1
votes

Use-Case: I'm sending a request to IBM MQ Listener from Spring Boot App with Apache camel, while sending I have to change the MQ JMS Property JMS_IBM_Character_Set=UTF-8 but these changes are not reflecting at Listener side

Could anyone please help me how to change the property value for IBM MQ with Apache Camel

// Request Queue - one direction

@Component
public class RequestRouter extends RouteBuilder {

    @Override
    public void configure() throws Exception {

        from("direct:request").
        setProperty("JMS_IBM_Character_Set", constant("true")).
        to("jms:REQUEST.Q1?disableReplyTo=true")
        .log("Received Body is  ${body}   and header info is   ${headers}  "); 
    }
}

// Below one Request-Reply Queue

@Component
public class RequestReplyRouter extends RouteBuilder {

    @Override
    public void configure() throws Exception {

        from("direct:request-reply").setProperty("JMS_IBM_Character_Set", constant("true"))
                .to("log:like-to-see-all?level=INFO&showAll=true&multiline=true")
                .to("jms:REQUEST.Q1?ReplyTo=REPLY.Q1&exchangePattern=InOut")
                .log("Request-reply Body is  ${body}   and header info is   ${headers}  ");

        from("jms:REPLY.Q1")
                .log("Received Body is  ${body}   and header info is   ${headers}  ");
    }

}
1
You want 37 not UTF-8 right?JoshMc
Could you elaborate on how you know it is not reflected at the Listener side?Morag Hughson
i wanna use UTF-8Srikanth Janapati
MyApp (Produce Q1) ---------------- >OtherApp(Q1 -Listener) MyApp(Q2 Listener)<------------ Other App(Q2 -Produce) I'm setting these headers in MyApp Q1, Other App placing header from Q1 to Q2 and forwarding to the Q2 Listener, in MyApp Q2 Listener i'm not getting expected headers.Srikanth Janapati
JMS default is UTF-8, I think you want camel also to send in 37, I explained this in your first question.JoshMc

1 Answers

1
votes

When I put a message on IBM MQ with JMS client in 2017 i could not make it. I changed jms client to IBMMQ.jar in order to put a message with header. I suggest you that you can read JMS document on Apache camel site. Also, try to use "allowAdditionalHeaders"