0

Please see my code snippets below:

  1. amqmdnet (this works but we prefer IBM.XMS because we can then do asynchronous consumption)
  2. XMS with CCDT file
  3. XMS with property for compression

We tried all possible ways to configure compression (in XMS). I really appreciate your help, if anyone could help...

Ozkan
  • 3,880
  • 9
  • 47
  • 78
  • If you don't have a customer id, how are you using a licensed software? Shouldn't be posting that here. – Attila Repasi Jul 22 '18 at 20:03
  • What are you talking about? IBM MQ Client is freely redistributable software. – Ozkan Jul 22 '18 at 20:09
  • Well I guess, you are connecting to a queue manager, which is licensed, so there should be a client id there, but never mind, just wanted to point out that what you ask for (opening a PMR) is not OK. – Attila Repasi Jul 22 '18 at 20:18
  • Based on this link **"[Message Service Client for .NET > XMS API reference > Properties of XMS objects](https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.xms.doc/props_connf.html)"** it does not list the XMSC.WMQ_HEADER_COMP or XMSC.WMQ_MSG_COMP properties, this would support that XMS.NET does not (currently?) support specifying message and header compression via properties of the CF, although one last attempt that probably will not work would be to specify them using a .binding file that you create with the JMSAdmin tool provided with the full client install. – JoshMc Jul 23 '18 at 08:06
  • 1
    Ozkan, via my PMR with IBM I asked about compression XMS.NET and was informed they have taken APAR IJ12614 for the problem of XMSC.WMQ_HEADER_COMP/XMSC.WMQ_MSG_COMP not being supported. I am told the APAR abstract currently is "XMS HEADER COMPRESSION PROPERTY "XMSC_WMQ_HEADER_COMP" IS NOT HONORED WHEN SET IN THE APPLICATION", I was also told this was just opened on January 15th so has not been closed yet or set to be delivered in any upcoming fixpack. Google search for that APAR number should come up with the APAR page once released. – JoshMc Jan 23 '19 at 04:58
  • @JoshMc do you know if this fix also has been released (`APAR IJ12614`)? There is still no APAR page for this issue. Do you know if version `8.0.0.12` will include the fix? – Ozkan Mar 29 '19 at 15:10
  • Unfortunately I don't have any direct information on that. Once they close the APAR it gets released to the internet and usually shows the target maintenance release. Since it is not Q2, there may be a chance it would be included in 8.0.0.12, but best to wait for the APAR page to be released. – JoshMc Mar 29 '19 at 18:06
  • I see it was released: [IJ12614: XMS .NET application doesn't honor header compression propertiesset in the application for unmanaged mode](https://www-01.ibm.com/support/docview.wss?uid=swg1IJ12614). It does show fixed in 8.0.0.12. – JoshMc Apr 06 '19 at 17:38

2 Answers2

2

It seems to me the possible values for the compression property are:

static int  WMQ_COMPMSG_DEFAULT
static int  WMQ_COMPMSG_NONE
static int  WMQ_COMPMSG_RLE
static int  WMQ_COMPMSG_ZLIBFAST
static int  WMQ_COMPMSG_ZLIBHIGH

So something like this might work:

cf.SetIntProperty(XMSC.WMQ_MSG_COMP, XMSC.WMQ_COMPMSG_DEFAULT);

Edit:

Even got the actual values, if that helps.

public static final int     WMQ_COMPMSG_DEFAULT     0
public static final int     WMQ_COMPMSG_NONE    0
public static final int     WMQ_COMPMSG_RLE     1
public static final int     WMQ_COMPMSG_ZLIBFAST    2
public static final int     WMQ_COMPMSG_ZLIBHIGH    4

Please remember, I'm trying to help, but won't set up a test environment just to post a possible solution. If it doesn't help feel free to vote it down.

Attila Repasi
  • 1,803
  • 10
  • 11
  • All 4 variables are `static int`. Setting them only sets the value to '0'. I tried this and it doesn't work. Please test it before posting an answer... – Ozkan Jul 22 '18 at 20:19
  • What's the difference between the four variables? All have the value '0'. I can't see any logic behind this. As I said earlier, please test it. I tested and this doesn't work. – Ozkan Jul 22 '18 at 20:24
  • Thanks for the effort. This is 3rd time I'm testing this on my localhost environment. This does not work: `CHSTATUS` gives: `COMPHDR(NONE,NONE) COMPMSG(NONE,NONE)` (while the first solution works, but we don't prefer to use) – Ozkan Jul 22 '18 at 20:41
  • Btw I use the latest dll versions (9.0.5) – Ozkan Jul 22 '18 at 20:48
2

Without APAR IJ12614, you cannot set channel compression programmatically in XMS .NET. In order to use channel compression you must use it via a CCDT.

The WMQ_CCDTURL is also not supported as best I understand. Use the standard environment variables and add multiple records with different QMNAME field values into a single CCDT. Have the application connect to the appropriate queue manager name in order to select the correct record from the CCDT. Remember that in this case the queue manager name can be a logical one if an asterisk is also used, and does not have to be a physical one.

Ensure all channel names are unique in the CCDT. Good practice anyway. Don't use SYSTEM.DEF.SVRCONN for example, but instead APP1.QM2.SVRCONN or some such, e.g. application reference and QMgr name reference contained in the channel name.

Morag Hughson
  • 7,255
  • 15
  • 44
  • 1
    This link seems to indicate that [XMSC_WMQ_CCDTURL](https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_8.0.0/com.ibm.mq.msc.doc/prx_wmq_ccdt_url.htm) is supposed to be supported by .NET, and the OP even said in a different question that this works with Managed mode, but in unmanaged mode it is being ignored. I also suggested the work around of having multiple entries, but the channel name has to be different for this to work as you can't not even add multiple channels with the same name into the CCDT even if other values such as QMNAME are different, OP said this is not in his control. – JoshMc Jul 23 '18 at 07:57
  • 1
    Another possible solution since the requirement to use compression is to use unmanaged mode would be to write a simple preconnect exit that would key off the QMNAME and build a MQCD structure for the connection using the required port number (all other values would need to be specified such as COMPMSG, COMPHDR, SSLCIPH, etc) and setting QMNAME to null. The sample `amqlcel0.c` can be viewed as a sample but the LDAP lookup may be overly complicated for this situation and could be easily removed. – JoshMc Jul 23 '18 at 08:12
  • 1
    In regard to your "IBM MQ Little Gem #34: Channel Compression" under "XMS Clients (unmanaged)", the following APAR should fix this to be able to be done programatically. IJ12614: XMS .NET application doesn't honor header compression propertiesset in the application for unmanaged mode. – JoshMc Apr 17 '19 at 08:13
  • 1
    Thanks @JoshMc - I have updated the table in https://community.ibm.com/community/user/imwuc/blogs/morag-hughson/2018/07/29/ibm-mq-little-gem-34-channel-compression and my answer above too (for any future readers). – Morag Hughson Apr 17 '19 at 08:43