REST를 사용하여 브라우저에서 Azure Service Bus 주제 구독을 읽는 대신에 다른 방법을 찾으려고합니다. SignalR처럼 자연 스러울 것 같지만 그걸 해낸 사람을 찾을 수없는 것 같습니다. 저는 스케일 아웃에 대해 이야기하는 것이 아니라, 서비스 버스 기능 세트를 브라우저 앞뒤로 중계하는 SignalR 허브에 불과합니다. 내가 비동기를 시작할 것 addReceiver(string topic, string subscriptionID);
defineSubscription(string name, string subscriptionRule);
deleteSubscription(string name);
postMessageToTopic(string topic, string message);
addReceiver 구독에 수신과 같은 기능을 생각 해요. 서비스 버스에서 메시지를 사용할 수있게 될 때마다 함수가 JS 클라이언트에서 호출됩니다. 당신의 허브 코드를 직접 메시지를 보낼 수있는 서비스 버스 API를 호출하거나 직접 자바 스크립트/브라우저에서 서비스 버스 API를 사용할 수 있습니다에서Azure 서비스 버스 전송으로 SignalR을 어떻게 사용할 수 있습니까?
1
A
답변
2
다음은 올바른 방향으로 사람을 가리 키도록 일부 코드입니다.
namespace SBTester
{
public class SBHub : Hub
{
public void AddReceiver(string topic, string subscriptionName, string subscriptionFilter)
{
string messageData;
TopicConnector.Initialize( topic,
Context.ConnectionId + "." + subscriptionName,
subscriptionFilter);
// Initiate receive loop on Service Bus
TopicConnector.SBClient.OnMessage((receivedMessage) =>
{
try
{
// Process the message
messageData = receivedMessage.GetBody<string>();
Clients.Caller.onMessage(topic, messageData);
}
catch
{
// Handle any message processing specific exceptions here
}
});
}
public void DefineSubscription(string topic, string subscriptionRule)
{
// Call Service Bus to create Subscription on the Specified topic
}
public void PostMessageToTopic(string topic, string message)
{
// Call Service Bus to send a message
Clients.All.addNewMessageToPage(topic, message);
}
}
}
0
관련 문제
- 1. Azure App 서비스 버스 서비스
- 2. Azure 서비스 버스 큐 수
- 3. Azure 서비스 버스 속도
- 4. Azure 서비스 버스 대안
- 5. Azure 서비스 버스 및 트랜잭션
- 6. Azure 서비스 버스 릴레이 보안
- 7. Azure 서비스 버스 메시지 펌프
- 8. Azure 서비스 버스 릴레이 성능
- 9. Azure 서비스 버스 중계 지침
- 10. Azure 서비스 버스 보안시 휴식시
- 11. Azure 서비스 버스 대기열에있는 메시지 수 결정
- 12. Azure 서비스 버스 속성 필터
- 13. embarasingly 병렬을위한 Azure 서비스 버스
- 14. Windows Azure 서비스 버스 청구
- 15. Azure 서비스 버스 호스팅 REST 서비스
- 16. Java에서 Azure 서비스 버스 사용
- 17. Azure 서비스 버스 대기열 읽기
- 18. Azure 서비스 버스 읽기 성능
- 19. 윈도우 Azure 서비스 버스 대기열 :
- 20. Azure 서비스 버스 직렬화 유형
- 21. Azure 서비스 버스 큐 디자인
- 22. Azure 서비스 버스 엔티티 처리량
- 23. Python 및 Azure 서비스 버스
- 24. Azure 서비스 버스 - ScheduledEnqueueTimeUtc가있는 TTL
- 25. Azure 서비스 버스 중계 장치 및 node.js
- 26. Azure 서비스 버스 ACS 발급자와 키가 누락되었습니다.
- 27. Azure 서비스 버스 주제 크기 변경
- 28. 서로 다른 azure 서비스 버스 네임 스페이스의 다중 구독 수신
- 29. Azure 서비스 버스 큐를 WCF와 함께 사용할 때의 이점
- 30. Azure 서비스 버스 클라이언트 연결 지속성
감사합니다. Abhishek. 누군가가 이미 서비스 버스를 호출하기 위해 Hub 코드를 구현했으면합니다. (Microsoft는 이것을 고려해야합니다!) Damir Dobric의 자료는 훌륭하지만 ServiceBus와 통신하기 위해 REST API를 사용합니다. – PrgTrdr