I'm new to IIB 9.0 and I've been googling around but I wasn't able to find a good solution on how to add a custom/named property to a MQ message in IIB 9.0 message flow.
In IBM Integration Toolkit, there are two header nodes that can be used in designing a message flow, JMSHeader and MQHeader. The JMSHeader allows me to add new custom (application) properties to the JMS message with no issues. However, the MQHeader, doesn't seems to have the same functionality. I have no issues adding a named property to an MQ message using the sample program, amqsstm, that comes with MQ installation.
AIX/Unix: $MQ_HOME/samp/bin/amqsbcg / amqsstm
Windows: $MQ_HOME\tools\c\Samples\Bin\amqsbcg.exe / amqsstm.exe
In theory, it's probably possible that I can transform the MQ into JMS message then use JMSHeader to add the custom property (using application properties option) then convert it back. But there got to be a better solution than this.
Thanks,
Ron
The message properties are stored in the RFH2 header:
https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_7.5.0/com.ibm.mq.ref.dev.doc/q104190_.htm
For example, when a IBM WebSphere MQ application attempts to access
the Property1 property, this maps to the Property1 element in the
usr folder. The wmq.Property2 property maps to the Property2
property in the wmq folder.
So I'd try setting them using ESQL:
https://www.ibm.com/support/knowledgecenter/en/SSMKHH_9.0.0/com.ibm.etools.mft.doc/ac16910_.htm
Related
Hi everyone one,
On my project, we are developing a spring boot application which is using JCo3.
It works fine for calling SAP from JAVA.
Now we are enhancing this application and we want to create a Jco server.
It will have to communicate with 2 different SAP system.
Each system have its own message server.
We customize each message server with several logon group according to our needs.
So we have created 2 classes to build up 2 Jco server one per system.
For server class, we hae base our development upon this blog:
https://blogs.sap.com/2017/08/25/sap-jco-server-example/
So we use a ServerDataProvider to use the parameters below
jco.server.connection_count=2
jco.server.progid=JCO_SERVER_SAP
jco.server.repository_map=SID(020)=S4
jco.server.mshost=myslanaddress.com
j
co.server.msserv=3601
jco.server.system_id=SID
We have 2 files to specify these parameters one per SAP system
The other system wil use a different progid.
When starting our application, everything goes well for the first bean instanciation.
As soon we arrived on the other, when trying to create the new Jco server
with for instance new progid JCO_SERVER_SAP and with new message server info)
with (server = JCoServerFactory.getServer(properties.getProperty(ServerDataProvider.JCO_PROGID));
The Constructor threw this exception; nested exception is com.sap.conn.jco.JCoRuntimeException: (136) JCO_ERROR_ILLEGAL_STATE: JCoServer JCO_SERVER_SAP is currently running. Current server state is STARTED
It is strange because in debug the progId is JCO_SERVER_CAR and not JCO_SERVER_SAP..
I foun this message (https://answers.sap.com/questions/12862862/how-to-implement-a-jco3-server-with-multiple-diffe.html) but I don’t know how to build such solution.
Do you have any clue ?
Thanks in advance for any help.
I tried to create and use
jco.server.repository_map
but it do not work.
I have installed the docker version of IBM MQ based on the following link
https://developer.ibm.com/tutorials/mq-connect-app-queue-manager-containers/
Then I created new topic with the following specs:
Name: PROD.TEST
Topic string: dev/test/
Then from C# client I am using dev/test/ to create subscriber to the created topic:
destination = sessionWMQ.CreateTopic(env.Conn.topic_name); subscriber
= sessionWMQ.CreateConsumer(destination);
For some reason if the Topic name doesn't start with DEV. the second line throws the following exception:
XMSException caught: IBM.XMS.IllegalStateException: Failed to
subscribe to topic dev/test/ using MQSUB. There may have been a
problem creating the subscription due to it being used by another
message consumer. Make sure any message consumers using this
subscription are closed before trying to create a new subscription
under the same name.
Linked Exception : CompCode: 2, Reason: 2035
To get you started quickly, container image of MQ's developer edition pre-authorises a user called "app" to be able to connect to the queue manager and access a set of predefined queues and topics. These are the DEV.* queues and the "dev/" branch of the topic tree through the DEV.BASE.TOPIC definition. This is explained here
You can then build on this by adding queues and topics and granting access to these as you require.
To do this with MQ's CLI (runmqsc) you would use the SET AUTHREC command. Or to use the web interface you would click on the configuration of the new topic and select the security tab. You'll need to grant publish or subscribe authority depending on what the application wants to do.
Obviously, this just gets you going, as you move forward you'll want to review the security requirements and decide how to configure MQ to provide this.
I am using TIBCO Business works so I can't directly us JMS API and I can only set the input to the API. Below is the MQ queue URI I have created but I get an error when the application tries to get handle to queue during runtime.
queue://QManager/QName?targetClient=1&mdWriteEnabled=true&mdMessageContext=1
Error I am getting
caused by: com.tibco.plugin.share.jms.impl.JMSExceptionWrapper: com.ibm.msg.client.jms.DetailedJMSException: JMSCC0005: The specified value '??1' is not allowed for 'mdMessageContext'.
The given value is not allowed for the property specified.
Change the value to a value that is supported for the property.
According to IBM knowledge article, the value I am setting for mdMessageContext is correct. below are the links to the Knowledge article.
https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q032350_.htm
https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_8.0.0/com.ibm.mq.javadoc.doc/WMQJMSClasses/constant-values.html#com.ibm.msg.client.wmq.common.CommonConstants.WMQ_MQMD_WRITE_ENABLED
Thanks for your help.
I am looking for a command to change the message broker message flow instance in the run time. I know it is quite easy with MB explorer. But I am more interested towards the server side mqsi command. Ours is a AIX env with message broker 8 installed.
The number of instances a message flow has on the execution group is configured in the BAR file, before deployment.
If you want to change the number of additional instances you will need to redeploy your flow.
You can use the mqsiapplybaroverride command to change the configuration of the flow in the BAR file, and the mqsideploy command to redeploy the BAR.
As of IIB v9 you can control the number of instances dynamically at runtime by assigning a workload management policy.
See the description here:
http://www-01.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.doc/bn34262_.htm
Once you have assigned a policy you can change it using the mqsichangepolicy command specifying an xml policy document that has a different number of instances.
Alternatively you can use the web ui to change it directly on the running broker.
Thanks for going thru this question.
We have installed ITCAM agent on MQ V7.5.0.3. Currently we had a scenario to clean out all the MQ objects and recreate it. While configuring ITCAM agent on MQ, there were few auto-created Subscriptions on Qmgr.
While taking dmpmqcfg -m these subscriptions are not captured ( as per info center "The dmpmqcfg utility dumps only subscriptions of type MQSUBTYPE_ADMIN, that is, only subscriptions that are created using the MQSC command DEFINE SUB or its PCF equivalent. Subscriptions that are created by applications using the MQSUB MQI call of type MQSUBTYPE_API are not part of the queue manager configuration, even if durable, and so are not dumped by dmpmqcfg")
Can anyone please advise how to take dump of all the subscriptions irrespective of created by DEFINE SUB or by some API's.
Thank you
You can issue the command DISPLAY SUB(*) TYPE(API) ALL to see them all.
dmpmqcfg does not dump them out because replaying them as DEFINE SUB commands would create TYPE(ADMIN) subscriptions.