2

NServiceBus で作成された一連のイベント メッセージを、単純な認証済み REST API を介してサード パーティに公開する必要があるシナリオがあります。サード パーティは .NET を使用している場合と使用していない場合があります (さらに、ブラウザーの JavaScript である場合もあります)。

pub/sub がプッシュ メカニズムであることは理解していますが、ポーリング メカニズムを探しています。これは NServiceBus でも可能ですか? これはアダプタの目的ですか、それとも受信メッセージを受け入れるためですか?

4

1 に答える 1

3

Typically you would not want to expose your service bus to third parties. You could manage to have some transport deliver to subscribers but then you would be sending an internal structure to the outside world. You also did mention that you need a pull mechanism via a REST interface.

What I would suggest is to have a subscriber within your service bus that listens to the relevant messages and then either saves them in a serialized form in a type of 'event store' or de-normalizes them into the resources that the REST interface would expose. These messages/resources would contain the relevant date/time stamp.

It would be up to the consumer of the REST API to specify some point in time to retrieve the resources from. So the third party would simply keep track of when last they retrieved the data. Of course they could retrieve as much as they need and new 'subscribers' would be able to retrieve the entire history if required. Each message/resource should also have a GUID of sorts to be able to aid idempotence.

于 2013-03-14T10:42:42.383 に答える