【发布时间】:2016-11-07 20:14:02
【问题描述】:
我目前正在开发一个使用 Spring 的 JMS 消息传递 (JMSTemplate) 的应用程序。应用程序需要将消息发送到无法解密 JMSTemplate 附加到消息的“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 Explorer 中的样子。如何删除这些值? Spring JMS 甚至有可能吗?如果您需要更多信息,请告诉我...
【问题讨论】: