简体   繁体   中英

Using JMS to put a Message in a MQ Queue And Consuming Message by SPLUNK

Im trying to put a message in a MQ Queue. Here is my source code:

        QueueConnection queueConn;
        QueueSession queueSession;
        QueueSender queueSender;

        queueConn = connectionFactory.getConnection();
        queueSession = queueConn.createQueueSession(false,
                Session.AUTO_ACKNOWLEDGE);
        queueSender = queueSession.createSender(queueSession
                .createQueue(KEY_CONFIG_QUEUE_NAME));
        queueSender.setDeliveryMode(DeliveryMode.NON_PERSISTENT);

        TextMessage message = queueSession.createTextMessage(logBase);

        queueSender.send(message);

I don't have the source code from the queue consumer, that is the one who sends the messages to SPLUNK. But at SPLUNK console, I could realize that the message is composed by JMS HEADER + my text message (logBase).

Id like the messages without JMS Header. Could someone help me to understand where the problem is? Could be at consumer? Maybe a wrong or missing SPLUNK config??

Assuming that you cannot change the source code at the consumer, there is a way to administratively do this. You can change the queue definition so that these message properties are not given to the getting application.

ALTER QLOCAL(q-name) PROPCTL(NONE)

Related Links

If you able and happy to change the producer, you could look into the Target Client property of the MQ JMS destination.

This informs the JMS client that the consuming application is not a JMS app so it removes the extra headers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM