1

I figured I would toss a question on here incase anyone has ideas. My MQ Admin created a new queue and alias queue for me to write messages to. I have one application writing to the queue, and another application listening on the alias queue. I am using spring jmsTemplate to write to my queue. We are seeing a behavior where the message is being written to the queue but then instantly being discarded. We disabled gets and to see if an expiry parameter was being set somehow, I used the jms template to set the expiry setting (timeToLive). I set the expiry to 10 minutes but my message still disappears instantly. A snippet of my code and settings are below.

    public void publish(ModifyRequestType response) {

    jmsTemplate.setExplicitQosEnabled(true);
    jmsTemplate.setTimeToLive(600000);
        jmsTemplate.send(CM_QUEUE_NAME, new MessageCreator() {
            public Message createMessage(Session session) throws JMSException {

                String responseXML = null;
                try {
                    responseXML myJAXBContext.getInstance().toXML(response);
                    log.info(responseXML);
                    TextMessage message = session.createTextMessage(responseXML);
                    return message;
                } catch (myException e) {
                    e.printStackTrace();
                    log.info(responseXML);
                    return null;
                }


        }
    });
}

/////////////////My settings

QUEUE.PUB_SUB_DOMAIN=false
QUEUE.SUBSCRIPTION_DURABLE=false
QUEUE.CLONE_SUPPORT=0
QUEUE.SHARE_CONV_ALLOWED=1
QUEUE.MQ_PROVIDER_VERSION=6
vs97
  • 5,765
  • 3
  • 28
  • 41
Kachopsticks
  • 125
  • 1
  • 13

1 Answers1

0

I found my issue. I had a parent method that had the @Transactional annotation. I do not want my new jms message to be part of that transaction so I am going to add jmsTemplate.setSessionTransacted(false); before performing a jmsTemplate.send. I have created a separate jmsTempalte for sending my new message instead of reusing the one that was existing, which needs to be managed.

Kachopsticks
  • 125
  • 1
  • 13