JMS message listener invoker failed, Cause: Identifier contains invalid JMS identifier character '-': 'x-request-id'

Omar Bahir :

I'm working with JMS and queues (Azure queues) for the first time. I'm required to make a queue where Rubi server would write some data and Java would read it from queue and will do further executions. This process is working fine locally on my machine. I've created a REST endpoint which is writing data in the queue and once data is written in the queue, the listener would take over and read the data and execute. When we deploy it to Azure the error I can see in logs which is not letting the Queues start is

Setup of JMS message listener invoker failed for destination 'queue' - trying to recover. Cause: Identifier contains invalid JMS identifier character '-': 'x-request-id' 

Zipkin is also present on the Azure server as a distributed tracing system and I guess this x-request-id is related to Zipkin which is creating the problem. I've searched Google for the issue but couldn't understand why its happening.

Following is detailed error message:

[36mc.m.s.l.NextGenRequestLoggingFilter     [0;39m [2m:[0;39m 
Before request [uri=/services/deal-service/api/v2/deals/ack;headers= 
[x-request-id:"2d8d86d7-4fbf-9db6-8e95-28813f21a85c", 
x-envoy-internal:"true", x-b3-parentspanid:"a209cdc649b0b890", content- 
length:"575", x-forwarded-proto:"http", postman-token:"ad074595- 
76a5-474b-9711-7e071b12b3b0", x-b3-sampled:"1", x-forwarded- 
for:"10.244.2.1", accept:"*/*", 
authorization: "some-token-YJc4tg--34jPRziJNSACqNQ", x-b3- 
traceid:"6b40ff22781be67ba209cdc649b0b890", x-b3- 
spanid:"702684ddb62cfe6b", 
host:"portal-gateway.52.228.65.225.nip.io", 
cache-control:"no-cache", accept-encoding:"gzip, deflate, br", 
user-agent:"PostmanRuntime/7.22.0", 
Content-Type:"application/xml;charset=UTF-8"]]
2020-02-18T15:19:34.197666458Z [2m2020-02-18 15:19:34.197[0;39m  . 
[32mDEBUG 
[,6b40ff22781be67ba209cdc649b0b890,702684ddb62cfe6b,true][0;39m  . 
[35m9[0;39m [2m---[0;39m [2m[ XNIO-1 task-15][0;39m
user11377504 :

From the error message its obvious that you are using qpid JMS client for communication through queues. qpid client won’t allow any keys which violates java variable naming convention e.g. you won’t be able to send x-request-id in a queue’s header which qpid jms client is consuming as it’ll throw error. You need to take care of istio/zipkin to not to add certain headers (id you don’t need them actually) with the queue when its trying to communicate on azure bus. So you have to disable the istio/zipkin libraries to intercept the request for queues so that request to/from queue can be made without headers. This will fix the issue.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=4264&siteId=1