我目前正在使用Spring的JMS消息(JMSTemplate)的應用程序。應用程序需要將消息發送到無法解密JMSTemplate附加到消息的「RFH」頭的大型機隊列。有沒有一種方法可以完全刪除所有標題信息,這樣大型機就可以在沒有標題的情況下獲取消息的原始內容?Spring JMS模板 - 刪除RFH頭信息
這裏是我的代碼...
MQQueueConnectionFactory connectionFactory = new MQQueueConnectionFactory();
connectionFactory.setHostName("127.0.0.1");
connectionFactory.setPort(1414);
connectionFactory.setChannel("S_LOCALHOST");
connectionFactory.setQueueManager("QM_LOCALHOST");
connectionFactory.setTransportType(1);
UserCredentialsConnectionFactoryAdapter credentials = new UserCredentialsConnectionFactoryAdapter();
credentials.setUsername("");
credentials.setPassword("");
credentials.setTargetConnectionFactory(connectionFactory);
JmsTemplate jmsTemplate = new JmsTemplate(credentials);
jmsTemplate.setPubSubDomain(false);
jmsTemplate.setDeliveryMode(javax.jms.DeliveryMode.NON_PERSISTENT);
jmsTemplate.setExplicitQosEnabled(true);
jmsTemplate.setReceiveTimeout(60000);
jmsTemplate.convertAndSend("MY.QUEUE", "cobol data");
以下是消息的樣子在WebSphere MQ資源管理。我怎樣才能刪除這些值? Spring JMS甚至有可能嗎?還是讓我知道如果你需要任何詳細信息...
謝謝很多ck1,你的第一個片段似乎已經做到了!關於第二個片段的問題,我已經看到其他帖子提到設置targetClient,但我不知道這是什麼類型的Queue對象,你能給我你說的那個隊列對象的完全限定包名嗎? – Jason