且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

向MQ发送消息时如何删除默认的Spring JMS Template头?

更新时间:2023-11-22 16:35:16

弄清楚了.每当我们想从发送到WebSphere MQ的Spring JMS消息中删除标头时,请始终使用以下内容:

Figured it out. Anytime we want to remove headers from our Spring JMS message being sent out to a WebSphere MQ, always use the following:

this.jmsTemplate.convertAndSend("queue:///YOUR.QUEUE.NAME.HERE?targetClient=1", text);

所以现在我的函数如下:

So now my function looks like:

public void send(String text) {
        this.jmsTemplate.convertAndSend("queue:///MY.QUEUE.INFORMATION.TEST?targetClient=1", text);
}