Endpoint Lifecycle

I’m looking for an extension point in the Endpoint initialisation lifecycle where I can execute some code after the endpoint is started (and MessageSession is available) but before messages are fetched from the queue and processed. Is there anything like this available or could you suggest some way of achieving this? Thanks!

Hi

You can use Features and FeatureStartupTasks to solve your problem. May I ask what specific scenario you have in mind?

Cheers,
Szymon

Hi there,
Thanks for your reply!
We have a component that needs access to the NSB endpoint for sending messages - however once initialised it will start receiving callbacks, via a separate protocol, and processing them, in some cases dispatching a message via the NSB endpoint.
At the same time the NSB is processing messages from the queue. The handlers for some of these need an instance of the other component to complete message processing. So there is a chicken and egg scenario.
Ideally our initialisation sequence would be:

  • Start the endpoint but not take messages from the queue

  • Initialise the other component

  • Start fetching messages from the queue.

At the moment we start the NSB endpoint, then initialise the other component. This results in a few failed attempts to use the uninitialized component as the endpoint starts processing messages before it has all the dependencies needed to complete the handling. Not the end of the world as the handling is retried and will succeed when the other component initialization is complete. It’s not very elegant though!