public void init(XQInitContext initialContext) throws XQServiceException
{
if(condition = true)
{
Here I want to stop/destrroy the service. Need some suggestion how to achieve this. thanx in advance
}
}
The easiest way is to:
throw new XQServiceException("I don't want to start!!");
I tried throwing XQServiceException in init() method but service still intialized and listening to entry endpoint after throwing exception. Any other suggestion.
thanx
I'm using 7.6 and the service will correctly fail to initialize. This means that start() is never called and therefore the service doesn't consume messages. What version are you using?
The other way to do this is to store the exception on the service as state information and basically throw the exception within the service() invocation. As Jaime states this is fully supported out of the box in 7.6
With this approach, any messages placed on the service's Entry Endpoint will get consumed by the service. The unhandled exception (that is deliberately invoked) will move the message to the RME. This may or may not be the behaviour you're looking for. Whether the Entry Endpoint is a topic or a queue might also influence your decision here.
I am using 7.5.1. Still no success. Even after throwing XQServiceException. Any other suggestion
thanx