IBM队列管理器覆盖了MQMD中的用户标识值。

huangapple go评论78阅读模式
英文:

IBM Queue Manager over writing the value of User Identifier in MQMD

问题

我们正在尝试使用JMS向IBM MQ写入消息,我们能够写入消息,但注意到MQMD中的UserIdentifier字段被QM管理器覆盖。

我们尝试了以下两个属性来设置用户标识:

message.setStringProperty(JmsConstants.JMS_IBM_MQMD_USERIDENTIFIER, "ourUserID");
message.setStringProperty("JMSXUserID", "ourUserID");

在设置用户ID之前,我们还有以下属性:

message.setBooleanProperty(WMQConstants.WMQ_MQMD_WRITE_ENABLED,true);
message.setIntProperty(WMQConstants.WMQ_MQMD_MESSAGE_CONTEXT,WMQConstants.WMQ_MDCTX_SET_ALL_CONTEXT);

此外,队列管理器和队列也具有所需的配置:

+setall +setid +passall

但仍然无法获得所需的结果。在这里我们可以做些不同的事情吗?

英文:

We are trying to write a message to IBM MQ using JMS, we are able to write the message but notice that the field UserIdentifier in MQMD is getting over-written by the QManager.

We've tried both these properties to set user id,

message.setStringProperty(JmsConstants.JMS_IBM_MQMD_USERIDENTIFIER, "ourUserID");
message.setStringProperty("JMSXUserID", "ourUserID");

We also have these properties before setting the User id,

message.setBooleanProperty(WMQConstants.WMQ_MQMD_WRITE_ENABLED,true);
message.setIntProperty(WMQConstants.WMQ_MQMD_MESSAGE_CONTEXT,WMQConstants.WMQ_MDCTX_SET_ALL_CONTEXT);

also the Queue Manager and Queue have the required configuration,

+setall +setid +passall

but still we are unable to get required result. What can we do different over here ?

答案1

得分: 2

这是我程序的一部分:

MQQueue d = (MQQueue)destination;
String altusr="myuserid";
d.setMQMDWriteEnabled(true);
outMsg.setBooleanProperty(MQConstants.WMQ_MQMD_WRITE_ENABLED, true);
outMsg.setStringProperty(CommonConstants.JMS_IBM_MQMD_USERIDENTIFIER, altusr);
d.setIntProperty(MQConstants.WMQ_MQMD_MESSAGE_CONTEXT, MQConstants.WMQ_MDCTX_SET_IDENTITY_CONTEXT);

如果您使用的是JMSContext API模型而不是较旧的createSession()方法,可能只有这样才能正常工作,因为这也会影响底层的MQOPEN或MQPUT1何时发生。这反过来会影响上下文设置标志是否被引用。

英文:

This is an extract from one of my programs:

MQQueue d = (MQQueue)destination;
String altusr="myuserid";
d.setMQMDWriteEnabled(true);
outMsg.setBooleanProperty(MQConstants.WMQ_MQMD_WRITE_ENABLED, true);
outMsg.setStringProperty(CommonConstants.JMS_IBM_MQMD_USERIDENTIFIER, altusr);
d.setIntProperty(MQConstants.WMQ_MQMD_MESSAGE_CONTEXT, MQConstants.WMQ_MDCTX_SET_IDENTITY_CONTEXT);

It's possible that this only works if you are using the JMSContext API model rather than the older createSession() approach as that can also affect when the underlying MQOPEN or MQPUT1 happens. Which in turn affects whether the context-setting flags are referred to.

huangapple
  • 本文由 发表于 2023年7月3日 14:13:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/76602228.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定