|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
pub/sub issue when WMB6 migration to WMB7 |
« View previous topic :: View next topic » |
Author |
Message
|
gangbao |
Posted: Thu Jun 27, 2013 1:35 am Post subject: pub/sub issue when WMB6 migration to WMB7 |
|
|
Newbie
Joined: 27 Jun 2013 Posts: 2
|
Hi All:
Now I have one flow running on WMB6.0 and MQ7.0 env, then we need to update the WMB to 7.0 version. There is one flow using the publish node in WMB6. In order to make the pub/sub works, also we need to execute java command.
Quote: |
java com.ibm.txhub.util.PubSubManager -i $address -p $port -qm $qm -q $desQ -t $topic -c [pub/sub]
|
This tool could help us to make the $desQ to subscript the $topic, below is the source code related to the subscribe:
Code: |
public void addSubscription(String hostname, int port, String qmgrName, String clientQueuemanager, String qName, String topicName) {
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);
MQEnvironment.hostname = hostname;
MQEnvironment.channel = "MQMESHD0.WBRK61";
MQEnvironment.port = port;
MQEnvironment.CCSID = 1208;
try {
MQQueueManager qmgr = new MQQueueManager(qmgrName);
if ( clientQueuemanager == null) {
clientQueuemanager = qmgrName;
}
System.out.println( " clientQueuemanager:" + clientQueuemanager);
// open queue
int mqputOpt = MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_OUTPUT + MQC.MQOO_SET_ALL_CONTEXT;
MQQueue mqQueue = qmgr.accessQueue("SYSTEM.BROKER.CONTROL.QUEUE", mqputOpt);
// create message
MQMessage message = new MQMessage();
message.format = MQC.MQFMT_RF_HEADER_2;
String msgBody = "T";
// construct the MQRFH2 Header
//String psc = "<psc><Command>RegSub</Command><Topic>/Topic/Test1</Topic><QMgrName>WBRK61_DEFAULT_QUEUE_MANAGER</QMgrName><QName>SUBSCRIBE.OUT.1</QName><RegOpt>PersAsPub</RegOpt></psc>";
StringBuffer pscBuffer = new StringBuffer();
pscBuffer.append("<psc><Command>RegSub</Command><Topic>");
pscBuffer.append(topicName);
pscBuffer.append("</Topic><QMgrName>");
pscBuffer.append(clientQueuemanager);
pscBuffer.append("</QMgrName><QName>");
pscBuffer.append(qName);
pscBuffer.append("</QName><RegOpt>PersAsPub</RegOpt></psc>");
String psc = pscBuffer.toString();
MQRFH2 rfh2 = new MQRFH2(psc);
rfh2.setFormat(MQC.MQFMT_NONE);
rfh2.write(message);
message.writeString(msgBody);
// propagate
MQPutMessageOptions mqOptions = new MQPutMessageOptions();
mqOptions.options = MQC.MQPMO_VERSION_2;
mqQueue.put(message, mqOptions);
qmgr.commit();
mqQueue.close();
qmgr.close();
System.out.println(" Subscribe command submitted " );
} catch (MQException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
|
The issue is: I forgot to execute the Java tool before the upgrade, in another word, there is no subscriber for the $topic. Then after the upgrade done, this flow throws an error in the trace log.
Quote: |
No user action required.
2013-06-26 08:55:14.956844 14394 UserTrace BIP4142I: Evaluating cniElementSet'CharacterValue'. Changing value from '''MQSTR ''' to '''MQSTR'''.
Element ''CharacterValue'' has been changed to '''MQSTR'''.
No user action required.
2013-06-26 08:55:14.957472 14394 UserTrace BIP2638I: The MQ output node 'EInvoiceFlow.ARMS_Q' attempted to write a message to queue ''ESH.OUT.ARMS.ALIAS'' connected to queue manager ''''. The MQCC was '0' and the MQRC was '0'.
2013-06-26 08:55:14.957488 14394 UserTrace BIP2622I: Message successfully output by output node 'EInvoiceFlow.ARMS_Q' to queue ''ESH.OUT.ARMS.ALIAS'' on queue manager ''''.
2013-06-26 08:55:14.960482 14394 UserTrace BIP3904I: Invoking the evaluate() method of node (class='ComIbmJavaComputeNode', name='EInvoiceFlow#FCMComposite_1_3.EInvoiceProcesserFlow#FCMComposite_1_2').
About to pass a message to the evaluate() method of the specified node.
No user action required.
2013-06-26 08:55:14.960766 14394 UserTrace BIP4142I: Evaluating cniElementSet'CharacterValue'. Changing value from '''INPUT_PROCESS''' to '''OUTPUT_PROCESS'''.
Element ''CharacterValue'' has been changed to '''OUTPUT_PROCESS'''.
No user action required.
2013-06-26 08:55:14.960836 14394 UserTrace BIP4142I: Evaluating cniElementSet'CharacterValue'. Changing value from ''NULL character'' to '''/ESH/EINVOICE'''.
Element ''CharacterValue'' has been changed to '''/ESH/EINVOICE'''.
No user action required.
2013-06-26 08:55:14.960917 14394 UserTrace BIP4142I: Evaluating cniElementSet'IntegerValue'. Changing value from ''1208'' to '1208'.
Element ''IntegerValue'' has been changed to '1208'.
No user action required.
2013-06-26 08:55:14.960935 14394 UserTrace BIP4142I: Evaluating cniElementSet'IntegerValue'. Changing value from ''1208'' to '1208'.
Element ''IntegerValue'' has been changed to '1208'.
No user action required.
2013-06-26 08:55:14.960960 14394 UserTrace BIP4142I: Evaluating cniElementSet'CharacterValue'. Changing value from '''wbiadmn ''' to '''txhubuser'''.
Element ''CharacterValue'' has been changed to '''txhubuser'''.
No user action required.
2013-06-26 08:55:14.961083 14394 UserTrace BIP7080I: Node 'EInvoiceFlow.Publication.ComIbmPSService': The Publication Node with Subscription Point '''' has received a message of type 'Publish'.
The Publication Node with Subscription Point '''' has started processing a message.
No user action required.
2013-06-26 08:55:14.962535 14394 UserTrace BIP7086I: Node 'EInvoiceFlow.Publication.ComIbmPSService': The Publication Node with Subscription Point '''' has received an error code 2035.
The Publication Node with Subscription Point '''' has received an error with code 2035. No response message has been sent as one was not requested.
No user action required.
2013-06-26 08:55:14.964202 14394 Error BIP2628E: Exception condition detected on input node 'EInvoiceFlow.EINVOICE_IN'.
The input node 'EInvoiceFlow.EINVOICE_IN' detected an error whilst processing a message. The message flow has been rolled-back and, if the message was being processed in a unit of work, it will remain on the input queue to be processed again. Following messages will indicate the cause of this exception.
Check the error messages which follow to determine why the exception was generated, and take action as described by those messages.
2013-06-26 08:55:14.964251 14394 RecoverableException BIP2230E: Error detected whilst processing a message in node 'EInvoiceFlow.Publication.ComIbmPSService'.
The message broker detected an error whilst processing a message in node 'EInvoiceFlow.Publication.ComIbmPSService'. An exception has been thrown to cut short the processing of the message.
See the following messages for details of the error.
2013-06-26 08:55:14.964257 14394 ImbPubSubEngineNode::publish 'MQ error opening topic handle' , 2035, '/ESH/EINVOICE', 2
2013-06-26 08:55:15.966057 14394 Error BIP2648E: Message backed out to a queue; node 'EInvoiceFlow.EINVOICE_IN'.
Node 'EInvoiceFlow.EINVOICE_IN' has received a message which has previously been backed out one or more times because of a processing error in the main path of the message flow. The failure terminal is not attached, so the message broker is putting the message directly to the requeue or dead letter backout queue associated with this node. The MQMD 'backoutCount' of the message now equals the 'backoutThreshold' defined for the WebSphere MQ input queue.
Examine previous messages and the message flow to determine why the message is being backed out. Correct this situation if possible. Perform any local error recovery processing required.
2013-06-26 08:55:15.966810 14394 UserTrace BIP2638I: The MQ output node 'EInvoiceFlow.EINVOICE_IN' attempted to write a message to queue ''DEAD.LETTER'' connected to queue manager ''MQMESHD0''. The MQCC was '0' and the MQRC was '0'.
2013-06-26 08:55:15.966829 14394 UserTrace BIP2615I: The WebSphere MQ input node 'EInvoiceFlow.EINVOICE_IN' has backed out the message to the backout requeue or the dead letter queue.
Message backout processing has been invoked, and the message has either been backed out by being written to the backout requeue or dead letter queue, as determined by the WebSphere MQ queue manager and queue configuration.
No user action required.
2013-06-26 08:55:26.273174 15422 UserTrace BIP2632I: Message received and propagated to 'out' terminal of MQ input node '.InputNode'.
2013-06-26 08:55:26.273388 15422 UserTrace BIP6060I: Parser type ''Properties'' created on behalf of node '.InputNode' to handle portion of incoming message of length 0 bytes beginning at offset '0'.
2013-06-26 08:55:26.273426 15422 UserTrace BIP6061I: Parser type ''MQMD'' created on behalf of node '.InputNode' to handle portion of incoming message of length '364' bytes beginning at offset '0'. Parser type selected based on value ''MQHMD'' from previous parser.
2013-06-26 08:55:26.273534 15422 UserTrace BIP6061I: Parser type ''XMLS'' created on behalf of node '.InputNode' to handle portion of incoming message of length '211' bytes beginning at offset '364'. Parser type selected based on value ''XMLS'' from previous parser.
2013-06-26 08:55:26.274070 15422 Information BIP2152I: Configuration message received from broker.
An execution group received a command from the Broker.
No user action required.
2013-06-26 08:55:26.274214 15422 Information BIP2153I: About to ''change'' an execution group.
An execution group is about to perform an action.
No user action required.
|
The flow throws an 2035 error, then I tried to give the authority to the user below:
Quote: |
setmqaut -m <QMGR> -t qmgr -p <user> +connect +inq +dsp +setid +setall
setmqaut -m <QMGR> -n "**" -t q -p <user> +browse +inq +dsp +get +put +set +setid +setall
setmqaut -m <QMGR> -n SYSTEM.** -t q -p <user> +browse +inq +dsp
setmqaut -m <QMGR> -n SYSTEM.ADMIN.COMMAND.QUEUE -t q -p <user> +put +browse +inq +dsp
setmqaut -m <QMGR> -n SYSTEM.MQEXPLORER.REPLY.MODEL -t q -p <user> +get +inq +dsp
setmqaut -m <QMGR> -n SYSTEM.DEFAULT.MODEL.QUEUE -t q -p <user> +get +inq +dsp +put
setmqaut -m <QMGR> -n SYSTEM.CLUSTER.TRANSMIT.QUEUE -t q -p <user> +get +inq +dsp +put +browse +setall
setmqaut -m <QMGR> -n SYSTEM.DEAD.LETTER.QUEUE -t q -p <user> +get +inq +dsp +put +browse +setall
setmqaut -m <QMGR> -n SYSTEM.BROKER.** -t q -p <user> +get +inq +dsp +put +browse
setmqaut -m <QMGR> -n "**" -t channel -p <user> +dsp
setmqaut -m <QMGR> -n SYSTEM.DEF.CLNTCONN -t clntconn -p <user> +dsp
setmqaut -m <QMGR> -n "**" -t listener -p <user> +dsp
setmqaut -m <QMGR> -n "**" -t process -p <user> +dsp +inq
setmqaut -m <QMGR> -n "**" -t topic -p <user> +dsp
setmqaut -m <QMGR> -n "**" -t authinfo -p <user> +dsp
setmqaut -m <QMGR> -n "**" -t namelist -p <user> +dsp
setmqaut -m <QMGR> -n "**" -t service -p <user> +dsp
|
but not effect. And there are some other flows using the Publish node in WMB6 too, meanwhile, this flows execute the java code mention above to make the sub queue could get the message, after the upgrade, these flows works fine too. So I think the root reason is I forgot the execute the Java code. Can anyone have any suggestion about this issue for what should I do to fix up this issue after the upgrade has done? |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jun 27, 2013 2:56 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Change the broker flow to set MQMD.UserId = NULL before you call the Publication node.
The Publication node uses the MQMD User name field as the identity that is publishing the message. This is actually likely behavior that you want, but it requires that you know all possible users and then grant them very specific authorizations to the topics.
If you set the userid to NULL, then the message is published as the broker service user.
You could, and probably should, set the user id to a known fixed value for the application being serviced by the publishing flow, and then grant permissions to the relevant topic objects for that user. |
|
Back to top |
|
 |
gangbao |
Posted: Thu Jun 27, 2013 5:45 am Post subject: |
|
|
Newbie
Joined: 27 Jun 2013 Posts: 2
|
mqjeff, thanks a lot!. According to your reply, I checked the flow code and found it hard coded the user identity to 'txhubuser' which is not even a user on the server! So it has no authority to connect the QM. I commented this code and it works.
And I checked why it worked in the MQ6 and WMB6 env, I checked MQ6 infor center and found dspmqaut command and dmpmqaut command, these two command has no -t topic like parameters in version 6 but it does support topic parameter in version 7, is that means the authority about object topic is not supported in version 6. Although 'txhubuser' is not a valid user on server, it could not effect the result. But in version 7, it goes wrong..
Am I right? If not, please point out the root cause, thank you very much again. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jun 27, 2013 5:49 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
That's a reasonably correct understanding.
the pub/sub broker in v6 did not have as stringent security controls as the one in v7 and later. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|