1

I have to get message from one MQ manager (transmission queue), get name of back-end queue from MQXQH header, validate message, create new message without MQXQH header and send it to another MQ manager. Now I can get back-end queue (with XSLT) and send message, but I can't change message, because I can't see data in request. can somebody help me? Current XSLT:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:dp="http://www.datapower.com/extensions" extension-element-prefixes="dp" exclude-result-prefixes="dp">
<xsl:template match="/">
 <!-- Get the MQXQH headers -->
 <xsl:variable name="MQXQH" select="dp:request-header('MQXQH')" />
 <!-- Parse the MQXQH headers to XML format -->
 <xsl:variable name="parsedMQXQH" select="dp:parse($MQXQH)" />
  <!-- log MQXQH -->
 <xsl:message dp:priority="alert">
 <xsl:copy-of select="$parsedMQXQH" />
 </xsl:message>
 <!-- extract destination Queue -->
 <xsl:variable name="destQ" select="$parsedMQXQH//RemoteQName"></xsl:variable>
 <!-- extract destination Manager -->
 <xsl:variable name="destM" select="$parsedMQXQH//RemoteQMgrName"></xsl:variable>
 <!-- set destination -->
 <dp:set-variable name="'var://service/routing-url'" value="concat('dpmq://KSSH_MQQM_AC/?RequestQueue=',$destQ)" />
</xsl:template>
</xsl:stylesheet>
Eugene K.
  • 11
  • 4
  • Could you elaborate on why you need to do this. The fact that you've discovered you can't should lead you to the understanding that it's not a normal thing to do. Perhaps if we knew why we could offer alternate suggestions. – Morag Hughson Nov 18 '15 at 01:28
  • Usually people do this when they convert a direct QMgr-to-QMgr channel connection to use a DataPower appliance instead. This allows the appliance to act as a policy-enforcment point, to bridge a DMZ, to provide failover capabilities, to scan for malicious payloads, etc. and to do so without making any application or QMgr configuration changes. It may very well be that making the MQ or app changes are a more favorable business case than making the DataPower changes but nobody can make that decision without knowing how to make the DataPower changes. – T.Rob Nov 26 '15 at 18:49
  • This is a VERY strange request. The only process that should be reading messages from an XMIT (transmission) queue is the MCA (Message Channel Agent). An XMIT queue is used by the MCA to move messages from one queue manager to another queue manager. Why don't you process the message after it arrives at the destination queue? Hence, you would not need to deal with the MQXQH header. – Roger Nov 17 '15 at 17:31
  • Thanks for replies. I know that it's strange, but I have to do it. So, can you help me to get message, validate it, remove MQXQH headers, send it to another queue with MQRFH headers? – Eugene K. Nov 18 '15 at 09:56

2 Answers2

1

You could use a MQ header parser, written in JS (https://gitlab.com/ksgerastenok/datapower/-/blob/master/domain/headers.js). It parses MQXQH header with original MQMD header and strips it from the message body.

Next, you should get original MQMD header from MQXQH.MsgDesc field and set it as MQMD request header. Also, you should set MQOD header with

MQOD.ObjectQMgrName = MQXQH.RemoteQMgrName
MQOD.ObjectName = MQXQH.RemoteQName

At last, you should remove MQXQH header. Now you have original MQMD header and MQOD header with necessary routing information. Routing URL with setted MQOD header can be without Request Queue parameter specified:

 dpmq://QMNAME/?RequestQueue=(something that will not be used or leave blank).
zortech
  • 21
  • 3
0

It is a bad idea to read transmission queue and only possible at all if you tweak your installation. See developerWorks DataPower forum posting on this.

Hermann.

HermannSW
  • 161
  • 1
  • 8