Friday, March 9, 2012

remote message being classified as local

Hi

I am trying to deploy our service broker application into our live enviroment. I have been using the excellent service listings manager to configure security and routes when deploying to our test enviroments and had no problems. However, after having gone through the same steps in live, i can not get it working.

The messages I try sending from the remote initiating service arrives at the target service, but the ack is not sent back from the target service. I have used profiler to find out what is going on and noticed that on the target after the ack is received, a broker:message classify event occurs with an event sub class of 1 - Local. It then starts going through lots of broker: Message undeliverable events. From what I understand this means that the target service has classified that the reply to the message should be sent to a local service instead of a remote service which is not the case.

I think the remote route is set up correctly on the target server. I have run this query on the target server after one message has been sent

select r.*

from sys.conversation_endpoints e

inner join sys.routes r on e.far_service = r.remote_service_name and e.far_broker_instance = r.broker_instance

and it returns the row from sys.routes that points to the initiating service.

Can anybody help with what else I can do to solve this problem?

Antony

something very strange was going on in my server.

A few days after this happened, all messages stopped being sent on the target server (even local ones between databases on the server)

I restarted sql server and everything started working - the remote messages started being classified as remote again and were sent correctly back to the initiating service.

I guess somehow service broker had got corrupted in this instance, though there were no dumps or error messages about this.

|||

Can you send the ERRORLOG from the time it run with the problem to remus.rusanu@.microsoft.com ?

Thanks,
~ Remus

|||

anthony_brown wrote:

The messages I try sending from the remote initiating service arrives at the target service, but the ack is not sent back from the target service. I have used profiler to find out what is going on and noticed that on the target after the ack is received, a broker:message classify event occurs with an event sub class of 1 - Local. It then starts going through lots of broker: Message undeliverable events. From what I understand this means that the target service has classified that the reply to the message should be sent to a local service instead of a remote service which is not the case.

One thing to keep in mind is that incomming message from the wire are normally actually classified 'LOCAL'. The process is described in BOL: http://msdn2.microsoft.com/en-us/library/ms166052.aspx When an incomming message arrives on an instance, it is classified in the MSDB database to find the destination service. Typically the AutoCreatedLocal route in msdb.sys.routes will expose all services on every database in the instance to the incomming message. As such, the result of this classification will be '1 - Local' but the DatabaseId of the event will be '4' (msdb). This is the correct and expected behavior of a typical deployment.

HTH,
~ Remus

No comments:

Post a Comment