|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
JMS_IBM_MQMD_PERSISTENCE doesn't work under XMS |
« View previous topic :: View next topic » |
Author |
Message
|
zbyszanna |
Posted: Mon Apr 18, 2016 5:08 am Post subject: JMS_IBM_MQMD_PERSISTENCE doesn't work under XMS |
|
|
Novice
Joined: 03 Feb 2012 Posts: 23
|
Hello,
I've got a simple windows XMS application sending messages with persistence set to queue default.
msg.SetIntProperty(XMSC.JMS_IBM_MQMD_PERSISTENCE, MQC.MQPER_PERSISTENCE_AS_Q_DEF);
Code: |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IBM.XMS;
namespace XMSSendTest
{
class Program
{
static void Main(string[] args)
{
IConnectionFactory factory = IBM.XMS.XMSFactoryFactory.GetInstance(XMSC.CT_WMQ).CreateConnectionFactory();
factory.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, "qmgr");
factory.SetStringProperty(XMSC.WMQ_CHANNEL, "chl");
factory.SetStringProperty(XMSC.WMQ_HOST_NAME, "host");
factory.SetIntProperty(XMSC.WMQ_PORT, 1414);
IConnection connection = factory.CreateConnection();
ISession session = connection.CreateSession(false, AcknowledgeMode.AutoAcknowledge);
IMessage msg = session.CreateBytesMessage();
System.Console.WriteLine("DELIVERY: " + msg.JMSDeliveryMode);
msg.JMSDeliveryMode = DeliveryMode.DELIVERY_MODE_NONE;
msg.SetIntProperty(XMSC.JMS_IBM_MQMD_PERSISTENCE, MQC.MQPER_PERSISTENCE_AS_Q_DEF);
IDestination queue = session.CreateQueue("QUEUE.OUT");
IMessageProducer producer = session.CreateProducer(queue);
producer.Send(msg);//, DeliveryMode.DELIVERY_MODE_NONE, 1, 100);
System.Console.WriteLine("Msg sent.");
}
}
}
|
echo "dis qa(QUEUE.OUT) DEFPSIST" | runmqsc QMGR
5724-H72 (C) Copyright IBM Corp. 1994, 2011. ALL RIGHTS RESERVED.
Starting MQSC for queue manager DMQBRK1.
1 : dis qa(QUEUE.OUT) DEFPSIST
AMQ8409: Display Queue details.
QUEUE(QUEUE.OUT) TYPE(QALIAS)
DEFPSIST(NO)
One MQSC command read.
No commands have a syntax error.
All valid MQSC commands were processed.
WMQ version 7.5.0.5
And when I send it to the queue I got:
A VER 2
A RPT 0
A MST 8
A EXP -1
A FDB 0
A ENC 546
A CCS 1208
A FMT MQHRF2
A PRI 4
A PER 1
The default for MessageProducer is Persistent but the queue alias has DEFPSIST set to NO, os the final persistence should be PER 0 (and is PER 1).
Is this a bug in the XMS or do I miss something? |
|
Back to top |
|
 |
MQsysprog |
Posted: Mon Apr 18, 2016 6:08 am Post subject: |
|
|
Centurion
Joined: 24 Feb 2014 Posts: 116
|
I would check also the real queue you are pointing with the alias ,to see how the persistence attribute is set...
Hope it helps . |
|
Back to top |
|
 |
zbyszanna |
Posted: Tue Apr 19, 2016 1:28 am Post subject: |
|
|
Novice
Joined: 03 Feb 2012 Posts: 23
|
Thank you for the reply.
This is a pattern we use in the whole enterprise. We set persistence on the alias queue and it works in Java and C++, it just doesn't work under .NET XMS, so I don't think this is queue setup, rather something to do with the implementation of XMS (or maybe I'm missing something in my app). |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Apr 19, 2016 3:55 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
It's important to note that a queue doesn't have persistence. It has default persistence.
If it doesn't work in .NET, then perhaps .NET isn't setting Persistence as Queue Definition.
I know your code is trying to set that. Which version of the .NET MQ classes are you using? With which version of .NET ?
Can you run an mq client trace to see what MQ thinks you're doing under the covers? _________________ chmod -R ugo-wx / |
|
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
|
|
|
|