nservicebus - In pub/sub model, how to make Subscriber pause processing based on some external state? -


I require the subscriber to stop processing to process messages, depending on whether the Web service is up or not is. Therefore, when the web service diminishes, the message should come from the publisher's subscriber queue and until the web service is back again (these messages should not go to the error queue, but the subscriber must remain on the queue.)

I tried to use unsubscribe, but the publisher stops sending messages because membership ends on RavenDB to clear the subscription informationI have also attempted to set up the MaxConcertarian level on the transport class, if I set the worker thread to 0, then the incoming subscriber messages go straight to the error queue. Finally, I tried Defer, which looks at the current message in the queue of the audit and creates a clone of the message and sends it locally to the customer queue upon completion from time to time. Apart from this, since I have to check the status of the service and keep on defending, I can not control the order of messages because I can not predict when the web service will be.

What is the best way to explain the behavior? I am using NServiceBus version 4.5.

It seems as if you want to keep trying to handle a message until it succeeds And do not turn it back in the queue (keep it up and keep trying)?

I think your only pure-NSB option is to tinker with MaxRightage setting, which controls the first level retries: Setting MaxRetries in a very high number, do what's for you But I can not imagine doing so would be a good practice.

Second level retries will postpone messages for one time configuration volume, but IIRC will allow other messages to be controlled by the main queue.

I think your best option is to try to retry in your own code.

Edit: Then the handler throws any exposure and can try to reach the Service X number in the loop (maybe on delay) before throwing the exception of the NSB.

Your requirement seems to be something like this:

"When someone comes to a mage, I need to call a webservice. If the web service is off, So many times at the X number Y interval, I will consider a failure at that point and handle the situation of failure. Unless I succeed or fail, I will stop controlling other messages. "

You have some potentially complex one message (try again, time Received, error conditions, logic allows to block additional messages, etc.). Keep in mind that NSB has a role to play in your system: communication through messaging services. While NSB has some advanced features that allow message orchestration (such as SAGAS), it is not actually used to change the domain or application logic.

The bottom line is, you may need to write custom code to handle your code typical scenario would be a loop with a Bholedar solution delay your handler, but to create a more robust memory store / queue May be required, which holds the message, while the service is down and executes them in sequential order when it comes back up.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -