We are trying to migrate our esb to azure service bus. We have messages posting to the service bus, and have wcf services that are attached to subscribers to process the message. After we migrate the bus, we are moving off wcf to azure functions, but for the time being, we have code that taps into the subscriber (on app start in global.asax), gets the message and forwards it to the wcf endpoint implementation. One of our messages is going to the dead letter queue only on our production environment, all the other environments seem to work for the same message. When I inspect the DeatLetterReson and Description, it just says maximum delivery count has been exceeded. We added logging on the first line after OnMessage, trying to see if there is an application error that is causing this, but that doesn’t get logged. I took the payload from prod and sent it through to our dev environment (thinking there could be weird data config issues) and the message is received. Also, other messages can be consumed on prod, and I can hit the wcf endpopint, if there was a connection issue, I would usually see it when trying to hit the endpoint (when the subscriber connects to the service bus).
Is there any way to do further debugging to see why the message is going to the dead letter queue? I was thinking since the subscriber is pulling, the service bus has no way of knowing why the message can’t be completed, but I don’t know where to log in the application to determine why. Like I said, I added logging on the first line of the on message, checked iis logs, and seems to work in other environments, and also in prod for other messages…
Any suggestions would be greatly appreciated!
CodePudding user response:
It ended up being a port not opened, and was trying to be used when the payload was larger than 65kb, not sure why it was only being introduced when the payload hit 65kb. Couldn't find any errors being thrown, but getting this testing the ports from the server:
[SocketException (0x274c): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond ...:9354] System.Net.Sockets.Socket.InternalEndConnect(IAsyncResult asyncResult) 6682835 System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult) 88 System.ServiceModel.Channels.ConnectAsyncResult.OnConnect(IAsyncResult result) 103
After opening up the ports, it seems to work fine.