diff --git "a/formatted_data.jsonl" "b/formatted_data.jsonl" new file mode 100644--- /dev/null +++ "b/formatted_data.jsonl" @@ -0,0 +1,2542 @@ +{"text": "### Human: On my team at work, we use the IBM MQ technology a lot for cross-application communication. I've seen lately on Hacker News and other places about other MQ technologies likeRabbitMQ. I have a basic understanding of what it is (a commonly checked area to put and get messages), but what I want to know what exactly is it good at? How will I know where I want to use it and when? Why not just stick with more rudimentary forms of interprocess messaging?### Assistant: All the explanations so far are accurate and to the point - but might be missing something: one of the main benefits of message queueing: resilience.Imagine this: you need to communicate with two or three other systems. A common approach these days will be web services which is fine if you need an answers right away.However: web services can be down and not available - what do you do then? Putting your message into a message queue (which has a component on your machine/server, too) typically will work in this scenario - your message just doesn't get delivered and thus processed right now - but it will later on, when the other side of the service comes back online.So in many cases, using message queues to connect disparate systems is a more reliable, more robust way of sending messages back and forth. It doesn't work well for everything (if you want to know thecurrentstock price for MSFT, putting that request into a queue might not be the best of ideas) - but in lots of cases, like putting an order into your supplier's message queue, it works really well and can help ease some of the reliability issues with other technologies.\n"} +{"text": "### Human: I am trying to develop a JMSstandalone applicationto read and write to a Queue on MQSeries.\nMy boss asked me to usepure java JMS(not ibm.mq lib) to do that.Here is the information that need to make the jms connection:mq.hostname=10.10.10.10\n mq.channel=API.CLIENTCHL\n mq.queueManager=MQPETAPI\n mq.port=1422Do you know how to do that Or do you have any link that teach me to do that.### Assistant: The issue here is the requirement that \"My boss asked me to use pure java JMS (not ibm.mq lib) to do that.\" JMS is a specification and each implementation must comply with the API and the semantics, but is free to do whatever they want at a low level. It is always necessary to use the implementation classes provided by the transport vendor. Therefore if you use WebSphere MQ as the transport, you will need to use the IBM MQ JMS classes to write a JMS application.That said, if you stick with pure JMS API calls you would be able to plug in any transport vendor's classes. This is what is usually intended when you are given requirements such as that mentioned in the original post.There's an article describing exactly what you are looking to do calledRunning a standalone Java application on WebSphere MQ V6.0It uses only the JMS API and it uses JNDI in a local file system (a .bindings file). By swapping out the IBM JMS classes for another vendor and using their JNDI tools you would be able to plug in any JMS transport without changing your code using this approach.If you want to do the same thing without JNDI, look at the sample programs provided with the MQ client install where you obtained your Java classes. In a UNIX/Linux system these are in/opt/mqm/sampand on Windows they are ininstall_dir/tools/jms/samples. TheSimpleRequestor.javasample has the following code for initializing your connection factory without JNDI:try {\n // Create a connection factory\n JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\n JmsConnectionFactory cf = ff.createConnectionFactory();\n\n // Set the properties\n cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, \"localhost\");\n cf.setIntProperty(WMQConstants.WMQ_PORT, 1414);\n cf.setStringProperty(WMQConstants.WMQ_CHANNEL, \"SYSTEM.DEF.SVRCONN\");\n cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\n cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, \"QM1\");Because this approach does not use JNDI, you are required to write code that is not transportable across transport vendors. It is IBM WebSphere MQ specific.If you grabbed the MQ jars from somewhere and do not have the full install (and thus do not have the samples) you can download it asSupportPac MQC7. The download is free. In general you should use the latest client, even with a back-level queue manager. Obviously you do not get V7 functionality from a V6 QMgr but the JMS implementation in the V7 client is much improved, even for V6 functionality. If for some reason you really must use the V6 client, you can download it asSupportPacMQC6. Whichever client version you use, make sure to use the corresponding Infocenter.V6 InfocenterV7 InfocenterFinally, the landing page with an index for all the SupportPacs ishere.\n"} +{"text": "### Human: What is the difference between a message channel and a message queue itself?They're different things. The queue actually holds messages which will be processed (pushed to the listener) in FIFO manner.A channel is a medium through which messages are transmitted.What does that mean exactly? In a book \"Enterprise Integration Patterns\" it says:Connect the applications using a Message Channel, where one application writes information to the channel and the other one reads that information from the channel.Does this mean that this message channel actually abstracts the queue away from the producer and consumer of the message? But it really doesn't right? When a producer has to place a message into a queue, it actually specifies the queue manager and queue names it want's to connect to.There's also the concept of different protocols in channels and different data formats in channels where you have a separate channel for each protocol you're using maybe and maybe a separate channel for each data format (XML, JSON etc).\nThis would facilitate the different queues to pick up from different channels. But why not directly call different queues for different data formats? What exactly is the role of the channel? Is it just a connection?I'm a completely new at MQM. I've just been assigned to this project which involves producing and consuming messages and I'm trying to wrap my mind around this.### Assistant: To expand a bit on Shashi's answer, please keep in mind that the EIP book referenced talks about high level messaging patterns. In that context the authors needed a generic term for the medium by which messages are transferred between two points and chose the word \"channel\".For purposes of the book the achannelconnects any two endpoints that move messages, for any message transport vendor. In this case a channel has attributes that are classes of service and support the various patterns. It may be 1-1, 1-many, many-1, many-many, etc.So for example if it is ZeroMQ, the endpoints are two peer-to-peer nodes and there's no messaging engine between them. For IBM MQ one endpoint is always the queue manager (a type of messaging engine) and the other is an application or another queue manager.Based on this example, it should be obvious thatchannelas used in the book andchannelas defined by any messaging transport are at different levels of abstraction. As used by MQ, achannelis a specific set of configuration parameters that define a communication path and includes such attributes asCONNAME,MAXMSGL, tuning parameters, SSL parameters, etc. Once an MQchannelis successfully started, you can see a running instance of it by displaying the channel status. In the case ofCLUSRCVR,SVRCONN, and (less commonly)RCVRorRQSTRchannels, you may see multiple instances of the same channel active simultaneously.If you are still with me, you may have noticed that the MQ usage of the termchannelalways describes one or more point-to-point network connections whereas the EIP book's usage of the termchannelis roughly translated as \"the thing that moves messages between application endpoints.\" Consider that two applications connected directly to the queue manager using shared memory would be using achannelas defined in EIP butnotas the term is defined by IBM MQ.Based on that example, it should be clear that the EIP version of the termchannelincludes the queue managerandany MQ connections between the queue manager and application endpoints.To sum up:The EIP book'schannelis all messaging infrastructure that isn't one of the application endpoints, and in an MQ context it includes the queue manager and any MQ channels.The IBM MQchannelis a specific configuration defining network connectivity between the queue manager and another queue manager or a client application.I hope this clarifies the terminology rather than confusing things further. I will update based on any comments if needed.\n"} +{"text": "### Human: If we use JMS request/reply mechanism using \"Temporary Queue\", will that code be scalable?As of now, we don't know if we will supporting 100 requests per second, or 1000s of requests per second.The code below is what I am thinking of implementing. It makes use of JMS in a 'Synchronous' fashion. The key parts are where the 'Consumer' gets created to point a 'Temporary Queue' that was created for this session. I just can't figure out whether using such Temporary Queues is a scalable design.destination = session.createQueue(\"queue:///Q1\");\n producer = session.createProducer(destination);\n tempDestination = session.createTemporaryQueue();\n consumer = session.createConsumer(tempDestination);\n\n long uniqueNumber = System.currentTimeMillis() % 1000;\n TextMessage message = session\n .createTextMessage(\"SimpleRequestor: Your lucky number today is \" + uniqueNumber);\n\n // Set the JMSReplyTo\n message.setJMSReplyTo(tempDestination);\n\n // Start the connection\n connection.start();\n\n // And, send the request\n producer.send(message);\n System.out.println(\"Sent message:\\n\" + message);\n\n // Now, receive the reply\n Message receivedMessage = consumer.receive(15000); // in ms or 15 seconds\n System.out.println(\"\\nReceived message:\\n\" + receivedMessage);Update:I came across another pattern, seethis blogThe idea is to use 'regular' Queues for both Send and Receive. However for 'Synchronous' calls, in order to get the desired Response (i.e. matching the request), you create a Consumer that listens to the Receive queue using a 'Selector'.Steps:// 1. Create Send and Receive Queue.\n // 2. Create a msg with a specific ID\n final String correlationId = UUID.randomUUID().toString();\n final TextMessage textMessage = session.createTextMessage( msg );\n textMessage.setJMSCorrelationID( correlationId );\n\n // 3. Start a consumer that receives using a 'Selector'.\n consumer = session.createConsumer( replyQueue, \"JMSCorrelationID = '\" + correlationId + \"'\" );So the difference in this pattern is that we don't create a new temp Queue for each new request.\nInstead all responses come to only one queue, but use a 'selector' to make sure each request-thread receives the only the response that is cares about.I think the downside here is that you have to use a 'selector'. I don't know yet if that is less preferred or more preferred than earlier mentioned pattern. Thoughts?### Assistant: Regarding the update in your post - selectors are very efficient if performed on the message headers, like you are doing with the Correlation ID.Spring Integrationalso internally does this forimplementing a JMS Outbound gateway.\n"} +{"text": "### Human: What is the difference between a Websphere Message Broker and a Queue Manager. I guess the queue manager puts messages in the queue, takes messages out of the queue, moves messages to backout queues etc. So what is the job of the broker?Does it sit between the publisher and the Queue Manager or between the consumer and the Queue Manager?### Assistant: Websphere MQ is a software which uses theAMQ(Asynchronous messaging protocol). You can achieve asynchronous messaging between your applications via Websphere MQ, which will make your infrastructure loosely coupled(Applications can keep working even though other applications are down in the infrastructure).But the applications in your infrastructure may not be able to understand each others' message formats, and hence just sending the message to the target application may not be enough. You mayrequire transformationof the message.You can do it by writingyour own program using the Websphere MQ API. \nYour program should be able to do the below things:Pick message from a specific queue (using MQGET)Should be able to understand the message. That is say it's an XML message. Then your program must be able to parse the XML and read the\n data in it.After reading the input message you will make your output message based on the requirements.Then you will either publish the message or put the message in some specific queue(say TargetQ), so that the target application can get\n the message. Target application will then get the message either by\n issuing MQGET on the TargetQ or subscribing to the topic which was\n published from your application.But writing your own program will take a lot of development time and effort and also may be a bit complex.So, IBM provided its own software to do the job, which is\"Websphere Message Broker\".WMB allows you to create programsvery easilyanda lot faster.Appropriate nodes in WMB will do all above steps for you. In fact it provides lot many features than the above steps.Websphere MQ still doesn't have an HTTP listener. But, a message broker does. It allows you to hostweb servicesand have HTTP based flows etc that too in a secure way(Supports SSL).\n"} +{"text": "### Human: What is the difference between a dead letter Queue and a back out queue?In WebSphere MQ terms and in terms of Application Servers.All J2EE/JEE app servers have a MQ Provider do they also have a construct of a Dead Letter Queue or is that something specific to WebSphere MQ?My understanding of a back out queue is as follows:If MQ is unable to deliver the message to a destination after a specified number of attempts it moves the message to the back out queue.I do not have a clear understanding of a Dead Letter queue.Appreciate any assistance.### Assistant: The dead letter queue was always used in MQSeries (the last time I used MQ) to store messages that arrived at the queue manager but the queue didn't exist.For example, if the message was address to queue managerXand queueY, it would arrive via a channel at managerX.If the receiver channel discovered there was no queueY, it would be placed in the dead letter queue.The backout queue, on the other hand, is more of an application-level thing (at least in terms of MQ). When an MQ client cannot process the message for some reason, it can back it out for later processing (back to it's original queue).If it's backed out too many times (the threshold can be configured), it gets moved to the backout queue.\n"} +{"text": "### Human: My understanding is that:MDBs (Message Driven Beans) connect via Activation Specification.MDPs (Message Driven POJO) connect via Connection Factory.This diagramfrom IBMis helpful:To me,this explanation from IBMdoes not shed much light on the difference:Connection factory-- used by the application to get connections to the messaging bus.Queue-- used by the application to send and receive messages.Activation specification-- used by the application's message-driven bean to connect to the queue and receive messages.One realdifference I have found is that:Session beans and entity beans [aka MDPs] allow you to send JMS messages and to\n receive themsynchronously, but not asynchronously. To avoid tying up\n server resources, you may prefer not to use blocking synchronous\n receives in a server-side component.To receive messages\n asynchronously, use a message-driven bean[MDB].So the unsatisfying list I have so far is:Use ActivationSpec with an MDB and ConnectionFactory with a POJO (but wait, can POJOsuse ActivationSpec too?)MDB's operate asynchronously. MBP's operate synchronously.My question is: Are there other differences? Can you clarify the difference ?References:Deploying message-driven beans and JMS applications into the Service Integration BusSpring JMS vs MDB### Assistant: @Jeffrey Knight: Let me try to clarify based on my experience.We understand MDB are beans to consume incoming messages. Now there is need to specify what kind of messages, from which destination a particular MDB wants to consume to.MDB is basically a message end point.Prior to JCA compliant MDBs:flow in websphere was :-incoming message --> listened by Message listener --> listener\n ports-->deliver to MDBSo typically a developer would create a MDB and specify message destination details in ejb-jar.xml as follows:-\n javax.jms.Queue\n\njms/QCF\n\n javax.jms.QueueConnectionFactory\n Container\nand a deployer would need to create listener port and associate deployed MDB to the listener port. QueueConnectionFactory specified above is made to create connections to queue.Post JCA compliant MDBs:Post JCA, MDB is treated as a JCA resource. JCA specification incorporated messaging framework APIs as well. Flow in case of JCA is:-incoming message --> listened by Message listener --> Resource Adapter-->deliver to MDBNow since JCA was created to work with any type of resouce be it JDBC, JMS, EIS etc, so it has a generic \"Activation Spec\" way of creating configurations for any adapter. In ra.xml file, it is mentioned what kind of activation spec is needed by that particular adapter to work. Activation spec is not a runtime entity, it is just a configuration details used by resource adapter. In above case JCA adapter will use connection from queue connection factory mentioned in activation spec. So basically queue connection factory in above both cases are same.In case of websphere, you can use either SIB (Service Integration Bus) destinations for messaging OR external software like websphere MQ for messaging.In case of SIB destinations for messaging:-\nSIB has implemented a JCA resource adapter. So MDB using destination on SIB can use activation spec to specify destination details. and resource adapter module can interact with messaging engine and can deliver the messages to MDB.In case of external messaging framework like websphere MQ:-\nSince websphere MQ has not implemented any JCA adapter, so we will need to configure listener port to connect to destinations residing on websphere MQ. It is listener port who will deliver the messages to MDB.In short, both cases use queue connection factory to get queue connection. In one case, it is resource adapter (with configuration information in form of activation spec) used to deliver messages where as in other case it is listener port (bound to queue & factory) used to deliver messages.I hope this clarifies now.\n"} +{"text": "### Human: I am getting this error while connecting to IBM MQ. I know that this is because of privileges, but is there any way just to check the connection with IBM MQ?Please suggest.### Assistant: The 2035 suggests that your connection is getting to the QMgr. If you had the wrong channel name, host or port you would get back a 2059. The 2035 means that the connection made it to the listener, found a channel of the name that was requested and attempted a connection.If you want to test past this point it will be necessary to either authorize the ID that you are using to connect or to put an authorized ID in the MCAUSER attribute of the channel.For a detailed explanation of how the WMQ security works on client channels, see the WMQ Base Hardening presentation athttp://t-rob.net/links.\n"} +{"text": "### Human: Our Java app writes to MQ Series queues via a Weblogic JMS Message Bridge. The actual MQ Series connection/queue details are stored in the MQ Series .bindings file on the app server. I've never really got my head around the bindings file and what all the entries mean. Can anyone provide guidance to understand this file?### Assistant: Before addressing the .bindings file, we need to step back a bit and look at JNDI - the Java Naming and Directory Interface - and how it is used by JMS. The Queue, Topic and various types of Connection Factory are all run-time JMS objects with methods and attributes. But you can pre-define them and store them in a registry where the JMS application can retrieve them using JNDI lookups.This is helpful because the objects are like coins in that they have a JMS side and a provider-specific side. On the JMS side, any administered object looks about the same. Regardless of the underlying transport provider, a ConnectionFactory has the same methods and attributes. However, on the provider-specific side, the administered objects look very different from one transport provider to the next. For example, the ConnectionFactory used with a WebSphere MQ transport will have an attribute for the Queue Manager. No other transport provider has a \"queue manager\" so this attribute is only valid in a WMQ context.The two aspects of administered objects are the \"glue\" that allows JMS to work independently of transport provider. In your code you just have to look up a ConnectionFactory and you get an object suitable to perform method calls against. Under the covers, the provider's JMS classes use the provider-specific object attributes to supply context to convert the generic JMS API calls into provider-specific calls. Thus the connection object that you instantiate results in a WMQ CONNECT call which specifies a QMgr name, host, port, channel and a variety of other parameters.OK, I promised to get to the .bindings file. I said previously that the JNDI lookup was against \"a registry\" and that usually means LDAP or similar. But Sun engineered JNDI like JMS in that there is an API that your program uses and an SPI or Service Provider Interface that is used by the registry. So, although JNDIcanbe implemented in LDAP, there is nothing that says itmustbe implemented in LDAP. One of the base implementations that Sun provided right out of the box was to use the local filesystem as the registry. In this implementation, the root context is a file folder. Each context can store either another sub-context (another file folder) or object definitions. Typically there is one folder for the root context and all of the objects are defined at that level. The file that holds the object definitions is...you guessed it... the .bindings file.The objects in the .bindings file are represented in Name/Type/Value triplets. So each .bindings file typically has many objects. Each object has many attributes. Each attribute has a name, a value and the type of variable that holds the value. The best way to get a handle on the .bindings file is to sort it which will put all the objects and their attributes together and make it more human-readable. For a list of possible properties, seethe manual.Of course, the .bindings file is supposed to be a compiled artifact and not intended to be human readable. IBM provides the JMSAdmin tool to generate and read the .bindings file. You can also use WMQ Explorer to manage the administered objects in a .bindings file. These are also discussed in the manual linked above. There is also a (some say) good tutorial in developerWorkshere.\n"} +{"text": "### Human: I'd like to connect to a Websphere 6.0 MQ via Java. I have already working code for a \"normal\" queue, but now I need to access a new queue which is SSL encrypted (keystore). I have been sent a file called something.jks, which I assume is a certificate I need to store somewhere. I have been searching the net, but I can't find the right information.This is the code I use for the \"normal\" queue. I assume I need to set some property, but not sure which one.MQQueueConnectionFactory connectionFactory = new MQQueueConnectionFactory();\nconnectionFactory.setChannel(channel_);\nconnectionFactory.setHostName(hostname_);\nconnectionFactory.setPort(port_);\nconnectionFactory.setQueueManager(queueManager_);\nconnectionFactory.setTransportType(1);\nconnectionFactory.setSSsetSSLCertStores(arg0)\n\nConnection connection = connectionFactory.createConnection();\nconnection.setExceptionListener(this);\nsession_ = connection.createSession(DEFAULT_TRANSACTED, DEFAULT_ACKMODE);\nconnection.start();\n\njavax.jms.Queue fQueue = session_.createQueue(queue_);\nconsumer = session_.createConsumer(fQueue);### Assistant: Alex Fehners tutorial in developerWorks is a bit old (2005) but has code samples that should work for you.SSL configuration of the Websphere MQ Java/JMS clientYour Java app will authenticate the QMgr based on its certificate. That means the jks file you were provided must have either the QMgr's self-signed certificate or it will have the root certificate of a Certificate Authority that signed the QMgr's certificate. In either case you point to the file using the-Djavax.net.ssl.trustStore=as noted in the article linked above. If the jks has a password, you will need to specify-Djavax.net.ssl.trustStorePassword=as well. Authenticating the QMgr with a truststore isalwaysrequired. The next part may or may not be required.The other piece of the puzzle is that the QMgr may require your app to present a certificate. In other words, the QMgr cert isalwaysauthenticated, whether the app is required to authenticate is optional. If it is then you have what is known as \"mutual authentication\". If the channel that you connect to has been configured withSSLCAUTH(REQUIRED)then mutual auth has been enabled and the QMgr must have your application's self-signed cert or a CA root cert that signed your app's cert in its keystore. Hopefully whoever set up your jks file will have arranged for this already.Assuming mutual auth is required, then your jks will have, in addition to the QMgr's trusted cert, a private cert representing your application. To get the app to fetch the cert and present it to the QMgr, you use the-Djavax.net.ssl.keyStore=and-Djavax.net.ssl.keyStorePassword=parameters. Note these saykeystore whereas the previous parms saidtruststore.My recommendation is to work with the WMQ administrator to set up and test the SSL connection. The first phase should be to test the channel withSSLCAUTH(OPTIONAL). This verifies that the application can resolve and authenticate the QMgr's certificate. Only when you get this working would the WMQ admin then change the channel toSSLCAUTH(REQUIRED)which tests authentication in the reverse direction.I wouldhighlyrecommend that you use the WMQ v7 client for a new application. This is for two reasons: 1) v6 is end-of-life as of Sept 2011; 2) the v7 code has a lot more diagnostic capability built in. The v7 client code is completely compatible with a v6 QMgr and works like the v6 client. You just don't get the v7 functionality. Download the WMQ client code free here:IBM - MQC7: WebSphere MQ V7.0 ClientsI'm running the WMQ Hands-On Security Lab at IMPACT this year and will be posting the scripts and lab guide over the weekend athttp://t-rob.netso check back for that.\n"} +{"text": "### Human: Can we rename a Queue without deleting and recreating it?### Assistant: It is not possible to rename a WebSphere MQ queue. There are two options:You can define an alias over an existing queue where the alias has the desired name.You can define a new queue with the desired name and move any messages into it from the original queue.In the event that you take the second option, there are a number of tools to move the messages. Two of the more popular tools are mqmon fromSupportPac MO71and the Q program fromSupportPac MA01.\n"} +{"text": "### Human: i am trying to access MQ queues using JMS. i am getting the belowjava.lang.UnsatisfiedLinkError: no mqjbnd05 in java.library.pathi am passing-Djava.library.path=\"C:\\Program Files\\IBM\\WebSphere MQ\\java\\lib\"as the VM argument while running the program in eclipse. This issue is discussed quite a lot on the net but with out any conclusion. Has anyone resolved this? TIA.### Assistant: As I had to deal with this error myself; and it took me a lot of time to find the right answer, I'd like to share it with the next one, who comes along this thread...Actually the solution to the problem was very simple (at least in my case). It was not related to anyCLASSPATH,java.library.pathor installation issues.I simply forgot to switch theMQConnectionFactoryinto the Client mode.This has to be done, by simply callingcf.setTransportType(WMQConstants.WMQ_CM_CLIENT);orcf.setTransportType(WMQConstants.WMQ_CM_BINDINGS_THEN_CLIENT);or any other connection type, that fits your needs.By default, the ConnectionFactory is in \"Binding\" mode (WMQ_CM_BINDINGS), which is intended for local server installations, as it is is stated in the IBM Documentation:To connect to a queue manager inbindings mode, a WebSphere MQ classes for JMS applicationmust run on the same systemon which the queue manager is running.This transport type is the same as theXMSC_WMQ_CONNECTION_MODE(WMQConstants.WMQ_CONNECTION_MODE) property, when using JNDI or theJmsFactoryFactory.The same should apply to the other ConnectionFactory types:MQQueueConnectionFactory,MQTopicConnectionFactory,MQXAConnectionFactory,MQXAQueueConnectionFactoryandMQXATopicConnectionFactoryCheck the IMB Knowledge Center for more information about the different connection/binding options:https://www.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q031720_.htmhttps://www.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q030560_.htm\n"} +{"text": "### Human: I am using Oracle Service Bus(OSB) as the MOM, and the destination URI is a IBM MQ queue. I just want to know which would be the preferred transport. OSB provides 2 adapters for the same, JMS adapter and MQ adapter for transport. Does any one knows what are the PROS and CONS of the same. TIA### Assistant: Typically, sending messages via the native MQI interface will be faster than using JMS. In reality I doubt you will see a real difference, unless you are sending tons of messages per day. However, there are other things to consider than just speed. For example, if you are not familiar with MQI applications the learning curve will be steeper than JMS.JMS header information is mapped to an MQRFH2 header when sent to another JMS destination via MQ. The inclusion of a MQRFH2 header is driven off of the Destination object you create. If the destination is a JMS endpoint then the header is included.I have included a link below that explains how the fields are mapped:Mapping JMS messages onto MQI messages.In reality, unless you are sending millions of messages a day I would assume that the performance of JMS on WebsphereMQ will be more than adequate for your needs. As far as thread blocking goes in request reply I don't think you need to worry about this. By default the reply in WebsphereMQ is consumed by a seperate thread, not the requesting thread.\n"} +{"text": "### Human: We're working on an application that supports AMQP for queuing. Some of our clients are using Websphere MQ. I'm just wondering at a high level how interchangeable these two protocols are in terms of functionality. I'm usingcelery, which should allow me to abstract out the lower-level stuff as long as I can write a Websphere MQ backend. What I'm trying to figure out is how difficult a challenge this will be.Does Websphere MQ provide a superset of AMQP's functionality? Does either one have any \"features\" that might make my life difficult?### Assistant: UPDATE 23 June 2015IBM has announcedMQ Lightwhich is their implementation of AMQP. theirStatement of Directionsays that they intend to deliver features to allow programs designed to run on MQ Light to run in MQ at some point in the future but have yet to announce when that will be. MQ Light is in open Beta as of this writing.Getting payloads moved between these systems will be relatively straightforward with a simple bridging app that reads off one system and writes to the other. They both have queues and topics and explicit routing is possible.The interesting parts include such fun concepts as...Mapping reply-to destinations. Especially dynamic reply-to destinations.TransactionalityAny kind of routing more complicated than \"pick up off this queue/topic, put to this one. For example a gateway that routes to multiple destinations based on queue name.Message-level security.Mapping identities for connection-level security.No possibility of end-to-end message encryption.So if all you need is on the order of \"get from AMQP:QUEUEA, put to WMQ:QUEUEB\" and transactionality is not important you should have a an easy time of it. Beyond that it depends on exactly what you want to do.\n"} +{"text": "### Human: Background:I have a relatively old application that uses Websphere MQ for messaging. It runs on WAS (Websphere Application Server) and uses MDBs (Message Driven Beans). I was successfully able to replace all MDBs usingSpring Integration - JMS. My next step is try to see if I can port it out of WAS so that it can run on any other servlet container with a non-IBM JRE (I am trying: apache tomcat). Note that securing channels using SSL is a requirement. I prefer using JNDI.End Goal:To decouple my application from the application server (WAS) and other infrastructure like messaging (MQ). But taking this out of WAS onto tomcat is the first step. Next comes the task of updating my messaging infrastructure with something more scalable. This allows me to update individual components of the infrastructure that my app relies on, one thing at a time (app server, messaging layer, datastore) without disrupting my application too much, as I go.Question:Now, my challenge is to define JNDI resources on tomcat that can access Websphere MQ. I have made some progress on this using non-SSL channels that I defined in the context.xml file like so:\nMy next step is to get this to work with SSL channels. I understand the part that involves setting up the keystores (kdb file and cert generation and exchanging), configuring the SSL channels on the QM etc. I have all that working already. How do I get tomcat to use my keystore, cipher suite etc? Pointers or a working example would be great!Note: I am using Spring Integration 4.2, Websphere MQ v8, Tomcat v9, currently.I must add that I did try everything without the JNDI first. So here's my spring jms non-ssl config without the JNDI, that works:\n \n \n \n\n\n \n \n \n \n \n \n \n \n \n QM_SANDBOX\n \n \n SANDBOX_Q\n \n### Assistant: I think I finally figured out how to pull this off... here's a brief description of the steps. If you need more details let me know.Pre-reqs: \nWebsphere MQ Server installed (at least v 8.0.0.2)\nConfigure the QM, SSL and non-SSL channels, create Qs and all that good stuff you need.\nNeedless to say, you need the Websphere MQ jars. Be mindful of any licensing restrictions.Step 1: Get the direct connection working with no SSL, no JNDI. You will need to use these beans to configure your spring based JMS listeners and JMS Templates etc.\n \n \n \n\n\n \n \n \n \n \n \n \n \n \n QM_SANDBOX\n \n \n SANDBOX_Q\n \nStep 2: Get the direct connection working with SSL, no JNDI. I found setting this up a little tricky.2a. Since I was using a non-IBM JRE, I had to make sure the cipher specs & cipher suites needed to be configured according to the mappings specified here:http://www-01.ibm.com/support/docview.wss?uid=swg1IV66840This obviously means that we at least have to have our Websphere MQ upgraded to 8.0.0.2. In my case I used ECDHE_RSA_AES_256_GCM_SHA384 on the SSL channel and configured the jms beans within application to use TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, like so:\n \n \n \n\n\n \n \n \n \n \n \n\n\n\n \n QM_SANDBOX\n \n \n SANDBOX_Q\n \n2b. Create certs, keystores (kdbs), exchange certs etc. There are many ways to do this. But be mindful that you will need to stash passwords, the key label for the queue manager must be \u2018ibmwebspheremqqmgr\u2019 \u2013 all in lower case, no spaces, (without quotes), the key label must be like \u2018ibmwebspheremquserid\u2019 \u2013 all in lower case, no spaces, (without quotes) where userid is the userid that runs tomcat. If you need more details on exactly how I did it using self signed certs, let me know.2c. Now you have to get the JVM that tomcat runs, to read your keystores. There are many ways but here's how I did it:\nCreate a setenv.bat file in the tomcat bin folder, with the following contents (debugging SSL is optional)set JAVA_OPTS=\"-Djavax.net.ssl.trustStore=C:\\path-to-keystore\\key.jks\" \"-Djavax.net.ssl.trustStorePassword=topsecret\" \"-Djavax.net.ssl.keyStore=C:\\path-to-keystore\\key.jks\" \"-Djavax.net.ssl.keyStorePassword=topsecret\" \"-Djavax.net.debug=ssl\" \"-Dcom.ibm.mq.cfg.useIBMCipherMappings=false\"2d. Start tomcat using the following command:catalina.bat run > ..\\logs\\tomcat.log 2>&1To stop, just press ctrl+c (on windows). Whichever way you do it, make sure that setenv.bat is used during start up. Or use JAVA_OPTS to set the keystore properties.2e. Verify that the using the SSL channel works.Step 3: Get a JNDI connection working with non-SSL, JNDI\nThere are many was to set up JNDI on tomcat. Here's how I did it: Within the web application create a file META-INF/Context.xml with the following contents:\nNow in your spring config, instead of the direct configurations, all you have to do is:\nNote that for brevity, I just didn't use resource references. In case you do, there a few additional steps which are straight forward.Step 4: Now the final step is to use an SSL channel and JNDI. Assuming you have done step 2, this is easy. Modify the META-INF/Context.xml with the following contents:\nNote the line with SCPHS=\"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384\". If you need to set other such parameters, see the \"Short Form\" column in this link:https://www.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.ref.dev.doc/q111800_.htm%23jm10910_?lang=enHopefully all this works for you. Good luck!Once this configuration works, sending messages is pretty straight forward. But this is how you can listen for a message on a queue using Spring JMS\nReference:https://docs.spring.io/spring/docs/current/spring-framework-reference/html/jms.htmlStep 1: Use Spring's DefaultMessageListenerContainer and configure your beans in an xml file like so (spring-beans.xml):\n\n\n \n \n\n \n \n \n \n \n \n\nStep 2: Add this to your web.xml\n contextConfigLocation\n /WEB-INF/context/spring-beans.xml\n \n\n\n org.springframework.web.context.ContextLoaderListener\nStep 3: Write a Message Listener class like so:import javax.jms.JMSException;\nimport javax.jms.Message;\nimport javax.jms.MessageListener;\nimport javax.jms.TextMessage;\n\npublic class ExampleListener implements MessageListener {\n\n public void onMessage(Message message) {\n if (message instanceof TextMessage) {\n try {\n System.out.println(((TextMessage) message).getText());\n }\n catch (JMSException ex) {\n throw new RuntimeException(ex);\n }\n }\n else {\n throw new IllegalArgumentException(\"Message must be of type TextMessage\");\n }\n }\n}Alternatively, instead of step 3, if you are using spring integration, you can do something like so:\n \n\n\n \n"} +{"text": "### Human: Im having a problem on a Spring based webapp that is being deployed to Websphere and interacts with IBM MQ.All is fine until I try some failure tests.While the webapp is up and running, I stop IBM MQ. I then invoke the webapp to send a JMS message out. The webapp hung at the call to JmsTemplate.convertAndSend and the following exception was found in the ffdc directory.Note the JmsTemplate was initialised using the JNDIObjectFactoryBean where it had got the MQ Connection Factory settings from Websphere.Can anyone explain the reason behind the \"Initializaton Failure\" ??[27/01/11 14:29:39:498 GMT] FFDC Exception:java.lang.NoClassDefFoundError SourceId:com.ibm.ws.asynchbeans.J2EEContext.run ProbeId:894 Reporter:com.ibm.ws.asynchbeans.J2EEContext@1280128\njava.lang.NoClassDefFoundError: com.ibm.msg.client.wmq.common.internal.Reason (initialization failure)\n at java.lang.J9VMInternals.initialize(J9VMInternals.java:140)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer.checkJmqiCallSuccess(WMQMessageProducer.java:1024)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer.checkJmqiCallSuccess(WMQMessageProducer.java:997)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer.access$800(WMQMessageProducer.java:63)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer$SpiIdentifiedProducerShadow.initialise(WMQMessageProducer.java:758)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer.(WMQMessageProducer.java:972)\n at com.ibm.msg.client.wmq.internal.WMQSession.createProducer(WMQSession.java:943)\n at com.ibm.msg.client.jms.internal.JmsSessionImpl.createProducer(JmsSessionImpl.java:1162)\n at com.ibm.msg.client.jms.internal.JmsQueueSessionImpl.createSender(JmsQueueSessionImpl.java:131)\n at com.ibm.mq.jms.MQQueueSession.createSender(MQQueueSession.java:148)\n at com.ibm.mq.jms.MQQueueSession.createProducer(MQQueueSession.java:249)\n at com.ibm.ejs.jms.JMSMessageProducerHandle.(JMSMessageProducerHandle.java:132)\n at com.ibm.ejs.jms.JMSSessionHandle.createProducer(JMSSessionHandle.java:1788)\n at org.springframework.jms.core.JmsTemplate.doCreateProducer(JmsTemplate.java:968)\n at org.springframework.jms.core.JmsTemplate.createProducer(JmsTemplate.java:949)\n at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:568)\n at org.springframework.jms.core.JmsTemplate$3.doInJms(JmsTemplate.java:541)\n at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:471)\n at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:539)\n at org.springframework.jms.core.JmsTemplate.convertAndSend(JmsTemplate.java:617)### Assistant: The \"(initialization failure)\" means that the static initializer (\"\") method of the class previously threw an unchecked exception. When this occurs, the JVM marks the class as bad, and subsequent attempts to use or access the class result in NoClassDefFoundError. Search your logs for errors that include \"Reason.\" in the stack trace to find the underlying cause.(In general, the NoClassDefFoundError should include a \"Caused by\" with the exception that occurred in the static initializer, but for some reason, the cause either wasn't present or you didn't include it in your stack trace.)\n"} +{"text": "### Human: I was digging into the possibilities for Websphere MQ as a data source for spark-streaming becuase it is needed in one of our use case.\nI got to know thatMQTTis the protocol that supports the communication from MQ data structures but since I am a newbie to spark streaming I need some working examples for the same. \nDid anyone try to connect the MQ with spark streaming. Please devise the best way for doing so.### Assistant: So, I am posting here the working code for CustomMQReceiver which connects the Websphere MQ and reads data :public class CustomMQReciever extends Receiver { String host = null;\nint port = -1;\nString qm=null;\nString qn=null;\nString channel=null;\ntransient Gson gson=new Gson();\ntransient MQQueueConnection qCon= null;\n\nEnumeration enumeration =null;\n\npublic CustomMQReciever(String host , int port, String qm, String channel, String qn) {\n super(StorageLevel.MEMORY_ONLY_2());\n this.host = host;\n this.port = port;\n this.qm=qm;\n this.qn=qn;\n this.channel=channel;\n\n}\n\npublic void onStart() {\n // Start the thread that receives data over a connection\n new Thread() {\n @Override public void run() {\n try {\n initConnection();\n receive();\n }\n catch (JMSException ex)\n {\n ex.printStackTrace();\n }\n }\n }.start();\n}\npublic void onStop() {\n // There is nothing much to do as the thread calling receive()\n // is designed to stop by itself isStopped() returns false\n}\n\n /** Create a MQ connection and receive data until receiver is stopped */\nprivate void receive() {\n System.out.print(\"Started receiving messages from MQ\");\n\n try {\n\n JMSMessage receivedMessage= null;\n\n while (!isStopped() && enumeration.hasMoreElements() )\n {\n\n receivedMessage= (JMSMessage) enumeration.nextElement();\n String userInput = convertStreamToString(receivedMessage);\n //System.out.println(\"Received data :'\" + userInput + \"'\");\n store(userInput);\n }\n\n // Restart in an attempt to connect again when server is active again\n //restart(\"Trying to connect again\");\n\n stop(\"No More Messages To read !\");\n qCon.close();\n System.out.println(\"Queue Connection is Closed\");\n\n }\n catch(Exception e)\n {\n e.printStackTrace();\n restart(\"Trying to connect again\");\n }\n catch(Throwable t) {\n // restart if there is any other error\n restart(\"Error receiving data\", t);\n }\n }\n\n public void initConnection() throws JMSException\n{\n MQQueueConnectionFactory conFactory= new MQQueueConnectionFactory();\n conFactory.setHostName(host);\n conFactory.setPort(port);\n conFactory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);\n conFactory.setQueueManager(qm);\n conFactory.setChannel(channel);\n\n\n qCon= (MQQueueConnection) conFactory.createQueueConnection();\n MQQueueSession qSession=(MQQueueSession) qCon.createQueueSession(false, 1);\n MQQueue queue=(MQQueue) qSession.createQueue(qn);\n MQQueueBrowser browser = (MQQueueBrowser) qSession.createBrowser(queue);\n qCon.start();\n\n enumeration= browser.getEnumeration();\n }\n\n @Override\npublic StorageLevel storageLevel() {\n return StorageLevel.MEMORY_ONLY_2();\n}\n}\n"} +{"text": "### Human: The application I am working on needs to communicate to an IBM MQ server in a remote location. We currently have a working system using active MQ which uses a broker, and a bridge to connect to this remote IBM MQ server and is working fine.Due to some new enhancement, we are now trying to achieve the same using IBM client jars instead of Active MQ.The problem I am facing is that I can connect to the remote server's inboundQ and send messages.But I am always receiving null from the remote servers outbound Queue. But I have no way to check if the messages are received at the remote location. But the same message if sending through the old ActiveMQ system will get a response from remote MQ server.Old Active MQ internally uses the bridge to connect to remote IBM MQ server which is configured exactly like the new code I am using.I have tried multiple codes from internet and stack overflow itself and always I am able to connect but not getting any responses.Also, I get no errors or exceptions while trying to send or receive from remote IBM MQ.I will paste a sample code which I am trying to get to work. I have changed some configuration values in the code.My doubts are the following.All I am doing for this is copying IBM MQ client jars into the application and using the code to send messages to remote MQ. I have not installed any other application. Will such a system work or should there always be some intermediate program like active MQ?The same code is able to send and receive from an IBM MQ server which I installed in our local network but fails to get a response from the remote server? This leads me to believe if I am missing anything in configuration ? should anything else be configured other than in code?I see no errors or exceptions. Always message is sent but the response is null. I have not seen the usage of any username-password or public-private key authentication. Is there any authentication used normally to check the source. ?I am using IBM MQ client 5.3 version which I know is old. But used that since they working active MQ setup uses the same and is working correctly. I have no way of knowing which version on IBM MQ server is present on the remote machine. Is there a problem if we use a different client MQ version than the version of server MQ version. ?Sample code which works for me in local environment ie is able to send and receive from an IBM MQ server I have installed in another machine in the local network. The same code will fetch null response when I am trying to use it with remote IBM MQ server.import javax.jms.*;\nimport javax.jms.JMSException;\nimport com.ibm.mq.jms.*;\nimport com.ibm.jms.JMSMessage;\nimport javax.jms.TextMessage;\n\npublic class SendReceive {\n private MQQueueConnectionFactory connectionFactory;\n private MQQueueConnection connection;\n\n private void runTest() {\n try {\n connect();\n connection.start();\n MQQueueSession session = (MQQueueSession) connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\n MQQueue queue = (MQQueue) session.createQueue(\"INBOUND_QUEUE\"); /* values replaced with correct values in deployment server */\n MQQueue queue2 = (MQQueue) session.createQueue(\"OUTBOUND_QUEUE\"); /* values replaced with correct values in deployment server */\n MQQueueSender sender = (MQQueueSender) session.createSender(queue); \n\n MQQueueReceiver receiver = (MQQueueReceiver) session.createReceiver(queue2);\n\n //TextMessage message = session.createTextMessage(\"yesyesyes\");\n String stt = \"Test Message\"; //\n\n TextMessage message = session.createTextMessage(stt);\n message.setJMSReplyTo(queue2);\n sender.send(message);\n System.out.println(\"Sent: \" + message);\n\n Message msg1 = receiver.receive(5000);\n if(msg1!=null){\n String responseMsg = ((TextMessage) msg1).getText();\n System.out.println(\"Received: \" + responseMsg);\n }else{\n System.out.println(\"Message received is null\");\n }\n }catch(Exception e){\n System.out.println(\"Exception caught in program : \" + e);\n e.printStackTrace();\n }\n }\n\n public boolean connect() {\n boolean connected = false;\n try {\n /* values below are replaced with correct values in deployment server */\n\n connectionFactory = new MQQueueConnectionFactory(); \n connectionFactory.setPort(1515);\n connectionFactory.setHostName(\"192.168.1.23\"); // \n connectionFactory.setQueueManager(\"QCCMGR\");\n connectionFactory.setChannel(\"QCHANNEL\"); \n connectionFactory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);\n\n connection = (MQQueueConnection) connectionFactory.createQueueConnection();\n connected = true;\n } catch (Exception e) {\n connected = false;\n }\n return connected;\n }\n\n public static void main(String[] args) {\n new SendReceive().runTest();\n }\n\n}### Assistant: MQ v5.3 was released November 29th 2002 and has been out of support since September 28th 2007 (almost 9 years). The version may not have anything to do with your issue but I would strongly suggest that you move to a supported version of the MQ client. Newer MQ client versions can connect to older MQ queue managers. You can download a java only install of MQ 8.0 or MQ 9.0 jar files at the links below:IBM MQ v8.0 ClientIBM MQ v9.0 ClientI read on some old threads that having the sender and receiver on the same session caused problems when a timeout was specified. Try adding another session for the receiver.private void runTest() {\n try {\n connect();\n connection.start();\n MQQueueSession session = (MQQueueSession) connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\n MQQueueSession session2 = (MQQueueSession) connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\n MQQueue queue = (MQQueue) session.createQueue(\"INBOUND_QUEUE\"); /* values replaced with correct values in deployment server */\n MQQueue queue2 = (MQQueue) session2.createQueue(\"OUTBOUND_QUEUE\"); /* values replaced with correct values in deployment server */\n MQQueueSender sender = (MQQueueSender) session.createSender(queue); \n\n MQQueueReceiver receiver = (MQQueueReceiver) session2.createReceiver(queue2);\n\n //TextMessage message = session.createTextMessage(\"yesyesyes\");\n String stt = \"Test Message\"; //\n\n TextMessage message = session.createTextMessage(stt);\n message.setJMSReplyTo(queue2);\n sender.send(message);\n System.out.println(\"Sent: \" + message);\n\n Message msg1 = receiver.receive(5000);\n if(msg1!=null){\n String responseMsg = ((TextMessage) msg1).getText();\n System.out.println(\"Received: \" + responseMsg);\n }else{\n System.out.println(\"Message received is null\");\n }\n }catch(Exception e){\n System.out.println(\"Exception caught in program : \" + e);\n e.printStackTrace();\n }\n }Try taking a JMS trace by adding the following to the execution of the java app:-DMQJMS_TRACE_LEVEL=base\n-DMQJMS_TRACE_DIR=/tracedirectoryex:java -DMQJMS_TRACE_LEVEL=base -DMQJMS_TRACE_DIR=/tracedirectory JavaAppThis should produce a file that I believe ends in.trcin the directory you specify.You can review this for errors that might help point you in the right direction.Suggestions:Try changing your program to force it to send a blank username:connection = (MQQueueConnection) connectionFactory.createQueueConnection(\"\", \"\");Try closing the sender aftersender.sendis calledsender.close();With out further information it is difficult to determine the cause. The more information you can gather the better.\n"} +{"text": "### Human: can any one guide me on, to get connect with ibm websphere mq by using c#.net, reason was i am trying to push the message in to MQ, kindly can any give me suggestion to connect by using c#.net### Assistant: There is an IBM supplied dll (since v5.3 Fixpack8) on Windows called amqmdnet.dll, which is a .NET assembly providing an IBM supported model for MQSeries. (Reference) It is usually located inC:\\Program Files\\IBM\\WebSphere MQ\\bin\\amqmdnet.dllIf you need more direction, there are several examples on how to communicate with MQ from .NET on CodeProject:http://www.codeproject.com/Articles/12198/IBM-WebSphere-MQ-with-C-GUI-application-that-is-bohttp://www.codeproject.com/Articles/37807/How-to-Setup-a-Websphere-MQ-with-C-NET-GUI-to-Puthttp://www.codeproject.com/Articles/6212/C-and-WebSphere-MQ-formerly-MQSeries-Client-ServerAlso, there's this walkthrough that could be helpful:http://www.c-sharpcorner.com/UploadFile/pk_khuman/AquickstartCsharpWebsphereMQ07112006024017AM/AquickstartCsharpWebsphereMQ.aspx\n"} +{"text": "### Human: WebSphere Application Server 8.0 is available in a free developer edition, is there also one available for WebSphere MQ?### Assistant: There is a developer edition of Websphere MQ 8 and 9 for Windows and Linux.You can grab it here:https://developer.ibm.com/messaging/mq-downloads/\n"} +{"text": "### Human: I'm currently working on a project where I need to interface with an IBM system which communicates with the outside world through WebSphere MQ. I need to query the system in a \"request-response\" fashion using queues, and I will be doing this through a queue manager.However, I can't quite get my head around how this works in practical terms.Say I've got multiple instances of the same application which puts a message onto a request queue. The message gets aCorrelationIdandMessageIdupon leaving the application, and aReplyToQueueproperty gets set on each message to make sure that the queue manager knows which queue to put the response onto.However, how does the queue manager operate the response queue? There is no guarantee with regards to the timing of responses, so how is it that the correct response gets back to the application instance which issued the corresponding request?I keep thinking of message queues as a FIFO queue where messages must be picked one by one. However, this would mean that instance A could pick a response meant for instance B. Obviously, this can't be how it works.Then, when I look at the API (com.ibm.mq.MQQueue) I see that to pick a message I have the chance to provide theCorrelationIdandMessageIdof the request message. Does this mean that when I query the queue manager for a message (with these ID's set), the queue manager iterates through the messages in the queue and returns the matching message? This, on the other hand, would mean that we're not talking about a FIFO queue?### Assistant: It is common practice to use CorrelationId to relate request and response messages. It works this way:1) Let's assume there are two queues, a REQQ - request queue where messages are put asking another application, service application, to pick up and process and a RESPQ to which the service application puts replies.2) The requester application (let's call it as REQAPP) puts a request message (REQMSG) to request queue (REQQ). Before sending the message the REQAPP sets ReplyToQ property on the messages to RESPQ. When the request message is sent, the JMS provider updates the sent message with a unique MessageId. The requester application caches this unique MessageId for later use.3) On the other side of the world, the service application retrieves the REQMSG from REQQ, reads the MessageId and ReplyToQ property from that message, processes the request and prepares appropriate response message RESPMSG. It then sets the CorrelationId property of the RESPMSG to the MessageId read from the REQMSG and puts the reply to ReplyToQ.4) The requester application when reading replies, it uses the caches MessageId and sets selection criteria as below to read reply messageGET MESSAGE FROM RESPQ WHERE RESPMSG.CORRELATIONID==REQMSG.MESSAGEIDThis selection criteria makes sure that correct response messages is retrieved. The key here is the service application must set the CorrelationId on the response message to the MessageId of request message.Although Queue is FIFO type, MQ implementation provides message delivery on a Priority basis where messages with high priority are delivered first or FIFO basis where message on top of the queue is delivered first. Messages can also be retrieved using selection criteria as explained in above example.Hope this helped\n"} +{"text": "### Human: Perhaps I am barking up the wrong tree - but I have a set of services (WebAPI and WCF) that use WebSphere MQ to interact with other systems.This works without issue - until I now need to find a way oflisteningfor messages on one of the queues.Is this even possible, or do I need to go down the windows Service route?### Assistant: You could write a Windows service that is continually calling MQ Get on the queue, and invokes a WCF service to process the message. Or you could write a trigger program (a console application) that MQ will launch for you when a message arrives, that invokes the WCF service.\n"} +{"text": "### Human: What is the difference between Websphere Message Broker and Websphere MQ? Is there any equivalent terminology for the same in a weblogic environment?\nAlso, strictly speaking, which one of the two (WMB vs WMQ) is an implementation for JMS API?### Assistant: WebSphere MQ is a messaging engine that provides assured delivery of some message/payload. MQ provides a Queue Manager: a server application that hosts Queues (to hold messahes) and Channels & Listeners (to allow Queue Managers to communicate with each other). MQ provides an API interface that implements JMS. It also has a number of APIs native to MQ. As of WebSphere MQ version 7.0.1 it also provides a publish-subscribe engine. WebSphere MQ basically lets you put a message in one place and get that message somewhere else with the smallest chance of the message being lost.WebSphere Message Broker is a program that attempts to provide an any-transport-to-any-transport interface, and an any-language transformation engine. In terms of transports, it provides MQ, JMS (most providers), MQ-FTE, local files, SMTP, FTP/SFTP, HTTP/HTTPS, TCP/TCPSSL, JDBC and probably some other entry hooks I have forgotten. Once the message is in MEssage Broker, you can manipulate that message using ESQL (SQL-like language native to Message Broker), Java, PHP, XSTL. It also contains functionality for message routing, collecting, aggregation, sequencing etc. Message Broker basically allows you to move data from a number of formats (both physical and logical) and manipulate that data before putting it somewhere else, possibly in a different format.\n"} +{"text": "### Human: JMS Topic and JMS Selector are quite different concept, yet they both can be used by a consumer to get only a subset of the messages.in a PubSub scenario, what are the pro\u2019s and con`s of filtering messages using:Option 1) Publishing everything in a single Topic and consumers uses JMS SelectorOption 2) Subscriber subscribe to one or multiple Topic.Exemple:I am Publishing Client Data Message and Subscriber might want to get only a particular type of client. A client types is defined in different attribute like \u2018ClientGroup\u2019 \u2018ClientSource\u2019 \u2018ClientOrgUnit\u2019 \u2018ClientSize\u2019 etcWhat should I do:1) Create a different Topic for each client typeOR2) On topic and Have each type in a JMS Property and let Subscriber use Selectors?Thank you### Assistant: In general, selection based on topic string should be faster. A side effect of selection on topic in a WebSphere MQ cluster is that messages are not distributed to network nodes that will not consume them. In WMQ V6 message selectors are implemented at the client so the application still gets every message but only sees the ones that match the selection criteria. In WMQ V7 the QMgr will perform the selection but the message must get to the QMgr for that to happen. So if every client is subscribed to the same topic then messages will flow to every QMgr where a client is connected. But if the clients subscribe at granular points in the topic tree, messages will only go to nodes where something has subscribed to them.Apart from distribution, the question of topic or property selection is greatly influenced by taxonomy. The design of the topic tree should provide granularity according to the logical data hierarchy but, unlike a file system, there are no \"soft links\" possible to overlay alternate structures within the tree. It is a simple hierarchy.In many cases there are data elements which if used in the topic tree would break the taxonomy and yet these are needed for selection. These are candidates for properties.Topic elements tend to be more categorical in nature. Items such as region, cost center, department number, branch number tend to fall into topic trees because they serve to partition data according to categorical business requirements.So as a general rule, use topics for those things by which you might summarize transactions. These generally follow the existing and natural taxonomies you already use to define your business. For example, department or cost center are two common elements. If you can easily imagine a report broken down by that value, it may be a topic element. \"Show me all transactions from branch 01234\" is an example. Use properties for things that are attributes of specific transactions rather than categories. Examples here would include color or price. Chances are \"show me all transactions for blue items\" sounds wrong because blue is not a categorical element and therefore is probably not a good candidate for the topic tree. (Unless you are in the paint business!)\n"} +{"text": "### Human: I have an webapp that is expected to fetch and display data from an External App which is accessible only via messaging (JMS).So, if a user submits a request on a browser, the same HTTP request thread will have to interact with the Messaging system (MQ Series) such that the same request thread can display the data received from the Messaging System.Is there a pattern I can make use of here? I saw some vague references on the net that use \"Correlation ID\" in this way:Msg m = new TextMsg(\"findDataXYZ\");\nString cr_id = m.setCorrelationID(id);\n\nsendQueue.send(m).\n\n// now start listening to the Queue for a msg that bears that specific cr_id\n\nResponse r = receiverQueue.receive(cr_id);Is there something better out there? The other patterns I found expect the response to be received asynchronously.. which is not an option for me, since I have to send the response back on the same HTTP request.### Assistant: The request/reply messaging pattern is useful for your requirement. You typically use a CorrelationId to relate request & reply messages.While sending request message you set JMSReplyTo destination on the message. Typically a temporary queue is used as JMSReplyTo destination. When creating a consumer to receive response use a selector with JMSCorrelationId, something likecons = session.createConsumer(tempDestination,\"JMSCorrelationId=\"+requestMsg.JMSMessageId);At the other end, the application that is processing the request message must use the JMSReplyTo destination to send response. It must also use the MessageId of the request message and set it as CorrelationId of the response message.\n"} +{"text": "### Human: I want to use JMS to connect to IBM MQ.\nHow do i specify the queuemanager, the channel and other properties ?### Assistant: Using JNDI for connectionFactory/destinations lookups, provide theInitialContextwith the following properties:java.naming.provider.url=:/\njava.naming.factory.initial=com.ibm.mq.jms.context.WMQInitialContextFactory\njava.naming.security.authentication=none\njava.naming.security.credentials=\njava.naming.security.principal=using WAS (Websphere Application Server) queues, the properties would be as follows:java.naming.provider.url=iiop://:\njava.naming.factory.initial=com.ibm.websphere.naming.WsnInitialContextFactory\njava.naming.security.authentication=none\njava.naming.security.credentials=\njava.naming.security.principal=The rest would be as follows:Properties config = new Properties();\nconfig.load(new FileInputStream(\"connectionConfig.properties\"));// this file would contain the properties above\nInitialContext context = new InitialContext(config);\nConnectionFactory factory = (ConnectionFactory) context.lookup(\"ConnectionFactory\");// connection factory name\nDestination destination = (Destination) context.lookup(\"destination\");// queue/topic name\n"} +{"text": "### Human: I am getting an WebSphere MQ Reason code 2195MQRC_UNEXPECTED_ERRORwhen I try to connect to the message flows deployed on the execution group. Can somebody please tell me what exactly does this reason code mean? Queue manager, broker , execution group.. everything is up and running and the ports are also open. I am not getting anything worthwhile on the net.\nPlease advise.### Assistant: The 2195 return code is a high-level exception that is hit when errors are not caught at lower levels in the code. Very often these are generated when some external dependency such as file access or OS resources do not behave as expected and the failure cascades into WMQ.Usually when these errors are thrown, WMQ will produce an FDC file in{WMQ install dir}/errorsto record the event. The FDC file tells which executable failed, the function that was executing during the failure, the environment, user ID and many other details. These can be used by IBM to diagnose the problem but are often useful for WMQ admins as well.As a general rule, for any WMQ error that you cannot easily diagnose, take a look in:{WMQ install dir}/qmgrs/{qmgr name}/errors/AMQERR01.LOG{WMQ install dir}/errors/AMQERR01.LOG{WMQ install dir}/errors/*.FDCWhen reporting an error, please post whether you found any error log entries or new FDC files in these locations and if so what the content of these was. This will make it easier for respondents to to provide answers that are specific and relevant. If you care to update your question with diagnostic info from theerrorsdirectories, I'll be happy to update this response in kind.\n"} +{"text": "### Human: What is the algorithmic time complexity of applying JMS selectors when consuming messages from a queue, with respect to queue depthn? In particular, is it linear (O(n)) per read? Is it implementation-dependent (on the JMS provider), and does it depend on what fields are being requested?(if implementation dependent, I'm particularly interested in Websphere MQ and Solace's behaviour, but I welcome answers that deal with any particular JMS provider, especially if you have links to documentation describing the complexity!).Motivation: each message has two properties: aninvocationIDand abatchName. A batch consists of several invocations.\u00a0Clients wish to\u00a0consume messages in one of two ways; either byinvocationIDor bybatchName.\u00a0At the point that messages are produced, I don't know by which method they will be consumed.This can be implemented through selectors:invocationID=42OrbatchName=\"reconciliation\"...and I can speed one of these up by using the correlation ID instead of a custom property, but am concerned that the other will remain slow.### Assistant: According to the docs, the messages are searched sequentially. WMQ does however index theMessageIDandCorrelIDfields. The Infocenter describes the behavior as follows:Selecting messages from a queue requires WebSphere MQ to sequentially\n inspect each message on the queue. Messages are inspected until a\n message is found that matches the selection criteria or there are no\n more messages to examine. Therefore, messaging performance suffers if\n message selection is used on deep queues.To optimize message selection on deep queues when selection is based\n on JMSCorrelationID or JMSMessageID, use a selection string of the\n form JMSCorrelationID = ... or JMSMessageID = ... and reference only\n one property.This method offers a significant improvement in performance for\n selection on JMSCorrelationID and offers a marginal performance\n improvement for JMSMessageID.I would love to understand more about the requirement to multiplex queues. A complex selector is going to impact performance on anyone's implementation and the alternative of using multiple open handles with simpler selectors is no different to the app code than using multiple queues. For WMQ of course, dynamic queues or many permanently defined queues is no problem at all. Very often when I see this requirement, it comes from shops that have used certain other transports where performance takes a severe dive with many queues defined and there is an assumption that this is true on WMQ as well. In other cases the requirement has been met with Pub/Sub and durable subscriptions. I'm not suggesting there are no valid cases for this requirement, just wondering what is driving it.\n"} +{"text": "### Human: I am testing WebSphere on local for development purposes and now i wanted to move to new PC. But i dont remember exactly how i get rid of that error in title. I know there are tons of posts about this error since introduction MQ 7.1 how to disabled security. I remember last time i did runmqsc.exe QM_name -> ALTER CHLAUTH(DISABLED). But its not working anymore?! What else i need to change so anyone can connect to queue?> DIS QMGR CHLAUTH\n> 2 : DIS QMGR CHLAUTH AMQ8408: Display Queue Manager details. \n> QMNAME(QueueManager1) CHLAUTH(DISABLED)Thanks.### Assistant: WebSphere MQ V7.1 introduced CHLAUTH rules which by default banned remote access by privileged users. To turn off CHLAUTH you are correct that you can issueALTER QMGR CHLAUTH(DISABLED)However, you could also very simply allow yourself access on a particular channel as described inCHLAUTH - Allow some privileged admins.IBM MQ V8 introduced Connection Authentication which default demands a password to authenticate a remote privileged user. To make this OPTIONAL (as it is for non-privileged users) you can issueALTER AUTHINFO(SYSTEM.DEFAULT.AUTHINFO.IDPWOS) AUTHTYPE(IDPWOS)\n CHCKCLNT(OPTIONAL)rather than turning it off completely withALTER QMGR CONNAUTH(' ')After either of these commands you'll need to issue the following command for the queue manager to be aware of your changes.REFRESH SECURITY TYPE(CONNAUTH)You mention that this is for development purposes which is fair enough, but remember to turn these features on so that you can make your queue manager secure when using it in production!Also, remember that the queue manager error log will provide you with details about why your application got the 2035, for example, \"Channel is Blocked\" for CHLAUTH and \"Missing password\" for CONNAUTH.\n"} +{"text": "### Human: i am using MQ7 and trying to access a queue with JMS api's. Getting this error.\nHas anyone seen it before? How do i resolve this? TIAException in thread \"main\" com.ibm.msg.client.jms.DetailedJMSException: \n JMSFMQ6312: An exception occurred in the Java(tm) MQI. The Java(tm) MQI has thrown an exception describing the problem. See the linked exception for further information.Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2495;AMQ8568: The native JNI library 'mqjbnd' was not found. [3=mqjbnd]Caused by: java.lang.UnsatisfiedLinkError: no mqjbnd in java.library.path### Assistant: Probably a bit late but I had the same problem and found that this can be avoided if you use a different Connection Mode when connecting to a remote Queue. By default theMQConnectionFactoryusesWMQ_CM_BINDINGSas it's connection mode. If you change it toWMQ_CM_CLIENT(or whichever connection mode you like that doesn't require native libraries) you should be fine.@Test\npublic void testMQConnectionMode() throws JMSException {\n MQConnectionFactory cf = new MQConnectionFactory();\n assertThat(cf.getIntProperty(CommonConstants.WMQ_CONNECTION_MODE), is(equalTo(CommonConstants.WMQ_CM_BINDINGS)));\n cf.setIntProperty(CommonConstants.WMQ_CONNECTION_MODE, CommonConstants.WMQ_CM_CLIENT);\n assertThat(cf.getIntProperty(CommonConstants.WMQ_CONNECTION_MODE), is(equalTo(CommonConstants.WMQ_CM_CLIENT)));\n}\n"} +{"text": "### Human: Hello has anyone ever used Camel with IBM's MQ. We are looking at possibly using the two products together but have no example of the two products working together.### Assistant: I have extensive use of IBM MQ's with camel. There is no issue using both together. I will paste a sample configuration from one of my spring context files leveraging a camel Jms Endpoint, A spring connection factory, and an IBM MQ definition.Camel Routefrom(\"someplace\")\n .to(\"cpaibmmq:queue:myQueueName\");Spring Context\n \n \n \n \n \n \n \n \n\n\n\n \n \n \n \n \n \n \n \n \n\n"} +{"text": "### Human: For days our log has been full of this message2018-06-15 12:19:23 WARN [com.arjuna.ats.arjuna] (Periodic Recovery) Transaction 0:ffff0a983f1e:1f3aa2ff:5a09aa02:d1c08c has 1 heuristic participant(s)!\n2018-06-15 12:19:23 WARN [com.arjuna.ats.jta] (Periodic Recovery) ARJUNA016037: Could not find new XAResource to use for recovering non-serializable XAResource XAResourceRecord < resource:null, txid:< formatId=131077, gtrid_length=46, bqual_length=36, tx_uid=0:ffff0a983f1e:1f3aa2ff:5a09aa02:d1c08c, node_name=acme_node, branch_uid=0:ffff0a983f1e:1f3aa2ff:5a09aa02:d1c08d, subordinatenodename=null, eis_name=unknown eis name >, heuristic: TwoPhaseOutcome.FINISH_OK com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord@6569a57c >\n2018-06-15 12:19:23 WARN [com.arjuna.ats.arjuna] (Periodic Recovery) Transaction 0:ffff0a983f1e:1f3aa2ff:5a09aa02:d1c08c restored heuristic participant XAResourceRecord < resource:null, txid:< formatId=131077, gtrid_length=46, bqual_length=36, tx_uid=0:ffff0a983f1e:1f3aa2ff:5a09aa02:d1c08c, node_name=acme_node, branch_uid=0:ffff0a983f1e:1f3aa2ff:5a09aa02:d1c08d, subordinatenodename=null, eis_name=unknown eis name >, heuristic: TwoPhaseOutcome.FINISH_OK com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord@6569a57c >It is always the same Xid. Is there a way to solve this? We are considering gracefully shutting down the application and deleting the files in data/tx-object-store. Is this a good idea?That's with WildFly 11. We have XA transactions set up with Oracle 12c and IBM WebSphere MQ. We are doing XA transactions from a message driven bean to JDBC.### Assistant: I found the answer to the problem in2.4.1. Assumed completeof the transaction guide.If a failure occurs in the transaction environment after the transaction coordinator had told the XAResource to commit but before the transaction log has been updated to remove the participant, then recovery will attempt to replay the commit. In the case of a Serialized XAResource, the response from the XAResource will enable the participant to be removed from the log, which will eventually be deleted when all participants have been committed. However, if the XAResource is not recoverable then it is extremely unlikely that any XAResourceRecovery instance will be able to provide the recovery sub-system with a fresh XAResource to use in order to attempt recovery; in which case recovery will continually fail and the log entry will never be removed.There are two possible solutions to this problem:Rely on the relevant ExpiryScanner to eventually move the log elsewhere. Manual intervention will then be needed to ensure the log can be safely deleted. If a log entry is moved, suitable warning messages will be output.Set the com.arjuna.ats.jta.xaAssumeRecoveryComplete to true. This option is checked whenever a new XAResource instance cannot be located from any registered XAResourceRecovery instance. If false (the default), recovery assumes that there is a transient problem with the XAResourceRecovery instances (e.g., not all have been registered with the sub-system) and will attempt recovery periodically. If true then recovery assumes that a previous commit attempt succeeded and this instance can be removed from the log with no further recovery attempts. This option is global, so needs to be used with care since if used incorrectly XAResource instances may remain in an uncommitted state.\n"} +{"text": "### Human: I wrote a Java program to connect to Websphere MQ to publish messages. I created a JNDI namespace, connection factory, destinations, and queue manager in Websphere MQ Explore. When I am running my program it is showingClassCastExceptionfor type casting fromstringtoConnectionFactory.Here is my code. Can anyone help resolve this problem.JNDIUtil.javapackage com.tradefinance.jms.util;\n\n//JMS classes\nimport javax.jms.JMSException;\nimport javax.jms.ConnectionFactory;\nimport javax.jms.Destination;\n\n//JNDI classes\nimport javax.naming.InitialContext;\nimport javax.naming.Context;\nimport javax.naming.NamingException;\n\n//Standard Java classes\nimport java.util.Hashtable;\nimport java.util.Properties;\n\n/**\n* \n* A wrapper class for JNDI calls\n*\n*/\npublic class JNDIUtil\n{\n private Context context;\n\n public JNDIUtil(String icf, String url) throws JMSException, NamingException\n {\n Hashtable environment = new Hashtable();\n\n environment.put(Context.INITIAL_CONTEXT_FACTORY, icf ); \n environment.put(Context.PROVIDER_URL, url);\n\n context= new InitialContext( environment );\n\n }\n\n /**\n * @param ObjName Object Name to be retrieved\n * @return Retrieved Object\n * @throws NamingException\n */\n private Object getObjectByName(String ObjName) throws NamingException\n {\n\n return context.lookup(ObjName);\n }\n\n /**\n * @param factoryName Factory Name\n * @return ConnectionFactory object\n * @throws NamingException\n */\n public ConnectionFactory getConnectionFactory(String factoryName) throws NamingException\n {\n return (ConnectionFactory) getObjectByName(factoryName);\n }\n\n /**\n * @param destinationName Destination Name\n * @return ConnectionFactory object\n * @throws NamingException\n */\n public Destination getDestination(String destinationName) throws NamingException\n {\n return (Destination) getObjectByName(destinationName);\n\n }\n}NewPublisher.javapackage com.tradefinance.jms.topics;\n\n//JMS classes\nimport javax.jms.JMSException;\nimport javax.jms.ConnectionFactory;\nimport javax.jms.Connection;\nimport javax.jms.Session;\nimport javax.jms.Destination;\nimport javax.jms.MessageProducer;\nimport javax.jms.TextMessage;\n\n//JNDI classes\nimport javax.naming.NamingException;\n\nimport com.tradefinance.jms.util.JNDIUtil;\n\n/**\n * A class to demonstrate how to a publish to a topic.\n */\npublic class NewsPublisher\n{\n\n public static String icf = \"com.sun.jndi.fscontext.RefFSContextFactory\";\n public static String url = \"file:/C:/JNDI-Directory/\";\n\n public static void main(String[] vars) throws JMSException, NamingException\n {\n\n ConnectionFactory factory = null;\n Connection connection = null;\n Session session = null;\n Destination destination= null; // a destination can be a topic or a queue\n MessageProducer producer= null; \n\n\n try\n { \n\n JNDIUtil jndiUtil= new JNDIUtil(icf,url);\n\n factory= jndiUtil.getConnectionFactory(\"TestQM1ConnectionFactory\");\n\n connection = factory.createConnection(); \n connection.start();\n\n // Indicate a non-transactional session \n boolean transacted = false;\n session = connection.createSession( transacted, Session.AUTO_ACKNOWLEDGE); \n\n destination = jndiUtil.getDestination(\"NewsTopic\");\n\n producer = session.createProducer(destination);\n\n TextMessage message = session.createTextMessage(\"No News is Good News!\");\n producer.send(message); \n\n System.out.println(\"NewsPublisher: Message Publication Completed\");\n\n }\n finally\n {\n // Always release resources\n\n if ( producer!= null )\n producer.close(); \n\n if ( session!= null )\n session.close();\n\n if ( connection!= null )\n connection.close();\n\n } \n } \n}Getting the error on these lines:return (ConnectionFactory) getObjectByName(factoryName); \nin JNDIUtil.java\n\nfactory= jndiUtil.getConnectionFactory(\"TestQM1ConnectionFactory\");\nin NewPublisher.java### Assistant: You are missing someJARsofMQ Clientto get this working. \nI had the same error, and after some further investigation, I ended up with this list of Jars in order to get this working:com.ibm.mq.jmqi.jarcom.ibm.mqjms.jardhbcore.jarfscontext.jarproviderutil.jarcom.ibm.mq.headers.jar\n"} +{"text": "### Human: I'm thinking about system that will notify multiple consumers about events happening to a population of objects. Every subscriber should be able to subscribe to events happening to zero or more of the objects, multiple subscribers should be able to receive information about events happening to a single object.I think that some message queuing system will be appropriate in this case but I'm not sure how to handle the fact that I'll have millions of the objects - using separate topic for every of the objects does not sound good [or is it just fine?].Can you please suggest approach I should should take and maybe even some open source message queuing system that would be reasonable?Few more details:there will be thousands of subscribers [meaning not plenty of them],subscribers will subscribe to tens or hundreds of objects each,there will be ~5-20 million of the objects,events themselves dont have to carry any message. just information that that object was changed is enough,vast majority of objects will never be subscribed to,events occur at the maximum rate of few hundreds per second,ideally the server should run under linux, be able to integrate with the rest of the ecosystem via http long-poll [using node js? continuations under jetty?].Thanks in advance for your feedback and sorry for somewhat vague question!### Assistant: I can highly recommendRabbitMQ. I have used it in a couple of projects before and from my experience, I think it is very reliable and offers a wide range of configuraions. Basically, RabbitMQ is anopen-source( Mozilla Public License (MPL) ) message broker that implements theAdvanced Message Queuing Protocol (AMQP)standard.As documented on the RabbitMQ web-site:RabbitMQ can potentially run on any platform that Erlang supports, from embedded systems to multi-core clusters and cloud-based servers.... meaning that an operating system like Linux is supported.There is a library for node.js here:https://github.com/squaremo/rabbit.jsIt comes with an HTTP based API for management and monitoring of the RabbitMQ server - including a command-line tool and a browser-based user-interface as well - see:http://www.rabbitmq.com/management.html.In the projects I have been working with, I have communicated with RabbitMQ using C# and two different wrappers,EasyNetQandBurrow.NET. Both are excellent wrappers for RabbitMQ but I ended up being most fan of Burrow.NET as it is easier and more obvious to work with ( doesn't do a lot of magic under the hood ) and provides good flexibility to inject loggers, serializers, etc.I have never worked with the amount of amount of objects that you are going to work with - I have worked with thousands ( not millions ). However, no matter how many objects I have been playing around with, RabbitMQ has always worked really stable and has never been the source to errors in the system.So to sum up - RabbitMQ is simple to use and setup, supports AMQP, can be managed via HTTP and what I like the most - it's rock solid.\n"} +{"text": "### Human: This is similar to the earlier questionException in thread \u201cmain\u201d java.lang.NoClassDefFoundError: com/ibm/mq/MQExceptionI am facing a similar issue in Linux. I have installed the following:MQSeriesRuntime-7.0.1-3.x86_64.rpmMQSeriesSDK-7.0.1-3.x86_64.rpmMQSeriesJava-7.0.1-3.x86_64.rpmMQSeriesServer-7.0.1-3.x86_64.rpmWhen I create an execution group , I get:java.lang.ClassNotFoundException: com.ibm.mq.MQExceptionI haveCLASSPATHset by using this line of code:export CLASSPATH=$CLASSPATH:/opt/mqm/java/lib/com.ibm.mq.jmqi.jar:/opt/mqm/java/lib/com.ibm.mq.jar:.Version of broker is 8.0.0.1 and that of MQ is 7.0.1.3 . Can you please suggest what is wrong? According to the previous answer, am I supposed to install the Client also?### Assistant: You need to review the WMQ Using Java manual for WMQ v7.0.1.*, as you are missing MQ JAR files.For MQ base Java (not MQ/JMS), you need at least 5 MQ JAR files:com.ibm.mq.jarconnector.jarcom.ibm.mq.jmqi.jarcom.ibm.mq.headers.jarcom.ibm.mq.commonservices.jar\n"} +{"text": "### Human: I've used .NET quite extensively but I'm pretty new to WebSphere MQ. I need to create a .NET application that reads messages off the MQ. I keep seeing articles referencing either the IBM.XMS or amqmdnet libraries.IthinkI'm supposed to be using the IBM.XMS library but what exactly is the difference between these two?Thanks!### Assistant: IBM.XMS is the IBM's implementation of JMS specification in C#. You need to use IBM.XMS if you need JMS style of messaging in C# or any other language of .NET framework. On the other hand amqmdnet is the MQ's native API implementation, something similar to C MQI but it's in C# and is Object oriented. Use amqmdnet if you want MQ native style of messaging.HTH.\n"} +{"text": "### Human: I'm looking for a solution to run IBM MQ Client under a Windows Docker container. I know that Docker Hub only provides Linux implementations of MQ, however, I do not need full MQ Server capability. Instead, I'm hoping there's a means to install the MQ Client and simply connect to a Channel and Queues defined on another (non-Docker) system. To approach this, I've done the following:Spun up a Windows Docker container running under a command prompt (For proof of concept)Copied in and expanded MQ Client9.0.0.8-IBM-MQC-Win64.zipSilently installed MQ Client (e.g.msiexec /i \"c:\\temp\\Windows\\MSI\\IBM MQ.msi\" /l*v c:\\temp\\install.log /q TRANSFORMS=\"1033.mst\" AGREETOLICENSE=\"yes\" ADDLOCAL=\"Client\").Note: The installation was successful and without errorEstablished required environment variables(MQServer, etc.) and updated paths (classpath, lib, include, etc).Pinged the MQ server system to verify connectivity.I attempted to put a message on a working, verified queue using,amqsputc.exe MYDOCKER.DS.Q. The immediate return code isMQCONNX ended with reason code 2195. Unfortunately,2195is pretty generic and there are no other logs available to review.I understand the differences between running MQ under a VM versus a container, however since I only need Client access, I was hoping MQ Client was lightweight enough to be usable.If MQ Client is not a viable direction, is there an MQ solution which might be doable via a Cloud connection? My legacy application is Windows-based and relies on MQ for job messaging.### Assistant: Instead of installing the Full client install usingmsiexec, I would recommend that you use the IBM MQ Redistributable client install. This is packaged as a simple zip file for windows which you can extract into any location you choose.You can find more information about the Redistributable client on the Knowledge Center pageRedistributable IBM MQ clients.You can download the IBM MQ Redistributable clients using the links below:IBM MQ 9.1 Redistributable client.IBM MQ 9.2 Redistributable client.Note:IBM MQ 8.0 is out of support as of April 30th 2020 and IBM MQ 9.0 is going out of support on September 30th 2021.The IBM Knowledge center pageLimitations and other considerations for redistributable clientsgives these requirements:Windows C runtime librariesYou might have these libraries on your machine already, but if you do not, you need to download and install the following Microsoft C/C++ runtime libraries:Microsoft Visual C++ Redistributable 2008Microsoft Visual C++ Redistributable 2012The download links for the redistributable downloads for each of these libraries can be found atThe latest supported Visual C++ downloads.\n"} +{"text": "### Human: I am working with WebSphere MQ FTE. While reading a document I came across a sentence that the bridge agent connects to local queue manager through binding mode. What is meant by binding mode in WebSphere MQ?### Assistant: WebSphere MQ was originally created to be a local communication stack that resided on the same server as the applications that used it. In this mode, applications talk to it using Inter Process Communication (IPC). This is where two processes on the same server intercommunicate using shared memory, semaphores and other local communication.Eventually the MQ client was created and allowed applications to communicate with WebSphere MQ over the network. This meant that there were now two modes of communication with the queue manager. The term Client Mode naturally arose to refer to communications using the MQ client. The term Bindings Mode arose to differentiate client mode from native WMQ IPC connections.So when you read that an FTE agent uses bindings mode connections, that means that it runs on the same server as a queue manager and that it communicates with the queue manager using shared memory instead of over the network.Note that with WebSphere MQ File Transfer Edition the licensing refers to \"Client\" and \"Server\" bundles of the products. The Client package is the FTE agents without a copy of WebSphere MQ Server included. The Server package is the same FTE components bundled with a copy of WebSphere MQ Serverand with the ability to connect in bindings mode.\n"} +{"text": "### Human: As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened,visit the help centerfor guidance.Closed10 years ago.We are facing a choice to use IBM MQ over SFTP for file transfer. I've heard advantages of such approach, but I've never see anyone actually using it for a large files.So main question: how well IMB MQ can handle transfer of large files (up to 100 MB)? Is it stable? It's from mainframe to UNIX server, if it does matter.Thanks a lot.### Assistant: I've used MQ with files up to 8GB in size, without incident. You have to allocate enough space for MQ to manage them, but it works.\n"} +{"text": "### Human: All documemtation and information shows that we have to have an MQ Series client installed on the machine where we want to use it.Does anyone know of a DLL (or whatever) that allows us to include MQ Series support in a .net project thatdoes notrequire a local install?### Assistant: Updated with info on officialIBM MQ Redistributable Client.Excerpt:From IBM MQ Version 8.0.0, Fix Pack 4, native redistributable client\n runtime libraries are provided for Linux x86-64 and Windows 64-bit\n platforms to make it simple to distribute both applications and the\n required IBM MQ runtime libraries. A third package, which is not\n platform-specific, contains the runtime files that are required for\n the Java\u2122/JMS applications, including the IBM MQ resource adapter for\n JMS applications that are running under an application server.The redistributable client that is supplied with IBM MQ is also a\n non-installed and relocatable image. Maintenance of a redistributable,\n non-installed image, is achieved through replacement; that is, you\n download newer versions of the runtime components when they are\n shipped.A redistributable client implies distributing the required run time\n with an application both inside and outside of your environment.A relocatable client implies putting the files somewhere else other\n than a fixed default location. For example, instead of installing into\n /opt/ installing into /usr/local.A non-installed client implies that you are not required to lay down\n client files, and that these files can be copied as required.The IBM IPLA license agreement is extended for IBM MQ to enable you to\n download a number of additional runtime files fromFix Central.From IBM MQ Version 9.0.5, XMS .NET is shipped as\n part of the redistributable client. XMS .NET requires the IBM MQ .NET\n client (amqmdnet.dll). If unmanaged mode is to be used, then the IBM\n MQ C client libraries are also needed along with amqmdnet.dll.See also theRedistributable clients on Windowspage which explains how to generate packages for redistribution and notes that \"IBM support is only able to provide assistance with the full, unmodified set of files contained within the redistributable client packages.\" This page discusses approaches to distribute the libraries in software that does not need Admin privileges to install.You will need an IBM ID to download the redistributable MQ client from Fix Central but the download is free and when packaged per IBM's instructions is fully supported when connecting to a supported instance of MQ Server.The previous accepted answer of a wrapper over the Java libraries still works however the same caveat applies - if IBM support is required it needs to be IBM's Java client install. Fortunately, this too now comes in a more friendly single-jar package called allclient.jar which isdocumented here. IBM also now documents which jar files can be relocated from the MQ Server installation and still be eligible for full support. This is discussed on theWhat is installed for IBM MQ classes for JMSpage.\n"} +{"text": "### Human: What are the conditions in whichJMSXDeliveryCountis increased in WebSphere MQ. I need all the scenarios under which it can happen.### Assistant: The JMSXDeliveryCount is incremented every time a message is re-delivered to a consumer. A message could be redelivered:1) A consumer using the Client Acknowledge mode received the message earlier did not call acknowledge() on that message.2) A consumer received the message in a transaction, did not call a commit or called a rollback.EDIT:If the JMS Client is unable to process the message due to some bad JMS headers, then such a message(known as poison message) will not be delivered to application and JMS client will internally rollback that message. In this case also JMSXDeliveryCount is incremented.In IBM MQ, have you set Backout Queue and Backout Threshold properties for the queue from which messages are being retrieved? JMS Client will put such bad messages to the backout queue once the Backout Threshold is reached. This is to avoid same message is retrieved by JMS client again and again thus blocking other good messages from being delivered to application.\n"} +{"text": "### Human: I am getting the following exception while trying to make a connection with remote MQ from my Java client on my local machine:com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2400' ('MQRC_UNSUPPORTED_CIPHER_SUITE')This is with Java version 1.7, the Oralce JRE, cipher suite 'TLS_RSA_WITH_AES_256_CBC_SHA256' and the following Maven dependencies:\n com.ibm.mq\n allclient\n 9.0.0\n\n\n com.sun.messaging.mq\n fscontext\n 4.4.2\n### Assistant: UpdateUpdating each point provided before with more current information.IBM MQ 9.2 and higher now support TLS1.3. The TLS1.3 ciphersuites now use the standard names which match in both Oracle Java and IBM Java, the use of-Dcom.ibm.mq.cfg.useIBMCipherMappings=falseshould no longer be required of you are able to use a TLS1.3 ciphersuite.The signature algorithmSHA224withRSAis required to use the Oracle Cipher SuiteTLS_RSA_WITH_AES_256_CBC_SHA256. Oracle JRE 1.7.0_171 or later and 1.8.0_162 or later now come with unlimited strength policy files enabled by default and supportSHA224withRSA.TheJCE Unlimited Strength Jurisdiction Policy Filesrequired to use a SHA256 Cipher Suite are now included and enabled by default in the above versions or later.There are three things that impact this:If you want to use Oracle JRE you need to set-Dcom.ibm.mq.cfg.useIBMCipherMappings=false, this will allow IBM MQ to use the Oracle Cipher Suite names likeTLS_RSA_WITH_AES_256_CBC_SHA256The signature algorithm SHA224withRSA is not supported by Oracle JRE 1.7 and is required to use the Oracle Cipher SuiteTLS_RSA_WITH_AES_256_CBC_SHA256. Based on this you would need to go to Oracle JRE 1.8.You will need to obtain and install theJCE Unlimited Strength Jurisdiction Policy Filesto use a SHA256 Cipher Suite.The information above is covered in more detail in my answer to another post \"MQ Error on SSL enabled\".\n"} +{"text": "### Human: According to the javadoc, if I call receive() on a javax.jms.MessageConsumer it will block indefinitely until a message is produced or until the message consumer is closed.I have a thread in which a receive() is being called. As part of the thread shutdown I am calling close(), but the consumer still blocks in receive() and so the thread will not shutdown. The gist of my code is:public String receiveMessage() {\n...\n...\n System.out.println(\"About to receive\")\n TextMessage message = (TextMessage) consumer.receive();\n System.out.println(\"No longer receiving\")\n...\n...\n}\n\npublic void stop() {\n try {\n if (consumer != null) {\n consumer.close();\n }\n } catch (JMSException ex) {\n throw new IllegalStateException(ex);\n }\n}In the debugger I can see close() being called, but the receive still blocks. If I use the receive() method with a timeout it will block until the timeout expires.Everything looks right to me, hopefully someone can tell me what I am doing wrong.### Assistant: I've sorted the problem, I wasn't doing a connection.start() anywhere. Once I put this in, the MessageConsumer.receive() stopped blocking when I closed it and everything worked as I had expected.Thanks for your suggestions.\n"} +{"text": "### Human: 1.) From a .net client, how do I test if the client is connected to the server (i.e. can send and receive) Yes, I could send a message inside a try block and catch the ensuing exception but I'm hoping for a more elegant solution.2) How do I open, close, and re-open connections? In my attempts to resolve question 1 above I discovered that if I open a connection then call connection.Close() I am not able to obtain another connection from the connection factory (see code fragment below). I receive error message XMSCC0008I am using a very standard vanilla MQ configuration . Here is how my client connects:ISession session = MQAccess.GetSession(MQAccess.Connection);\nIDestination destination = session.CreateTopic(SubTopicName);\nConsumer = MQAccess.GetConsumer(session, destination);\nConsumer.MessageListener = new MessageListener(HandleMQSubEvent);\nMQAccess.Connection.Start();where MQAccess is a small utility class.Edited the question to add MQAccess code:public static class MQAccess\n{\n public static readonly MQConfigurationSectionHandler ConfigSettings;\n public static readonly IConnectionFactory ConnectionFactory;\n\n private static readonly IConnection connection;\n public static IConnection Connection\n {\n get { return connection; }\n }\n\n static MQAccess()\n {\n ConfigSettings = (MQConfigurationSectionHandler)\n ConfigurationManager.GetSection(\"mq-configuration\");\n\n XMSFactoryFactory factory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\n ConnectionFactory = factory.CreateConnectionFactory();\n ConnectionFactory.SetStringProperty(XMSC.WMQ_HOST_NAME, ConfigSettings.Hostname);\n ConnectionFactory.SetIntProperty(XMSC.WMQ_PORT, ConfigSettings.Port);\n ConnectionFactory.SetStringProperty(XMSC.WMQ_CHANNEL, ConfigSettings.Channel);\n\n if (ConfigSettings.QueueManager == string.Empty)\n {\n ConnectionFactory.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, \"\");\n }\n else\n {\n ConnectionFactory.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, ConfigSettings.QueueManager);\n }\n\n connection = GetConnection();\n }\n\n public static IConnection GetConnection()\n {\n return ConnectionFactory.CreateConnection();\n }\n\n public static ISession GetSession(IConnection connection)\n {\n return connection.CreateSession(false, AcknowledgeMode.AutoAcknowledge);\n }\n\n public static IMessageProducer GetProducer(ISession session, IDestination destination)\n {\n return session.CreateProducer(destination);\n }\n\n public static IMessageConsumer GetConsumer(ISession session, IDestination destination)\n {\n return session.CreateConsumer(destination);\n }\n\n public static void MQPub(string TopicURI, string message)\n {\n using (var session = GetSession(Connection))\n {\n using (var destination = session.CreateTopic(TopicURI))\n {\n using (var producer = GetProducer(session, destination))\n {\n producer.Send(session.CreateTextMessage(message));\n }\n }\n }\n }\n\n public static void MQPub(string TopicURI, IEnumerable messages)\n {\n using (var session = GetSession(Connection))\n {\n using (var destination = session.CreateTopic(TopicURI))\n {\n using (var producer = GetProducer(session, destination))\n {\n foreach (var message in messages)\n {\n producer.Send(session.CreateTextMessage(message));\n }\n }\n }\n }\n }\n}Edit: Renamed MQAccess class to MQClient. Made it an instance class per T Rob suggestion. Disconnect method still crashes with error msgs listed abovepublic class MQClient : IDisposable\n{\n public MQConfigurationSectionHandler ConfigSettings { get; private set; }\n public IConnectionFactory ConnectionFactory { get; private set; }\n\n public IConnection Connection { get; private set; }\n\n public IMessageConsumer Consumer { get; private set; }\n public IMessageProducer Producer { get; private set; }\n // Save sessions as fields for disposing and future subscription functionality\n private ISession ProducerSession;\n private ISession ConsumerSession;\n public string SubTopicName { get; private set; }\n public string PubTopicName { get; private set; }\n public bool IsConnected { get; private set; }\n public event Action ConnectionError;\n private Action IncomingMessageHandler;\n\n public MQClient(string subTopicName, string pubTopicName, Action incomingMessageHandler)\n {\n // Dont put connect logic in the constructor. If we lose the connection we may need to connect again.\n SubTopicName = subTopicName;\n PubTopicName = pubTopicName;\n IncomingMessageHandler = incomingMessageHandler;\n }\n\n public string Connect()\n {\n IsConnected = false;\n string errorMsg = string.Empty;\n\n ConfigSettings = (MQConfigurationSectionHandler)\n ConfigurationManager.GetSection(\"mq-configuration\");\n\n XMSFactoryFactory factory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\n ConnectionFactory = factory.CreateConnectionFactory();\n ConnectionFactory.SetStringProperty(XMSC.WMQ_HOST_NAME, ConfigSettings.Hostname);\n ConnectionFactory.SetIntProperty(XMSC.WMQ_PORT, ConfigSettings.Port);\n ConnectionFactory.SetStringProperty(XMSC.WMQ_CHANNEL, ConfigSettings.Channel);\n\n if (ConfigSettings.QueueManager == string.Empty)\n ConnectionFactory.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, \"\");\n else\n ConnectionFactory.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, ConfigSettings.QueueManager);\n\n Connection = ConnectionFactory.CreateConnection();\n\n\n if (!string.IsNullOrEmpty(PubTopicName))\n {\n ProducerSession = Connection.CreateSession(false, AcknowledgeMode.AutoAcknowledge);\n Producer = ProducerSession.CreateProducer(ProducerSession.CreateTopic(PubTopicName));\n }\n\n if (!string.IsNullOrEmpty(SubTopicName) && IncomingMessageHandler != null)\n {\n ConsumerSession = Connection.CreateSession(false, AcknowledgeMode.AutoAcknowledge);\n Consumer = ConsumerSession.CreateConsumer(ConsumerSession.CreateTopic(SubTopicName));\n Consumer.MessageListener = new MessageListener(IncomingMessageHandler);\n }\n\n try\n {\n Connection.Start();\n Connection.ExceptionListener = new ExceptionListener(ConnectionExceptionHandler);\n IsConnected = true;\n }\n catch (TypeInitializationException ex)\n {\n errorMsg = \"A TypeInitializationException error occured while attempting to connect to MQ. Check the Queue configuration in App.config. The error message is: \" + ex.Message; \n }\n catch (IllegalStateException ex)\n {\n errorMsg = \"An IllegalStateException error occured while attempting to connect to MQ. Check the Queue configuration in App.config. The error message is: \" + ex.Message; \n }\n\n return errorMsg;\n }\n\n public void Disconnect()\n {\n if (Producer != null)\n {\n Producer.Close();\n Producer.Dispose();\n Producer = null;\n }\n\n if (ProducerSession != null)\n {\n // Call Unsubscribe here if subscription is durable\n\n ProducerSession.Close();\n ProducerSession.Dispose();\n ProducerSession = null;\n }\n\n if (Connection != null)\n {\n Connection.Stop();\n\n //if (Connection.ExceptionListener != null)\n // Connection.ExceptionListener = null;\n\n // Per Shashi............\n //if (Consumer.MessageListener != null)\n // Consumer.MessageListener = null;\n\n Connection.Close();\n Connection.Dispose();\n Connection = null;\n }\n\n if (Consumer != null)\n {\n\n if (Consumer.MessageListener != null)\n Consumer.MessageListener = null;\n\n Consumer.Close();\n Consumer.Dispose();\n Consumer = null;\n }\n\n\n if (ConsumerSession != null)\n {\n // Call Unsubscribe here if subscription is durable\n ConsumerSession.Close();\n ConsumerSession.Dispose();\n ConsumerSession = null;\n }\n\n IsConnected = false;\n }\n\n\n public void Publish(string message)\n {\n Producer.Send(ProducerSession.CreateTextMessage(message));\n }\n\n\n public void Publish(string[] messages)\n {\n foreach (string msg in messages)\n Publish(msg);\n }\n\n public void ConnectionExceptionHandler(Exception ex)\n {\n Disconnect(); // Clean up\n\n if (ConnectionError != null)\n ConnectionError(ex);\n }\n\n #region IDisposable Members\n private bool disposed;\n\n public void Dispose()\n {\n Dispose(true);\n GC.SuppressFinalize(this);\n }\n\n protected virtual void Dispose(bool disposing)\n {\n if (!this.disposed)\n {\n if (disposing)\n Disconnect();\n\n disposed = true;\n }\n }\n #endregion\n\n}### Assistant: The problem is here -->where MQAccess is a small utility class.The first part of the question asks how to tell if the connection is active. The XMS classes for WebSphere MQ are an implementation of the JMS specification for non-Java platforms. They follow the JMS spec fairly closely and the JMS spec does not have a method on the connection or session equivalent toisConnectedtherefore neither does XMS. However, all GET and PUT activity should occur within a try/catch block in order to catch the JMS exceptions. (From which youalwaysprint thelinkedException, right?) When a JMS exception is thrown the app either treats it as fatal and dies or else it closes all JMS objects except for the Connection Factory, waits a few seconds and then re-drives the connection sequence.UPDATE based on new info in the question:Thanks for posting the MQAccess class. This provides considerable insight into what's happening, although there still isn't any code showing where the connection is closed and reopened as per Part #2 of the question.However, the code shows that theMQAccessclass creates a private instance ofICONNECTION connectionas the class instance is constructed, which is then exposed publicly asMQAccess.GetConnection. TheMQAccessclass as currently posted has no public or private class method that would ever replace the connection handle held byconnectionso ifMQAccess.Connection.Close()is ever called, thatIConnectionobject instance within theMQAccessclass will forever after hold an invalid connection handle. Once the connection is closed, that instance ofMQAccessis effectively dead. You'd have to delete and reinstantiateMQAccessto get a new connection.TheMQAccessclass does expose the connection factory publicly so in theory it would be possible to callMQAccess.GetConnectionfrom outside the class and obtain a valid newIConnectionobject, even after closing the original one. However, that instance would exist outside the scope of theMQAccessclass and thus any subsequent calls toMQAccesswould refer to its defunct instance variableconnectionrather than the new connection instance created outside the class.If you need to close and recreate connections, you might consider managing that from inside ofMQAccess. A low-tech approach might be to write anMQAccess.Close()method for the connection which would close the existing connection then immediately callconnection = GetConnection();so that the privateconnectionvariable always holds a valid connection handle.If this doesn't resolve the problem, please post the code that is closing and recreating the connections.By the way, the non-transacted session over a network connection opens the possibility to lose or duplicate messages for any JMS provider, including WMQ. Was this what you intended? I've explained why this is in an other SO posthere.\n"} +{"text": "### Human: What are the recommended guidelines for WebSphere MQ naming conventions for queue managers, queues (local, remote, transmit, dead letter queues...), channels etc. I found one at IBM'sdeveloperWorksbut looking to see if there is anything else comprehensive out there. Thanks.### Assistant: This sounds like a good topic for a newMission:Messagingcolumn but I'll write up the condensed version here. I'll preface my answer by noting that many of my recommendations are contrary to those you might find elsewhere. In some cases this is because the way MQ is commonly used have changed over the years. In other cases it is because the conventional wisdom never worked well to begin with. (Cluster channels namedTO.QMGRfor example.) In all cases, I prefer conventions which apply to the broadest number of situations. That means it is usually possible to find exceptions to these rules for specific cases but they are broadly applicable nonetheless.Some general rulesThe following apply to all object types.Use the dot character.as a separator.Authorization rules parse names using dot characters as separators. For example, the queue nameMY.EXAMPLE.QUEUE.NAMEwould match rules likeMY.*.*.*orMY.**but notMY.*because the dots signify name node separator characters. Do yourself a favor and use dots rather than underscores as your naming node separators consistently.Use machine-parsable names.When you have 5 queue managers and a few hundred objects, you can easily get by doing all your management manually with WMQ Explorer or runmqsc. However, there comes a point where consistency, reliability, repeatability and efficiency demand that you script up some of your routine operations or employ instrumentation to respond to network events. More than anything else this means eliminating ambiguity in names.For example, if you create a naming convention that channel names must look likeSRCQMGR.DESTQMGRthen it is possible for a script to read aRCVRorSDRchannel name and derive the names of the two queue managers it connects. However, what does the script do with a channel name likeGA.PAYROLL.OPS? Is it theGA.PAYROLLqueue manager connecting to theOPSqueue manager? Or is it theGAqueue manager connecting to thePAYROLL.OPSqueue manager? A human might be able to tell instantly based on context but scripts are notorious for doing what you tell them rather than what you intended. Similar situations arise when queue names have position-dependent qualifiers at both the beginning and the end of the name and a variable number of nodes.Stick with UPPERCASE names.This is for compatibility across all platforms, and in particular z/OS. Although it is true that more z/OS shops are using mixed case, it is also true that there are still a lot of systems out there that only accept UPPERCASE names. While it is easy to say \"this doesn't apply to me\" I have seen many cases where somebody had problems interfacing to a new business partner because of incompatible names. After all, the ability to interface to just about any platform out there is one of the main reasons for using WMQ in the first place.Don't include attributes of the object in the nameIn an SOA world, queues and topics are different types of destination and often are interchangeable. Something putting messages to what it thinks is a queue doesn't necessarily know (or care!) if they are actually going to a queue or a topic. A queue that has an application listening on it for messages may be fed by an administrative subscription that is actually roping in publications from one or more topics.What we really care about is the nature of the messages - what function do they perform - not whether we are connecting to a local queue or an alias queue. So adding qualifiers like.QA,.QL,.TPC(for topic) and so forth doesn't make sense. Similarly, adding.RCVRonto a channel name sucks up 5 useful characters that could have been better used describing the QMgr name. Worse, these practices bake the topology into the object names, making the system both less flexible and more brittle.Channel namesPoint-to-Point Channel namesUse names likeSRCQMGR.DESTQMGRforRCVR,RQSTR,SDR, andSVRchannels. This is biased toward languages that read left-to-right because the intention is to describe the data flowfroma QMgrtoanother QMgrCluster channelsUse names likeCLUSNAME.QMNAME. The old wisdom said to use names likeTO.QMNAMEbut if you ever implement overlapping clusters this causes the same channel to be used for multiple clusters. That's bad because you can then never perform maintenance on one cluster without impacting the other. UsingCLUSNAME.QMNAMEinsures that every QMgr has a dedicatedCLUSRCVRchannel for each cluster in which it participates.Client ChannelsThe exception to the \"don't include attributes of the object in the name\" is arguably theSVRCONNchannel. This is because channels are very much tied to the physical rather than the logical layer of the network. So putting the QMgr name in a SVRCONN channel name is generally OK. I don't object too strongly if people want to add.SVRCONNat the end, either.The thing to remember about client channels is that if you use a Client Channel Definition Table (CCDT) then the unique index into that table is the channel name. That means you cannot have the same channel name on multiple QMgrs and still use a CCDT. Since the CCDT is one way to configure the SSL/TLS channel details, this is often not appreciated to its fullest until the \"let's finally secure WMQ\" project comes along. By using unique channel names forSVRCONNchannels from the start, you can future-proof the network. Usually these names look likeAPP.QMNAMEor to make it obvious you aren't dealing with a cluster or point-to-point channel,APP.QMNAME.SVRCONNor similar.Queue manager namesNo dots in QMgr namesOne implication of the previous rules is that cluster and queue manager names must contain only one node and therefore should never contain a.character. This is because channel names are typically derived from the cluster and/or QMgr names. So in the example above, aRCVRchannel name likeGA_PAYROLL.OPSwould tell both humans and scripts that the channel in question connects a QMgr namedGA_PAYROLLto a QMgr namedOPS.Names of 9 chars or lessChannel names can be only 20 characters. Subtract one for the dot separator, divide by two and round down gets you to 9 characters max for queue managers. If there's a possibility that you may set up different channels for classes of service (for large vs small messages, for example, then drop back to 8 chars or less for QMgr names. This leads toQM1.QM2.A,QM1.QM2.B, etc.QMgr names reflect the physical layerIn a service-oriented world, we really care about destination names like queues and topics. We care much less about queue manager names because these are just life support for queues and topics. Client apps don't care so much aboutwhichQMgr the connect to, so long as they can send requests and receive replies. WMQ very conveniently fills in the reply-to QMgr name on outbound requests so it is rare that an application needs to know about it.On the other hand, the administrators need to know about the QMgr name. In the early days it was common to name QMgrs for the host server. Later it became the fashion to name them for the applications they hosted. Now in the SOA world, messaging is infrastructure and usually not associated with any single application so the pendulum has swung back. Give the QMgr a unique name that is meaningful to an administrator.Never reuse QMgr names!It is unfortunately very common to \"move\" a QMgr from one place to another or to have a primary and disaster recovery QMgr with the same name. This practice usually means some part of the application is dependent on the QMgr name and therefore it is \"easier\" to reuse the name. IBM introduced theQMIDas a way to address some of the problems introduced by reusing QMgr names. The typical use case is that a node gets rebuilt and the QMgr once there is also rebuilt from scratch. The cluster knows it is a new QMgr because theQMIDhas changed, but the name used for routing and other operations remains the same.Although this helped in that limited use case, it doesn't address the issues when both QMgrs with the same name are online at the same time. Nor does it address the problem that a reputable Certificate Authority won't issue multiple certs with the same Distinguished Name which forces reuse of the same certificate for multiple QMgrs.Remember that QMgrs are just life support for queues and topics and ideally will be anonymous to the applications using them. Pick a naming convention that allows you to spin up new QMgrs with unique names by the hundreds or thousands, if necessary, so that you don't have to reuse QMgr names.Other objectsUse intention-revealing namesOr to put it another way, name the object for what itdoesand not what itis. For example, if you were in the habit (as many people are) of including qualifiers like.QLfor local queues and.QAfor aliases, then any change in topology will impact the applications using those queues. Instead, name the queues for the functions they represent.Go left-to-right, most generic to most specificObject names, especially queues, should be constructed hierarchically beginning with the most generic qualifier and proceeding to the most specific qualifier. For example, many shops useAPP.FUNC.SUBFUNC.VERwhereAPPis the ID of the owning application, then one or more nodes with the function and subfunction. Many shops add a version qualifier on the end so that new versions of a service can migrate their clients on separate schedules rather than changing the service on the existing queue and making all clients change at the same time.The thing that reads the messages owns the queueIf I have a service endpoint represented by a queue then there is a many-to-one relationship between the things that might call the service to the thing that provides the service. The queue is associated with the service and the thing providing that service. Clients are more or less anonymous. Therefore, if any of the stakeholder applications can be said to \"own\" the queue, it is the service provider app that consumes messages form it.The thing that publishes the message owns the topic. Sort of.The relationship is not as straightforward with topics. Here it is the consumers of messages that are usually anonymous. In that sense if the topic name reflects any application, it is most likely the publisher. However, even publishers can be anonymous, or at least there may many of them and not all publishing at the same time. With topics it makes much more sense that the topic tree nodes are structured for the hierarchy of data or functionality they represent. These names tend to match the names of the publishing apps so sometimes the publisher \"owns\" the topic as much out of coincidence as anything else.Put positional qualifiers on the leftWhere names have variable numbers of qualifiers, put the positional ones on the left where scripts and automation can parse them. Some shops where both the beginningandending qualifiers are positional deal with this by using underscores for separators in the variable section of the name likeAPP.FUNC.SUBFUNC1_SUBFUNC2.VER. Scripts and authorizations then always see a fixed number of nodes in the name but this approach can be brittle if somebody forgets and makes a name with an extra node or two.Further readingThis sums up most of the general rules but some of the philosophy behind them has been captured in the Mission:Messaging column. In particular:Embracing cultural change in the WebSphere MQ communityMigration, failover, and scaling in a WebSphere MQ clusterThe articlePlanning for SSL on the WebSphere MQ networkdiscusses distinguished name standards as they apply to WMQ\n"} +{"text": "### Human: MQMessage queueMessage = new MQMessage();\n queueMessage.WriteString(strInputMsg);\n queueMessage.Format = MQC.MQFMT_STRING;\n MQPutMessageOptions queuePutMessageOptions = new MQPutMessageOptions();\n Queue.Put(queueMessage, queuePutMessageOptions);Using C#, with the above code, when I input the message into the queue, the data length of the message is 3600.When I manually input the message into the queue by right clicking the queue and selecting Put Test Message option, the data length of the message is 1799.I am really confused why this is the case. The message in both cases is an xml string with declaration. In Notepad++, there are 1811 characters including the declaration. When I view the message in debugger before I input into the queue, the message is converted into xml without any line or return carriages.I created the xml string using://converts string message into xml by serializing it\n public string GetMessage(MyMessage messageInstance)\n{\n\n// Serialize the request\n XmlSerializer xsr = new XmlSerializer(typeof(MyMessage));\n MemoryStream memoryStream = new MemoryStream();\n XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, Encoding.UTF8);\n xsr.Serialize(xmlTextWriter, messageInstance);\n\n memoryStream = (MemoryStream)xmlTextWriter.BaseStream;\n string XmlizedString = new UTF8Encoding().GetString((memoryStream.ToArray());\n\n\n // Encode the xml\n Encoding utf = Encoding.UTF8;\n byte[] utfBytes = utf.GetBytes(XmlizedString);\n\n // Load the document (XmlResolver is set to null to ingore DTD)\n XmlDocument xmlDoc = new XmlDocument();\n xmlDoc.XmlResolver = null;\n xmlDoc.LoadXml(utf.GetString(utfBytes));\n return utf.GetString(utfBytes);Am I missing anything in my C# implementation that is adding extra characters?Thanks.### Assistant: As @Matten suggests one problem could be character encoding.The default value for theCharacterSetproperty is 1200 (UNICODE) andWriteStringconverts to the code page specified by CharacterSet.Code Page 1200 is UTF-16 little-endian so you are likely to get two bytes per character. It is certainly possible that \"Put Test Message\" uses some other encoding that uses one-byte per character for common characters.Assuming that the 3600 and 1799 lengths are counted in bytes, they could represent 1800 UTF-16LE characters and 1799 UTF-8 characters (or 1799 ASCII characters or 1799 EBCDIC characters...).That still leaves us with a one character difference in length. Perhaps WriteString includes a terminating NULL character in the string written?Are you sure you trust the count Notepad++ gives you? If Put Test Message placed 1799 characters into a message there were probably 1799 characters in the data you supplied to it.Edit:Assuming the encoding theory is correct, you could shorten the message by using a different encoding. How short an encoding would make a particular message would depend on the actual contents of the string.For example, you could use an ASCII encoding to get one byte per character.MQMessage queueMessage = new MQMessage();\nqueueMessage.CharacterSet = 437; // Set code page to ASCIIThat would shorten your message to 1800 bytesifall the characters in your xml string had an ASCII representation.An alternative would be to use UTF-8 encoding.MQMessage queueMessage = new MQMessage();\nqueueMessage.CharacterSet = 1208; // Set code page to UTF-8Using UTF-8 has the advantage that (unlike ASCII) all characters have a representation (for certain values of 'all'). The disadvantage is that some characters require two, three or even four bytes to represent them. The most common characters are encoded in one byte, then the next most common characters are encoded in two bytes and so on.In the best case a UTF-8 encoding would also give you 1800 bytes. In the worst case it would give you 7200 bytes but that seems very unlikely unless you are using something like Klingon!\n"} +{"text": "### Human: I'm hoping someone can help me - I'm using JBoss 5.1 and MQ Series 7 in an EJB / JMS based application. I have several message driven beans in my application, each listening on an MQ Series message queue. When an error is encountered during the processing of a message, I need to be able to configure a 'retry delay', so that mq series waits some period of time before attempting to redeliver the message. I have combed through MQ Series documentation extensively, and have not yet found a way to accomplish this in MQ Series. I know that the JBoss default JMS provider has a way to do this, but I am currently limited to using MQ Series. Since I haven't been able to set a retry delay - when I have a message that fails, my application gets stuck in a tight loop of delivering the message and rolling back continuously. Can anyone help me understand if there is some config option in MQ Series that will allow me to wait X milliseconds before redelivering a failed message?### Assistant: This is likely to be an opportunity to craft a little infrastructure for such an issue.Since you can look at the JMSDeliveryCount when the message has entered the bean (before you process it -- consider commit scope) and you can see that it has had a couple of rollbacks already, send the message around to a staging queue but attach the destination queue name in the jms properties so you can use it later.A simple process can run on some interval to clear thestaging queue(every 5 minutes for example) and send the message on to arouting queue.Another process can sit on therouting queueand look at the jms properties (which added the destination queue name to) and send the message along to the orginal destination.It's a poor man's broker but it will acheive the goal. It is true that there is not much built in to really do what you want.\n"} +{"text": "### Human: I'm writing a simple Java application using MQ classes for Java with Eclipse.Right now I'm able to browse a remote queue without removing the messages stored.Here is the code of the reading cycle:MQQueueManager QMgr = new MQQueueManager(qManager); //<-- qManager is a String with the QMgr name\n\nint openOptions = MQC.MQOO_FAIL_IF_QUIESCING | MQC.MQOO_INPUT_SHARED | MQC.MQOO_BROWSE; \n\nMQQueue queue = QMgr.accessQueue(queueName, openOptions);\n\nMQMessage theMessage = new MQMessage();\nMQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.options=MQC.MQGMO_WAIT | MQC.MQGMO_BROWSE_FIRST;\n gmo.matchOptions=MQC.MQMO_NONE;\n gmo.waitInterval=5000;\n\nboolean thereAreMessages=true;\nwhile(thereAreMessages){\n try{\n //read the message \n queue.get(theMessage,gmo); \n //print the text \n String msgText = theMessage.readString(theMessage.getMessageLength());\n System.out.println(\"msg text: \"+msgText);\n\n // <--- Solution code Here\n\n //move cursor to the next message \n gmo.options = MQC.MQGMO_WAIT | MQC.MQGMO_BROWSE_NEXT;\n\n }catch(MQException e){\n\n if(e.reasonCode == e.MQRC_NO_MSG_AVAILABLE) {\n System.out.println(\"no more message available or retrived\");\n }\n\n thereAreMessages=false;\n } catch (IOException e) {\n System.out.println(\"ERROR: \"+e.getMessage());\n }\n}Main question:After the read message line and before moving the cursor to the next message how can I remove the message from the queue?Secondary question:Eclispe is warning me that all the costants used for the options are deprecated; which are the correct ones to use?Solution:Here the solution I'm really looking for:// set te cursor to remove the message from the queue\ngmo.options = CMQC.MQGMO_MSG_UNDER_CURSOR;\nqueue.get(theMessage, gmo);these lines have to be inserted in the question codeI've found it here:http://www.velocityreviews.com/forums/t124676-mq-series-messages-browse-and-delete.html### Assistant: Solution:Here the solution I'm really looking for:// set te cursor to remove the message from the queue\ngmo.options = CMQC.MQGMO_MSG_UNDER_CURSOR;\nqueue.get(theMessage, gmo);these lines have to be inserted in the question codeI've found it here:http://www.velocityreviews.com/forums/t124676-mq-series-messages-browse-and-delete.html\n"} +{"text": "### Human: I own the following findings in order to work againts WMQ Secure-Channel:DefinedSecure-Channelin the WMQ farmPublic/Private keysUnmanagedSecurity-ExitassemblyMy question is how to utilize these resources and interact with aSecure Channelusing the XMS API? (Using C#)This is what I've tried so far, but without success:private IConnectionFactory CreateConnectionFactory()\n{\n XMSFactoryFactory factoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\n\n IConnectionFactory connectionFactory = factoryFactory.CreateConnectionFactory();\n\n connectionFactory.SetStringProperty(XMSC.WMQ_HOST_NAME, _wmqHostName);\n connectionFactory.SetIntProperty(XMSC.WMQ_PORT, _wmqPort);\n connectionFactory.SetStringProperty(XMSC.WMQ_CHANNEL, _wmqChannel);\n connectionFactory.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT_UNMANAGED);\n connectionFactory.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, _wmqQueueManager);\n connectionFactory.SetIntProperty(XMSC.WMQ_BROKER_VERSION, 0);\n connectionFactory.SetStringProperty(XMSC.WMQ_SECURITY_EXIT, \"MySecurityExitName\");\n\n return (connectionFactory);\n}I get the following error when calling it:CWSMQ0006E: An exception was received during the call to the method\n ConnectionFactory.CreateConnection: CompCode: 2, Reason: 2195 . During\n execution of the specified method an exception was thrown by another\n component. See the linked exception for more information.UPDATE:I found the following Technote which describes my problem and itspossible(not tested) solution:https://www-304.ibm.com/support/docview.wss?uid=swg1IC82112### Assistant: Good that you found that Technote. Also make sure that...If doing mutual authentication (SVRCONN channel is set toSSLCAUTH(REQUIRED)) that the app's personal certificatehas a label matching the service account. Example, if the app is running asdotnetacctthe label of the personal cert in its keystore would beibmwebspheremqdotnetacct.Get the channel running without SSL or an exit first. Then do server-authenticated SSL, then mutually authenticated SSL, then add the exit back in. This isolates problems.Use the latest WMQ client. I do not mean the latest fix pack for v7.0 or v7.1 but the latest v7.5 (as of this writing) client. Download asSupportPac MQC75. Later clients are compatible with back-level QMgrs and they have more fixes/features.Install thefullclient and not just the classes or assemblies you think you need. This gets you all sorts of utilities such as client-side tracing.Use theamqssslcsample to test your channel and certificates. This is usually atC:\\Program Files (x86)\\IBM\\WebSphere MQ\\tools\\c\\Samples\\Bin\\amqssslc.exeand is one of the utilities supplied when installing the full client.Go to theWMQ SupportPacs pageand look forMH03 WebSphere MQ SSL Configuration CheckerandMO04 WebSphere MQ SSL Wizard. These can help with configuration and problem diagnosis.\n"} +{"text": "### Human: I have a simple program to process messages from a queue.\nMy intention is to process all available messages in queue and still listen to queue for incoming messages.I have written the processing part inside a infinite loop as i want it to listen to queue always and process messages.Once after processing all messages again it tries to get a message(as it is inside a infinite loop) from the queue and thereis no messages it throws MQRC 2033 NO_MSG_AVAILABLE exception(infact it is correct) and my program exits.Can someone give an idea to continously listen to this queue and avoid this exception.### Assistant: When you execute theMQGETAPI call, there is an option to have the program wait for messages. You can specify a wait time (in milliseconds) or specify to wait forever. Just make sure that if you have the app wait for more than a few seconds, also specify 'Fail if Quiescing'. This allows the queue manager to be stopped cleanly. Without 'Fail if Quiescing' the administrator will need to issue a preemptive shutdown which can cause problems.There is a section specifically for this question in the Programmer's Guide in theWaiting for Messageschapter. Depending on the language you are writing in ,the actual value to specify is in theProgrammer's Reference, theUsing Javamanual or theUsing .Netmanual. Each of these will be visible in the navigation panel when you click the link above.\n"} +{"text": "### Human: I had much difficulties implementing a Websphere MQ (WMQ) connector with Apache CAMEL that could handle MQ Confirmation of Delivery (CoD) reports without exceptions, neither side effects in the form of unwanted response datagrams. In the end I got it working the way I wanted, a much standard and common way if you are accustomed to writing native MQ clients. I document the method in a post to this same topic, but I find the solution bloated with intricacies and would very much appreciate any advice or example to make the implementation cleaner and more elegant.I understood that the problem takes its roots into the way MQ designed request-reply Message Exchange Pattern (MEP), versus the way JMS specifications did, versus CAMEL implementation of the Request-Reply MEP in its JMS Component. Three different philosophies!WMQ features a MessageType header (seeMQMD fieldsandconstants) that bears value 1 for request, 2 for reply, and 8 for datagram (one way MEP). In addition, the value 4 is used to mark Report messages in the form of CoD (Conf. of Delivery), PAN (Positive AckNowledge) and NAN (Negative AckNowledge), which - in term of the message flow - also make an additional Reply message. The CoD, PAN, and NAN acks can be requested for either Request messages, Replies or Datagrams using another header field named 'Report' in which flags for all report variants can be combined. Additional header fields 'ReplyToQ' and 'ReplyToQMgr' specify the Queue and Queue Manager on which Reports and Replies are expected by the original sender, and afixed 24 bytes'CorrelId' field - optional - can help correlate Reports and Replies to the original Datagram or Request mesage. To make it more complex, one can indeed send back Replies and Reports with the same original Message ID and no CorrelID, or provide the original Message ID in the CorrelId, or return the CorrelId value when already specified in the original Request or Datagram. IBM provides aJMS API over WMQ, allowing either to tunnel plain JMS exchanges over WMQ as transport (with help from an extra message header nameMQRFH2), or tomap native MQ messages onto JMS messagesand vice-versa.On the other hand, JMS specs provide an optional 'JMSReplyTo' header field and a 'JMSCorrelationID', but do leave the exact MEP semantics to client applications; namely stating in specs: \"A response may be optional; it is up to the client to decide.\"CAMEL features 'routes' in XML or Java DSL and a inner Exchange Object model with the purpose to supportEIP Patternsamongst which theRequest-Replypattern. CAMEL then assumes in itsJMS Componentthat if the JMSReplyTo field is set, this is necessarily a Request expecting a Reply, causing the Out part (or modified In part if Out is empty) of an Exchange to be returned to the queue defined in JMSReplyTo.I was willing to support native MQ Message exchanges with Confirmation of Delivery (CoD) reports through a remote Websphere Queue Manager, so that, in addition to transaction and persistence (i.e. no loss, no duplicates) one can also track when a message is consumed and raise alerts in case of delays.Inbound issue:By default, the Websphere Queue Manager generates CoD Reports when message consumption from the queue completes. Therefore,without any specific settings, a remote MQ client sending a datagram with the CoD flag (and the then compulsory ReplyToQ) will get a first reply as MQ Report back from the Queue Manager when the CAMEL endpoint consumes the message, followed by a second (unexpected) reply message explicitly returned by CAMEL and containing whatever is left in the Exchange object at the end of the CAMEL route, because CAMEL assumes a Request-Reply EIP given that the JMSReplyTo field is present (mapped from MQ ReplyToQ and ReplyToQMgr, both being required to support the CoD return flow).Outbound issues:Without specific settings, CAMEL assumes too by default a Request-reply EIP / MEP on the outbound connection. The CAMEL JMS/MQ endpoint will then wait for1response back. When the OUTbound message is JMS over MQ (hence with MQRFH2 header), this works fine. When forcing plain vanilla MQ, i.e. removing MQRFH2 header as below, I was unable to get the endpoint listener match the correlated incoming MQ Report, although traced values seem all correct (enforcing 24 char correlation IDs so that truncation of longer CorrelId values or null padding by MQ cannot geopardize the correlation filter). Has anyone been able to solve that issue?Details:Although IBM JMS API accepts passing specific JMS property values WMQ_MESSAGE_BODY={1|0} / WMQ_TARGET_CLIENT={1|0} to control the presence of the JMS header MQRFH2 in the generated messages, these options become inoperative through CAMEL. One must use theCamelJmsDestinationNameheader (as explained in CAMEL JMS doc) to supply an IBM queue URL for the destination featuring the option \"targetClient=1\" in order to get rid of the MQRFH2 header. But without this header, the CAMEL correlation on the CoD Report or MQ reply does fail.The solution to the above issue is indeed about building a specific CAMEL route to handle the CoD Reports returned by the remote party (as well as correlated MQ Replies). So CAMEL outbound messages must be enforced as \"InOnly\"ExchangePatternand thus not wait for any reply. But this will cause CAMEL to suppress too all ReplyTo fields. Then if a MQ CoD is requested on an outbound MQ datagram, a CAMEL exception ensues whose cause isMQException JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2027' ('MQRC_MISSING_REPLY_TO_Q').CAMEL documents an URI option 'disableReplyTo=true' to disable the reply-listening on exchange patterns yet keep the ReplyTo fields - apparently on both inbound and outbound exchanges. But this option does not work (as observed, I may be wrong) on outbound JMS exchanges and one must use the much less intuitive 'preserveMessageQos' option instead.Elegant solutions to these issues are welcome.### Assistant: The best I have been able to get is documented below, illustrated as a Spring XML application context that itself hosts the CAMEL context and routes. It works with the IBM native MQ JCA-compliant resource adapter v7.5, CAMEL 2.15, Spring core 4.2. I can deploy it to both Glassfish and Weblogic servers.Of course a java DSL is used in a real implementation given the numerous variables. This example based on the CAMEL XML DSL is self-contained and easy to test.We start with Spring & Camel declarations:\nThe CAMEL context follows with 2 routes: MQ to JMS and JMS to MQ, here chained to form a bridge to ease testing.\n\n Weird: when using the native MQ Resource adapter the only way to get (e.g.) 3 listeners is to enforce 3 connections (with 3 Camel:from statements in sequence) with max 1 session each, otherwise an MQ error ensues:MQJCA1018: Only one session per connection is allowed. However, if you use MQ client jars instead, then the concurentConsumers option in CAMEL JMS does work fine. \n \n The disable disableReplyTo option above ensures that CAMEL will not produce a reply before we can test the MQ message type to be 1=Request(-reply) or 8=datagram (one way!). That test and reply construction is not illustrated here.Then we enforce the EIP to InOnly on the next posting to plain JMS to be consistent with the Inbound MQ mode.\n \n \n Next comes the jms-to-MQ route:\n \n \n \n \n Now comes the request flag for the MQ CoD report to be returned by remote destination. We also enforce the MQ message to be of Datagram type (value 8).2048\n 64\n 8The ReplyTo queue can be specified either via theReplyTouri option, else as a header as below.Next we do useCamelJmsDestinationNameheader to enforce suppressing of the JMS MQ message headerMQRFH2(using targetClient MQ URL option value 1). In other words, we want to send a plain vanilla MQ binary message (i.e. Only the MQMD message descriptor followed by the payload).TEST.REPLYTOQ\n queue://MYQMGR/TEST.Q2?targetClient=1More MQMD fields may be controlled throughreserved JMS propertiesas illustrated below. Seerestrictionsin IBM doc.MQSTR \n _PLACEHOLDER_24_CHARS_ID_The destination queue in the URI is overwritten by theCamelJmsDestinationNameabove, hence the queue name in the URI becomes a placeholder.The URI optionpreserveMessageQosis the one that - as observed - allows sending a message with the ReplyTo data being set (to get the MQ CoD Report), yet prevent CAMEL to instantiate a Reply message listener by enforcing the InOnly MEP.\n \nThe following must be adjusted to your context. It provides the queue factories for both a native JMS provider and Websphere MQ (via the native IBM WMQ JCA Resource Adapter). We use here JNDI lookups on administrative objects.\n\n\n\n\n\n\n \n\n\n\n \n\n\nAlternatively, if you are using the MQ client jars instead of the Resource Adapter, you will declare the connection factory beans like (in place of JNDI lookups as above):\n \n \n \n \n \n \n\n\n\n \n \n \nComments and improvements welcome.\n"} +{"text": "### Human: I have Spring Boot application which listen IBM MQ Queue via@JmsListenerannotation as below from component class. The MQ properties (hostname, channel, port, etc) are set fromyamlfile.@JmsListener(destination = \"\")\n public void receiveMessage(BytesMessage msg) { \n //snippet to read msg\n }The MQ dependencies are added in gradle build as below,compile(\"com.ibm.mq:mq-jms-spring-boot-starter:0.0.2\") { \n exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'\n }This works fine and listening the message as long as I run the application on local with Tomcat container. But if I package this as EAR and deploy to Wesbphere8.5 server, it throws below exception and listener is not reading the message from queue. I confirmed that all the run-time dependencies are packaged in EAR. Tried with different versions of MQ dependencies but no luck.2018-07-10 15:21:16,531 ERROR DefaultMessageListenerContainer - Could not refresh JMS Connection for destination 'QueueName' -\n retrying using FixedBackOff{interval=5000, currentAttempts=34,\n maxAttempts=unlimited}. Cause: JMSFMQ6312: An exception occurred in\n the Java(tm) MQI.; nested exception is com.ibm.mq.jmqi.JmqiException:\n CC=2;RC=2195;AMQ9546: Error return code received.\n [1=java.lang.reflect.InvocationTargetException[null],3=NativeConstructorAccessorImpl.newInstance0]Need help to fix this issue.### Assistant: I faced a similar issue like this. This happens because of missing configurations on IBM MQ Connection with your JMS Application. In My case, I got an authorization related exception but I set the correct user credentials for the IBM mq. when I checked the IBM mq site, the userName is different and that is not which I configured in my spring application.#IBM MQ JMS Configuration\nibm.mq.queueManager={QUEUE_MANAGER}\nibm.mq.channel={CHANNEL_NAME}\nibm.mq.connName={HOST_NAME(HOST_PORT)}\nibm.mq.user={USER_NAME}\nibm.mq.password={PASSWORD}Then I added the below property to Use compatibility mode when authenticating with a queue manager.\nHere we override the authentication mode. This should not normally be needed withcurrent maintenance levels of MQ V8 or V9, but some earlier levels sometimes got get it wrong and then this flag can be set to \"false\"ibm.mq.user-authentication-m-q-c-s-p=falsePlease Referthis pagefor more details\n"} +{"text": "### Human: We communicate with the third party using IBM MQ in request/reply fashion. We send them request and they give us reply. \nCurrent we both have a simple java based native IBM MQ application.\nWe are planning to rewrite our code using spring jms.\nBut we are not getting any response back within given time when spring jms is used. We are using JMSTemplate to send or receive messages.\nI am sharing my code snippet. Am I doing anything wrong here? Any other properties should I set here?// Request Part (we are sending request)\n\n String request // this is the request string\n byte[] reqData = request.getBytes(); // converting it into byte array to send\n\n TextMessage txtMsg = session.createTextMessage(String.valueOf(reqData));\n\n Destination replyToQName = jmsTemplate.getDestinationResolver().resolveDestinationName(session, responseQueueName, false);\n\n txtMsg.setJMSReplyTo(replyToQName);\n\n Destination requestQ = jmsTemplate.getDestinationResolver().resolveDestinationName(session, requestQueueName, false);\n\n ((JmsDestination) requestQ).setBooleanProperty( WMQConstants.WMQ_MQMD_WRITE_ENABLED, true );\n\n ((MQQueue) requestQ).setTargetClient(WMQConstants.WMQ_CLIENT_NONJMS_MQ); // setting this because third party application is native websphere mq java application \n\n jmsTemplate.convertAndSend(requestQ, txtMsg);\n\n // saved msgId of request for late use\n String messageId = txtMsg.getJMSMessageID();\n\n\n // Response fetching part\n\n Destination responseQ = jmsTemplate.getDestinationResolver().resolveDestinationName(session, responseQueueName, false);\n\n ((JmsDestination) responseQ).setBooleanProperty(WMQConstants.WMQ_MQMD_READ_ENABLED, true);\n\n ((JmsDestination) responseQ).setObjectProperty( WMQConstants.JMS_IBM_MQMD_CORRELID, msgIdText);\n\n jmsTemplate.setReceiveTimeout(30000L);\n\n String filter = \"JMSCorrelationID='\" + messageId + \"'\"; // to match request message's messageId with response message's correlationId\n\n TextMessage respMsg = (TextMessage) jmsTemplate.receiveSelected(responseQ, filter);Below is my connectionFactory code:MQConnectionFactory factory = new MQQueueConnectionFactory();\n factory.setHostName(\"hostname\");\n factory.setPort(1420);\n factory.setQueueManager(\"QM1\");\n factory.setChannel(\"TEST.CHANNEL\");\n factory.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);### Assistant: The main issue here is that basic diagnostics have not been performed, or if they have then the results not presented in the question. I don't know Spring but I do know basic MQ debugging. I also lived in Missouri, the \"Show Me\" state, long enough to adopt the state motto as my own. Show me how all the assumptions were verified. As an MQ Admin I'd work with the developer to confirm all the assumptions by visual inspection. Here's how I'd approach it:Inspect the outbound messageStop the outbound channelPUT a request messageGET(ENABLE) the XMitQ and browse the messagea) Does the message appear?b) Does the message have the right format and values?c) Are the Reply-To fields correctly populated?d) Does the message expire and if so is the expiry sufficiently long?Inspect the return messageStop the applicationRestart the outbound channelBrowse the reply-to queuea) Does a message arrive?b) Is it correctly formatted and populated?SummaryIn the end there are only two likely scenarios where this can go wrong and both are easy to check.First, it is possible the new program is not putting any message at all. This is actually quite common when refactoring code to use a new framework. Trying to debug without positively verifying a message gets PUT (and explicitly stating in the question how this was done and the result) is making an awfully big assumption. Don't assume. Verify a message is produced and tell us the details when asking so we can eliminate that as a root cause.Second, working backward from the application taking the requests, it doesn't care which app sends the message if they are the same. Assuming the requestor app is actually PUTting a message, it can't be the same as the old one since it gets a different reaction from the remote server app. Compare messages for the same transaction from the old and the new app versions. Print them out in hex and compare byte for byte if necessary.After performing this kind of differential diagnosis it would be possible narrow the focus and get to root cause. The list of things to check if no message is produced is quite different from the list of items to check if a message is actually produced. It might be possible to resolve this without doing basic diagnostics but that would be the exception. So my non-answer answer is: start by doing the basic diagnostics.\n"} +{"text": "### Human: So I've spent the past few days trying to solve this that seems to have been forgotten since none of the two PECL extensions available (SAM and mqseries) have been updated for a long time. I've tried both and mqseries seems to get me the furthest at this point since SAM refuses to get me a connection, even though MQ works perfectly from the command line. I've successfully created a connection to my QueueManager and it's during the next step (MQOPEN) that I fail miserably:$mqcno = array(\n 'Version' => MQSERIES_MQCNO_VERSION_2,\n 'Options' => MQSERIES_MQCNO_STANDARD_BINDING,\n 'MQCD' => array('ChannelName' => '[channel]',\n 'ConnectionName' => '[ipnumber]([port])',\n 'TransportType' => MQSERIES_MQXPT_TCP)\n );\n\nmqseries_connx('MQED', $mqcno, $conn, $comp_code,$reason);\nif ($comp_code !== MQSERIES_MQCC_OK) {\n printf(\"Connx CompCode:%d Reason:%d Text:%s
\\n\", $comp_code, $reason, $reason);\n exit;\n}\n\n$mqods = array('ObjectName'=>'MYPUTQUEUE', 'ObjectType'=>MQOT_Q, 'ObjectQMgrName'=>'MYQUEUEMANAGER');\nmqseries_open($conn, $mqods, \n MQSERIES_MQOO_FAIL_IF_QUIESCING | MQSERIES_MQOO_OUTPUT,\n $obj, $comp_code,$reason);THis results in $reason being populated with 2044, which translates to MQRC_OD_ERROR, or in English: 'On the MQOPEN or MQPUT1 call, the object descriptor MQOD is not valid'.So the question is, what's wrong with my MQOD?Update #1: At this point this is not resolved. I rebuilt the project from the ground up to resolve any issues at build time. I am still stuck on MQOPEN returning 2044. The samples still run flawlessly from CLI, so this is definitely tied to the installation of the PECL extension. If there's anyone out there who has successfully installed and are running PHP against MQ in a fairly recent 64-bit PHP5 environment please let me know...Update #2: MQPUT1 works flawlessly with the problem that I can't receive my response. At this point, it's just MQOPEN that doesn't work. Question is; what is causing MQOPEN to return 2044 when MQPUT1 works, which I understand includes MQOPEN?### Assistant: The MQOD in the cmqch file looks like this:/****************************************************************/\n /* MQOD Structure -- Object Descriptor */\n /****************************************************************/\n\n\n typedef struct tagMQOD MQOD;\n typedef MQOD MQPOINTER PMQOD;\n typedef PMQOD MQPOINTER PPMQOD;\n\n struct tagMQOD {\n MQCHAR4 StrucId; /* Structure identifier */\n MQLONG Version; /* Structure version number */\n MQLONG ObjectType; /* Object type */\n MQCHAR48 ObjectName; /* Object name */\n MQCHAR48 ObjectQMgrName; /* Object queue manager name */\n MQCHAR48 DynamicQName; /* Dynamic queue name */\n MQCHAR12 AlternateUserId; /* Alternate user identifier */\n /* Ver:1 */\n MQLONG RecsPresent; /* Number of object records\n present */\n MQLONG KnownDestCount; /* Number of local queues opened\n successfully */\n MQLONG UnknownDestCount; /* Number of remote queues opened\n successfully */\n MQLONG InvalidDestCount; /* Number of queues that failed to\n open */\n MQLONG ObjectRecOffset; /* Offset of first object record\n from start of MQOD */\n MQLONG ResponseRecOffset; /* Offset of first response record\n from start of MQOD */\n MQPTR ObjectRecPtr; /* Address of first object record */\n MQPTR ResponseRecPtr; /* Address of first response\n record */\n /* Ver:2 */\n MQBYTE40 AlternateSecurityId; /* Alternate security identifier */\n MQCHAR48 ResolvedQName; /* Resolved queue name */\n MQCHAR48 ResolvedQMgrName; /* Resolved queue manager name */\n /* Ver:3 */\n MQCHARV ObjectString; /* Object long name */\n MQCHARV SelectionString; /* Message Selector */\n MQCHARV ResObjectString; /* Resolved long object name*/\n MQLONG ResolvedType; /* Alias queue resolved object type */\n /* Ver:4 */\n };\n\n #define MQOD_DEFAULT {MQOD_STRUC_ID_ARRAY},\\\n MQOD_VERSION_1,\\\n MQOT_Q,\\\n {\"\"},\\\n {\"\"},\\\n {\"AMQ.*\"},\\\n {\"\"},\\\n 0,\\\n 0,\\\n 0,\\\n 0,\\\n 0,\\\n 0,\\\n NULL,\\\n NULL,\\\n {MQSID_NONE_ARRAY},\\\n {\"\"},\\\n {\"\"},\\\n {MQCHARV_DEFAULT},\\\n {MQCHARV_DEFAULT},\\\n {MQCHARV_DEFAULT},\\\n MQOT_NONEI'm wondering if the module fills in the defaults and is letting you override then with the hash. If so, is 'DeviceName' really the right key? I would think it would match the WMQ field name or constant.Update: Perthe exampleat the link provided, the hash key does indeed match the field name from the cmqc.h.Update #2 respond to comment: Object types as defined in cmqc.h are:/* Object Types */\n #define MQOT_NONE 0\n #define MQOT_Q 1\n #define MQOT_NAMELIST 2\n #define MQOT_PROCESS 3\n #define MQOT_STORAGE_CLASS 4\n #define MQOT_Q_MGR 5\n #define MQOT_CHANNEL 6\n #define MQOT_AUTH_INFO 7\n #define MQOT_TOPIC 8\n #define MQOT_CF_STRUC 10\n #define MQOT_LISTENER 11\n #define MQOT_SERVICE 12\n #define MQOT_RESERVED_1 999My understanding of the PHP, Perl and most other similar efforts is that they are a very thin wrapper over the C API. The Perl one simply generates most of the code directly from the cmqc.h and other C include files and therefore all the field names and defaults exactly match those include files. This module appears to have taken a similar approach and I would expect to use the defined names and field defaults where needed.I'm thinking something like:$mqods = array(\n 'StrucID'=>'OD ',\n 'Version'=>1.\n 'ObjectType'=>1,\n 'ObjectName'=>'MYPUTQUEUE', \n 'ObjectQMgrName'=>'MYQUEUEMANAGER'\n 'DynamicQName'='',\n 'AlternateUserId'='',\n 'RecsPresent'=>0,\n 'KnownDestCount'=>0,\n 'UnknownDestCount'=>0,\n 'InvalidDestCount'=>0,\n 'ObjectRecOffset'=>0,\n 'ResponseRecOffset'=>0,\n 'ObjectRecPtr'=>NULL,\n 'ResponseRecPtr'=>NULL\n);Update #3 respond to additional comments:The Q Mgr will accept any version of the MQOD but will fall back to that level of functionality. If you use v1 you can test out that it works. If you want to use later versions of the MQOD then you will need to add the additional fields to the hash.The 2009 is \"Connection Broken.\" Essentially the QMgr didn't like something and terminated your connection. Usually the meaningful error messages for that return code are in/var/mqm/qmgrs//errors/AMQEER01.LOG.\n"} +{"text": "### Human: Is there a WebSphere MQ .NET API I can download ?\nI am basically trying to write a C# app that listens for messages in an MQ queue.### Assistant: MQ, since v5.3 fixpack 8 on Windows, includes amqmdnet.dll, a .NET assembly that provides managed-code programming model for MQSeries. It's supported by IBM.IBM Calls it the \"MQ Classes for .NET\"If you have MQ, you probably have this assembly.C:\\Program Files\\IBM\\WebSphere MQ\\bin\\amqmdnet.dllReference\n"} +{"text": "### Human: Hi does anyone know how to create a message listener using IBM MQ? I know how to do it using the JMS spec but I am not sure how to do it for IBM MQ. Any links or pointers are greatly appreciated.### Assistant: Although there is a WMQ Java API as noted by the previous responders, WMQ supports JMS as well so here are some resources to get you started there.Take a look at this article:IBM WebSphere Developer Technical Journal: Running a standalone Java application on WebSphere MQ V6.0Also, if you have installed the full WMQ client and not just grabbed the jars then you will have lots of sample code installed. By default, these will live in C:\\Program Files\\IBM\\WebSphere MQ\\tools\\jms or /opt/mqm/samp depending on your platform.If you need the WMQ Client install media, get ithere. Note that this is the WMQ v7 client and not the v6 client. It is compatible with the v6 QMgr but since v6 is end-of-life as of September 2011 you should be doing new development on the v7 client and, if possible, a v7 QMgr. There are a lot of functional and performance enhancements available if both sides are v7.You can get the product manualhereif you need it.Finally, please be sure when you get a JMS exception to print the linked exception. This is not a WMQ thing, rather it's a JMS thing. Sun provided a multi-level data structure for JMS exceptions and the really interesting parts are often in the nested level. This is not a big deal and can be implemented in a few lines:try {\n .\n . code that might throw a JMSException\n .\n} catch (JMSException je) {\n System.err.println(\"caught \"+je);\n Exception e = je.getLinkedException();\n if (e != null) {\n System.err.println(\"linked exception: \"+e);\n } else {\n System.err.println(\"No linked exception found.\");\n }\n}This helps to determine the difference between a JMS error versus a transport error. For example a JMS security error might be a WMQ 2035, or it might be the JSSE configuration, or the app might not have access to something in the file system. Only one of these is worth spending a lot of time digging through the WMQ error logs for and only by printing the linked exception will you be able to tell if it's that one.\n"} +{"text": "### Human: I receive a message from a WebSPhere MQ queue. I try to process and if i receive some exceptions i want to rollback the message to the MQ Queue.I have no problems in doing the same. What happens to the message? Does it go to the bottom of the queue?If i try and pull a message from the queue would i receive the same message that i rolledback?What is the behaviour likely to be? I want to know this behaviour typically in a high volume Queue scenario?Appreciate any inputs.Thanks,\nManglu### Assistant: If you are doing queue operations within the scope of a transaction, and a rollback occurs, then after the transaction resolves the queue and message will appear just as it did before the transaction began. In other words no changes at all.In a high volume scenario, though, it is typical to have multiple transactional readers and writers on a single queue, and they do not lock the entire queue for each de-queue or enqueue.These readers and writers will insert items into the queue, or dequeue items from the queue transactionally, while your doomed transaction is resolving. In that case, other queue items may appear or disappear (or both).If after rollback of the original transaction, you again dequeue from the queue, youmayget the original message, but you may not. In a high-volume, high-concurrency scenario, it is possible that another reader will have pulled the message before your code can do so.\n"} +{"text": "### Human: I need to write a .Net connector to WebSphere MQ queues so I've installed a trial version of IBM WebSphere MQ on my Windows 7 machine. I initially setup some dummy queues in MQ Explorer to play with the setup process and I was able to connect to those queue managers and create queues. I deleted those dummy queues and followed the first set of instructionsfrom Lesson 1.1 from IBM herewhere I created some queues from the command lineI failedto run Lesson 1.2because of security issues, and I now cannot connect to any queue managers in MQ Explorer. when I try to connect I get the error messageAn unexpected error (2063) has occurred. (AMQ4999)I am local admin on my machine.I've added myself to the mqm group that was createdI've run the MQ Explorer both with and without the 'Run as Administrator' optionI've uninstalled MQ and re-installed itI've rebooted several timesI've also noticed that when I create a queue manager in MQ Explorer, the last part fails withAMQ8135: Not authorized.(see output below)Is there something obvious that I am missing?Is there some way that I can work out what the problem is myself - the log files don't seem to give me any idea where to look****************************************\n* Command: \"C:\\Program Files (x86)\\IBM\\WebSphere MQ\\bin\\crtmqm\" -sa QM1\n****************************************\nThere are 90 days left in the trial period for this copy of WebSphere MQ.\nWebSphere MQ queue manager created.\nDirectory 'C:\\Program Files (x86)\\IBM\\WebSphere MQ\\qmgrs\\QM1' created.\nThe queue manager is associated with installation 'Installation2'.\nCreating or replacing default objects for queue manager 'QM1'.\nDefault objects statistics : 74 created. 0 replaced. 0 failed.\nCompleting setup.\nSetup completed.\nexitvalue = 0\n****************************************\n* Command: \"C:\\Program Files (x86)\\IBM\\WebSphere MQ\\bin\\strmqm\" QM1\n****************************************\nThere are 90 days left in the trial period for this copy of WebSphere MQ.\nWebSphere MQ queue manager 'QM1' starting.\nThe queue manager is associated with installation 'Installation2'.\n5 log records accessed on queue manager 'QM1' during the log replay phase.\nLog replay for queue manager 'QM1' complete.\nTransaction manager state recovered for queue manager 'QM1'.\nWebSphere MQ queue manager 'QM1' started using V7.1.0.0.\nexitvalue = 0\n****************************************\n* Command: \"C:\\Program Files (x86)\\IBM\\WebSphere MQ\\bin\\runmqsc\" QM1\n* Input: DEFINE LISTENER('LISTENER.TCP') TRPTYPE(TCP) PORT(1414) CONTROL(QMGR)\n****************************************\n5724-H72 (C) Copyright IBM Corp. 1994, 2011. ALL RIGHTS RESERVED.\nStarting MQSC for queue manager QM1.\nAMQ8135: Not authorized.\nNo MQSC commands read.\nNo commands have a syntax error.\nAll valid MQSC commands were processed.\nexitvalue = 20### Assistant: If you have a recent trial version of WMQ then you are working with a v7.1 QMgr. As of v7.1 WMQ will allow only non-privileged remote connections. In order to connect with an administrator account, it will be necessary to either disable the restrictions or, better yet, to define a new channel for the administrative connection and authenticate it.With Windows the biggest issue is that WMQ authenticates domain IDs and must look up their groups. One very common problem when running WMQ in a corporate environment is that it attempts to lookup an ID or group and does not have the domain rights to do so.Domain accounts, even those with local admin rights, often fail because they don't have access to inquire in the domain SAM to do group lookups. There's a whole section in the Infocenterheredescribing the requirements for Windows accounts.One workaround for thisfor dev environments onlyis to create a local administrator's account, then log on with that and create the QMgr. Or make sure that the default accountMUSR_MQADMINhas local admin rightsand login rights. Again,, you must actually log in with the account to make this work because that way there is never a requirement to look up an account in Active Directory because it all hits the local SAM database. Again, this is just for development! In Production you'd want to use a real domain account and grant it the correct access rights to do SAM lookups but NOT make it a local admin, as described in the Infocenter section linked above.Assuming that you have succeeded in creating the QMgr, next create a new channel and authorize it to accept yourlocalconnections using the admin account:runmqsc\n* Define the channel, anyone connecting runs as MUSR_MQADMIN\nDEFINE CHL('DOTNET.SVRCONN') CHLTYPE(SVRCONN) MCAUSER('MUSR_MQADMIN@hostname')\n\n* Override default block-list - channel now allows ANYBODY\nSET CHLAUTH('DOTNET.SVRCONN') TYPE(BLOCKUSER) USERLIST('nobody')\n\n* Block access from ALL IP addresses\nSET CHLAUTH('DOTNET.SVRCONN') TYPE(ADDRESSMAP) ADDRESS('*') USERSRC(NOACCESS) WARN(NO) ACTION(ADD)\n\n* Allow access from local host only\nSET CHLAUTH('DOTNET.SVRCONN') TYPE(ADDRESSMAP) ADDRESS('127.0.0.1') USERSRC(CHANNEL) ACTION(ADD) \n\nENDNow you have a channel that will accept local connections ONLY, map these to an administrative account and then override the security that prevents administrative accounts from connecting remotely. Using the admin account means that no queue or QMgr authorizations are required and the account being a local admin means that there are no domain lookup issues. TheMCAUSER('MUSR_MQADMIN)converts every remote ID to the local admin ID so that WMQ doesn't need to look up the remote IDs. The mapping rule restricts connections to the local host only. Anyone who can connect to the channel will have local admin on the box with the ability to remotely execute OS code so if you wanted to accept connections from other users, authenticating them with certificates would be recommended.\n"} +{"text": "### Human: I'm writing a .NET Windows Forms application that will post a message to a Websphere MQ queue and then poll a different queue for a response. If a response is returned, the application will partially process the response in real time. But the response needs to stay in the queue so that a daily batch job, which also reads from the response queue, can do the rest of the processing.I've gotten as far as reading the message. What I haven't been able to figure out is how to read it without removing it.Here's what I've got so far. I'm an MQ newbie, so any suggestions will be appreciated. And feel free to respond in C#.Public Function GetMessage(ByVal msgID As String) As MQMessage\n Dim q = ConnectToResponseQueue()\n Dim msg As New MQMessage()\n Dim getOpts As New MQGetMessageOptions()\n Dim runThru = Now.AddMilliseconds(CInt(ConfigurationManager.AppSettings(\"responseTimeoutMS\")))\n System.Threading.Thread.Sleep(1000) 'Wait for one second before checking for the first response'\n While True\n Try\n q.Get(msg, getOpts)\n Return msg\n Catch ex As MQException When ex.Reason = MQC.MQRC_NO_MSG_AVAILABLE\n If Now > runThru Then Throw ex\n System.Threading.Thread.Sleep(3000)\n Finally\n q.Close()\n End Try\n End While\n Return Nothing 'Should never reach here'\nEnd FunctionNOTE:I haven't verified that my code actually removes the message. But that's how I understand MQ to work, and that appears to be what's happening. Please correct me if that's not the default behavior.### Assistant: You need to open the queue with MQOO_BROWSE option. Then on your first read you do a GET using the MQGMO_BROWSE_FIRST option. Finally, your subsequent GET's should use the MQGMO_BROWSE_NEXT option.Note: MQOO is MQ open options and MQGMO is MQ Get Message Options.\n"} +{"text": "### Human: hi I am new to Spring JMS and websphere MQ. Can Any one give me step by step processs or example how to receive message from websphere MQ and be able to print that message in console\nthanks u very much for your help### Assistant: Here is a working sample using Spring MDP/Activation Spec for websphere MQmdp-listener.xml\n\n\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \nweb.xml\n contextConfigLocation\n /WEB-INF/context/mdp-listener.xml\n \n\n\n org.springframework.web.context.ContextLoaderListener\nSpringMdppackage com.rohid.samples;\n\n import javax.jms.JMSException;\n import javax.jms.Message;\n import javax.jms.MessageListener;\n import javax.jms.TextMessage;\n\n public class SpringMdp implements MessageListener {\n\n public void onMessage(Message message) {\n try {\n if(message instanceof TextMessage) {\n System.out.println(this + \" : \" + ((TextMessage) message).getText());\n }\n\n } catch (JMSException ex){\n throw new RuntimeException(ex);\n }\n }\n }'\n"} +{"text": "### Human: I have an instance of WebSphere 6 and an instance of WebSphere 7. Each has a WebSphere MQ messaging provider, a queue connection factory and a queue configured in a similar way. All user ID fields are left empty and Authentication aliases left at \"none\".In WAS6 it works fine.In WAS7 I get an error:JMSWMQ2013: The security authentication was not valid that was supplied for QueueManager 'MYQMNGR' with connection mode 'Client' and host name '10.11.22.33(51001)'.; nested exception is com.ibm.msg.client.jms.DetailedJMSSecurityException: JMSWMQ2013: The security authentication was not valid that was supplied for QueueManager 'MYQMNGR' with connection mode 'Client' and host name '10.11.22.33(51001)'. Please check if the supplied username and password are correct on the QueueManager you are connecting to; nested exception is com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED').What may be different in the way WAS7 connects to MQ compared to WAS6 if no user ID is supplied?I don't have any visibility or access to that MQ (version 7), it doesn't require user ID when accessing from WAS 6 so I need to get WAS7 to work the same.### Assistant: In WAS 6 if you left the user ID in the administration panel blank, a blank was passed to WMQ. WMQ will run the channel even if it cannot determine the remote user and in that case the channel runs with the authority of the Message Channel Agent (MCA), which is always administrative. Hence, in V6, it works.As of V7, the WMQ client will try a little harder to determine what ID to pass if you leave it blank in the WAS admin panel and will obtain the JVM ID and pass that on theCONNECTcall. This is the source of the 2035.The right way to fix this is that the WMQ administrator should place a low-privileged ID in the SVRCONN channel's MCAUSER field. The ID should be authorized to whatever queues the Java EE server needs but not to the command queue and various other administrative queues. This will resolve the problem that WAS 7 is sending an unrecognized IDandit prevents remote clients of any type from gaining admin access on that channel.The alternative is to go to the WAS admin panel for the WMQ connection and set the user ID tomqm. (This works if if WMQ runs on a distributed non-Windows system. If WMQ is running on Windows, z/OS or something else, substitute the platform equivalent ID here.) Although this will get WAS up and running, it does not address the fact that the QMgr exposes administrative access.Please see the WMQ Hardening presentation and lab athttp://t-rob.net/linksfor a more comprehensive explanation of how to identify and remediate the underlying security exposure at the QMgr.\n"} +{"text": "### Human: I am trying to make an common abstract interface over the messaging infrastructure in our company. The design goal is to 2 fold. 1 is to hide the complexity of programming from the developers (i know its not very complex but still simplify it further) and 2 is to make the developers independent of the vendor specific messaging infrastructure (i.e. it can be MQSeries or EMS or MSMQ).The very common option is using the WCF layer over the messaging infrastructure. Use the MQSeries Custom channel for WCF or use EMS custom channle for WCF. But both are ruled out due to lack of proper version of MQSeries and EMS.Can someone please suggest what are the possible solutions to this problem. One which i can think of the to have a custom wrapper like JMS. Has anyone ever tried something similar before. Any help would be fantastic.by the way, i am trying to create this wrapper in C# 3.5.Regards### Assistant: There'sNMS, which is a .NET implementation of the JMS protocol. It comes with a provider which works with ActiveMQ as the underlying message broker.It might also be worth checking out some of the excellent open source Service Bus implementations for .NET which provide further useful messaging abstractions:NServiceBus,MassTransitandRhino Service Buscome to mind.\n"} +{"text": "### Human: I have WebSphere MQ and WebSphere Message Broker installed on Linux and when I executemqsicreateexecutiongroupI get an error saying:BIP1046E: Unable to connect with the queue manager (Could not connect to queue manager 'NSPZPAI1' (MQ reason code 2538)).When I search for this reason code I understand that it is ahost not available error.Can somebody please tell me how to resolve this error?When I run arunmqlsrcommand I always end up in a hang. Can somebody tell me how to start a listener?### Assistant: Don't start the listener by hand or script. If you have a modern queue manager, define a listener object like so:DEF LISTENER(LISTENER.1414) TRPTYPE(TCP) +\n CONTROL(QMGR) PORT(1414) +\n REPLACE\n\nSTART LISTENER(LISTENER.1414)The attributeCONTROL(QMGR)tells the QMgr to start the listener automatically when the QMgr is started and to kill the listener when the QMgr is shut down. This ensures that the listener will always be started when the QMgr comes up, even if the QMgr is started manually instead of from the usual boot script. Because the listener is a child process of the QMgr it willalwayscome down with the QMgr so you don't need to worry about orphaned listeners preventing connections after a QMgr restart.Once the listener is defined, you can also useSTART LISTENERorSTOP LISTENERMQSC commands to manually start and stop it independently of the QMgr. In the example above, I've manually started the listener rather than reboot the QMgr. Either would work but theSTARTcommand is less intrusive.\n"} +{"text": "### Human: I am using Spring JMS to connect to a Websphere MQ server. I implemented the SessionAwareListener interface to create a custom listener, reusing old code for the business logic.While testing, the listener throws a StringIndexOutOfBoundsException, which I fail to catch. However, I see in the log the following printed about 32 times, then the DMLC stops.WARN - Execution of JMS message listener failedIs there a way to control how often the DMLC will retry a message, and how to handle uncaught exceptions?### Assistant: You can always check the JMSDeliveryCount. If it is more than the number you consider as maximum then just don't process the message and return.You can alsoconfigure your Websphereto move the bad message to the exception destination after some attempts.\n"} +{"text": "### Human: The JMS 2.0 specification saysTheJMSMessageIDheader field contains a value that uniquely\n identifies each message sent by a provider....and...The exact scope of uniqueness is provider defined. It should at least\n cover all messages for a specific installation of a provider where an\n installation is some connected set of message routers.The specification does not explicitly state that theJMSMessageIDreturned from the publish API call must match the one present in the message when it is consumed. The discussion in the spec about moving theJMSMessageIDto theJMSCorrelationIDwhen replying to a request implies that the two would be the same. If the message ID was changed between publication and consumption, this style of request/reply would fail.Certainly in the unified domain model of JMS 1.1 and now 2.0, it would not make sense for the behavior of theJMSMessageIDto change depending on whether the destination is a queue or a topic. Under the unified model, one would expect all destinations to act alike in this regard.Also, if \"provider\" as used in the first paragraph refers to the thing that is sending messages, then a publication that fanned out to 10 identical messages, with identicalJMSMessageIDvalues, would meet the spec since uniqueness is measured at the sending side.Unfortunately, the specification liberally switches between using the term \"provider\" to describe the thing sending messages versus using it to describe the vendor of the JMS transport. This is evident in the two quoted passages above. This ambiguity doesn't help matters any.At least one implementation (IBM's MQ) takes the approach that a publication fanning out to 10 messages has created 10 unique, new messages, and therefore each of these has a uniqueJMSMessageIDvalue. This is arguably consistent with the second quoted passage which requires uniqueness scoped to the provider, where \"provider\" appears to refer to the vendor implementation andnotthe thing sending messages.It is my belief that when a published message fans out to multiple subscribers the correct behavior would be that theJMSMessageIDwould be preserved in each instance of the message so that replies can be correlated as expected. In other words, I believe IBM's implementation to be non-compliant. Since the specification is ambiguous on the matter, I'm looking for an authoritative source which either states outright or strongly implies the behavior as intended by the spec, one way or the other. Depending on the response, I'll either stand down, or else raise the issue with IBM as a compliance defect.### Assistant: The term \"provider\" here is simply a reference to the specific messaging product being used, and covers both client-side and server-side components. To avoid confusion, I'll use the word JMS product vendor here.The purpose of the JMS specification is to define a Java API implemented by that messaging product. It uses loose terms like \"provider\" because the JMS spec does not define how the product is architected and is trying to avoid suggesting how the implementation should be shared between client-side and server-side components, or even whether there is a server (or cluster of servers) at all. You'll notice the spec never (well, almost never) says \"the server does this\" or \"the server does that\".The sentence about the \"exact scope of uniqueness\" is there to make it easy for the JMS product vendor to implement the code that generatesJMSMessageIDvalues. It's saying that the code that generatesJMSMessageIDvalues doesn't need to worry about ensuring that the values generated are unique across the entire universe. It's sufficient to ensure that they are unique to that particular product installation.You say that \"The specification does not explicitly state that theJMSMessageIDreturned from the publish API call must match the one present in the message when it is consumed.\"I think this is stated in Section 4.4.11 \"How message header values are set\". This states that theJMSMessageIDis set by the \"JMS provider send method\". The same section goes on to say that \"Message header fields that are defined as being set by the 'JMS provider send method' will be available on the sending client as well as on the receiving client.\"This means that after the call to send() or publish() has returned, the sending application can use the methodgetJMSMessageID()to find the message ID that was assigned to that message. When this message is received, the receiving application can use the same method, and get the same value.Each message sent to a topic is delivered to every subscriber on that topic. These subscribers will receive a separate copy of the same message, with the same body, properties and headers, includingJMSMessageIDvalue.Feel free to argue; the JMS spec is not free of ambiguities.\n"} +{"text": "### Human: Closed.This question is seeking recommendations for books, tools, software libraries, and more. It does not meetStack Overflow guidelines. It is not currently accepting answers.We don\u2019t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.Closed5 years ago.Improve this questionI'm seeing downloads for 7.0.1.8 off the IBM website but at the same time I see 7.1.0.1 around. I do not see the download for the client of 7.1.0.1 though...### Assistant: The WMQ clients are available asSupportPacs. You can download one of the following:WMQ V7.0 Client == SupportPac MQC7 -Withdrawn no longer supportedWMQ V7.1 Client ==SupportPac MQC71WMQ V7.5 Client ==SupportPac MQC75IBM MQ V8.0 Client ==SupportPac MQC8IBM MQ V9.0 Client ==SupportPac MQC9Be sure to use the Knowledge Center for the version of client you are using!WMQ V7.0.1 Knowledge CenterWMQ V7.1 Knowledge CenterWMQ V7.5 Knowledge CenterWMQ V8.0 Knowledge CenterWMQ V9.0 Knowledge Center\n"} +{"text": "### Human: We have a Java application that sends JMS message via IBM WebSphere MQ. The consumer application requires the message content type to be set to \"application/json\". How can I go about doing it?I've checked through a few references and it seems I can set extra header via method \"setStringProperty(headerKey, headerName)\", E.g.Message jmsMsg = session.createTextMessage(msgStr);\njmsMsg.setStringProperty(\"Content-Type\", \"application/json\");The problem then is \"Content-Type\" is not a valid property key since it contains the \"-\" character.Is this something that can be done in code? Or is it actually configured in the queue settings?### Assistant: The property name \"Content-Type\" has a '-' character. According to JMS specifications a property name can contain any character for which the JavaCharacter.isJavaIdentifierPartmethod returns atrue. For '-' characterisJavaIdentifierPartmethod returnsfalse. Hence thesetStringProperty(\"Content-Type\", \"application/json\")method call fails with the following exception.com.ibm.msg.client.jms.DetailedMessageFormatException: JMSCC0049: The property name 'Content-Type' is not a valid Java(tm) identifier.\nThe supplied property name does not conform to the allowed format described in the JMS specification.\nCheck the characters used in the property name and modify as necessary.If it's possible to change the receiving application, you could opt for\"Content_Type\"(Use an underscore) as property name instead of\"Content-Type\".\n"} +{"text": "### Human: I need to listen to multiple queues (exists in same Queue Manager). I have the working spring boot application code for listening to single queue. But is there any way I can connect to multiple queues from the single spring boot application?Also is there anyway if I can switch listeners from one queue to another queue at runtime?I have the code to read from single queue which is as follows:public class ConnectionConfiguration {\n\n private static final Logger logger = LogManager.getLogger(ConnectionConfiguration.class);\n\n @Value(\"${LDR_LOCAL_MQ_READ_FACTORYNAME}\")\n String connectionFactory;\n\n @Value(\"${LDR_LOCAL_MQ_QUEUENAME}\")\n String localQueue;\n\n @Value(\"${jmsConcurrency}\")\n String concurrency;\n\n @Value(\"${servers.mq.host}\")\n private String host;\n\n @Value(\"${servers.mq.port}\")\n private Integer port;\n\n @Value(\"${servers.mq.queue-manager}\")\n private String queueManager;\n\n @Value(\"${servers.mq.channel}\")\n private String channel;\n\n @Value(\"${servers.mq.queue}\")\n private String queue;\n\n @Value(\"${servers.mq.timeout}\")\n private long timeout;\n\n @Bean\n public ConnectionFactory connectionFactory() {\n\n JndiObjectFactoryBean jndiObjectFactoryBean = new JndiObjectFactoryBean();\n jndiObjectFactoryBean.setResourceRef(true);\n jndiObjectFactoryBean.setJndiName(connectionFactory);\n try {\n jndiObjectFactoryBean.afterPropertiesSet();\n } catch (IllegalArgumentException e) {\n logger.error(e.getMessage(), e);\n e.printStackTrace();\n } catch (NamingException e) {\n logger.error(e.getMessage(), e);\n e.printStackTrace();\n }\n return (ConnectionFactory) jndiObjectFactoryBean.getObject();\n }\n\n @Bean\n public MQQueueConnectionFactory mqQueueConnectionFactory() {\n MQQueueConnectionFactory mqQueueConnectionFactory = new MQQueueConnectionFactory();\n try {\n mqQueueConnectionFactory.setHostName(host);\n mqQueueConnectionFactory.setQueueManager(queueManager);\n mqQueueConnectionFactory.setPort(port);\n mqQueueConnectionFactory.setChannel(channel);\n mqQueueConnectionFactory.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n mqQueueConnectionFactory.setCCSID(1208);\n } catch (Exception e) {\n e.printStackTrace();\n }\n return mqQueueConnectionFactory;\n }\n\n @Bean\n public SimpleMessageListenerContainer queueContainer(MQQueueConnectionFactory mqQueueConnectionFactory) {\n\n SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();\n container.setConnectionFactory(mqQueueConnectionFactory);\n container.setDestinationName(queue);\n container.setMessageListener(getListenerWrapper());\n container.start();\n return container;\n }\n\n @Bean\n public MQListener getListenerWrapper() {\n return new MQListener();\n }\n\n @Bean\n public JmsTemplate getJmsTemplate() {\n try {\n return new JmsTemplate(mqQueueConnectionFactory());\n } catch (Exception exp) {\n logger.error(exp.getMessage(), exp);\n }\n return null;\n }\n\n}### Assistant: Just add a listener container bean for each queue.To change the queue, callstop(), thenshutdown(), change the destination, theninitialize(), thenstart().\n"} +{"text": "### Human: I'm using theIBM.XMS libto talk to WebSphereMQ.When receiving messages using the synchronous method, eg:using (var scope = new TransactionScope(TransactionScopeOption.Required, transactionOptions))\n{\n message = consumer.Receive(1000);\n\n if (message != null)\n {\n //Do work here\n scope.Complete();\n }\n}But if I want to use the asynchronous method:consumer.MessageListener = delegate(IMessage msg)\n{\n //Do work here\n //But where do I put TransactionScope?\n};I can't work out how to wrap theMessageListenercallback within aTransactionScope.Does anyone know how to do this?### Assistant: A message listener a.k.a Asynchronous Consumer can't be used in aTransactionScopeas the message listener runs on a different thread than the thread that created theTransactionScope. You can only use the synchronous Receive/Send inside aTransactionScope.Thislinksays \"The XA transactions are not supported in asynchronous consumers.\"\n"} +{"text": "### Human: I have a requirement that I need to process JMS Messages (via MDB) in a way that Messages belonging to a certain group (a group ID is set) are consumed by the same bean instance. The behaviour I require in this is that Messages with the same group ID are processed sequentially (though message ordering is irrelevant), and tying them to the same MDB-instance should provide that.The messages do not carry any kind of sequence number (as it is irrelevant) and we do not know what the first or last message in a group is (there could theoratically \"never\" be a last message in a group). We want them to be delivered as soon as the consumer is able to receive them.ActiveMQ provides this exact feature (http://activemq.apache.org/message-groups.html) by simply setting JMSXGroupID. We are bound to WebSphere MQ, though. All I've found out so far is that it is possible to collect Messages of the same group in the queue and using a MessageSelector to receive a \"Last Message in Group\" Message as described inhttp://www.ibm.com/developerworks/websphere/library/techarticles/0602_currie/0602_currie.html. We would prefer a cleaner way though (like in ActiveMQ). Does anyone know how to achieve that behaviour in WebSphere?Thanks!### Assistant: Generally you use MessageSelectors in IBM product implementations of JMS (both WebSphere MQ and SIBus implementations). These are the equivalent of a filter that would scan the header of an HTTP or SOAP message for web-based protocols.Though it may not be what you want, it actually is a clean and well thought through design.However, if you do not want to use MessageSelectors, you will probably have to build your own and \"process\" a message with a fronting MDB that scans the headers, and then forwards the message to an appropriate queue, where only the MDB that cares about the grouped messages will process them (sort of a gateway/message selector pattern).If you are using the \"pure\" JMS API's, then you can ask the Session object to create a MessageConsumer with the specified selector string (value in the header) you want to filter on (again you have to set this yourself).//assume we have created a JMS Connection and Session object already.\n//and looked up the Queue we want already.\nMessageConsumer consumerWithSelector = session.createConsumer(queue, groupId);This is all the pure JMS API's give you. Anything else is purely up to the implementer of the messaging technology, which is then proprietary to their implementation and not portable code.\n"} +{"text": "### Human: While browsing the messages in MQ explorer, it only displays the first 1000 characters. We are not able to see the complete message. Is there any freeware available that can be used to view the complete message ?### Assistant: Before switching to something else, have you tried adjusting the WMQ Explorer settings?First, get to the Preferences dialog:Then select the Messages panel and adjust the value:The reason that WMQ Explorer has these defaults set is to prevent an apparent \"hang\" if there were, for example, 3500 messages of size 64k. Given these defaults, Explorer will download no more than 500 of them and only the first 10k bytes of each. Given the defaults, Explorer can browse a deep queue with large messages and still return in a predictable amount of time.The same issues hold true for any other browser tool since the bottleneck is the network and not the tool.That said, if you want to look at other desktop client tools,SupportPac MO71is quite popular.\n"} +{"text": "### Human: I am using a JMS client. The queue is a IBM MQ. When I write data on the queue, it is added with the RFH header. How can I strip the RFH header. I cannot use IBM MQ apis.### Assistant: Another way is using the queue URI attributes (http://www.ibm.com/support/knowledgecenter/api/content/nl/en-us/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q032240_.htm#q032240___q032240_4).\nThe attributetargetClientcontrols whether to use RFH or native format.Queue queue = queueSession.createQueue(\"queue:///\" + queueName + \"?targetClient=1\");\n"} +{"text": "### Human: I made a java app that uses JMS to send messages to an MQ Queue. I set the message id and correlation id with the setJMSMessageId() and setJMSCorrelationId(). The messageId seems to be overwritten when the sending ends. I googled a bit, and seems that the server overwrites the messageId even when you send it.The requirement for this app is that both messageId and correlationId have the same value when sent and when received. Isn't there anything I can do about this?Note: I am using JDK 1.6, and a WAS 8.5 to deploy the app. This WAS communicates with a MQ Queue Manager.### Assistant: Message ids are reserved for the messaging system to set. You can read it and, e.g., log or even persist it, but nothing else. Esp., it's not supposed to be set by an application! The setter is there only when bridging between two messaging systems, i.e. when you receive a message from one messaging system X and forward it to a different messaging system Y. Then Y needs to be able to set the message id of that message object, even though Y has not created it, i.e. even though it's not Y's own implementation. There are several methods for this use case and it's causing a lot of confusion; it's best to just ignore them.OTOH, correlation ids are for your application to use. A very common pattern is arequest-responsepair of messages, and this is the second source of confusion:An original sender A sends a message to a destination D with the reply-to header field set to a destination D' where A expects to receive the replies. The message id is set by the messaging system when A calls one of the varioussendmethods, and A stores this message id.Then B receives the message, handles the business logic, and replies to D'. It also sets the correlation id to the message id of the message it just received. The reply message also gets a new message id from the messaging system, but that is irrelevant for this pattern.Finally A receives the reply message from D', reads the correlation id, and uses that to look up the message id it has stored in step 1.There are a lot of other message exchange patterns, like one-request-many-replies or unsolicited messages, and the proper use of correlation ids is essential; but request-reply is by far the most common. That's why it's even suggested in the JavaDoc. Otherwisemessage ids have nothing to do with correlation ids. This is confusing for beginners. I even found it preferable to correlate messages with business keys instead of message ids.Coming back to your question: as you set the correlation id before you send the message, and the message id is set by the messaging system when you send the message, there is no way in the JMS-API to make both values the same value.\n"} +{"text": "### Human: We have an application which needs to communicate with a Multi-Instance QueueManager. Both (instances) are running on the default port and have unique addresses.serverA.internal.company.addressserverB.internal.company.addressWe use the following code to establish the ConnectionFactory:MQQueueConnectionFactory connectionFactory = new MQQueueConnectionFactory();\nconnectionFactory.setTransportType(1);\nconnectionFactory.setPort(1414);\nconnectionFactory.setChannel(\"CLIENTCONNECTION\");\nconnectionFactory.setQueueManager(\"queue.manager.name.here\");\nconnectionFactory.setHostName(\"serverA.internal.company.address\");How can we specify both addresses so that failover is achieved without writing our own retry logic?### Assistant: using the following:connectionFactory.setConnectionNameList(\"serverA.internal.company.address(1414),\"\n + \"serverB.internal.company.address(1414)\")instead ofconnectionFactory.setHostName(\"serverA.internal.company.address\");\nconnectionFactory.setPort(1414);did the trick for us.\n"} +{"text": "### Human: I addedcom.ibm.mqjmsmaven dependency in my pom.xml:\n com.ibm\n com.ibm.mqjms\n 5.3.07\nAnd it's giving me:The following artifacts could not be resolved: com.ibm:com.ibm.mqjms:jar:5.3.07, com.ibm:com.ibm.mq:jar:5.3.07, javax.naming:jndi:jar:1.2.1, javax.resource:connector:jar:1.0, javax.transaction:jta:jar:1.0.1B, javax.jms:jms:jar:1.1: Could not find artifact com.ibm:com.ibm.mqjms:jar:5.3.07 in central (http://repo.maven.apache.org/maven2)Any idea how can I fix it?### Assistant: Below JARs are proprietary - hence they will not resolve through a public Maven repository like Maven Central. These JARs need to be obtained from the WebSphere MQ installation directory and manually deployed to our local Maven repository.:\n com.ibm\n com.ibm.mqjms\n ${webSphereMQVersion}\n\n\n com.ibm\n com.ibm.mq.jmqi\n ${webSphereMQVersion}\n\n\n com.ibm\n com.ibm.disthub2.dhbcore\n ${webSphereMQVersion}\n\n"} +{"text": "### Human: I am using IBM MQ Classes for JMS (IBM MQ Version 8.0.0.4) with auto-reconnection configured. According to the docs, reconnection happens implicitly. I would like to issue a simple log statement in the event of reconnection. For that reason, I need to somehow get informed, when that happens.In the IBM docs on pageApplication RecoveryI stumbled over section \"Detecting failover\" where it says:Reconnection aware:Register an MQCBT_EVENT_HANDLER event handler with\n the queue manager. The event handler is posted with MQRC_RECONNECTING\n when the client starts to try to reconnect to the server, and\n MQRC_RECONNECTED after a successful reconnection. You can then run a\n routine to reestablish a predictable state so that the client\n application is able to continue processing.Unfortunately, I did not find a code example for Java/JMS that demonstrates how and where to register such an event handler. I don't know if that is even supported in my case. Could anyone provide me to the right direction or even provide a code sample? Thank you very much.Question Update from February 5, 2020:Added the following code example created by myself, after having received Sashi's initial answer from January 27, 2020.public static void main(String[] args) {\n Connection connection = null;\n Session session = null;\n Object destination = null;\n MessageProducer producer = null;\n\n try {\n JmsFactoryFactory jmsFactoryFactory = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\n JmsConnectionFactory cf = jmsFactoryFactory.createConnectionFactory();\n\n cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, HOST);\n cf.setIntProperty(WMQConstants.WMQ_PORT, PORT);\n cf.setStringProperty(WMQConstants.WMQ_CHANNEL, CHANNEL);\n cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\n cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, QM_NAME);\n cf.setIntProperty(WMQConstants.WMQ_CLIENT_RECONNECT_OPTIONS, WMQConstants.WMQ_CLIENT_RECONNECT);\n cf.setIntProperty(WMQConstants.WMQ_CLIENT_RECONNECT_TIMEOUT, RECONNECT_TIMEOUT);\n\n connection = cf.createConnection();\n connection.setExceptionListener(new MQExceptionListener());\n session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);\n destination = session.createQueue(QUEUE);\n producer = session.createProducer((Destination)destination);\n connection.start();\n } catch (JMSException ex) {\n LOGGER.error(ex.toString());\n }\n}\n\npublic class MQExceptionListener implements ExceptionListener {\n public void onException(JMSException e) {\n System.out.println(e);\n if(e.getLinkedException() != null)\n System.out.println(e.getLinkedException());\n }\n}This is what I get in the logs:ERROR [Main.main:57] (main) com.ibm.msg.client.jms.DetailedIllegalStateException: JMSWMQ0018: Failed to connect to queue manager '' with connection mode 'Client' and host name '()'.\nCheck the queue manager is started and if running in client mode, check there is a listener running. Please see the linked exception for more information.\nERROR [Main.main:61] (main) Inner exceptions:\nERROR [Main.main:65] (main) com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2538' ('MQRC_HOST_NOT_AVAILABLE').\nERROR [Main.main:65] (main) com.ibm.mq.jmqi.JmqiException: CC=2;RC=2538;AMQ9204: Connection to host '()' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2538;AMQ9204: Connection to host '/:' rejected. [1=java.net.ConnectException[Connection refused: connect],3=/:,4=TCP,5=Socket.connect]],3=(),5=RemoteTCPConnection.bindAndConnectSocket]\nERROR [Main.main:65] (main) com.ibm.mq.jmqi.JmqiException: CC=2;RC=2538;AMQ9204: Connection to host '/:' rejected. [1=java.net.ConnectException[Connection refused: connect],3=/:,4=TCP,5=Socket.connect]\nERROR [Main.main:65] (main) java.net.ConnectException: Connection refused: connectQuestion Update from February 11, 2020:I've added this additions based on feedback received by Sashi on February 5, 2020.I have tried to build a minimal application that connects to an IBM MQ instance. Here's the code:Application.javapublic class Application {\n private static final Logger LOGGER = LoggerFactory.getLogger(Application.class);\n\n public static void main(String[] args) {\n new Application().run();\n }\n\n private void run() {\n MQWriter writer = new MQWriter();\n int i = 1;\n while (true) {\n String message = \"Hello Testing \" + i;\n LOGGER.info(\"Sending message {} to MQ server...\", message);\n writer.write(message);\n i++;\n try {\n Thread.sleep(1000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n }\n}MQConnectionDetails.javapublic class MQConnectionDetails {\n public static final String HOST = \"XXX.XXX.XXX.XXX\";\n public static final int PORT = 1414;\n public static final String QM_NAME = \"QM1\";\n public static final String CHANNEL = \"DEV.APP.SVRCONN\";\n public static final String QUEUE = \"DEV.QUEUE.1\";\n public static final int RECONNECT_TIMEOUT = 60; // 1 minute\n}MQWriter.javapublic class MQWriter {\n\n private static final Logger LOGGER = LoggerFactory.getLogger(MQWriter.class);\n\n private Connection connection = null;\n private Session session = null;\n private Object destination = null;\n private MessageProducer producer = null;\n\n public MQWriter() {\n try {\n JmsFactoryFactory jff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\n JmsConnectionFactory jcf = jff.createConnectionFactory();\n jcf.setStringProperty(WMQConstants.WMQ_HOST_NAME, MQConnectionDetails.HOST);\n jcf.setIntProperty(WMQConstants.WMQ_PORT, MQConnectionDetails.PORT);\n jcf.setStringProperty(WMQConstants.WMQ_CHANNEL, MQConnectionDetails.CHANNEL);\n jcf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\n jcf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, MQConnectionDetails.QM_NAME);\n jcf.setIntProperty(WMQConstants.WMQ_CLIENT_RECONNECT_OPTIONS, WMQConstants.WMQ_CLIENT_RECONNECT);\n jcf.setIntProperty(WMQConstants.WMQ_CLIENT_RECONNECT_TIMEOUT, MQConnectionDetails.RECONNECT_TIMEOUT);\n\n LOGGER.info(\"Initializing connection to write queue {} on {}:{}...\",\n MQConnectionDetails.QUEUE,\n MQConnectionDetails.HOST,\n MQConnectionDetails.PORT);\n connection = jcf.createConnection();\n connection.setExceptionListener(new MQExceptionListener());\n session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);\n destination = session.createQueue(MQConnectionDetails.QUEUE);\n producer = session.createProducer((Destination)destination);\n connection.start();\n } catch (JMSException ex) {\n LOGGER.error(\"Error initializing connection to write queue\", ex);\n }\n }\n\n public void write(String message) {\n try {\n TextMessage textMessage = session.createTextMessage(message);\n producer.send(textMessage);\n } catch (Exception ex) {\n LOGGER.error(\"Error sending message to write queue\", ex);\n }\n }\n}MQExceptionListener.javapublic class MQExceptionListener implements ExceptionListener {\n private static final Logger LOGGER = LoggerFactory.getLogger(MQExceptionListener.class);\n\n public void onException(JMSException ex) {\n LOGGER.error(\"=====\");\n LOGGER.error(ex.toString());\n if (ex.getLinkedException() != null) {\n LOGGER.error(ex.getLinkedException().toString());\n }\n LOGGER.error(\"=====\");\n }\n}The test scenario I ran is like this:Make sure, IBM MQ is available on TCP port 1414 (IBM MQ Docker container running on Amazon EC2).Run the application above (Application.java) and make sure it sends messages to the queue.Change firewall config on Amazon EC2 security groups by changing port from 1414 to 1415, which makes IBM MQ unavailable to the client.This is what I've observed:Only after 90 seconds of inactivity, the client started throwing exceptions. I do not understand, because my RECONNECT_TIMEOUT was set to 60 seconds, so 30 seconds off here.MQExceptionListener is invoked only once (the first time).There are no reason codes 2544(MQRC_RECONNECTING) only 2009(MQRC_CONNECTION_BROKEN) is present. Why is that?Here is a summary of the exceptions that got thrown:Exceptions on console:2020-02-11 09:50:16,155 INFO [Application.run:21] (main) Sending message Hello Testing 13 to MQ server...\n2020-02-11 09:50:17,285 INFO [Application.run:21] (main) Sending message Hello Testing 14 to MQ server...\n2020-02-11 09:50:18,413 INFO [Application.run:21] (main) Sending message Hello Testing 15 to MQ server...\n2020-02-11 09:50:19,555 INFO [Application.run:21] (main) Sending message Hello Testing 16 to MQ server...\n2020-02-11 09:51:45,966 ERROR [MQExceptionListener.onException:14] (JMSCCThreadPoolWorker-6) =====\n2020-02-11 09:51:45,966 ERROR [MQExceptionListener.onException:15] (JMSCCThreadPoolWorker-6) com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ1107: A problem with this connection has occurred.\nAn error has occurred with the IBM MQ JMS connection.\nUse the linked exception to determine the cause of this error.\n2020-02-11 09:51:45,966 ERROR [MQExceptionListener.onException:17] (JMSCCThreadPoolWorker-6) com.ibm.mq.MQException: MQ delivered an asynchronous event with completion code '2', and reason '2009'.\n2020-02-11 09:51:45,966 ERROR [MQExceptionListener.onException:19] (JMSCCThreadPoolWorker-6) =====\n2020-02-11 09:51:45,967 ERROR [MQWriter.write:52] (main) Error sending message to write queue\ncom.ibm.msg.client.jms.DetailedJMSException: JMSWMQ2007: Failed to send a message to destination 'DEV.QUEUE.1'.\nJMS attempted to perform an MQPUT or MQPUT1; however IBM MQ reported an error.\nUse the linked exception to determine the cause of this error.\n at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:595)\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:215)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer.checkJmqiCallSuccess(WMQMessageProducer.java:1288)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer.checkJmqiCallSuccess(WMQMessageProducer.java:1245)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer.access$800(WMQMessageProducer.java:76)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer$SpiIdentifiedProducerShadow.sendInternal(WMQMessageProducer.java:906)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer$ProducerShadow.send(WMQMessageProducer.java:566)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer.send(WMQMessageProducer.java:1428)\n at com.ibm.msg.client.jms.internal.JmsMessageProducerImpl.sendMessage(JmsMessageProducerImpl.java:855)\n at com.ibm.msg.client.jms.internal.JmsMessageProducerImpl.synchronousSendInternal(JmsMessageProducerImpl.java:2055)\n at com.ibm.msg.client.jms.internal.JmsMessageProducerImpl.sendInternal(JmsMessageProducerImpl.java:1993)\n at com.ibm.msg.client.jms.internal.JmsMessageProducerImpl.send(JmsMessageProducerImpl.java:1486)\n at com.ibm.mq.jms.MQMessageProducer.send(MQMessageProducer.java:293)\n at org.example.MQWriter.write(MQWriter.java:50)\n at org.example.Application.run(Application.java:22)\n at org.example.Application.main(Application.java:13)\nCaused by: com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2009' ('MQRC_CONNECTION_BROKEN').\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:203)\n ... 14 more\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2009\n at com.ibm.mq.jmqi.remote.api.RemoteHconn$ReconnectionState.recordFailure(RemoteHconn.java:4931)\n at com.ibm.mq.jmqi.remote.api.RemoteHconn.setReconnectionFailureInner(RemoteHconn.java:2650)\n at com.ibm.mq.jmqi.remote.api.RemoteParentHconn.setReconnectionFailure(RemoteParentHconn.java:152)\n at com.ibm.mq.jmqi.remote.impl.RemoteReconnectThread.bestHconn(RemoteReconnectThread.java:265)\n at com.ibm.mq.jmqi.remote.impl.RemoteReconnectThread.run(RemoteReconnectThread.java:115)\n at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.runTask(WorkQueueItem.java:319)\n at com.ibm.msg.client.commonservices.workqueue.SimpleWorkQueueItem.runItem(SimpleWorkQueueItem.java:99)\n at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.run(WorkQueueItem.java:343)\n at com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.runWorkQueueItem(WorkQueueManager.java:312)\n at com.ibm.msg.client.commonservices.j2se.workqueue.WorkQueueManagerImplementation$ThreadPoolWorker.run(WorkQueueManagerImplementation.java:1227)\n2020-02-11 09:51:46,969 INFO [Application.run:21] (main) Sending message Hello Testing 17 to MQ server...\n2020-02-11 09:51:46,972 ERROR [MQWriter.write:52] (main) Error sending message to write queue\ncom.ibm.msg.client.jms.DetailedJMSException: JMSWMQ2007: Failed to send a message to destination 'DEV.QUEUE.1'.\nJMS attempted to perform an MQPUT or MQPUT1; however IBM MQ reported an error.\nUse the linked exception to determine the cause of this error.\n at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:595)\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:215)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer.checkJmqiCallSuccess(WMQMessageProducer.java:1288)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer.checkJmqiCallSuccess(WMQMessageProducer.java:1245)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer.access$800(WMQMessageProducer.java:76)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer$SpiIdentifiedProducerShadow.sendInternal(WMQMessageProducer.java:906)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer$ProducerShadow.send(WMQMessageProducer.java:566)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer.send(WMQMessageProducer.java:1428)\n at com.ibm.msg.client.jms.internal.JmsMessageProducerImpl.sendMessage(JmsMessageProducerImpl.java:855)\n at com.ibm.msg.client.jms.internal.JmsMessageProducerImpl.synchronousSendInternal(JmsMessageProducerImpl.java:2055)\n at com.ibm.msg.client.jms.internal.JmsMessageProducerImpl.sendInternal(JmsMessageProducerImpl.java:1993)\n at com.ibm.msg.client.jms.internal.JmsMessageProducerImpl.send(JmsMessageProducerImpl.java:1486)\n at com.ibm.mq.jms.MQMessageProducer.send(MQMessageProducer.java:293)\n at org.example.MQWriter.write(MQWriter.java:50)\n at org.example.Application.run(Application.java:22)\n at org.example.Application.main(Application.java:13)\nCaused by: com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2009' ('MQRC_CONNECTION_BROKEN').\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:203)\n ... 14 more\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2009\n at com.ibm.mq.jmqi.remote.api.RemoteHconn$ReconnectionState.recordFailure(RemoteHconn.java:4931)\n at com.ibm.mq.jmqi.remote.api.RemoteHconn.setReconnectionFailureInner(RemoteHconn.java:2650)\n at com.ibm.mq.jmqi.remote.api.RemoteParentHconn.setReconnectionFailure(RemoteParentHconn.java:152)\n at com.ibm.mq.jmqi.remote.impl.RemoteReconnectThread.bestHconn(RemoteReconnectThread.java:265)\n at com.ibm.mq.jmqi.remote.impl.RemoteReconnectThread.run(RemoteReconnectThread.java:115)\n at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.runTask(WorkQueueItem.java:319)\n at com.ibm.msg.client.commonservices.workqueue.SimpleWorkQueueItem.runItem(SimpleWorkQueueItem.java:99)\n at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.run(WorkQueueItem.java:343)\n at com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.runWorkQueueItem(WorkQueueManager.java:312)\n at com.ibm.msg.client.commonservices.j2se.workqueue.WorkQueueManagerImplementation$ThreadPoolWorker.run(WorkQueueManagerImplementation.java:1227)Question Update from February 12, 2020Added this sample and findings based on JoshMc's answer from February 11, 2020. My comments on this sample:I am now using the MQ* classes and set reconnect options as suggested.Reconnect is still not happening thoughMQWriter2.javapublic class MQWriter2 {\n\n private static final Logger LOGGER = LoggerFactory.getLogger(MQWriter2.class);\n\n private Connection connection = null;\n private Session session = null;\n private Queue destination = null;\n private MessageProducer producer = null;\n\n public MQWriter2() {\n try {\n MQConnectionFactory factory = new MQConnectionFactory();\n factory.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n factory.setConnectionNameList(\"XXX.XXX.XXX.XXX(1414)\");\n factory.setQueueManager(MQConnectionDetails.QM_NAME);\n factory.setChannel(MQConnectionDetails.CHANNEL);\n factory.setClientReconnectOptions(WMQConstants.WMQ_CLIENT_RECONNECT);\n factory.setClientReconnectTimeout(MQConnectionDetails.RECONNECT_TIMEOUT);\n\n LOGGER.info(\"Initializing connection to write queue {} on {}:{}...\",\n MQConnectionDetails.QUEUE,\n MQConnectionDetails.HOST,\n MQConnectionDetails.PORT);\n connection = factory.createConnection();\n connection.setExceptionListener(new MQExceptionListener());\n session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);\n destination = session.createQueue(MQConnectionDetails.QUEUE);\n producer = session.createProducer(destination);\n connection.start();\n } catch (JMSException ex) {\n LOGGER.error(\"Error initializing connection to write queue\", ex);\n }\n }\n\n public void write(String message) {\n try {\n TextMessage textMessage = session.createTextMessage(message);\n producer.send(textMessage);\n } catch (Exception ex) {\n LOGGER.error(\"Error sending message to write queue\", ex);\n }\n }\n}Console Output2020-02-12 08:39:11,628 INFO [MQWriter2.:29] (main) Initializing connection to write queue DEV.QUEUE.1 on 54.161.121.207:1414...\n2020-02-12 08:39:14,552 INFO [Application.run:19] (main) Sending message Hello Testing 1 to MQ server...\n2020-02-12 08:39:15,710 INFO [Application.run:19] (main) Sending message Hello Testing 2 to MQ server...\n2020-02-12 08:39:16,841 INFO [Application.run:19] (main) Sending message Hello Testing 3 to MQ server...\n...\n2020-02-12 08:39:41,973 INFO [Application.run:19] (main) Sending message Hello Testing 25 to MQ server...\n2020-02-12 08:41:27,314 ERROR [MQExceptionListener.onException:14] (JMSCCThreadPoolWorker-10) =====\n2020-02-12 08:41:27,314 ERROR [MQExceptionListener.onException:15] (JMSCCThreadPoolWorker-10) com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ1107: A problem with this connection has occurred.\nAn error has occurred with the IBM MQ JMS connection.\nUse the linked exception to determine the cause of this error.\n2020-02-12 08:41:27,314 ERROR [MQWriter2.write:49] (main) Error sending message to write queue\ncom.ibm.msg.client.jms.DetailedJMSException: JMSWMQ2007: Failed to send a message to destination 'DEV.QUEUE.1'.\nJMS attempted to perform an MQPUT or MQPUT1; however IBM MQ reported an error.\nUse the linked exception to determine the cause of this error.\n at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:595)\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:215)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer.checkJmqiCallSuccess(WMQMessageProducer.java:1288)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer.checkJmqiCallSuccess(WMQMessageProducer.java:1245)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer.access$800(WMQMessageProducer.java:76)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer$SpiIdentifiedProducerShadow.sendInternal(WMQMessageProducer.java:906)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer$ProducerShadow.send(WMQMessageProducer.java:566)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer.send(WMQMessageProducer.java:1428)\n at com.ibm.msg.client.jms.internal.JmsMessageProducerImpl.sendMessage(JmsMessageProducerImpl.java:855)\n at com.ibm.msg.client.jms.internal.JmsMessageProducerImpl.synchronousSendInternal(JmsMessageProducerImpl.java:2055)\n at com.ibm.msg.client.jms.internal.JmsMessageProducerImpl.sendInternal(JmsMessageProducerImpl.java:1993)\n at com.ibm.msg.client.jms.internal.JmsMessageProducerImpl.send(JmsMessageProducerImpl.java:1486)\n at com.ibm.mq.jms.MQMessageProducer.send(MQMessageProducer.java:293)\n at org.example.MQWriter2.write(MQWriter2.java:47)\n at org.example.Application.run(Application.java:20)\n at org.example.Application.main(Application.java:11)\nCaused by: com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2009' ('MQRC_CONNECTION_BROKEN').\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:203)\n ... 14 more\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2009\n at com.ibm.mq.jmqi.remote.api.RemoteHconn$ReconnectionState.recordFailure(RemoteHconn.java:4931)\n at com.ibm.mq.jmqi.remote.api.RemoteHconn.setReconnectionFailureInner(RemoteHconn.java:2650)\n at com.ibm.mq.jmqi.remote.api.RemoteParentHconn.setReconnectionFailure(RemoteParentHconn.java:152)\n at com.ibm.mq.jmqi.remote.impl.RemoteReconnectThread.bestHconn(RemoteReconnectThread.java:265)\n at com.ibm.mq.jmqi.remote.impl.RemoteReconnectThread.run(RemoteReconnectThread.java:115)\n at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.runTask(WorkQueueItem.java:319)\n at com.ibm.msg.client.commonservices.workqueue.SimpleWorkQueueItem.runItem(SimpleWorkQueueItem.java:99)\n at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.run(WorkQueueItem.java:343)\n at com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.runWorkQueueItem(WorkQueueManager.java:312)\n at com.ibm.msg.client.commonservices.j2se.workqueue.WorkQueueManagerImplementation$ThreadPoolWorker.run(WorkQueueManagerImplementation.java:1227)### Assistant: You can set an ExceptionListener on connection object after creating a connection. The onException method of the ExceptionListener gets invoked when reconnection attempts are made. Here is an example:ExceptionListener exceptionListener = new ExceptionListener(){\n @Override\n public void onException(JMSException e) {\n System.out.println(e);\n if(e.getLinkedException() != null)\n System.out.println(e.getLinkedException());\n }\n };\n MQQueueConnection connection = (MQQueueConnection) cf.createQueueConnection();\n connection.setExceptionListener(exceptionListener);\n"} +{"text": "### Human: My .NET code can connect and put a message to a remote queue successfuly. However, the same code does not work with local queue. It throws 2085 error. What different setting should be set in code to make that work with local queue?Here is my code:Hashtable queueProperties = new Hashtable();\nqueueProperties[MQC.HOST_NAME_PROPERTY] = \"10.x.x.x\";\nqueueProperties[MQC.PORT_PROPERTY] = 1451;\nqueueProperties[MQC.CHANNEL_PROPERTY] = \"TST1.TRADE.CHANNEL\";\n\ntry\n{\n // Attempt the connection\n queueManager = new MQQueueManager(\"MYQUEUEMANAGER\", queueProperties);\n strReturn = \"Connected Successfully\";\n}\ncatch (MQException mexc)\n{\n // TODO: Setup other exception handling\n throw new Exception(mexc.Message\n + \" ReasonCode: \" + mexc.ReasonCode\n + \"\\n\" + GetReason(mexc.ReasonCode), mexc);\n}Here, the code is internally using the IIS user id (application pool user) to connect with MQ because this code is run as part of WCF service.### Assistant: If you run themqrcutility you can find out what the error code translates to:$mqrc 2085\n\n 2085 0x00000825 MQRC_UNKNOWN_OBJECT_NAMEThis means the queue name you are attempting to open does not exist on the queue manager you are connected to.I noted that the source you posted does not include any code related to opening the queue. You should check that the queue name you are attempting to open does in fact exist on the queue manager you are connecting to.\n"} +{"text": "### Human: Can I use just WebSphere's jar files with standard JMS to send messages to a WebSphere MQ server, or do I need to download their WebSphere MQ Client?### Assistant: Youcanuse just the jar files for both JMS and the native Java MQ API but the question is whether you really want to. The full client install includes sample programs in source and object form, utilities, tracing and more. When you open a trouble ticket with IBM they may ask for information that you would use these tools to gather. If you do not have the full install you may not be able to provide the requested diagnostic information. For this reason, IBM supports the full client installation. If you are just trying to learn JMS and writing a toy application this is probably OK. If the application is going into Production and you may want to get support on it someday, install the client.The WMQ client install is free and available asSupportPac MQC7. It is a good is a to develop on the V7 client since it is compatible with the V6 QMgr. This saves you some testing when V6 goes out of service in September 2012.Note that the JMS Thin Client referred to in another responseis described in the Infocenter as\"a Java service integration bus JMS client designed to run as an embeddable client in Java SE applications under the IBM\u00ae, Sun and HP Java run-time environments (JREs). The client supports no transaction and local transaction models.\" As noted there it is an SI Bus client not an MQ client, has limited platform support and lacks even single-phase commit. The actual WMQ client is specific to WebSphere MQ, has broad platform support and provides single-phase commit transactionality.UPDATE:As of April 24th 2012, there is no longer a charge for the Extended Transactional Client for any version of WMQ on any platform. I've removed the portion of the answer that explained the previous license terms.\n"} +{"text": "### Human: What is RFHUTIL. What are the uses of it?### Assistant: From theSupportPac IH03page:It allows test messages to be captured\n and stored in files, and then used to\n drive WBI Message Broker Version 7\n applications. Output messages can also\n be read and displayed in a variety of\n formats. The formats include two types\n of XML as well as matched against a\n COBOL copybook. The data can be in\n EBCDIC or ASCII. An RFH2 header can be\n added to the message before the\n message is sent.WebSphere MQ messages can contain a Rules and Formatting Header or RFH for short. The RFHUtil (and it's client-based companion RFHUtilc) allow for a wide variety of message manipulation with and without these headers. Because the headers are used extensively by WebSphere Message Broker and for v6 Pub/Sub the utility provides a convenient way to perform ad-hoc testing of message flows, publications and subscriptions. It also allows the loading and unloading of queues to files or files to queues, for example to perform regression testing against a known workload.\n"} +{"text": "### Human: I have an error popping up after upgrading to IBM MQ 8.0 from 7.5 reason being -In MQ 8.0, a new function is introduced that requires MQ administrators using remote access to supply the userid and password. When the userid and password are not supplied or the password is incorrectError: 2035 Code : 2\nThe queue manager is configured to require a user ID and password, but none was supplied.The problem is described better in thislink.\nThere are three scenarios that are talked about. My solution would fall in Scenario A) MQ samples: Provide the user and password to the MQ client applicationI'm trying to read from the MQ using a program. Is there a way I can pass the username and password as part of the command line parameters rather than inputting it when prompted. Because this exe is invoked by my program.$ amqsputc qName qMgr### Assistant: IBM provides a client-side channel security exit calledmqccredto perform this task. The full documentation is at the link provided but in general it requires the following:Specify the exit in a CCDT file.Configure the exit by placing ID and password in an ini fileExecute therunmqccredcommand against the ini file to obfuscate the passwords.Make sure the ini file is set so that world- and group-read are disabled.Note that Java/JMS programs can easily be modified and the exit is intended mainly for programs using the native C API or that are compiled on top of that.\n"} +{"text": "### Human: I am \"very\" new to IBM Websphere Mq, I'll try to give as much details as possible.I've got Websphere MQ 7.1 installed on Windows server 2003 running on Vmware Workstation. The Host is running Windows 7 with Websphere MQ Client and my ASP.NET application. (My application is supposed to connect to Windows server 2003 Websphere's Queue manager via SVRCONN channel, the Websphere client installed on the host is used just for testing purpose, connecting WMQ Client to WMQ Server results in an AMQ4036 access not authorized error, which leads to conclusion server configuration needed!)Both System can ping each other and are on the same local network. (did I also mentioned that port 1415 is opened and TCP listener is running on the server virtual machine?)ASP.NET code segment :queueManager = new MQQueueManager(queueManagerName, queueProperties);with queueManagerName matching the server's queue manager and queueProperties as following:queueProperties[MQC.HOST_NAME_PROPERTY] = \"192.168.203.128\";\n\nqueueProperties[MQC.PORT_PROPERTY] = 1415;\n\nqueueProperties[MQC.CHANNEL_PROPERTY] = \"QM_TEST.SVRCONN\";\n\nqueueProperties[MQC.USER_ID_PROPERTY] = \"\";\n\nqueueProperties[MQC.PASSWORD_PROPERTY] = \"\";when compiling I get the MQRC_NOT_AUTHORIZED exception and this following logs in AMQERR01.log on server side (NOTE: The IBM WMQ is installed in french language, the logs are generated in french, but I think you'll manage to understand the error.)3/04/2013 21:32:25 - Process(1120.3) User(MUSR_MQADMIN) Program(amqzmur0.exe)\n Host(HATRIXX-82HDFHA) Installation(Installation1)\n VRMF(7.1.0.2) QMgr(QM_TEST)\n\nAMQ6287: WebSphere MQ VC:\\Program Files\\IBM\\WebSphere MQ (Installation1).\n\nEXPLICATION :\nInformations syst\u00e8me WebSphere MQ : \nProduit :- Windows Server 2003, Build 3790: SP1 (MQ Windows 32-bit) \nVersion :- C:\\Program Files\\IBM\\WebSphere MQ (Installation1) \nInformations h\u00f4te :- 7.1.0.2 (p710-002-121029)\nACTION :\nAucun(e). \n-------------------------------------------------------------------------------\n13/04/2013 21:32:25 - Process(2128.11) User(MUSR_MQADMIN) Program(amqzlaa0.exe)\n Host(HATRIXX-82HDFHA) Installation(Installation1)\n VRMF(7.1.0.2) QMgr(QM_TEST)\n\nAMQ8075: L'autorisation a \u00e9chou\u00e9 car il est impossible d'obtenir le SID de\nl'entit\u00e9 'hatrix'.\n\nEXPLICATION :\nLe gestionnaire des droits d'acc\u00e8s aux objets n'a pas pu obtenir le SID de\nl'entit\u00e9 sp\u00e9cifi\u00e9e. Cet incident peut \u00eatre d\u00fb \u00e0 l'absence de la machine locale\ndu domaine (l'entit\u00e9 ne peut donc pas \u00eatre localis\u00e9e) ou \u00e0 l'inexistence de\nl'entit\u00e9.\nACTION :\nV\u00e9rifiez que l'entit\u00e9 est valide et que tous les contr\u00f4leurs de domaine requis\nsont disponibles. Il peut \u00eatre n\u00e9cessaire de cr\u00e9er l'entit\u00e9 sur la machine\nlocale. \n----- amqzfubn.c : 2227 -------------------------------------------------------\n13/04/2013 21:32:25 - Process(2524.7) User(MUSR_MQADMIN) Program(amqrmppa.exe)\n Host(HATRIXX-82HDFHA) Installation(Installation1)\n VRMF(7.1.0.2) QMgr(QM_TEST)\n\nAMQ9245: Impossible d'extraire des d\u00e9tails de compte pour l'ID utilisateur de\ncanal MCA.\n\nEXPLICATION :\nWebSphere MQ n'a pas pu extraire des d\u00e9tails de compte pour l'ID utilisateur de\ncanal MCA Hatrix. Il s'agit de l'ID utilisateur MCA pour le canal\nQM_TEST.SVRCONN sur le gestionnaire de files d'attente QM_TEST. Il peut avoir\n\u00e9t\u00e9 d\u00e9fini dans la d\u00e9finition de canal ou fourni par un exit de canal ou un\nclient.\nACTION :\nV\u00e9rifiez que l'ID utilisateur est correct et qu'il est d\u00e9fini dans le syst\u00e8me\nlocal Windows, le domaine local ou un domaine de confiance. Dans le cas d'un ID\nutilisateur de domaine, assurez-vous que que tous les contr\u00f4leurs de domaines\nn\u00e9cessaires sont disponibles. \n----- cmqxrsrv.c : 1778 -------------------------------------------------------\n13/04/2013 21:32:25 - Process(2128.11) User(MUSR_MQADMIN) Program(amqzlaa0.exe)\n Host(HATRIXX-82HDFHA) Installation(Installation1)\n VRMF(7.1.0.2) QMgr(QM_TEST)\n\nAMQ8073: Echec de l'autorisation. Le SID ((None)) n'a pas pu \u00eatre corr\u00e9l\u00e9.\n\nEXPLICATION :\nLe gestionnaire de droits d'acc\u00e8s aux objets n'a pas pu faire correspondre le\nSID sp\u00e9cifi\u00e9 \u00e0 des informations connues d'entit\u00e9 et de domaine.\nACTION :\nAssurez-vous que l'application fournit un SID reconnu sur ce syst\u00e8me, que tous\nles contr\u00f4leurs de domaines n\u00e9cessaires sont disponibles et que les r\u00e8gles de\ns\u00e9curit\u00e9 sont correctement d\u00e9finies. \n----- amqzfubn.c : 4351 -------------------------------------------------------DISPLAY CHLAUTH(QM_TEST.SVRCONN) command returns:CHLAUTH(QM_TEST.SVRCONN) TYPE(USERMAP)\n DESCR( ) CUSTOM( )\n ADDRESS(*) CLNTUSER(HATRIX)\n MCAUSER( ) USERSRC(CHANNEL)\n WARN(NO) ALTDATE(2013-04-13)\n ALTTIME(13.53.03)\nAMQ8878: Affichage des d\u00e9tails relatifs \u00e0 l'enregistrement d'authentification de\n canal.\n CHLAUTH(QM_TEST.SVRCONN) TYPE(USERMAP)\n DESCR( ) CUSTOM( )\n ADDRESS(*) CLNTUSER(MQM)\n MCAUSER( ) USERSRC(CHANNEL)\n WARN(NO) ALTDATE(2013-04-13)\n ALTTIME(13.57.59)\nAMQ8878: Affichage des d\u00e9tails relatifs \u00e0 l'enregistrement d'authentification de\n canal.\n CHLAUTH(QM_TEST.SVRCONN) TYPE(ADDRESSMAP)\n DESCR( ) CUSTOM( )\n ADDRESS(*) MCAUSER(ADMINISTRATEUR)\n USERSRC(MAP) WARN(NO)\n ALTDATE(2013-04-13) ALTTIME(01.53.52)(note that i have added couple rules, and USERID Hatrix does not exist, i have included it in a SET CHLAUTH command for testing purpose)I thought it has to do with MCAuser so I gave it a try with the MCAuser set to \"Administrateur\" (which is the admin's name on WMQ) and connecting with:queueProperties[MQC.USER_ID_PROPERTY] = \"Administrateur\";Still gives me the same error but with different server side log output:13/04/2013 21:41:18 - Process(1120.3) User(MUSR_MQADMIN) Program(amqzmur0.exe)\n Host(HATRIXX-82HDFHA) Installation(Installation1)\n VRMF(7.1.0.2) QMgr(QM_TEST)\n\nAMQ6287: WebSphere MQ VC:\\Program Files\\IBM\\WebSphere MQ (Installation1).\n\nEXPLICATION :\nInformations syst\u00e8me WebSphere MQ : \nProduit :- Windows Server 2003, Build 3790: SP1 (MQ Windows 32-bit) \nVersion :- C:\\Program Files\\IBM\\WebSphere MQ (Installation1) \nInformations h\u00f4te :- 7.1.0.2 (p710-002-121029)\nACTION :\nAucun(e). \n-------------------------------------------------------------------------------\n13/04/2013 21:41:18 - Process(2524.8) User(MUSR_MQADMIN) Program(amqrmppa.exe)\n Host(HATRIXX-82HDFHA) Installation(Installation1)\n VRMF(7.1.0.2) QMgr(QM_TEST)\n\nAMQ9776: La canal a \u00e9t\u00e9 bloqu\u00e9 par l'ID utilisateur.\n\nEXPLICATION :\nLe canal entrant 'QM_TEST.SVRCONN' a \u00e9t\u00e9 bloqu\u00e9 \u00e0 partir de l'adresse\n'192.168.203.1' parce que les valeurs actives du canal \u00e9taient mapp\u00e9es sur un\nID utilisateur qui devrai t \u00eatre bloqu\u00e9. Les valeurs actives du canal \u00e9taient\n**'MCAUSER(Administrateur) CLNTUSER(Hatrix)'.**\nACTION :\nPrenez contact avec l'administrateur syst\u00e8me qui examinera les enregistrements\nd'authentification de canal pour s'assurer que les param\u00e8tres corrects ont \u00e9t\u00e9\nconfigur\u00e9s. Le commutateur ALTER QMGR CHLAUTH permet de contr\u00f4ler si les\nenregistrements d'authentification de canal sont utilis\u00e9s. La commande DISPLAY\nCHLAUTH peut \u00eatre utilis\u00e9e pour interroger les enregistrements\nd'authentification de canal. \n----- cmqxrmsa.c : 1004 -------------------------------------------------------\n13/04/2013 21:41:18 - Process(2524.8) User(MUSR_MQADMIN) Program(amqrmppa.exe)\n Host(HATRIXX-82HDFHA) Installation(Installation1)\n VRMF(7.1.0.2) QMgr(QM_TEST)\n\nAMQ9999: Le canal 'QM_TEST.SVRCONN' vers l'h\u00f4te 'FAIROUZ (192.168.203.1)' s'est\ntermin\u00e9 anormalement.\n\nEXPLICATION :\nLe programme du canl s'ex\u00e9cutant sous l'ID processus 2524(488) pour le canal\n'QM_TEST.SVRCONN' a pris fin anormalement. Le canal est 'FAIROUZ\n(192.168.203.1)'. Dans certains cas, son nom ne peut pas \u00eatre d\u00e9termin\u00e9 et il\nest repr\u00e9sent\u00e9 par '????'.\nACTION :\nExaminez les messages d'erreur pr\u00e9c\u00e9dents du programme de canal dans les\njournaux des erreurs afin de d\u00e9terminer la cause de l'incident. Notez que ce\nmessage peut \u00eatre totalement exclus ou supprim\u00e9 en r\u00e9glant les attributs\n\"ExcludeMessage\" ou \"SuppressMessage\" sous la strophe \"QMErrorLog\" dans le\nfichier qm.ini. D'autres informations figurent dans le guide d'administration\ndu syst\u00e8me. \n----- amqrmrsa.c : 925 --------------------------------------------------------What I couldn't understand is, what's the use of USERID and PASSWORD in the queuemanager properties in ASP.NET where the USERID identified in WMQ is \"Hatrix\" (which is the windows 7 account's name).Do I have to create a new USERID \"Hatrix\" in WMQ in order to make my code works? (i couldn't figured out how )Thanks in advance,MqDebug.### Assistant: First issue is that the QMgrmustbe able to resolve the ID passed to it. That means the ID either is defined locally or in a domain to which the QMgr has access. Normally, permissions are granted on the group and if so then it too must be resolved by the receiving QMgr.Now comes the question of what, exactly, does the QMgr resolve? When you have a connection from a Windows machine to a QMgr on a Windows machine then the ID that is passed by the channel is the Windows SID which is a Universally Unique Identifier (UUID)and not the text string. Similarly, the group resolves to a Windows SID.So, for example, you may have an ID called ADMINISTRATEUR defined locally on two Windows boxes and it still fails. The errors will say that the ID presented wasADMINISTRATEURand that the ID is not authorized and you can clearly see in thedspmqautcommands thatADMINISTRATEURisauthorized. Except what is happening is thatADMINISTRATEURon one host has its unique UUID and the account of the same name on the other host has a different UUID and Windows is looking at the UUID and not the text string.When you have the same ID defined in multiple places, the QMgr must be able to differentiate between them. When it cannot, strange and unusual things occur.For example, let's say you define a channel withMCAUSER('hatrix')and then runsetmqaut -p hatrix. Let's further stipulate that thehatrixID is not defined locally but rather is defined in bothDOMAINAandDOMAINBand that when the command is run, theDOMAINAdomain server is first in the search path.Thesetmqautcommand resolves the namehatrixto a UUID defined inDOMAINA.Later due to normal activity in the network,DOMAINBrises to the first spot in the domain search path. Now when theMCAUSER('hatrix')attempts to connect, the stringhatrixresolves inDOMAINBwhich is adifferentUUID than the one thesetmqautcommand resolved. The channel which was connecting normally suddenly throws a 2035 error.The answer to this problem is to qualify both thesetmqautcommand and theMCAUSERvalue with the desired domain. For example,setmqaut -p hatrix@DOMAINAand thenMCAUSER('hatrix@DOMAINA')will work regardless of whetherDOMAINAorDOMAINBare first in the search path, or even ifhatrixis defined locally on the WMQ host server. (Assuming thathatrixis indeed defined inDOMAINAof course.As a rule, you generally do not want to use the -p option onsetmqautcommands. The only exception is Windows hosts, and then only when the ID is qualified with a domain or server name as shown above.Finally, leaving the channel'sMCAUSERblank is what allows your Windows ID to flow to the MCA and be used for authorization checks. What you need to realize is that there is no authentication going on. Yes, it's true that the Windows client will send its Windows SID. However if you run a Linux VM on your Windows box and connect with that, there is no SID to pass and so the Windows QMgr falls back to resolving the string value of the ID. That means anyone can connect to that channel as any ID just by asserting the desired ID from a non-Windows client.So, strongly authenticate administrative connections with certificates. For low-privileged connections, use CHLAUTH rules or an exit to set theMCAUSERrather than letting it flow through, and then usesetmqautto make sure thatMCAUSERis not administrative. That means never grant+seton the QMgr and+crton queues to non-admins and avoid+setid, +setallwherever possible.For lots more WMQ Security content, please go tot-rob.net.\n"} +{"text": "### Human: When I connect WebSphere MQ using C# without installing MQ server and client, I get the exceptionThe type initializer for 'IBM.WMQ.MQQueueManager' threw an exception. I add the reference of two MQ dlls,amqmdnet.dllandamqmdxcs.dllfrom MQ server, but it doesn't work. How can I connect to MQ without installing MQ server or client? Thank you!### Assistant: I don't recommend using MQ client libraries without installing them. Installation ensures that all the required binaries are installed and registered with GAC. Adding reference to amqmdxcs is not required. Just a reference to amqmdnet is enough.So it's better to install MQ client and run your application.\n"} +{"text": "### Human: I have an MDB in WebSphere 6. The MessageListener is linked to a Tibco EMS queue. In the MDB I'm trying to write to a WebSphere MQ queue. I get the following error:WMSG0042I: MDB Listener LoanIQ Payments Inbound started successfully for JMSDestination jms/eid/payments\nWTRN0063E: An illegal attempt to commit a one phase capable resource with existing two phase capable resources has occurred.\nWTRN0086I: XAException encountered during prepare phase for transaction 00000131...0001. Local resources follow.\nWTRN0089I: XATransactionWrapper@ 3fbe3fbe XAResource: com.ibm.ejs.jms.JMSManagedSession$JMSXAResource@3fb83fb8 enlisted: true mcWrapper.hashCode()1038237154: Vote: commit.\nWTRN0089I: LocalTransactionWrapper@:4e2e4e2e LocalTransaction:com.ibm.ejs.jms.JMSManagedSession$JMS LocalTransaction@4e5a4e5a enlisted:true registeredForSynctruemcWrapper.hashcode()1032076676: Vote: none.The QueueConnectionFactory instance is acom.ibm.ejs.jms.JMSQueueConnectionFactoryHandle. Could I get an XAConnection from this? Do I need to? I'd prefer to stay with vanilla JMS if possible.The MDB implementation is akin to:public void onMessage(Message message) {\n // ^^ incoming message delivered from EMS queue via WAS MessageListener\n TextMessage textMessage = (TextMessage) message;\n QueueConnectionFactory factory = (QueueConnectionFactory) context.lookup(factoryName);\n Queue queue = (Queue) context.lookup(queueName);\n QueueConnection connection = factory.createQueueConnection();\n connection.start();\n QueueSession session = connection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);\n QueueSender sender = session.createSender(queue);\n TextMessage message = session.createTextMessage(\"some new payload\");\n sender.send(message);\n // ^^ outgoing message sent to WebSphere MQ queue\n}### Assistant: Looking at the error, you have one XA resource and one JCA LocalTransactionWTRN0089I: XATransactionWrapper@ 3fbe3fbe XAResource: com.ibm.ejs.jms.JMSManagedSession$JMSXAResource@3fb83fb8 enlisted: true mcWrapper.hashCode()1038237154: Vote: commit.andWTRN0089I: LocalTransactionWrapper@:4e2e4e2e LocalTransaction:com.ibm.ejs.jms.JMSManagedSession$JMS LocalTransaction@4e5a4e5a enlisted:true registeredForSynctruemcWrapper.hashcode()1032076676: Vote: none.Sounds like you either haven't set the ConnectionFactory to XA enabled, see:http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/umj_pjcfm.html(scroll down to \"XA Enabled\") or the Tibco EMS connection isn't XA capable. If it's the latter, and there is no suitable XA driver, then you could look at Last-Participant support in the WAS infocentre, that might do what you need - i.e. WAS would prepare the WMQ XA transaction, locally commit the Tibco, then commit WMQ if the Tibco commit worked (or rollback otherwise). If the Tibco connection is XA capable, then WAS has full XA support for WMQ built in, so there's no reason not to use a two-phase transaction for the whole operation.RegardingThe QueueConnectionFactory instance is a com.ibm.ejs.jms.JMSQueueConnectionFactoryHandle. Could I get an XAConnection from this? Do I need to? I'd prefer to stay with vanilla JMS if possible.You shouldn't do this, just keep to plain JMS. As a general point of style it's better to cast to a ConnectionFactory (not QueueConnectionFactory) too, and then remain with cross-domain objects (Connection, Session, MessageProducer).\n"} +{"text": "### Human: I read thisarticleAnd still didn't understand the notion of how topics works in MQ.\nIn JMS I know that you can publish a message on a Topic, and in order to receive a message from it you first need to subscribe to it (using the subscription name at the receive phase).How it is work in MQ? I want to write a simple scenario of (as in JMS):1. Publish to a topic2. Receive from a Topic - that will fail (i'm not subscribed yet)3. Subscribe4. Receive - nothing to receive since I subscribed after the publish5. Publish6. Receive - successfulA sample code (.NET) would be helpfulGuy### Assistant: Have you looked at the included sample code? In a default installation it resides at:C:\\Program Files\\IBM\\WebSphere MQ\\tools\\dotnet\\samplesTheMQPubSubSample.csprogram illustrates both durable and non-durable subscriptions for managed and unmanaged code. In each case it first subscribes, then publishes but you can easily modify it to your use case of publish/subscribe/receive/publish/receive as described in the question. (You won't be able to receive from a topic to which you have not yet subscribed, though.)Here's one of the sections from the sample code:// Managed/nondurable\n string topicName = DEFAULT_TOPIC_STRING;\n string topicObject = null;\n int openOptionsForGet = MQC.MQSO_CREATE | MQC.MQSO_FAIL_IF_QUIESCING | MQC.MQSO_MANAGED | MQC.MQSO_NON_DURABLE;\n int destType = MQC.MQOT_TOPIC;\n\n try\n { \n destForGet = mqQMgr.AccessTopic(topicName, topicObject, MQC.MQTOPIC_OPEN_AS_SUBSCRIPTION, openOptionsForGet);\n\n messageForPut = new MQMessage();\n messageForPut.WriteString(DEFAULT_MESSAGE_DATA);\n\n mqQMgr.Put(destType, topicObject, null, topicName, messageForPut);\n\n messageForGet = new MQMessage();\n\n destForGet.Get(messageForGet);\n\n string messageDataFromGet = messageForGet.ReadLine();\n\n if(!DEFAULT_MESSAGE_DATA.Equals(messageDataFromGet))\n Console.WriteLine(\"Incorrect Message Received.\");\n\n destForGet.Close();\n }\n catch(MQException mqE)\n {\n Console.WriteLine(\"MQException caught. \" + mqE.ToString());\n }Your question references JMS as an example. Please be aware that you have the option of using IBM XMS - Extensible Message Service Client for .Net. XMS implements the JMS API over .Net with WMQ, WMB or WAS as the transport so you can use JMS code with very little modification. TheMessage Service Client for .Net 2.0.0manualdescribes the offering:Message Service Client for .NETMessage Service Client for .NET provides an application programming Interface (API) called XMS that has the same set of interfaces as the Java Message Service (JMS) API. Message Service Client for .NET contains a fully managed implementation of XMS, which can be used by any .NET compliant language.\nXMS supports:point-to-point style messagingpublish/subscribe style messagingSynchronous message deliveryAsynchronous message deliveryAn XMS application can exchange messages with the following types of application:An XMS applicationA WebSphere MQ JMS applicationA native WebSphere MQ applicationA JMS application that is using the WebSphere default messaging providerAn XMS application can connect to, and use the resources of, any of the following messaging servers:A WebSphere MQ queue manager - The application can connect in either bindings or client mode.A WebSphere service integration bus - The application can use a direct TCP/IP connection, or it can use HTTP over TCP/IP.A broker of WebSphere Event Broker or WebSphere Message Broker - Messages are transported between the application and the broker using WebSphere MQ Real-Time Transport and, depending on the configuration, messages can be delivered to the application using WebSphere MQ Multicast Transport.By connecting to a WebSphere MQ queue manager, an XMS application can use WebSphere MQ Enterprise Transport to communicate with a broker of WebSphere Event Broker or WebSphere Message Broker. Alternatively, an XMS application can use a WebSphere MQ Publish/Subscribe broker.If you wish to explore further, the sample XMS code resides in subdirectories below the native .Net samples referred to earlier. The samples are described in theUsing the XMS Sample Applicationssection of the manual.The .Net support is integrated into WMQ as of v7. If you are lacking the samples then your WMQ client installation is back-level or incompletely installed. The latest v7.0 WMQ Client for Windows is downloadable asSupportPac MQC7.The XMS support is delivered asSupportPac IA9H.\n"} +{"text": "### Human: I wrote an application that connected to local queue manager using this function call:MQQueueManager mqQMgr = new MQQueueManager(\"QM_QueueManagerName\");Now I need to connect to remote queue manager on another computer.I can successfully connect to remote queue manager using MQ Explorer from my development PC usingQM_ComputerNameas queue manager name,S_ComputerNameas channel and ComputerName as connection name. So it is accessible from my desktop.However, when I try to connect via .Net I getMQRC_Q_MGR_NAME_ERRORno matter what I try.I tried specifyingMQEnvironment.Hostname = \"ComputerName\";\nMQEnvironment.Channel = \"S_ComputerName \";\n\nand then calling\n\nmqQMgr = new MQQueueManager(\"QM_ComputerName\");\n\nI also tried calling \n\nmqQMgr = new MQQueueManager(\"QM_ComputerName\", \"S_ComputerName\", \"ComputerName\");I get error in both cases.Anyone can advise?### Assistant: This is how I got it to work:MQQueueManager mqQMgr=null;\n\n Hashtable props = new Hashtable();\n\nprops.Add(MQC.HOST_NAME_PROPERTY, \"HostNameOrIP\");\n\n props.Add(MQC.CHANNEL_PROPERTY, \"ChannelName\");\n\n props.Add(MQC.PORT_PROPERTY, 1414); // port number\n\n props.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\n\n MQQueue mqQueue = null;\n\n try\n\n {\n\n mqQMgr = new MQQueueManager(\"QueueManagerName\", props);\n\n mqQueue = mqQMgr.AccessQueue(\n QueueName,\n MQC.MQOO_OUTPUT // open queue for output\n + MQC.MQOO_FAIL_IF_QUIESCING); // but not if MQM stopping\n }\n\n catch (MQException mqe1)\n\n {\n\n }\n"} +{"text": "### Human: Ok, I want to check if I can run some OS or MQSC commands in MQ server remotely. As long as I know, this could be done withSYSTEM.ADMIN.SVRCONN. In order to do that, I add a remote Queue Manager to my WebSphere MQ client. I put Queue Manager name on the server with proper IP, but when I useSYSTEM.ADMIN.SVRCONNas channel name, I have got:Channel name not recognized (AMQ4871)error.Also, if I have a channel name like MY.CHANNEL.NAME and it is a server-connection channel withmqmas itsMCAUSER, can I run some commands (MQSC or OS) through this channel on the server?Thanks.Edit1I am using WebSphere MQ v.7.0By \"I add a remote Queue Manager to my WebSphere MQ client\" I meant I added a remote queue manager to MQ Explorer.Edit2I want to explain my question more precisely in this edit. I want to connect to a remote Qmanager via MQ Explorer. I know Qmanager name and its IP ofcourse. Also, the remote Qmanager has bothSYSTEM.ADMIN.SVRCONNandSYSTEM.AUTO.SVRCONNchannel available. When I checkCHLAUTHfor these channels, I've got:AMQ8878: Display channel authentication record details.\n CHLAUTH(SYSTEM.ADMIN.SVRCONN) TYPE(ADDRESSMAP)\n ADDRESS(*) USERSRC(CHANNEL)\nAMQ8878: Display channel authentication record details.\n CHLAUTH(SYSTEM.*) TYPE(ADDRESSMAP)\n ADDRESS(*) USERSRC(NOACCESS)\ndis chl(SYSTEM.ADMIN.SVRCONN) MCAUSER\n 5 : dis chl(SYSTEM.ADMIN.SVRCONN) MCAUSER\nAMQ8147: WebSphere MQ object SYSTEM.ADMIN.SVRCONN not found.\ndis chl(SYSTEM.AUTO.SVRCONN) MCAUSER\n 6 : dis chl(SYSTEM.AUTO.SVRCONN) MCAUSER\nAMQ8414: Display Channel details.\n CHANNEL(SYSTEM.AUTO.SVRCONN) CHLTYPE(SVRCONN)\n MCAUSER( )As you can see here, I should be able to connect via these two channels and run some commands. But when I chooseSYSTEM.ADMIN.SVRCONNas channel name in remote configuration I get :Channel name not recognized (AMQ4871)and when I chooseSYSTEM.AUTO.SVRCONNas channel name, I get:You are not authorized to perform this operation (AMQ4036).Any idea?### Assistant: when I use SYSTEM.ADMIN.SVRCONN as channel name, I have got: Channel\n name not recognized (AMQ4871) error.Did you define the channel on the remote queue manager?if I have a channel name like MY.CHANNEL.NAME and it is a\n server-connection channel with mqm as its MCAUSER, can I run some\n commands (MQSC or OS) through this channel on the server?Sure. And so can anyone else. You should read up on MQ security and not expose your queue manager to hackers.\n"} +{"text": "### Human: I'm currently developing an application which needs to connect a MQ Queue in order to have the queue saving message information inside another service. Once it's done, the service returns a result message through the MQ Queue and it is returned to me.I'm sending a string message that contains a XML message similar to the following one:\n\nDEMANDA CONTRATACI\u00d3N\nIt appears that MQ is not decoding properly the \"\u00d3\" character and \"subtipo\" field is being saved as \"DEMANDA CONTRATACI\u251c\u00f4N\".I'm encoding the message in \"UTF-8\" and I've been told that the CCSID I'm using to send the message is 850 instead of 1208 (the one belonging to UTF-8).To run the MQ manager, I'm using\"pymqi\" Python library in Client Mode. This is the MQManager class I use to send messages to the queue and get the response:class MQManager:\n def __init__(self):\n self.queue_manager = config.queue_manager\n self.channel = config.channel\n self.port = config.port\n self.host = config.host\n self.conn_info = config.conn_info\n self.queue_request_name = config.queue_request_name\n self.queue_response_name = config.queue_response_name\n\n cd = pymqi.CD()\n cd.ChannelName = self.channel\n cd.ConnectionName = self.conn_info\n cd.ChannelType = pymqi.CMQC.MQCHT_CLNTCONN\n cd.TransportType = pymqi.CMQC.MQXPT_TCP\n\n self.qmgr = pymqi.QueueManager(None)\n self.qmgr.connect_with_options(self.queue_manager, opts=pymqi.CMQC.MQCNO_HANDLE_SHARE_NO_BLOCK, cd=cd)\n\n def send_message(self, str_xml_message):\n # set message descriptor\n request_md = pymqi.MD()\n request_md.ReplyToQ = self.queue_response_name\n request_md.Format = pymqi.CMQC.MQFMT_STRING\n\n queue_request = pymqi.Queue(self.qmgr, self.queue_request_name)\n queue_request.put(str_xml_message.encode(\"UTF-8\"), request_md)\n queue_request.close()\n\n # Set up message descriptor for get.\n response_md = pymqi.MD()\n response_md['CorrelId'] = request_md['MsgId']\n\n gmo = pymqi.GMO()\n gmo.Options = pymqi.CMQC.MQGMO_WAIT | pymqi.CMQC.MQGMO_FAIL_IF_QUIESCING\n gmo.WaitInterval = 5000 # 5 seconds\n\n queue_response = pymqi.Queue(self.qmgr, self.queue_response_name)\n message = queue_response.get_no_rfh2(None, response_md, gmo)\n queue_response.close()\n\n return str(message)\n\n\n def close(self):\n self.qmgr.disconnect()I wonder how can I define the MQ Manager's CCSID value and hopefully solve the codepage mismatch.Thank you!### Assistant: In your code you create a default message descriptor for the message you send in this line of code:request_md = pymqi.MD()By default pymqi (like the underlying IBM MQ C libraries) will set the message descriptorCodedCharSetIdto the valueCMQC.MQCCSI_Q_MGR.This can be seen in thesource:['CodedCharSetId', CMQC.MQCCSI_Q_MGR, MQLONG_TYPE],The IBM MQ v9.0 KC pageReference > Developing applications reference > MQI applications reference > Data types used in the MQI > MQMD - Message descriptor > Fields for MQMD > CodedCharSetId (MQLONG)describes how the client handles this:For client applications, MQCCSI_Q_MGR is filled in, based on the locale of the client rather than the one on the queue manager.The IBM MQ Troubleshooting documentWhat CCSID is used by default for WebSphere MQ client messagesexplains this in a slightly different way:A MQ client sets the MQCCSI_Q_MGR value based on the environment in which the client application is running.Based on the850CCSID I would guess you are running on a Windows OS that is not in the United States (which commonly uses CCSID 437).You have a few options to override this:You can programmatically override the pymqi MQMD default value like this:request_md.CodedCharSetId = 1208Set the env variableMQCCSIDto the value you want (in your case 1208). This must be set before you connect to mq. This is documented in the IBM MQ v9.0 KC pageDeveloping applications > Developing MQI applications with IBM MQ > Writing client procedural applications > Using the MQI in a client application > Choosing client or server CCSID.The example below is for Windows:SET MQCCSID=1208In themqclient.iniyou can set theCCSID=numberunder theCHANNELSstanza. This is documented in the IBM MQ v9.0 KC pageConfiguring > Configuring connections between the server and client > Configuring a client using a configuration file > CHANNELS stanza of the client configuration file. For example:CHANNELS:\n CCSID=1208\n"} +{"text": "### Human: When I go to my WebSphere MQ explorer, and connect to a remote queue manager and go to--> Advanced --> Listeners, I do not see any listeners defined. But I am able to create a remote JMS client, connect to this queue manager by using a channel connection and publish a message to a topic.So what is the purpose of listeners? In my case, things are working fine without listeners.### Assistant: WebSphere MQ listeners are what accepts remote connections and start inbound channels. Modern queue managers will almost always have listeners defined but it is also possible to specify a default port for the QMgr to listen on without actually defining a listener. This is unusual, though. For older versions of MQ it was common to useinetdto start channels. This method doesn't use a listener.So rest assured thatsomethingon your QMgr is listening for connections. Since you are not seeing it there are three likely possibilities:The listener name starts withSYSTEM.and your Explorer view is set to filter SYSTEM objects.The default port has been specified in theqm.inifileYou have a really old QMgr usinginetdBy the way, go get a new version of WMQ Explorer. Since you have anAdvanced --> Listenersyou must have an old version. Download fromSupportPac MS0T.\n"} +{"text": "### Human: I am new to mqseries and I started with IBM WebSphere MQ curses. There are examples withMQ_APPLEandMQ_ORANGEqueue managers. I have no problem with sending messages to local or remote queue with MQ Explorer, but I wanted to send such message from code: Python or Java. I tried Python pymqi library with code like this:import pymqi\n\nqmgr = pymqi.QueueManager(None)\nqmgr.connect('QM_APPLE')\n\nputq = pymqi.Queue(qmgr, 'Q1')\nputq.put('Hello from Python!')but I receive error:Traceback (most recent call last):\n File \"mq_put.py\", line 4, in \n qmgr.connect('QM_APPLE')\n File \"c:\\Python26\\lib\\site-packages\\pymqi.py\", line 758, in connect\n raise MQMIError(rv[1], rv[2])\npymqi.MQMIError: MQI Error. Comp: 2, Reason 2540: FAILED: MQRC_UNKNOWN_CHANNEL_NAMEThere isQM_APPLEqueue manager withQ1local queue.What is wrong with my code?### Assistant: Based on the error it appears that you are attempting to connect to a remote queue manager, but you are using the local queue manager bindings method to connect. I say this because the error is stating that the mqi client doesn't know which channel to connect to. Can you please clarify if you are using a local queue manager or a remote queue manager? I have pasted the code below to connect to a remote queue manager using a channel.import pymqi\n\nqueue_manager = \"QUEUE_MANAGER_NAME\"\nchannel = \"SVRCONN.1\"\nhost = \"host.domain.com\"\nport = \"1434\"\nconn_info = \"%s(%s)\" % (host, port)\n\nqmgr = pymqi.QueueManager(None)\nqmgr.connectTCPClient(queue_manager, pymqi.cd(), channel, conn_info)\n"} +{"text": "### Human: I can use the Java MQ Api to put and get messages.\nI can also disable gets and put on a queue.During a migration project, we'll have an App running in parallell. Old and New. Old and New will have their own separate queues. I regulary have messages from a client going to Old. Occasionally want the msgs to flow to New instead.wondering if MQ supports a gate/switch concept. where via API I can point a queue to go only to New, or only to Old, for a short time.Trying to avoid going to message based routing via WMB since I dont have to do that today. THe parallel mode is only for a few months.### Assistant: You do not mention the version of MQ or whether there are message affinities or dependence on preserving theMQMD.MsgID. These are critical in devising a solution to this problem. I'll try to describe enough options so that at least one will be viable whatever version you are at.Pub/SubThe easiest thing to do is to have the messages arrive on an alias over a topic. Any message that arrives is published immediately on that topic. Then it is a simple matter to generate administrative subscriptions to direct messages to the queues on which the apps needing the messages are listening. This is entirely a configuration change and requires no external components, processes or code. It is available from v7.1 of MQ and higher, which is to say any of the currently supported versions of MQ.The down side is that IBM MQ will change theMQMD.MsgIDfrom the time the message is received on the topic to the time it is published on the application's input queue. This breaks the app's ability to use theMQMD.MsgIDof the incoming message as a correlation ID when replying. If the requesting app pre-loads the correlation ID or doesn't rely on a correlation ID, this is not an issue.AliasingBut for apps where this is an issue, it gets a bit harder. You can alias over a queue and have inbound messages land on the alias. When you need to switch from one queue to another, you change the alias. There are a couple issues with this. The first is that it is never possible to deliver the message stream to more than one of the applications. In a parallel processing test it is often desirable to do exactly that and then compare summary or detail reports.The second problem is more operational in nature. It isn't possible to change the alias while it is open. If the messages arrive over aRCVR,RQSTRor `CLUSRCVR channel, no problem. Stop the channe, switch the alias and restart the channel. In a series of MQSC script commands this can be done faster than it can be typed. However, if the applications putting the messages are connected in bindings mode or via client directly to the alias, they must all be stopped in order to change the alias.That said, aliasing works on all versions of MQ out of the box.Physical copyOne solution that's been around for quite some time is to use theQprogram (SupportPac MA01) to direct the messages. In this scenario, the queue on which messages land is a local queue. TheQprogram is either triggered or set to constantly listen on the queue. When a message arrives,Qthen copies it to one or both of the destination queues.Switching the behavior ifQis triggered involves pre-defining 2 or 3 processes where each defines a different behavior - move new messages toQUEUEA, toQUEUEBor to both. Changing the queue'sPROCESSattribute to point to a different process results in an instantaneous change of the behavior.Alternatively, if Q is configured to listen on the queue forever then changing the behavior involves use of three different scripts to execute it where one causes messages to be copied toQUEUEA, another toQUEUEBand another to both queues. Changing the behavior involves killing the script and starting a different one.TheQprogram works with all versions of MQ, regardless of whether it is triggered or scripted.Downsides to this approach include the obvious - more moving parts. You have to trigger the queue or else make a transactional program act like a daemon. Not hard but if you are betting the business on it then perhaps some monitoring is in order to make sure the input queue doesn't start building.RecommendationOf all these methods, Ireallylike the Pub/Sub version. It is extremely reliable, has the least moving parts, and if anything breaks it's under IBM support. When you need to change something, you can do that with minimal impact to the running applications. If at all possible, use that.\n"} +{"text": "### Human: I am trying to connect to a MQ connection factory defined in Websphere app Server 7.0.But I couldnt find a right connectionfactory interface for the MQ to define in Spring.However when I tried to hardcode the connection details in the spring config file, I am able to connect to the Queue Manager.What is the right interface/format to use in Spring beans to load the MQ connection factory defined in Websphere appl server?Working Code\n \n 127.0.0.1\n \n \n 1414\n \n \n MYQM\n \n \n 1\n \nNot Working Code\n \n \n \n \nwhere WASQM is the MQ connection factory defined in WebsphereError with the Non working codeorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mqConnectionFactory' defined in ServletContext resource [/WEB-INF/config/config-mq.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: [com.ibm.mq.jms.MQQueueConnectionFactoryFactory] is not an interface\nat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)\nat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)\nat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)\nat org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)\nat org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)\nat org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)\nat org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)\nCaused by: java.lang.IllegalArgumentException: [com.ibm.mq.jms.MQQueueConnectionFactoryFactory] is not an interfaceI need help in replacing the not working code with a right code.\nSpring - 3.0.5\nIBM MQ and Web App Servers - 7.0### Assistant: Right way to do isCreate the resource in Queue Connection Factory in Websphere App Server (not in Connection Factory)Use javax.jms.QueueConnectionFactory as the connection factory in spring config\n \n \n \n \nThispagegave me the hint.\n"} +{"text": "### Human: I am trying to connect to IBM Websphere MQ Server from IBM Websphere Application Server.I am getting the following error:MQJMS2013: invalid security authentication supplied for MQQueueManagerWhat I understand is, this is because of invalid security credentials by WAS while connecting to MQ Manager.I have tried different combination of providing the MQ admin password e.g.Provide J2C authentication to MQ Connection Factory.Provide MQ admin username and password to Queues.Providing Blank username.Combination of all three above.Also, as mentioned in some of the posts, I have tried theTransport Typeas'Binding'as well as'Client'forQueueConnectionFactory.Please suggest.### Assistant: One problem is that the MQJMS2013 may have nothing to do with the QMgr. It could be config file permission problems, LDAP credentials doing JNDI lookups, problems with a keystore, etc.One way to determine whether this really is a WMQ authorization exception is to enable authorization events on the QMgr and recreate the error. If it is a WMQ auth problem, the event message will land in SYSTEM.ADMIN.QMGR.EVENT queue. It will contain the ID of the user, the object the call failed on, the API call that failed and all of the options used on the call. If you useSupportPac MO71then it will format the event message for you. If you use WMQ Explorer then you can installSupportPac MS0Pto format the event messages.If you do not get an event message then the connection is not reaching WMQ! In that case, nothing you do with accounts, groups, setmqaut and other WMQ-specific configuration will help and I'd suggestenabling tracing.In bindings mode, the ID presentedmustmatch the ID the JVM runs as. In client mode another way to diagnose is to set the channel's MCAUSER to a known good value. The channel's MCAUSER overrides any ID passed in by the app server and should always be set to a low-privileged account. For diagnostics, set it TEMPORARILY to 'mqm' and if the connection works that isolates the problem to being WMQ auth issues.\n"} +{"text": "### Human: I'm trying to send a message to a java server over a Websphere MQ which uses JMS as the transport protocol. I can happily drop messages on the MQ using the IBM supplied libraries, but the server rejects them. I'm assuming (hopefully correctly) that this is because I'm missing various JMS specific headers/properties on the MQ message.I have ensured the payloads for the messages are the same by inspecting the queue (they are both map messages if that helps), but don't want to fully implement theJMS Websphere MQ protocoljust to get this to work.I'm wondering if anyone has managed to get this to work, and if so what's the minimum amount of information you need to specify in the JMS header? Are there any alternatives to doing this directly on the MQ (I've seen some about using java interop, but this is something I think would be overkill).Any help would be greatly appreciated!### Assistant: Can you paste the Java code you are using to read the message. Is that code assuming that the message is a \"MapMessage\". Normally something put into a Queue from a non-java client will appear as either a TextMessage or a BytesMessage.The WebsphereMQ JMS api is normally fine with reading those messages without the JMS headers as long as you read as a TextMessage / BytesMessage as put.In my server code, my content is normally put to the queue as bytes, and so appears as a BytesMessage, but just in case i get a message that was manually put on the queue, i catch the classcastexception, and test to see if it is in fact a TextMessage.\n"} +{"text": "### Human: In IBM MQ, I have a requirement where I can get many types of xml from the queue. The xml messages will be conformed to already specified xsd (there are say, 5 xsd - which means I can get 5 different xml). When I get the message from queue, I would like to know the type of xml (if its xsd1 or xsd2 or so on)The reason why I would want to know is, I am using a JaxB interface with SAX implementation, for which I need to give the java object corresponding to the xml as parameter. So I have to know which xsd the input and is and assign the parameter correspondingly.The options I have is to set a property in the header to the message, but the party who is dropping the message into MQ is not ready.What other options do I have? Can I get the file name (of xml) from the mq and find the xsd based on the name of the file? Or do I have to do I sax parsing and identify the root tag and derive the xsd type? Any other better option anybody has in mind?### Assistant: Think of MQ like the Post Office. When you get a letter, the post office doesn't mess with anything on the inside (the payload) and if it changes the outside, it only changes routing information. If you want to sort incoming mail to different recipients, whoever is sending it has to put the data against which the sort criteria operate on the outside of the envelope. If that doesn't work, you must open the envelope and look for the recipient name, department, or whatever on the papers inside.Your MQ messageisthat envelope. The sort criteria can be different queue names, a property of the message, a property of the message header, or something in the payload. But unless the sender explicitly sets the destination queue name based on the selection criteria, or sets the message or header property, your only option is to inspect the payload and figure it out.If you have to inspect the payload, this is a perfect scenario for IBM Integration Broker. But you can also write an application to perform this function. Very often this is performed by a Dispatch app which gets the message, figures out where it goes, then puts it onto another queue andCOMMITs theGETandPUToperations. But if the dispatch app must parse the XML to determine the correct queue, the message has to be parsed twice - once by the dispatcher, once by the receiving app.\n"} +{"text": "### Human: I have a scenario where about 10 different messages will need to be enqueued and then dequeued / processed. One subscriber will need all 10 messages, but another will only need 8 of the 10 messages. I am trying to understand what the best way is to setup this type of architecture. Do you create a queue for each message type so the subscriber(s) can just subscribe to the relevant queues or do you dump them all to the same queue and ignore the messages that are not relevant to that subscriber? I want to ensure the solution is flexible / scalable, etc.Process:10 different xml messages will be enqueued to an IBM WebSphere MQ server.We will use .Net (Most likely WCF since WebSphere MQ 7.1 has added in WCF support)We will dequeue the messages and load them into another backend DB (Most likely SQL Server).Solution needs to scale well because we will be processing a very large number of messages and this could grow (Probably 40-50,000 / hr). At least large amount for us.As always greatly appreciate the info.--S### Assistant: Creating queues is relatively 'cheap' from a resource perspective, plus yes, it's better to use a queue for each specific purpose, so it's probably better in this case to separate them by target client if possible. Using a queue to pull messages selectively based on some criteria (correlation ID or some other thing) is usually a bad idea. The best performing scenario in messaging is the most straightforward one: simply pull messages from the queue as they arrive, rather than peeking and receiving selectively.As to scaling, I can't speak for Websphere MQ or other IBM products, but 40-50K messages per hour isn't particularly hard for MSMQ on Windows Server to handle, so I'd assume IBM can do that as well. Usually the bottleneck isn't the queuing platform itself but rather the process of dequeuing and processing individual messages.\n"} +{"text": "### Human: I have configured two servers by side, one Active MQ and one WebSphere MQ 8.0, in order to communicate each other I've configured an Apache Camel in the middle, which receives messages from Active MQ and send them to WebSphere. Right now Camel is able to receive messages from Active MQ server, but when it tries to send them to the WebSphere MQ it throws the error:Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2540;AMQ9204: Connection to host '10.0.0.122(1414)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2540;AMQ9520: Channel not defined remotely. [3=channel.test]],3=10.0.0.122(1414),5=RemoteConnection.analyseErrorSegment]I am able to connect Camel to the WebSphere QueueManager with a user, but not the the channel that is created, the configuration for the camel side in order to connect to the WebSphere server is:\n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n\n \n \n And the way that I've created the Server-Connection channel is by going to the WebSphere MQ Explorer, select queue manager, create new Server-Connection channel, set the appropiate username in the MCA User Field.As a suggestion of @shashi in his answer below I've run the command DIS CHANNEL() with the following output:1 : DIS CHANNEL('channel.test')\nAMQ8414: Display Channel details.\n CHANNEL(channel.test) CHLTYPE(SVRCONN)\n ALTDATE(2015-07-22) ALTTIME(00.16.25)\n COMPHDR(NONE) COMPMSG(NONE)\n DESCR( ) DISCINT(0)\n HBINT(300) KAINT(AUTO)\n MAXINST(999999999) MAXINSTC(999999999)\n MAXMSGL(4194304) MCAUSER(mqm)\n MONCHL(QMGR) RCVDATA( )\n RCVEXIT( ) SCYDATA( )\n SCYEXIT( ) SENDDATA( )\n SENDEXIT( ) SHARECNV(10)\n SSLCAUTH(REQUIRED) SSLCIPH( )\n SSLPEER( ) TRPTYPE(TCP)Any help will be really helpfullThanks in advance### Assistant: MQRC 2540 means the queue manager did not recognize the channel name provided by the client.In MQ the object names are case sensitive. Ensure the channel name you have provided in Camel configuration matches the one you created in MQ Explorer.\n"} +{"text": "### Human: MQQueue.Get()operation freezes for 5 minutes when getting a message from QueueManager using SSL on .NetCore 3.1. The same code works fine when running on .Net Framework (v4.8) or without SSL on both runtimes.Details:Client:MQ Managed Client from NuGet (IBMMQDotnetClient/v9.1.4)Server:docker from tagibmcom/mq:9.1.4.0-r1with basic SSL config usingSSLCIPH(ANY_TLS12) SSLCAUTH(OPTIONAL)Reproduced on:.Net Core 3.1.2 on Windows and .Net Core 3.1.1 on LinuxMQ Logs:MqGet-framework48.zip,MqGet-core31.zipMy Findings:The attachedMqGet-core31tells:The client sends the get message request at09:15:52.199588It receives response with message body almost immediately at09:15:52.311050Then it calls anotherMQRcvThread.ReceiveOneTSH()to finish the get operation. It callsMQTCPConnection.Receive()and it freeze for 5 minutes to09:20:52.412669Possible reason:MQTCPConnectionkeeps originalsocketandMQEncryptedSocketinstance wrapping the samesocketviaSslStreamThe methodMQTCPConnection.Receive()polls on thesocketand then it callsMQEncryptedSocket.Read()It looks like that data from thesocketare read bySslStreaminMQEncryptedSocketbefore thepoll()method is called andpoll()waits for its 5 minutes timeout. Or any other race condition around?If I put a breakpoint before problematicpoll()call and delay it for a moment, then it often passess without any delay!Test Code:This code finishes in ~2 seconds on .Net Framework, but it needs 5 minutes and ~2 seconds when it is run on .Net Core. (Win or Linux)// import server's CA\nMQConnectionPool.ImportServerCertificateAuthorityIfNotPresent(CertMqTestCa);\n\nHashtable properties = new Hashtable {\n {MQC.HOST_NAME_PROPERTY, Mq1QmSslAnyTls12.Host},\n {MQC.PORT_PROPERTY, Mq1QmSslAnyTls12.Port},\n {MQC.CHANNEL_PROPERTY, Mq1QmSslAnyTls12.ChannelName},\n {MQC.USER_ID_PROPERTY, \"admin\"},\n {MQC.PASSWORD_PROPERTY, \"changeit\"},\n {MQC.CCSID_PROPERTY, 819},\n {MQC.SSL_CIPHER_SPEC_PROPERTY, \"TLS_RSA_WITH_AES_256_CBC_SHA256\"},\n {MQC.SSL_CERT_STORE_PROPERTY, \"*USER\"}\n};\nMQQueueManager queueManager;\nusing (new MQCcsidSetter(properties)) {\n queueManager = new MQQueueManager(null, properties);\n}\n\nstring requestText = Guid.NewGuid().ToString();\nstring queueName = \"SV.MqConnectionPoolTest\";\n// put message - works fine\nusing (MQQueue queue = queueManager.AccessQueue(queueName, MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING)) {\n byte[] requestBytes = Encoding.UTF8.GetBytes(requestText);\n MQMessage requestMessage = new MQMessage {Expiry = 3000, Priority = 4, CharacterSet = 1208, MessageType = MQC.MQMT_DATAGRAM};\n requestMessage.Write(requestBytes, 0, requestBytes.GetLength(0));\n queue.Put(requestMessage, new MQPutMessageOptions());\n}\n\n// get message back from the same queue\nusing (MQQueue queue = queueManager.AccessQueue(queueName, MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING)) {\n while (true) {\n MQMessage msg = new MQMessage();\n queue.Get(msg, new MQGetMessageOptions()); // <<= !!!IT IS DELAYED HERE!!!\n msg.Seek(0);\n string msgContent = msg.ReadString(msg.MessageLength);\n if (requestText.Equals(msgContent)) {\n break;\n }\n }\n}Thread Dumps:MQ Client Receiver ThreadSocketPal.Poll()\nSocket.Poll()\nMQTCPConnection.Receive() \nMQRcvThread.ReceiveBuffer()\nMQRcvThread.ReceiveOneTSH()\nMQRcvThread.Run()\nThreadHelper.ThreadStart_Context()\nExecutionContext.RunInternal()\nThreadHelper.ThreadStart()Waits onPoll(), but it ends with 5 minute (heartbeat) timeout. Then it goes tothis.network.Read()and immediately gets proper data.this.socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, this.timeout);\n if (this.socket.Poll(this.timeout * 1000, SelectMode.SelectRead))\n {\n length2 = this.network.Read(cBuffer, offset1, length1);Application ThreadMonitor.Wait()\nMQSession.ExchangeTSH() \nMQProxyQueue.RequestMessages()\nMQProxyQueue.FlushQueue()\nMQProxyQueue.ProxyMQGET()\nMQFAP.zstMQGET()\nMQFAP.MQGET()\nMQDestination.Get()\nMQDestination.Get()\nMqConnectionPoolTest.TestMqDirect()Waits forentry.Replyto be filled by receive thread:while (entry.Reply == null) {\n Monitor.Wait((object) entry, this.rmtReqEntMaxPollTime, true);\n ...Please, does anybody know a workaround or has a fix?### Assistant: You should notGetand wait infinitely, you should do it like this:const int TIMEOUTTIME = 20000;\ntry\n{\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.Options = MQC.MQGMO_WAIT;\n gmo.WaitInterval = TIMEOUTTIME;\n queue.Get(msg, gmo);\n msg.Seek(0);\n string msgContent = msg.ReadString(msg.MessageLength);\n if (requestText.Equals(msgContent)) {\n break;\n }\n}\ncatch (MQException ex)\n{\n if (ex.CompletionCode == MQC.MQCC_FAILED && ex.ReasonCode == MQC.MQRC_NO_MSG_AVAILABLE)\n {\n // Log on DEBUG level something like this:\n // No message from after seconds, continue receiving\");\n continue;\n }\n throw ex;\n}To make your programmer's life easier, I would recommend to use theXMS API.\n"} +{"text": "### Human: I am trying to create a connection to an mq manager that has ssl auth enabled. I am using Java 1.8I have thiscodeTrustStrategy trustStrategy = new TrustSelfSignedStrategy();\nKeyStore trustStore = KeyStore.getInstance(\"JKS\");\ntry (FileInputStream fileInputStream = new FileInputStream(propertyReader.getProperty(QUEUE_KEYSTORE))) {\ntrustStore.load(fileInputStream, propertyReader.getProperty(QUEUE_KEYSTOREPASS).toCharArray());\n}\nKeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());\nkmf.init(trustStore, \"changeit\".toCharArray());\nfinal TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());\ntmf.init(trustStore);\n\nfinal SSLContext sslContext = SSLContext.getInstance(\"TLSv1.2\");\nsslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), new SecureRandom());\n\nconnectionFactory.setTransportType(WMQConstants.WMQ_CM_CLIENT);\nconnectionFactory.setHostName(propertyReader.getProperty(QUEUE_HOST));\nconnectionFactory.setQueueManager(propertyReader.getProperty(QUEUE_MANAGER));\nconnectionFactory.setChannel(propertyReader.getProperty(QUEUE_CHANNEL));\nconnectionFactory.setSSLCipherSuite(propertyReader.getProperty(QUEUE_CIPHERSUITE));\nconnectionFactory.setPort(Integer.parseInt(propertyReader.getProperty(QUEUE_PORT)));\nconnectionFactory.setSSLSocketFactory(sslContext.getSocketFactory());When I try to create the connection I get thisexception:com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2397\njavax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)I can see the following in thelogs:Allow unsafe renegotiation: false\nAllow legacy hello messages: true\nIs initial handshake: true\nIs secure renegotiation: false\nIgnoring unsupported cipher suite: TLS_RSA_WITH_AES_256_CBC_SHA256 for TLSv1\nNo available cipher suite for TLSv1\nhandling exception: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)\nSEND TLSv1.2 ALERT: fatal, description = handshake_failure\nWRITE: TLSv1.2 Alert, length = 2\n[Raw write]: length = 7\n0000: 15 03 03 00 02 02 28 ......(\ncalled closeSocket()Is this saying that it is still trying to use TLSv1 instead of TLCv1.2?\nI have jce unlimited strength enabled in my security file.Update with details:IBM MQ Jar Version: 6.0.2.5java version \"1.8.0_201\"Java(TM) SE Runtime Environment (build 1.8.0_201-b26)### Assistant: You have stated you are using IBM MQ jar files from v6.0.2.5, this went out of support from IBM in September 30th 2012. See end of this question for additional details on the only CipherSuites that were supported in that old version.You can use Maven to get the current IBM MQ v9.1.0.4 LTS support client at the following link:MVN REPOSITORY \u00bb com.ibm.mq com.ibm.mq.allclientI checked old documentation saved as PDF and MQ v6 only supported SSL and TLS1.0 ciphers, the list is below:SSL_RSA_WITH_NULL_MD5\nSSL_RSA_WITH_NULL_SHA\nSSL_RSA_EXPORT_WITH_RC4_40_MD5\nSSL_RSA_WITH_RC4_128_MD5\nSSL_RSA_WITH_RC4_128_SHA\nSSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5\nSSL_RSA_WITH_DES_CBC_SHA\nSSL_RSA_EXPORT1024_WITH_RC4_56_SHA\nSSL_RSA_EXPORT1024_WITH_DES_CBC_SHA\nSSL_RSA_WITH_3DES_EDE_CBC_SHA\nSSL_RSA_WITH_AES_128_CBC_SHA\nSSL_RSA_WITH_AES_256_CBC_SHA\nSSL_RSA_WITH_DES_CBC_SHA\nSSL_RSA_WITH_3DES_EDE_CBC_SHA\nSSL_RSA_FIPS_WITH_DES_CBC_SHA\nSSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA\n"} +{"text": "### Human: I would like to test some MQ-related functionality and I wanted to use MQ Explorer (v 7.5.0.2) to put a message to MQ queue. However, the input field accepts only one line messagesIs it possible to put multi-line messages using MQ Explorer? Using sequences like\\nor does not work.### Assistant: It is sad, but currently IBM MQ Explorer does not allow to send multiline message.My workaround to this is to use JMSToolBox:https://github.com/jmstoolbox/jmstoolboxGeneral description how to set it up with IBM MQ is here:https://github.com/jmstoolbox/jmstoolbox/wiki/2.1-Setup-for-IBM-MQIn my case two extra jars were needed:\ncom.ibm.mq.allclient-9.2.4.0.jar\njson-20210307.jar\n"} +{"text": "### Human: i kind of don't understand when to use the MQ client connection channel. From my understanding, when client trying to connect MQ server, it can be completed by defining the channel object withserver connection channelvalue directly in application code. Therefore, if so, then why do we need to make use of such client connection channel?Please help explain to me in detail. Thanks very much### Assistant: A Server Connection Channel is used by clients to connect to a queue manager.You don't really use a client connection channel to connect to queue manager. A client connection channel defines the connection parameters required to connect to a queue manager for example queue manager name, connection name, SSL etc. These channel definitions are stored in channel definition table (CCDT) files. CCDT files are used by client applications through MQCHLLIB and MQCHLTAB environment variables.Thislinkandanotherhas little more details.\n"} +{"text": "### Human: I'm using the mq library of IBM to read messages from MQ queues. Now I need to retrieve the messageid of the message. I now it is in the message header under the name messageId. But this returns a byte[]. Now I need to change it to a readable string.How can I transform the messageId from byte[] to string?I tried a couple of conversions but non of them works:new String(theMessage.messageId)\nnew String(theMessage.messageId, \"UTF-8\")\nnew String(theMessage.messageId, \"UTF-16\")\ntheMessage.messageId.toString()### Assistant: The messageId in the MQMD is represented as 24 bytes. If you know what platform these were generated on you may be able to find some meaning to portions of them by converting the bytes to characters in the character set of the queue manager where they were produced but is not recommended to rely on any data being conveyed in the messageID as character data since I have seen statements from IBM similar to \"MsgId is generated by MQ in an IBM proprietary format and it may change at any time.\"If you want represent them as a string you should represent them as a 48 character HEX string representing the 24 bytes.Below is a sample functiongetHexStringIBM has provided in a Technote that will perform this conversion for you. You would use it like this:getHexString(theMessage.messageId)The sample function below is from IBM MQ Technote \"How to match correlation id's when request is made via JMS application and reply generated from base Java API\"public static String getHexString(byte[] b) throws Exception {\n String result = \"\";\n for (int i=0; i < b.length; i++) {\n result += Integer.toString( ( b[i] & 0xff ) + 0x100, 16).substring( 1 );\n }\n return result;\n}IBM Documents the format and uniqueness of the Queue Manager generated message IDs at the bottom of the Knowledge Center page \"Reference>Developing applications reference>MQI applications reference>Data types used in the MQI>MQMD - Message descriptor>Fields>MsgId (MQBYTE24)\"A MsgId generated by the queue manager consists of a 4-byte product identifier (AMQ\u00ac or CSQ\u00ac in either ASCII or EBCDIC, where \u00ac represents a blank character), followed by a product-specific implementation of a unique string. In IBM\u00ae MQ this contains the first 12 characters of the queue-manager name, and a value derived from the system clock. All queue managers that can intercommunicate must therefore have names that differ in the first 12 characters, in order to ensure that message identifiers are unique. The ability to generate a unique string also depends on the system clock not being changed backward. To eliminate the possibility of a message identifier generated by the queue manager duplicating one generated by the application, the application must avoid generating identifiers with initial characters in the range A through I in ASCII or EBCDIC (X'41' through X'49' and X'C1' through X'C9'). However, the application is not prevented from generating identifiers with initial characters in these ranges.\n"} +{"text": "### Human: I am sending messages to a remote queue, to which I have no control.I send a xml file as message but when the application reads the message it gets a message header likejms_text \\0\\0\\0lqueue:///TEST12814758437071i don't want this message header to be present and my code for sending this message is as follows:Properties props = new Properties();\n props.setProperty(\"java.naming.factory.initial\",this.initialFactory);\n props.setProperty(\"java.naming.provider.url\", url);\n\n Context context = new InitialContext(props);\n\n QueueConnectionFactory qcf = (QueueConnectionFactory) context.lookup(this.context);\n qConn = qcf.createQueueConnection();\n queue = (Queue)context.lookup(name);\n qSession = qConn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);\n qConn.start();\n QueueSender send = qSession.createSender(queue);\n String text = \"My xml file\";\n TextMessage tm = qSession.createTextMessage(text);\n send.send(tm);\n send.close();How do I avoid this ?### Assistant: It appears that you are sending a jms message to a non jms destination. How is the message being consumed on the destination? Is it expecting a native MQ message? The receiver is not understanding the MQRFH2 header that stores the JMS header properties.You should either configure the destination to understand jms or your can do something like the following to tell the mq jms that your receiver is a non-jms client.((com.ibm.mq.jms.MQQueue) queue).setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ);\n"} +{"text": "### Human: I just created a VM vagrant with centos, installed python2.7 and pip using Miniconda, installed pymqi using pip, created a test python file to see if my pymqi installation is correct :import pymqi\nprint \"hello...\"but I got this :[vagrant@localhost projects]$ python test.py\nTraceback (most recent call last):\nFile \"test.py\", line 1, in \nimport pymqi\nFile \"/home/vagrant/miniconda2/lib/python2.7/site-packages/pymqi/__init__.py\", line 109, in \nimport pymqe, CMQC, CMQCFC, CMQXC\nImportError: libmqic_r.so: cannot open shared object file: No such file or directoryI looked for that file :[vagrant@localhost projects]$ find /opt/mqm/ -name 'libmqic_r.so'\n/opt/mqm/lib/compat/libmqic_r.so\n/opt/mqm/lib/libmqic_r.so\n/opt/mqm/lib64/compat/libmqic_r.so\n/opt/mqm/lib64/libmqic_r.soThank you, your help is appreciated.### Assistant: I found the solution :export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/mqm/lib64\n"} +{"text": "### Human: I'm pretty new to websphere MQ, so please pardon me if I am not using the right terms. We are doing a project in which we need to setup a MQ cluster for high availability.The client application maintains a pool of connection with the Queue Manager for subscribers and publishers. Suppose we have two Queue Managers in a cluster hosting the queues with the same names. Each of the queue has its own set of subscribers and publishers which are cached by the client application. Suppose one of the queue manager goes down, the subscribers and publishers of the queues on that queue manager will die making the objects on client application defunct.In this case can the following scenarios taken care of?1] When first QueueManager crashes, the messages on its queues are transferred to other queuemanager in the cluster2] When QueueManager comes up again, is there any mechanism to restore the publishers and subscribers. Currently we have written an automated recovery thread in the client application which tries to reconnect the failed publishers and subscriber. But in case of cluster setup, we fear that the publishers and subscribers will reconnect to the other running qmanager. And when the crashed queuemanager is restored, there will be no publishers and subscribers to it.Can anybody please explain how to take care of above two scenarios?### Assistant: WMQ Clustering is an advanced topic. You must first do a good amount of read up of WMQ and understand what clustering in WMQ world means before attempting anything.WMQ Cluster differs in many ways from the traditional clusters. Unlike the traditional clusters, say in a Active/Passive cluster, data will be shared between active and passive instances of an application. At any point in time, the active instance of application will be processing data. When the active instance goes down, the passive instance takes over and starts processing. This is not the case in WMQ clusters where queue managers in a cluster are unique and hence queues/topics hosted by those queue managers are not shared. You might have the same queues/topics in both queue managers but since queue managers are different, messages, topics, subscriptions etc won't be shared.Answering to your questions.1) No. Messages,if persistent, will remain in the crashed queue manager. They will not be transferred to other queue manager. Since the queue manager itself is not available nothing can be done till the queue manager is brought up.2)No. Queue manager can't do that. It's the duty of the application to check for queue manager availability and reconnect. WMQ provides automatic client reconnection feature where in the WMQ client libraries automatically reconnect to queue manager when they detect connection broken errors. This feature is available from WMQ v7.x and above with C and Java clients. C# client supports the feature from v7.1.For your high availability requirement, you could look at using Multi instance queue manager feature of WMQ. This feature enables an Active/Passive instances of the same queue manager running on two different machines. Active instance of the queue manager will be handling client connections while the passive instance will be in sleep mode. Both instances will be sharing data and logs. Once the active instance goes down, the passive instance becomes active. You will have access to all the persistent messages that were in the queues before the active queue manager went down.Read through the WMQ InfoCenter for more on Multi instance queue manager.\n"} +{"text": "### Human: My aim is to put n number of messages in a for loop to a WebSphere MQ queue using WebSphere MQ java programming.My java program will run as a standalone program.If any exception in between , I need to rollback all the messages.If no exception then I should commit all the messages .The outside world should not see my messages in the queue until I complete fully. \nHow do I achieve this?Updated with sample code as per reply from T.Rob:Please check if sample code is fine ?Does setting MQGMO_SYNCPOINT is only related to my program's invocation ?\n(because similar programs running parallely will also be putting messages on the same queue and those messages should not gett affected by my program's SYNCPOINT.)public void sendMsg() {\n MQQueue queue = null;\n MQQueueManager queueManager = null;\n MQMessage mqMessage = null;\n MQPutMessageOptions pmo = null;\n System.out.println(\"Entering..\");\n try {\n MQEnvironment.hostname = \"x.x.x.x\";\n MQEnvironment.channel = \"xxx.SVRCONN\";\n MQEnvironment.port = 9999;\n\n\n queueManager = new MQQueueManager(\"XXXQMANAGER\");\n int openOptions = MQConstants.MQOO_OUTPUT; \n queue = queueManager.accessQueue(\"XXX_QUEUENAME\", openOptions, null, null, null);\n\n pmo = new MQPutMessageOptions(); \n pmo.options = CMQC.MQGMO_SYNCPOINT;\n\n\n String input = \"testing\";\n System.out.println(\"sending messages....\");\n for (int i = 0; i < 10; i++) {\n input = input + \": \" + i;\n mqMessage = new MQMessage();\n mqMessage.writeString(input);\n System.out.println(\"Putting message: \" + i);\n queue.put(mqMessage, pmo);\n\n }\n queueManager.commit();\n System.out.println(\"Exiting..\");\n\n } catch (Exception e) {\n e.printStackTrace();\n try {\n System.out.println(\"rolling back messages\");\n if (queueManager != null)\n queueManager.backout();\n } catch (MQException e1) {\n e1.printStackTrace();\n }\n } finally {\n try {\n if (queue != null)\n queue.close();\n if (queueManager != null)\n queueManager.close();\n } catch (MQException e) {\n e.printStackTrace();\n }\n }\n }### Assistant: WMQ supports both local and global (XA) units of work. The local units of work are available simply by specifying the option. Global XA transactions require a transaction manager, as mentioned by keithkreissl in another answer.For what you described, a POJO doing messaging under syncpoint, specifyMQC.MQGMO_SYNCPOINTin yourMQGetMessageOptions. When you are ready to commit, issue theMQQManager.commit()orMQQManager.backout()call.Note that the response and doc provided by ggrandes refers to the JMS and not Java classes. The Java classes use Java equivalents of the WMQ procedural API, can support many threads (doc) and even provide connection pooling (doc). Please refer to the Java documentation rather than the JMS documentation for the correct behavior. Also, I've linked to the WMQ V7.5 documentation which goes with the latestWMQ Java V7.5 client. The later clients have a lot more local functionality (tracing, flexible install path, MQClient.ini, etc.) and work with back-level QMgrs. It is highly recommended to be using the latest client and the download is free.\n"} +{"text": "### Human: Since we are experiencing some trouble with IBM's Websphere MQ using XMS.net (Windows service that sometimes seems to give up listening for messages on a queue) we would like to create a simple application to monitor the depths of some queues (or number of messages on the queue) to be able to alert someone when the queue depth exceeds a certain threshold. This application would be launched by the task scheduler on a specific interval and would \"read out\" for X queues their queue depth (and maybe some other statistics).Our windows service is using the following code and I was hoping I could reuse that same \"knowledge\" for our \"monitoring\" application.AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);\n\n //Read config values\n string QueueManager = ConfigurationManager.AppSettings[\"queuemanager\"];\n string Channel = ConfigurationManager.AppSettings[\"channel\"];\n string Queue = ConfigurationManager.AppSettings[\"queue\"];\n string HostIP = ConfigurationManager.AppSettings[\"host\"];\n int Port = int.Parse(ConfigurationManager.AppSettings[\"port\"]);\n\n //Create connection\n var factoryfactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\n var connectionfactory = factoryfactory.CreateConnectionFactory();\n\n connectionfactory.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, QueueManager);\n connectionfactory.SetStringProperty(XMSC.WMQ_HOST_NAME, HostIP);\n connectionfactory.SetIntProperty(XMSC.WMQ_PORT, Port);\n connectionfactory.SetStringProperty(XMSC.WMQ_CHANNEL, Channel);\n connectionfactory.SetIntProperty(XMSC.WMQ_BROKER_VERSION, XMSC.WMQ_BROKER_V2);\n connectionfactory.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT_UNMANAGED);\n\n Console.WriteLine(\"Creating connection\");\n var connection = connectionfactory.CreateConnection();\n connection.ExceptionListener = new ExceptionListener(OnXMSExceptionReceived);\n\n //Create a_session\n Console.WriteLine(\"Creating sessions\");\n var session = connection.CreateSession(false, AcknowledgeMode.ClientAcknowledge);\n\n //Create queue\n Console.WriteLine(\"Creating queue\");\n var queue = session.CreateQueue(string.Format(\"queue://{0}/{1}\", QueueManager, Queue));I have browsed through the properties ofsession,queueetc. but, ofcourse, there are no \"current queue depth\" properties. I could useGetIntProperty()orGetLongProperty()on these objects but I don't know which constant to use for that (I have seen IBM.XMS.MQC.MQIA_CURRENT_Q_DEPTH but that contains anintandGet...Property()expects astringas parameter).Long story short: how would I go about retrieving a queues depth with the above code as a starting-point? Is it at all possible using XMS.Net?### Assistant: I was able to solve it using,as Shashi suggested, the MQ API. For this you need to reference amqmdnet.dll (C:\\Program Files (x86)\\IBM\\WebSphere MQ\\bin\\amqmdnet.dll) and use the following (example) code. Please note that this is a simple example, no exception handling etc. is included.using System;\nusing System.Collections;\nusing System.Configuration;\nusing IBM.WMQ;\n\nnamespace Test\n{\n class Program\n {\n static void Main(string[] args)\n {\n //Connection properties\n var properties = new Hashtable();\n properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);\n properties.Add(MQC.CHANNEL_PROPERTY, \"SOME.CHANNEL.TCP\");\n properties.Add(MQC.HOST_NAME_PROPERTY, \"12.34.56.78\");\n properties.Add(MQC.PORT_PROPERTY, 1416);\n\n var qmgr = new MQQueueManager(\"MYQMGR\", properties);\n\n Console.WriteLine(\"Local : {0}\", GetQueueDepth(qmgr, \"FOO.LOCALQ\"));\n Console.WriteLine(\"Report : {0}\", GetQueueDepth(qmgr, \"FOO.REPORTQ\"));\n }\n\n public static int GetQueueDepth(MQQueueManager queuemgr, string queue)\n {\n return queuemgr.AccessQueue(queue,\n MQC.MQOO_INPUT_AS_Q_DEF + \n MQC.MQOO_FAIL_IF_QUIESCING + \n MQC.MQOO_INQUIRE).CurrentDepth;\n }\n }\n}This performs way better thanmy initial \"workaround\".\n"} +{"text": "### Human: We have one MQ Queue which receives messages from an external system out of our control.\nOur system processing the incoming messages is a critical one and needs to be up and running 27x7 no matter what.The order in which the incoming messages are processed is also not negotiable which means we need to process them in exactly the order they arrived.To make sure our system is 100% available we deployed our system to a bunch of physical machines able to process those messages.Once the messages reached our system we put in place a mechanism to make sure the messages processing does not go out of order while also getting some performance gain as a result of the parallel processing. For us the performance gain is a good to have, however it is rather a side effect as our main goal is the high availability while assuring the right processing order.My thoughts were to have on every single machine an MDB able to process the incoming messages but only have one active consumer at a time.We are using Webshere MQ as a JMS provider and Webshere Application Server 8.5 to deploy our application.The problem with multiple consumers listening to the same queue does not seem to be a workable solution as when messages arrive in bulk they would be round-robin passed to all consumers and there is no way to control how this is going to happen and the messages easily go out of sequence.When I manually stopped all the listeners but one obviously the messages got processed in order. But manually shutting down and starting up such listeners is definitely not a HA solution.We could put in place monitoring processes to check for health of the system and shut things down or start them up as required but this still looks too weak to me.\nWhat we want in fact is to have all listeners up and running but only one receiving the messages. If that one goes down for whatever reasons then another one sitting there will become active and start processing messages.Initially we considered using a topic rather than a queue but this comes with other issues like below:we cannot control the source of our messagesthe high volume of messages we have would put us in in trouble with our going down subscribers that have to be durable and such when coming up back will have to deal with lots of pending messagesthe input queues are already part of a cluster and changing all the infrastructure would require a lot of workAnyway in my view it has to be an existing pattern to accommodate situations like this. Any help, suggestion would be greatly appreciated.The solution does not have to be a specific MQ one, any idea is welcome.Thanks in advance### Assistant: Create a second queue, we'll call it the \"control queue.\" Into this queue, put a single message, we'll call it the \"token.\" Change application processing as follows:Listen on the control queue for a message.Get the token from the control queue under syncpoint.Put the same token message back on the control queue, also under syncpoint.Process a transaction from the normal input queue, also under syncpoint.COMMITthe messages.Loop.TheCOMMITcompletes the transaction on the input queue and makes the token available to the other MDBs. No processing of the input queue can occur except by the MDB that has the token under syncpoint. However you can have any number of MDBs waiting on the token. A failure of any one of them allows the others to take over instantly.No need to use XA, by the way. WMQ's single-phase COMMIT works great with this.\n"} +{"text": "### Human: Consider the following queue defintinons:SET AUTHREC OBJTYPE(QMGR) GROUP('mq-user') AUTHADD(INQ,DSP,CONNECT)SET AUTHREC PROFILE(SYSTEM.MQEXPLORER.REPLY.MODEL) OBJTYPE(QUEUE) GROUP('mq-user') AUTHADD(INQ,DSP,GET)SET AUTHREC PROFILE(SYSTEM.ADMIN.COMMAND.QUEUE) OBJTYPE(QUEUE) GROUP('mq-user') AUTHADD(INQ,DSP,PUT)DEFINE CHANNEL ($cname) CHLTYPE (SVRCONN) TRPTYPE (TCP) MCAUSER('tcs-mq-user') REPLACESET CHLAUTH($cname) TYPE(ADDRESSMAP) ADDRESS(*) MCAUSER('tcs-mq-user')What is the meaning of MCAUSER in both DEFINE CHANNEL and SETCHLAUTH?Should tcs-mq-user belong to mq-user group?Does this mean only tcs-mq-user has access to the queue manager in bindings mode? Now what if I want to give access to another user in the binding mode, should I create another pair of DEFINE CHANNEL and SET CHLAUTH commands for this user?Is it possible to give the channel access to the mcs-user group?### Assistant: OK, answers are on sale, buy one get three free today! :-) Let's take these in order...1.A.The channel's MCAUSER value is the ID against which authorization checks are performed. If theDEFINE CHL() CHLTYPE(SVRCONN)leaves MCAUSER blank, then clients connecting can specify the ID that they wish to connect as. If they fail to specify, WMQ clientattemptsto use the ID of the client user as seen from the workstation where the client app is running and present that. SettingMCAUSERin the channel definition prevents the client app from specifying the value.1.B.The MCAUSER in anADDRESSMAPrule is used to map theMCAUSERbased on some identifying criteria. It says \"IFa connection arrives onthis channelwith a specified IP address | User Name | SSL Distinguished NameTHENusethisID as theMCAUSERANDallow the channel to run if no other rules block it.The recommendation if aCHLAUTHmapping rule is used is usually to set the channel'sMCAUSERto a value that cannot possibly be a user ID so it will not run. This way the channel defaults to a secure state unless aCHLAUTHrule overrides the MCAUSER to a value intended to allow access. The quintessential value forMCAUSERused to benobodyuntil Mark Taylor, WMQ Strategist from the Hursley Lab, suggested using a value that can not be an actual user ID, such asno#body. As of WMQ V7.1 the value*NOACCESSis a reserved work and what I'm using in the conference presentations these days.2.Yes. WMQ authorizes based on groups. The standard advice is to deconstruct your security requirements into roles like 'admin', 'app1', 'app2', 'monitoring', 'anonymous', etc. Then for each of these roles that requires access, create a group.But access requests come from principals that are uniquely identified, not from groups. The authorization check requires an account to check against so the MCAUSER in the channel is an ID while the authorization rights are stored by group. To associate a user with the correct rights, enroll them in the right group.This is standard UNIX authorization model that supports separation of duties. Resource admins (the WMQ administrator) authorize groups. Account admins enroll user IDs in groups. It takes both groups to provide access. In the real world, most shops do not utilize the separation of duties feature but in a significant cases it is mandatory.3.Sort of. A default QMgr at V7.1 or higher won't allow any remote connections at all. This is because when created it has noAUTHRECrules so non-admins are not granted access. Admins are blocked from remote access by the defaultCHLAUTHrule.With the rules specified,anyonecan successfully connect to the$cnamechannel and will be authorized astcs-mq-user. If you want them to connect as a different user IDwith the same privilegesthen you would need to add that ID to themq-usergroup and then set the channel up to map the IDs presented. If you wanted toenforcewhich ID someone connected as you'd have to specify the mapping by IP address or, better yet, based on their certificate distinguished name.4.No. As noted in #2 above, access requests are always made by principals, not by groups. The whole point ofCHLAUTHrules,MCAUSERand distinguished name mapping is to resolve the user ID that the channel uses for authorization checks. The channel definition'sMCAUSERis a security control in that ID resolution process and so it operates on the ID and not on the group.If you haven't already found the site, you might findT-Rob.netuseful. In particular, on the Links page I have posted all the WMQ Security presentations from the conferences as well as links to my and other authors' articles.\n"} +{"text": "### Human: I have a MDB which listens to WebSphere MQ. It does not picks up the messages in the order that has been received by the Queue. How can i make it read it in that order? Is it possible? Should i not use a MDB.### Assistant: In general, WMQ delivers messages in the order that they were received. However, several things can impact that...If the queue is set to priority instead of FIFO delivery and messages arrive in different priorities, they will be delivered \"out of order\".Distinguish between order produced and order delivered. If the messages are produced on a remote QMgr and there are multiple paths to the local QMgr, messages may arrive out of order.Difference in persistence - if messages are produced on a remote QMgr and are of different persistences, the non-persistent messages may arrive faster than the persistent ones, especially with channel NPMSPEED(FAST) set.Multiple readers/writers - Any dependency on sequence implies a single producer sending to a single consumer over a single path. Any redundancy in producers, consumers or paths between them can result in messages delivered out of sequence.Syncpoint - To preserve sequence, ALL messages must be written and consumed under syncpoint or else ALL must be written and consumed outside of syncpoint.Selectors - These specifically are intended to deliver messages out of order with respect to the context of all messages in the queue.Message groups - Retrieval of grouped messages typically waits until the entire group is present. If groups are interleaved, messages are delivered out of sequence.DLQ - if the target queue fills, messages may be delivered to the DLQ. As the target queue is drained, messages start going back there. With a queue near capacity, messages can alternate between the target queue and DLQ.So when an MDB is receiving messages out of order any of these things, or even several of them in combination, may be at cause. Either eliminate the dependency on message sequence (best choice) or else go back over the design and reconcile all the factors that may lead to out-of-sequence processing.\n"} +{"text": "### Human: We are currently using IBM MQ via JMS, but seem to be pushing through more messages than it can handle - strangely, the problem seems to be intermittent.The messages are prices and thus dont need to be guaranteed, just need to be sent quickly.As IBM have aLow Latency product, I am wondering if that is perhaps the better solution - but it does not seem to have a JMS api, or at least not easily visible.Anyone know if there is a JMS api into the Low Latency product, or if the \"unique\" API it does have is JMS-like...Alternatively, pointers for MQ tuning would also be appreciated... :)### Assistant: Definitely a low latency messaging product would be better suited to your problem, I am working on a project where we do something very similar using a low latency messaging product called LBM from29West. It doesn't have a JMS api and I suspect most of the products in the low-latency space won't. There a large number of features that don't make sense in combination with these types of products (e.g. persistence, selectors, etc.). We found that writing our own simple api over the top of the messaging product to be fairly easy and gives use the flexibility to change products later and frees us from some of the bulk and verbosity of the JMS api.Another option to consider would beJGroups.29West have added JMS support to their messaging product line.\n"} +{"text": "### Human: IBM WebSphere Liberty Profileprovides the\"wmqJmsClient-2.0\"feature to interact withIBM MQIs there an equivalent for Open Liberty?[UPDATED]If not (as it seems), how to connect Open Liberty to IBM MQ?Should I develop an Open Liberty \"feature\" equivalent of the one available in WLP, based on the IBM MQ official RAR file (currently\"9.1.0.0-IBM-MQ-Java-InstallRA.jar\") ?Or is there a \"generic\" way to configure such a connection in Open Liberty?(I guess the question arises with other Queue Managers likeActiveMQ,Artemis,OpenMQetc.)### Assistant: OpenLiberty has the jms-2.0 feature, which allows you to configure a JCA resource adapter which provides JMS such as theWebSphere MQ resource adapter.Configuration in server.xml would be something like the following,\n \n jms-2.0\n jndi-1.0\n servlet-3.1\n \n\n \n\n \n \n \n\n ...\n"} +{"text": "### Human: I am doing an IBM webpshere project and IBM MQ is reauired within this project, and now, We need to use Jmeter to send message to IBM MQ,Anyone knows how to create the test plan in Jmeter for IBM MQ message test? link and test plan are preferred.Note, IBM MQ is a little difference with standard JMS, it provides host, queue manager, server channel, port and queue name, how can we configure this within Jmeter?Thanks in advance.### Assistant: Follow instructions fromObtaining the WebSphere MQ classes for JMSguide to get all the necessary client libraries.Place libraries from step 1 to JMeter classpath using one of following approaches:add jars to /lib folder of JMeter installationadd the next line touser.propertiesfileuser.classpath=/folder/with/mq/jarsJMeter restart will be required to pick the libraries up.Follow steps fromBuilding a JMS Testing Plan - Apache JMeterguide to set JMeter up.\n"} +{"text": "### Human: So well, I am trying to get a MQXAQueueConnectionFactory to work, I have created a extended class from the JmsComponent to handle username and password when sending data to the queue.\nIt does get/put messages on the queue, but in my case I've created a router to test the XA such asfrom(\"wmq:queue:incomingQueue\")\n .process(new Processor(){\n ... Thread.sleep(20000)\n })\n .to(\"wmq:queue:outgoingQueue\")while being in sleep, I shut down the queuemanager. However when trying to get uncommited messages from the queueDISPLAY QSTATUS('qChainQueue')i getCURDEPTH(0), while it should be 1 as I understand the XA part.Am I doing this totally wrong?How can it be tested?HelpClass to handle WMQ:public class WMQComponent extends JmsComponent {\n private final String username;\n private final String password;\n\n public WMQComponent(String hostname, int port, String username, String password,\n String queueManager, String channel) throws JMSException {\n super();\n this.username = username;\n this.password = password;\n\n MQXAQueueConnectionFactory connectionFactory = new MQXAQueueConnectionFactory();\n connectionFactory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);\n connectionFactory.setFailIfQuiesce(1);\n\n connectionFactory.setHostName(hostname);\n connectionFactory.setPort(port);\n connectionFactory.setQueueManager(queueManager);\n connectionFactory.setChannel(channel);\n\n setConnectionFactory(connectionFactory);\n }\n\n @Override\n public Endpoint createEndpoint(String uri) throws Exception {\n if (uri.contains(\"username\") || uri.contains(\"password\")) {\n throw new IllegalStateException(\"Username and password is set by the component\");\n }\n if (uri.contains(\"?\")) {\n return super.createEndpoint(uri + \"&username=\" + username + \"&password=\" + password);\n } else {\n return super.createEndpoint(uri + \"?username=\" + username + \"&password=\" + password);\n }\n }\n\n}With the following errors:2015-03-25 14:01:12,077 [ #2 - Multicast] INFO dest_chain_ldap - org.springframework.jms.IllegalStateException: JMSWMQ0018: Failed to connect to queue manager 'QMBATCHESB' with connection mode 'Client' and host name 'hostname.com'.; nested exception is com.ibm.msg.client.jms.DetailedIllegalStateException: JMSWMQ0018: Failed to connect to queue manager 'QMBATCHESB' with connection mode 'Client' and host name 'hostname.com'. Check the queue manager is started and if running in client mode, check there is a listener running. Please see the linked exception for more information.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2059' ('MQRC_Q_MGR_NOT_AVAILABLE').\n at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:279)\n at org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:168)\n at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:469)\n at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.send(JmsConfiguration.java:228)\n at org.apache.camel.component.jms.JmsProducer.doSend(JmsProducer.java:431)\n at org.apache.camel.component.jms.JmsProducer.processInOnly(JmsProducer.java:385)\n at org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:153)\n at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:120)\n at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)\n at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)\n at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:416)\n at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)\n at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)\n at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)\n at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)\n at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:51)\n at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:120)\n at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)\n at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)\n at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)\n at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:416)\n at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)\n at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:105)\n at org.apache.camel.processor.MulticastProcessor.doProcessParallel(MulticastProcessor.java:732)\n at org.apache.camel.processor.MulticastProcessor.access$200(MulticastProcessor.java:82)\n at org.apache.camel.processor.MulticastProcessor$1.call(MulticastProcessor.java:303)\n at org.apache.camel.processor.MulticastProcessor$1.call(MulticastProcessor.java:288)\n at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)\n at java.util.concurrent.FutureTask.run(FutureTask.java:166)\n at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)\n at java.lang.Thread.run(Thread.java:722)\nCaused by: com.ibm.msg.client.jms.DetailedIllegalStateException: JMSWMQ0018: Failed to connect to queue manager 'QMBATCHESB' with connection mode 'Client' and host name 'hostname.com'. Check the queue manager is started and if running in client mode, check there is a listener running. Please see the linked exception for more information.\n at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:496)\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:236)\n at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:430)\n at com.ibm.msg.client.wmq.internal.WMQXAConnection.(WMQXAConnection.java:70)\n at com.ibm.msg.client.wmq.factories.WMQXAConnectionFactory.createV7ProviderConnection(WMQXAConnectionFactory.java:190)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6210)\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:278)\n at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6155)\n at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:144)\n at com.ibm.mq.jms.MQQueueConnectionFactory.createConnection(MQQueueConnectionFactory.java:223)\n at org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter.doCreateConnection(UserCredentialsConnectionFactoryAdapter.java:175)\n at org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter.createConnection(UserCredentialsConnectionFactoryAdapter.java:150)\n at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184)\n at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:456)\n ... 29 more\nCaused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2059' ('MQRC_Q_MGR_NOT_AVAILABLE').\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:223)\n ... 41 more\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2059;AMQ9204: Connection to host 'hostname.com(1514)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2059;AMQ9213: A communications error for occurred. [1=java.net.ConnectException[Connection refused: connect],3=hostname.com]],3=hostname.com(1514),5=RemoteTCPConnection.connnectUsingLocalAddress]\n at com.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiConnect(RemoteFAP.java:1831)\n at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:345)\n ... 40 more\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2059;AMQ9213: A communications error for occurred. [1=java.net.ConnectException[Connection refused: connect],3=hostname.com]\n at com.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.connnectUsingLocalAddress(RemoteTCPConnection.java:612)\n at com.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:940)\n at com.ibm.mq.jmqi.remote.internal.system.RemoteConnection.connect(RemoteConnection.java:1097)\n at com.ibm.mq.jmqi.remote.internal.system.RemoteConnectionPool.getConnection(RemoteConnectionPool.java:348)\n at com.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiConnect(RemoteFAP.java:1503)\n ... 41 more\nCaused by: java.net.ConnectException: Connection refused: connect\n at java.net.DualStackPlainSocketImpl.connect0(Native Method)\n at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:69)\n at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)\n at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)\n at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)\n at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157)\n at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)\n at java.net.Socket.connect(Socket.java:579)\n at java.net.Socket.connect(Socket.java:528)\n at com.ibm.mq.jmqi.remote.internal.RemoteTCPConnection$2.run(RemoteTCPConnection.java:597)\n at java.security.AccessController.doPrivileged(Native Method)\n at com.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.connnectUsingLocalAddress(RemoteTCPConnection.java:588)\n ... 45 more### Assistant: The reason code 2059 and various errors stating that the connection was refused suggest either a mechanical issue (i.e. Listener not running) or an auths issue.If I were attempting to debug this, the first thing I'd do is to enable authorization events, channel events, and any others you would normally enable. If you use MQ Explorer, also install theMS0P Pluginwhich will allow you to view the event messages in human-readable text.Next, I would use the MQ sample programs to test. Since I always install the full client rather than grabbing the jar files, I have amqsputc available. However, the Java classes have IVT (initial verification test) programs. These ensure that the listener is running, the channel is configured and available, etc. As of v7.1 this also ensures that theCHLAUTHrules are set to allow the access. As of v8.0, or if you had the Capitalware exit installed, this also lets us test the user ID and password authentication.The queue manager's error log and the event messages should provide good diagnostics, assuming the connection request makes it to MQ. Be sure to look both in the QMgr-specific error logs and the installation-global error logs.Once I had confirmed that basic connectivity is in place, I'd reconcile my client-side configuration parameters for host, port, channel and if it is specified [shudder!] the QMgr name. Assuming these are correct and having proven basic connectivity works, it is now possible to test the app with some confidence.The same method applies. First make sure the app's connection request makes it to the QMgr. If it does and is refused, the event messages and error logs will note this and why. If there is no indication of a failure in these places, the app isn't getting to the QMgr. The 2059 can indicate that the socket was refused, that the listener is up but the QMgr is not, that the channel instances have maxed out, or that after provisionally starting the channel it was closed by the QMgr, often due to aCHLAUTHrule. In any case, the event messages and error logs will have a detailed explanation as to why.\n"} +{"text": "### Human: I have a TIBCO BusinessWorks process that is publishing to a JMS topic -- lets call it TOPIC.A -- there is one process that is subscribing to that topic with a name SUBSCRIBE.A.The problem I have is that the first server that starts listening to SUBSCRIBE.A hooks in fine. The other 3 servers, running the exact same process get an error of \"WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2429' ('MQRC_SUBSCRIPTION_IN_USE')\"This can't be reasonable behavior for enterprise software, and I know WebsphereMQ, JMS and TIBCO Businessworks all scale well, so I must be missing something. I only want each event processed once, but a single box just isn't going to do it, both for fail-over reasons and shear volume reasons.What do I have to do to let all 4 servers in the cluster to service the subscription SUBSCRIBE.A?### Assistant: I agree it does not seem like reasonable behavior for enterprise software - but this restriction is imposed by the JMS specification. The JMS 1.1 spec, section 6.66.1 says \"Only one session at a time can have a TopicSubscriber for a particular durable subscription\".That said, WebSphere MQ does provide a vendor-specific option that allows you to do what you want: see theCLONESUPPConnection Factory property. This is documented in the Infocenter at theCLONESUPPpropertiespage.While it's specific to MQ, if you specify this using administered objects you code will not need to use any vendor-specific methods.\n"} +{"text": "### Human: I have a cluster named inventory with 4 queue managers defined london, paris, newyork, tokyo. If london and paris are the default queue managers which get messages, how can I make newyork and tokyo as default to receive and not allow clients to put messages on london and paris but they should still be in the cluster. can this be achieved with workload management ?If there are any other solutions please let me know. All this should be done without making any changes on the client side.Thanks### Assistant: Adding to T.Rob's suggestions here are couple of options you could take a look at:Disable put on cluster queue instances inlondonandparis. So the messages will be distributed betweennewyorkandtokyo.Write a cluster workload balancing exit that will skip putting messages to cluster queues inlondonandparisand puts messages only to cluster queue instances innewyorkandtokyo.SeeWriting and compiling cluster workload exitsfrom the MQ 7 Documentation.\n"} +{"text": "### Human: I'm new to WebSphere MQ and I am trying to move files through WebSphere MQ as messages using c# code. Can WebSphere MQ transfer files (e.g. *.txt) directly?Thanks in Advance.### Assistant: WebSphere MQ File Transfer Edition (FTE) is a product built on top of WebSphere MQ for transferring files. No coding is required to for transferring files. There are commands and MQ Explorer through which you can configure your file transfers. You can also start file transfers through scripting.Read through this developerWorksarticle\n"} +{"text": "### Human: We are working on an IBM WebSphere MQ application, and we use JMS API to operate the message. But we have a problem that the connection takes too much time, and we want to pool the JMS connection, for it's a standalone application, we have no application container to provide JNDI or pooling service. So is there a solution to resolve this? For JDBC we can use DBCP or c3p0 to archive pooling datasource, in JMS, is there any similar project that can pool JMS connections?### Assistant: It used to be that the JMSMQConnectionFactoryhad pooling built in, but it seems that in version 7, it has been removed.Set the use of ConnectionPooling in earlier versions of the WebSphere\n MQ classes for JMS. This method is retained for compatibility with\n older MQJMS applications, but, because this Connection Pooling\n functionality has been removed from version 7, setting this property\n will have no effect.In the absence of anything else, you can useApache Commons Pool. Same idea as DBCP (which uses Pool) but for non JDBC objects.\n"} +{"text": "### Human: Let's say there is a mobile application that needs to make a sync request/query for some data from a server. The request will come to hosted JMS client first, that will publish a message/request on external Queue (from partner). Now here where it start to be unclear. How do I get a response back from the partner in the synchronous fashion.Should the partner expose separate queue for me to subscribe and I then block the mobile request till I get the response message from that separate queue?Does JMS or proprietary WebSphere MQ interface have support for sync messaging?What are other ways to implement it with messaging?Thanks### Assistant: The textbook pattern is as follows:JMS app receives a request from the mobile device.JMS app opens the reply-to queue (which may be dynamic).JMS app prepares a request message specifying the destination from #2 as the JMSREplyTo destination.JMS app sends the request outside of syncpoint to the external service provider.JMS app listens for a response with a specified wait interval. If it used a dynamic reply-to queue it does a simple receive. If multiple instances are listening on the same queue (which is more likely with an external service) then it uses the JMSMessageID returned from the send as the JMSCorrelationID specified on the receive.JMS app receives the response from the external service.JMS app replies to the mobile device.Note that with WMQ the expected behavior from the service provider is to copy the JMSMessageID from the request message to the JMSCorrelationID of the response. It is less common to require the sender to generate a JMSCorrelation ID and copy it to the JMSCorrelationID of the response but some applications use that behavior. You will need to understand how your service provider deals with this to determine the correct behavior for your requester application.If you are using the complete WMQ Client install you will already have sample code that does most of this. If installed to the default location, look in...C:\\Program Files\\IBM\\Websphere MQ\\tools\\jms\\samples\\simple\\simpleRequestor.java...or the equivalent location under/var/mqmfor UNIX/Linux distributions. This is one of the many reasons to install the full client rather than simply grabbing the jar files. If you need to download the client is is delivered asSupportPac MQC7.\n"} +{"text": "### Human: I am writing a C# client that connects to IBM Websphere MQ Manager using amqmdnet.dll using the following construct:_myQueueManager = new MQQueueManager(queueManagerName, properties);In the properties Hashtable I am setting hostname, channel and queuemanager. Now, how can I have auto reconnect functionality in my client application? We have IBM MQ multi-instance queue manager HA configuration.Basically, I have four end points to which I have to fall back in case of connection failure from my client?### Assistant: According tothe docs:You can supply a list of hostnames and ports as an argument to the\n constructor MQQueueManager (String queueManagerName, Hashtable\n properties) using CONNECTION_NAME_PROPERTY.For example:ConnectionName = \"fred.mq.com(2344),nick.mq.com(3746),tom.mq.com(4288)\";\nHashtable Properties-new Hashtable();\nproperties.Add(MQC.CONNECTION_NAME_PROPERTY,ConnectionName);\nMQQueueManager qmgr=new MQQueue Manager(\"qmgrname\",properties);When a connection attempt is made, the connection name list is\n processed in order. If the connection attempt to the first host name\n and port fails, then connection to the second pair of attributes is\n attempted. The client repeats this process until either a successful\n connection is made or the list is exhausted. If the list is exhausted,\n an appropriate reason code and completion code is returned to the\n client application.Be sure to also follow the advice inAutomatic client reconnection in .NETto make sure the option is correctly specified with respect to managed/unmanaged mode.\n"} +{"text": "### Human: We are backend processor and doing programming with JMS MQ. We have 2 queues. one is used to get message and another one is used to send message. All the banking users will put messages to Q1 through their IB, MB etc. We receive messages from Q1 and process it and we send message to Q2.Currently we do not use multi threading for this. Can we able to use multi threading for this or single thread is enough to do this. because we are getting messages from Q1 one by one and process it.Kindly revert back to me if question is not understandable. Please someone help me.### Assistant: Yes, JMS allows for multiple readers on the same queue. You can do this by multi-threading, multiple application instances, or a dispatch layer that fetches messages and then passes them to a handler through a callback or other mechanism.The application must support that, however. For example, if two messages are related and must be processed in order, the order is not preserved if there is more than one listener on the queue. This is one reason why async messaging patterns strongly prefer messages not to have order dependencies or affinities.If you use multi-threading, it is important to make sure to preserve transactionality. If multiple threads use the same connection and one issues aCOMMITthen that commits all outstanding messages across all the threads sharing that connection.\n"} +{"text": "### Human: I have a task to write a script that will filter an input from an MQ runmqsc command and redirect the output into another file. I have been working around using many other Linux commands piped together and it seems to work just fine in Linux, but my manager needs to run the script on an AIX system, so UNIX operating system.\nI was made aware that many commands that run fine on Linux or get the job done in Linux will produce a totally different output on UNIX or UNIX-based systems.\nThe output from the runmqsc command looks like this:5724-H72 (C) Copyright IBM Corp. 1994, 2009. ALL RIGHTS RESERVED.\nStarting MQSC for queue manager CNUMQ02B.\n\n\n 1 : DISPLAY QLOCAL(*) CURDEPTH\nAMQ8409: Display Queue details.\n QUEUE(ADEXA.AOM.REPLY.MR.QL) TYPE(QLOCAL)\n CURDEPTH(0) \nAMQ8409: Display Queue details.\n QUEUE(ADEXA.AOM.REPLY.QL) TYPE(QLOCAL)\n CURDEPTH(0) \nAMQ8409: Display Queue details.\n QUEUE(ADEXA.ERROR.QL) TYPE(QLOCAL)\n CURDEPTH(0) \nAMQ8409: Display Queue details.\n QUEUE(ADEXA.FACT.OUT.QL) TYPE(QLOCAL)\n CURDEPTH(0)\nAMQ8409: Display Queue details.\n QUEUE(ADW.REMAN.XREF.ERR.QL) TYPE(QLOCAL)\n CURDEPTH(14)\nAMQ8409: Display Queue details.\n QUEUE(SAPNA.MESS.CRITICAL.CLASS.RESUME.QL)\n TYPE(QLOCAL) CURDEPTH(123)\nOne MQSC command read.\nNo commands have a syntax error.\nAll valid MQSC commands were processed.What I basically need to do is only display the name of the queue, a whitespace, and then the queue depth on the same line, with no trailing whitespaces and no newline characters at the beginning or end of file, so that it will resemble a csv file with the whitespace as the separator. I also need to filter out queues that have a queue depth equal to 0, so the output will look like this:ADW.REMAN.XREF.ERR.QL 14As I said I tried many commands on Linux, but I have a lack of knowledge of what commands and flags actually work more or less the same on UNIX and Linux, and my manager wants this today, so if by any chance you read this I ask that you at least guide me what to use to try working it out :) Thanks.This is what I wrote in Linux:head -n -3 \"$1\" | \ntail -n +6 | \nsed '/AMQ8409: Display Queue details./d' | \nsed 's/TYPE(QLOCAL)//g' | \ntr -d ' \\t\\r\\f' | \nawk 'NR%2{printf \"%s \",$0;next;}1' | \nsed '/CURDEPTH(0)/d' | \nawk '{gsub(/QUEUE(/, \"\"); gsub(/CURDEPTH(/, \"\"); gsub(/)/, \"\"); print}' |\nsort -nk2### Assistant: Try this simpler command..sed -n -e 's/.*QUEUE(\\([^)]*\\)).*/\\1/p' -e 's/.*CURDEPTH(\\([0-9]*\\)).*/\\1/p' \\\n | paste -d ' ' - - \\\n | grep -v ' 0$'\n"} +{"text": "### Human: How do I ping an IBM WebSphere MQ queue manager? Is there a way throughcmd.exe? Is there a way to use WebSphere to do it?I have triedrunmqsc QMGR \"qManager\"Thanks!### Assistant: Depends on what exactly you mean by 'ping'. Do you want to check for running WMQ processes? For local connectivity to the QMgr? Remote connectivity? Whether a specific channel or queue is available?Locally you can usedspmqand it will show you all the locally defined QMgrs and their status. Remotely, you can ping the listener but if you do not complete the connection, it causes WMQ to log an error and cut a trace. Remotely, it is better to use the WMQ client to make a connection. If the connection succeeds then the QMgr is up. If you get an error, then the error code (or linked exception in JMS) will tell you how far into the WMQ stack the connection request got - i.e. whether the listener was down, or if it was up and there was a problem at the QMgr, or if you don't have authority, etc.There are sample programs that come with MQ such asamqsgetandamsqput, and their client-based equivalentsamqsgetcoramqsputc, which connect and get or put a message. These can be used in scripts to check MQ status. Also, there is a tutorialherethat provides a stand-alone JMS program that can connect which you could customize as a ping application.The format for the command you tried is:echo dis qmgr qmname | runmqsc QMGRNAMEThis echoes a command to display the QMgr's attributes intorunmqscand executes it. The manual containing all therunmqsccommands for v7.0 ishere. The v7.1 manualis here.Finally, although I don't think this is what you are looking for, WMQ has a ping command. It is used on one queue manager to test the channel connectivity to another queue manager. The WMQ ping exercises the channel path and validates things such as the remote listener is up, the remote queue manager has a compatible channel instance defined, etc. However, this is more useful to an MQ administrator than to a developer wanting to know if the queue manager is up. For that you'd want some version of one of the suggestions above.\n"} +{"text": "### Human: I'm using MQ JMS interface with MQ 6.0.2.It seems that only pre defined properties are suported and not arbitrary ones.\nfor instance, I can properlygetJMSCorrelationID(),getJMSPriority()etc. However, when i set an arbitrary property on the sender:message.setStringProperty(\"my arbitrary name\", \"value\");I can't get the property from the message on the receiver:message.getStringProperty(\"my arbitrary name\");I simply getnull.Is there a way to do that as in any JMS implementation, or is that an MQ JMS limitation?### Assistant: If you have the complete client install, you can go toC:\\Program Files\\IBM\\WebSphere MQ\\tools\\jms\\samples\\interactive\\or somewhere in/opt/mqm/sampand look forSampleConsumerJava.javaandSampleProducerJava.java.From the sample Producer program:// Set custom properties\n msg.setStringProperty(\"MyStringProperty\", \"My Year Of Birth\");\n msg.setIntProperty(\"MyIntProperty\", 2007);And from the sample Consumer:// Get values for custom properties, if available\n String property1 = msg.getStringProperty(\"MyStringProperty\");\n\n // Get value for an int property, store the result in long to validate\n // the get operation.\n long property2 = ((long) Integer.MAX_VALUE) + 1;\n property2 = msg.getIntProperty(\"MyIntProperty\");\n\n if ((property1 != null) && (property2 < Integer.MAX_VALUE)) {\n System.out.println(\"[Message has my custom properties]\");Property names follow the rules for Java variable names and cant have spaces in them.\n"} +{"text": "### Human: This is excerpt of program which throws an exception with code MQException (CompCode: 2 Reason: 2059)Hashtable properties = new Hashtable();\n\n properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\n properties.Add(MQC.HOST_NAME_PROPERTY, _host);\n properties.Add(MQC.PORT_PROPERTY, _port);\n properties.Add(MQC.CHANNEL_PROPERTY, _channel);\n\n _mqQMgr = new MQQueueManager(_manager, properties);I have setup trace log which produceslink. Small excerpt of it :000002B4 14:45:52.635100 16832.1 0x00000000 0B 08 00 00 : ..\n000002B5 14:45:52.635100 16832.1 ----} MQFAP.NmqiConnect(String,NmqiConnectOptions,MQConnectOptions,Hconn,Phconn,out int,out int,ManagedHconn) rc=OK\n000002B6 14:45:52.636100 16832.1 System.ArgumentNullException: Value cannot be null.\nParameter name: dest\n at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)\n at System.Array.CopyTo(Array array, Int32 index)\n at IBM.WMQ.MQFAPMQCNO.set_ConnTag(Byte[] value)\n at IBM.WMQ.MQFAP.NmqiConnect(String name, NmqiConnectOptions pNmqiConnectOpts, MQConnectOptions cno, Hconn remoteParentHconn, Phconn pHconn, Int32& compCode, Int32& reason, ManagedHconn rcnHconn)\n at IBM.WMQ.MQFAP.MQCONNX(String pQMgrName, MQConnectOptions pConnectOpts, Phconn phconn, Int32& pCompCode, Int32& pReason)\n000002B7 14:45:52.636100 16832.1 ---} MQFAP.MQCONNX(String,MQConnectOptions,Phconn,out int,out int) rc=OK\n000002B8 14:45:52.636100 16832.1 IBM.WMQ.MQQueueManager#01475D71 throwing MQException: cc=2 rc=2059\n000002B9 14:45:52.636100 16832.1 New MQException CompCode: 2 Reason: 2059\n000002BA 14:45:52.662095 16832.1 --}! MQQueueManager.Connect() rc=(Unknown(2059))Server side Windows Event Log:2/6/2020 16:00:18 - Process(4472.130285) User(MUSR_MQADMIN) Program(amqrmppa.exe) Host(MQ-TEIRESIAS-T) Installation(MQTest) VRMF(8.0.0.4) QMgr(MQ.EXTSERVICES)\n\nError on receive from host 10.0.8.46.\n\nAn error occurred receiving data from 10.0.8.46 over TCP/IP. This may be due to a communications failure.\n\nThe return code from the TCP/IP recv() call was 10054 (X'2746'). Record these values and tell the systems administrator.This is working code with amqmdnet.dll (9.0.0.0)We appreciate any help or how can contact IBM Support for this### Assistant: The issue has been resolved in APARIT31572. Fix provided by IBM, tested and verified OK. Released v9.1 CD 9.1.5\n"} +{"text": "### Human: Is it possible to keep a history of messages (with message content would be perfect) that have already been retrieved and are no longer on a queue?In the application I can see when the sender attempts to put the message in the queue and when the receiver attempts to pick the messages up, but I'd like to see when the message really arrived into the queue and when the messages were really received.Does MQ Explorer have this function? How would I use it?### Assistant: What you are looking for is a message tracking/auditing software for IBM MQ. You can find a list of what is availablehere.\n"} +{"text": "### Human: I am trying to write simple string message into a queue. TheMaxMsgLengthproperty of queue is set as 4 kb. The message has 2700 characters and when I try to put into queue I am getting 2030 (07EE) (RC2030):MQRC_MSG_TOO_BIG_FOR_Qexception. I am not doing any special kind of encoding and hence whatever is default for Windows should be used.I want to know how to determine the value that I should give inMaxMsgLengthproperty. How to calculate that.### Assistant: Please remember that theMaxMsgLengthas specified in the queue definition includes not just the payload, but also the message headerandany properties that you set. If you check the InfocenterMQ_* (String Lengths)page and look forMQ_MSG_HEADER_LENGTHyou will see that the MQMD alone is 4000 bytes. So if you set theMaxMsgLengthof the queue to 4k, the largest payload you can have is 96 bytes. If the queue in question is a transmission queue, you need the queue size plus the size of theMQXQHtransmission queue header.To specifically answer the question in the title of the post, you can find theMaxMsgLengthin two ways. Visually, by displaying the queue attributes. Programmatically, add \"Inquire\" to the open options when opening the queue and use theMQInqAPI call. Then add the total of theMQMD, any properties that you add (including the XML structures that contain them but are not returned in the API calls that manipulate them) plus any headers such asRFH2(if the queues are set to use that instead of native properties),MQXQH,MQDLQ, etc.\n"} +{"text": "### Human: I am on websphere v7.0 and websphere mq 6. while trying to connect to queue manager through websphere console i am getting compcode '2' ('MQCC_FAILED') reason '2058' error.The queue manager with the same is available on the mq server with the server channel defined.Any help much Appreciated.### Assistant: MQRC_Q_MGR_NAME_ERROR (2058) is a generic error (This has been improved in the latest version of wmq). There could be a problem with the host name or its resolution, the port or even the channel name or qmgr name. Look closely for errors. Is there anything reported in /var/mqm/errors on the websphere 7 server?\n"} +{"text": "### Human: I'm kind of confused about thesyncpointfrom WebSphere MQ. According to the reference from the WMQ Infocenter, thesyncpointis defined as below:The decision to commit or back out the changes is taken, in the simplest case, at the end of a task. However, it can be more useful for an application to synchronize data changes at other logical points within a task. These logical points are called sync points (or synchronization points) and the period of processing a set of updates between two sync points is called a unit of work.Therefore,a unit of workis named as processing between two sync points. From my understanding, that unit of work is a transaction actually. So I draw the picture here reflecting the relationship between them:Am I understanding it correctly?Another question here is as for the syncpoint, it's said to synchronize data for application, where is the data synced from and where to?Thanks### Assistant: Answer 1: Yes, you are understanding it correctly. Transactions are atomic units of work that succeed or fail in their entirety. Syncpoints are the boundaries between the transactions. The subtle difference between a transaction and a syncpoint is that the work done under a transaction can be in-doubt for a period of time whereas the sync point is the state during which the transaction is not in doubt. In the event of failure, the queues are restored to the state which existed at the last syncpoint and then any pending transactions rolled back or, in the case of XA, possibly committed by the resource manager.The Infocenter pageTransaction management and supportmay explain it better than the page linked in the post.Answer 2: The data is synchronized by the resource manager(s). For local units of work where messages are the only participants in the transaction, the synchronization occurs only in the queue, and the queue manager acts as both the resource manager and the transaction manager. For global units of work involving messages and database updates in the same transaction, the synchronization occurs in the QMgr and the database which act as resource managers. The transaction manager will either be MQ or an application server and it orchestrates the synchronization between the resource managers.Regardless of whether the transaction is local or global (sometimes also referred to as single-phase commit or 2-phase commit) the relationship between transactions and syncpoints is the same. The syncpoint is the most recent point in time at which a known state is preserved and to which an in-doubt transaction might be rolled back.\n"} +{"text": "### Human: I am new to MQ..\nI have a requirement.\nCan I connect to a particular queue, using java, on a server without specifying the queue manager name?\nI have all the details like host name, port number, request, response queue name etc.,Thanks### Assistant: Yes. If the app specifies the QMgr name, then the name specified must actually match the QMgr connected to. However, if the app leaves the QMgr name blank, then whatever QMgr responds on that host, port and channel is accepted.For example, if you define a managed object it might look like this:DEFINE CF(JMSDEMOCF) +\n SYNCPOINTALLGETS(YES) +\n TRAN(client) +\n HOST(127.0.0.1) CHAN(MYAPP.SVRCONN) PORT(1414) +\n QMGR( )If not using JNDI, omit the environment hashtable entry for the QMgr name.\n"} +{"text": "### Human: I am trying to set up a 2 way SSl using my java code. I am successful doing it one way that is server certificate gets validated from my side but when it comes to two way I get a 2397 Error code.Steps followed by me are:Create a keystore with a self-signed certificate using Keytool, deploy it in truststore of MQ server.Create a keystore for MQ server and create a self-signed certificate.Deploy MQ server's certificate in my truststore.Then I try to run my java Code. This works fine without SSL or One way SSL.But two way handshake if failing. Below is the code and stack trace://code to create MQ connectivity\n public static void main(String [] args){\n System.setProperty(\"javax.net.debug\",\"ssl\");\n //keystore path\n System.setProperty(\"javax.net.ssl.keyStore\", \"C:/keystores/keystore.jks\"); \n System.setProperty(\"javax.net.ssl.keyStorePassword\", \"password\");\n //trsutstore path\n System.setProperty(\"javax.net.ssl.trustStore\", \"C:/keystores/truststore.jks\");\n System.setProperty(\"javax.net.ssl.trustStorePassword\", \"password\");\n //cipher spec \n MQEnvironment.sslCipherSuite = \"SSL_RSA_WITH_NULL_MD5\";\n MQEnvironment.hostname = \"*****-ws3717\";//system name\n MQEnvironment.port = 1414;\n MQEnvironment.channel = \"channel_name\";//channel name\n MQQueueManager qm = null;\n try { qm = new MQQueueManager(\"QMNGR\");\n System.out.println(\"Conn Successs!!!\");\n } catch (MQException e) {\n e.printStackTrace();\n } \n finally {\n try {\n qm.disconnect();\n } catch (Exception e) {\n e.printStackTrace();\n e.getCause();\n }\n }\n } }Stack Trace is as follows:keyStore is : C:/keystores/keystore.jks\nkeyStore type is : jks\nkeyStore provider is : \ninit keystore\ninit keymanager of type SunX509\n***\nfound key for : selfsigned\nchain [0] = [\n[\n Version: V3\n Subject: CN=Pooja Joshi, OU=SGW, O=SUNGARD, L=PUNE, ST=MH, C=IN\n Signature Algorithm: MD5withRSA, OID = 1.2.840.113549.1.1.4\n Key: Sun RSA public key, 1024 bits\n modulus: 132473562370742919150140985227175013875110053845431438145351913928668686945002725183702560702247749924970161010103451411451345824467592557656888776558245848713650717773344294766986771753500118311618188922138349812131167438364266468003061810102502957510761089213138803410346480285664890149111581898928681089463\n public exponent: 65537\n Validity: [From: Fri May 25 13:54:00 IST 2012,\n To: Sat May 25 13:54:00 IST 2013]\n Issuer: CN=Pooja Joshi, OU=SGW, O=SUNGARD, L=PUNE, ST=MH, C=IN\n SerialNumber: [ 4fbf41a0]\n]\n Algorithm: [MD5withRSA]\n Signature:\n0000: 46 D0 CC DF AB 5F 6F D3 37 33 E1 64 F7 1B F7 3F F...._o.73.d...?\n0010: 98 95 06 09 F9 84 C8 3A 65 CF A7 24 BB 46 95 DF .......:e..$.F..\n0020: 8B 30 F2 BC 5C F9 CC 31 E4 36 53 43 BB 50 1B EF .0..\\..1.6SC.P..\n0030: 8C 9B DB C0 41 C9 2C 37 AD B6 1D 30 BF 6E 75 E4 ....A.,7...0.nu.\n0040: A9 05 E7 30 5A B1 30 84 6B 8E B7 7A 83 2D 33 01 ...0Z.0.k..z.-3.\n0050: A1 44 86 A0 11 30 C3 4D 5B 68 7E 0B 09 48 03 CC .D...0.M[h...H..\n0060: DF C5 97 AD 87 40 DC 2A 9A 3D ED FC 27 D3 8B 4F .....@.*.=..'..O\n0070: F0 21 02 E8 62 6B 05 63 57 BB E8 4D 33 EA 35 9E .!..bk.cW..M3.5.\n]\n***\ntrustStore is: C:\\keystores\\truststore.jks\ntrustStore type is : jks\ntrustStore provider is : \ninit truststore\nadding as trusted cert:\n Subject: CN=Pooja Joshi, OU=SGW, O=SUNGARD, L=PUNE, ST=MH, C=IN\n Issuer: CN=Pooja Joshi, OU=SGW, O=SUNGARD, L=PUNE, ST=MH, C=IN\n Algorithm: RSA; Serial number: 0x4fbf4261\n Valid from Fri May 25 13:57:13 IST 2012 until Sat May 25 13:57:13 IST 2013\ntrigger seeding of SecureRandom\ndone seeding SecureRandom\nAllow unsafe renegotiation: false\nAllow legacy hello messages: true\nIs initial handshake: true\nIs secure renegotiation: false\n%% No cached client session\n*** ClientHello, SSLv3\nRandomCookie: GMT: 1321485794 bytes = { 138, 193, 95, 113, 86, 252, 250, 50, 154, 121, 73, 8, 93, 116, 115, 184, 182, 142, 240, 205, 15, 250, 172, 171, 111, 5, 122, 52 }\nSession ID: {}\nCipher Suites: [SSL_RSA_WITH_NULL_MD5]\nCompression Methods: { 0 }\nExtension renegotiation_info, renegotiated_connection: \n***\nmain, WRITE: SSLv3 Handshake, length = 52\nmain, READ: SSLv3 Handshake, length = 4875\n*** ServerHello, SSLv3\nRandomCookie: GMT: 1321485794 bytes = { 250, 173, 248, 90, 241, 136, 107, 119, 99, 92, 80, 19, 223, 223, 152, 131, 216, 115, 242, 56, 198, 135, 156, 111, 210, 234, 220, 103 }\nSession ID: {240, 31, 0, 0, 80, 56, 194, 89, 112, 238, 203, 154, 79, 75, 68, 48, 106, 203, 19, 130, 88, 88, 88, 88, 226, 70, 196, 79, 13, 0, 0, 0}\nCipher Suite: SSL_RSA_WITH_NULL_MD5\nCompression Method: 0\n***\nWarning: No renegotiation indication extension in ServerHello\n%% Created: [Session-1, SSL_RSA_WITH_NULL_MD5]\n** SSL_RSA_WITH_NULL_MD5\n*** Certificate chain\nchain [0] = [\n[\n Version: V3\n Subject: CN=Pooja Joshi, OU=SGW, O=SUNGARD, L=PUNE, ST=MH, C=IN\n Signature Algorithm: MD5withRSA, OID = 1.2.840.113549.1.1.4\n Key: Sun RSA public key, 1024 bits\n modulus: 105605049659295333895264877648371480987144339115417104117025065956957634413900327625548229515098843172709660865042903412409581107015480309223474293490705595126088958625491899627683399717294708677347640098462040771799700233921554682196524988217754821345297656825451441457385676164016790486091736694366149540953\n public exponent: 65537\n Validity: [From: Fri May 25 13:57:13 IST 2012,\n To: Sat May 25 13:57:13 IST 2013]\n Issuer: CN=Pooja Joshi, OU=SGW, O=SUNGARD, L=PUNE, ST=MH, C=IN\n SerialNumber: [ 4fbf4261]\n]\n Algorithm: [MD5withRSA]\n Signature:\n0000: 81 F5 2C 2A 77 63 F1 CD D8 31 E1 BE B5 9B 28 C5 ..,*wc...1....(.\n0010: 6B EA 24 BB 5C 3D EB D0 EB E3 86 2E D7 1C 0D 92 k.$.\\=..........\n0020: 36 A2 79 13 BC 74 40 C4 BF 7C F7 1B 05 8C 6B CF 6.y..t@.......k.\n0030: EB 2C C2 0D E3 40 F7 F0 95 66 B6 85 AE 84 66 C9 .,...@...f....f.\n0040: B7 C5 29 BE 71 1F 28 C0 83 1C 94 41 08 2A 44 45 ..).q.(....A.*DE\n0050: 99 FD C5 77 28 26 FC 50 A3 69 32 BD F5 8B 0C A6 ...w(&.P.i2.....\n0060: 13 21 0F BA B2 C6 A2 71 18 17 94 31 3B 7E 88 63 .!.....q...1;..c\n0070: C0 01 76 DC 60 47 BB 3F 2F 7E 2A 73 84 DA 60 79 ..v.`G.?/.*s..`y\n]\n***\nFound trusted certificate:\n[\n[\n Version: V3\n Subject: CN=Pooja Joshi, OU=SGW, O=SUNGARD, L=PUNE, ST=MH, C=IN\n Signature Algorithm: MD5withRSA, OID = 1.2.840.113549.1.1.4\n Key: Sun RSA public key, 1024 bits\n modulus: 105605049659295333895264877648371480987144339115417104117025065956957634413900327625548229515098843172709660865042903412409581107015480309223474293490705595126088958625491899627683399717294708677347640098462040771799700233921554682196524988217754821345297656825451441457385676164016790486091736694366149540953\n public exponent: 65537\n Validity: [From: Fri May 25 13:57:13 IST 2012,\n To: Sat May 25 13:57:13 IST 2013]\n Issuer: CN=Pooja Joshi, OU=SGW, O=SUNGARD, L=PUNE, ST=MH, C=IN\n SerialNumber: [ 4fbf4261]\n]\n Algorithm: [MD5withRSA]\n Signature:\n0000: 81 F5 2C 2A 77 63 F1 CD D8 31 E1 BE B5 9B 28 C5 ..,*wc...1....(.\n0010: 6B EA 24 BB 5C 3D EB D0 EB E3 86 2E D7 1C 0D 92 k.$.\\=..........\n0020: 36 A2 79 13 BC 74 40 C4 BF 7C F7 1B 05 8C 6B CF 6.y..t@.......k.\n0030: EB 2C C2 0D E3 40 F7 F0 95 66 B6 85 AE 84 66 C9 .,...@...f....f.\n0040: B7 C5 29 BE 71 1F 28 C0 83 1C 94 41 08 2A 44 45 ..).q.(....A.*DE\n0050: 99 FD C5 77 28 26 FC 50 A3 69 32 BD F5 8B 0C A6 ...w(&.P.i2.....\n0060: 13 21 0F BA B2 C6 A2 71 18 17 94 31 3B 7E 88 63 .!.....q...1;..c\n0070: C0 01 76 DC 60 47 BB 3F 2F 7E 2A 73 84 DA 60 79 ..v.`G.?/.*s..`y\n]\n*** CertificateRequest\nCert Types: RSA\nCert Authorities:\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n*** ServerHelloDone\nmatching alias: selfsigned\n*** Certificate chain\nchain [0] = [\n[\n Version: V3\n Subject: CN=Pooja Joshi, OU=SGW, O=SUNGARD, L=PUNE, ST=MH, C=IN\n Signature Algorithm: MD5withRSA, OID = 1.2.840.113549.1.1.4\n\n Key: Sun RSA public key, 1024 bits\n modulus: 132473562370742919150140985227175013875110053845431438145351913928668686945002725183702560702247749924970161010103451411451345824467592557656888776558245848713650717773344294766986771753500118311618188922138349812131167438364266468003061810102502957510761089213138803410346480285664890149111581898928681089463\n public exponent: 65537\n Validity: [From: Fri May 25 13:54:00 IST 2012,\n To: Sat May 25 13:54:00 IST 2013]\n Issuer: CN=Pooja Joshi, OU=SGW, O=SUNGARD, L=PUNE, ST=MH, C=IN\n SerialNumber: [ 4fbf41a0]\n]\n Algorithm: [MD5withRSA]\n Signature:\n0000: 46 D0 CC DF AB 5F 6F D3 37 33 E1 64 F7 1B F7 3F F...._o.73.d...?\n0010: 98 95 06 09 F9 84 C8 3A 65 CF A7 24 BB 46 95 DF .......:e..$.F..\n0020: 8B 30 F2 BC 5C F9 CC 31 E4 36 53 43 BB 50 1B EF .0..\\..1.6SC.P..\n0030: 8C 9B DB C0 41 C9 2C 37 AD B6 1D 30 BF 6E 75 E4 ....A.,7...0.nu.\n0040: A9 05 E7 30 5A B1 30 84 6B 8E B7 7A 83 2D 33 01 ...0Z.0.k..z.-3.\n0050: A1 44 86 A0 11 30 C3 4D 5B 68 7E 0B 09 48 03 CC .D...0.M[h...H..\n0060: DF C5 97 AD 87 40 DC 2A 9A 3D ED FC 27 D3 8B 4F .....@.*.=..'..O\n0070: F0 21 02 E8 62 6B 05 63 57 BB E8 4D 33 EA 35 9E .!..bk.cW..M3.5.\n]\n***\n*** ClientKeyExchange, RSA PreMasterSecret, SSLv3\nmain, WRITE: SSLv3 Handshake, length = 711\nSESSION KEYGEN:\nPreMaster Secret:\n0000: 03 00 3D 04 C8 EF 08 83 A4 EF 85 1C D9 96 A0 77 ..=............w\n0010: 32 2A A5 43 14 98 11 6F DD 01 52 73 4D DF B4 5A 2*.C...o..RsM..Z\n0020: C5 2E FC 2A C0 F6 C2 9B 11 23 B2 C0 7B 59 E8 96 ...*.....#...Y..\nCONNECTION KEYGEN:\nClient Nonce:\n0000: 4F C4 46 E2 8A C1 5F 71 56 FC FA 32 9A 79 49 08 O.F..._qV..2.yI.\n0010: 5D 74 73 B8 B6 8E F0 CD 0F FA AC AB 6F 05 7A 34 ]ts.........o.z4\nServer Nonce:\n0000: 4F C4 46 E2 FA AD F8 5A F1 88 6B 77 63 5C 50 13 O.F....Z..kwc\\P.\n0010: DF DF 98 83 D8 73 F2 38 C6 87 9C 6F D2 EA DC 67 .....s.8...o...g\nMaster Secret:\n0000: C0 20 A8 BC D1 A7 06 B0 C5 07 CA A7 83 C5 35 9E . ............5.\n0010: 20 AB B6 28 8C 7E EF 14 CB 9D C1 ED C5 62 F8 A1 ..(.........b..\n0020: 6A DE 9F AF 16 5B 2F 1D 21 8F A3 2C F7 B9 3D 36 j....[/.!..,..=6\nClient MAC write Secret:\n0000: 09 E8 CE 6C D1 2D 43 86 7E 74 1C 5F 68 DA E2 AE ...l.-C..t._h...\nServer MAC write Secret:\n0000: CE 62 DA F7 2C F2 2B 4A AD 47 8F 61 BD 58 51 BD .b..,.+J.G.a.XQ.\n... no encryption keys used\n... no IV used for this cipher\n*** CertificateVerify\nmain, WRITE: SSLv3 Handshake, length = 134\nmain, WRITE: SSLv3 Change Cipher Spec, length = 1\n*** Finished\nverify_data: { 4, 127, 139, 212, 93, 181, 170, 62, 121, 196, 243, 156, 251, 103, 206, 222, 2, 10, 84, 35, 186, 251, 144, 6, 31, 97, 135, 179, 160, 127, 204, 93, 100, 140, 74, 79 }\n***\nmain, WRITE: SSLv3 Handshake, length = 56\nmain, waiting for close_notify or alert: state 1\nmain, Exception while waiting for close java.net.SocketException: Software caused connection abort: recv failed\nmain, handling exception: java.net.SocketException: Software caused connection abort: recv failed\nMQJE001: An MQException occurred: Completion Code 2, Reason 2397\nMQJE030: IOException during security flows\nMQJE001: Completion Code 2, Reason 2397\ncom.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2397\n at com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:219)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnection(MQClientManagedConnectionFactoryJ11.java:318)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnection(MQClientManagedConnectionFactoryJ11.java:338)\n at com.ibm.mq.StoredManagedConnection.(StoredManagedConnection.java:84)\n at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:168)\n at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:772)\n at com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:697)\n at com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:657)\n at com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:153)\n at com.ibm.mq.MQQueueManager.(MQQueueManager.java:451)\n at com.test.SSlTest.main(SSlTest.java:68)\nCaused by: java.net.SocketException: Software caused connection abort: recv failed\n at java.net.SocketInputStream.socketRead0(Native Method)\n at java.net.SocketInputStream.read(SocketInputStream.java:129)\n at com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:293)\n at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:331)\n at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:798)\n at com.sun.net.ssl.internal.ssl.SSLSocketImpl.waitForClose(SSLSocketImpl.java:1493)\n at com.sun.net.ssl.internal.ssl.HandshakeOutStream.flush(HandshakeOutStream.java:103)\n at com.sun.net.ssl.internal.ssl.Handshaker.sendChangeCipherSpec(Handshaker.java:689)\n at com.sun.net.ssl.internal.ssl.ClientHandshaker.sendChangeCipherAndFinish(ClientHandshaker.java:985)\n at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverHelloDone(ClientHandshaker.java:904)\n at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:238)\n at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:593)\n at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:529)\n at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:893)\n at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1138)\n at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1165)\n at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1149)\n at com.ibm.mq.SSLHelper.configureSSLSocket(SSLHelper.java:567)\n at com.ibm.mq.SSLHelper.createSSLSocket(SSLHelper.java:150)\n at com.ibm.mq.MQInternalCommunications.createSocketConnection(MQInternalCommunications.java:2264)\n at com.ibm.mq.MQv6InternalCommunications$1.run(MQv6InternalCommunications.java:157)\n at java.security.AccessController.doPrivileged(Native Method)\n at com.ibm.mq.MQv6InternalCommunications.initialize(MQv6InternalCommunications.java:154)\n at com.ibm.mq.MQv6InternalCommunications.(MQv6InternalCommunications.java:102)\n at com.ibm.mq.MQSESSIONClient.MQCONNX(MQSESSIONClient.java:1337)\n at com.ibm.mq.MQSESSIONClient.MQCONN(MQSESSIONClient.java:1246)\n at com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:184)\n ... 10 moreKindly help me....### Assistant: Your debugging process is perfect! When setting up SSL for the first time, always test first without SSL (validates channel name spelling, listener port, etc.), then check with anonymous SSL (validates that the client can validate the QMgr's certificate) then finally check with mutually authenticated SSL.In this case the failure is in that final step. By this point we know that the QMgr can read it's KDB and that the client can read its trust store. There are very few possible issues at this point and the primary ones are that the client cannot find its private key or that the QMgr cannot validate the client's key.Since the trace shows the client is able to access its key, we know that's not the problem. In most cases then, this points to a problem on the QMgr's side. There are two problems typical in this case.The client's key is not properly loaded into the QMgr's keystore (or perhaps a prior version of the key is loaded).The QMgr does not have the current version of the KDB loaded.Since you provided the stack trace and all other aspects of key exchange appear to be good, I'm going to take a wild guess and say the cause is #2 above. If so then it is easily fixed. You can use runmqsc to enter the commandREFRESH SECURITY TYPE(SSL)which causes the QMgr to stop all SSL channels and flush the KDB from its cache. There is an equivalent command in WMQ Explorer found by right-clicking on the QMgr. Or just bounce the QMgr, which accomplishes the same thing. Either of these methods result in the QMgr reloading the KDB which gives it access to the new certificate.UPDATE:Sorry that was not the issue. Can you recreate the failure and look at the QMgr's error logs? You should see the error at the bottom of/var/mqm/qmgrs//errors/AMQERR01.LOGright after the failure.You can also dump the certificate details on the client and QMgr to verify they match and are marked as trusted in the QMgr's kdb. You already know how to do this with keytool. Depending on your version of WMQ server, you can usegsk7capicmdorgsk8capicmdor with WMQ v7.1runmqakm. First dump the QMgr's KDB using the-cert -listcommand, then dump the client's cert using the-cert -detailsand post the results as an update to your question.The commands will give you help with the needed parameters. If you want the deep details, go tohttps://t-rob.net/wmq/where you will find links to the GSKit 7 and GSKit 8 manuals about halfway down the page. Therunmqakmcommand is a wrapper over GSKit 8 so if the QMgr is running WMQ v7.1 use the GSKit 8 manual.\n"} +{"text": "### Human: I have an application where messages keep coming at a rate of 70K XMLs per hour. We consume these XML messages and store it into an intermediate queue. The intermediate queue is created because we need to meet SLA of consuming all the messages with 24 hours. We are able to consume and load the XMLS into the internal queue within 24 hours. After loading it to internal queue, we process the XMLS (parse, apply very few transformation, perform very few validations) and store the data to a heavily normalized data model. I know that the datamodel can have a huge impact on performance, unfortunately, we have no control over the datamodel. Currently, we take 3.5 minutes to process 2K messages, which is unacceptable. We want to bring it down to 1 minute for 2K messages. Here is what we have done so far:1) Applied indexes wherever applicable.2) Use XMLBeans for parsing the XMLs (size of each XML is not very huge)3) Removed all unnecessary validations, transformatios, etc.The application runs on:Operating system: RHEL 5.4 64 bitPlatform: JDK 1.6.0_17, 64 bitDatabase: Oracle 11g R2 64 bit (2 node cluster)External MQ: IBM QueueInternal temporary storage MQ: JBoss MQApplication Server: Jboss 5.1.0.GA (EAP Version)The order in which we consume and process the XML messages is very important and so we cannot do a parallel processing.Is there anything else we can do to improve performance?### Assistant: Some suggestions outside of message delivery tuning since it appears this is not your [primary] bottleneck:You mentioned you are storing data into a highly normalized database. This invariably means one or more reference data or PK lookups which creates several additional trips to the database to fetch this data. To avoid or reduce this, create a local cache with all your reference data and update the cache as you go. In memory lookups will be significantly faster than a trip to the DB.If you feel you have insufficient RAM to cache all your decodes and reference data, shoot for a disk based cache (e.g. EHCache which will do RAM, Disk or Overflow) or a lightweight local DB like HyperSonic or H2 which will still give you better lookup times than a trip to Oracle (unless you're on the same host, and even then....)Ultimately, if each message requires many round trips to the DB, you may benefit from migrating the processing of the message to the DB itself, where you can implement the process in PL/SQL or Java.If your write to the database for one message processed involves multiple inserts/updates, make sure to use prepared statement batching. This will send multiple inserts/updates in one call to the DB.Speaking of prepared statements, make sure yourJBoss DataSource configurationfor Oracle hasprepared-statement-cache-sizeset to some number high enough to handle all your prepared statements created during processing (and not the default which is zero, or no caching).The XML parser you are using may be imposing more overhead than is necessary, even (or especially) for small messages. If you are using JAXB, make sure you're not recreating the unmarshaller more than once (or more than necessary). Alternatively, try aPull/Streaming parser. If you are using a DOM parser, the additional memory required may be causing a lot of garbage collection.Silly thing, but worth mentioning, if you are executing a lot of logging for each message, that will be costing you time, so turn it off.Using JBoss MQ as an intermediary buffer is elegant but it is probably not the fastest way to store your messages for deferred processing since the persistence is more complex and generalized for all sorts of JMS message types. On that note, if JBoss MQ is persisting to Oracle anyways, then it seems improbable that a custom persistence procedure would not be faster. If JBoss MQ is storing to HyperSonic (as it does by default), you can still probably outperform the store of the JMS message with some custom code. This will also mean that you will need a new mechanism to pull the message back out of the DB for processing, but as with the JMS store, a custom process may outperform the more generalized procedure implemented by JBoss MQ.Storing intermediary messages to the DB may also give more query flexibility to determine where messages do not have to be serially processed. (Perhaps, for example, messages originating from different clients do not need to be processed in sequence). Of course, you can also do this with JBoss MQ by placing the appropriate headers in the intermediary messages. This would allow you to parallelize by using different selectors in multiple different message listeners/processors.One quick item on messaging.....You did not mention if you were using message driven beans with WebSphere MQ, but if you are, there is a setting in theInbound ConfigurationcalledpollingIntervalwhich, to quote from the docs, means:If each message listener within a session has no suitable message on its queue, this is the maximum interval, in milliseconds, that elapses before each message listener tries again to get a message from its queue. If it frequently happens that no suitable message is available for any of the message listeners in a session, consider increasing the value of this property. This property is relevant only if TRANSPORT has the value BIND or CLIENT.The defaultpollingTimeis 5000 ms. Your current message processing time is(3.5 * 60 * 1000 / 2000)= 105 ms per message.If you introduce a 5000 ms pause here-and-there, that will seriously cut down on your throughput, so you might want to look into this by measuring the ongoing difference between the message enqueue time and the time that you receive the message in your JBoss message listener. The enqueue time can be determined from these message headers:JMS_IBM_PutDateJMS_IBM_PutTimeAll in all, your best bet is going to be to figure out how to parallelize.Good luck.//Nicholas\n"} +{"text": "### Human: I have read the articlehttp://techtots.blogspot.com/2010/01/connecting-to-mq-using-spring-without.htmlabout configuringQueueConnectionFactoriesand have that side of things working nicely.# MQ related values\nmq.jms.qcf=QM_Epsilon\nmq.jms.request.queue=TEST.REQUEST.QUEUE\n\n# Connection details\nmq.host.url=localhost:1414/SYSTEM.DEF.SVRCONN\nmq.factoryclass=com.ibm.mq.jms.context.WMQInitialContextFactory\n\n# Authentication details\nmq.auth=simple\nmq.user=******\nmq.password=********\n \n \n \n \n ${mq.factoryclass}\n ${mq.host.url}\n ${mq.auth}\n ${mq.user}\n ${mq.password}\n \n \nUsing this configuration thequeueConnectionFactorybean is easily injected into my classes as anMQQueueConnectionFactory.But I am wanting to use the publish/subscribe model and, as I understand it, I need to get an MQTopicConnectionFactory for this. I have searched everywhere and tried numerous things but I cannot find any information on how to modify this configuration, or the MQ installation so that I get anMQTopicConnectionFactoryinstead of anMQQueueConnectionFactory.### Assistant: TheWMQInitialContextFactoryis a class that implements a JNDI provider over a WebSphere MQ queue. Instead of the managed objects being stored in a .bindings file or LDAP, they are serialized and stored in a queue and this class allows you to treat that queue as just another JNDI store. This class was only ever intended to be a JNDI provider and not a replacement for the actual IBM JMS implementation. Since storing managed objects on a topic would not work, these classes have no topic factories in them. This is as expected.In my opinion, the problem withWMQInitialContextFactoryis that it must first connect to WebSphere MQ in order to to obtain a connection factory which then tells the app - you guessed it - how to connect to WebSphere MQ. This makes the article that was linked confusing because it appears that all that configuration, the WMQ connection details and so forth, are for the benefit of the application when in fact they just bootstrap a JNDI provider which is expected to have defined connection factory objects with all this same information.What is missing from the article is that the author would have had to use IBM's JMSAdmin tool to connect to the MQInitialContext and define the ConnectionFactory and other administered objects before connecting the application to that same Initial Context in order to access them.For the record, the WebSphere MQ JMS classes have supported JMS 1.1 ConnectionFactory and Destination classes for quite some time now. Prior to that they supported both queues and topics as per the JMS 1.0 spec.You can download the IBM WMQ JMS implementation asSupportPac MQC7. There is a lot more there than just the jar files. For example, you get lots of sample code, diagnostic and trace utilities, documentation, etc. You also get the correct jar files.If you want to use a .bindings file (File-system initial context) instead of theWMQInitialContextFactory, download the latest WebSphere MQ Explorer tool asSupportPac MS0T. You can create a directory, point WMQ Explorer to it and define all your connection factories and destinations. (Or go with domain-specific QueueConnectionFactory and TopicConnectionFactory if you rock it old school.) More information on using WMQ Explorer to define your managed objects may be found at:Creating and configuring JMS administered objectsIf you want a tutorial that includes a demonstration of how to use IBM's JMSAdmin tool to create the .bindings file, look atRunning a standalone Java application on WebSphere MQ V6.0. (The JMSAdmin tool is installed with the WMQ Server and I believe it also comes with the free MS0T WMQ Client install linked above.) The documentation for the JMSAdmin tool is here:Using the WebSphere MQ JMS administration toolWhichever method you choose to create managed objects, you can look up all the possible properties supported in IBM's implementation at:Properties of WebSphere MQ classes for JMS objects\n"} +{"text": "### Human: I have been asked this a lot lately so I thought I'd post the question and answer here.What is the difference between an FTE exit and an FTE call? What are they for and when do I use them?### Assistant: BackgroundWebSphere MQ File Transfer Edition (WMQ FTE) is a Java application built on WebSphere MQ and which provides an enterprise file transfer platform. The transfer occurs between two agents, one at the source and one at the destination. In the lifecycle of the transfer there are four points at which external code can be called - before the transfer starts at both the source and the destination agents, and after the transfer completes at the source and destination agents. The two methods by which external code may be called are exits and calls.ExitsExits are implemented as Java classes and are called from the agent code. The scope of these is per-agent and once enabled, the exit is called for every transfer. This makes them appropriate for enforcing global policies or providing a ubiquitous service such as virus scanning.CallsCalls are implemented as (mostly) separate tasks in the transfer lifecycle and may be either an Ant script or a command-line executable. These are defined within the transfer job definition and the post-transfer calls will not fire if the transfer fails. This makes them suitable for providing functionality that is specific to a transfer or that depends on the outcome of the transfer. For example, a post-transfer destination call is a good place to perform decryption because this is something you would usually define for specific transfers and the decrypt step will not fire if the transfer fails.Order of exits and callsExits and calls both fire before the transfer starts and after the transfer completes, at both the source and target agents. But the documentation does not yet show the relationship between calls and exits. By creating a set of calls and exits which update the same log file, it is possible to demonstrate the firing order.Below is the timeline of exit points and calls during a file transfer. The names of the exits are as per the Java interface definition. The names of the calls are as per the XML schema for transfer definitions.Successful transferSun Feb 6 20:20:21 EST 2011: onSourceTransferStart Exit firedSun Feb 6 20:20:21 EST 2011: PreSourceCall firedSun Feb 6 20:20:21 EST 2011: onDestinationTransferStart Exit firedSun Feb 6 20:20:21 EST 2011: PreDestinationCall firedSun Feb 6 20:20:22 EST 2011: onDestinationTransferEnd Exit firedSun Feb 6 20:20:22 EST 2011: PostDestinationCall firedSun Feb 6 20:20:22 EST 2011: onSourceTransferEnd Exit firedSun Feb 6 20:20:22 EST 2011: PostSourceCall firedFailed transferSun Feb 6 20:28:49 EST 2011: onSourceTransferStart Exit firedSun Feb 6 20:28:50 EST 2011: PreSourceCall firedSun Feb 6 20:28:50 EST 2011: onDestinationTransferStart Exit firedSun Feb 6 20:28:50 EST 2011: PreDestinationCall firedSun Feb 6 20:28:50 EST 2011: onDestinationTransferEnd Exit firedSun Feb 6 20:28:50 EST 2011: onSourceTransferEnd Exit firedAdditional resourcesFor more information on programming WMQ FTE calls and exits, see theWMQ FTE Infocenter.\n"} +{"text": "### Human: is there a limit on how many queues I can have open within a single connection and single session? I can currently open up 128 queues and send messages to them. If I try to open up 129 I get the following error...ThanksError:com.ibm.msg.client.jms.DetailedResourceAllocationException: JMSWMQ2008: Failed to open MQ queue 'TestQueue_129'. JMS attempted to perform an MQOPEN, but WebSphere MQ reported an error. Use the linked exception to determine the cause of this error. Check that the specified queue and queue manager are defined correctly.\n at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:579)\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:219)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer.checkJmqiCallSuccess(WMQMessageProducer.java:1000)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer.checkJmqiCallSuccess(WMQMessageProducer.java:956)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer.access$800(WMQMessageProducer.java:59)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer$SpiIdentifiedProducerShadow.initialise(WMQMessageProducer.java:727)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer.(WMQMessageProducer.java:931)\n at com.ibm.msg.client.wmq.internal.WMQSession.createProducer(WMQSession.java:783)\n at com.ibm.msg.client.jms.internal.JmsSessionImpl.createProducer(JmsSessionImpl.java:1122)\n at com.ibm.msg.client.jms.internal.JmsQueueSessionImpl.createSender(JmsQueueSessionImpl.java:131)\n at com.ibm.mq.jms.MQQueueSession.createSender(MQQueueSession.java:147)\n at com.ibm.mq.jms.MQQueueSession.createProducer(MQQueueSession.java:248)\n at MyQueue.(MyQueue.java:25)\n at Main.main(Main.java:54)\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)\n at java.lang.reflect.Method.invoke(Method.java:599)\n at com.ibm.ws.client.applicationclient.launchClient.createContainerAndLaunchApp(launchClient.java:788)\n at com.ibm.ws.client.applicationclient.launchClient.main(launchClient.java:493)\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)\n at java.lang.reflect.Method.invoke(Method.java:599)\n at com.ibm.wsspi.bootstrap.WSLauncher.launchMain(WSLauncher.java:213)\n at com.ibm.wsspi.bootstrap.WSLauncher.main(WSLauncher.java:93)\n at com.ibm.wsspi.bootstrap.WSLauncher.run(WSLauncher.java:74)\n at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)\n at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)\n at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)\n at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)\n at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)\n at java.lang.reflect.Method.invoke(Method.java:599)\n at org.eclipse.core.launcher.Main.invokeFramework(Main.java:340)\n at org.eclipse.core.launcher.Main.basicRun(Main.java:282)\n at org.eclipse.core.launcher.Main.run(Main.java:981)\n at com.ibm.wsspi.bootstrap.WSPreLauncher.launchEclipse(WSPreLauncher.java:330)\n at com.ibm.wsspi.bootstrap.WSPreLauncher.main(WSPreLauncher.java:108)\nCaused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2017' ('MQRC_HANDLE_NOT_AVAILABLE').\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:206)\n ... 39 more\nWSCL0100E: Exception received: java.lang.reflect.InvocationTargetException\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)\n at java.lang.reflect.Method.invoke(Method.java:599)\n at com.ibm.ws.client.applicationclient.launchClient.createContainerAndLaunchApp(launchClient.java:788)\n at com.ibm.ws.client.applicationclient.launchClient.main(launchClient.java:493)\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)\n at java.lang.reflect.Method.invoke(Method.java:599)\n at com.ibm.wsspi.bootstrap.WSLauncher.launchMain(WSLauncher.java:213)\n at com.ibm.wsspi.bootstrap.WSLauncher.main(WSLauncher.java:93)\n at com.ibm.wsspi.bootstrap.WSLauncher.run(WSLauncher.java:74)\n at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)\n at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)\n at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)\n at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)\n at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)\n at java.lang.reflect.Method.invoke(Method.java:599)\n at org.eclipse.core.launcher.Main.invokeFramework(Main.java:340)\n at org.eclipse.core.launcher.Main.basicRun(Main.java:282)\n at org.eclipse.core.launcher.Main.run(Main.java:981)\n at com.ibm.wsspi.bootstrap.WSPreLauncher.launchEclipse(WSPreLauncher.java:330)\n at com.ibm.wsspi.bootstrap.WSPreLauncher.main(WSPreLauncher.java:108)\nCaused by: java.lang.NullPointerException\n at MyQueue.sendMessage(MyQueue.java:39)\n at Main.main(Main.java:55)\n ... 27 more### Assistant: This is controlled by the queue manager'sMAXHANDSattribute.The default is 256. Depending on how you access the queues, the classes may be opening each one twice, resulting in 128 max open queues.You can display the queue handles in runmqsc with theDIS QSTATUScommand.\n"} +{"text": "### Human: in my Java application I getMQQueueobject usingMQQueue tQueue = qManager.accessQueue(tqName, tqOptions);The queue is a remote queue. Is there way to get corresponding local transmission queue ?(UsingMQ 7.5)Thanks### Assistant: Yes, usingrunmqscconsole.First on a command prompt runrunmqsc .Once the console opens rundis qr XMITQto display the transmit queue used by the remote queue definition.UPDATEAnother method is to use PCF classes.PCFMessageAgent pcfma = new PCFMessageAgent(\"QM\");\n PCFMessage pcfCmd = new PCFMessage(MQConstants.MQCMD_INQUIRE_Q);\n pcfCmd.addParameter(MQConstants.MQCA_Q_NAME, \"Q.REMOTE\");\n PCFMessage[] pcfResponse = pcfma.send(pcfCmd);\n String xmitQName = (String) pcfResponse[0].getParameterValue(MQConstants.MQCA_XMIT_Q_NAME);\n System.out.println(\"XmitQ name \" + xmitQName);\n"} +{"text": "### Human: I'm using XMS (i.e IBM Message Services Client for .NET) to connect to IBM MQ and get the messages.With that said, I wanted to know how to get count of messages on a Queue at any given point of time.(Explored on IQueueBrowser.GetEnumerator, but it will download the messages onto client.)### Assistant: XMS .NET is an implementation of JMS specification and JMS specific does not define a method or a property that retrieves count of messages in a queue. Hence XMS does not provide a way to do that.Anything to do with queue attributes is a provider specific administrative job, so you have to use message provider specific APIs.But why do you want to know the count of messages? Application should be coded to receive messages continuously. Your application can choose to quit receiving messages when there are no more messages in the queue or wait for further messages. If there are no messages, the receive call will return with null message object. Your application can check for this and decide to make further receive calls or quit.HTH\n"} +{"text": "### Human: I am trying to get the number of consumers of a particular Websphere MQ queue from Java? I need to know whether someone is going to consume the messages before placing them on the queue.### Assistant: First, it is worth noting that the design proposed is a very, VERY bad design. The effect is to turn async messaging back into synchronous messaging. This couples message producers to consumers, introduces location and resolution dependencies, breaks clustering, defeats WMQ's load distribution and balancing, embeds network topology into the application, and makes the whole system brittle. Please do not blame WMQ for not working correctly after intentionally defeating all its best features except the actual queue/dequeue operations.However, to answer your question more directly, use thegetOpenInputCountmethod of the queue object to obtain the number of open input handles. Here's how:MQQueue outQ = qMgr.accessQueue(qName,\n openOptions,\n null, // default q manager\n null, // no dynamic q name\n null); // no alternate user id\n\nint inCount = outQ.getOpenInputCount();Note that you can only inquire the input handles on a local queue. If the queue is hosted on a QMgrotherthan the one where the message sender is connected, this method will not work. Of course it is the normal case that the message sender and receiver would reside on different QMgrs. However since you do not mention much about the design, I'll assume for purposes of this answer that connections from the message producer and consumer attach to the same QMgr. If that's not the case, we need to have a discussion about PCF and even stronger warnings about the design.\n"} +{"text": "### Human: We are reading messages from Websphere MQ using JMS and Spring Integration.\n\n\n \n \n \n \n\n\nThere is another system, which put message on this Queue. (Out of scope for us)We can have 2000 messages at a time on queue to be read.Sometimes, Message Listener stops reading messages from Queue, when I tried to troubleshoot this issue, it gives reason that there are some un-commited message on queue, which listener trying to read and won't be able to process further and hangs there itself.As when delete that message manually from queue, it processes other message perfectly.So how to skip such uncommitted messages, so that system can continue with next message ?### Assistant: Sounds like a classic unhandled poison message problem. When the app reads a message that it cannot process, the message is backed out to the queue. It is then read back in again since it is at the top of the queue. This results in the message appearing to be under syncpoint until finally the listener gives up and stops.Sometimes the problem is in the app and it is the app explicitly callingROLLBACK. Sometimes though the rollback happens befor the app even sees the message. For example, if the message cannot be converted to the local code page, or other low-level error.If this is what is happening, the answer is to define a backout queue and then alter the input queue to point at it. For example, if the input queue is calledSRC.RECEIVER.QUEUEyou might do something like this on the QMgr usingrunmqsc:DEFINE QL(SRC.RECEIVER.QUEUE.BKOUT)\nALTER QL(SRC.RECEIVER.QUEUE) BOQNAME(SRC.RECEIVER.QUEUE.BKOUT) BOTHRESH(15)If the problem really is a poison message, the problem message will show up in the backout queue as an uncommitted message. As soon as the app issues the nextCOMMITagainst the source queue, the backout message will become visible in the backout queue. If no other message arrives on the source queue, the poison message will either remain uncommitted in the backout queue or possibly revert to the source queue ifROLLBACKis called by the app or QMgr.The setup of the backout queue is simple to do and should be standard practice so I'd recommend doing it whether or not it resolves the problem. Please seeHandling poison messages in WebSphere MQ classes for JMSin the Infocenter.\n"} +{"text": "### Human: I'm trying to write a small application which connects to a Queue Manager and issues some commands on it, in Java.From what I have read in the documentation, I understand that one must issue commands by sending them in the \"SYSTEM.ADMIN.COMMAND.QUEUE\" queue.However, the reply queue defined byreplyToQueueNameis still empty after execution.Is there something I missed ?Here is a stripped-down version of the code :MQQueueManager qMgr = new MQQueueManager(\"SOME_HOSTNAME\");\n\nMQQueue qOut = qMgr.accessQueue(\"SYSTEM.ADMIN.COMMAND.QUEUE\", MQC.MQOO_OUTPUT);\nMQQueue qIn = qMgr.accessQueue(\"SYSTEM.DEFAULT.LOCAL.QUEUE\", MQC.MQOO_INPUT_AS_Q_DEF);\n\nMQMessage message = new MQMessage();\nmessage.writeUTF(\"DISPLAY QMGR ALL\");\nmessage.messageType = MQC.MQMT_REQUEST;\nmessage.format = MQC.MQFMT_STRING;\nmessage.replyToQueueName = \"SYSTEM.DEFAULT.LOCAL.QUEUE\";\n\nqOut.put(message, new MQPutMessageOptions());\n\nMQMessage retrievedMessage = new MQMessage();\nMQGetMessageOptions gmo = new MQGetMessageOptions();\ngmo.options = MQC.MQGMO_WAIT | MQC.MQGMO_CONVERT;\n\nqIn.get(retrievedMessage, gmo);### Assistant: The Command Processor expects to receive messages in Programmable Command Format (PCF) format. Please see thecom.ibm.mq.pcfclasses and theProgrammable Command Formats and Administration Interfacemanual.Depending on the version of MQ client you are using, you may need to download the PCF Java classes fromSupportPac MS0B. However, it is strongly encouraged to develop using the latest MQ client. The current client will always work with earlier WMQ server versions V7 and fall back to the level of functionality available on those platforms. This ensures that at least your client classes are supported, whereas an older version such as V5.3 or V6 are not.The V7.0 MQ client is available asSupportPac MQC7.The V7.5 MQ client is available asSupportPac MQC75.The V8.0 MQ client is available asSupportPac MQC80.\n"} +{"text": "### Human: I'm connecting to an IBM Websphere MQ. I want to be able to match the reply message with the correct request message. I've trawled through hundreds of pages to get this and have had no luck.I have a class - MQHandler - which sends a message to one defined queue, and reads the request from another. This works fine, however, if multiple users are using the application at the same time, messages get mixed up.I can't seem to get a method on the receiver to indicate the CorrelationID to match.\nSomething like...consumer.receive( selector );Can you check the below methods to ensure I'm doing this correctly?/**\n * When the class is called, this initialisation is done first.\n * \n * @throws JMSException\n */\npublic void init() throws JMSException\n{\n // Create a connection factory\n JmsFactoryFactory ff;\n try\n {\n ff = JmsFactoryFactory.getInstance( WMQConstants.WMQ_PROVIDER );\n cf = ff.createConnectionFactory();\n\n // Set the properties\n cf.setStringProperty( WMQConstants.WMQ_HOST_NAME, hostServer );\n cf.setIntProperty( WMQConstants.WMQ_PORT, 1414 );\n cf.setStringProperty( WMQConstants.WMQ_CHANNEL, channel );\n cf.setIntProperty( WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT );\n cf.setStringProperty( WMQConstants.WMQ_QUEUE_MANAGER, qManager );\n\n connection = cf.createConnection();\n\n session = connection.createSession( false, Session.AUTO_ACKNOWLEDGE );\n }\n catch( JMSException e )\n {\n throw e;\n }\n\n} // end of init\n\n\n\n/**\n * @param request\n * @return\n * @throws JMSException\n */\nprivate String sendRequest( String request ) throws JMSException\n{\n\n // Create JMS objects\n Destination destination = session.createQueue( \"queue:///\" + writeQueueName );\n\n // Enable write of MQMD fields. See documentation for further\n // details.\n ((JmsDestination) destination).setBooleanProperty( WMQConstants.WMQ_MQMD_WRITE_ENABLED, true );\n\n // Set message context, if needed. See comment at the top.\n\n // Create a producer\n MessageProducer producer = session.createProducer( destination );\n\n // Create a message\n TextMessage message = session.createTextMessage( request );\n\n // Generate a custom message id\n message.setJMSCorrelationID( generateRandomID() );\n\n // Start the connection\n connection.start();\n\n // And, send the message\n producer.send( message );\n System.out.println(message);\n\n return message.getJMSCorrelationID();\n}\n\n\n/**\n * @param customMessageId\n * @return\n * @throws JMSException\n */\nprivate String recvResponse( String customMessageId ) throws JMSException\n{\n Destination destination = session.createQueue( \"queue:///\" + readQueueName );\n\n // Enable read of MQMD fields.\n ((JmsDestination) destination).setBooleanProperty( WMQConstants.WMQ_MQMD_READ_ENABLED, true );\n ((JmsDestination) destination).setObjectProperty( WMQConstants.JMS_IBM_MQMD_CORRELID, customMessageId );\n\n // Create a consumer\n MessageConsumer consumer = session.createConsumer( destination );\n\n // Start the connection\n connection.start();\n\n // And, receive a message from the queue\n TextMessage receivedMessage = (TextMessage)consumer.receive( 15000 );\n\n connection.close();\n session.close();\n\n return receivedMessage.getText();\n}Here is a snippet of the main method...try\n {\n String customMessageId;\n init();\n customMessageId = sendRequest( request );\n return recvResponse( customMessageId );\n }\n catch( Exception ex )\n {\n System.out.println( \"Error on MQ.\" );\n throw new Exception( \"\\n\\n*** An error occurred ***\\n\\n\" + ex.getLocalizedMessage()\n + \"\\n\\n**********************************\" );\n }### Assistant: QueueReceiver queueReceiver = \n session.createReceiver(destination, \"JMSCorrelationID='customMessageId'\");\n\nTextMessage receivedMessage = (TextMessage)queueReceiver.receive( 15000 );In my example, customMessageId should contain the actual value you have previously set.Also, I have seen many cases where people generate a correlationID and set it in the outbound message expecting to be able to select the response based on that value. The textbook way to do this is for the service provider app to copy the message ID to the correlation ID when responding. The requestor would still specify the JMSCorrelationID as the selector but would use the original JMSMessageID as the value. Since the JMSMessageID is guaranteed to be unique even across QMgrs, you are MUCH less likely to get collisions on this value. You will need to insure that your client matches the behavior of the service provider with respect to which value gets copied into the correlation ID.\n"} +{"text": "### Human: I have a .NET application that needs to monitor a queue in WebSphere MQ. I need to react to each message without impacting the current process. The client application can't explicity send me the same message.Can I read a message without removing it from the queue? Can I be notified for each message? Can I configure the MQ to duplicate the current queue?Is there another solution?### Assistant: If you are using WMQ v7 then you can do this without any impact to the existing applications other than to change the queue name for one of them.Currently the message producer and consumer use the same queue. In v7 of WMQ you can create an alias over a topic so that the message producer thinks it's a queue. Then you can create two administrative, durable subscriptions such that one points to the existing input queue and another points to a queue dedicated to your new application.Of course you are already using v7 since v6 goes out of service next year, right? You can upgrade the QMgr to v7 which enables this behavior while still using v6 client code for the apps.If you are using WMQ v6 then theMirrorQ programmight work for you.\n"} +{"text": "### Human: I'm forwarding my IBM MQ v9.1 error logs using splunk forwarder to a centralized cluster to see trends on common error occurring across my distributed messaging systems.However I'm unable to parse the required fields, since the format of MQ error logs are varying i.e. the severity of the messages could be error, warning, informational, severe and termination and each have different set of fields in itself and are not consistent.Please let me know if anyone have used regex in splunk for parsing the fields of IBM MQ error logs for v9.1.I have tried few regex patterns but it wasn't parsing as expected.I have already referred below link, but that is for v8 and there is a different in format of error logs for v9,https://t-rob.net/2017/12/18/parsing-mq-error-logs-in-splunk/Also the splunk user is unable to access the error logs. I have updated below stanza in qm.ini \nFilesystem: \n ValidateAuth=Noalso set chmod -R 755 to /var/mqm/qmgrs/qmName/errors folder.Though the permissions for the ERROR logs doesn't change whenever it gets updated, when the logs rotate the permissions are revoked and splunk user is not able to read the logs.Please let me know how to overcome this without adding splunk user to mqm group### Assistant: I would suggest enabling JSON logging and forward those logs to Splunk which should be able to parse this format.In IBM MQ v9.0.4 CDS release IBM added the ability to log out to a JSON formatted log, MQ will always log to the original AMQERR0x.LOG files even if you enable the JSON logging. This is included in all MQ 9.1 LTS and CSD releases.The IBM MQ v9.1 Knowledge Center PageIBM MQ>Configuring>Changing IBM MQ and queue manager configuration information>Attributes for changing queue manager configuration information>Diagnostic message logging>Diagnostic message service stanzas>Diagnostic message serviceshas information on the topic. You can add the following to yourqm.inito have it output the log information to a JSON formatted file calledAMQERR0x.jsonin the standard queue managererrorsdirectory:DiagnosticMessages:\n Service = File\n Name = JSONLogs\n Format = json\n FilePrefix = AMQERRAs noted by the OP the JSON formatted logs do not contain theEXPLANATIONorACTIONportion that you see in the normal logs.In IBM MQ v9.1 you can use themqrccommand to convert the JSON format to the familiar format you see inAMQERR01.LOG.One simple example is below:cat <' for channel '' closed.\n\nEXPLANATION:\nAn error occurred receiving data from '' over . The\nconnection to the remote host has unexpectedly terminated.\n\nThe channel name is ''; in some cases it cannot be determined and\nso is shown as '????'.\n\nACTION:\nTell the systems administrator.You could take it further and specify the inserts from the JSON:Exmple portion of the JSON log:\"ibm_messageId\":\"AMQ9209E\",\"ibm_arithInsert1\":0,\"ibm_arithInsert2\":0,\"ibm_commentInsert1\":\"localhost (127.0.0.1)\",\"ibm_commentInsert2\":\"TCP/IP\",\"ibm_commentInsert3\":\"SYSTEM.DEF.SVRCONN\"In the command below eachibm_arthInsertis specified with a proceeding-nflag in order following by eachibm_commentInsertwith a proceeding-cflag:mqrc AMQ9209E -n 0 -n 0 -c \"localhost (127.0.0.1)\" -c \"TCP/IP\" -c \"SYSTEM.DEF.SVRCONN\"The output is below:536908297 0x20009209 rrcE_CONNECTION_CLOSED\n 536908297 0x20009209 urcMS_CONN_CLOSED\n\nMESSAGE:\nConnection to host 'localhost (127.0.0.1)' for channel 'SYSTEM.DEF.SVRCONN'\nclosed.\n\nEXPLANATION:\nAn error occurred receiving data from 'localhost (127.0.0.1)' over TCP/IP. The\nconnection to the remote host has unexpectedly terminated.\n\nThe channel name is 'SYSTEM.DEF.SVRCONN'; in some cases it cannot be determined\nand so is shown as '????'.\n\nACTION:\nTell the systems administrator.\n"} +{"text": "### Human: I am trying to install pymqi on windows 64-bit machine.\"pip install pymqi\" gives an errorCollecting pymqi\n Using cached https://files.pythonhosted.org/packages/15/d9/b5babbd3f296b47a9d8bca417ca185ede9e8780ce4ca6b66bbf2dd1b7880/pymqi-1.9.2.tar.gz\nInstalling collected packages: pymqi\n Running setup.py install for pymqi ... error\n Complete output from command C:\\Users\\xxxxxxxxx\\.virtualenvs\\BBG_IBM_MQ_connection\\Scripts\\python.exe -u -c \"import setuptools, tokenize;__file__='C:\\\\Users\\\\xxxxxxxxx\\\\AppData\\\\Local\\\\\nTemp\\\\pip-install-1qy7i0yt\\\\pymqi\\\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\\r\\n', '\\n');f.close();exec(compile(code, __file__, 'exec'))\" install --recor\nd C:\\Users\\xxxxxxxxx\\AppData\\Local\\Temp\\pip-record-hhuxyqkh\\install-record.txt --single-version-externally-managed --compile --install-headers C:\\Users\\xxxxxxxxx\\.virtualenvs\\BBG_IBM_MQ_con\nnection\\include\\site\\python3.7\\pymqi:\n Building PyMQI client 64bits\n running install\n running build\n running build_py\n creating build\n creating build\\lib.win-amd64-3.7\n creating build\\lib.win-amd64-3.7\\pymqi\n copying pymqi\\__init__.py -> build\\lib.win-amd64-3.7\\pymqi\n copying pymqi\\CMQC.py -> build\\lib.win-amd64-3.7\\pymqi\n copying pymqi\\CMQCFC.py -> build\\lib.win-amd64-3.7\\pymqi\n copying pymqi\\CMQXC.py -> build\\lib.win-amd64-3.7\\pymqi\n copying pymqi\\CMQZC.py -> build\\lib.win-amd64-3.7\\pymqi\n running build_ext\n building 'pymqi.pymqe' extension\n creating build\\temp.win-amd64-3.7\n creating build\\temp.win-amd64-3.7\\Release\n creating build\\temp.win-amd64-3.7\\Release\\pymqi\n C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.21.27702\\bin\\HostX86\\x64\\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYQMI_SERVERBUILD=0 \"-Ic:\\Program Fi\nles (x86)\\IBM\\WebSphere MQ\\tools\\c\\include\" -IC:\\Users\\xxxxxxxxx\\.virtualenvs\\BBG_IBM_MQ_connection\\include -IC:\\Users\\xxxxxxxxx\\AppData\\Local\\Programs\\Python\\Python37\\include -IC:\\Users\\\nxxxxxxxxx\\AppData\\Local\\Programs\\Python\\Python37\\include \"-IC:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.21.27702\\include\" /Tcpymqi/pymqe.c /Fobuild\\temp.\nwin-amd64-3.7\\Release\\pymqi/pymqe.obj\n pymqe.c\n pymqi/pymqe.c(78): fatal error C1083: Cannot open include file: 'cmqc.h': No such file or directory\n error: command 'C:\\\\Program Files (x86)\\\\Microsoft Visual Studio\\\\2019\\\\Community\\\\VC\\\\Tools\\\\MSVC\\\\14.21.27702\\\\bin\\\\HostX86\\\\x64\\\\cl.exe' failed with exit status 2\n\n ----------------------------------------\nCommand \"C:\\Users\\xxxxxxxxx\\.virtualenvs\\BBG_IBM_MQ_connection\\Scripts\\python.exe -u -c \"import setuptools, tokenize;__file__='C:\\\\Users\\\\xxxxxxxxx\\\\AppData\\\\Local\\\\Temp\\\\pip-install-1qy7i0\nyt\\\\pymqi\\\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\\r\\n', '\\n');f.close();exec(compile(code, __file__, 'exec'))\" install --record C:\\Users\\xxxxxxxxx\\AppD\nata\\Local\\Temp\\pip-record-hhuxyqkh\\install-record.txt --single-version-externally-managed --compile --install-headers C:\\Users\\xxxxxxxxx\\.virtualenvs\\BBG_IBM_MQ_connection\\include\\site\\pyt\nhon3.7\\pymqi\" failed with error code 1 in C:\\Users\\xxxxxxxxx\\AppData\\Local\\Temp\\pip-install-1qy7i0yt\\pymqi\\I tried to install \"python-dev\" as I read for pymqi installation, python-dev is necessary. But it is also giving an error and after searching for that error, got to know from this forum that \"python-dev\" doesn't exist for windows.Can I get help on this?### Assistant: Download MQ client libraries from this link:https://ibm.biz/IBM-MQC-Redist-Win64zipOnce downloaded and extracted, you will find thecmqc.hfile in this location:9.3.0.0-IBM-MQC-Redist-Win64\\tools\\c\\includeCreate a new folder on yourC:drive:C:\\Program Files (x86)\\IBM\\WebSphere MQCopy the tools subfolder9.3.0.0-IBM-MQC-Redist-Win64\\tools\\c\\includetoC:\\Program Files (x86)\\IBM\\WebSphere MQNow run:pip install pymqiThe output should be similar to this:C:\\Windows\\system32>pip install pymqi\nCollecting pymqi\n Using cached pymqi-1.12.8.tar.gz (88 kB)\n Preparing metadata (setup.py) ... done\nUsing legacy 'setup.py install' for pymqi, since package 'wheel' is not installed.\nInstalling collected packages: pymqi\n Running setup.py install for pymqi ... done\nSuccessfully installed pymqi-1.12.8For me it worked. Please give it a try and let me know if it worked for you.\n"} +{"text": "### Human: I have problem connecting to IBM MQ8.0 from Java client when SSL enabled at client channel(SVRCONN). When SSL is disabled(SSLAUTH to OPTIONAL) at channel, the flow is working fine.Client is java with JRE1.7. MQ server version is IBM MQ8.0Created self-signed certificates and exchanged properly as per MQ setup references.javax.net.debug=ssl option cofirms in the log that certificate exchange and SSL handshake is successful.But when java client code is trying to get MQManager object, following MQ Exception thrown.com.ibm.mq.MQException: MQJE001: Completion code '2', reason '2059' ...\n\ncaused by: com.ibm.jmqi.JmqiException: CC=2;RC=2059;AMQ9204: Connection to host '1.2.3.4(1414)' rejected. [1=com.ibm.jmqi.JmqiException[CC=2;RC=2059;AMQ9503: Channel negotiation failed. [3=CHANNEL.SVRCONN.SSL]],3=1.2.3.4(1414), 5=RemoteConnection.analyseSegment] ...\n\ncaused by: com.ibm.jmqi.JmqiException: CC=2;RC=2059;AMQ9503: Channel negotiation failed. [3=CHANNEL.SVRCONN.SSL]I have configured to use TLS_RSA_WITH_AES_256_CBC_SHA256 as cipherspec in both client side and MQ client channel(SVRCONN).Tried with other cipherspecs like TLS_RSA_WITH_AES_128_CBC_SHA, error remains same.MQ server error log has AMQ9665: SSL connection closed by remote end of channel '????' \n\nExplanation: The SSL or TLS connection was closed by the remote host '5.6.7.8' during the secure socket handshake. The channel is '????', in some cases its name can not be determined and so is shown as '????'. The chanel didn't start. \n\nACTION: Check the remote end of for SSL and TLS errors. Fix them and restart the channel.But remote side, I have only java client which is uses MQ libraries to connect to MQ server.SSLLog Page-4SSLLog Page-5Not able to get data from server, so added image of last 2 pages from SSL logs.MQ server side logs are already given above. Along with there is a default log AMQ9999: Channel '????' to host 1.2.3.4 ended abnormally. \nThe same error is getting logged repeatedly with . Didn't find any other logs.MQ client code snippet below.void connect2MQ()\n{\n MQEnvironment.hostname=1.2.3.4\n MQEnvironment.port=1414\n MQEnvironment.channel=CLIENT.SVRCONN.SSL\n if(SSLEnabled.equals(\"Y\") // It is set to 'Y' in main method\n {\n MQEnvironment.sslCipherSuit=\"TLS_RSA_WITH_AES_128_CBC_SHA\";\n System.setProperty(\"javax.net.ssl.truststore\",\"trustStoreCertFilePath\");\n System.setProperty(\"javax.net.ssl.keyStore\",\"keyStoreCertFilePath\");\n System.setProperty(\"javax.net.ssl.trustStorePassword\",\"Pass\");\n System.setProperty(\"javax.net.ssl.keyStorePassword\",\"Pass\");\n System.setProperty(\"javax.net.ssl.trustStoreType\",\"JKS\");\n System.setProperty(\"javax.net.ssl.keyStoreType\",\"JKS\");\n }\n\n try {\n MQQueueManager qmgr = new MQQueueManager(\"QMGR.TEST.SSL\"); // Exception is thrown from here\n ...\n }### Assistant: It appears you are hitting the issue described in APARIT10837. This is fixed in the 8.0.0.5 and later MQ Classes for Java and MQ Classes for JMS client jar files, I would suggest moving to 8.0.0.7 which is the latest v8 version.The error messages don't match but the symptoms of it working withSSLCAUTH(OPTIONAL)and not working withSSLCAUTH(REQUIRED)matches up as does the version you are running not having the fix.There is a IBM developerWorks MQdev Blog by Tom Leend titled \"MQ Java, TLS Ciphers, Non-IBM JREs & APARs IT06775, IV66840, IT09423, IT10837 -- HELP ME PLEASE!which describes a work around if you are not at a level of MQ that has the fix.---- Code Snippet Start ----\nKeyStore keyStore = KeyStore.getInstance(\"JKS\");\njava.io.FileInputStream keyStoreInputStream = new java.io.FileInputStream(\"/home/tom/myKeyStore.jks\");\nkeyStore.load (keyStoreInputStream, password_char_array);\n\nKeyStore trustStore trustStore = KeyStore.getInstance (\"JKS\");\njava.io.FileInputStream trustStoreInputStream = new java.io.FileInputStream(\"/home/tom/myTrustStore.jks\");\ntrustStore.load (trustStoreInputStream, password_char_array);\n\nkeyStoreInputStream.close();\ntrustStoreInputStream.close();\n\nKeyManagerFactory keyManagerFactory = \n KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());\nTrustManagerFactory trustManagerFactory = \n TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());\nkeyManagerFactory.init(keyStore,password);\ntrustManagerFactory.init(trustStore);\n\nSSLContext sslContext = SSLContext.getInstance(\"TLSv1\"); \nsslContext.init(keyManagerFactory.getKeyManagers(), \n trustManagerFactory.getTrustManagers(), \n null);\nSSLSocketFactory sslSocketFactory = sslContext.getSocketFactory(); \n\n// classes for JMS\n//myJmsConnectionFactory.setObjectProperty(\n// WMQConstants.WMQ_SSL_SOCKET_FACTORY, sslSocketFactory);\n\n// classes for Java\nMQEnvironment.sslSocketFactory = sslSocketFactory;\n---- Code Snippet End ----\n"} +{"text": "### Human: Received signed certificate, installed in windows user cert. store with the public key from MQ, but getting MQRC_Q_MGR_NOT_AVAILABLE error? \n What's missing?EDITOne more question - where certificates should be placed to be available using### Assistant: Looking at the comments and question i see you mentionReceived signed certificate, installed in windows user cert store with the public key from MQandwhen SSL is optional on the server it all magically worksFrom this i believe you are trying to connect a client into your Queue Manager where the client application has it's own certificate. Because you have not specified a certificate for the client to use i don't believe the client is connecting with the (signed) certificate you added to the windows certificate store. This is why it works when the SSL is set to optional but does not work when the SSL is set to required. (Assuming you are talking about the SSLCAUTH attribute on the channel)Fromthis knowledge center pagei believe you need to add the following:replacingcertificatelabelwith the label of the certificate you want the client to use.\n"} +{"text": "### Human: I am fairly new to Spring and Spring Batch, so feel free to ask any clarifying questions if you have any.I am seeing an issue with Spring Batch that I cannot recreate in our test or local environments. We have a daily job that connects to Websphere MQ via JMS and retrieves a set of records. This job uses the out-of-the-box JMS ItemReader. We implement our own ItemProcessor, but it doesn't do anything special other than logging. There are no filters or processing that should affect incoming records.The problem is that out of the 10,000+ daily records on MQ, only about 700 or so (the exact number is different each time) usually get logged in the ItemProcessor. All records are successfully pulled off the queue. The number of records logged is different each time and seems to have no pattern. By comparing the log files against the list of records in MQ, we can see that a seemingly random subset of records are being \"processed\" by our job. The first record might get picked up, then 50 are skipped, then 5 in a row, etc. And the pattern is different each time the job runs. No exceptions are logged either.When running the same app in localhost and test using the same data set, all 10,000+ records are successfully retrieved and logged by the ItemProcessor. The job runs between 20 and 40 seconds in Production (also not constant), but in test and local it takes several minutes to complete (which obviously makes sense since it is handling so many more records).So this is one of those tough issue to troubleshoot since we cannot recreate it. One idea is to implement our own ItemReader and add additional logging so that we can see if records are getting lost before the reader or after the reader - all we know now is that only a subset of records are being handled by the ItemProcessor. But even that will not solve our problem, and it will be somewhat timely to implement considering it is not even a solution.Has anyone else seen an issue like this? Any possible ideas or troubleshooting suggestions would be greatly appreciated. Here are some of the jar version numbers we are using for reference.Spring - 3.0.5.RELEASESpring Integration - 2.0.3.RELEASESpring Batch - 2.1.7.RELEASEActive MQ - 5.4.2Websphere MQ - 7.0.1Thanks in advance for your input.EDIT: Per request, code for processor:public SMSReminderRow process(Message message) throws Exception {\n\n SMSReminderRow retVal = new SMSReminderRow();\n LOGGER.debug(\"Converting JMS Message to ClaimNotification\");\n ClaimNotification notification = createClaimNotificationFromMessage(message);\n\n retVal.setShortCode(BatchCommonUtils\n .parseShortCodeFromCorpEntCode(notification.getCorpEntCode()));\n retVal.setUuid(UUID.randomUUID().toString());\n retVal.setPhoneNumber(notification.getPhoneNumber());\n retVal.setMessageType(EventCode.SMS_CLAIMS_NOTIFY.toString());\n\n DCRContent content = tsContentHelper.getTSContent(Calendar\n .getInstance().getTime(),\n BatchCommonConstants.TS_TAG_CLAIMS_NOTIFY,\n BatchCommonConstants.TS_TAG_SMSTEXT_TYP);\n\n String claimsNotificationMessage = formatMessageToSend(content.getContent(),\n notification.getCorpEntCode());\n\n retVal.setMessageToSend(claimsNotificationMessage);\n retVal.setDateTimeToSend(TimeUtils\n .getGMTDateTimeStringForDate(new Date()));\n\n LOGGER.debug(\n \"Finished processing claim notification for {}. Writing row to file.\",\n notification.getPhoneNumber());\n return retVal;\n}JMS config:\n\n\n \n \n \n \n\n\n\n\n\n \n\n\n \n \n \n \n false\n \n \n 20000\n \n### Assistant: As a rule, MQ will NOT lose messages when properly configured. The question then is what does \"properly configured\" look like?Generally, lost messages are caused by non-persistence or non-transactional GETs.If non-persistent messages are traversing QMgr-to-QMgr channels andNPMSPEED(FAST)is set then MQ will not log errors if they are lost. That is what those options are intended to be used for so no error is expected.Fix: SetNPMSPEED(NORMAL)on the QMgr-to-QMgr channel or make the messages persistent.If the client is getting messages outside of syncpoint, messages can be lost. This is nothing to do with MQ specifically, it's just how messaging in general works. If you tell MQ to get a message destructively off the queue and it cannot deliver that message to the remote application then the only way for MQ to roll it back is if the message was retrieved under syncpoint.Fix: Use a transacted session.There are some additional notes, born out of experience.Everyone swears message persistence is set to what they think it is. But when I stop the application and inspect the messages manually itveryoften isnotwhat is expected. It's easy to verify so don't assume.If a message is rolled back on the queue, it won't happen until MQ or TCP times out the orphan channel This can be up to 2 hours so tune the channel parms and TCP Keepalive to reduce that.Check MQ's error logs (the ones at the QMgr not the client) to look for messages about transactions rolling back.If you still cannot determine where the messages are going, try tracing withSupportPac MA0W. This trace runs as an exit and it isextremelyconfigurable. You can trace allGEToperations on a single queue and only that queue. The output is in human-readable form.\n"} +{"text": "### Human: I want to build a publish/subscribe program to compute matrix manipulation on a cluster.When a publisher send a message to a topic, message copies to all subscribers.I want a copy of message send to one subscriber and the message deletes and not send to other subscribers.### Assistant: There are two ways to do this.Make an administrative subscription and have all subscribers read messages off the queue to which the subscription points.Use MQ V8.0, the new JMS 2.0 interface, and theShared Subscriptionfeature.Note that in both of these cases, all subscribers are connected to the same queue manager. Although Pub/Sub creates a single logical message, when it is broadcast to other queue managers it becomes multiple physical messages and their consumption by subscribers is not coordinated across the network.\n"} +{"text": "### Human: I am trying to use Websphere MQ (without WAS) as the XA transaction coordinator for my java application between MQ and Oracle 11g.Is it possible? Is it a good practice?I have installed the MQ V7.0.1 server on my windows (64bit win7) and config the XA resource manager properly. However when my simple java code start a transaction and blackout it, only the message on the queue can rollback but DB operation can not rollback. I expect both of them can rollback together.My simple java code like belowQueueManager qmgr = new QueueManager(QM_NAME, properties);.....JdbcConnection conn = qmgr.getJdbcConnection(xads);qmgr.begin();// do DB operation and put message to queueqmgr.backout();conn.close();However only the 'put message' can rollback, while the DB operation can not.I am a newbie for MQ, Do you have any idea to resolve this issue? Any input is highly appreciate!### Assistant: TheDetailed System Requirementspage says that this is supported, but with some combinations it is necessary to have installed Fix Pack 7.0.1.2 or 7.0.1.3 to work. Please see the section of the page entitledResource Manager\u200bs (when MQ is the Transaction Manager)\u200bfor details.The Fix Packs can be downloadedfrom here.The documentation to enable XAis here.\n"} +{"text": "### Human: I'm building a spring-websocket application that currently uses RabbitMQ as a message broker via the STOMP protocol. The rest of our organization mostly uses IBM Websphere MQ as a message broker, so we'd like to convert it away from RabbitMQ. However Websphere MQ doesn't support the STOMP protocol, which is spring-websocket's default. MQTT seems like the easiest supported protocol to use instead. Ideally our front-end web clients will continue to use STOMP, but I'm also OK with migrating them to MQTT if needed.What classes do I need to overwrite to make spring-websocket interface with the broker via MQTT instead of STOMP?This articleprovides some general guidance that I should extendAbstractMessageBrokerConfiguration, but I'm unclear where to begin.Currently I'm using the standard configuration methods:registry.enableStompBrokerRelayandregisterStompEndpointsinAbstractWebSocketMessageBrokerConfigurer### Assistant: Ryan has some good pointers.The main work is going to be creating a replacement for StompBrokerRelayMessageHandler with an MqttBrokerMessageHandler that not only talks to an MQTT broker but also adapts client STOMP frames to MQTT and vice versa. The protocols are similar enough that it may be possible to find common ground but you won't know until you try.Note that we did have plans for for MQTT supporthttps://jira.spring.io/browse/SPR-12581but the key issue was that SockJS which is required over the Web for fallback support does not support binary messages.\n"} +{"text": "### Human: somebody can help me in configuring Websphere MQ Server in WAS 8.5?I got the below error while creating the WAS MQ Server.Error: WebSphere MQ server MQSERVER connection test failed for WebSphere MQ queue manager MQSERVER. CWSJP0050E: An attempt to connect to WebSphere MQ queue manager or queue sharing group MQSERVER failed. The WebSphere MQ reason code is Unknown (2538)..### Assistant: MQRC 2538 means \"host not available\". Check the host name and port name that you have specified and is pointing to the machine where MQ queue manager \"MQSERVER\" is running.Check on which port your queue manager is listening. You can do that by using MQExplorer or runmqsc command shell on the machine where you queue manager is running. In a command prompt, run the following commandrunmqsc MQSERVEROnce the runmqsc shell opens run the following command to list TCP listener.dis listener(SYSTEM.DEFAULT.LISTENER.TCP)Check the PORT number displayed. By default it will be 0. You need to change this to some port number. To change the port number run the following command.alter listner(SYSTEM.DEFAULT.LISTENER.TCP) port(1414)Once this is done you need to start the listener by running the following commandstart listener(SYSTEM.DEFAULT.LISTENER.TCP)After this you can attempt your tests.\n"} +{"text": "### Human: I need to change the C++ code to connect with WebSphere MQ using Client Channel defnition table. There are about 5000+ MQ clients and 10 MQ Servers on Windows 2003 with v6.0. Please help me if any one using C++ with CCDT.### Assistant: Set the MQCHLLIB and MQCHLTAB environment variables to point to the channel table as described in \"Using WebSphere MQ environment variables.\" Next, set SSLKEYR as described in the same section of the manual. These will allow the app to find the CCDT and the KDB files. Be sure that the CCDT contains channel definitions which specify the right SSLCIPH and then connect as usual. No code changes should be required.A word of advice, use the WMQ v7 client, even though the server is at v6. The client is backward compatible as long as you do not try to use the v7 features like automatic reconnect. However, v6 is end-of-life next year and if you want to avoid retesting and redeployment - or running an unsupported version - deploy as much as possible on v7 components.\n"} +{"text": "### Human: I am currently building a Mule ESB server application which uses a request-response jms connector. Since it is being used in a highly concurrent environment, we enabled spring jms cache in our MQ config.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \nThis configuration runs fine when the client uses a static replyTo queue. However, we have some customers who are using dynamic/temporary replyTo queue. Sinceorg.springframework.jms.connection.CachingConnectionFactorycaches producers, for every temporary replyTo queue, a producer object is cached and never closed. After processing hundreds of requests, the application started throwing exceptions:********************************************************************************\nMessage : Failed to create and dispatch response event over Jms destination \"queue://QMGR1/TESTret5a975v53AF980F2006BE02?targetClient=1\". Failed to route event via endpoint: null. Message payload is of type: JMSTextMessage\nCode : MULE_ERROR-42999\n--------------------------------------------------------------------------------\nException stack is:\n1. MQJE001: Completion Code 2, Reason 2017 (com.ibm.mq.MQException)\n com.ibm.mq.MQQueueManager:2808 (null)\n2. MQJMS2008: failed to open MQ queue TESTret5a975v53AF980F2006BE02(JMS Code: MQJMS2008) (javax.jms.ResourceAllocationException)\n com.ibm.mq.jms.MQQueueServices:398 (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/jms/ResourceAllocationException.html)\n3. Failed to create and dispatch response event over Jms destination \"queue://QMGR1/TESTret5a975v53AF980F2006BE02?targetClient=1\". Failed to route event via endpoint: null. Message payload is of type: JMSTextMessage (org.mule.api.transport.DispatchException)\n org.mule.transport.jms.JmsReplyToHandler:173 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transport/DispatchException.html)After investigating the MQ error code (MQJE001: Completion Code 2, Reason 2017), I found that the reason behind this error is because we never closed producers, and the producers exhausted MQ Handles on the Queue Manager. The quick and easy fix is to uncomment the line in spring jms cache config to close Producers each and every time.\n \n \n \n \nNow I am not seeing the MQ issue, but came up with another performance issue, because no producers are cached, so a new producer is created every single time.My question is, how to deal with this scenario? Since the client won't change the way they receive reply messages from temporary queues, how can we avoid exhausting MQ handlers without impacting the performance.Thank you very much\n- Lei### Assistant: This is a very interesting use case. However, I'm afraid there is nothing out of the box to fix this. There are the more obvious solutions: disable the caching or extend the spring cache provider.Temporary queues and performance are definitely not two things that you can have at the same time. I would suggest another posibility:If you are using the temporary queues to have the responses come back to a given consumer only, probably in adition to having old messages discarded on reconnection:You could use a well know queue for the replies, using a combination of a header with the hostname that should receive the message plus a selector different on each consumer node and a TTL on the messages sent to make them dissapear after a while.\n"} +{"text": "### Human: I am having problems testing the MQSC Adapter in BizTalk to communicate with a Queue on Z/OS Host.The test senario: While sending messages though Biztalk I (Force)stop and start the Host channel, to mimic a HOST IPL.In this scenario I experienced the following outcomes:Sometimes there are messages left uncomitted on the Host MQ.Even after the channel are started again. This way I don't know if the messages have been processed by Biztalk.QuestionIs there a way to make sure that messages are always committed on the Host MQ or still available on the MQ if not committedOnce I experienced duplicate messages and once that messages was lostSince these things happened only once each. I hope to find problems in my test applications / procedure.Not really a question, but if others have experienced the same errors I would like to know.The test SetupBiztalk 2009 on 2 nodesWebSphere MQ client 7.5.0.2 (Transactions supported)MSDTC -XA Transactionsare enabled (Edited to reflect comments)MS Biztalk Adapters for Host Systems 2.0Port ConfigurationReceive LocationSend Port### Assistant: If you are using MQ transactions, that is just MQPMO_SYNCPOINT and MQCMIT, then the disconnection (either explicitly or implicitly due toSTOP CHANNEL(chl-name) MODE(FORCE)) will cause any outstanding transaction to be completed (committed on an explicit disconnection, rolled-back on an implicit one).If you are using 2-PC transactions with a Transaction Manager (TM), then the transaction will need to be dealt with by the TM, depending on how far through it is, is it prepared already for example.\n"} +{"text": "### Human: When a local queue manager receives the following message in it's AMQ error log:09/13/12 08:00:19 - Process(3017.20) User(mqm) Program(amqrmppa_nd)\n AMQ9544: Messages not put to destination queue.EXPLANATION: During the processing of channel 'TO_QM_QD2T1_C1' one or\n more messages could not be put to the destination queue and attempts\n were made to put them to a dead-letter queue. The location of the\n queue is 2, where 1 is the local dead-letter queue and 2 is the remote\n dead-letter queue.... what is the mechanism by which MQ exchanges such information? Is there a built in facility within the channel program API itself, or is the info exchanges as discrete messages placed on theSYSTEM.CLUSTER.COMMAND.QUEUE(in the case of a cluster)? Given that this could occur in a remote queue definition situation, with only simple sender/receiver channel pairs, and no corresponding COMMAND QUEUE necessarily, I could imagine that it would be handled via the channel process communications... just wondering...### Assistant: The channel agents have a bi-directional communication between them, even though messages flow in only one direction. When a message fails to find the destination at the remote end there are several possibilities for what happens next. The channel will only continue to run if the message can be successfully putsomewhereand the first place to try is the remote DLQ. If that fails, the local MCA must either relocate the message or stop the channel. Therefore, the two message channel agents work out between them what happens and what the status of the channel should be.The peculiar wording of the error message reflects that the different dispositions of the message derive from within the same code path and exception handling and the optimization of WMQ. The MCA knows the message was put to a DLQ at that point and rather than having two different error messages or logic to work out the wording on which DLQ was used, it just drops a number into a template. Thus a single error message and streamlined logic are used for both possibilities.\n"} +{"text": "### Human: I've run into a frustrating problem browsing a queue all the way through its depth. I understood that the queue needs to be opened with the MQOO_BROWSE option among the open options. Then on the first read do a GET using the Get Messsage Option MQGMO_BROWSE_FIRST. Finally, the subsequent GET's should use the MQGMO_BROWSE_NEXT option.The problem is, my attempts worked only to retrieve the first message! Upon the second GET, even with MQGMO_BROWSE_NEXT, the method threw MQRC_NO_MSG_AVAILABLE, even though there were 5 messages in the queue!Here was the code I was using:IList Messages = new List();\n_queueManager = new MQQueueManager(QueueManagerName);\nint openOptions = MQC.MQOO_BROWSE // open queue for browsing\n_queue = QManager.AccessQueue(QueueName, openOptions);\n\nMQGetMessageOptions mqGetMsgOpts = new MQGetMessageOptions();\nmqGetMsgOpts.Options = MQC.MQGMO_BROWSE_FIRST;\n\nMQMessage msg = new MQMessage();\n\n_queue.Get(msg, mqGetMsgOpts);\nMQGetMessageOptions mqGetNextMsgOpts = new MQGetMessageOptions();\nmqGetNextMsgOpts.Options = MQC.MQGMO_BROWSE_NEXT;\n\ntry\n{\n while (true)\n {\n string messageText = msg.ReadString(msg.MessageLength);\n Messages.Add(messageText);\n _queue.Get(msg, mqGetNextMsgOpts);\n }\n}\ncatch (MQException ex)\n{\n // Handle it\n}### Assistant: This was frustrating, but I was able to rely upon questions and answers posted here on SO to verify that I was on the right path. Unfortunately, none of the answers addressed subsequent GETs with browse, and I was stumped. The answer came to me after trying a number of fruitless other paths, and it was very simple when I finally came to it. I decided to post the Q&A of my solution that worked.Apparently, once having done a GET into an MQMessage, unless you re-initialize it, the GET can't get the next message, and it throws the MQRC_NO_MSG_AVAILABLE exception immediately. Re-initializing the MQMessage instance before performing the GET solves the problem. I modified the code above by adding the needed line of code just before the GET in the while loop:while (true)\n{\n string messageText = msg.ReadString(msg.MessageLength);\n Messages.Add(messageText);\n msg = new MQMessage();\n _queue.Get(msg, mqGetNextMsgOpts);\n}Once I made this change, the routine browsed all the messages on the queue.\n"} +{"text": "### Human: IBM's advice doesn't work for me:http://www-01.ibm.com/support/docview.wss?uid=swg21454454### Assistant: Open file ...\\MQExplorer\\eclipse\\configuration\\config.ini and add this lines:org.osgi.framework.language=en\nosgi.nl=en_UScredits go to:http://blog.ondruska.com/2012/12/switch-eclipse-language.html\n"} +{"text": "### Human: I wrote a program to put messages into MQ . It works fine when I don't have SSL configuration in place. If I configure SSL in QueueManager and Channel, always getting An MQException occurred: Completion Code 2, Reason 2400\nMQJE011: Socket connection attempt refused. Tried with different cipher suite\nPlease advise how to resolve it.SSL properties :com.ibm.mq.MQEnvironment.sslCipherSuite = \"TLS_RSA_WITH_AES_256_GCM_SHA384\"; \nSystem.setProperty(\"javax.net.ssl.trustStore\", \"D:/keystore/testKS.jks\");\nSystem.setProperty(\"javax.net.ssl.trustStorePassword\", \"12345678\");\nSystem.setProperty(\"javax.net.ssl.keyStore\", \"D:/keystore/testKS.jks\");\nSystem.setProperty(\"javax.net.ssl.keyStorePassword\", \"12345678\");### Assistant: This answer specific to Java code .Java JREs, including Oracle/Sun and IBM's have Import Limits on Cryptographic Algorithms enabled. This limits the maximum key sizes and also some algorithms.When trying to use a AES 256 cipher, such asECDHE_RSA_AES_256_CBC_SHA384orTLS_RSA_WITH_AES_256_CBC_SHA256, you need to ensure JRE supports this cipher. In most cases, when the stronger cipher algorithms are needed, such as AES 256 ciphers, the JCE Unlimited Strength Jurisdiction Policy Files must be obtained and installed in the JDK/JRE.This is mentioned in the JDK/JRE documentation: For Oracle 1.7:http://docs.oracle.com/javase/7/docs/technotes/guides/security/SunProviders.htmlFor IBM JRE: ** Cipher suites that use AES_256 require installation of the JCE Unlimited Strength Jurisdiction Policy Files.http://www-01.ibm.com/support/knowledgecenter/SSYKE2_7.0.0/com.ibm.java.security.component.71.doc/security-component/jsse2Docs/ciphersuites.html?lang=enThis is similar to the issue noted with IBM MQ Explorer in :https://developer.ibm.com/answers/questions/187285/why-is-a-mqrc-ssl-initialization-error-displayed-w.htmlPlease updated this JAR File run with MSPKI and Cipher value \u201cTLS_RSA_WITH_AES_256_CBC_SHA\u201dNew policy jar which will support all the algorithms, you need to update jars into yourC:\\java-8\\jdk1_8_0\\jre\\lib\\securityhttp://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html\n"} +{"text": "### Human: I have to periodically check messages in a queue within Websphere MQ. I haven't found better approach rather than try getting a message and handle 2033 reason code (which is NO_MSG_AVAILABLE) like this:try\n{\n // ...\n inQueue.Get(message);\n}\ncatch (MQException exception)\n{\n if (exception.ReasonCode != 2033)\n throw;\n}Is there better way to get message from queue? I think that there might be some openOptions flag that I'm not aware of, that wouldn't throw exception when no message available, but return null instead.### Assistant: There are three ways to avoid or reduce this polling mechanism.\nHere they are in oder of elegance(the higher the better):MQGET with wait interval UNLIMITED and MQGMO_FAIL_IF_QUIESCINGGet your application be triggered by MQServerCallback function - new with MQ V7 on both sides\n"} +{"text": "### Human: I've installed WebSphere MQ 7.1 on Linux platform, after which I installed WebSphere Message Broker 8.0.0.1. Now when I try to create an execution group, I get an exception: Reason code 2035. This exception states that the user is unauthorised to connect to the queue manager. I have this user added in themqmgroup. I did not face any such issue when I was working with MQ 7.0.x. I searched a lot and came to know that there is user ID blocking in MQ 7.1. But, I want this user to be able to create execution group, how can I do so? Please advise.### Assistant: MQ security has been improved a lot in MQ v7.1 and is different from what it used to be in earlier MQ versions. In MQ v7.1, by default all SYSTEM.channels are blocked. If you are trying to use any of these SYSTEM.channels then you will get 2035 which is MQRC_NOT_AUTHORIZED. The recommended way is to create your own SVRCONN channel for broker and create channel authentication records to allow the user to access queue manager.Please see thislinkfor detailed answers from T.Rob on similar issue.Update:A SVRCONN channel defines the endpoint of a queue manager meaning the connection information required by the clients to connect to a queue manager. Client applications use this type of channel to send and receive messages to/from a queue or a topic.Message Broker toolkit is GUI that you can use to administer message broker, for example creating execution groups, creating flow, deploying bar files etc. Toolkit is available on Windows and I guess it's available on Linux.I got to know that MB toolkit requires SYSTEM.BRK.CONFIG channel which is a SVRCONN channel to connect to queue manager. I am thinking this is the channel you will need to authorize to allow Message Broker to connect to MQ. Can you check if this is the case and if so create channel authentication record for that channel?\n"} +{"text": "### Human: I'm new to SpringBoot. Trying to build a simple non-web process where I listen to a MQ Queue and process the messages received. I tried various ways to acheive this in SB, but unfortunately I cant get the @JmsListener method to get called. No errors either & the process just waits.All the MQ Queue details are in application.propertiesI did verify there are messages in the Queue and I could retrieve them using the old MQ receiver way.I would like to know how & when does @JmsListener Annotation method gets called? I did try creating a JmsListenerContainerFactory and included it in the annotation params but made no difference.There are few examples similar to this, it looks simple but I just cant get it to work. Any suggestions are appreciated. Thanks.Main SpringBoot Class@SpringBootApplication\n@EnableJms\npublic class Application {\n\n public static void main(String[] args) {\n SpringApplication.run(Application.class, args);\n }\n\n}MQListener Class@Component\npublic class MQListener {\n @JmsListener(destination = \"${mq.queueName}\")\n public void receiveMessage(final Message message) throws JMSException{\n System.out.println(\"...Message Received...\");\n String messageData = null;\n if(message instanceof TextMessage) {\n TextMessage textMessage = (TextMessage)message;\n messageData = textMessage.getText();\n }\n }\n}MQConfiguration Class@Configuration\npublic class MQConfiguration {\n @Value(\"${mq.host}\")\n private String host;\n @Value(\"${mq.port}\")\n private Integer port;\n @Value(\"${mq.queue-manager}\")\n private String queueManager;\n @Value(\"${mq.channel}\")\n private String channel;\n @Value(\"{mq.queueName}\")\n private String queueName;\n @Value(\"${mq.receive-timeout}\")\n private long receiveTimeout;\n \n @Bean\n public MQQueueConnectionFactory mqQueueConnectionFactory() {\n MQQueueConnectionFactory mqQueueConnectionFactory = new MQQueueConnectionFactory();\n mqQueueConnectionFactory.setHostName(host);\n try {\n mqQueueConnectionFactory.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n mqQueueConnectionFactory.setChannel(channel);\n mqQueueConnectionFactory.setPort(port);\n mqQueueConnectionFactory.setQueueManager(queueManager);\n } catch (Exception e) {\n e.printStackTrace();\n }\n return mqQueueConnectionFactory;\n }\n}### Assistant: As you are using default settings for the MQ connection factory you don't actually need it. Instead you can use the default one that Spring Boot will create for you. You are also only expecting a text message so you can let Spring do the marshalling. In which case all you need is a message consumer derived from this example -https://github.com/ibm-messaging/mq-dev-patterns/tree/master/Spring-JMS/src/main/java/com/ibm/mq/samples/jms/spring/level101package ...\n\nimport org.apache.commons.logging.Log;\nimport org.apache.commons.logging.LogFactory;\nimport org.springframework.jms.annotation.JmsListener;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class MessageConsumer101 {\n protected final Log logger = LogFactory.getLog(getClass());\n\n @JmsListener(destination = \"${mq.queueName}\")\n public void receive(String message) {\n logger.info(\"\");\n logger.info( this.getClass().getSimpleName());\n logger.info(\"Received message is: \" + message);\n }\n}As you will be letting Spring Boot create the MQ container you need to provide settings inapplication.propertiesin the form -# MQ Connection settings\nibm.mq.queueManager=QM1 \nibm.mq.channel=DEV.APP.SVRCONN\nibm.mq.connName=localhost(1414)\n\n\n# Change the following lines as necessary. Set the ibm.mq.user\n# property to an empty string to send no authentication request.\nibm.mq.user=app\nibm.mq.password=passw0rdYou are more likely to want a custom listener than a custom connection factory, but if you do want to configure a ConnectionFactory different from the default, then use a configuration and message consumer derived from this example -https://github.com/ibm-messaging/mq-dev-patterns/tree/master/Spring-JMS/src/main/java/com/ibm/mq/samples/jms/spring/level114Configuration, you only need to set the properties that deviate from the default.package ...\n\nimport com.ibm.mq.jms.MQConnectionFactory;\nimport com.ibm.mq.samples.jms.spring.globals.handlers.OurDestinationResolver;\nimport com.ibm.mq.samples.jms.spring.globals.handlers.OurMessageConverter;\nimport com.ibm.mq.spring.boot.MQConfigurationProperties;\nimport com.ibm.mq.spring.boot.MQConnectionFactoryFactory;\nimport org.apache.commons.logging.Log;\nimport org.apache.commons.logging.LogFactory;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.jms.config.DefaultJmsListenerContainerFactory;\nimport org.springframework.jms.config.JmsListenerContainerFactory;\nimport org.springframework.jms.core.JmsTemplate;\nimport org.springframework.jms.support.QosSettings;\n\n\nimport javax.jms.DeliveryMode;\nimport javax.jms.JMSException;\n\n@Configuration\npublic class MQConfiguration114 {\n protected final Log logger = LogFactory.getLog(getClass());\n\n @Bean\n public MQConnectionFactory mqConnectionFactory() throws JMSException {\n MQConfigurationProperties properties = new MQConfigurationProperties();\n // Properties will be a mix of defaults, and those found in application.properties\n // under ibm.mq\n // Here we can override any of the properties should we need to\n MQConnectionFactoryFactory mqcff = new MQConnectionFactoryFactory(properties,null);\n MQConnectionFactory mqcf = mqcff.createConnectionFactory(MQConnectionFactory.class);\n return mqcf;\n }\n\n @Bean\n public JmsListenerContainerFactory myContainerFactory114() throws JMSException {\n DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();\n factory.setConnectionFactory(mqConnectionFactory());\n factory.setPubSubDomain(false);\n\n factory.setMessageConverter(new OurMessageConverter());\n factory.setDestinationResolver(new OurDestinationResolver());\n\n // reply Qos\n QosSettings rQos = new QosSettings();\n rQos.setPriority(2);\n rQos.setTimeToLive(10000);\n rQos.setDeliveryMode(DeliveryMode.NON_PERSISTENT);\n factory.setReplyQosSettings(rQos);\n\n return factory;\n }\n\n @Bean(\"myNonJmsTemplate114\")\n public JmsTemplate myNonJmsTemplate114() throws JMSException {\n JmsTemplate jmsTemplate = new JmsTemplate(mqConnectionFactory());\n jmsTemplate.setDestinationResolver(new OurDestinationResolver());\n jmsTemplate.setMessageConverter(new OurMessageConverter());\n\n return jmsTemplate;\n }Note: The listener container factory based on the customised connection factory. You need this step. Your message consumer then looks something like:package ...\n\nimport com.ibm.mq.samples.jms.spring.globals.data.OurData;\nimport org.apache.commons.logging.Log;\nimport org.apache.commons.logging.LogFactory;\nimport org.springframework.jms.annotation.JmsListener;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class MessageConsumer114 {\n protected final Log logger = LogFactory.getLog(getClass());\n\n @JmsListener(destination = \"${mq.queueName}\", containerFactory = \"myContainerFactory114\")\n public void receiveRequest(OurData message) {\n logger.info(\"\");\n logger.info( this.getClass().getSimpleName());\n logger.info(\"Received message of type: \" + message.getClass().getSimpleName());\n logger.info(\"Received message :\" + message);\n }\n}if you need to perform your own marshalling from JMSMessage objects then use a message consumer derived from this example (You only need a consumer and nothing else) -https://github.com/ibm-messaging/mq-dev-patterns/tree/master/Spring-JMS/src/main/java/com/ibm/mq/samples/jms/spring/level105package ...\n\nimport javax.jms.*;\n\nimport com.ibm.mq.samples.jms.spring.globals.Constants;\nimport com.ibm.mq.samples.jms.spring.globals.data.OurData;\nimport com.ibm.mq.samples.jms.spring.globals.data.OurOtherData;\nimport com.ibm.mq.samples.jms.spring.globals.utils.MessageUtils;\nimport org.apache.commons.logging.Log;\nimport org.apache.commons.logging.LogFactory;\nimport org.springframework.jms.annotation.JmsListener;\n\nimport org.springframework.stereotype.Component;\n\nimport java.io.Serializable;\n\n\n@Component\npublic class MessageConsumer105 {\n protected final Log logger = LogFactory.getLog(getClass());\n\n @JmsListener(destination = \"${app.l105.queue.name2}\")\n public void receiveData(Message message) {\n logger.info(\"\");\n logger.info( this.getClass().getSimpleName());\n logger.info(\"Received message of type: \" + message.getClass().getSimpleName());\n if (null != message) {\n MessageUtils.checkMessageType(message);\n }\n }\n}Wherepackage ...\n\nimport com.ibm.mq.samples.jms.spring.globals.Constants;\nimport com.ibm.mq.samples.jms.spring.globals.data.OurData;\nimport com.ibm.mq.samples.jms.spring.globals.data.OurOtherData;\nimport org.apache.commons.logging.Log;\nimport org.apache.commons.logging.LogFactory;\n\nimport javax.jms.*;\nimport java.io.Serializable;\nimport java.util.Map;\n\npublic class MessageUtils {\n protected static final Log logger = LogFactory.getLog(MessageUtils.class);\n\n private MessageUtils () {}\n\n public static void checkMessageType(Message message) {\n try {\n if (message instanceof TextMessage) {\n logger.info(\"Message matches TextMessage\");\n logger.info(\"message payload is \" + ((TextMessage) message).getText());\n } else if (message instanceof BytesMessage) {\n logger.info(\"Message matches BytesMessage\");\n } else if (message instanceof MapMessage) {\n logger.info(\"Message matches MapMessage\");\n } else if (message instanceof StreamMessage) {\n logger.info(\"Message matches StreamMessage\");\n } else if (message instanceof ObjectMessage) {\n checkForObject((ObjectMessage) message);\n }\n } catch (JMSException e) {\n logger.warn(\"Unable to process JMS message\");\n }\n }\n\n public static void logHeaders(Map msgHeaders) {\n if (! msgHeaders.isEmpty() ) {\n logger.info(\"\");\n logger.info(\"Headers found\");\n msgHeaders.forEach((k, v) -> {\n logger.info(k + \": is of type\" + v.getClass());\n });\n }\n }\n\n private static void checkForObject(ObjectMessage message) {\n try {\n int typeValue = message.getIntProperty(Constants.DATATYPE);\n if (Constants.DataTypes.OURDATATYPE.getValue() == typeValue) {\n logger.info(\"It is one of our objects\");\n Serializable serObj = message.getObject();\n OurData data = (OurData) serObj;\n logger.info(data);\n } else if (Constants.DataTypes.OUROTHERDATATYPE.getValue() == typeValue) {\n logger.info(\"It is one of our other objects\");\n Serializable serObj = message.getObject();\n OurOtherData data = (OurOtherData) serObj;\n logger.info(data);\n } else {\n logger.warn(\"It is not one of our objects\");\n }\n } catch (JMSException e) {\n logger.warn(\"Unable to retrieve message data\");\n } catch (ClassCastException e2) {\n logger.warn(\"Not the object we were expecting\");\n }\n }\n\n}If your consumer and configuration classes have the@Componentand@Configurationannotations and sit within the same package family, then they will be found, If not then you need to add some more annotations to the Application to get Spring to pick them up. eg.package ...\n\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.EnableAutoConfiguration;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\nimport org.springframework.context.annotation.ComponentScan;\nimport org.springframework.jms.annotation.EnableJms;\n\n\n@SpringBootApplication\n@EnableJms\n@ComponentScan\n@EnableAutoConfiguration\npublic class MQApplication {\n public static void main(String[] args) {\n SpringApplication.run(MQApplication.class, args);\n }\n}If you don't havespring.jms.listener.auto-startup=falsein your application.properties file then all the listeners will start automatically on application start.You will need to namemq-jms-spring-boot-starteras a dependency. Eg. if using maven :\n com.ibm.mq\n mq-jms-spring-boot-starter\n 2.4.1\n If this is the only JMS implementor then Spring Boot will be able to figure out that all your listeners are Using IBM MQ. If you have other JMS providers listed as dependancies, then Spring needs to be explicitly told which connection factories to use. There is a sample pom.xml with only the required dependancies in the sample athttps://github.com/ibm-messaging/mq-dev-patterns/blob/master/Spring-JMS/pom.xmlTry the 101 sample athttps://github.com/ibm-messaging/mq-dev-patterns/tree/master/Spring-JMSIt's maven based, has only the required dependancies listed in itspom.xmland all you will need to do is update theapplication.propertiesinhttps://github.com/ibm-messaging/mq-dev-patterns/tree/master/Spring-JMS/src/main/resourcesto point at your MQ server.\n"} +{"text": "### Human: I want to dump a message from a queue in WebSphere MQ which is installed on a linux machine. How could I check messages inside queues withmqmauthorized user? I have already checked insideopt/mqm/binand I found some MQ commands likedmpmqautand etc. But I can't find a command for dumping messages inside queues.EDIT-I am using WebSphere MQ v.7.1### Assistant: You don't say what version you are, but hopefully you are at a new enough version to have thedmpmqmsgcommand, This will dump the messages off the queue to a file.If you are on an older version on IBM MQ that does not have this command, then the equivalent function can be used throughSupportPac MO03 QLOAD.dmpmqmsgwas the productisation of this free tool.\n"} +{"text": "### Human: if [[ $(dspmq | grep '(Running)' | grep \"$QMgr\" | wc -l | tr -d \" \") != 1 ]]The above code is to check if queue manager is running or not.Is there any command to check whether the given queue name is exists in the queue manager or not?### Assistant: Adding another suggestion in addition to what Rob and T.Rob have said.MQ v7.1 and higher come with the dmpmqcfg command and you can use this to check for a specific queue.The examples below are in line with your sample that checks if a queue manager is running:To use dmpmqcfg to check if a queue name of any type exists you could do this:if dmpmqcfg -m ${QMgr} -t queue -x object -o 1line -n ${QName}|egrep '^DEFINE '; then\n echo \"Queue ${QName} exists on Queue Manager ${QMgr}\nfiUsing the method Rob Parker provided* to check if a queue name of any type exists:*Note I usedDISPLAY Q(instead ofDISPLAY QLOCAL(if printf \"DISPLAY Q(${QName})\" | runmqsc ${QMgr} 2>&1 >/dev/null; then\n echo \"Queue ${QName} exists on Queue Manager ${QMgr}\nfiYour example check for a queue manager Running could be simplified to this:if dspmq -m ${QMgr}| grep --quiet '(Running)'; then\n echo \"Queue Manager ${QMgr} is Running\"\nfi\n"} +{"text": "### Human: How do I create the listener in WebSphere MQ version 5.3? I have used therunmqsccommand and enter into console and try to execute this command:DEFINE LISTENER (name) TRPTYPE(TCP) PORT(99990)But is throwing andAMQ8426error and saying:Valid commands are DEFINE AUTHINFO,DEFINE CHANNEL,\n DEFINE PROCESS, DEFINE NAMELIST,DEFINE QALIAS, DEFINE QLOCAL,DEFINE\n QMODE,DEFINE QREMOTE### Assistant: How do i create the listener in the MQ version 5.3?You don't. That component wasn't available in v5.3, a version of MQ that was out of service in 2007. In fact, it has been out of service for so long, that IBM has removed the online Infocenter for it. However, you can still find the individualMQ v5.3 manuals online. In particular, theIntercommunicationmanualsection on receiving on TCPexplains that with this version you will need either to useinetdor therunmqlsrprogram.Of course since v5.3 has been out of service for 8 years on most platforms, the more important advice here isuse a modern version. IBM has provided a license that allows people to run an unrestricted MQ server install on their laptop or PC at no charge. The product/license name isIBM MQ Advanced For Developers.Note that while it is important for individuals to move to a modern version of MQ, it is even more so for the companies using MQ for business purposes. In the 8 years (as of this writing) since v5.3 was retired, there have been many security-relevant fixes, none of which were maintained in the 5.3 code base. Obviously, that goes for all the performance improvements, bug fixes and enhancements as well.There are almost no legitimate reasons for anyone to still be working with MQ v5.3 (which I am intentionally not enumerating here) but if you actually are facing one of them and are stuck at that version, use therunmqlsrprogram and launch it in your start script.But the correct answer for virtually EVERYONE else reading this isdo NOT keep using MQ v5.3.\n"} +{"text": "### Human: From my application I need to query some Websphere MQ per-queue statistics (last message get/put time, number of en/dequeued messages, current queue depth, number of connected clients).\nI managed to get the queue depth via PCFAgent, but I'm kind of stuck on the rest because the IBM documentation is rather confusing.Do you know any useful references (or code examples) that might help?### Assistant: If you installed the WMQ client in the default location then the samples will be at:C:\\Program Files (x86)\\IBM\\WebSphere MQ\\tools\\pcf\\samples.On UNIX flavors, they end up under/opt/mqm/samp.If you just grabbed the jar files and did not install the client then you won't have a supported configuration - or the samples, tracing utilities, diagnostic tools, etc., etc. The client install media is available for free download in theSupportPacs page. The different clients currently available are:Version 6.0 isSupportPac MQC6(V6 is end of life Sept 2012)Version 7.0 isSupportPac MQC7Version 7.1 isSupportPac MQC71Make sure that you are looking at the Infocenter for the version of WebSphere MQ Server that you are connecting to. Also note that if you connect to a v7 QMgr and are using a v6 client, then the constants and classes you are using will limit you to the v6 functionality. Preferably, use the latest client since it is always backward compatible with older QMgr versions.UPDATE:Here are some code snippets to perform the requested functions:First you need a queue manager connection (qmgr). Then you can create aPCFMessageAgent:// Create PCF Message Agent\ntry {\n pcfAgent = new PCFMessageAgent(qmgr);\n} catch (MQException mqe) {\n System.err.println(\"PCF Message Agent creation ended with reason code \"\n + mqe.reasonCode);\n return mqe.reasonCode;\n}You can get most of the attributes you need using (except the enq/deq count) the call below. Note that in order to get last msg get\\put time you need to turn queue monitoring (MONQ) on.// Prepare PCF command to inquire queue status (status type)\ninquireQueueStatus = new PCFMessage(CMQCFC.MQCMD_INQUIRE_Q_STATUS);\ninquireQueueStatus.addParameter(CMQC.MQCA_Q_NAME, \"name of queue to inquire\");\ninquireQueueStatus.addParameter(CMQCFC.MQIACF_Q_STATUS_TYPE, CMQCFC.MQIACF_Q_STATUS);\ninquireQueueStatus.addParameter(CMQCFC.MQIACF_Q_STATUS_ATTRS, new int[] {\n CMQC.MQCA_Q_NAME, CMQC.MQIA_CURRENT_Q_DEPTH,\n CMQCFC.MQCACF_LAST_GET_DATE, CMQCFC.MQCACF_LAST_GET_TIME,\n CMQCFC.MQCACF_LAST_PUT_DATE, CMQCFC.MQCACF_LAST_PUT_TIME,\n CMQCFC.MQIACF_OLDEST_MSG_AGE, CMQC.MQIA_OPEN_INPUT_COUNT,\n CMQC.MQIA_OPEN_OUTPUT_COUNT, CMQCFC.MQIACF_UNCOMMITTED_MSGS });You can retrieve the parms using:pcfResp = pcfAgent.send(inquireQueueStatus);The for each individual parms you can use thegetXXXXXParameterValuemethod (XXXXXXis the type of data).For the Enq/Deq counts, you need to reset the queue statistics:// Prepare PCF command to reset queue statistics\nqueueResetStats = new PCFMessage(CMQCFC.MQCMD_RESET_Q_STATS);\nqueueResetStats.addParameter(CMQC.MQCA_Q_NAME, queueName);\n\npcfResp3 = pcfAgent.send(queueResetStats);\n\nqueueMsgDeqCount = pcfResp3[0].getIntParameterValue(CMQC.MQIA_MSG_DEQ_COUNT);\nqueueMsgEnqCount = pcfResp3[0].getIntParameterValue(CMQC.MQIA_MSG_ENQ_COUNT);Let me know if you have more questions.\n"} +{"text": "### Human: Please tell me how do i read the MQ activity logs ? Which inside the QManger folder.Thats format is human unreadable### Assistant: Please confirm which directory and the filename of the log you are trying to read. Active log files such as S0000001.LOG are not human readable. They are used internally by the queue manager.The logs most often used to administer a queue manager are the error logs such as AMQERR01.LOG which are found in the subdirectory under qmgrs/QMGRNAME/errors directory.If you truly need to see some info stored in the active log files, you can use the dmpmqlog command to dump a formatted version. Refer to the knowledge center:http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.ref.adm.doc/q083170_.htm\n"} +{"text": "### Human: I want to load files in the file system to a WebSphere MQ Queue. There are couple of support pacs -Q ProgramandMO03: WebSphere MQ Queue Load / Unload Utilitythat come close but they mandate the files to be in a specific format. I have the messages which are XML files and want a quick way to load them to a queue. The number of files run into a few hundred so looking for an utility to do this job instead of having to write an application to achieve this.I could not locate some general purpose application to achieve this. So looking for some help hereThanks### Assistant: Why do you believe that the Q program requires a specific file format? According to theREADME.TXTfile, the following options are available:-f\n Input file.\n Each line of the file will be put to output queue as a different\n message.\n See \"Z/OS FILE NAME FORMAT EXAMPLES\" for specific z/OS details.\n\n-F[+]\n Input/output file.\n Entire file will be put to the output queue as a single message.\n If '+' is specified the dataset attributes will be retained if\n the output dataset exists - z/OS only.\n See \"Z/OS FILE NAME FORMAT EXAMPLES\" for specific z/OS details.So if you specify-F(without the+) all lines in the the XML file are loaded into a single message. You can also specify the message options using the-aparameter:-a Sets message attributes when put to the output queue\n\n n - forces non-persistence\n p - forces persistence\n q - uses queue default persistence\n d - put a datagram message type\n r - put a reply message type\n R - put a request message type\n t - put a report message type\n x - don't treat lines starting with '#' as specialAlthough the Q program will interpret files by default, note that the-axoption above tells it to ignore lines with#which it would ordinarily interpret as commands. This allows you to load XML files or source code with comments or even binary files such as a PDF or JPG.Was there a specific limitation in Q that you are unable to work with? If so, it would be helpful to know what that is so we might point you to something that would better fit your purpose.UPDATEResponding to Spyro's comments, Q isnotlimited to 1000 characters. Here's an example where the README file from the Q distribution is written to a single message and read back.D:\\WMQ\\MA01>q -m JMSDEMO -OSYSTEM.DEFAULT.LOCAL.QUEUE -FREADME\nMQSeries Q Program by Paul Clarke [ V6.0.0 Build:May 1 2012 ]\nConnecting ...connected to 'JMSDEMO'.\n\nD:\\WMQ\\MA01>echo dis q(SYSTEM.DEFAULT.LOCAL.QUEUE) curdepth | runmqsc JMSDEMO\n5724-H72 (C) Copyright IBM Corp. 1994, 2011. ALL RIGHTS RESERVED.\nStarting MQSC for queue manager JMSDEMO.\n\n\n 1 : dis q(SYSTEM.DEFAULT.LOCAL.QUEUE) curdepth\nAMQ8409: Display Queue details.\n QUEUE(SYSTEM.DEFAULT.LOCAL.QUEUE) TYPE(QLOCAL)\n CURDEPTH(1)\nOne MQSC command read.\nNo commands have a syntax error.\nAll valid MQSC commands were processed.\n\nD:\\WMQ\\MA01>q -m JMSDEMO -dl -iSYSTEM.DEFAULT.LOCAL.QUEUE\nMQSeries Q Program by Paul Clarke [ V6.0.0 Build:May 1 2012 ]\nConnecting ...connected to 'JMSDEMO'.\nMQGET 24309 bytes\n============================================================================\nMessage Descriptor (MQMD)\nReport :00000000\nMessage Type :8 (Datagram)\nFormat :'MQSTR '\nPriority :0\nPersistence :0 (Not Persistent)\nMessage Id :A M Q J M S D E M O . . . R . * .\n 414D51204A4D5344454D4F20202020201DDEA052200B2A02\n 'AMQ JMSDEMO ...R .*.'\nReplyToQ :' '\nReplyToQMgr :'JMSDEMO '\n ----------------------------------------------------------------------\n| |\n| |\n| DESCRIPTIVE NAME WebSphere MQ Q Program |\n| |\n\n------- 8><-------------------------------------------------------------\nREMAINDER OF MSG OUTPUT OMITTED FOR BREVITY. PRINT-OUT RESUMES...\n------- 8><-------------------------------------------------------------\n\nNo more messages.\n\nD:\\WMQ\\MA01>Note the header lines where the message was printed. The-dloption tells Q to print the message length which, in this case, was 24309 bytes. I downloaded the current version to perform this test so this is accurate as of 7 December 2013.\n"} +{"text": "### Human: In my test I run inmem ActiveMQ and then instantiate ActiveMQConnectionFactory and do whatever I want in order to test it. I used this because that seemed to be the easiest way to create integration test. I thought the switch from ActiveMQConnectionFactory to com.ibm.mq.jms.MQTopicConnectionFactory would be straightforward. But it apparently is not. What would be the mapping from this snippet\n \nto that one:\n \n \n \n \n \nWould that be even possible without some kind of weird bridges Camel has?### Assistant: This is not possible. The JMS specification covers the API and behavior but vendors are free to implement any wire format and communication protocols that they wish. WebSphere MQ uses it's own formats and protocols and Active MQ has its own formats and protocols.Bridge applications function by reading messages into memory from one transport then writing that message to the other transport. Although this works at a basic level, the two transports have different destination namespaces and security realms so these interfaces tend to be hard-coded point-to-point routes. This is usually the best you can expect when mixing JMS transport providers.\n"} +{"text": "### Human: I have a program which publishes data to IBM Websphere MQ via the MQAX200 interface. I'm struggling to work out how to test it.What's the simplest way of setting up an application to consume the messages from the queue and confirm they're correct? I don't currently have any MQ infrastructure here (that's on the client's site).Do I need a message broker? Are there any open source implementations? Or do i need to purchase Websphere MQ, in which case what's the minimal license I'd require?ThanksBen### Assistant: As your application is written using a MQ interface, you need MQ to test. If it's just for testing, you can use thetrialversion of MQ.As far as I know MQAX200 interface supports only P2P messaging and not Publish/Subscribe messaging. So using your application put message to a queue and then use the application likeamqsgetto receive message.You don't need message broker.\n"} +{"text": "### Human: I am trying to test the authentication exits in a MQ server. All the channels has theSSLCAUTHattribute set toREQUIRED. As I know, this means each client must have SSL certificate in order to put message in channel and if they don't have valid SSL certificate, the connection will be refused. However, when I checked theSSLCIPHattribute for these channels, they are all blank. IBM documentation says: \"TheSSLCIPHattribute can contain a blank value, meaning that you are not using SSL or TLS. If one end of the channel has a blankSSLCIPHattribute, the other end of the channel must also have a blankSSLCIPHattribute.\"So, I am totally confused here. Are the channels using SSL certificate for authentication or not. Any help will be greatly appreciated.### Assistant: The SSLCAUTH attribute is only applicable if the SSLCIPH attribute is not blank. In other words the SSLCIPH attribute is the big switch for SSL/TLS being used. Only then will the SSLCAUTH attribute even be looked at.\n"} +{"text": "### Human: I need to write a Windows based service in C# to listen to the request queue configured in WebSphere MQ. I successfully put the request in MQ and get a correlation ID, but in response, I'm not getting the actual result.I want to develop a system that whenever a new message arrives in the queue, the service should pick up the message and process the request. I can map that response with my correlation ID.### Assistant: The following code has solved my problem.class Program\n{\n static void Main(string[] args)\n {\n Program app = new Program();\n app.Setup();\n Console.ReadLine();\n\n }\n\n public void Setup()\n {\n XMSFactoryFactory xff = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\n IConnectionFactory cf = xff.CreateConnectionFactory();\n cf.SetStringProperty(XMSC.WMQ_HOST_NAME, \"10.87.188.156(7111)\");\n cf.SetIntProperty(XMSC.WMQ_PORT, 7111);\n cf.SetStringProperty(XMSC.WMQ_CHANNEL, \"QMEIGS1.CRM.SVRCONN\");\n cf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);\n cf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, \"QMEIGS1\");\n cf.SetIntProperty(XMSC.WMQ_BROKER_VERSION, XMSC.WMQ_BROKER_V1);\n\n IConnection conn = cf.CreateConnection();\n Console.WriteLine(\"connection created\");\n ISession sess = conn.CreateSession(false, AcknowledgeMode.AutoAcknowledge);\n IDestination dest = sess.CreateQueue(\"DOX.APYMT.ESB.SSK.RPO.02\");\n IMessageConsumer consumer = sess.CreateConsumer(dest);\n MessageListener ml = new MessageListener(OnMessage);\n consumer.MessageListener = ml;\n conn.Start();\n Console.WriteLine(\"Consumer started\");\n\n\n }\n\n private void OnMessage(IMessage msg)\n {\n ITextMessage textMsg = (ITextMessage)msg;\n Console.Write(\"Got a message: \");\n Console.WriteLine(textMsg.Text);\n }\n\n}\n"} +{"text": "### Human: I am trying to find some documentation on what is MQSecurityExit and how do we actually implement it in Java. I just have a very little idea on this - like I believe it's for authenticating MQ client to MQ provider. But don't know how this fits in overall security architecture of WebSphere MQ.### Assistant: An exit is a point in the vendor code that calls out to user or 3rd party code to perform custom functions. WebSphere MQ provides security exit points at both the server and at the client. A common use for a security exit is that after authenticating the connection, the exit sets the MCAUSER field in the channel to the user ID that was resolved in the authentication. Authorization is performed against this value.A stand-alone server-side exit can authenticate connections based on data passed in the connection request. The most common items used by a server-side exit are SSL certificate details, user credentials passed from the client and IP connection information.A client/server exit pair can do any arbitrarily complex authentication. For example, the client-side exit can prompt the user for ID and password, encrypt these and then forward to the server-side exit for validation. There is an SSPI exit pair supplied with the Windows version of WMQ that authenticates using Kerberos tokens.Server-side exits must be written in C. In v6.0 and prior versions of WebSphere MQ you were required to write channel exits in C as well. As of v7 it is possible to write channel exits in Java as described in the documentationhere. Note that client channel exits are most useful when paired with a server-side exit. For example, it would not do much good for a client channel exit to supply authentication credentials if there is no server-side exit to do something with them.Additional information on exits is available in theIntercommunications manual.A well known example of a server-side exit isBlockIP2.\n"} +{"text": "### Human: I got key files from our client where I need to use them to connect to MQ over SSL. The files we have got from client are:xxx.crl \nxxx.kdb \nxxx.rdb \nxxx.sth \nxxx.tabThey said client channel table in that. I am trying to connect using the below code. And they are saying I don't need to specify the Queue Manager it will be defined in the Client Channel Table. But one thing is they have done while created key with the using \"user1\".Code:Hashtable connectionProperties = new Hashtable(); \n\n// Add the connection type \nconnectionProperties.Add(MQC.TRANSPORT_PROPERTY, connectionType); \n\nMQQueueManager qMgr; \n\nMQEnvironment.SSLCipherSpec = \"TRIPLE_DES_SHA_US\"; \nMQEnvironment.SSLKeyRepository = @\"D:\\Cert\\BB\\key\"; \nMQEnvironment.UserId = \"user1\"; \nMQEnvironment.properties.Add(MQC.TRANSPORT_PROPERTY, connectionType); \nqMgr = new MQQueueManager();Error I am getting:Message = \"MQRC_Q_MGR_NAME_ERROR\"I also tried telneting the server which I am able to do.Can some help me what is wrong I am doing here and why I am getting this error.### Assistant: I sloved the issue by setting following env varibles. before the connection.Env varibles are MQCHLLIB,MQCHLTAB,MQSSLKEYR - use Environment.SetEnvironmentVariable - to set values\" /> \n --- Certs location. \n\n - **Make sure you give the refarance of this DLL**After setting all this just call queueManager = new MQQueueManager(); - You should be good.\n"} +{"text": "### Human: We have messages coming in over a WebSphere MQ queue. It takes a long time before we receive the message.Is there a simple, easy way of tracking when a message gets received/picked up?### Assistant: When the message is put, you can request Confirmation on Delivery. When the message is consumed, a report message is delivered to the Reply-To Queue and Reply-To QMgr that were set in the original message. This is relatively easy if you are using the C or Java procedural interfaces or WMQ v7.0 with any language. The report options are set like any other message option prior to the PUT.http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzak.doc/fr13320_.htmIn the case of JMS and WMQ v7.0 the MQMD properties have all been exposed as JMS Message Properties and you can set or read them that way.http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzaw.doc/jm25500_.htmThere is another, less simple but MUCH more detailed, approach you may consider. The MA0W SupportPac (http://www-1.ibm.com/support/docview.wss?rs=171&uid=swg24010343&loc=en_US&cs=utf-8&lang=en) is a trace exit. This trace has extremely fine control and you can enable it for a single PID, for specific queues or channels, etc. It will give you API timings so you will be able to see whether the time is being spent between API calls or in the API call itself. In other words, did the program wait 10 seconds between API calls or did the GET take 10 seconds to complete? If you are getting messages rolled back due to filling the transaction log and then re-read this can cause delays that are pretty transparent unless you have a trace.\n"} +{"text": "### Human: Currently, I faced an issue whereby when trying to runmqsc (queue manager name), I achieved an error of AMQ8157: Security Error. Is there any way I can solve this issue?I am running IBM MQ Version 8.0.0.5 on Windows 7 x64 Edition.AMQ8157 appeared in the command prompt asAMQ8157: Security error.However, This was the error which was displayed in the error log.Error Log Message:AMQ8079: Access was denied when attempting to retrieve group membership\ninformation for user 'userdecim@ddgroup.com'.\n\nEXPLANATION:\n\nWebSphere MQ, running with the authority of user 'admin@dd-pc-002',\nwas unable to retrieve group membership information for the specified user.\nACTION:\nEnsure Active Directory access permissions allow user\n'admin@dd-pc-002' to read group memberships for user\n'userdecim@ddgroup'. To retrieve group membership information for a domain user,\nMQ must run with the authority of a domain user and a domain controller must be\navailable.### Assistant: The ACTION in the error explains the problem. The IBM MQ queue manager is running as alocaluseradminon the hostdd-pc-002. The queue manager is trying to retrieve group membership information for thedomainuseruserdecim@ddgroup.com. Because the queue manager is running under alocalaccount it will not have permission to obtain information on adomainuser.If the IBM MQ queue manager will interact withdomainusers and groups, the account which the queue manager processes run under on Windows must be adomainaccount that hasRead group membershipandRead groupMembershipSAMpermissions.See the IBM MQ v8 Knowledge Center page \"Creating and setting up domain accounts for IBM MQ\" for more details.\n"} +{"text": "### Human: I am using 'c-client' api to access theWebsphere IBM MQ 8. Is it possible to identify the source topic from which the message was published ?### Assistant: To inquire on the topic string, use theMQCRTMHAPI call to obtain a message handle, then inquire the properties of the message using theMQINQMPAPI call specifying theMQTopicStringproperty.MQCRTMH- Create message handleMQINQMP- Property NamesSample IBM MQ procedural programsAdmittedly, it can be difficult to track this info down in the IBM MQ reference documentation, especially if you do not already know the way it works and the names of the calls and fields. One approach that can help is to start with the sample programs to get a basic understanding and then work back into the manuals to fill in the missing details. The sample code is available from the install media by selecting the appropriate optional component.On Windows these end up in{MQM Home}/Toolsand on UNIX systems at{MQM Home}/samp. If the samples are installed,AMQSIQMAwill demonstrate how to inquire properties of a message handle, and is an example of the use of theMQINQMPAPI call.\n"} +{"text": "### Human: I amd trying put a string message in MQ using pymqi, the code is as follows;import xml.dom.minidom as minidom\nimport pymqi\n\nclass PutMQ:\n def put_mq(args1):\n doc = minidom.parse(args1) \n queue_manager = \"NameQueueManager\"\n channel = \"ChannelName\"\n host = \"HostName\"\n port = \"PortNumber\"\n conn_info = \"%s(%s)\" % (host, port)\n\n qmgr = pymqi.QueueManager(None)\n\n qmgr.connectTCPClient(queue_manager, pymqi.cd(), channel, conn_info)\n\n putq = pymqi.Queue(qmgr, 'QueueName')\n\n\n putq.put(doc.toprettyxml())\n\n putq.close()\n qmgr.disconnect()\n put_mq('C://MQ//myMessage.xml')When I run this code, it doesn't throw any error. Hence, I get the feeling that the message has been put successfully on the required Queue.However, I am expecting to see a record in one of my application screen after I send the above message to the Queue, and this is not happening.If I put the same message through AppWatch (web interface), it works and I see the expected record on the application UI too.On the AppWatch (web interface), when I do the 'Put Message', I mention the message type as : \"String Format (MQFMT_STRING)\".How can I specify in my code that the message format is 'MQFMT_STRING'?Appreciate your help on this.### Assistant: According to thePyMQI Docsthis is the definition of the put call:put(msg[, mDesc, putOpts])Put the string buffer \u2018msg\u2019 on the queue. If the queue is not already open, it is opened now with the option \u2018MQOO_OUTPUT\u2019.mDesc is the pymqi.md() MQMD Message Descriptor for the message. If it is not passed, or is None, then a default md() object is used.putOpts is the pymqi.pmo() MQPMO Put Message Options structure for the put call. If it is not passed, or is None, then a default pmo() object is used.If mDesc and/or putOpts arguments were supplied, they may be updated by the put operation.So in order to set the format you need to supply an MQMD Message Descriptor, themDescparameter on the put call.I haven't tried this out myself, but your code should look something like:md = pymqi.MD()\nmd.Format = CMQC.MQFMT_STRING\nputq.put(doc.toprettyxml(), md, None)\n"} +{"text": "### Human: I encountered a really wired problem. I have successfully installWebsphere MQon my windows machine and want to createQManagerand Queue to connect to a remoteQmanagerserver. I have already created a QManager as you can see in the picture below. However, when I tried to create a queue for thisQManager, I could not find any expand button as the IBM tutorial mentioned. \nI have already tried to create a queue with MQSC but when I runrunmqscin the command prompt with administrator user, it showsAMQ8135: Not Authorizederror!### Assistant: Check your error logs (AMQERR01.LOG) for an explanation of why AMQ8135 was returned to the client - for security reasons clients aren't given more information and so you have to go to the logs to get the detail.I suspect the user you're running MQ Explorer and runmqsc as isn't in the 'mqm' group, or is otherwise not authorised to connect to the queue manager.\n"} +{"text": "### Human: I am writing an application in Delphi to connect to remote MQ Server and get messages.I installed a MQ Server on my comp and wrote a test application.All well Connect,Open,Put,Get,.. all works well.Then I tried to connect to remote MQ by changing address, it works but not correctly, it works with local MQ still and get info from local. not switched to other remote server!!!!My source is as bellow, What I should do? Thanksvar\n QMgrName : MQCHAR48;\n ConnectOpts : TMQCNO;\n ClientConn : TMQCD;\n Compcode : MQLONG;\n Reason : MQLONG;\nbegin\n StrPCopy(QMgrName, AQueueManager+#0);\n ConnectOpts.StrucId := MQCNO_STRUC_ID;\n ConnectOpts.Version := MQCNO_VERSION_1;\n ConnectOpts.Options := MQCNO_STANDARD_BINDING;\n ConnectOpts.ClientConnOffset := 0;\n ConnectOpts.ClientConnPtr := @ClientConn;\n\n with ClientConn do begin\n StrPCopy(ClientConn.ConnectionName, format('%s(%s)'#0, [AIP,APort]));\n Version := MQCD_VERSION_6;\n ChannelType := MQCHT_CLNTCONN;\n TransportType := MQXPT_TCP;\n Desc := '';\n QMgrName := '';\n XmitQName := '';\n ShortConnectionName := '';\n MCAName := '';\n ModeName := '';\n TpName := '';\n BatchSize := 50;\n DiscInterval := 6000;\n ShortRetryCount := 10;\n ShortRetryInterval := 60;\n LongRetryCount := 999999999;\n LongRetryInterval := 1200;\n SecurityExit := '';\n MsgExit := '';\n SendExit := '';\n ReceiveExit := '';\n SeqNumberWrap := 999999999;\n MaxMsgLength := 4194304;\n PutAuthority := MQPA_DEFAULT;\n DataConversion := MQCDC_NO_SENDER_CONVERSION;\n SecurityUserData := '';\n MsgUserData := '';\n SendUserData := '';\n ReceiveUserData := '';\n UserIdentifier := '';\n Password := '';\n MCAUserIdentifier := '';\n MCAType := MQMCAT_PROCESS;\n ConnectionName := '';\n RemoteUserIdentifier := '';\n RemotePassword := '';\n MsgRetryExit := '';\n MsgRetryUserData := '';\n MsgRetryCount := 10;\n MsgRetryInterval := 1000;\n HeartbeatInterval := 1;\n BatchInterval := 0;\n NonPersistentMsgSpeed := MQNPMS_FAST;\n StrucLength := MQCD_LENGTH_6;\n ExitNameLength := MQ_EXIT_NAME_LENGTH;\n ExitDataLength := MQ_EXIT_DATA_LENGTH;\n MsgExitsDefined := 0;\n SendExitsDefined := 0;\n ReceiveExitsDefined := 0;\n MsgExitPtr := nil;\n MsgUserDataPtr := nil;\n SendExitPtr := nil;\n SendUserDataPtr := nil;\n ReceiveExitPtr := nil;\n ReceiveUserDataPtr := nil;\n ClusterPtr := nil;\n ClustersDefined := 0;\n NetworkPriority := 0;\n LongMCAUserIdLength := 0;\n LongRemoteUserIdLength := 0;\n LongMCAUserIdPtr := nil;\n LongRemoteUserIdPtr := nil;\n// MCASecurityId := MQSID_NONE_ARRAY;\n// RemoteSecurityId := MQSID_NONE_ARRAY;\n end;\n MQCONNX(@QMgrName, ConnectOpts, HConn,Compcode,Reason);\n if CompCode <> MQCC_OK then\n raise Exception.Create(format('MQCONNX Fail, Completion Code: %d, Reason: %d',[CompCode,Reason]));### Assistant: The code snippet doesn't show theusesstatement. According tothe MA7Q docs,The SupportPac contains two files called 'MQI.PAS' and 'MQIC.PAS'.\n These are Pascal sources that should be placed somewhere in the Search\n Path of Delphi to be included in your Pascal program. The way to\n include it is like using any unit in Pascal:uses MQI;oruses MQIC;TheMQIis the bindings mode (shared memory) connection and theMQICis the client connection over the network stack.It is possible to have both available and let the application determine which to use at run-time. According to theWMQ Infocenter:If you are linking to the mqm library, then a standard server\n connection using the default bind type is attempted first. If the\n underlying server library failed to load, a client connection is\n attempted instead.This suggests to me that you have both libraries in the path and the connection is finding the local QMgr first and ignoring the client connection parameters, or perhaps that you are using the MQI library where you want the MQIC library. Make sure the MQIC library is in the path and change yourusesstatement.If switching the library does not alone solve the problem, consider specifyingMQCNO_CLIENT_BINDINGinstead ofMQCNO_STANDARD_BINDING.\n"} +{"text": "### Human: Is Extended Transactional Client installed by default? How do I verify if this is installed or not? How do I get this installed?### Assistant: In previous versions of the MQ client, it certainly wasn't included with the standard client (the Transactional Client had cost / licensing implications).However from the date of the announcement of WMQ v7.5 onwards it is now included with the Standard clients at v7.0.1 and up.From theIBM Websphere siteWith the availability of WebSphere MQ V7.5 the capability previously\n delivered within the Extended Transactional Client is incorporated\n into the standard WebSphere MQ client.And in more detail,hereWider access to the Extended Transactional Client for all customers\n The Extended Transactional Client enables customers to configure their\n WebSphere MQ client to participate in a transactional unit of work\n when exchanging messages to an MQ server. Use of this client without\n charge was previously restricted to customers using WebSphere\n Application Server, WebSphere Enterprise Service Bus, or WebSphere\n Process Server as the Transaction Manager. With the announcement of\n WebSphere MQ V7.5, the Extended Transactional Client is available for\n use in all client deployments without additional entitlement. This\n includes all supported versions of WebSphere MQ client connecting to\n any supported version of WebSphere MQ queue manager.With the availability of WebSphere MQ V7.5 the capability previously\n delivered within the Extended Transactional Client is incorporated\n into the standard WebSphere MQ client. Customers using WebSphere MQ\n V7.0.1 and WebSphere MQ V7.1 gain the benefit of use of the Extended\n Transactional Client without charge from the date of this\n announcement. IBM is making available refreshed code including updated\n License Information. Customers can realize this benefit through the\n download and acceptance of this new License Information.\n"} +{"text": "### Human: My current task in the company is to implement IVY dependency management.\nNow I hit the following libraries that I couldn't find in usual Maven repositories, such ashttp://mvnrepository.com:com.ibm.mq.jarcom.ibm.mq.pcf.jar\n...and so forth (they are all with the prefix: com.ibm.mq).I could found them on a separated website:http://www.java2s.com/But it's not Maven compatible.So, where could I found those? What's the best solution to overcome this?I'm thinking, uploading them manually to the team nexus. But is this the usual procedure in such cases?Thanks a lot in advance.### Assistant: Best place to find those is directly from IBM. Please seethis answerfor the different versions of the WMQ Java/JMS client available.As for the best way to package these, please be aware that if you want IBM to support them you need to install the client code rather than just bundling in the jar files. The reason IBM is reluctant to support non-standard installs should concern you as well if the app is to be installed in Production. The full client includes considerable additional functionality such as diagnostics, trace functions, crypto libs, JSSE, etc. In addition, it is the only install against which you can apply IBM's maintenance.If you install the jars from a 3rd party site such as the one linked above, do you even know what version they are? Has any of the maintenance been applied? Have the latest patches been applied? Since IBM only distributes the full client, and OEMs are not authorized to distribute the jar files except as part of their application, any site offering the WMQ jar files is by definition pirating them.I realize that requiring you to do the full client install is considered burdensome when you are used to being able to just grab some jars and go. On the other hand, if you don't need support then you might install the WMQ Client on a VM somewhere, keep it up to date and grab the jar files from there. That way you have a known-good set of files that are all in sync and to which you canapply maintenance.If you'd like to suggest to IBM that they need a lighter-weight Java solution, feel free to raise the requirement (or vote on it if it already exists) at theIBM Request For Enhancement (RFE) Community.\n"} +{"text": "### Human: I'm trying to understand how common is the usage of MQ Topics in the industry.\nAnd MQ with SSL?Thanks,\nGuy### Assistant: Pub/SubPrior to v7 of WMQ, Pub/Sub was available either as a separate component of WMQ or as part of the functionality of WebSphere Message Broker. Now in v7 pub/sub is integral to WMQ and allows topic-level security. There is a certain amount of pub/sub adoption that is occurring just because it is now baked into WMQ as native functionality.Another factor influencing uptake on WMQ pub/sub is that more people are being exposed to it through WMQ File Transfer Edition. WMQ FTE makes status of file transfers available as publications and many people with this product are writing applications that monitor these topics to provide a variety of custom functionality. Once they start using pub/sub, many of these shops begin to see other uses for it.Pub/Sub also solves some common problems with messaging such as an application that currently writes to a queue and a new requirement comes up to get a copy of that message to another consumer. Prior to v7, switching an app from writing to a queue to writing to a topic was somewhat invasive and required configuration changes for JMS apps or code changes for other types of code. The simplest way to address the problem was to intercept the message with an application or exit that wrote copies to two or more queues. As of v7 an application that was written for queues can be provided with an alias over a topic. The producer still thinks it is writing to a queue but WMQ is publishing the messages to a topic instead. Consumers can then either subscribe directly or, in the case of legacy code that requires a queue, an administrative subscription can cause the messages on the topic to be delivered to a queue. I am seeing a lot of uptake on pub/sub to address these kinds of requirement.There are also the cases where pub/sub is the appropriate solution and it is used for that reason alone. In the past the requirement for separate components, administrative skill or a WMB license were barriers to adoption that caused a certain portion of pub/sub apps to be reworked as point-to-point. With pub/sub built into WMQ, these barriers are eliminated or at least significantly reduced which leads to more uptake simply because it is the right architecture for the problem at hand.In general, I would say that WMQ pub/sub has gone mainstream with v7. Since v6 end-of-life has been announced for September 2011, there will be a mass migration to v7 this year and subsequently even more adoption of pub/sub as a result.SSL/TLSAs for SSL, WMQ security is approaching mainstream. I wouldn't say SSL is the norm - just yet - but over the last two or three years it is in enough demand that myWMQ Hands-On Security Labsessions at the IMPACT and European WebSphere Technical conferences have had overflow attendance. Irecently wrote...The term \"trusted internal network\"\n was coined to differentiate that part\n of the network that was internal from\n destinations outside the firewall. But\n the term \"trusted\" as used in this\n context is relative. It was not\n supposed to indicate that the internal\n network was trusted implicitly, only\n that it was more trusted than things\n outside the firewall. Unfortunately,\n the term is sometimes interpreted\n quite literally. I have had clients\n quite earnestly tell me by definition\n we trust everything on the \"trusted\n internal network\", that's why we call\n it that. Of course, this overstates\n the case, because even the staunchest\n believers in trusting the internal\n network still enforce password-based\n login to servers, databases, and\n applications. So the internal network\n is trusted, but only up to a point,\n and even on the internal network\n authentication and authorization are\n essential.Although SSL (TLS, actually) channels encrypt, they also authenticate. As more people realize that they need to authenticate WMQ connections on the \"trusted\" internal network, SSL has been a common method of achieving that. Of course, there is also a growing requirement for privacy (encryption) and integrity services on the WMQ channels for both internal and external connections and this is driving adoption of WMQ SSL channels as well.Now that SSL is more common, there are a number of secondary challenges that pop up when people do not fully understand WMQ security. The fact that these are now common topics on theWMQ listserveand onMQSeries.netattests to the level of SSL adoption. Some of these secondary issues are the inclusion of unused Certificate Authority root certs in the QMgr's keystore, or lack of QMgr channel settings like SSLPEER (which filters connections by distinguished name) or MCAUSER (which maps authorizations to a specific user account). Frequently people enable SSL but overlook one or more of these other settings and do not achieve the level of security they had intended. Since you must have enabled SSL for these things to present an issue, it is as a friend of mine says \"a luxury problem.\" It is much better to be challenged by SSLPEER settings than not to have applied SSL at all.In summary...So I suppose the short answer to both of these questions is that use of pub/sub and SSL in WMQ is quite common. Both are on a sharp upward trend right now and if I were writing new applications I would definitely use SSL and would not hesitate to use WMQ pub/sub where called for.\n"} +{"text": "### Human: How do i convert/lookup a reason code of IBM Websphere MQseries to its explanation (for logging etc)?### Assistant: Please seeSupportPac MA0Kwhich has C and Visual Basic code to perform this task.\n"} +{"text": "### Human: I am running a simple Java client to connect to a remote MQ queue.When I run the Java code to read write messages with Alias queue name, it works fine.When i try to run the code on the same queue but witha a physical queue name (Because i wish to invoke getQueueDepth), I get a 2035 error at the point when the code tries to establish a connectionThe authority on the queue are:\nbrowse +dsp +get +inq +put +set +setallThe java code is as underimport com.ibm.mq.MQC;\nimport com.ibm.mq.MQEnvironment;\nimport com.ibm.mq.MQException;\nimport com.ibm.mq.MQGetMessageOptions;\nimport com.ibm.mq.MQMessage;\nimport com.ibm.mq.MQPutMessageOptions;\nimport com.ibm.mq.MQQueue;\nimport com.ibm.mq.MQQueueManager;\npublic class MQSniffer {/**\n * @param args\n */\n/**\n * @param args\n */\npublic static void main(String[] args) {\n String hostname = \"XXXX\"; \n String channel = \"CHANNEL\"; \n String qManager = \"qmgr\"; \n\n MQQueueManager qMgr; \n\n\n MQEnvironment.hostname = hostname; \n MQEnvironment.channel = channel; \n MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES);\n\n try { \n qMgr = new MQQueueManager(qManager); \n\n int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_INQUIRE | MQC.MQOO_OUTPUT ;\n\n MQQueue system_default_local_queue = \n qMgr.accessQueue(\"PHYSICAL_QUEUE_NAME\", // *****Get an exception on this call*****\n openOptions, \n null, \n null, \n null); \n\n System.out.println(\"****Current Depth is \"+ system_default_local_queue.getCurrentDepth());\n\n MQMessage hello_world = new MQMessage(); \n hello_world.writeUTF(\"Hello World!\"); \n\n\n MQPutMessageOptions pmo = new MQPutMessageOptions(); \n\n\n system_default_local_queue.put(hello_world,pmo); \n System.out.println(\"Put the message\");\n\n\n system_default_local_queue.close(); \n\n // Disconnect from the queue manager \n\n qMgr.disconnect(); \n\n } \n\n catch (MQException ex) \n { \n System.out.println(\"An MQSeries error occurred : Completion code \" + \n ex.completionCode + \n \" Reason code \" + ex.reasonCode); \n\n ex.printStackTrace();\n } \n catch (java.io.IOException ex) \n { \n System.out.println(\"An error occurred whilst writing to the message buffer: \" + ex); \n } \n\n\n\n}}om.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2035\n at com.ibm.mq.MQQueueManager.accessQueue(MQQueueManager.java:2858)\n at org.ku.benchmarkos.MQSniffer.main(MQSniffer.java)Any help is appreciated!Thanks\nJ### Assistant: WMQ checks permissions on the first object encountered. So if you open an alias, the permissions are checked on the alias and not the base queue. If you open a base queue, the permissions are checked on the base queue and not on any aliases that may point to it. There is no expectation that the ability to open an alias implies an ability to open the base queue. One would need to run setmqaut against both the alias and the base queue with the appropriate permissions.I have a longer explanation posted here:Understanding WebSphere MQ authorization and the setmqaut command.\n"} +{"text": "### Human: I have an application that uses WebSphere MQ Java API along with a configuration (xml) file to access MQ. I would like to migrate to WebSphere JMS API. For this i try creating \n1) WebSphere MQ Queue Connection factory and 2) WebSphere MQ Queue destinations from my local WAS. When i configure my Queue destinations and try to set my MQ Config parametes i get an error message like \"WMSG0316E: You tried to view a Queue that was not a local Queue. Only administration of local Queues is supported.\"The message is correct in the sense that i am trying to connect to a remote queue. Now, cant i configure my WAS as an MQ client trying to connect to a remote Queue ? The MQ Client has the necessary MQ JMS jars in the server classpath.Would appreciate if anyone could throw some light into this.### Assistant: I'm working on this same issue - I've found articles where the authors confirm that WebSphere has to be told that \"client to remote queue\" mode is desired, but I have yet to find details on how to do that, beyond one author mentioning an environment variable.Still searching ... I'll post the solution if I find one.\n"} +{"text": "### Human: We are trying to set up a jms connection from tomcat toward IBM MQSeries, with the concern to make connection pooling.We have followed the link below, with the solution suggested :WebSphere MQ connection pooling with TomcatI don't know how we can manage the different jms connections with the method suggested, we have made tests, and we have noticed that CachingConnectionFactory manage different jms session and not jms connection.I share with you the link below, in which it is explained that CachingConnectionFactory does not allow to manage different jms connection but just jms sessions !https://jira.spring.io/browse/SPR-13586I also share with you , both files context.xml (datasource and services.xml (spring services file)context.xml\n\nservices.xml\n\n \n \n\n\n\n\n \n \n\n\n\n \n \n \n\n\n\n\n\n \n \n \n \n \nBest regards.### Assistant: SummaryYou need to either upgrade to a later version of the MQ classes for JMS or have your MQ admin increase the MAXINST/MAXINSTC settings to allow more channel instances.Note the version you are using has been out of support since 2012 so I would recommend upgrading.Product Version Release End of Service\n============ ======= ========== =================\nWebsphere MQ 6.0 2005-06-24 2012-09-30BACKGROUND INFO FROM COMMENTSBased on what you provided in comments the following information is known about your current setup:IBM MQ Server version: 8.0.0.? (specific maintenance level unknown)\nIBM MQ jar names: mq-7.0.0.jar and mqjms-7.0.0.jar\nIBM MQ jar version: 6.0.2.11\nSVRCONN Channel settings: SHARECNV(10) MAXINST(9) MAXINSTC(9)Note that even though the jar files have names that contain the string 7.0.0, they are actually from IBM MQ v6.0.2.11 (technically it was called Websphere MQ at that time).The other StackOveflow question \"WebSphere MQ connection pooling with Tomcat\" you point to is referencing the fact that the IBM MQ prior to v7.0 (for example v6.0) provided connection pooling, but this was removed at MQ v7.0, and was asking how to get similar functionality at v7.0 and later.The v6 connection pooling was the default in MQ v6.0 JMS as described on page 504 of the \"WebSphere MQ Using Java Version 6.0\" manual:setUseConnectionPoolingpublic void setUseConnectionPooling(boolean usePooling);Chooses whether to use connection pooling. If you set this to true,\n JMS enables connection pooling for the lifetime of any connections\n created through the ConnectionFactory. This also affects connections\n created with usePooling set to false; to disable connection pooling\n throughout a JVM, ensure that all ConnectionFactories used within the\n JVM have usePooling set to false.In the fact that the connection pooling was removed in MQ v7 is documented in the IBM MQ v8.0 Knowledge Center pageDeveloping applications>Developing JMS and Java Platform, Enterprise Edition applications>Using IBM MQ classes for JMS>IBM MQ classes for JMS>Class MQConnectionFactorysetUseConnectionPoolingpublic void setUseConnectionPooling(boolean usePooling)Deprecated. JMS does not use connection pooling anymore.Any connection pooling\n should be done using the facilities provided by the App Server. Set the use of\n ConnectionPooling in earlier versions of the WebSphere MQ classes for\n JMS.This method is retained for compatibility with older MQJMS\n applications, but, because this Connection Pooling functionality has\n been removed from version 7, setting this property will have no\n effect.To explain the behavior you see today you also need to to know about MQ Client channel shared conversations behavior that was added in MQ v7.0, you can read about this in the IBM MQ v8.0 Knowledge Center pageMigrating and upgrading>Introduction to IBM MQ migration>Coexistence, compatibility, and interoperability>MQI client: Default behavior of client-connection and server-connection channels. Quoting a few specifics below:In Version 7.0 the default settings for client and server connection\n channels changed to use shared conversations. This change affects the\n behavior of heartbeats and channels exits, and can have an impact on\n performance.Before Version 7.0, each conversation was allocated to a different\n channel instance. From Version 7.0, the default for client and server\n connections is to share an MQI channel. You use the SHARECNV (sharing\n conversations) parameter to specify the maximum number of\n conversations that can be shared over a particular TCP/IP client\n channel instance. The possible values are as follows:SHARECNV(0)This value specifies no sharing of conversations over a TCP/IP socket. The channel instance behaves exactly as if it was a Version\n 6.0 server or client connection channel, and you do not get the extra features such as bi-directional heartbeats that are available when you\n set SHARECNV to 1 or greater. Only use a value of 0 if you have\n existing client applications that do not run correctly when you set\n SHARECNV to 1 or greater.Putting this all together, you have a SVRCONN channel with the following settings:SHARECNV(10)MAXINST(9)MAXINSTC(9)These settings when used with a MQ v7.0 and later client would mean that you could have 9 channel instances (TCP connections) between the client and queue manager and each of those could have 10 shared conversations for a total max of 90 conversations.Because you are using MQ v6.0 classes for JMS the channel is operating as if the setting were:SHARECNV(0)MAXINST(9)MAXINSTC(9)This means that can have 9 channel instances (TCP connections) between the client and the queue manager and each of those supports only a single conversation.At MQ v6.0 classes for JMS each underlying JMS connection and every JMS session that is created on top of the JMS connection will allocate a channel instance to the queue manager.To understand more about how connection and sessions interact with each other and with the SHARECNV setting look at the IBM MQ v8.0 Knowledge Center pageDeveloping applications>Developing JMS and Java Platform, Enterprise Edition applications>Using IBM MQ classes for JMS>Writing IBM MQ classes for JMS applications>Accessing IBM MQ features>Sharing a TCP/IP connection in IBM MQ classes for JMS:Every JMS connection and JMS session that is created by a JMS application creates its own conversation with the queue manager.In your case because you are using MQ v6.0 classes for JMS each \"conversation\" is a MQ channel instance (TCP connection) to the queue manager.I would recommend you get a current IBM MQ classes for Java version to use, this would then allow you to have up to 90 shared conversations. If contention is an issue you would need to have your MQ admin increase theMAXINST/MAXINSTCsettings and decreaseSHARECNV.ForIBM MQ Classes for JMSyou can find the list of files required on the IBM MQ v9 Knowledge Center page \"What is installed for IBM MQ classes for JMS\":Relocatable JAR filesWithin an enterprise, the following files can be moved to systems that need to run IBM MQ classes for JMS:com.ibm.mq.allclient.jarcom.ibm.mq.traceControl.jarjms.jarfscontext.jarproviderutil.jarThe Bouncy Castle security provider and CMS support jarsThe fscontext.jar and providerutil.jar files are required if your application performs JNDI lookups using a file system context.The Bouncy Castle security provider and CMS support jar files are required. For more information, see Support for non-IBM JREs.Note that onlycom.ibm.mq.allclient.jar,jms.jar, and the Bouncy Castle security provider and CMS support jars are included in the Redistributable client, but all are included in Java All client. You are also running 9.0.0.0 and I would recommend you go to 9.0.0.5. You can find both the Redistributable and Java All clients onFix Central.\n"} +{"text": "### Human: We have a IBM MQ v8 setup setup with 1 high volume non-persistent queue and many consumers (50+) on that queue. The large number of consumers is needed to be able to process the volume of messages being published on the queue.What we now notice is that the queue manager is not distributing the messages evenly over the X consumers. A few consumers get up to 300 message per minute, while many other consumers only get a few messages per minute (<10). And, there are many messages on the queue and the queue depth is steadily increasing. CPU and memory on the consumer side are not a problem, utilization of both is < 50%.Can someone explain how IBM MQ queue manager is distributing messages over multiple consumers? And is it possible to influence this either on server or on consumer side such that messages are distributed more evenly over the available consumers?Added after Mark Taylors responseThe challenge we face is that there are >10.000 messages added to the queue per minute and we're not able to consume them fast enough. Our current setup is that we have a simple consumer that is running in a Docker container and we scale by running multiple Containers. Running 12 consumers (Docker containers) does increase the overall throughput, running 50+ consumers does not add any throughput. Each consumer is simple:1. connect to queue manager\n2. Connect to queue\n3. While true\n - Get message from queue\n - Process message (commenting this out does not increase overall performance)How can we get achieve more message consume performance? Would it for example help if within one container we connect to the queue manager once and then have multiple threads use that same queue manager to connect to the queue and get the messages? Or should we even reuse the queue over multiple threads?Regards,Gero### Assistant: MQ's default behaviour is to give messages to the MOST RECENT getter. That generally improves performance as that process is most likely to be \"hot\" (in the processor cache). So you should not expect equal distribution of messages. If you are seeing one application getting most messages that implies that it is regularly getting through processing one message before another is available for retrieval. It is rejoining the queue of waiters before the next message is available.There are many aspects that affect overall performance including transactionality, retrieval criteria, contention etc so it's not really possible to say what your problem is, or whether changing that default distribution algorithm (there is an undocumented tuning parm that reverses the queue of waiters) would help. And having client connections where the waiting is really being done by the \"proxy\" svrconn processes and threads makes it more complicated.\n"} +{"text": "### Human: I am trying to connect to IBM MQ using JMS and client channel definition table (CCDT). I was able to connect successfully to the QueueManager when i specify the MQ properties individually.\nBut when i try to use CCDT file i get the below exception.As client channel definition table (CCDT) is used to determine the channel definitions used by client applications to connect to the queue manager i didnt set QueueManager Name.ERROR> com.ssc.ach.mq.JMSMQReceiver[main]: errorMQJMS2005: failed to create MQQueueManager for ''\njavax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for ''\n at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:586)\n at com.ibm.mq.jms.MQConnection.createQM(MQConnection.java:2110)\n at com.ibm.mq.jms.MQConnection.createQMNonXA(MQConnection.java:1532)\n at com.ibm.mq.jms.MQQueueConnection.(MQQueueConnection.java:150)\n at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:174)\n at com.ibm.mq.jms.MQQueueConnectionFactory.createConnection(MQQueueConnectionFactory.java:1066)Iam using the.setCCDTURL(ccdt);method to set the CCDT URL.private MQQueueConnectionFactory mqQueueConnectionFactory = new MQQueueConnectionFactory();\n mqQueueConnectionFactory.setCCDTURL(ccdt);\n queueConnection = mqQueueConnectionFactory.createConnection(username, pwd);When i try to connect using below configuration instead of the CCDT file it connects to the MQ.mqQueueConnectionFactory.setHostName(host);\n mqQueueConnectionFactory.setChannel(channel);\n mqQueueConnectionFactory.setPort(port);\n mqQueueConnectionFactory.setQueueManager(qManager);\n mqQueueConnectionFactory.setTransportType(1);Do i need to set setQueueManager as well along with the CCDT file , as the exception saysfailed to create MQQueueManager for ''### Assistant: The CCDT is not meant to be read in a text editor, it is a binary formatted file. One of the parameters in the CCDT for eachCLNTCONNchannel isQMNAME. Knowing whatQMNAMEis set to and how manyCLNTCONNchannels you have defined in the CCDT and what you want to accomplish will help figure out what value if any should be specified for withsetQueueManager.If there is only oneCLNTCONNchannel then you could specify the following and it will connect using the single channel no matter what the QMNAME property is set to:setQueueManager(\"*\");If there is more than oneCLNTCONNchannel in the file each with a differentQMNAMEspecified, assuming the name matches the actual queue manager name listening on the host and port associated with the channel you would pass the queue manager name:setQueueManager(\"QMGRNAME\");If there is more than oneCLNTCONNchannels in the file each with the sameQMNAMEspecified where this name is not meant to reflect a actual queue manager name listening on the host and port associated with each channel, this is known as a queue manager group, this would be intended where you want the client to connect to any number of different hosts and ports and you do not need to know which queue manager you are connecting to, in this case you would pass the queue manager group name prefixed with a*:setQueueManager(\"*QMGRGROUPNAME\");Another variation of the above is if there is more than oneCLNTCONNchannels in the file each with an all blank (spaces) or NULLQMNAMEspecified, this is known as a queue manager group, this would be intended where you want the client to connect to any number of different hosts and ports and you do not need to know which queue manager you are connecting to, in this case you would pass the queue manager name as either a single spaceor nothing at all ``:setQueueManager(\" \");\n//or\nsetQueueManager(\"\");The last use case above would likely work if you did not use setQueueManager at all.If you want to view the contents of the CCDT, you can use the runmqsc command that comes as part of the MQ v8 and higher client or server install.For Unix ksh/bash shells use the following:export MQCHLLIB=PATH/OF/CCDT\nexport MQCHLTAB=NAME_OF_CCDT\nrunmqsc -nFor Windows use the following:set MQCHLLIB=PATH/OF/CCDT\nset MQCHLTAB=NAME_OF_CCDT\nrunmqsc -nOnce the runmqsc program has started and displayedStarting local MQSC for 'NAME_OF_CCDT'.you can run the following command to see the channel details:DIS CHL(*)Below is a more specific command to narrow the number of fields returned:DIS CHL(*) QMNAME CONNAME\n"} +{"text": "### Human: How should the following userid/password property expressions translated into blueprint \"bean\" notation?MQQueueConnectionFactory connectionFactory = new MQQueueConnectionFactory();\n\nconnectionFactory.setBooleanProperty(WMQConstants.CAPABILITY_USERNAME_PASSWORD, true); //XMSC_CAPABILITY_USERNAME_PASSWORD\nconnectionFactory.setStringProperty(WMQConstants.USERID, \"admin\"); //\"XMSC_USERID\"\nconnectionFactory.setStringProperty(WMQConstants.PASSWORD, \"passw0rd\"); //XMSC_PASSWORDWhen deploying to JBoss Fuse, the camel-route.xml (blueprint) chokes on the userid, password part...\n\n\n \n \n aaa.bbb.ccc*\n \n \n\n \n\n \n\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \nQUESTION: How should the above user and password properties be written as proper blueprint \"bean\" property notation?please note:the java code, when run in a standalone client works fine. -Apparently, \"WMQConstants.USERID\" resolves to \"XMSC_USERID\"... -at least according to my NetBeans debugger. :-)On deploy getting the following error...org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to find property descriptor XMSC_USERID on class com.ibm.mq.jms.MQQueueConnectionFactorySOLUTION FOUND! :-)NOTE: I did not receive a direct answer as to how to convert the java property setter statements in to blueprint \"beans\". But, thanks to help/postings from generous individuals, I arrived at the working solution, below...:I included relatively full code/context, i.e., to enable others to arrive at the solution more quickly than I did :-)aaa.bbb.ccc.CamelRestRoutes.javapackage aaa.bbb.ccc;\n\nimport org.apache.camel.builder.RouteBuilder;\nimport org.apache.camel.model.rest.RestBindingMode;\n\npublic class CamelRestRoutes extends RouteBuilder {\n\n public CamelRestRoutes() {\n }\n\n @Override\n public void configure() throws Exception {\n\n restConfiguration().component(\"restlet\")\n .host(\"localhost\")\n .port(8182)\n //.bindingMode(RestBindingMode.json_xml);\n .bindingMode(RestBindingMode.json);\n\n rest(\"/service\")\n //.bindingMode(RestBindingMode.json_xml)\n .bindingMode(RestBindingMode.json)\n .get(\"/getAll\")\n .produces(\"application/json\")\n .to(\"direct:thingX\");\n\n from(\"direct:thingX\")\n .to(\"bean:camelRestService?method=getAll\")\n .log(\"---------------------- (AAA) ----------------------> direct:thingX...:\" + body().toString())\n .to(\"direct:thingY\");\n\n from(\"direct:thingY\")\n .log(\"---------------------- (BBB) ----------------------> direct:thingY...:\" + body().toString())\n .to(\"direct:thingZ\");\n\n from(\"direct:thingZ\")\n .log(\"---------------------- (CCC) ----------------------> direct:thingZ...:\" + body().toString())\n .to(\"wmq:queue:mylocalqueue?jmsMessageType=Text&exchangePattern=InOnly\"); \n }\n}aaa.bbb.ccc.CamelRestService.javapackage aaa.bbb.ccc;\n\nimport aaa.bbb.ccc.model.CamelRestPojo;\nimport javax.ws.rs.GET;\nimport javax.ws.rs.Path;\nimport javax.ws.rs.Produces;\nimport java.util.Collection;\nimport java.util.HashMap;\nimport java.util.Map;\nimport javax.ws.rs.core.MediaType;\n\n@Path(\"/service/\")\npublic class CamelRestService {\n\n Map itemMap = new HashMap<>();\n\n public CamelRestService() {\n init();\n }\n\n @GET\n //@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})\n @Produces({MediaType.APPLICATION_JSON})\n @Path(\"/getAll/\")\n public Collection getAll() {\n System.out.println(\"====================== (getAll) ---------------------->\");\n return itemMap.values();\n }\n\n final void init() {\n System.out.println(\"---------------------- (init) ---------------------->\");\n CamelRestPojo o = new CamelRestPojo();\n o.setName(\"JOE BLOW\");\n o.setId(100);\n itemMap.put(o.getId(), o);\n }\n}aaa.bbb.ccc.model.CamelRestPojopackage aaa.bbb.ccc.model;\n\nimport java.io.Serializable;\npublic class CamelRestPojo implements Serializable {\n\n private long id;\n private String name;\n\n public long getId() {\n return id;\n }\n public void setId(long id) {\n this.id = id;\n }\n\n public String getName() {\n return name;\n }\n public void setName(String name) {\n this.name = name;\n }\n\n @Override\n public String toString() {\n return \"CamelRestPojo{\" + \"id=\" + id + \", name=\" + name + '}';\n }\n}camel-route.xml\n\n \n \n aaa.bbb.ccc\n \n \n\n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n\n \n \n \npom.xml\n\n 4.0.0\n\n aaa.bbb.ccc\n camelRest\n 1\n bundle\n camelRest\n camelRest\n\n \n UTF-8\n true\n 8.0.0.7\n \n\n \n \n org.slf4j\n slf4j-log4j12\n 1.7.25\n provided \n \n \n org.slf4j\n slf4j-api\n 1.7.25\n provided \n \n \n org.apache.camel\n camel-core\n 2.17.0\n provided\n \n \n org.apache.camel\n camel-restlet\n 2.17.0 \n provided \n \n \n org.apache.camel\n camel-cxf\n 2.17.0\n provided \n \n \n com.ibm.mq\n allclient\n ${mq.version}\n provided \n \n \n com.ibm.mq\n jms\n ${mq.version}\n provided\n \n\n \n\n \n ${project.artifactId}-${project.version}\n\n \n \n src/main/resources\n true\n \n \n\n \n \n org.apache.maven.plugins\n maven-compiler-plugin\n 3.1\n \n 1.8\n 1.8\n true\n \n \n \n org.apache.felix\n maven-bundle-plugin\n 3.3.0\n true\n \n \n ${project.groupId}.${project.artifactId}\n aaa.bbb.ccc* \n * \n \n \n \n \n \nhere is the contents of the jboss fuse \"deploy\" folderC:\\tools\\jboss-fuse-6.3.0.redhat-187\\deploy>dir\n Volume in drive C is OSDisk\n Volume Serial Number is D89B-75DE\n\n Directory of C:\\tools\\jboss-fuse-6.3.0.redhat-187\\deploy\n\n08/17/2017 01:49 PM .\n08/17/2017 01:49 PM ..\n08/17/2017 01:49 PM 7,975 camelRest-1.jar\n06/29/2017 01:00 AM 159,649 com.ibm.mq.osgi.allclientprereqs_8.0.0.7.jar\n06/29/2017 01:00 AM 8,011,749 com.ibm.mq.osgi.allclient_8.0.0.7.jar\n06/29/2017 01:00 AM 4,088,715 com.ibm.mq.osgi.java_8.0.0.7.jar\n06/29/2017 01:00 AM 171,064 com.ibm.msg.client.osgi.commonservices.j2se_8.0.0.7.jar\n06/29/2017 01:00 AM 48,715 com.ibm.msg.client.osgi.jms.prereq_8.0.0.7.jar.DISABLE\n06/29/2017 01:00 AM 639,807 com.ibm.msg.client.osgi.jms_8.0.0.7.jar\n06/29/2017 01:00 AM 216,218 com.ibm.msg.client.osgi.nls_8.0.0.7.jar\n06/29/2017 01:00 AM 279,861 com.ibm.msg.client.osgi.wmq.nls_8.0.0.7.jar\n06/29/2017 01:00 AM 92,406 com.ibm.msg.client.osgi.wmq.prereq_8.0.0.7.jar\n06/29/2017 01:00 AM 7,963,226 com.ibm.msg.client.osgi.wmq_8.0.0.7.jar\n09/15/2016 04:19 AM 873 README\n 12 File(s) 21,680,258 bytes\n 2 Dir(s) 143,871,660,032 bytes free\n\nC:\\tools\\jboss-fuse-6.3.0.redhat-187\\deploy>other notes...fwiw, I had add following features: \n\n -camel-jackson\n -camel-restlet\n\n(I'm sure your \"mileage will vary\" as you tinker to make your IBM MQ app work, etc)\n\nAlso, fwiw, running: \n features:list | grep \"jms\" \nyields....\n\n JBossFuse:karaf@root> features:list | grep \"jms\"\n [installed ] [2.4.0.redhat-630187 ] jms karaf-enterprise-2.4.0.redhat-630187 JMS service and commands\n [installed ] [2.17.0.redhat-630187 ] camel-jms camel-2.17.0.redhat-630187\n [uninstalled] [2.17.0.redhat-630187 ] camel-sjms camel-2.17.0.redhat-630187\n [uninstalled] [3.1.5.redhat-630187 ] cxf-transports-jms cxf-3.1.5.redhat-630187\n [uninstalled] [2.1.0.redhat-630187 ] switchyard-jms switchyard-2.1.0.redhat-630187\n [uninstalled] [2.1.0.redhat-630187 ] switchyard-quickstart-bpel-jms-binding switchyard-2.1.0.redhat-630187\n [uninstalled] [2.1.0.redhat-630187 ] switchyard-quickstart-camel-jms-binding switchyard-2.1.0.redhat-630187\n [uninstalled] [2.1.0.redhat-630187 ] switchyard-demo-security-propagation-jms switchyard-2.1.0.redhat-630187\n [uninstalled] [1.1 ] jms-spec activemq-core-5.11.0.redhat-630187 JMS spec 1.1 libraries\n [installed ] [2.0 ] jms-spec activemq-core-5.11.0.redhat-630187 JMS spec 2.0 libraries\n [uninstalled] [1.1 ] jms-spec-dep activemq-core-5.11.0.redhat-630187 JMS spec 1.1 dependency\n [installed ] [2.0 ] jms-spec-dep activemq-core-5.11.0.redhat-630187 JMS spec 2.0 dependency\n [uninstalled] [5.11.0.redhat-630187 ] activemq-jms-spec-dep activemq-core-5.11.0.redhat-630187 ActiveMQ broker libraries\n [installed ] [3.2.16.RELEASE_1 ] spring-jms spring-2.4.0.redhat-630187 Spring 3.2.x JMS supportSpecial thank you to all who helped me on the pain-staking journey that landed this solution! :-)### Assistant: XMSis IBM's implementation of a JMS like interfaces in non-Java languages like C# and C++. XMS constants would not be present in the IBM MQ Classes for JMS libraries.I took your sample and changed the names of some of the beans and wrapped theMQQueueConnectionFactorywithorg.springframework.jms.connection.UserCredentialsConnectionFactoryAdapterto pass the credentials.UPDATE:In reading the source for Apache Camel'sorg.apache.camel.component.jms.JmsComponentit appears that if it is provided with a username and password it will wrap the connection factory with UserCredentialsConnectionFactoryAdapter automatically.Try with the following changes:\n \n \n \n \n \n \n\n\n \n \n\n\n\n \n \n \n\n"} +{"text": "### Human: As part of the installation of our application, I need to put a bunch of xml messages into an MQ queue. To make it more complicated, the messages need to have the usr-folder of the RFH2-header set.I found thatmqput2.exefrom the IBM RFHUtil is an ideal tool for this task. Unfortunately, I have been unable to make setting of the usr-folder work, the documentation is too vague. What am I doing wrong? Or, is there another command-line tool available that works better?My prop. file formqput2looks like this:[header]\n.....\n*\n* message type\n*\n* Allowed values for message type\n* 1 - request\n* 2 - reply\n* 4 - report\n* 8 - datagram\n* 112 - MQE fields from MQE\n* 113 - MQE fields\n* 65536 to 999,999,999 - user\nmsgtype=8\n.....\n*\n* rfh usage\n* rfh = N for No rfh\n* rfh = A for Automatic (look for RFH at beginning of data file)\n* rfh = 1 or V1 for Version 1 rfh from parameters in parm file\n* rfh = 2 or V2 for Version 2 rfh from parameters in parm file\n* rfh = X for special V2 rfh with fixed portion only and format=xml\n*\n* only first character checked, except for V when second character is also checked\n*\nrfh=X\n\n\n RDS.Codebook.Changes\n\n.....\n[filelist]\nfile1.xmlmqput2simply ignores thesection and doesn't include it with the message. I've also triedrfh=Aand put thesection at the beginning of thefile1.xmlfile, but then I get MQPUT errorreason=2142(invalid MQ header structure).### Assistant: Also dmpmqmsg utility, which is part of the WMQ8 installation, can be used for sending the messages from command-line. A message can be exported from a queue including the headers viadmpmqmsg -m queue_manager> -I -f -aand then submitted again via (I think, consult the docs)dmpmqmsg -m queue_manager> -o -f This utility is however not part of WMQ 7.5.\n"} +{"text": "### Human: I'm using simple Spring JmsTemplate to send messages onto a MQ.\n \n \n \n \n false\n \n \n 1000\n \n\n\n This works fine, however, My client application isn't able to process the message as the message format is in 'MQHRF2' by default.\nHow can I alter my MQ headers so as to send explicitly MQSTR format.Thanks in advance.### Assistant: You must set the property targetcllient=1 to send the msg as MQSTR.\nTo do this in sending part of java code, change the queue name as belowString senderQ = \"queue:///MYQUEUENAME?targetClient=1\";\njmsTemplate.send(senderQ, new MessageCreator() {\n public Message createMessage(Session session) throws JMSException {\n TextMessage message = session.createTextMessage(text);\n message.setJMSReplyTo(replyToQ);\n return message;\n }\n});Alternatively you can try setting this in jmstemplate bean\n \n \n \n\n"} +{"text": "### Human: I have a MQ spring jms application that has been working fine using SSL channel. However after a recent java security patch that was applied the application stopped working with below error.Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2397' ('MQRC_JSSE_ERROR').\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:209) ~[com.ibm.mqjms-7.5.0.0.jar:7.5.0.0 - p000-L120604]\n ... 45 common frames omitted\nCaused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)\n at sun.security.ssl.Handshaker.activate(Handshaker.java:438) ~[na:1.6.0_34]\n at sun.security.ssl.SSLSocketImpl.kickstartHandshake(SSLSocketImpl.java:1414) ~[na:1.6.0_34]I notice that the new java security file has this line added that is causing this failure in SSL connection to MQ.jdk.tls.disabledAlgorithms=SSLv3I can not get this line removed as this is shared environment, what are my options to make this work. I am using MQQueueConnectionFactory configured and injected into my spring JMS components.Thank you### Assistant: Can you not use this -java.security.Security.setProperty(\"jdk.tls.disabledAlgorithms\",\"\")This change was introduced in JDK8.\n"} +{"text": "### Human: we have a major problem with many of our Applications making improper connections (SVRCONN) with queue manager and not issuing MQDISC when connection not required. This causes lot of idle stale connections and prevents Application from making new connections and fails with CONNECTION BROKEN (2009) error. We have been restricting Application connections with clientidle parameter in our Windows MQ on version 7.0.1.8 but when we migrated to MQ v7.5.0.2 in Linux platform we are deciding on the best option available in the new version. We do not have clientidle anymore in ini file for v7.5 but has DISCINT & KAINT in SVRCONN channels. I have been going through the advantages and disadvantages of both for our scenario of Application making connections through SVRCONN channels and leave connections open without issuing a disconnect. Which of these above channel attributes is ideal for us. Any suggestions? Does any of these take precedence over the other??### Assistant: First off,KAINTcontrols TCP functions, not MQ functions. That means for it to take effect, the TCPKeepalivefunction must be enabled in theqm.iniTCP stanza. Nothing wrong with this, but the nativeHBINTandDISCINTare more responsive than delegating to TCP. This addresses the problem that the OS hasn't recognized that a socket's remote partner is gone and cleaned up the socket. As long as the socket exists and MQ's channel is idle, MQ won't notice. When TCP cleans the socket up, MQ's exception callback routine sees it immediately and closes the channel.Of the remaining two,DISCINTcontrols the interval after which MQ will terminate an idle butactivesocket whereasHBINTcontrols the interval after which MQ will shut down an MCA attached to anorphansocket. Ideally, you will have a modern MQ client and server so you can use both of these.TheDISCINTshould be a value longer than the longest expected interval between messages if you want the channel to stay up during the Production shift. So if a channel should have message traffic at least once every 5 minutes by design, then aDISCINTlonger than 5 minutes would be required to avoid channel restart time.TheHBINTactually flows a small heartbeat message over the channel, but only will do so ifHBINTseconds have passed without a message. Thsi catches the case that the socket is dead but TCP hasn't yet cleaned it up.HBINTallows MQ to discover this before the OS and take care of it, including tearing down the socket.In general, really low values forHBINTcan cause lots of unnecessary traffic. For example,HBINT(5)would flow a heartbeat every five second interval in which no other channel traffic is passed. chances are, you don't need to terminate orphan channels within 5 seconds of the loss of the socket so a larger value is perhaps more useful. That said,HBINT(5)would cause zero extra traffic in a system with a sustained message rate of 1/second - until the app died, in which case the orphan socket would be killed pretty quick.For more detail, please go to theSupportPacs pageand look for the Morag's \"Keeping Channels Running\" presentation.\n"} +{"text": "### Human: I am having a ongoing problem trying to create a topic publisher from seemingly simple java code. My WMQ is administered separately in the company so I have no direct control of it.I try to connect to the topic by creating aTopicConnection, then aTopicSessionand then aTopicPublisher, using fairly standard Java code albeit over SSL so setting some additional system props. However I have the same problem with or without SSL I am fairly certain.On the linethis.topicPublisher = this.topicPublisherSession.createPublisher(this.topic);a WMQ exception is raised as followsCaused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED').\nat com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:209)The WMQ administrator can provide a \"fix\" for me by granting auths on theSYSTEM.BASE.TOPIC. However this is disallowed by company risk policy.I have been asked why do I need access to the base topic, but of course I do not need that access. I just simply need to publish to my topic.Any WMQ experts got any other ideas please?\nThanks so much.### Assistant: MQ maintains a Topic Tree for managing publish/subscribe. By default access for non-admin users to the topic tree is not allowed. The root of the topic tree resolves attributes from SYSTEM.BASE.TOPIC.When an application attempts to create a publisher with a topic, MQ makes authority checks using the topic string specified. MQ searches the topic tree for a node that matches the given topic string. If a match is found, authority to publish or subscribe is determined. If the user has enough authority, then create publisher call will succeed. If no nodes match, then MQ goes up to the root of the topic tree to determine authority.In your case, your application has specified a topic string that does not match any of the nodes defined in the topic tree. MQ attempted to determine authority at the root. Since you do not have the publish authority, the call is failing with 2035 reason code.So what can be done? Instead of providing access to SYSTEM.BASE.TOPIC, ask your administrator create a topic with topic string your application is using and provide youpublishauthority.\n"} +{"text": "### Human: Getting below error with MQ(Message Queue), how to resolve this?Message : com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ1107: A problem with\nthis connection has occurred. An error has occurred with the WebSphere MQ JMS\nconnection. Use the linked exception to determine the cause of this error.Caused by [1] -->Message : com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with\ncompcode '2' ('MQCC_FAILED') reason '2009' ('MQRC_CONNECTION_BROKEN').Caused by [3] -->Message : com.ibm.mq.jmqi.JmqiException: CC=2;RC=2009;AMQ9208: Error on receive\nfrom host '/xx.xx.xx.xx:xxxx\n(emb701t7.dci.bt.com)'. [1=-1,2=ffffffff,3=/xx.xx.xx.xx:xxxx\n(emb701t7.dci.bt.com),4=TCP]Please take me forward.### Assistant: I faced the same error and its resolved now!As Magic Wand mentioned in the comment, below error comes up if you have a lower version of MQ jar i.e if your MQ jar version is 7.0.1.5 or belowCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2009;AMQ9208: Error on receive from hostThis bug has been fixed in IBM MQ version 7.0.1.6 or higher as mentioned here:http://www-01.ibm.com/support/docview.wss?uid=swg1IV00348Add the newer version of below ibm.mq jars and make sure you have the additional jars too mentioned below:com.ibm.mq.commonservices.jar \ncom.ibm.mq.jar \ncom.ibm.mq.jmqi.jar \ncom.ibm.mqbind.jar \ncom.ibm.mqjms.jar \nfscontext.jar \njms-1.1-20020430.jar\nproviderutil.jar\n"} +{"text": "### Human: I have a Java client that connects to MQ with 10 connections. These remain open for the duration that the Java client runs. For each thread we create a message, create a session, send the message and close the session. We are using the Spring CachingConnectionFactory and have a sessionCacheSize of 100. We have been told by our MQ engineering team is that that our queue manager has a max connections of 500 and that we are exceeding this. The QM.ini file has:maxChannels=500\nmaxActiveChannels=256\nmaxHandles=256What I have observed in MQ explorer is that the open output count on the queue remains static at 10, however if we load balance across 2 queues it's 10 on each, even though we still only have 10 connections. So what I'd like to know is what do jms connections and sessions equate to in MQ terminology?I did think that a connection equates to an active channel and a session is a handle, so it was the handles that we were possibly exceeding as the amount of sessions we open (and close) run into hundreds or thousands, whereas we only have 10 connections. Although going against this, the snippet below from IBM's Technote \"Explanation of connection pool and session pool settings for JMS connection factories\", suggests that the max channels should be greater than the max sessions, however we never know this as it depends on the load (unless this should be greater than the sessionCacheSize?).Each session represents a TCP/IP connection to the queue manager.\n With the settings mentioned here, there can be a maximum of 100 TCP/IP\n connections. If you are using WebSphere MQ, it is important to tune\n the queue manager's MaxChannels setting, located in the qm.ini file,\n to a value greater than the sum of the maximum possible number of\n sessions from each JMS connection factory that connects to the queue\n manager.Any assistance on how best to configure MQ would be appreciated.### Assistant: Assuming that your maximum number of conversations is set to 1 on the MQ Channel (the default is 10 in MQ v7 and v7.5) then a JMS Connection will result in a TCP connection (MQ channel instance) and a JMS Session will result in another TCP connection (MQ channel instance).From your update it sounds like you have 10 JMS Connections configured and the sessionCacheSize in Spring set to 100, so 10 x 100 means 1000 potential MQ channel instances being created. The open output count will show how many 'active' JMS Sessions are attempting send a message and not necessarily how many have been 'cached'.The conversation sharing on the MQ channel might help you here as this defines how many logical connections can be shared over one TCP connection (MQ channel instance). So the default of 10 conversations means you can have 10 JMS Sessions created that operate over just one TCP connection.\n"} +{"text": "### Human: public class PtpReceiver {public static void main(String[] args) {\n // TODO Auto-generated method stub\n try {\n MQEnvironment.hostname = \"192.168.120.28:1415\";\n MQEnvironment.channel = \"SFMS.TO.CBS\";\n MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,\n MQC.TRANSPORT_MQSERIES);\n System.out.println(\"Q manager\");\n MQQueueManager qMgr = new MQQueueManager(\"GSCBBRQM\");\n System.out.println(\"Q manager11\");\n\n }\n\n catch (MQException ex) {\n System.out.println(ex.completionCode+ ex.reasonCode);\n }\n}}I got the error following:MQJE001: Completion Code '2', Reason '2538'.Can any one help me for solve this error### Assistant: That is JMS code for doing a connection via for WMQ for JMS. Bhaumik is using WMQ for Java (non JMS).Bhaumik, you do not specify the port number in the hostname but rather as follows:public static void main(String[] args) {\n try {\n MQEnvironment.hostname = \"192.168.120.28\";\n MQEnvironment.port = 1415;\n MQEnvironment.channel = \"SFMS.TO.CBS\";\n MQQueueManager qMgr = new MQQueueManager(\"GSCBBRQM\");\n }\n\n catch (MQException ex) {\n System.out.println(\"CC=\"+ex.completionCode + \" : RC=\"+ ex.reasonCode);\n }\n}\n"} +{"text": "### Human: This is one of those brain-dead things that I need to do for most the new development servers I set up at work. We used to have the steps documented on our wiki, but that got wiped out recently and so I had to figure this out again.Without the MQ client packages installed, I was seeing the following error when trying to install a Python MQ client library:In file included from mqclient.c:2:0:\n\nmodule.h:6:18: fatal error: cmqc.h: No such file or directory\n\ncompilation terminated.\n\nerror: command 'gcc' failed with exit status 1### Assistant: For future reference, here are the steps that worked for me. These assume you are logged in asrooton theDebian server. These are forversion 7.0.1.10, but I imagine can be more or less easily adapted to other versions.1. InstallalienforrpmpackagesIf not yet installed on your server:apt-get install alien2. Download IBM Websphere packageI believe the 7.0.1 versions can be foundhere, along with links to other versions.3. Unzip package in/tmp/mqclientdirectory and accept licensemkdir /tmp/mqclient\ncp mqc7_7.0.1.10_linuxx86.tar.gz /tmp/mqclient\ntar zxvf mqc7_7.0.1.10_linuxx86.tar.gz\n./mqlicense.shSelect the appropriate option to accept the license.4. Set up mqm useradduser mqm\nusermod -m -d /var/mqm mqm5. Install MQSeries packagesalien --scripts --to-deb MQSeriesRuntime-7.0.1-10.i386.rpm\nalien --scripts --to-deb MQSeriesClient-7.0.1-10.i386.rpm\nalien --scripts --to-deb MQSeriesSDK-7.0.1-10.i386.rpm\ndpkg -i mqseriesruntime_7.0.1-10_i386.deb\ndpkg -i mqseriesclient_7.0.1-10_i386.deb\ndpkg -i mqseriessdk_7.0.1-10_i386.debAnd, voila, hopefully that does it. Remember to double check the paths in these steps against the ones you are actually using for your particular package and best of luck.\n"} +{"text": "### Human: Is there a good best practice about what kind of messages an application is allowed to reject?My understanding is that all messages which can't be handled should be rejected to the dead letter queue - no matter if the problem is a syntax error or a semantic error in the message or if the application is temporarily not able to handle the message (for instance because the db just went down).Of course - if the app already knows upfront that it will not be able to handle a message (DB down), it should stop accepting messages.So what's the common understanding / best practice?### Assistant: My response is with respect to WebSphere MQ:A Dead Letter Queue (DLQ for short) is a place where messages that could not be delivered to their destination are put. Messages can be put on the DLQ by queue managers, message channel agents (MCAs), and applications. All messages on the DLQ must be prefixed with a dead-letter header structure, MQDLH. The MQDLH header is automatically fixed when queue manager or MCAs put messages whereas applications must prefix the MQDLH explicitly.As far applications are concerned, if they are unable to handle the message, say for example the message format is not understood, they can put the message to a BACKOUT queue instead of a DLQ. A BACKOUT queue is just like any normal queue where messages rejected by applications can be put. The advantage of BACKOUT queue is that you can specify a BACKOUT queue on a per queue basis and the messages put there need not have MQDLH header prefixed.An application can be written to read the messages from BACKOUT and route them back to the target queue as it is. However the messages in a DLQ require additional processing to remove the MQDLH before they are put onto a target queue.\n"} +{"text": "### Human: I have few hundreds of messages in my MQ server(using MQ .NET).I am trying to read those one by one, however i am having issue in looping thro' that. I don't have any count/length property that i can use in this regard.mqQueue - MQQueue\nmqQMgr - MQ QueueManagermqQueue = mqQMgr.AccessQueue(queueName, MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_BROWSE);\n mqQueue.Get(mqMsg, mqGetMsgOpts); \n string readMessage = mqMsg.ReadString(mqMsg.MessageLength);How can i loop thro' all the messages in the queue and if there is no message i want exit out. Thanks in advance.### Assistant: Have a look at the sample programs that installed with the WMQ code. By default, these will live inC:\\Program Files (x86)\\IBM\\WebSphere MQ 7.5\\tools\\dotnet\\samples\\cs\\base\\and the one I think you want isSimpleGet.cs.The problem you are having is that you are opening the queue repeatedly. That resets the rowse pointer to the head of the queue eac time. The sample program shows how to open the queue once, then loop through messages until reaching a certain number or until the queue is empty, whichever comes first.// create connection\n Console.Write(\"Connecting to queue manager.. \");\n queueManager = new MQQueueManager(queueManagerName, properties);\n Console.WriteLine(\"done\");\n\n // accessing queue\n Console.Write(\"Accessing queue \" + queueName + \".. \");\n queue = queueManager.AccessQueue(queueName, MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING);\n Console.WriteLine(\"done\");\n\n // getting messages continuously\n for (int i = 1; i <= numberOfMsgs; i++)\n {\n // creating a message object\n message = new MQMessage();\n\n try\n {\n queue.Get(message);\n Console.WriteLine(\"Message \" + i + \" got = \" + message.ReadString(message.MessageLength));\n message.ClearMessage();\n }\n catch (MQException mqe)\n {\n if (mqe.ReasonCode == 2033)\n {\n Console.WriteLine(\"No message available\");\n break;\n }\n else\n {\n Console.WriteLine(\"MQException caught: {0} - {1}\", mqe.ReasonCode, mqe.Message);\n break;\n }\n }\n }The IBM install media with the code samples is downloadable asSupportPac MC75. If for some reason you need a back-level client, they are available from the SupportPacsmain page. However, keep in mind that there has been a lot of engineering in the later releases and you are MUCH better off with the latest version. Any version of MQ client can work with any version of QMgr, but obviously the functionality you get is either that only on the client side (such as the client.ini file) or on the server side, whatever that level of QMgr gives you. In other words, using a V7.5 client with a v7.0 QMgr works fine, but it doesn't give you CHLAUTH rules because the v7.0 QMgr doesn't have those.\n"} +{"text": "### Human: For the following codepublic class JMSSamplePut \n {\n private static String initialContextUrl = null;\n private static String connectionFactoryFromJndi = \"UM_QMGR_QCF\";\n private static String queueFromJndi = \"BCUFXW.EXB.ATHENA.FX.IN\";\n private static String outString = \"A sample text message \" +\n \"from JMSSampleput\";\n private static int retryInterval = 10;\n private static int retryCount = 3;\n private static int connStatus = 1;\n\n\n /**\n * @param args\n */\n public static void main( String[] args ) \n {\n\n // Variables\n Queue ioQueue = null;\n QueueSession session = null;\n QueueSender queueSender = null;\n QueueConnection connection = null;\n QueueConnectionFactory factory = null;\n boolean transacted = false;\n int i = 0;\n\n try { \n // Instantiate the initial context for JNDI\n String contextFactory =\"com.sun.jndi.fscontext.RefFSContextFactory\";\n Hashtable environment = new Hashtable();\n environment.put(Context.INITIAL_CONTEXT_FACTORY, contextFactory);\n environment.put(Context.PROVIDER_URL, \"file:/c:/jndi\"); \n Context context = new InitialDirContext(environment);\n System.out.println(\"Initial context found!\");\n\n // Create a Queue ConnectionFactory\n factory = (QueueConnectionFactory) context.lookup(connectionFactoryFromJndi);\n\n ...........The last line is failing withcaught JMSException: com.ibm.msg.client.jms.DetailedJMSSecurityException: JMSWMQ2013: The security authentication was not valid that was supplied for QueueManager '' with connection mode 'Client' and host name 'NATMIB1.hostname.net(1414)'. Please check if the supplied username and password are correct on the QueueManager you are connecting to\nlinked exception: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED').\nFinishedJVM args-Djavax.net.ssl.keystore=c://keystore//a_dev.jks \\\n-Djavax.net.ssl.keyStorePassword=******** \\\n-Djavax.net.ssl.trustStorePassword=******** \\\n-Djavax.net.ssl.trustStore=c://keystore//cacerts.jks \\\n-Djavax.net.debug=allAny pointers? Why is the following line?security authentication was not valid that was supplied for QueueManager '' with connection mode 'Client' and host name 'NATMIB1.hostname.net(1414)'Looks like the JNDI agent is not able to find the name of the QueueManager? \nI have the following line in .bindings file and the queue manager name is NATMIB1UM_QMGR_QCF/RefAddr/3/Content=NATMIB1.xyz.netThanks in AdvanceSundar### Assistant: Debugging WMQ security errors is dead-simpleifyou have the right tools. First, go getSupportPac MS0Pand install into WMQ Explorer according to the instructions. If you do not have a modern version of WMQ Explorer, you can download it fromSupportPac MS0T.Next, enable authorization events on the QMgr and recreate the error.At this point, right-click on the event queue in WMQ Explorer and select Format Event Messages. This will show you all aspects of the error including:The User ID that generated the error. Depending on the channel setup, exits and the client settings, the ID used may not be the one you expect.The API call that was made. Probably Connect in this case, but sometimes this is also not what you expect. For example, the IBM JMS classes will always inquire on the QMgr to get the DLQ name and if you didn't grant inquire, it fails.The exact options used for the call.The object against which the call was issued.Once you know these elements of the error, you can identify whether it is a problem with the ID itself, the channel, the authorizations for the ID, etc.UpdateIn response to a question in the comments, to enable Authorization Events use MQ Explorer or runmqsc as follows:For the MQ Explorer version, first right-click on the QMgr and select Properties.Then select Events in the nav panel, set the events as required and clickOK.\n"} +{"text": "### Human: I have one MQ cluster environment. At some point, one of the partial repository qmgr broke down while the queueSYSTEM.CLUSTER.REPOSITORY.QUEUE's depth in another qmgr keeps increasing.I kind of don't undersatnd why this happened. I walked through the technote from this linkhttp://www-01.ibm.com/support/docview.wss?uid=swg21193012but I don't understand it. Can someone help explain in more detail and more clearly?Thanks### Assistant: The repository queue contains messages that represent the state of the cluster. The full repository tracks state of all objects and QMgrs in the cluster while the cluster member QMgrs track only the objects they need to know about. Since this is usually a subset, ordinary cluster QMgrs are sometimes referred to as \"partial repositories\" because that is what they contain - a partial subset of the full repository info.The actual format of the messages on the repository queue is not publicly documented. What the Technote explains is that the information is frequently rearranged and compressed so that you should not expect a linear relationship between the number of cluster objects and the depth of the repository queue. Depending on the timing, one message on the repository queue might represent the state of multiple cluster objects or just one. There might even be repository messages representing the state of deleted cluster objects. Generally, partial repositories have fewer messages on the repository queue than do full repositories but if not it usually is not any indication of a problem.What the Technote doesn't explain is that the messages on the repository queue are held under syncpoint and that this distorts the QDepth. For example, the QMgr will read all the cluster repository messages at startup. If it needs to make a change, it performs a GET under syncpoint for the relevant message(s). During the time when these messages are under syncpoint, the queue depth is reduced even though the messages are still there. The apparent and actual depths will match only after aCOMMITorROLLBACK. As the cluster state changes, new messages are put to the queue to reflect the new state. These increase the apparent QDepth immediately, even while the transaction is pendingCOMMITorROLLBACK. Also, the number of messages written may be significantly more or less than the number gotten for any update of the queue.So the upshot of the Technote and my advice is to accept that the SYSTEM.CLUSTER.REPOSITORY.QUEUE is volatile and not to worry to much about its depth. Instead, if you have a monitoring agent, monitor that there is always an open input handle on the queue or that the cluster repository manager process (amqrrmfa) is running, or both.\n"} +{"text": "### Human: Currently I have a queue manager that no matter I do just fails to go away. I am trying to end it and delete it. This is in one of our development servers. Not sure what happened, our server went through host name changes. Currently when I dodspmq, I get:QMNAME(QM_MIT) STATUS(Status not available)endmqmsays:AMQ8146: WebSphere MQ queue manager not available.dltmqmsays:AMQ8041: The queue manager cannot be restarted or deleted because processes,\nthat were previously connected, are still running.\nAMQ7018: The queue manager operation cannot be completed.I googled and found that listener needs to be killed, which I did. I am running WebSphere MQ v7.1 on Linux.What else can I do?### Assistant: Do aps-ef | grep qmgrnameto find any remaining processes that were running as part of the QMgr or that were attached to the QMgr.Next, do a/opt/mqm/bin/amqiclen -x -F -m qmgrnameto get rid of any shared memory segments. The command will fail if you do not provide a fully-qualified path name and try to run it from your$PATHor a relative path.SeeWebSphere MQ utility amqiclen usage and descriptionfor more details.\n"} +{"text": "### Human: I found that PERSISTENT message have much slower performance than NON_PERSISTENT message.\nI sent and received non_persistent messages and the performance is as follows.Method Number of Msg Elapsed Time\n\n Sending - 500 messages - 00:00:0332\n Receiving - 500 messages - 00:00:0281I sent and received persistent messages and the performance is as follows.Sending - 500 messages - 00:07:0688\n Receiving - 500 messages - 00:06:0934This behavior happens in both MQMessage and JMSMessage.Thank all people helping me out the problem.Special thanks to Shashi, T.Rob and Pangea.### Assistant: Given the new title, I find I now have a response to this question.Yes, persistent messages will always take longer than non-persistent messages with all other aspects being equal. The degree to which they are slower is highly tunable, though. In order to get the results that you are seeing it is likely that the queue manager has many of the worst-case tunings. Here are some of the factors that apply:Whether the disk is local or networked. For 100MBS and slower connections talking to NFS mounted over spinning disks, a local drive is almost always much faster. (Mounts to SAN with fiber channel and battery-backed cached controllers are nearly always faster than local spinning drives, however.) A common example is use of consumer-grade NAS drives. As great as home NAS units are, throughput is always slower than local disk.For local drives, the speed of the drive. Newer 'green' drives vary rotational speed to conserve power. Even 7200RPM disks can exhibit performance degredation compared to a 10k RPM drive.For local drives, the degree of fragmentation. Even though the messages are small, they are placed into pre-allocated log files that may be highly fragmented.Putting disk and log files on the same local volume. This causes head contention because a single message is written to both files before control returns to the application.Linear versus circular logs. Linear are slower because the log formatter must allocate them new each time.Whether syncpoint is used or not. If many messages are written in a single unit of work, WMQ can use cached writes and optimize the sector put operations. Only the COMMIT need ever be a blocking call.Since non-persistent messages are handled entirely in memory, or overflowed to at most one disk file, then they are not affected by most of these issues.\n"} +{"text": "### Human: What is the best way to startup automatically Websphere MQ v7.1 queue managers during system startup? I see that there is aSupportPacfor it, just want to make sure this is the right one. We have MQ running over 64-bit Linux. Thanks.### Assistant: Yes,SupportPac MSL1is the correct one for Linux.Some other UNIX flavors can use this SupportPac as-is or with modifications. For Windows, specify the QMgr to be started automatically and the WMQ service will start it.Update 26 Sep 2017Responding to comments from byteborg, I checked and it seems IBM have removed SupportPac MSL1 for some reason, even from the list of withdrawn SupportPacs.As it happens I'm atMQTCthis week and lots of IBMers from Hursley Lab are here so I'll ask then to restore it or put it on Github. If they are able to do so, the internal review process to make that happen is extensive so it won't happen soon. If that doesn't work, I'll see about getting permission to host it myself. Stay tuned.Update 1 Oct 2017While at MQTC, Mark Taylor, the MQ Architect from IBM Hursley Labs, explained the removal of MSL1. Basically, \"it didn't work\" according to Mark. Instead, IBM have provided guidance in the form of an MQDev blog postManaging queue manager startup and shutdown on Linux with systemd. The post does pretty much what the headline says, and describes how to use systemd to start/stop MQ. Please refer to that post for details.\n"} +{"text": "### Human: How can you create a durable architecture environment using MQ Client and server if the clients don't allow you to persist messages nor do they allow for assured delivery?Just trying to figure out how you can build a salable / durable architecture if the clients don't appear to contain any of the necessary components required to persist data.Thanks,S### Assistant: Middleware messaging was born of the need to persist data locally to mitigate the effects of failures of the remote node or of the network. The idea at the time was that the queue manager was installed locally on the box where the application lives and was treated as part of the transport stack. For instance you might install TCP and WMQ as a transport and some apps would use TCP while others used WMQ.In the intervening 20 years, the original problems that led to the creation of MQSeries (Now WebSphere MQ) have largely been solved. The networks have improved by several nines of availability and high availability hardware and software clustering have provided options to keep the different components available 24x7.So the practices in widespread use today to address your question follow two basic approaches. Either make the components highly available so that the client can always find a messaging server, or put a QMgr where the application lives in order to provide local queueing.\n"} +{"text": "### Human: Now I use the websphere MQ client connect to remote MQ Server(7.0 version) using c#, and occurs a problem of authority,Which is the user running the MQ client application have insufficient authority to access qmgr.Then I use the 'setmqaut' command to grand the user sufficient authority and it works.I think it's not very convenient and must be a better way.May via adding user's IP in MQ Server? But I have no idea how to do it.Any suggestions would be greatly appreciated.\nThanks### Assistant: WebSphere MQ does not perform any authentication. Local applications are authenticated by the operating system and so their ID can be trusted. (By definition, if you cannot trust the local OS authentication then the entire server is compromised.) Just as with local connections, WMQ trusts that the ID connecting remotely is genuine. It is up to the WMQ administrator to determine what level of authentication to employ. In WMQ v7 there are two choices - authenticate with SSL/TLS channels, or use a channel exit to authenticate.In either case, it is the channel's MCAUSER value that decides what ID is used for authorization. If the MCAUSER is left blank then the channel will use the user ID that the client sends. In your case you received a 2035 error because the client sent an ID that was not in the administrative (mqm) group. Had your client sent the ID 'mqm' (or on Windows 'MUSR_MQADMIN'), the connection would have succeeded. If your program is Java or JMS, the ability to select the ID presented is part of the API. Just tell the QMgr who you want to be.If you are willing to allow remote connections to execute OS commands on the server, then just put the administrative ID in the channel's MCAUSER. (For example, MCAUSER('mqm') on UNIX/Linux or typically MCAUSER('MUSR_MQADMIN') for Windows.) However, be aware that remote users with admin rights can remotely execute arbitrary OS command-line code using the QMgr. This is a feature of WMQ and not a bug, hence we NEVER recommend this in Production. In fact, I personally recommend that development environments enable security. Waiting until Production to figure out how to authenticate connections and what authorizations are needed often leads to unnecessary deployment delays.If you want to use IP filtering to mitigate that threat, you can either move to WMQ v7.1 which includes this feature natively, or use an exit such asBlockIP2. Either of these solutions will allow you to create rules that filter incoming connection requests by IP address, user ID, etc.Note that on a v7.0 QMgr all the channels are unprotected by default. So even if you filter incoming requests on one channel, if the others are left in their default state, anyone can still connect and execute commands as the administrator. For a comprehensive review of all this, please take a look at the Hardening WebSphere MQ presentation att-rob.net. Scroll down to the v7.0 presentations.\n"} +{"text": "### Human: Using JMS & WebSphere MQ, if I use a message selector to selectively dequeue, and there are several messages with the same selection criteria, am I guaranteed to dequeue the first message that matches?e.g. given a queue with messages{color: pink, name: alice}{color: blue, name: bob}{color: red, name: charlie}{color: blue, name: doug}if I dequeue with the selectorcolor='blue', am I guaranteed to dequeue{color: blue, name: bob}? Or is there a chance I could get{color: blue, name: doug}instead, even though it is further into the queue depth?### Assistant: Please refer to theRESCANINTproperty of the different WMQ Connection Factory implementations. From the manual:When a message consumer in the point-to-point domain uses a message\n selector to select which messages it wants to receive, the WebSphere\n MQ JMS client searches the WebSphere MQ queue for suitable messages in\n the sequence determined by the MsgDeliverySequence attribute of the\n queue. When the client finds a suitable message and delivers it to the\n consumer, the client resumes the search for the next suitable message\n from its current position in the queue. The client continues to search\n the queue in this way until it reaches the end of the queue, or until\n the interval of time in milliseconds, as determined by the value of\n this property, has expired. In each case, the client returns to the\n beginning of the queue to continue its search, and a new time interval\n commences.The idea is that in a very busy queue with priority delivery, some messages of a higher priority may appear higher in the queue then the current position of the selector. Theoretically a higher priority message should be consumed first but the consumer won't see it unless it seeks from the head of the queue. The cursor is reset to the head of the queue either when it gets to the end or when RESCANINT is reached. The setting of RESCANINT allows for tuning of how responsive you want the selector to be in finding these higher priority messages.RESCANINT isn't specific to FIFO delivery. The other case in which this can happen is if there are multiple threads with overlapping selection criteria. In this case one thread can hold a message under lock and then release it. Although the message may be eligible for the second thread, if that thread has already passed that position in the queue then it takes hitting the end of the queue or RESCANINT elapsing to restart the cursor to find the message.Rescan interval is in milliseconds and defaults to 5000. Any positive integer value is accepted, although too low a value will cause thrashing as the cursor is continually reset before any messages can be consumed.As a practical matter, you will receive the messages in order if the queue is FIFO and you have only one reader on the queue for which the messages are eligible, regardless of what RESCANINT is set to. If message order is to be strictly preserved, there are some additional considerations as described inSequential retrieval of messages. These boil down to messages having only one path from producer to consumer when considering channels, syncpoints, etc.\n"} +{"text": "### Human: Is there an API to connect to a Websphere MQ queue from an SQL Server stored procedure and put a message onto a queue?If not, what would be the best way to achieve this?### Assistant: The solution I am going to use for this is to write a CLR stored procedure and deploy this onto SQL Server.Inside the CLR stored proc I will use the MQ .NET api.Update:I created a stored proc using the following code:using System;\nusing System.Data;\nusing System.Data.SqlClient;\nusing System.Data.SqlTypes;\nusing Microsoft.SqlServer.Server;\nusing IBM.WMQ;\n\npublic partial class StoredProcedures\n{\n [Microsoft.SqlServer.Server.SqlProcedure]\n public static int MQStoredProc(String queueManager, String queueName, String messageText)\n {\n //MQEnvironment.Hostname = \"localhost\";\n //MQEnvironment.Port = 1414;\n //MQEnvironment.Channel = \"SYSTEM.DEF.SVRCONN\";\n\n MQQueueManager mqQMgr = null; // MQQueueManager instance\n MQQueue mqQueue = null; // MQQueue instance\n\n try\n {\n mqQMgr = new MQQueueManager(queueManager);\n mqQueue = mqQMgr.AccessQueue(queueName, MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING); // open queue for output but not if MQM stopping\n\n if (messageText.Length > 0)\n {\n // put the next message to the queue\n MQMessage mqMsg = new MQMessage();\n mqMsg.WriteString(messageText);\n mqMsg.Format = MQC.MQFMT_STRING;\n MQPutMessageOptions mqPutMsgOpts = new MQPutMessageOptions();\n mqQueue.Put(mqMsg, mqPutMsgOpts);\n }\n\n return 0;\n }\n catch (MQException mqe)\n {\n return ((int)mqe.Reason); \n }\n finally\n {\n if (mqQueue != null)\n mqQueue.Close();\n if (mqQMgr != null)\n mqQMgr.Disconnect();\n }\n }\n};This is not production ready but is inserting messages successfully on a queue manager running on the same server as the SQL server in bindings mode.\n"} +{"text": "### Human: I am using IBM.XMS 2.0.0.5 and MQ Client 7.0.1.5 and have created a connection, set the exception listener, started the connection and started listening for messages using a message listener. This works fine, except that theExceptionListenerdoes not fire when I disable the network connection. Instead I get an unhandled socket exception.I have gone back to the example given on the IBM site and recreated the error:If I disable the network connetion I get the unhandled socket exception and the exceptionListener does not get fired.using System;\nusing System.Threading;\nusing IBM.XMS;\n\npublic class Sample\n{\n public static void Main()\n {\n XMSFactoryFactory factoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\n\n IConnectionFactory connectionFactory = factoryFactory.CreateConnectionFactory();\n connectionFactory.SetStringProperty(XMSC.WMQ_HOST_NAME, \"**********\");\n connectionFactory.SetStringProperty(XMSC.WMQ_CHANNEL, \"*****\");\n connectionFactory.SetIntProperty(XMSC.WMQ_PORT, 1414);\n connectionFactory.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);\n connectionFactory.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, \"*********\");\n\n //\n // Create the connection and register an exception listener\n //\n\n IConnection connection = connectionFactory.CreateConnection();\n connection.ExceptionListener = new ExceptionListener(OnException);\n\n ISession session = connection.CreateSession(false, AcknowledgeMode.AutoAcknowledge);\n IDestination queue = session.CreateQueue(\"queue://***********\");\n\n //\n // Create the consumer and register an async message listener\n //\n\n IMessageConsumer consumer = session.CreateConsumer(queue);\n consumer.MessageListener = new MessageListener(OnMessage);\n\n connection.Start();\n\n while (true)\n {\n Console.WriteLine(\"Waiting for messages....\");\n Thread.Sleep(1000);\n }\n }\n\n static void OnMessage(IMessage msg)\n {\n Console.WriteLine(msg);\n }\n\n static void OnException(Exception ex)\n {\n Console.WriteLine(ex);\n }\n}### Assistant: I'll put the answer up in the hope that it saves someone the time it wasted for me.You need to use an unmanaged client connection in order to connect up an exception listener to your connection.connectionFactory.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT_UNMANAGED);\n"} +{"text": "### Human: Are Websphere MQ messages stored in a database or filesystem?\nCan I configure it to use MySQL?### Assistant: WebSphere MQ persistence is always a local filesystem for distributed platforms. On the mainframe there is the possibility of using a DB2 database in a Sysplex with a Coupling Facility but for everything else it is a filesystem.Also, there is no local persistence for WebSphere MQ clients. Only the queue manager will persist messages.In the WebSphere family, WebSphere Application Server's System Integration Bus has the ability to use a database for it's message persistence. SIBus is a JMS implementation provided with WAS for exchanging messages in the WAS cell and between WAS instances.\n"} +{"text": "### Human: There is a built in limitation of 2 MB for the IBM WebSphere MQ JMS interface.http://www-01.ibm.com/support/docview.wss?uid=swg21221260Is there a way to bypass that limitation?### Assistant: The limitation applied to WMQ versions distributed with WAS back at V5.1.1 many years ago. If this is the problem, upgrading to current version of WMQ will resolve it. The current version of WMQ is V7.0.1. V6.0.2 is also still current but will be out of service in September of 2012. V6 & V7 can send and receive messages up to 100MB but WMQ itself defaults to 4MB out of the box. It is necessary to tune parameters of the QMgr, queues and channels if messages larger than 4MB are required but JMS is not a limitation at modern versions.The WMQ Java/JMS manuals do not specifically mention a maximum size because it is the same as the native WMQ max length of 100MB. However, theWMQ V6 Performance Reportprovides benchmarks for JMS messages up to 64MB.Whatever is preventing you from putting a 3MB message isn't a limitation of WMQ's JMS implementation as regards message size. If you have checked MAXMSGL on all of the channels and queues and the QMgr then it's something less obvious but itisconfiguration.\n"} +{"text": "### Human: Today if we build an application using the JMS API (using MDBs as message listeners, host it on lets say GlassFish or Weblogic 10) and tomorrow lets say the traffic goes crazy, can we port this application without code changes to some product like Websphere MQ... coz theoretically MQ is more like a dedicated JMS provider ...### Assistant: Yes and no. (The answer to all the best questions is always \"it depends.\")If the application adheres to the JMS specification then it should run unchanged on any JMS compliant provider. That's the good news.The bad news is that it really does matter how the provider implemented JMS. For example, Section 6.5 of the JMS 1.1 specification says this about topics:Many Pub/Sub providers group topics\n into hierarchies and provide various\n options for subscribing to parts of\n the hierarchy. JMS places no\n restrictions on what a Topic object\n represents. It might be a leaf in a\n topic hierarchy, or it might be a\n larger part of the hierarchy (for\n subscribing to a general class of\n information).The organization of topics and the\n granularity of subscriptions to them\n is an important part of a Pub/Sub\n application\u2019s architecture. JMS does\n not specify a policy for how this\n should be done. If an application\n takes advantage of a provider-specific\n topic grouping mechanism, it should\n document this. If the application is\n installed using a different provider,\n it is the job of the administrator to\n construct an equivalent topic\n architecture and create equivalent\n Topic objects.What this means is that certain parts of the specification are open to interpretation of the JMS transport provider. It will be up to the application owner to determine how to map these differences when porting applications.Another aspect of this question is that even when the specification is followed strictly by two transport providers, the behavior behind the API may differ. An example of this is connection management. Some providers fail connections over transparently to the client, others ask the client to re-drive the connection sequence after a failure. Both approaches can be 100% JMS compatible and yet both require different application logic.So the answer is that adhering to the JMS API gets you very close to fully portable and the amount of porting that is required depends on the differences in how the transport provider interprets parts of the spec and/or implemented features that are ambiguous in the spec.\n"} +{"text": "### Human: My Python is worse than my Chinese (I have never seen so many smiling faces than when I try to speak Mandarin), so I need a little help:I want something to listen to MQ (for topics specified in a configuration) and relay the message to dBus and in return listen to dBus (for topics specified in a configuration) and relay them back to the MQ. From poking around my conclusion is Python would be suitable. I found:MQTT.orgPYMQiandMosquitto.So the approach seems to be valid. Now I'm looking for code samples. My main concern is to make the code efficient. Since it seems that the routine needs to run in a polling loop how do I do that in Python without bogging down my system.### Assistant: PYMQi has sample code here:http://packages.python.org/pymqi/examples.htmlIn order not to poll you might want to look at MQ Triggers. They enable an application to be launched when a message is put on a queue.\n"} +{"text": "### Human: The documentation refers toconfiguring information with stanzas, but what is a stanza?Is it just a fancy name for a sub-section of configuration?### Assistant: You are correct, in this context a stanza refers to a sub-section of a IBM MQ configuration file.For example MQ clients come by default with a config file calledmqclient.ini, in this file you may see something like the following:TCP:\n ClntSndBuffSize=0In this example thestanzaisTCPand it has a singleattributeClntSndBuffSizeset to the value0.\n"} +{"text": "### Human: I'm running two(2) client tests.Presumably they should both work. But, one does not, and I do not know why.(1) This one works...package aaa.bbb.ccc;\n\nimport com.ibm.mq.MQEnvironment;\nimport com.ibm.mq.MQQueueManager;\nimport com.ibm.mq.MQQueue;\nimport com.ibm.mq.MQMessage;\nimport com.ibm.mq.MQPutMessageOptions;\nimport com.ibm.mq.constants.CMQC;\nimport com.ibm.mq.constants.MQConstants;\n\npublic class MQCheck {\n public static void main(String args[]) {\n try {\n int openOptions = CMQC.MQOO_INQUIRE | CMQC.MQOO_INPUT_AS_Q_DEF | MQConstants.MQOO_OUTPUT;\n MQEnvironment.hostname = \"localhost\";\n MQEnvironment.port = 1414;\n MQEnvironment.channel = \"DEV.APP.SVRCONN\";\n MQEnvironment.properties.put(CMQC.USER_ID_PROPERTY, \"admin\");\n MQEnvironment.properties.put(CMQC.PASSWORD_PROPERTY, \"passw0rd\"); \n MQEnvironment.properties.put(CMQC.TRANSPORT_PROPERTY, CMQC.TRANSPORT_MQSERIES);\n MQQueueManager qMgr;\n qMgr = new MQQueueManager(\"QM1\");\n MQQueue destQueue = qMgr.accessQueue(\"mylocalqueue\", openOptions);\n MQMessage hello_world = new MQMessage();\n hello_world.writeUTF(\"Blah...blah...bleah...test message no.1...!\");\n MQPutMessageOptions pmo = new MQPutMessageOptions();\n destQueue.put(hello_world, pmo);\n destQueue.close();\n qMgr.disconnect();\n System.out.println(\"------------------------success...\"); \n } catch (Exception e) {\n System.out.println(\"Exception: \" + e);\n e.printStackTrace();\n }\n }\n}(2) This one does NOT work...package aaa.bbb.ccc;\n\nimport com.ibm.mq.jms.MQQueueConnection;\nimport com.ibm.mq.jms.MQQueueConnectionFactory;\nimport com.ibm.mq.jms.MQSession;\nimport com.ibm.msg.client.wmq.WMQConstants;\nimport javax.jms.Connection;\nimport javax.jms.JMSException;\nimport javax.jms.MessageProducer;\nimport javax.jms.Queue;\nimport javax.jms.QueueSession;\nimport javax.jms.Session;\nimport javax.jms.TextMessage;\n\npublic class MQCheck3 {\n\n public static void main(String args[]) {\n\n Connection qconn = null;\n QueueSession qsess = null;\n MQSession mqsess;\n Queue queue = null;\n\n try {\n MQQueueConnectionFactory connectionFactory = new MQQueueConnectionFactory();\n connectionFactory.setHostName(\"localhost\");\n connectionFactory.setChannel(\"DEV.APP.SVRCONN\");//communications link\n connectionFactory.setPort(1414);\n connectionFactory.setQueueManager(\"QM1\");\n connectionFactory.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n connectionFactory.setBooleanProperty(WMQConstants.CAPABILITY_USERNAME_PASSWORD, true);\n connectionFactory.setStringProperty(WMQConstants.USERID, \"admin\");\n connectionFactory.setStringProperty(WMQConstants.PASSWORD, \"passw0rd\"); \n qconn = (MQQueueConnection) connectionFactory.createConnection();\n qconn = connectionFactory.createQueueConnection();\n qconn.start();\n mqsess = (MQSession) qconn.createSession(false, Session.AUTO_ACKNOWLEDGE); //.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\n queue = mqsess.createQueue(\"mylocalqueue\");\n TextMessage textMessage = mqsess.createTextMessage(\"Bleah...bleah...blech...test message no.2...!\");\n MessageProducer mc = mqsess.createProducer(queue);\n mc.send(textMessage, 0, 0, 0);\n System.out.println(\"------------------------success...\"); \n } catch (JMSException e) {\n System.out.println(\"Exception: \" + e);\n e.printStackTrace();\n } finally {\n try {\n qsess.close();\n qconn.close();\n } catch (JMSException e) {\n System.err.print(e);\n }\n }\n }\n}NOTE: \nRunning the code in (2) gets the following exception...Exception: com.ibm.msg.client.jms.DetailedJMSSecurityException: JMSWMQ2013: The security authentication was not valid that was supplied for QueueManager 'QM1' with connection mode 'Client' and host name 'localhost(1414)'.\nPlease check if the supplied username and password are correct on the QueueManager to which you are connecting.\ncom.ibm.msg.client.jms.DetailedJMSSecurityException: JMSWMQ2013: The security authentication was not valid that was supplied for QueueManager 'QM1' with connection mode 'Client' and host name 'localhost(1414)'.\nPlease check if the supplied username and password are correct on the QueueManager to which you are connecting.\n at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:514)\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:214)\n at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:408)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:6398)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:5740)\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl._createConnection(JmsConnectionFactoryImpl.java:293)\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:234)\n at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6016)\n at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:111)\n at aaa.bbb.ccc.MQCheck3.main(MQCheck3.java:35)\nCaused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED').\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:202)\n ... 8 more\nException in thread \"main\" java.lang.NullPointerException\n at aaa.bbb.ccc.MQCheck3.main(MQCheck3.java:48)*QUESTION: can anyone explain to me why the 2nd example does not work?: *-Is there something that is incorrect and/or missing from the code that would enable it to work?FYI - running MQ server from Docker image:C:>docker exec mq dspmqverC:\\>docker exec mq dspmqver\nName: IBM MQ\nVersion: 9.0.3.0\nLevel: p903-L170517.DE\nBuildType: IKAP - (Production)\nPlatform: IBM MQ for Linux (x86-64 platform)\nMode: 64-bit\nO/S: Linux 4.9.31-moby\nInstName: Installation1\nInstDesc:\nPrimary: Yes\nInstPath: /opt/mqm\nDataPath: /var/mqm\nMaxCmdLevel: 903\nLicenseType: Developer\n\nC:\\>pom.xml\n\n 4.0.0\n\n aaa.bbb.ccc\n mqcheck\n 1\n jar\n mqcheck\n mqcheck\n\n \n 8.0.0.2\n \n\n \n \n ibm.mq\n fscontext\n ${mq.version}\n \n \n ibm.mq\n jms\n ${mq.version}\n \n \n ibm.mq\n com.ibm.mq\n ${mq.version}\n \n \n ibm.mq\n com.ibm.mqjms\n ${mq.version}\n \n \n ibm.mq\n com.ibm.mq.jmqi\n ${mq.version}\n \n \n ibm.mq\n com.ibm.mq.headers\n ${mq.version}\n \n \n ibm.mq\n com.ibm.mq.commonservices\n ${mq.version}\n \n \n\n \n ${project.artifactId}-${project.version}\n \n \n org.apache.maven.plugins\n maven-compiler-plugin\n 3.1\n \n 1.8\n 1.8\n true\n \n \n \n \nas per the suggestion in the post below (thx, joshmc), here is the AMQERR01.logit appears to provide a clue... -now, the quest to determine how to I unblock the 'admin' user :-)----- cmqxrmsa.c : 1347 -------------------------------------------------------\n08/11/17 17:32:09 - Process(1847.6) User(root) Program(amqrmppa)\n Host(bd069b8075db) Installation(Installation1)\n VRMF(9.0.3.0) QMgr(QM1)\n Time(2017-08-11T17:32:09.967Z)\n\nAMQ9776: Channel was blocked by userid\n\nEXPLANATION:\nThe inbound channel 'DEV.APP.SVRCONN' was blocked from address '172.17.0.1'\nbecause the active values of the channel were mapped to a userid which should\nbe blocked. The active values of the channel were 'MCAUSER(admin)\nCLNTUSER(admin)'.\nACTION:\nContact the systems administrator, who should examine the channel\nauthentication records to ensure that the correct settings have been\nconfigured. The ALTER QMGR CHLAUTH switch is used to control whether channel\nauthentication records are used. The command DISPLAY CHLAUTH can be used to\nquery the channel authentication records.\n----- cmqxrmsa.c : 1347 -------------------------------------------------------running following command (as suggested)...C:\\>docker exec --tty --interactive mq runmqsc\n5724-H72 (C) Copyright IBM Corp. 1994, 2017.\nStarting MQSC for queue manager QM1.DIS CHL(DEV.APP.SVRCONN) MCAUSERDIS CHL(DEV.APP.SVRCONN) MCAUSER\n 1 : DIS CHL(DEV.APP.SVRCONN) MCAUSER\nAMQ8414: Display Channel details.\n CHANNEL(DEV.APP.SVRCONN) CHLTYPE(SVRCONN)\n MCAUSER(app)\n :DISPLAY CHLAUTH(DEV.APP.SVRCONN) MATCH(RUNCHECK) ALL ADDRESS(172.17.0.1)DISPLAY CHLAUTH(DEV.APP.SVRCONN) MATCH(RUNCHECK) ALL ADDRESS(172.17.0.1) CLNTUSER('admin')\n 5 : DISPLAY CHLAUTH(DEV.APP.SVRCONN) MATCH(RUNCHECK) ALL ADDRESS(172.17.0.1) CLNTUSER('admin')\nAMQ8878: Display channel authentication record details.\n CHLAUTH(DEV.APP.SVRCONN) TYPE(ADDRESSMAP)\n DESCR( ) CUSTOM( )\n ADDRESS(*) USERSRC(CHANNEL)\n CHCKCLNT(ASQMGR) ALTDATE(2017-08-11)\n ALTTIME(19.23.31)DIS QMGR CONNAUTHDIS QMGR CONNAUTH\n 1 : DIS QMGR CONNAUTH\nAMQ8408: Display Queue Manager details.\n QMNAME(QM1) CONNAUTH(DEV.AUTHINFO)DIS AUTHINFO(DEV.AUTHINFO)DIS AUTHINFO(DEV.AUTHINFO)\n 2 : DIS AUTHINFO(DEV.AUTHINFO)\nAMQ8566: Display authentication information details.\n AUTHINFO(DEV.AUTHINFO) AUTHTYPE(IDPWOS)\n ADOPTCTX(YES) DESCR( )\n CHCKCLNT(REQDADM) CHCKLOCL(OPTIONAL)\n FAILDLAY(1) AUTHENMD(OS)\n ALTDATE(2017-08-14) ALTTIME(13.57.29)DISPLAY CHLAUTH(DEV.APP.SVRCONN) allDISPLAY CHLAUTH(DEV.APP.SVRCONN) all\n 1 : DISPLAY CHLAUTH(DEV.APP.SVRCONN) all\nAMQ8878: Display channel authentication record details.\n CHLAUTH(DEV.APP.SVRCONN) TYPE(ADDRESSMAP)\n DESCR( ) CUSTOM( )\n ADDRESS(*) USERSRC(CHANNEL)\n CHCKCLNT(ASQMGR) ALTDATE(2017-08-16)\n ALTTIME(13.43.26)DISPLAY CHLAUTH() all*DISPLAY CHLAUTH(*) all\n 2 : DISPLAY CHLAUTH(*) all\nAMQ8878: Display channel authentication record details.\n CHLAUTH(DEV.ADMIN.SVRCONN) TYPE(USERMAP)\n DESCR(Allows admin user to connect via ADMIN channel)\n CUSTOM( ) ADDRESS( )\n CLNTUSER(admin) USERSRC(CHANNEL)\n CHCKCLNT(ASQMGR) ALTDATE(2017-08-16)\n ALTTIME(13.43.26)\nAMQ8878: Display channel authentication record details.\n CHLAUTH(DEV.ADMIN.SVRCONN) TYPE(BLOCKUSER)\n DESCR(Allows admins on ADMIN channel) CUSTOM( )\n USERLIST(nobody) WARN(NO)\n ALTDATE(2017-08-16) ALTTIME(13.43.26)\nAMQ8878: Display channel authentication record details.\n CHLAUTH(DEV.APP.SVRCONN) TYPE(ADDRESSMAP)\n DESCR( ) CUSTOM( )\n ADDRESS(*) USERSRC(CHANNEL)\n CHCKCLNT(ASQMGR) ALTDATE(2017-08-16)\n ALTTIME(13.43.26)\nAMQ8878: Display channel authentication record details.\n CHLAUTH(MY.ADMIN.SVRCONN) TYPE(ADDRESSMAP)\n DESCR( ) CUSTOM( )\n ADDRESS(127.0.0.1) USERSRC(CHANNEL)\n CHCKCLNT(ASQMGR) ALTDATE(2017-08-11)\n ALTTIME(20.17.14)\nAMQ8878: Display channel authentication record details.\n CHLAUTH(MY.ADMIN.SVRCONN) TYPE(BLOCKUSER)\n DESCR( ) CUSTOM( )\n USERLIST(*NOBODY) WARN(NO)\n ALTDATE(2017-08-11) ALTTIME(20.17.51)\nAMQ8878: Display channel authentication record details.\n CHLAUTH(SYSTEM.ADMIN.SVRCONN) TYPE(ADDRESSMAP)\n DESCR(Default rule to allow MQ Explorer access)\n CUSTOM( ) ADDRESS(*)\n USERSRC(CHANNEL) CHCKCLNT(ASQMGR)\n ALTDATE(2017-08-03) ALTTIME(17.22.22)\nAMQ8878: Display channel authentication record details.\n CHLAUTH(SYSTEM.*) TYPE(ADDRESSMAP)\n DESCR(Default rule to disable all SYSTEM channels)\n CUSTOM( ) ADDRESS(*)\n USERSRC(NOACCESS) WARN(NO)\n ALTDATE(2017-08-03) ALTTIME(17.22.22)\nAMQ8878: Display channel authentication record details.\n CHLAUTH(*) TYPE(ADDRESSMAP)\n DESCR(Back-stop rule - Blocks everyone)\n CUSTOM( ) ADDRESS(*)\n USERSRC(NOACCESS) WARN(NO)\n ALTDATE(2017-08-16) ALTTIME(13.43.26)\nAMQ8878: Display channel authentication record details.\n CHLAUTH(*) TYPE(BLOCKUSER)\n DESCR(Default rule to disallow privileged users)\n CUSTOM( ) USERLIST(*MQADMIN)\n WARN(NO) ALTDATE(2017-08-03)\n ALTTIME(17.22.22)### Assistant: Thereason '2035' ('MQRC_NOT_AUTHORIZED')can be caused by quite a few issues.IBM Support Technote \"WMQ 7.1 / 7.5 / 8.0 / 9.0 queue manager RC 2035 MQRC_NOT_AUTHORIZED or AMQ4036 or JMSWMQ2013 when using client connection as an MQ Administrator\" has a good write up on diagnosing and resolving issues like this.If you want more specific help, to start with please provide the following details by editing and adding them to your question.Version of IBM MQ Classes for JMS used by the client application.Version of IBM MQ installed on the IBM MQ queue managerErrors in the queue manager's AMQERR01.LOG that happen at the same time as the error you receive in the IBM MQ Classes for JMS client application.Based on the error you have in theAMQERR01.LOGyou have aCHLAUTHrule that is blocking you. Run the following command to see which rule this is:DISPLAY CHLAUTH(DEV.APP.SVRCONN) MATCH(RUNCHECK) ALL ADDRESS(172.17.0.1) CLNTUSER('admin')If it is the default rule that blocks MQ administrative users from connecting, then this is a good thing from a security standpoint. It is much better to have an application connect to the queue manager as a USERID that is low privileged and does not have MQ administrative authority. To do this you need to grant the user authority to connect to the queue manager as well as toPUTorGETfrom the queues required.After looking at the output so far I think what is happening is this.The IBM MQ Classes for Java program is not actually authenticating as the admin user and is being defaulted to the MCAUSER(app) on the SVRCONN channel which is not a MQ Administrative user so does not get blocked. The issue is that theMQEnvironment.propertiesis meant to hold the value of a Hash table of properties not individual properties. Check out @Roger's answer to \"Java program to connect WMQ with User Id instead of channel\" for examples of using the Hashtable which is thread safe compared to the MQEnvironment which is not. But in fixing this issue the IBM MQ Classes for Java app should be blocked the same as the JMS app.The IBM MQ Classes for JMS program is properly authenticating as the admin user and ADOPTCTX(YES) is set and the admin user is a MQ Administrative user so is blocked by the following default CHLAUTH rule:CHLAUTH(*) TYPE(BLOCKUSER)\n DESCR(Default rule to disallow privileged users)\n CUSTOM( ) USERLIST(*MQADMIN)\n WARN(NO)Please validate by running the following:DIS QMGR CONNAUTHThen run the following command replacing the valueSYSTEM.DEFAULT.AUTHINFO.IDPWOSwith the value found in output of the above command if it is different:DIS AUTHINFO(SYSTEM.DEFAULT.AUTHINFO.IDPWOS)Note I'm not sure why theRUNCHECKis not returning theBLOCKUSERrule, I don't have a 9.0.3 to try this on but with a similarADDRESSMAPrule to the one that is being returned for you I still get theBLOCKUSERrule on both 8.0.0.5 and 8.0.0.6.\n"} +{"text": "### Human: I have JMS Messages that are sent to an IBM MQ Queue, if the remote Client (I have not control over the remote client) does not consume the message in a given time (Say 1 minute) The message should Expire (I have the Expire part working, \"MQ deletes the message\" using setExplicitQosEnabled and setTimeToLive on the JMSTemplate) and the message sender (My SI Code) should be notified that the message was not delivered to the remote client so that the expired message can be reroute to another Queue.I am not sure how to implement this pattern using Spring Integration especially as the messages are sent asynchronously and only correlated upon return (MessageID -> CorrelationID).I thought I could have some form of:1) ErrorMessageExceptionTypeRouter, but I need the payload so I can resend the message and I am not sure how to implement this (How to call back from MQ to JMSTemplate or Route to another Queue on Time out, and have a secondary route listening to that queue and rerouting)2) WireTap, but I think this would mean blocking threads on the sender (Request/Response model) with timer that watches for the msg to be removed by the remote client. Again I am not sure how to implement this.Any help with how best to implement the above greatly appreciated.Progress report:I have tried to Query MQ by using the methodJMSTemplate.receiveSelected(destination, messageSelector);that Artem Bilan suggested. The plan was to manually find messages that have not been consumed by the Client in the given time. (The Provider would have to track all messages and attempt to retrieve each message using its messageID once the timer had expired, instead of using TimeToLive message expiry) This solution places the onus on the Provider to track and time every message sent and attempt to retrieve each message (most which should not be available) making it inefficient but a workable solution. Unfortunately IBM MQ does not like the it when I call:JMSTemplate.receiveSelected(destination, messageSelector);I get the following error:org.springframework.jms.InvalidSelectorException: JMSWMQ2008: Failed to open MQ queue \u2018MY.TEST.IN'.; nested exception is com.ibm.msg.client.jms.DetailedInvalidSelectorException: JMSWMQ2008: Failed to open MQ queue 'MY.TEST.IN'.\nJMS attempted to perform an MQOPEN, but WebSphere MQ reported an error.\nUse the linked exception to determine the cause of this error. Check that the specified queue and queue manager are defined correctly.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2459' ('MQRC_SELECTOR_SYNTAX_ERROR').however usingJMSTemplate.receive(destination);with the same destination does read a message off the queue.### Assistant: The following code causes IBM MQ V8 to automagicaly reroute an expired message to the JMSReplyTo queue, (Thanks to JoshMc for his suggestion in the comments above)jmsTemplate.setTimeToLive(3000l);\njmsTemplate.setExplicitQosEnabled(true);\njmsTemplate.setSessionAcknowledgeMode(Session.AUTO_ACKNOWLEDGE);\njmsTemplate.setDeliveryMode(DeliveryMode.PERSISTENT);\njmsTemplate.setPriority(Message.DEFAULT_PRIORITY);\njmsTemplate.send(destinationName, session -> {\n TextMessage toSend = session.createTextMessage(message)\n toSend.setIntProperty(\"JMS_IBM_Report_Expiration\", 14680064);\n Queue queue = session.createQueue(\u201cTEST.EXPIRE.REPORT\u201d);\n toSend.setJMSReplyTo(queue);\n\n return toSend;\n});The JMS_IBM_Report_Expiration value of 14680064 I found here:https://www.ibm.com/support/knowledgecenter/en/SS7K4U_8.0.0/com.ibm.websphere.javadoc.doc/web/apidocs/constant-values.html#com.ibm.websphere.sib.api.jms.ApiJmsConstants.MQRO_EXPIRATION_WITH_FULL_DATAI need to find this JAR and add it to my project, however MQ Removes the expired message and deposits it on my specified reply to queue.\n"} +{"text": "### Human: I have MQ V8.0.0.2 installed in my system and I am applying the fix pack to upgrade it to 8.0.0.5 using the silent install method. It runs successfully and finishes butdspmqverstill says the version as 8.0.0.2.It is on a Windows 7 machine 64 bit. The exe file I am using to apply the fix pack isWS-MQ-8.0.0-FP0005.exe.I am not getting any errors in the command prompt. I followed the installation instructions IBM suggested while downloading the fix pack. I stopped the MQ manager and then ran the command WS-MQ-8.0.0-FP0005.exe -f silent_install.resp \nI gave the response file name along with its path. But its still not working.UpdateOn a multi-installation setup the update was being applied properly but to a different installation. To fix the problem, runamqicsdn.exeas described inApplying maintenance level updates on IBM MQ serversin the Windows maintenance Tasks section of the Knowledge Center.amqicsdn MQPINSTALLATIONNAME=name MQPSILENT=1This invocation sets a pointer to the installation that is to be updated.### Assistant: The response file tells the installer what to do and what to install. Depending on what is set there, what you are seeing is what would be expected.Specifically, theMQPREBOOTandMQPINUSEOKparms tell the installer whether or not to continue if a file it needs to update is in use. There are two likely outcomes here.1) The maintenance was applied correctly but because files were in use it will not show up until after a reboot.\n2) TheMQPINUSEOKparm told the installer to bail out if the files were in use.On Windows, even though the QMgr is stopped, the service continues running. Depending on theMQPINUSEOKsetting that would either cause the install to fail or to complete pending a reboot.It is worth noting that installinganythingon Windows requires a couple of reboots. The very first thing before running the install or upgrade is to reboot. That ensures that the registry is saved at the current values. It also ensures that if someone else's app has gone rogue with a memory leak or other issue, it gets cleared before your MQ install proceeds.After the install, reboot again to ensure the registry with the new MQ settings is saved. That's because if the server crashes, you want the last known good registry entry to be the one with your install or upgrade reflected in it. That also ensures the services still start as expected.Finally, I'm unsure what \"the installation instructions IBM suggested while downloading the fix pack\" are but the official instructions are in the Knowledge Center sectionWindows: Applying maintenance level upgrades on IBM MQ servers. Among the other information you will find there is that the location for the installation log is either specified in the response file or defaults toamqicsdn.txtin your TEMP directory (%TEMP%).\n"} +{"text": "### Human: I am new to Message Queue. I am attemting to get messages from MQ Queue by using below code.I am creating one connection and getting every message from the queue using that connection. Is it right way of doing like this and whether i need to commit the connection.Infinite for-loop is right way to receive messages all the times from the queue, is it right?\nKindly advice me.try {\n createMQConnection(); // getting mq connection\n createMQSession(); // getting mq session\n createMQDestination(); // getting mq destination\n\n for ( ; ; ) { // infinite loop to receive message from Queue\n consumer = session.createConsumer(mqQueue);\n jmsTextMessage = (JMSTextMessage) consumer.receive(100);\n // Calling application method to process the requested message from queue\n }\n} catch (Exception e) {\n throw e;\n} finally {\n // closing consumer\n // closing session\n // closing connection\n}### Assistant: Is it right way of doing like thisDefine \"right.\" Depending on the business requirement, this could be right or it could be horrible. For example, with a 100ms wait time and a depth of zero messages the code will time out, throw a 2033 error (MQRC_NO_MSG_AVAILABLE), close the session, and exit. Is that what you want?Generally there is atry/catchblock enclosing theGETand that handles transient errors likeRC=2033if the intent is that the program remains running even when the queue is empty. In that case though, it's customary to set the timeout to 10 seconds or so. With 100ms timeout, the app as written would absolutely hammer the listener if it were modified to stay running.Also, the exception handling does not show any code for printing the linked exception. JMS exceptions are multi-level data constructs in which the transport provider's native error code is in the linked part of the exception. If the error handling doesn't look at the linked exception it cannot even tell the difference betweenMQRC=2033(no messages) versusMQRC=2035(authorization error). One of these is transient and should be survived by the program, the other is always fatal. At the very least, the code should either print the linked exception or else print a message stating no linked exception was found.So with regard to the loop and processing design, it's not possible to answer for values of \"right\" without knowing requirements. With regard to exception handling, definitelynotright as no linked exception processing is present....and whether I need to commit the connection.Depends. Is it OK to lose or duplicate messages? If so then transactions are not needed. Use of transacted sessions protects against loss of messages but not dupes. Use of XA 2-Phase Commit protects against both loss of messages and against dupes. The idea is to pick the class of service (generally referred to as \"At most once,\" \"At least once,\" or \"Once and only once\") that meets the business requirement and code accordingly.Infinite for-loop is right way to receive messages all the times from the queue, is it right?That's one way to do it. For high availability and high throughput, typically there are two or more instances of the application listening on the same queue. That way if one app server instance goes down (whether planned or unplanned) the other instance(s) continues to serve the queue. In general all of these instances listen on the queue with about a 10-second timeout.Also customary is that theGETon the queue specifiesMQGMO_FAIL_IF_QUIESCINGwhich allows the QMgr to interrupt the application when the MQ Admin tries to shut the QMgr down. If this option is not specified, the only to shut the QMgr down is to ask it to forcibly break the outstanding connections and this should only be done as a last resort.It's also possible to cause MQ to trigger the app to start when a message arrives on the queue. That's not typically done when the app runs on a JEE server but is very useful for stand=-alone apps.\n"} +{"text": "### Human: I am using IBM MQ WebSphere client v 7.5 installed on an application server.To securely connect to the MQ queue manager I have to pass certificate whose Name should beibmwebspheremq + \"userid\". I put my code on the APP SERVER to test the MQ connectivity. If I specify domain user id it works fine for me but not for other domain users. So what certificate name should be used so that it works for all domain users??Certificate Label : ibmwebspeheremq.kdb located on the local pathcertificate Name: using strmqikm.exe, open above certificate and check the name\nAs of now this CN is \"ibmwebspheremq\" + 111111(domain userid) and it works fine for the domain user 111111 ,but for domain user 222222 it is throwing SSL errors.P.S. Security must be maintainedUpdate from OP comments on 11 Sept 2015I am using the .NET Application and done code through the help of IBM.WMQ interface provided with the dllamqmdnet. I have KDB certificates and I have just provided the local certificate's path in the configuration. I am able to access the MQ Server for the particular user on APP Server (where MQ client resides) but if I want to access for all users then how to? because in my case certificate label name (using strmqikm.exe) should be like ibmwebspheremq + userid. For individual users I am able to access the certificate by doing individual login to app server but not for all users at a time. There is only one certificate and as mentioned earlier it is non-JAVA application.### Assistant: The MQ client either uses IBM's C code or it uses Java and the JRE's JSSE provider. Each of these have different behaviors and requirements.The Java EE App Server will use the JSSE Provider and its rules for selecting a personal cert from the JKS. That may or may not include searching for a particular label. Anything using IBM's compiled C code APIwillrequire a specific label for the personal certificate in the KDB. Furthermore, the behavior has changed from version to version, as explained in IBM's TechnoteSpecifying the userid in the SSL certificate label for an MQ client.As explained in the Technote, the Java client uses standard Java methods for finding the personal certificate and is not dependent on the label at all. That requirement isonlyfor the non-Java client. The App server uses a JKS and the non-Java clients use a KDB. Since you did not mention converting certificates between JKS and KDB, I will assume that your testers are not using the C client or a KDB.Presumably then, your testers are using the same JKS as the app server. If they have the right path and the password to access it, and if it has a personal cert, they will be able to find and present the personal cert. If it has more than one personal cert, MQ has no control over how it selects which one it will present. That's a Java thing. If this is the problem the answer is simple - either use one personal cert and one keystore, or else each tester has their own JKS, each with its own personal cert.Security must be maintainedIn that case, the latter approach is preferred. Each tester should have their own JKS and their own personal cert.The other possibility is that you have a variety of certs, each of which is being found by the client and properly presented to the server, but that there's a cert exchange problem. If each developer has their own cert and those are all self-signed, the public portionmustbe in the QMgr's KDB to be accepted.If you want a more precise answer, you will need to providea lotmore detail such as what code, keystore, and certificate the testers are using to test with, whether these are self-signed certs, whether the testers are using the same app channel and testing from the same node, whether you are usingSSLCAUTH, etc. I would also recommend using the debugging procedure I outlined inthis answer.\n"} +{"text": "### Human: How can i add new user to my queue in WebSphere 7.5 MQ Explorer?\nI have a 90 day trial version and I don't have a administrator console :/ I don't know why...I would like to connect to a queue that is placed on my server, but I can't connect with Administrator account.### Assistant: First off, go get the non-expiring version for which the product name isMQ Advanced for Developers. As of this writing, it is available in v7.5 and v8.0 and it is free. If you want support, IBM will let you throw money at them for that but the full-function, non-expiring product is free.MQ now ships secure by default. When you first create a queue manager it rejects administrative connections over client channels. It would allow non-admin channels overSYSTEM.ADMIN.SVRCONNexcept that until you explicitly authorize them non-administrators have no rights on the QMgr.(As of v8.0, the QMgr is also set by default to require ID and password but you needen't worry about this with MQ v7.5.)If you are using a Linux or Windows QMgr and can start MQ Explorer on the host where the QMgr is installed, connect to the QMgr using bindings mode rather than a channel. If you are using an administrative user ID (one in the mqm group or on Windows also the Administrators group) then bindings mode will work.If you must connect over a client channel, you will need to set up MQ to allow your administrative connection and/or low-privileged user connections. You can do this by disabling theCHLAUTHrules but that approach isstronglydiscouraged. Much better to learn how MQ security works than to disable it.You can also define newCHLAUTHrules that permit the connection. The defaultCHLAUTHrules look like this:dis CHLAUTH(*) all\n 1 : dis CHLAUTH(*) all\nAMQ8878: Display channel authentication record details.\n CHLAUTH(*) TYPE(BLOCKUSER)\n DESCR(Default rule to disallow privileged users)\n CUSTOM( ) USERLIST(*MQADMIN)\n WARN(NO) ALTDATE(2015-05-28)\n ALTTIME(15.10.02)\nAMQ8878: Display channel authentication record details.\n CHLAUTH(SYSTEM.ADMIN.SVRCONN) TYPE(ADDRESSMAP)\n DESCR(Default rule to allow MQ Explorer access)\n CUSTOM( ) ADDRESS(*)\n USERSRC(CHANNEL) CHCKCLNT(ASQMGR)\n ALTDATE(2015-05-28) ALTTIME(15.10.02)\nAMQ8878: Display channel authentication record details.\n CHLAUTH(SYSTEM.*) TYPE(ADDRESSMAP)\n DESCR(Default rule to disable all SYSTEM channels)\n CUSTOM( ) ADDRESS(*)\n USERSRC(NOACCESS) WARN(NO)\n ALTDATE(2015-05-28) ALTTIME(15.10.02)Note that the first rule says to block admin users on any channel. You can add a new rule that says to block some non-admin user on the channel you want to use for administrators.runmqsc MYQMGRNAME\n\nDEFINE CHL(MY.ADMIN.SVRCONN) CHLTYPE(SVRCONN) MCAUSER('*NOACCESS') REPLACE\nDEFINE CHLAUTH(MY.ADMIN.SVRCONN) TYPE(ADDRESSMAP) ADDRESS(127.0.0.1) USERSRC(CHANNEL)\nDEFINE CHLAUTH(MY.ADMIN.SVRCONN) TYPE(BLOCKUSER) USERLIST('*NOBODY')TheDEF CHLcommand defines a new channel for administrators, and sets theMCAUSERto a value that insures that channel won't start.The firstCHLAUTHrule tells MQ to replace the badMCAUSERwith the one from the connection requestprovided the request comes from 127.0.0.1 and only forMY.ADMIN.SVRCONN. Fill in your own IP address here. Preferably instead use a certificate instead of an IP address to authenticate the connection.The secondCHLAUTHrule is a bit tricky. There is no 'ALLOW USERS' rule so we have to use a rule of typeTYPE(BLOCKUSER). But when we block users we have to provide a non-empty list of them. What we need is aCHLAUTHrule where the channel name is more specific than the default oneandwith aUSERLISTvalue that doesnotcontain*MQADMINor your actual user ID. I use*NOBODYhere because it makes it obvious that the intent is to not block anybody, and the value canneverbe an actual user ID.Defining a channel just for admins to use is considered a Best Practice. Authenticating administrators based on the IP address or hostname is not. Once you get connected with your admin ID and get your QMgr configured, consider learning enough about MQ certificates to strongly authenticate administrator connections. And/or go to a V8.0 QMgr and client where you can log on using a password.\n"} +{"text": "### Human: When using MQ Light service in Bluemix, is there an API to delete a Topic / Queue using MQLight? Or mark a Topic / Queue to be auto deleted?### Assistant: When you create a subscription, you can specify the TTL \"time to live\". If time to live counts down to zero, then MQ Light will delete the destination by discarding any messages held at the destination and not accruing any new messages.The default value for this property is0- which means the destination will be deleted as soon as there are no clients subscribed to it.Refer to theIBM MQ Light Client Moduledocumentation for more details about the Node.js API. Here are some various examples for setting TTL:Set it using theclient.subscribe(...)API call:client.subscribe(\"my/replies\", \"shareGroup1\", \n { ttl: 300000, qos: mqlight.QOS_AT_LEAST_ONCE, autoConfirm: true },\n msgArrivedCallback);or set it as an options variable:var options = {\n ttl: 60000 ,\n qos: 1,\n credit: 1,\n autoConfirm: false\n};for methods like inclient.send(...)andclient.unsubscribe(...).\n"} +{"text": "### Human: I have a cloud server that sits behind the firewall (cloud-server.cat.com).I can RDP into it by creating a firewall rule usingVMware vCloud Director.I checked and the outbound rule has been created forport 1414oncloud-server.cat.comI need to be able to connectcloud-server.cat.comtoIBM WebSphere MQthat's on server here locally (phoenix.cat.com).I can connect using port1414from one of the local test servers, but not fromcloud-server.cat.comserver.I get following error:MQJE001: Completion Code '2', Reason '2059'.\nA WebSphere MQ error occurred : Completion code 2 Reason code 2059\n\ncom.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2059'.\n at com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:\n236)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnecti\non(MQClientManagedConnectionFactoryJ11.java:504)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnectio\nn(MQClientManagedConnectionFactoryJ11.java:545)\n at com.ibm.mq.StoredManagedConnection.(StoredManagedConnection.jav\na:95)\n at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConne\nctionManager.java:184)\n at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueMana\ngerFactory.java:870)\n at com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:7\n56)\n at com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManager\nFactory.java:704)\n at com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFac\ntory.java:170)\n at com.ibm.mq.MQQueueManager.(MQQueueManager.java:598)\n at MsgQueue.DPGReceiver.main(DPGReceiver.java:177)\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2059;AMQ9204: Connection to ho\nst 'phoenix.cat.com(1414)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;R\nC=2059;AMQ9213: A communications error for occurred. [1=java.net.ConnectExcepti\non[Connection timed out: connect],3=phoenix.cat.com]],3=phoenix.cat.com(\n1414),5=RemoteTCPConnection.connnectUsingLocalAddress]\n at com.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiConnect(RemoteFAP.java:\n1689)\n at com.ibm.mq.MQSESSION.MQCONNX_j(MQSESSION.java:929)\n at com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:\n225)\n ... 10 more\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2059;AMQ9213: A communications\n error for occurred. [1=java.net.ConnectException[Connection timed out: connect\n],3=phoenix.cat.com]\n at com.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.connnectUsingLoca\nlAddress(RemoteTCPConnection.java:603)\n at com.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.protocolConnect(R\nemoteTCPConnection.java:938)\n at com.ibm.mq.jmqi.remote.internal.system.RemoteConnection.connect(Remot\neConnection.java:1065)\n at com.ibm.mq.jmqi.remote.internal.system.RemoteConnectionPool.getConnec\ntion(RemoteConnectionPool.java:392)\n at com.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiConnect(RemoteFAP.java:\n1407)\n ... 12 more\nCaused by: java.net.ConnectException: Connection timed out: connect\n at java.net.DualStackPlainSocketImpl.connect0(Native Method)\n at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)\n at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)\n at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)\n at java.net.AbstractPlainSocketImpl.connect(Unknown Source)\n at java.net.PlainSocketImpl.connect(Unknown Source)\n at java.net.SocksSocketImpl.connect(Unknown Source)\n at java.net.Socket.connect(Unknown Source)\n at java.net.Socket.connect(Unknown Source)\n at com.ibm.mq.jmqi.remote.internal.RemoteTCPConnection$2.run(RemoteTCPCo\nnnection.java:588)\n at java.security.AccessController.doPrivileged(Native Method)\n at com.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.connnectUsingLoca\nlAddress(RemoteTCPConnection.java:579)\n ... 16 moreDoes anyone know if this is onWebSphere'send or it's because mycloud-server.cat.com?### Assistant: That's really hard to say with the information provided. There may be firewall rules inbound onphoenix.cat.com, host-based firewall rules on any of the servers, IPSec or any other number of issues at the network level.At the QMgr level, it's possible that the listener is not running or not listening on the port you expect.Generally, before trying to test the MQ connectivity, it is a good idea to verify the underlying network connectivity. You can do this by telnetting from the client-side to the QMgr side on the desired port. If this works you will get a socket that hangs and after disconnecting you will see an FDC file in the QMgr's global errors directory. Until that low-level test works, it is guaranteed that MQ willnotwork.However, if you are able to telnet from the client box to the QMgr host successfully and still get 2059, it is time to look at MQ's configuration. There are security-related errors that give a very opaque error code to the client because that is just Good Security Practice. In the case that it is an MQ security problem, there will be very detailed error messages on the QMgr side in its error logs and, assuming you have auths events enabled, emitted as event messages.But, as mentioned earlier, it is a waste of time to look for MQ errors until and unless it is possible to connect from the client host to the MQ host using telnet on the MQ port. So do the Telnet thing first, then check for MQ errors.\n"} +{"text": "### Human: //snippet\nMQEnvironment.properties = GetConnectionProperties(); \n\n_queueManager = new MQQueueManager(QueueManager); \n\n//end of snippet\n\n private Hashtable GetConnectionProperties()\n {\n Hashtable properties = new Hashtable();\n properties.Add(MQC.USER_ID_PROPERTY, Environment.UserName);\n properties.Add(MQC.HOST_NAME_PROPERTY, MQHostname);\n properties.Add(MQC.PORT_PROPERTY, MQPortNumber);\n properties.Add(MQC.CHANNEL_PROPERTY, MqChannel); \n properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT); \n\n if (_useSSL)\n {\n properties.Add(MQC.SSL_CIPHER_SUITE_PROPERTY, CipherSuite);\n properties.Add(MQC.SSL_PEER_NAME_PROPERTY, SslPeerName); \n properties.Add(MQC.SSL_CIPHER_SPEC_PROPERTY, CipherSpec);\n properties.Add(MQC.SSL_FIPS_REQUIRED_PROPERTY, FipsRequired);\n properties.Add(MQC.SSL_CERT_STORE_PROPERTY, SslKeyRepository); \n }\n\n return properties;\n }\n\nthrows {\"MQRC_KEY_REPOSITORY_ERROR\"}the sslkeyRepository is just a directory location which contains .tab .arm .crl .crt .jks .kdb .rdb .sth filesAny ideas what i am missing here?### Assistant: SslKeyRepository must point to a .kdb file and not to a directory as you have done. For example a client application will code for certificate store property as:properties.Add(MQC.SSL_CERT_STORE_PROPERTY, \"C:\\\\MyApp\\\\SSL\\\\client_certstore\");Also note that I have not suffixed the file extension to keystore file name. MQ client will automatically add the \".kdb\" extension. Please see thislinkfor more details.Also you need to set only SSL_CIPHER_SUITE_PROPERTY in your application. You don't set SSL_CIPHER_SPEC_PROPERTY. See the tablehere.\n"} +{"text": "### Human: I am new to the whole WebSphere world, so I dont know how else to ask this.Basically, my app already has a QCF, as well as an inbound and outbound queue set up. I was told a while ago that this environment never had its MQ settings tested properly so its unverified if they work correctly.Currently I am experiencing problems with my service that uses MQ in this environment and I want to somehow test these connections explicitly. Is there a way to do this like there is for testing the database connection in WebSphere, with a simply click of a button or something?As I said, I am new to the WebSphere world so I can probably taking some things for granted.### Assistant: When you are setting up connection factory, you have a test connection button, which tests connection to the queue manager. Unfortunately this button is available only during creation of connection factory. There is no similar 'Test connection' functionality like in Data sources.I usually use my custom very simple application, which takes qcf and queue from jndi, connects, sends and receives test message.To just verify that the network is set up correctly, you could usetelnet qmHost qmPortfrom application server machine.If you are getting some exceptions, provide a stacktrace, it might tell something more about your problem\n"} +{"text": "### Human: SourceLogPrimaryFiles=3|2-254 (Windows)|2-510 (UNIX systems)The log files allocated when the queue manager is created.LogSecondaryFiles=2|1-253 (Windows)|1-509 (UNIX systems)The log files allocated when the primary files are exhausted.From what I understand, these log files are a part of transaction log.Now, while creating the Queue Manager if I were to use the following settings,LogPrimaryFiles=2 \nLogSecondaryFiles=8 \nLogFilePages=16384 \nLogType=CIRCULAR \nLogBufferPages=0 \nLogPath=/var/mqm/log/QMGRA/ \nLogWriteIntegrity=TripleWriteI would like to know what happens after the 8 secondary log files are exhausted, i.e a scenario where all primary and secondary log files are filled.Next, if I were to use these settings,LogPrimaryFiles=2 \nLogSecondaryFiles=8 \nLogFilePages=16384 \nLogType=LINEAR\nLogBufferPages=0 \nLogPath=/var/mqm/log/QMGRA/ \nLogWriteIntegrity=TripleWriteIn this case I would like to know what happens after,all primary log files are exhausted.all secondary log files are exhausted.Also, when the Queue Manager needs to be restored, a restart of the Queue Manager is required. The queue manager will be restored from the last sync point that is defined in the transaction logs. However, I am confused as to where this sync point is located. Is it in the Primary log file or the secondary log file, or is it such that it may exist in either of them?### Assistant: with either linear or circular logs, once the primary and secondary extents are filled with messages under syncpoint, the QMgr will start rolling back transactions to release some log space. There is a misconception that linear logs can handle any number of messages under syncpoint because they are not reused.With linear logs, all persistent messages are captured in the log and those under syncpoint must fit within primary and secondary extents.With circular logs, only messages under syncpoint are captured in the log.The last point of consistency isalwaysthe oldest active log extent. Please see the Infocenter sectionDetermining superfluous log filesfor more details. Alsop, have a look atMission:Messaging: Circular logs vs. linear logsfor a deeper explanation.\n"} +{"text": "### Human: I am constructing a messaging system using MQSeries. For some reason, when I perform q.get(...), I am getting an exception thrown (I don't know the specific MQException). Below is the code causing the error:private static MQGetMessageOptions GMO = new MQGetMessageOptions();\nprivate static int GMO_OPTIONS = MQC.MQGMO_SYNCPOINT | MQC.MQGMO_WAIT;\nGMO.options = GMO.options | GMO_OPTIONS;\nGMO.waitInterval = MQC.MQWI_UNLIMITED;\n\nMQEnvironment.hostname = args[0];\nMQEnvironment.channel = args[2];\nMQEnvironment.port = Integer.parseInt(args[1]);\nMQQueueManager queueManager = new MQQueueManager(args[3])\n\nMQMessage msg = new MQMessage();\nMQQueue q = queueManager.accessQueue(\"qName1\",MQC.MQOO_OUTPUT);\nq.get(msg, GMO);My plan is, when this error occurs, skip the message and delete it. To perform the delete I will call the following function:private void deleteMsg(MQQueueManager queueManager, String queueName) throws MQException {\n MQGetMessageOptions tempGmo = new MQGetMessageOptions();\n tempGmo.options |= MQC.MQGMO_WAIT;\n tempGmo.waitInterval = 1000;\n MQQueue remover = queueManager.accessQueue(queueName, MQC.MQOO_INPUT_AS_Q_DEF);\n remover.get(new MQMessage(), tempGmo);\n queueManager.commit();\n}Would the remover.get() in my deleteMsg function also, in this specific scenario, fail for the same reason? Or does the option used to construct the MQQueue(MQC.MQOO_INPUT_AS_Q_DEF vs MQC.MQOO_OUTPUT) prevent it from also failing? If I am having trouble accessing my queue's message, how do I discard the top message and move to the next?To shorten my question:\nIf I am unable to perform a get() on a given queue to retrieve a message, how can we delete that corrupt message on the same queue?Thank you!### Assistant: OMG!MQQueue q = queueManager.accessQueue(\"qName1\",MQC.MQOO_OUTPUT);\nq.get(msg, GMO);Your are opening a queue for output (writing) but you are trying to get a message. You have your shoes on the wrong feet!! Secondly, why aren't you catching the MQException that MQ would be throwing?? The exception would have included the reason code which would have given you the exact explanation to your issue.Here's how you should be opening the queue for reading:try\n{\n int oo = MQC.MQOO_INPUT_SHARED + MQC.MQOO_FAIL_IF_QUIESCING;\n MQQueue q = queueManager.accessQueue(\"qName1\",oo);\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.options = MQC.MQGMO_NO_WAIT + MQC.MQGMO_FAIL_IF_QUIESCING;\n q.get(msg, gmo);\n}\ncatch (MQException e)\n{\n System.err.println(e.getLocalizedMessage() );\n System.err.println(\"CC = \" + e.completionCode + \" - RC = \" + e.reasonCode);\n}Also, make sure you use the appropriate \"Fail if quiescing\" option for the particular MQ API call.Finally, look up \"backout queue\". If your application is having an issue with a message then the message should be moved to a backout queue and not simply deleted.\n"} +{"text": "### Human: I am using the MQ.NET classes of the MQ 7x client, and importing and exporting messages works fine. However, if there is a network disconnect or the remote manager is disconnected, the IBM MQ client doesn't automatically reconnect. I get:Error: Remote host ' not available, retry later.Is there a way to auto-connect and continue processing the message when these kind of issues occur?There is a property to check the connection of the queue manager:mqQMgr = new MQQueueManager(\"My queue manager name\" ,\"my channel name\",\",my connection name\");mqQMgr.IsConnectedreturns true/false, but this doesn't help to auto-connect.This is what i am using:// mq properties\n Hashtable properties = new Hashtable();\n properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED); \n properties.Add(MQC.CONNECTION_NAME_PROPERTY, \"connectionName\"); \n properties.Add(MQC.CHANNEL_PROPERTY, \"channelName\");\n properties.Add(MQC.CONNECT_OPTIONS_PROPERTY, MQC.MQCNO_RECONNECT_Q_MGR);\n\n mqQMgr = new MQQueueManager(\"my queue manager\"), properties); //error thrownI get this error on the above lineIBM MQException caught in send message - reason code - 2046- message -CompCode: 2, Reason: 2046\n{\"MQRC_OPTIONS_ERROR\"}\nbase {System.ApplicationException}:\n{\"MQRC_OPTIONS_ERROR\"}\nCompCode: 2\nCompletionCode: 2\nMessage: \"MQRC_OPTIONS_ERROR\"\nReason: 2046### Assistant: Automatic client reconnection is supported by MQ C# client from v7.1 onwards. You have to useMQCNO_RECONNECTorMQCNO_RECONNECT_Q_MGRorMQCNO_RECONNECT_AS_DEFCNO option to enable automatic reconnection. MQ v7.1 ships couple of samples, SimpleClientAutoReconnectPut.cs is one of them. Please refer to the sample for detail.Simple snippet.mqQMgr = new MQQueueManager(\"QM\", MQC.MQCNO_RECONNECT,\"SVRCONNCHN\",\"localhost(1414)\");\n"} +{"text": "### Human: How can we browse all the messages in a WebSphere MQ queue in one API call using java?Here is the code which I'm using. Here I'm using this code aforloop until q depth is reached.MQGetMessageOptions gmo=new MQGetMessageOptions();\n gmo.options = MQC.MQGMO_WAIT | MQC.MQGMO_BROWSE_NEXT ;\n //System.out.println(\"Status: \"+i);\n MQMessage out=new MQMessage(); \n out.format =MQC.MQFMT_XMIT_Q_HEADER;//MQC.MQFMT_REF_MSG_HEADER; \n mqCon.getQue().get(out,gmo);\n System.out.print(i);How can I get all messages without usingforloop? It's taking a long time to browse 10,000 messages.### Assistant: How can I get all messages without using for loop?Use awhileloop. Sorry, could not resist a slightly snarky answer on that one. WMQ does not have an API call analogous to the SQLselectstatement. Messaging and databases share some traits but address fundamentally different requirements.It's taking a long time to browse 10,000 messages.Take a look at the Performance SupportPacs. These are published on theSupportPacs main pageand have names beginning with MP. Find the one for your platform and MQ version and it will list different scenarios for putting and getting messages as well as performance tuning recommendations.I would also ask why a normal app needs to browse 10,000 messages. The QMgr will select messages for you based on MsgID, Correlation ID or property and this ismuchfaster than browsing all the messages in order for the application to find the ones of interest. Occasionally people need to browse all messages on a queue to archive the queue or to debug a problem, but this is the exception rather than the rule. If a Production app regularly browses all messages on a queue, then the queues may have been inappropriately used as a database.\n"} +{"text": "### Human: How can you create a new queue programmatically using theMQQueueManagerandMQQueueobjects?Is there a guide on how to use these classes? The javadocs don't say much.### Assistant: To create a dynamic queue, you just open a model queue. The dynamic queue is created and you get back a handle to it. The name of the queue is provided as well and you can place that in the Reply-To-Queue field of a request message.If you want to create a permanent queue, have a look atcom.ibm.mq.pcfin the Infocenter. To execute any WMQ admin command from an application, submit a Programmable Command Format (PCF) message to theSYSTEM.ADMIN.COMMAND.QUEUE. The application must be authorized to put a message onto the queue for this to work. Furthermore, the command server will use the user ID in the message header to look up authorizations for the specific command being executed. To create a queue, the submitter must have+crtauthority on queues.Note that any person or app with the ability to create a permanent queue is a defacto administrator. If their ID is not authorized to create authorization control list entries, they need only to create an alias over the command queue and can then spoof the administrative user ID. For this reason, it is rare that any non-administrator would be granted rights to create queues.\n"} +{"text": "### Human: My app (a spring message listener) reads from a queue and writes to the database in a single transaction. I use Atomikos to provide the XA transaction behaviour. When the app is abruptly terminated with kill statements for example, I see messages are lost. Is there any specific configuration I need to use? Should the queues be persistent? Currently the queues are non-persistent. My MQ version is v7.1.Spring config for listener container looks like:\n \n \n \n \n \n \n \n \n \n \n \n \nAny other info will be given as needed.Thanks.### Assistant: The client you are using must be the Extended Transactional Client if downloaded prior to May of this year. Any of the V7.0.1 and higher clients as of May 2012 have the XA capability built in. If in doubt, go download a current release of the WMQ client and install.Second, the XA transaction manager must have it's own connection to the queue manager independent of the application. This is so that it can connect and reconcile the transactions if the application fails to restart. To do this, the transaction manager must be configured with an XX_OPEN string and a switch file as described in the Infocenter topicConfiguring XA-compliant transaction managers.For what its worth, there is no such thing as a persistent queue in WMQ. It is the messages themselves that are persistent (or not). For more on that, please seemy blog post on the topic. This is a rather important topic because when people assume that the queue itself is persistent they tend to devise solutions that produce unexpected results. Please read the blog post!\n"} +{"text": "### Human: Below is the related part from a QMGR log file about a WMQ channel issue:-------------------------------------------------------------------------------\n2012-7-23 10:35:25 - Process(340.1) User(MUSR_MQADMIN) Program(runmqchl.exe)\nAMQ9206: Error sending data to host 86.0.223.5(1602) \u3002\n\nEXPLANATION:\nAn error occurred sending data over TCP/IP to 86.0.223.5(1602). This may be due to\na communications failure.\nACTION:\nThe return code from the TCP/IP(send) call was 10054 X('2746'). Record these\nvalues and tell your systems administrator. \n----- amqccita.c : 2612 -------------------------------------------------------\n2012-7-23 10:35:25 - Process(340.1) User(MUSR_MQADMIN) Program(runmqchl.exe)\nAMQ9999: Channel program ended abnormally. \n\nEXPLANATION: \nChannel program 'CZWJNS.CZWJCZ' ended abnormally. \nACTION: \nLook at previous error messages for channel program 'CZWJNS.CZWJCZ' in the \nerror files to determine the cause of the failure. \n----- amqrccca.c : 834 --------------------------------------------------------\n2012-7-23 10:35:35 - Process(3616.1) User(MUSR_MQADMIN) Program(runmqchl.exe)\nAMQ9002: Channel \u201cCZWJNS.CZWJCZ' is starting\u3002\n\nEXPLANATION\uff1a\nChannel \u201cCZWJNS.CZWJCZ' is starting\u3002\nACTION\uff1a\nNone\u3002 \n-------------------------------------------------------------------------------\n2012-7-23 10:40:35 - Process(3616.1) User(MUSR_MQADMIN) Program(runmqchl.exe)\nAMQ9206: Error sending data to host 86.0.223.5(1602) \u3002\n\nEXPLANATION:\nAn error occurred sending data over TCP/IP to 86.0.223.5(1602). This may be due to\na communications failure.\nACTION:\nThe return code from the TCP/IP(send) call was 10054 X('2746'). Record these\nvalues and tell your systems administrator. \n----- amqccita.c : 2612 -------------------------------------------------------\n2012-7-23 10:40:35 - Process(3616.1) User(MUSR_MQADMIN) Program(runmqchl.exe)\nAMQ9999: Channel program ended abnormally. \n\nEXPLANATION: \nChannel program 'CZWJNS.CZWJCZ' ended abnormally. \nACTION: \nLook at previous error messages for channel program 'CZWJNS.CZWJCZ' in the \nerror files to determine the cause of the failure. \n----- amqrccca.c : 834 --------------------------------------------------------\n2012-7-23 10:40:45 - Process(4848.1) User(MUSR_MQADMIN) Program(runmqchl.exe)\nAMQ9002: Channel \u201cCZWJNS.CZWJCZ' is starting\u3002\n\nEXPLANATION\uff1a\nChannel \u201cCZWJNS.CZWJCZ' is starting\u3002\nACTION\uff1a\nNone\u3002\n-------------------------------------------------------------------------------Right now, the situation is that the target channel (CZWJNS.CZWJCZ) can finally run, but only after a few retry attempts. It keeps happening often. All the messages can be delivered to the target queue in the remote QMGR host successfully. However, they're always delayed due to the multiple retry attempts.I've searched through the internet for the return code10054and it means the connection has been reset by the peer.My WMQ version is 6.0.10 on Windows 2003.### Assistant: The \"Connection reset by peer\" means that something between this node and the other node closed the connection. The cause can range from dodgy/noisy network, to firewall timing out, to channel exits that refuse the connection, or many other causes.The key to diagnosis in these cases is to narrow down the cause. This requires looking at the error logs on both QMgrs (or the client and QMgr) for the same event. In the case of a channel exit, a look at the channel definitions on both sides reveals whether such an exit is in place but if it is then you need to look at the exit's configuration and logs as well.If the problem is in the network, the error logs from both QMgrs will show similar errors. However if one QMgr closed the connection intentionally then you will see that in its log files.\n"} +{"text": "### Human: I'm preparing a test environment to connect to Websphere MQ 7.0 through SSL, so I have to configure SSL on Websphere MQ myself before I startconfiguring the SSL connection from JMS side.So, I'm trying to create SSL certificates for Websphere MQ, followingthesesteps. But when I attempt to add the signed certificate to the repository using the commandgsk7cmd.exe -cert -receive -db key.kdb -pw pass -file QMANAGER_signed.armI get the error:An attempt to receive the certificate has failed.\nAll the signer certificates must exist in the key database.I even tried the C commandgsk7capicmdbut it also fails, with the error:Error: 146\n\nError id: GSKKM_ERR_INVALID_CERT_CHAIN\nDetails: QMANAGER_signed.armUPDATE 1:I used the WMQ SSL Wizard to create the proper configuration. The configuration went smoothly, but when I run the JMS sample included with the SSL Wizard I get the error:MQJE001: Completion Code '2', Reason '2397'the SSL logs (using the option-Djavax.net.debug=all) shows the following error:Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2397;AMQ9771: SSL handshake failed. [1=javax.net.ssl.SSLHandshakeExcep\ntion[Remote host closed connection during handshake],3=localhost/127.0.0.1:1414 (localhost),4=SSLSocket.startHandshake,5\n=default]\n at com.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:995)\n at com.ibm.mq.jmqi.remote.internal.system.RemoteConnection.connect(RemoteConnection.java:989)\n at com.ibm.mq.jmqi.remote.internal.system.RemoteConnectionPool.getConnection(RemoteConnectionPool.java:293)\n at com.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiConnect(RemoteFAP.java:1371)\n at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:331)\n ... 7 more\nCaused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake\n at com.ibm.jsse2.jc.a(jc.java:380)\n at com.ibm.jsse2.jc.g(jc.java:115)\n at com.ibm.jsse2.jc.a(jc.java:240)\n at com.ibm.jsse2.jc.startHandshake(jc.java:54)\n at com.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:989)\n ... 11 more\nCaused by: java.io.EOFException: SSL peer shut down incorrectly\n at com.ibm.jsse2.a.a(a.java:7)\n at com.ibm.jsse2.jc.a(jc.java:493)\n ... 15 moreUPDATE 2:Using T.Rob's diagnostic technique mentioned in his answer, I'm still stuck at point #3 with the same error as before.### Assistant: The error that you are seeing is because your keystore does not have the signing CA's root and/or intermediate signer certificates. When you get a signed certificate back from the Certificate Authority it must be validated before adding it to the keystore. Pretty much anyone could have intercepted your signing request and signed the certificate. The step of validating it when received insures that it was signed by a CA that you actually trust and not some anonymous man-in-the-middle.The way the cert is validated is by checking the CA signature against the public key of the CA that is in your KDB. For that the CA's certificate must already be in the KDB when you attempt to receive your signed cert. If the CA uses an intermediate signer certificate (and for a variety of reasons any commercial CAwilluse intermediate certs) then you must also have imported the intermediate certandthe root cert. This forms a certificate chain or certificate path from the CA's root cert through any intermediate certs to your signed certificate. Each thing in the chain is authenticated by the thing above it until you get to the root. Your KDBmusthave the entire chain and because each cert is validated by the one above it, youmustimport these beginning with the root and working your way down.Typically your CA will have posted their signer certs on their web site where you retrieve them using SSL. Fetch those and import them and you will be able to receive your signed cert.As it happens, The Sphere Online Journal just published an article that walks you through this process using Verisign as an example, and with screen shots of importing the root and intermediate signer certs. The article is aboutRenewing WebSphere MQ Certificatesbut the first part of the article creates a kdb file and a signing request, then imports the CA certs and the signed cert.Let's also get you to the correct Infocenter. Please look at the WMQ v7.0 Infocenter's section onUsing CA Signed Certificates. The one you were looking at is for Message Broker and quite frankly the article you linked to is a bit of a mess. I'll see about getting it fixed. For starters, that bit about creating the cert in one kdb, getting it signed, then exporting it, deleting it and importing it to the QMgr's KDB is pure rubbish. Just generate the CSR in the QMgr's own KDB file and receive the signed cert directly to it. This is much easier and is the process illustrated in the article mentioned above.Finally, if you go tot-rob.netand download the WMQ Security Lab from IMPACT 2011 you will find there a lab guide and some scripts. These use self-signed certificates but the scripts can easily be converted to use CA signed certificates and then tailored for use in your WMQ network.UPDATE:Responding to he additional questions in the comments:I'm actually planning to use a self-signed certificate, so I guess I only need to extract it and adding it to the client's trust store?Yes, that is correct. But here's a problem in the WMB Infocenter page that was originally linked in that it asks you to create a cert with the labelqmgrnameinstead ofibmwebspheremqqmgrname. The QMgr finds its cert based on the label and so itmustmatch the specified format. So when you create your self-signed cert, mke sure that the label is the literalibmwebspheremqwith the QMgr name folded to lower case appended. If you have made a cert with the wrong label, you can always export it to a P12 file and then import it to a new KDB with the right label.I used the WMQ SSL Wizard mentioned in the WMQ Security Lab to create the proper configuration. The configuration went smoothly, but when I run the JMS sample included with the SSL Wizard I get the errorMQJE001: Completion Code '2', Reason '2397', the SSL logs shows the following errormain, received EOFException: error main, handling exception: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake main, SEND TLSv1 ALERT: fatal, description = handshake_failureThere are a few reasons why that might occur. Rather than going through all of them, I'll suggest some diagnostic techniques. When I set up SSL channels, I always use the following procedure:Get the channel running without SSL. This proves that the basic communication path is working (listener running, ports match, channel object definitions match, etc.).If this is the first time that the QMgr is using SSL, or if the kdb has changed, be sure to issue theREFRESH SECURITY TYPE(SSL)command.Enable SSL by specifying the same ciphersuite at the QMgr and client but be sure that the QMgr's SVRCONN channel is set toSSLCAUTH(OPTINAL) SSLPEER(). This verifies that theclientacceptsthe QMgr'scertificate. Only when this works, go to the next step.Now change the QMgr's SVRCONN toSSLCAUTH(REQUIRED) SSLPEER(). This causes the QMgr to request the client's certificate.If usingSSLPEERset it to the desired value.This process isolates the possible problems so that at any point you know where to look. If the process fails in Step #3 then there is either an issue with the SSL configuration of the application, or it cannot validate the QMgr's cert. If the process fails in Step #4 then we know the application's SSL configuration is sound and that it likes the QMgr's cert bu that the QMgr doesn't like the application cert. If we get to Step #5 then it's just a matter of getting theSSLPEERvalue correct.Because you got a handshake failure that appears to be due to the QMgr closing the TCP connection, I am assuming that you haveSSLCAUTH(REQUIRED)(which is the default, by the way) and that either the QMgr doesn't have the application's certificate or that you were attempting to use an anonymous connection where the client doesn't require a personal cert. If that is the case, settingSSLCAUTH(OPTIONAL)will get you past the point of failure - although possibly to an entirely new point of failure.\n"} +{"text": "### Human: I need to write a Java client listening to WebSphere MQ Server. Message is put into a queue in the server.I developed this code, but am not sure it is correct or not. If correct, then how can I test it?This is a standalone Java project, no application server support. Which jars I should put into classpath?I have the MQ settings, where I should put into my codes? Standard JMS can skip these settings? confusing ....import javax.jms.Destination;\nimport javax.jms.Message;\nimport javax.jms.MessageConsumer;\nimport javax.jms.MessageListener;\nimport javax.jms.Queue;\nimport javax.jms.QueueConnection;\nimport javax.jms.QueueConnectionFactory;\nimport javax.jms.QueueReceiver;\nimport javax.jms.QueueSession;\nimport javax.jms.Session;\nimport javax.naming.Context;\nimport javax.naming.InitialContext;\nimport javax.naming.NamingException;\n\npublic class Main {\n Context jndiContext = null;\n QueueConnectionFactory queueConnectionFactory = null;\n QueueConnection queueConnection = null;\n QueueSession queueSession = null;\n Queue controlQueue = null;\n QueueReceiver queueReceiver = null;\n\n private String queueSubject = \"\";\n\n private void start() {\n try {\n queueConnection.start();\n\n queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\n Destination destination = queueSession.createQueue(queueSubject);\n MessageConsumer consumer = queueSession.createConsumer(destination);\n consumer.setMessageListener(new MyListener());\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n private void close() {\n try {\n queueSession.close();\n queueConnection.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n private void init() {\n try {\n jndiContext = new InitialContext();\n queueConnectionFactory = (QueueConnectionFactory) this.jndiLookup(\"QueueConnectionFactory\");\n queueConnection = queueConnectionFactory.createQueueConnection();\n queueConnection.start();\n } catch (Exception e) {\n System.err.println(\"Could not create JNDI API \" + \"context: \" + e.toString());\n System.exit(1);\n }\n }\n\n private class MyListener implements MessageListener {\n @Override\n public void onMessage(Message message) {\n System.out.println(\"get message:\" + message);\n }\n }\n\n private Object jndiLookup(String name) throws NamingException {\n Object obj = null;\n\n if (jndiContext == null) {\n try {\n jndiContext = new InitialContext();\n } catch (NamingException e) {\n System.err.println(\"Could not create JNDI API \" + \"context: \" + e.toString());\n throw e;\n }\n }\n try {\n obj = jndiContext.lookup(name);\n } catch (NamingException e) {\n System.err.println(\"JNDI API lookup failed: \" + e.toString());\n throw e;\n }\n return obj;\n }\n\n public Main() {\n\n }\n\n public static void main(String[] args) {\n new Main();\n\n }\n}MQ Queue setting\n AAA\n 1423\n ddd\n EEE.CLIENTS.00\n PKIJCExit\n 1\n 1\n \n \n \n GGGG.NY.00\n false\n 1\n 1\n \n### Assistant: There is an article with sample codeRunning a standalone Java application on WebSphere MQ V6.0which walks you through most of your questions, including how you might test with a free WMQ trial install. The main difference (as discussed in the comments) to v7 or v7.1 is that there is no broker component to start if you want to use topics. Other than that, the article should work fine with the current WMQ client and/or server.In addition, please refer to theWebSphere MQ Using Javamanual (v7.0 client) or theUsing WebSphere MQ Classes for Javamanual (v7.1 client) for the appropriateCLASSPATHand other settings for your client. Remember to use the Infocenter appropriate to your client version and not to the server version. You can mix and match client and server version but you get only the features supported by the server. For example, using the WMQ v7.1 client with the WMQ v7.0 server is perfectly valid.Finally, there are a number of sample programs supplied with the free client download that do exactly what you are describing. Some use JNDI to lookup the WMQ resources, others use Java methods and can be populated with standard Java property files. The ones with a-nojndioption show how to initialize your WMQ objects in the code at run time. These are under[WMQ Install path]\\tools\\wmqjava\\samples...in the latest Windows client install (SupportPac MQC71). You can also use the v7.0 client (SupportPac MQC7). I would recommend using the samples to get started rather than starting from scratch. Why reinvent the wheel, right?In addition to the many sample programs, the vendor install includes all of the requisite jar files. Note that what goes in theCLASSPATHchanges by WMQ client version so refer to the Infocenter. The later versions are much simpler and require only a couple of jar files in theCLASSPATH.If you want todownload the WMQ trialfor testing and do not have Administrator rights on your Windows workstation, you can install it easily on a RedHat or SUSE virtual machine. With a bit of massaging you can also easily install on Ubuntu as described in an Andy Piperblog post.\n"} +{"text": "### Human: I've been trying to get some performance statistics out of IBM WebSphere MQ to monitor with Spring Source's Hyperic HQ.I'm after the message enqueue and dequeue rate along with queue depth of a few local queues to ensure messages are being delivered to and consumed by our local application.Initially attempted to retrieve the data using WMI and windows performance counters however it seems that on one of our servers the counters aren't available for any of the local queues (just a load of temporary queues) and on the other the counters are available but don't always return a value correctly though WMI.I've tried PCF (usingMQIA_MSG_DEQ_COUNT) which wouldn't provide the counter requested. MQSC (UsingDISPLAY QUEUE&DISPLAY QSTATUS) which didn't seem to support the queuing rates - only providing last message get / put date and time.Anyone got an idea how to either get WMI and performance counters working correctly or an alternative to WMI that would provide the statistics I need?### Assistant: RegardingMQIA_MSG_DEQ_COUNT, you should be aware that theRESET_QUEUE_STATISTICScommand which returns this attribute is what I like to call the \"quantum physics property of WMQ\" because the act of observing the value resets the value. This is fine if you are the only one inquiring on the value and you have only one thread of inquiry. But if you have multiple inquiries going at once, they all reset the counter to zero at each inquiry, each one stepping on the other one's numbers. This aspect rendersRESET_QUEUE_STATISTICSof limited use for real-time debugging and not suitable for reliable statistics gathering.An alternative is to use MQ's Accounting and Statistics facility. In order to get the QMgr to produce Accounting and Statistics messages, it is necessary to enable them either at the QMgr or on a per-queue basis. The instructions for how to enable them are in the manual sectionQueue statistics information.Note that the statistics are reported to an event queue and must be fetched and parsed. The documentation reference on parsing the event messages is in theQueue statistics message datasection. There is a sample program in source format namedamqsmonthat shows how to fetch and format the statistics messages. The compiled version is also supplied to provide a human-readable listing of such messages.Once you enable the statistics on the queue(s) of interest and have a way to parse the messages, simply point your parser at the appropriate event queue and collect the stats. An example of the output of amqsmon showing the stats available follows:RecordType: QueueStatistics\n QueueManager: 'saturn.queue.manager'\n IntervalStartDate: '2005-04-30'\n IntervalStartTime: '15.09.02'\n IntervalEndDate: '2005-04-30'\n IntervalEndTime: '15.39.02'\n CommandLevel: 600\n ObjectCount: 3\n QueueStatistics:\n QueueName: 'LOCALQ'\n CreateDate: '2005-03-08'\n CreateTime: '17.07.02'\n QueueType: Predefined\n QueueDefinitionType: Local\n QMinDepth: 0\n QMaxDepth: 18\n AverageQueueTime: [29827281, 0]\n PutCount: [26, 0]\n PutFailCount: 0\n Put1Count: [0, 0]\n Put1FailCount: 0\n PutBytes: [88, 0]\n GetCount: [18, 0]\n GetBytes: [52, 0]\n GetFailCount: 0\n BrowseCount: [0, 0]\n BrowseBytes: [0, 0]\n BrowseFailCount: 1\n NonQueuedMsgCount: 0\n ExpiredMsgCount: 0\n PurgedMsgCount: 0This and other examples are provided in the manual in a section entitled, appropriately enough,amqsmon examples.\n"} +{"text": "### Human: i am looking to set the MQ Header field 'PutApplName' in my java client and access the same in the JMSXAppID field as a JMS header. The documents on the net talk about the MQ Header Fields getting mapped to JMS ones. Has anyone tried this?### Assistant: You must be using WMQ v7 at the client and the server to do this in a JMS-portable way. Since v6 is end-of-life next year, you are hopefully already on v7 anyway. In v7 all MQMD properties are accessible using message properties. In v6 it was necessary to drop down into WMQ-specific Java classes and it wasn't pretty.That said, please take a look atJMS fields and properties with corresponding MQMD fieldswhich maps all the MQMD fields to the corresponding JMS properties.There is a sample program which writes to MQMD fields and which is installed with the WMQ Client. If you installed the full WMQ client rather than just grabbing the jar files this program will reside at:C:\\Program Files\\IBM\\WebSphere MQ\\tools\\jms\\samples\\simple\\SimpleMQMDWrite.javaThe sample program uses the WMQConstants class rather than coding the string value directly. You can find the WMQConstants documentedhere. Within the constants you should find JMS_IBM_MQMD_PUTAPPLNAMEhere. The JavaDoc for this field says:JMS_IBM_MQMD_PUTAPPLNAMEpublic static final String\n JMS_IBM_MQMD_PUTAPPLNAMEJMS_IBM_MQMD_PUTAPPLNAME property name. Sets or gets the MQ application\n name sending the message. Set using \n setStringProperty(JmsConstants.JMS_IBM_MQMD_PUTAPPLNAME,); Get using\n getStringProperty(JmsConstants.JMS_IBM_MQMD_PUTAPPLNAME);\n Valid on a Message object.Note that the application must be granted +setall authority either by running in the mqm group (NOT recommended) or by using the setmqaut command. The +setall authorization must be applied both at the QMgr and at the specific queue.\n"} +{"text": "### Human: I'm trying to write a simple tool for monitoring the state of a Queue Manager. One of the things I'd like to monitor is the current queue depth of each queue. I haven't been able to find a way to programmatically enumerate all of the queues on a particular Queue Manager, though. Do any of the MQ APIs provide this functionality? I'd prefer to do this with C, but if it's only possible with another language's bindings, I'd at least like to know that.### Assistant: Several C samples atCapitalware. Look for the ones that use the MQAI interface. Nothing there that enumerates queues but the MQAI programs all use Programmable Command Format (PCF) messages. Enumerating the list of queues is a PCF equivalent of DIS Q(*).You will also want to review the PCF manual in theInfocenterTried to add this as a comment but the links didn't markup as expected:One way or another you end up at PCF commands if you are doing this remotely. You can run MQSC script commands remotely if you install theWMQ clientand useSupportPac MO72to convert them to PCF if you want but at the QMgr it's ultimately PCF. I do a lot of central inquiry and reporting on WMQ with scripts that iterate over a list of QMgrs and execute MO72. I once used CGI and wrote a web front-end over MO72.By the way,SupportPac MO71will do the type of monitoring that you are describing. It's compiled C so it needs the WMQ client installed but it can be set up to monitor depth of queues and even has a mini web server so many people can use the same MO71 instance.\n"} +{"text": "### Human: I need to implement handling of redelivery of JMS messages in the application that is deployed on the IBM-backed environment, so JMS provider is standalone MQ V6.0.Do you know if it is setting JMSXDeliveryCount property correctly and I can rely on the values of this very property?### Assistant: I've just found the answer for my question :)The IBM WebSphere MQ sets the following JMSX* header properties:JMSXUserIdwill be set by WMQ JMS when you send the message - it looks at\nthe userid running the application and sets JMSXUserId accordingly.JMSXAppIdwill also be set by WMQ JMS when you send the message - to\nsomething like \"WebSphere MQ Client for Java\". There is some debate over\nhow to interpret the JMS Spec on this one - some JMS providers allow an\napplication to set it, others don't. Currently, the WebSphere MQ\nimplementation does not.JMSXDeliveryCountwill be set by WMQ JMS when the message is sent on to a\nreceiving application - it tells that receiving application how many times\nWebSphere MQ has tried to deliver the message to that or other applications.\nNormally, messages should only be delivered once, but in the case of\nfailures or explicit rollback of transactions etc., the delivery count may\nget higher, and applications or JMS providers can use that information to\nspot when things are going wrong and perhaps do something different like\nmoving the message to a dead letter queue, or even discard the message,\ndepending on the nature of the message, the application and the context.\n"} +{"text": "### Human: We have two connections (as a .NET/Windows client) to an IBM MQ endpoint (let's say non-Windows).We use SSL, which is supported by a pair of certificates (client and server) and correctly labelled in the Windows Certificate Store to ensure we pick the right certificate.Everything in Queue A works fine.Queue B has recently stopped working. We now get a 2538 error. Nothing has changed.We keep both sides of both queues the same as we can.We have Wire-traced both Queue A and Queue B and can confirm SSL negotiation isincompleteon Queue B because of a \"Connection Reset\" by the ClientAll certificates are valid and in dateWe've tried with hard-trusted Self-signed certs between partiesIt feels like there may be a communication error inhibiting successful SSL handshake.The problem is exacerbated by theWebSphereMqClientNuGet package we use (8.0.0.7 - latest version) not giving us anything other than a 2538 error on calling:_mqQueueManager = new MQQueueManager((string)queueManager, (Hashtable)connectionProperties);Connection Properties being (redacted):\n Is there anything an expert could give us a clue on? Is there a way to get any diagnostics out of the NuGet black box?Update 1:The server is running 8.0.0.9.Update 2:@JoshMc suggested I turn on logging.From this, I learn:It couldn't (rightly) find anmqclient.inifile in the binary folder or my personal folder.Errors start during SSL Authentication, specificallySystem.ComponentModel.Win32Exception (0x80004005): The credentials supplied to the package were not recognizedFollowed by the host seemingly disappearing:MQTCPConnection.ConnectSocket(string,string,MQLONG) rc=OK\n00000174 10:29:28.917526 5748.1 CompCode: 2, Reason: 2538\nAMQ9202: Remote host 'x.x.x.x(y)' not available, retry later.Out of which comes the 2538CompCode: 2, Reason: 2538Negotiation seems to continue, using appropriate TLS version, etc.Then when trying to get the client (with our private key) certificate, we getSystem.ComponentModel.Win32Exception (0x80004005): The credentials supplied to the package were not recognizedI have double checked that the userdoeshave permission to the Private Key.Update 3Issue found.The issue was highlighted by the textSystem.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.. On investigation it turns out that the permissions on the Private Key had been removed during a certificate renewal. I know the above says the permissions were confirmed to be there, but for a different certificate. I've left it in to retain history/honesty.### Assistant: The NuGet package is just the stand-aloneamqmdnet.dllthat IBM lets you relocate from a full MQ client install or download via the redistributable client zip file.If you want to have them turn on a trace for a stand-alone Managed .NET MQ Client you need to follow the instructions atDeveloping applications > Developing .NET applications > Writing and deploying IBM MQ .NET programs > Using the stand-alone IBM MQ .NET client.You start by adding the following to your app.config and point the value to a directory that you can create a file in.\n\nYou then create a file calledtrace.configin the above directory with the following contents where theMQTRACEPATHandMQERRORPATHpoint to a directory that the user running your application can write to.\n\n 2\n C:\\MQTRACEPATH\n C:\\MQERRORLOGPATH\nNote that you can toggle theMQTRACELEVELbetween2and0to dynamically turn tracing on or off for a running program.On the MQIPT side of things if you use the stockmqipt.sketo start your MQIPT instance you can set the env variableMQIPT_JVM_OPTIONS=\"-Djavax.net.debug=ssl\"before you start MQIPT, this will cause java to provide TLS debug logging tomqipt.stdout.login thelogsdirectory.\n"} +{"text": "### Human: In this post , Garry Russell explained how to programmatically create multiple KafkaListeners to listen from multiple topics.. [this setup is actually working successfully for me ]Kafka Spring: How to create Listeners dynamically or in a loop?Now i want to have a similar setup working for JMSListeners as well - where I can have one class with one @JMSListener in it and i can programmatically create multiple instances of that JMSListener each injected with its own queueName.I found this postSpring JMS start listening to jms queues on requestIn the end of this post Gary made a similar comment,If you wish to dynamically create lots of containers, then just create the containers programmatically, call afterPropertiesSet(), then start()I used the setup that i had working from the first post above(related to KafkaListeners), my multiple instances of JMS listeners are starting up but not consuming any messages.Basically i didn't understand where do i do thisthen just create the containers programmatically, call afterPropertiesSet(), then start()I am confused with the word - container, I know there's JMSListener and there's \nJmsListenerContainerFactory, what is a container in this context - i guess JMSListener?i have confirmed there are messages in the queue. also when i don't create the listeners programmatically and just have one listener with hardcoded queue mentioned on it, it consumes the message fine.Basically none of the listeners are consuming the messages when i am creating multiple JMS Listeners programmatically@SpringBootApplication\n@EnableJms\npublic class MqProdConsumerApplication {\n private static Logger logger = LogManager.getLogger(MqProdConsumerApplication.class.getName());\n private static Consumers consumersStatic;\n\n @Autowired\n Consumers consumers;\n\n @PostConstruct\n public void init() {\n consumersStatic = this.consumers;\n }\n\n @Bean\n public Gson gson() {\n return new Gson();\n }\n\n public static void main(String[] args) {\n ConfigurableApplicationContext context = SpringApplication.run(MqProdConsumerApplication.class, args);\n List queueInformationList = consumersStatic.getQueueInformationList();\n Assert.notEmpty(queueInformationList, \"queueInformationList cannot be empty\");\n logger.debug(\"queueInformationList ************\" + queueInformationList.toString());\n for (QueueInformation queueInformation : queueInformationList) {\n AnnotationConfigApplicationContext child = new AnnotationConfigApplicationContext();\n child.setParent(context);\n child.register(MQConfig.class);\n Properties props = new Properties();\n props.setProperty(\"mqQueueName\", queueInformation.getMqQueueName());\n //\n PropertiesPropertySource pps = new PropertiesPropertySource(\"listenerProps\", props);\n child.getEnvironment().getPropertySources().addLast(pps);\n child.refresh();\n }\n }\n}Here's the MQConfig that has the listenerContainerFactory@Configuration\npublic class MQConfig {\n Logger logger = LoggerFactory.getLogger(this.getClass());\n\n @Value(\"${ibm.mq.user}\")\n private String mqUserName;\n\n @Bean\n public MQListener listener() {\n return new MQListener();\n }\n\n @PostConstruct\n public void afterConstruct() {\n logger.debug(\"************* initialized MQ Config successfully for user =\" + mqUserName);\n }\n\n @Bean\n public JmsListenerContainerFactory myFactory(ConnectionFactory connectionFactory,\n DefaultJmsListenerContainerFactoryConfigurer configurer) {\n DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();\n configurer.configure(factory, connectionFactory);\n\n // Put the MQ username in the PCF environment.\n // Otherwise, the connection is identified by PCF's default user, \"VCAP\"\n System.setProperty(\"user.name\", mqUserName);\n return factory;\n }\n}Then comes the MQListener which has the actual @JMSListenerpublic class MQListener {\n Logger logger = LoggerFactory.getLogger(this.getClass());\n\n @Value(\"${mqQueueName}\")\n private String mqQueueName;\n\n @PostConstruct\n public void afteConstruct() {\n logger.debug(\"************* initialized MQ Listener successfully, will read from =\" + mqQueueName);\n\n }\n\n @JmsListener(destination = \"${mqQueueName}\", containerFactory = \"myFactory\")\n public void receiveMessage(String receivedMessage) throws JAXBException, ExecutionException, InterruptedException {\n logger.debug(\"***********************************************receivedMessage:\" + receivedMessage);\n }\n}Here's my application.ymlibm.mq.queueManager: ABCTOD01\nibm.mq.channel: QMD00.SERVER\nibm.mq.connName: mqdv1.devfg.ABC.com\nibm.mq.user: pmd0app1\nibm.mq.password:\nconsumers:\n queueInformationList:\n -\n mqQueueName: QMD00.D.SRF.PERSON.LITE.PHONE.LOAD\n -\n mqQueueName: QMD00.D.SRF.PERSON.PHONE.LOAD### Assistant: ok i found another post where Gary has answered what i was looking forAdding Dynamic Number of Listeners(Spring JMS)Essentially here's the working solution for me.\nGreat job @GaryRussell - I am a fan now :)@Configuration\n@EnableJms\npublic class AppConfig implements JmsListenerConfigurer {\n\n @Override\n public void configureJmsListeners(JmsListenerEndpointRegistrar registrar) {\n List queueInformationList = consumersStatic.getQueueInformationList();\n int i = 0;\n for (QueueInformation queueInformation :\n queueInformationList) {\n SimpleJmsListenerEndpoint endpoint = new SimpleJmsListenerEndpoint();\n endpoint.setId(\"myJmsEndpoint-\" + i++);\n endpoint.setDestination(queueInformation.getMqQueueName());\n endpoint.setMessageListener(message -> {\n logger.debug(\"***********************************************receivedMessage:\" + message);\n });\n registrar.registerEndpoint(endpoint);\n logger.debug(\"registered the endpoint for queue\" + queueInformation.getMqQueueName());\n }\n}See alsohttps://docs.spring.io/spring/docs/current/spring-framework-reference/integration.html#jms-annotated-programmatic-registration\n"} +{"text": "### Human: I tried to verify the speed of using both asyncPut()andCommit()using the code below. The problem is that its speed is ten times slower than either using asyncPut()only orCommit()only, which does not make sense.Am I missing something here?class AsyncProducerWithCommit \n {\n private MQQueueManager _queueManager;\n private MQQueue _queue;\n\n public void Run()\n {\n Produce();\n }\n\n\n void Produce()\n {\n Open(ConnectionMode.Write);\n\n PutMessage(ConvertMessageToByte(message)); \n\n _queue.Close();\n _queueManager.Disconnect();\n }\n\n void PutMessage(byte[] messageString)\n { \n MQMessage _message = new MQMessage();\n _message.Write(messageString);\n _message.Format = MQC.MQFMT_STRING;\n _message.CharacterSet = 1208;// IbmUtf8Encoding;\n _message.Persistence = MQC.MQPER_PERSISTENT;\n\n var putMessageOptions = new MQPutMessageOptions();\n putMessageOptions.Options = MQC.MQPMO_SYNCPOINT //unit of work\n + MQC.MQPMO_ASYNC_RESPONSE; //async\n\n _queue.Put(_message, putMessageOptions); //send message asynchronously\n\n _queueManager.Commit(); \n\n }\n\n void Open(ConnectionMode connectionMode)\n {\n string _queueManagerName = _appSetting.MessagingServerSetting.QueueManagerName;\n\n int openOptions = 0;\n\n switch (connectionMode)\n {\n case ConnectionMode.Read:\n openOptions = MQC.MQOO_INPUT_SHARED + MQC.MQOO_FAIL_IF_QUIESCING;\n break;\n case ConnectionMode.Write:\n openOptions = MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING;\n break;\n }\n\n\n var properties = new Hashtable\n {\n {MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED },\n {MQC.CONNECT_OPTIONS_PROPERTY, MQC.MQCNO_RECONNECT },\n { MQC.HOST_NAME_PROPERTY, \"192.168.1.10\" },\n { MQC.PORT_PROPERTY, \"1415\"},\n { MQC.CHANNEL_PROPERTY, \"LOCAL.DEF.SVRCONN\" },\n {MQC.USER_ID_PROPERTY, \"user\" },\n {MQC.PASSWORD_PROPERTY, \"pwd\" } \n };\n\n _queueManager = new MQQueueManager(_queueManagerName, properties);\n _queue = _queueManager.AccessQueue(QUEUE_NAME, openOptions);\n }\n\n\n public enum ConnectionMode\n {\n Read,\n Write\n }\n\n }Update 1Async PutputMessageOptions.Options = MQC.MQPMO_ASYNC_RESPONSE; //async\n_queue.Put(_message, putMessageOptions); //send message asynchronouslyPut with CommitputMessageOptions.Options = MQC.MQPMO_SYNCPOINT; //unit of work \n _queue.Put(_message, putMessageOptions); \n _queueManager.Commit();QueueManager version: 8.0.0.5 on Redhat Linux 7+MQ.NET: 8.0.0.8### Assistant: In the IBM MQ v8 Knowledge center page \"Using asynchronous put in a client application\" it states:Normally, when an application puts a message or messages on a queue,\n using MQPUT or MQPUT1, the application has to wait for the queue\n manager to confirm that it has processed the MQI request. You can\n improve messaging performance, particularly for applications that use\n client bindings, and applications that put large numbers of small\n messages to a queue, by choosing instead to put messages\n asynchronously. When an application puts a message asynchronously,the\n queue manager does not return the success or failure of each call, but\n you can instead check for errors periodically.Async put only impacts the put call which will return right away instead of waiting for the queue manager to confirm it has processed the put.So if you have the following it would be expected to be the fastest since you would not ever be waiting for the message to write to disk._message.Persistence = MQC.MQPER_PERSISTENT;\nputMessageOptions.Options = MQC.MQPMO_ASYNC_RESPONSE; //async\n_queue.Put(_message, putMessageOptions); //send message asynchronouslyIf you have either of these, the commit is going to wait for the message to write to disk so would be as slow as the disk write takes. It is very possible this is slower than the above, but 3sec vs 30sec does not seem reasonable._message.Persistence = MQC.MQPER_PERSISTENT;\nputMessageOptions.Options = MQC.MQPMO_SYNCPOINT //unit of work\n + MQC.MQPMO_ASYNC_RESPONSE; //async\n_queue.Put(_message, putMessageOptions); //send message asynchronously\n_queueManager.Commit();Or_message.Persistence = MQC.MQPER_PERSISTENT;\nputMessageOptions.Options = MQC.MQPMO_SYNCPOINT; //unit of work \n_queue.Put(_message, putMessageOptions); \n_queueManager.Commit();If the call with MQPMO_SYNCPOINT and MQPMO_ASYNC_RESPONSE is 30 seconds and the call with only MQPMO_SYNCPOINT is 3 seconds, then I think there must be some sort of defect and I would suggest you open a PMR with IBM and they will likely ask you for at least a client side .NET trace and likely queue manager trace from the same time.\n"} +{"text": "### Human: Are the features below supported by IBM Websphere MQ in .NET client? Please provide code example.1. Publisher ConfirmsWhen Publisher sends messages to queue, it receives confirmations from MQ server that messages have been saved to hard disk.Does MQ server save message before sending confirmation?Update 2Is it corrent that when MQQueue.Put() returns, the message has been saved to transaction log? How long does it take to save to disk? What about message persistence in a cluster?void PutMessage(byte[] messageString)\n {\n try{\n\n // creating a message object\n message = new MQMessage();\n message.Write(messageString);\n message.Format = MQC.MQFMT_STRING;\n message.CharacterSet = 1208;// IbmUtf8Encoding;\n message.Persistence = MQC.MQPER_PERSISTENT;\n\n var options = new MQPutMessageOptions\n {\n Options = useSyncPoint ? MQC.MQPMO_SYNCPOINT : MQC.MQPMO_NO_SYNCPOINT\n };\n\n queue.Put(message, options);\n qMgr.Commit();\n\n }catch(Exception e){\n qMgr.Backout();\n }\n }2. Consumer AcknowledgementWhen Consumer receives messages from queue, processes them, then sends acknowledgement to MQ server.Update 3How can Consumer acknowledges to MQ server that messages have been processed successfully, and the messages can be safely deleted from server?public void GetMessages()\n { \n Open(ConnectionMode.Read);\n\n for (int i = 1; i <= numberOfMsgs; i++)\n { \n GetMessage();\n }\n queue.Close();\n queueManager.Disconnect(); \n }\n\n public string GetMessage()\n {\n message = new MQMessage { Format = MQC.MQFMT_STRING };\n var mqMessageOptions = new MQGetMessageOptions\n { \n Options = MQC.MQGMO_WAIT | MQC.MQGMO_FAIL_IF_QUIESCING | MQC.MQGMO_SYNCPOINT\n };\n\n queue.Get(message, mqMessageOptions, MaxMessageSizeInBytes);\n\n var content = message.ReadString(message.MessageLength);\n message.ClearMessage();\n\n return content;\n }\n\n\npublic void Open(ConnectionMode websphereConnectionMode)\n {\n var connectionSettings = new Hashtable\n {\n {MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED },\n {MQC.CONNECT_OPTIONS_PROPERTY, MQC.MQCNO_RECONNECT }\n };\n\n int openOptions = 0;\n\n switch (websphereConnectionMode)\n {\n case ConnectionMode.Read:\n openOptions = MQC.MQOO_INPUT_SHARED + MQC.MQOO_FAIL_IF_QUIESCING;\n break;\n case ConnectionMode.Write:\n openOptions = MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING;\n break;\n }\n queueManager = new MQQueueManager(queueManagerName);\n queue = queueManager.AccessQueue(queueName, openOptions);\n }\n\n\n public enum ConnectionMode\n {\n Read,\n Write\n }How to do an explicit ACK when receiving Websphere MQ messages?### Assistant: If the message is persistent, then MQ will write it into the transaction log and wait for the log extent to reach the disk, before put returns.To achieve this, the consumer should read messages under syncpoint, and commit the gets after appropriate processing is done on the client side.\n"} +{"text": "### Human: Following code snippet has my connection and subscription logic for an IBM MQ Queue. When ever there is a connection failure, I am using IConnection.ExceptionListener delegate to establish a new connection to by queue and resubscribing for the messages. But the problem is, I can see multiple queue handles. How can I make sure I close the previous connection handle and establish a new connection where ever there is a connection break due to network issues or MQ server restarts?private CancellationToken _cancellationToken;\nprivate IConnection _connection;\nprivate IConnectionFactory _connectionfactory;\nprivate IMessageConsumer _consumer;\nprivate IDestination _destination;\nprivate MessageFormat _msgFormat;\nprivate IMessageProducer _producer;\nprivate ISession _session;\n\nprivate void CreateWebsphereQueueConnection () {\n SetConnectionFactory ();\n\n //Connection\n _connection = _connectionfactory.CreateConnection (null, null);\n _connection.ExceptionListener = new ExceptionListener (OnConnectionException);\n\n //Session\n _session = _connection.CreateSession (false, AcknowledgeMode.AutoAcknowledge);\n\n //Destination\n _destination = _session.CreateQueue (\"queue://My.Queue.Name\");\n _destination.SetIntProperty (XMSC.DELIVERY_MODE, 2);\n _destination.SetIntProperty (XMSC.WMQ_TARGET_CLIENT, 0);\n\n //Consumer\n _consumer = _session.CreateConsumer (_destination);\n}\n\nprivate IConnectionFactory SetConnectionFactory () {\n XMSFactoryFactory factoryFactory = XMSFactoryFactory.GetInstance (XMSC.CT_WMQ);\n IConnectionFactory cf = factoryFactory.CreateConnectionFactory ();\n\n // Set the properties\n cf.SetStringProperty (XMSC.WMQ_CHANNEL, ConnectionSettings.Channel);\n cf.SetIntProperty (XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);\n cf.SetIntProperty (XMSC.WMQ_FAIL_IF_QUIESCE, XMSC.WMQ_FIQ_YES);\n cf.SetStringProperty (XMSC.WMQ_QUEUE_MANAGER, ConnectionSettings.QueueManager);\n cf.SetStringProperty (XMSC.WMQ_CONNECTION_NAME_LIST, ConnectionSettings.ConnectionList);\n cf.SetIntProperty (XMSC.WMQ_CLIENT_RECONNECT_TIMEOUT, ConnectionSettings.ReconnectTimeout);\n cf.SetIntProperty (XMSC.WMQ_CLIENT_RECONNECT_OPTIONS, ConnectionSettings.ReconnectOptions);\n\n cf.SetStringProperty (XMSC.WMQ_PROVIDER_VERSION, XMSC.WMQ_PROVIDER_VERSION_DEFAULT);\n cf.SetBooleanProperty (XMSC.WMQ_SYNCPOINT_ALL_GETS, true);\n return cf;\n}\n\npublic override void Subscribe (Action onMessageReceived) {\n try {\n\n _connection.ExceptionListener = delegate (Exception connectionException) {\n //Using any of these two statements is termination my code. Debugger doesn't move to CreateWebsphereQueueConnection() line of code at all\n //_conection.Stop()\n //_conection.Close()\n CreateWebsphereQueueConnection ();\n Subscribe (onMessageReceived);\n };\n\n MessageListener messageListener = new MessageListener ((msg) => {\n onMessageReceived (message);\n });\n _consumer.MessageListener = messageListener;\n\n // Start the connection\n _connection.Start ();\n } catch (Exception ex) {\n //Log exception details\n }\n}### Assistant: You have already set reconnection option on the connection factory. XMS library will do the reconnection automatically when the connection to queue manager breaks, excepting when the queue manager is shutdown without -r or -s option. So your application does not need to reconnect explicitly. Having exception listener will help in understanding what's going with reconnection process.\n"} +{"text": "### Human: We are one application in a larger environment and a client for some data interface, using Websphere MQ 8.x. Our application is a Java EE application running on a WildFly 9 which uses a resource adaptor (wmq.jmsra.rar) which is deployed together with the EAR file in the same AS. We interact with the MQ Server in both directions. So we have on the one hand some MDBs (which are due to historical origins still in EJB 2.x format without annotations) listining to some queues and which are configured by theejb-jar.xmldeployment descriptor, containing the activation config propertiesdestinationType, channel, queueManager, hostName, username, password. On the other hand we have a sender which lookups a queue connection factory and a queue via JNDI and creates a connection.Now we have the requirement with a newly established MQ server to communicate via SSL and a client certificate. We got such a certificate from the server people for our machine. So my questions are:What has to be done to make it work with the setup described above?Is this possible purely by configuration and thus transparent for the application or has the application to specifically use SSL, present the certificate or something similar?Does this conflict with any other keystore already used by some other part of the application?Is some additional IBM MQ software needed to make it work? (Our client is just the RAR, no software is installed and no MQ server on our side should be established.)Update:I went for setting the global JSSE properties for the VM as it solved my problem as a start.It was necessary to set the following parameters:-Djavax.net.ssl.trustStore=\n-Djavax.net.ssl.keyStore=\n-Djavax.net.ssl.keyStorePassword=Additionally, since I am using non-IBM VM, there was the following paramter to set:-Dcom.ibm.mq.cfg.useIBMCipherMappings=falseThen, it was necessary to set the cipher suite property on the RAR configuration instandalone-full.xmltogether with the other connection parameters of my WildFly installation:\n...\n \n \n xxx\n...\nAnd finally, the MDBs listining on the queues also had to be configured to use the cipher suite, so in my case I had to add that in the ejb-jar.xml by adding for each MDB:\n sslCipherSuite\n xxx\n### Assistant: OP stated in the comments that they use OpenJDK 8 and are using the IBM MQ v9.0.0.1 resource adapter, both of the following known problems are fixed in that release, but putting this information here for the benefit of others who may not yet be at a release where these are fixed:APARIV66840: TLS cipherspecs in non-IBM JREs were not supported until 8.0.0.2.APARIT10837: WildFly 9 may hit another issue if using a non-IBM JRE in finding the KeyStore that contains the client cert, this is fixed in 8.0.0.5.The resource adapter includes the MQ functionality to support TLS but uses the underlying JSSE for the actual encryption.Based on RFC 5246 it suggests that the TLS Client should only return a cert that is suitable based on the the server sending \"A list of the distinguished names [X501] of acceptable certificate_authorities, represented in DER-encoded format.\", this would mean that if the certs in your keyStore for the different uses (ex: existing non-MQ certs and MQ certs) arenotsigned by the same CA chain, and the various TLS servers you connect to do not accept certs from the CA of other certs in your key store (ex: existing non-MQ certs and MQ certs) then JSSE will return the appropriate cert to each.For example if existing non-MQ certs are signed by a Internal CA and the MQ cert is signed by another company's CA, it is highly unlikely that the MQ company would trust your internal CA certs, conversely it is unlikely that your other non-MQ TLS servers you connect to would trust the other company's CA. Since JSSE would return only a cert that was trusted by the remote server they should not impact each other. You would just need to add the MQ cert to your existing key store.Quotes from the relevant sections of RFC 5246 are at the bottom of this post.@a_cornish_pasty answer to your question \"Use specific keystore for JMS\" is also an alternative as it would allow you to specify a separate key store from what the rest of Wildfly uses, this key store could have ONLY the MQ cert, so no chance of causing an issue with the existing key store and certs.RFC 5246 Section 7.4.4states the following:7.4.4. Certificate RequestWhen this message will be sent:A non-anonymous server can optionally request a certificate from\nthe client, if appropriate for the selected cipher suite. This\nmessage, if sent, will immediately follow the ServerKeyExchange\nmessage (if it is sent; otherwise, this message follows the\nserver's Certificate message).It then goes on to state:certificate_authoritiesA list of the distinguished names [X501] of acceptable\ncertificate_authorities, represented in DER-encoded format.These\ndistinguished names may specify a desired distinguished name for a\nroot CA or for a subordinate CA; thus, this message can be used to\ndescribe known roots as well as a desired authorization space.If\nthe certificate_authorities list is empty, then the client MAY\nsend any certificate of the appropriate ClientCertificateType,\nunless there is some external arrangement to the contrary.RFC 5246 Section 7.4.6states the following:7.4.6. Client CertificateWhen this message will be sent:This is the first message the client can send after receiving a\nServerHelloDone message.This message is only sent if the server\nrequests a certificate.If no suitable certificate is available,\nthe client MUST send a certificate message containing no\ncertificates.That is, the certificate_list structure has a\nlength of zero. If the client does not send any certificates, the\nserver MAY at its discretion either continue the handshake without\nclient authentication, or respond with a fatal handshake_failure\nalert. Also, if some aspect of the certificate chain was\nunacceptable (e.g., it was not signed by a known, trusted CA), the\nserver MAY at its discretion either continue the handshake\n(considering the client unauthenticated) or send a fatal alert.It then goes on to state:If the certificate_authorities list in the certificate request\nmessage was non-empty,one of the certificates in the certificate\nchain SHOULD be issued by one of the listed CAs.\n"} +{"text": "### Human: What is the proper way, or the popular convention of deciding when to kill a listener? I can't seem to find a solid answer really anywhere. The queues I'm dealing with are IBM's MQ Queues, and I know typically that you would read until you receive a 2033 error code (my company does this in other applications) at which point you can wrap up, but for a SpringBoot Jms application what's the convention here? Once the queue is empty the listener just hangs until more messages come. I know HOW to kill it if I want, but how can I know WHEN?As an example, here is a config for a sample project I threw together@Configuration\n@EnableTransactionManagement\npublic class JmsConfig {\n\n@Bean\nprotected DefaultJmsListenerContainerFactory defaultJmsListenerContainerFactory() throws JMSException {\n DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();\n factory.setConnectionFactory(mqQueueConnectionFactory());\n factory.setConcurrency(\"1\");\n factory.setSessionTransacted(true);\n factory.setAutoStartup(true);\n factory.setSessionAcknowledgeMode(Session.CLIENT_ACKNOWLEDGE);\n factory.setErrorHandler(new JmsErrorHandler());\n return factory;\n}\n\n@Bean\npublic MQQueueConnectionFactory mqQueueConnectionFactory() {\n MQQueueConnectionFactory mqQueueConnectionFactory = new MQQueueConnectionFactory();\n mqQueueConnectionFactory.setHostName(host);\n try {\n mqQueueConnectionFactory.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n mqQueueConnectionFactory.setCCSID(1208);\n mqQueueConnectionFactory.setChannel(channel);\n mqQueueConnectionFactory.setPort(port);\n mqQueueConnectionFactory.setQueueManager(queueManager);\n } catch (Exception e) {\n e.printStackTrace();\n }\n return mqQueueConnectionFactory;\n}and here is the listener@Component\npublic class Consumer {\n\n @JmsListener(id = \"myQueue\", destination = \"queue\")\n public void processMessage(Message message) throws MQException, IOException {\n try {\n String messageString = ((TextMessage) message).getText();\n } catch (JMSException e) {\n e.printStackTrace();\n }\n }\n}Besides the main class and the ErrorHandler, that is literally the whole sample project, and it will process messages. What I have done in other applications is instantiated aMQQueuegiven the queue values and just simple didqueue.getCurrentDepth()and if I get a zero I then call on an instance of a ListenerContainerController that then calls stop from a JmsListenerEndpointRegistry given the queues id.Does Spring have an easy way of communication \"hey your queue is now empty\" or is there a way to end it after x amount of time has passed?### Assistant: AJmsListeneris intended to receive and process messages as they arrive on the destination. It isn't intended to read until the destination is empty and then stop, it is designed to keep running.Instead just use aJmsTemplateand itsreceivemethod to read the messages until they are done. Then process them and write a report.Ultimately you could even create a Spring Batch job using theJmsItemReader, this reader will read until there is nothing more to read and then it will all end. Underneath it also uses aJmsTemplateWhat you could do then is, as you are using Spring Boot, use a cron job to daily trigger this job (which is basically done launching the jar you created). See also the reference guide of Spring Boot on how to work withbatch applications.\n"} +{"text": "### Human: Looking at the sample codes it seems I needqueue managerandqueue nameto setup MQ through code. What is difference between those and where I can get those values from? Any suggestion?MQTopicConnectionFactory cf = new MQTopicConnectionFactory();\n\n // Config\n cf.setHostName(\"localhost\");\n cf.setPort(1414);\n cf.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);\n cf.setQueueManager(\"QM_thinkpad\");\n cf.setChannel(\"SYSTEM.DEF.SVRCONN\");\n\n MQTopicConnection connection = (MQTopicConnection) cf.createTopicConnection();\n MQTopicSession session = (MQTopicSession) connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);\n MQTopic topic = (MQTopic) session.createTopic(\"topic://foo\");\n MQTopicPublisher publisher = (MQTopicPublisher) session.createPublisher(topic);\n MQTopicSubscriber subscriber = (MQTopicSubscriber) session.createSubscriber(topic);### Assistant: You connect to a queue manager which may host many different queues. So yes, an application generally needs access to a queue manager and then specific queues on that queue manager. I suggest you can look at the Stack Overflowinfo for the websphere-mq tagto help get you started. The names of those objects should be known by your application architect/developer or can be confirmed with the MQ admin.\n"} +{"text": "### Human: How to I specify the username and password in a wmq connection string? This is the sample connection string I'm working with.Uri sampleAddress = new Uri(\"wmq://localhost:1414/msg/queue/Q1?connectQueueManager=QM1&replyTo=Q2\");How do I put the userId/password used for authentication to the MQ Manager here?### Assistant: For V8.0 I was successful by making the connection in the following way:Hashtable connectionProperties = new Hashtable(); \nconnectionProperties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\nconnectionProperties.Add(MQC.HOST_NAME_PROPERTY, _queueServer);\nconnectionProperties.Add(MQC.PORT_PROPERTY, _portNumber);\nconnectionProperties.Add(MQC.CHANNEL_PROPERTY, _channelInfo);\nconnectionProperties.Add(MQC.USER_ID_PROPERTY, \"userid\");\nconnectionProperties.Add(MQC.PASSWORD_PROPERTY, \"password\"); \nqueueManager = new MQQueueManager(_queueManager, connectionProperties);Seehere.\nAlthough for version below 8.0 please see that you will have to use an exit mechanism as for them the client provided id is not used.\n"} +{"text": "### Human: Closed. This question needs to be morefocused. It is not currently accepting answers.Want to improve this question?Update the question so it focuses on one problem only byediting this post.Closed7 years ago.Improve this questionI just need to know some basic information or the procedure that is followed when migrating from IBM MQ server to ActiveMQ. We are planning to migrate our messaging systems from IBM MQ to Active MQ.To be specific the migration is from MQ V7.0 to ActiveMQ V5.7.0. What would be the object movement from IBM MQ to ActiveMQ i.e., to know the comparison or the relation between MQ objects and ActiveMQ if there are any.( IBM MQ queue->? in ActiveMQ and other major things)It would be greatly appreciable if someone would provide me some insight on this. Thanks in advance for your help### Assistant: It's a large topic depending on the complexity of your setup.Here are some high level topics to consider.ClientsJMSIf you are using IBM WebSphere MQ with JMS clients those clients will need to replace their IBM libraries with ActiveMQ ones and replace the configuration.MQ NativeUsing native MQ clients will require you to rewrite your applications to use any of the client libraries available for ActiveMQ. This might be non straight forward.QMGR ConfigurationQueues and topicsSimple objects in WMQ such Queues and Topics are the same in ActiveMQ, although you do not have to explicitly define them.Cluster ConfigurationWMQ clusters are roughly the same as AMQ Network of Brokers. However, in AMQ message propagation is pretty much automatic and all queues are global (by default). Most features should be possible to migrate, one way or another.HA ConfigurationAMQ uses similar fail-over setups as WMQ, where a shared network disk is the most common.SecurityAMQ and WMQ have different security mechanisms but support users, passwords, authorities, security groups, TLS transport security etc etc. A migration path should be possible but may not be straight forward in some scenarios.\n"} +{"text": "### Human: I know that MQExplorer GUI could show who connected to some queue by some channel and other information about this connection, but I didn't find anything in PCF to do that from Java.Thanks in advance for commands and examples if they exist!### Assistant: This shows sample snippet shows how to retrieve theconname.// Create the PCF message type for the inquire.\nPCFMessage pcfCmd = new PCFMessage(MQConstants.MQCMD_INQUIRE_Q_STATUS);\n// Add queue name\npcfCmd.addParameter(MQConstants.MQCA_Q_NAME, \"MYQ\");\n// We want Q HANDLE attributes\npcfCmd.addParameter(MQConstants.MQIACF_Q_STATUS_TYPE, MQConstants.MQIACF_Q_HANDLE);\n// We want to retrieve only the connection name\npcfCmd.addParameter(MQConstants.MQIACF_Q_STATUS_ATTRS, MQConstants.MQCACH_CONNECTION_NAME);\n// Execute the command. The returned object is an array of PCF messages.\nPCFMessage[] pcfResponse = pcfCM.agent.send(pcfCmd);\n\ntry{\n for(int i = 0; i < pcfResponse.length;i++){\n String name = (String) pcfResponse[i].getParameterValue(MQConstants.MQCACH_CONNECTION_NAME);\n System.out.println(\"Connection Name: \" + name); \n }\n }catch(Exception ex) {\n System.out.print(ex);\n}You can modify the snippet per your need. Hope it helps.\n"} +{"text": "### Human: I am trying to send Text messages using IBM XMS for .NET. After sending around 254 messages, I get following error:An unhandled exception of type 'IBM.XMS.XMSException' occurred in IBM.XMS.Client.WMQ.dll\n\nAdditional information: CWSMQ0082E: Failed to send to CompCode: 2, Reason: 2017.There isn't much on google about it. I found one related post atWSMQ Queue LimitThe post suggest that there is some sort of limit in max queues. The links in the post don't seem to work. How do I overcome this error ?### Assistant: MQ has a commandmqrcwhich returns the text for any reason code or message code. The 2017 meansMQRC_HANDLE_NOT_AVAILABLE. A better explanation can be had by going to theKnowledge Centerand searching on 2017. This returns several pages of API calls which can return 2017, along with the page for the reason code itself:2017 (07E1) (RC2017): MQRC_HANDLE_NOT_AVAILABLE.That page provides the following description of the problem:ExplanationAn MQOPEN, MQPUT1 or MQSUB call was issued, but the\n maximum number of open handles allowed for the current task has\n already been reached. Be aware that when a distribution list is\n specified on the MQOPEN or MQPUT1 call, each queue in the distribution\n list uses one handle.We know from the documentation, and can confirm from MQ Explorer's QMgr Extended Properties panel, that by default the maximum handles any process will be allowed to have is 256.Based on all this and that your program is dying after 254 messages, the conclusion is that it is grabbing a fresh handle for every message beingPUTand not ever releasing them.Generally this occurs when there is a loop that should containonlythePUTandCOMMITbut instead also contains theOPEN. I would suggest carefully reviewing your code, possibly also updating your question to post the code here.I would also suggest studying the MQ .Net sample programs or using one of them as the basis for your own code.\n"} +{"text": "### Human: I was trying to configure my WMQ. \nqueue manager was running until i changed the password of my musr_mqadmin account. \nNow it the local queue manager that i created cannot be start any moreThe pop up says \"The MQ service for installation \"installation1\" must be running\"While i tried to reset the musr_mqadmin account, it says \"mq configuration an error while validating the security credentials \"I am really stuck and helpless. Please kindly advise.### Assistant: MQ Service runs under MUSR_MQADMIN account. You will need to provide the same password for MQ Service also. Go toAdministrative Tools/Servicesconsole. SelectIBM WebSphere MQservice and open the properties by double clicking on the service. On theLog Ontab provide the new password andOKto close the dialog and start the service.HTH/Shashi\n"} +{"text": "### Human: I want to create a broker to broker connection between ActiveMQ and WebSphere MQ in an embedded broker. I know that exists the network connector in activemq to do that (broker-to-broker), but I don't know how to configure it to connect to WebSphere MQ. Doing a search in the web I found some different ways to do with XML configuration and I noticed that the XML tags used does not refer the network connector, but refers a, so I do a research about this bridge connector by using java code but I wasn't able to find something that points me about how to do that.Is there an explicit way to configure a bridge connector in ActiveMQ to a WebSphere MQ, for an embedded broker by using java code instead to use the XML configuration?I know that is possible by using XML configuration, but, what if I am implementing an embedded broker (as I've mentioned before), and I want to configure the broker instance with a bridge connector to WebSphere MQ with java code, Does ActiveMQ provide a Class or Interface on the API to do this?This is what I have done to connect two activemq brokerstry {\n getBroker().addConnector(\"tcp://localhost:61616\");\n getBroker().addNetworkConnector(\"static:(tcp://remotBroker:61616)\");\n } catch (Exception e) {\n logger.error(\"Unexpected ERROR, connection lost.\");\n e.printStackTrace();\n }One TransportConnector to listen in port 61616 and one Network connector to establish connection from my local broker to the remoteBroker, both brokers are \ninstances of activemq. Now I want a connection from my ActiveMQ local broker to WebSphere MQ broker using java code, no XML.### Assistant: It's pretty simple.\nThe following example will send all messages on the ActiveMQ queue QUEUE42 to a remote WebSphere MQ broker. Change connection settings.This requires you to have some WMQ libs on your classpath: com.ibm.mq.jar and com.ibm.mqjms.jar (at least). The trick is to simply create a JmsQueueConnector with a QueueConnectionFactory (to WMQ) and whatever inbound/outbound bridges you want. The bridges are simply queue names that will be copied.BrokerService broker = new BrokerService();\n broker.setBrokerName(\"amqbroker\");\n broker.setPersistent(false);\n broker.setTransportConnectorURIs(new String[] {\"tcp://localhost:61616\"});\n\n // setup bridge\n JmsQueueConnector qCon = new JmsQueueConnector();\n\n JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\n JmsQueueConnectionFactory cf = ff.createQueueConnectionFactory();\n cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, \"192.168.13.151\");\n cf.setIntProperty(WMQConstants.WMQ_PORT, 1414);\n cf.setStringProperty(WMQConstants.WMQ_CHANNEL, \"SYSTEM.DEF.SVRCONN\");\n cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\n cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, \"SUPERHERO\");\n\n qCon.setOutboundQueueConnectionFactory(cf);\n OutboundQueueBridge outBridge1 = new OutboundQueueBridge(\"QUEUE42\");\n qCon.setOutboundQueueBridges(new OutboundQueueBridge[] {outBridge1});\n broker.setJmsBridgeConnectors(new JmsConnector[] {qCon});\n broker.start();\n"} +{"text": "### Human: I'm using WebSphere MQ. I have 3 QMs: QM1, QM2, and QM3. QM1 and QM2 form together an MQ Cluster named CLS12, while the QM2 and QM3 form CLS23. In other words, QM2 is in two clusters.I'd like to put a message (actually, it will be IIB to put a message) on QM2, but the target queues will actually be local on QM1 and QM3, but shared in the clusters. However, I would like to be able to choose to which cluster (not QM) the message should be put to.Is that possible?### Assistant: Short answer? No.MQ performs name resolution by queue and queue manager name. At no time during name resolution is the cluster name available to the application putting the message as a way to resolve the destination.It is possible to create QMgr aliases with names that match a particular cluster and get behavior similar to what you seek but it isn't reliable. Clusters are a namespace in which the queues and topics can reside. When clusters overlap, the namespaces overlap. So even though it's possible to fake the routing using aliases, changes in the namespace for either the queue, the alias or the queue manager that cause a name collision or cause cross-contamination of the overlapping cluster namespaces will break the name rresolution.\n"} +{"text": "### Human: I have created an MQ Service object to run my Trigger Monitor thus:-DEFINE SERVICE('TriggerMonitor') +\n CONTROL(QMGR) +\n STARTCMD('C:\\Program Files (x86)\\IBM\\WebSphere MQ\\bin\\runmqtrm') +\n STARTARG('-m TriggerTest -q InitQueue')Even though I set runmqtrm.exe in \"Start Command\" property it is showing me \"Service Status\" as Stopping. Is there way to make this runmqtmc running as a background service on windows without having to run it in a command prompt?### Assistant: In order to see status of a program running as an MQ Service Object, it must be of typeSERVER. The default is typeCOMMANDwhich allows you to have as many of the program running, but therefore means you can't display status of it. Define the Service Object withSERVTYPE(SERVER)and thenDISPLAY SVSTATUSwill show status of the running program.Read more about this inWorking with ServicesAlso, another helpful hint looking at yourSTARTCMDvalue, did you know that you can use a replaceable insert instead of having to provide the full installation path to the program. Read more about this inReplaceable inserts on service definitions\n"} +{"text": "### Human: I try connect to WMQ from a simple web service launched on WebSphere app server.On WMQ I have channel with SSL. I use self-signed certificates for now.In the case of glassfish I just add this cert to key store in domain and all works well(off cause I configure my MQQueueConnectionFactory).But on WebSphere this trick don't work:[5/13/13 14:00:25:058 FET] 00000060 SystemOut O %% Invalidated: [Session-94, SSL_RSA_EXPORT_WITH_RC4_40_MD5]\n[5/13/13 14:00:25:058 FET] 00000060 SystemOut O jmsContainer-1, SEND SSLv3 ALERT: fatal, description = certificate_unknown\n[5/13/13 14:00:25:058 FET] 00000060 SystemOut O jmsContainer-1, WRITE: SSLv3 Alert, length = 2\n[5/13/13 14:00:25:058 FET] 00000060 SystemOut O [Raw write]: length = 7\n[5/13/13 14:00:25:058 FET] 00000060 SystemOut O 0000: 15 03 00 00 02 02 2e .......\n\n[5/13/13 14:00:25:058 FET] 00000060 SystemOut O jmsContainer-1, called closeSocket()\n[5/13/13 14:00:25:058 FET] 00000060 SystemOut O jmsContainer-1, handling exception: javax.net.ssl.SSLHandshakeException: com.ibm.jsse2.util.j: PKIX path building failed: java.security.cert.CertPathBuilderException: unable to find valid certification path to requested target\n[5/13/13 14:00:25:058 FET] 00000060 DefaultMessag E org.springframework.jms.listener.DefaultMessageListenerContainer refreshConnectionUntilSuccessful Could not refresh JMS Connection for destination 'fromESB' - retrying in 5000 ms. Cause: JMSWMQ0018: Failed to connect to queue manager 'qm1' with connection mode 'Client' and host name '192.168.56.101(1414)'.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2397' ('MQRC_JSSE_ERROR').How do I configure WebSphere app server to use ssl(how to add server(WMQ) certificate to trust store? or where is the trust store?)?### Assistant: Ok. I solve this by myself.Configure WMQ:Create keystorerunmqckm -keydb -create -db \"c:\\dev\\sslqm001\\sslqm001.kdb\" -pw\nserverpass -type cms -expire 365 -stashCreate certificate and add it to keystorerunmqckm -cert -create -db \"c:\\dev\\sslqm001\\sslqm001.kdb\" -pw\nserverpass -label ibmwebspheremqssl_qm001 -dn \"CN=SSL_QM001,OU=IT,O=SomeCompany,L=Minsk,ST=Belarus,C=\nBY\" -expire 365Export this certificate from keystore to file.runmqckm -cert -extract -db \"c:\\dev\\sslqm001\\sslqm001.kdb\" -pw\nserverpass -label ibmwebspheremqssl_qm001 -target SSL_QM001.crt -format asciiIn Queue Manager settings, tab \"SSL\" set path to keystore without.kdband FIPS to No:ALTER QMGR SSLKEYR('c:\\dev\\sslqm001\\sslqm001')\nALTER QMGR SSLFIPS(NO)Create new channelIn channel settings, tab \"SSL\" set cipher to some value(with works for me: DES_SHA_EXPORT), and auth to optionalDEFINE CHANNEL('SSL_CHANNEL') CHLTYPE(SVRCONN) TRPTYPE(TCP) SSLCIPH(DES_SHA_EXPORT) SSLCAUTH(OPTIONAL) REPLACEIn Queue Manager refresh SSL:REFRESH SECURITY TYPE(SSL)Change your appcontex:\n \n \n \n \n \n \nSetup SSL on WASGo To:Security \u2192 SSL certificate and key management \u2192 SSL configurations \u2192\nNodeDefaultSSLSettings \u2192 Key stores and certificates \u2192 NameOfStore \u2192\nSigner certificatesAdd your certificate, that we export instep 3\n"} +{"text": "### Human: i can see error as below from the error log of my QMGR:- Process(27605.1) User(umts) Program(runmqtrm)\nAMQ6047: Conversion not supported.\n\nEXPLANATION:\nWebSphere MQ is unable to convert string data tagged in CCSID 0 to data in\nCCSID 0.\nACTION:\nCheck the WebSphere MQ Application Programming Reference Appendix and the\nappropriate National Language Support publications to see if the CCSIDs are\nsupported by your system.That shows the CCSID is0; However, my current CCSID used by QMGR is819dis qmgr ccsid\n 1 : dis qmgr ccsid\n QMNAME(QMUMBFEA) CCSID(819)So what's the problem with the CCSID? Is the MQ bug or sth else?BTW, MQ version is6.0.2.9Please help me out, thanks in advance### Assistant: Its not an MQ bug.Its just that your putting application is setting the CCSID of your message equal to zero.\nNow, the queue manager is trying to convert the message to its own CCSID, which fails.You can escape from this conversion by turning off the channel conversion for the channel your application is using to put the message.\n"} +{"text": "### Human: I am running Weblogic 10.3 on Linux and I have setup a bridge to Webspere MQ. I am sending a TextMesasge from Weblogic and it is being transfered to MQ. But when I am reading the message on MQ side like// Receiver reader - my class\nreader.qMgr = new MQQueueManager(qManager);\nint openOptions = MQOO_INPUT_AS_Q_DEF | MQOO_OUTPUT ;\n\nMQQueue localQueue = reader.qMgr.accessQueue(queueName, openOptions);\nMQMessage msg = new MQMessage();\nMQGetMessageOptions gmo = new MQGetMessageOptions(); \nlocalQueue.get(msg, gmo);\n\nint n = msg.getDataLength();\nSystem.out.println(\"The message is \" + n + \" bytes long\");\nString msgText = msg.readStringOfByteLength(n);\nSystem.out.println(\"The message is: \" + msgText);I am getting:The message is 154 bytes long\nThe message is: RFH \ufffd\ufffdMQSTR \ufffd jms_text Hqueue:///Q113575850399442 ABCDE\"ABCDE\" is my message.Do I have somehow to instruct Websphere MQ to perform JMS->MQ conversion so the message will be read as simple 'ABCDE'?Thanks### Assistant: The program sending the messages should set theTARGCLIENTparm as describedhere.Please bear in mind that all WMQ V6.x is out of support. If you were to use one of the supported versions (all the v7.x) you would be able to set the queue'sPROPCTLattribute to cause the QMgr to strip the JMS headers without little or no code changes.You can get the new version of WMQ through Passport Advantage if your company has a support agreement in place. The new client is available at no charge asSupportPac MQC75.You can mix client and QMgr versions and the new clients have a number of bug fixes and new features (many of which you can use even while connecting to an older QMgr). The newer client and QMgr will also have security patches not present on the V6 code. Please try to get to a supported version at least of the client since its free but preferably of the QMgr as well.\n"} +{"text": "### Human: I'm trying to read messages of an MQ, I've been followingthis approach from IBMto create \"a WCF custom channel by suppling binding and endpoint information programmatically\".I've got a similar mechanism working with SOAP message which have a header specifying the class and method to be called for each incoming message.I'm now wanting to process messages which are not in SOAP format from another queue, but I get this error;System.ServiceModel.CommunicationException: WCFCH0314E: The recieved message 'ID: ...' could not be de-serialized The message format or contents is not consitent with the selected message encoder and cannot be interpreted as a SOAP/JMS message. Review the linked exceptions for futher details. ---> System.ServiceModel.CommunicationException: Unrecognized message version.This makes sense as the example uses SoapJmsIbmTransportBindingElement. Unfotunately, there doesn't seem to be any alternative binding element in IBM.XMS.WCF.Is it possible to create a WCF custom channel for MQ for non-soap messages?### Assistant: Currently MQ WCF custom channel supports only SOAP messages, no support for non-SOAP messages. The MQ WCF custom channel looks for specific message headers to identify the incoming message as a WCF message. The WCFCH0314E exception will be thrown if those headers are not present.\n"} +{"text": "### Human: I am using Java API for WMQ.I have seen that RFHUTIL is able to load all queue names in a drop down list for a queue manager.Same way, I wanted to get all queue names for a queue manager in a list.It is being done by RFHUTIL, so definitely it is possible.\nI checked the functions available for MQQueueManager class but could find any solution.Need some advice.### Assistant: Listing queue names in a queue manager is an administrative job. You have to use Programmable Command Format (PCF) classes to do that. There are number of PCF commands to create, delete, list queue, channels, etc. Thislinkdescribes PCF in detail.For listing queues you can use MQCMD_INQUIRE_Q or MQCMD_INQUIRE_Q_NAMES PCF command. There are samples shipped with MQ. There isPCF_DisplayActiveLocalQueues.javais a useful one for you.\n"} +{"text": "### Human: I am trying to use MQQueueManager with multiple instances\nIn .net, we have IBM MQ jar provided with MQC.CONNECTION_NAME_PROPERTYConnectionName = \"fred.mq.com(2344),nick.mq.com(3746),tom.mq.com(4288)\";\n Hashtable Properties-new Hashtable();\n properties.Add(MQC.CONNECTION_NAME_PROPERTY,ConnectionName);\n MQQueueManager qmgr=new MQQueue Manager(\"qmgrname\",properties);Source:http://publib.boulder.ibm.com/infocenter/wmqv7/v7r1/index.jsp?topic=%2Fcom.ibm.mq.doc%2Fun11010_.htmBut, a similar thing where I can use the connection name list on MQQueueManager, using java is not provided.Could you please help me here?\nI am using 7.0.1.6 jars### Assistant: Please refer toUsing a client channel definition table with WebSphere MQ classes for Javain the Infocenter. I've linked to the V7.0 Infocenter since you mentioned that's the version you are using but it works the same in later versions.Before there were Multi-Instance QMgrs and the corresponding multi-instance CONNAME attributes in the channel definitions, there was the Client Channel Definition Table or CCDT as it is more commonly known. The CCDT contains the CLNTCONN definitions for any number of channels to one or more QMgrs. When multiple entries have the same value in the QMName field, they are treated as a group. (Note, the QMName in the CCDT doesnotneed to match the actual QMgr name. That would force you to use non-unique QMgr names which is not a good practice. It is just an index into the CCDT to identify groups of channels.)To better understand the CCDT, please read the topics underConnecting WebSphere MQ client applications to queue managersin the Infocenter and in particular,Examples of channel weighting and affinity,Role of the client channel definition tableandExamples of MQCONN calls. (Access these from the Table of Contents on the left. At the very top right of the frame is a button that will sinc the Table of Contents to whatever page you are on if you get lost.)The one \"gotcha\" with CCDT is that each channel name within it must be unique. This differs from the Multi-Instance CONNAME which looks for the exact same channel at different IP addresses. This is because the CCDT file is maintained using MQSC commands on the QMgr. Within the namespaces managed by the queue manager, all object names must be unique. When defining channels on a QMgr, each channel must have a unique name. In the case of the CCDT the entries are defined using CLNTCONN channels. Although these point to SVRCONN channels defined onotherQMgrs, because all the CLNTCONN channels are defined in the same namespace, they must be unique.To illustrate this further consider provisioning an app called PAYROLL. You might construct the channel names based on the app name combined with the QMgr name. This results in a channel that describes a from-->to relationship reading left to right. For example, to define the CCDT for three QMgrs you would have:* On any QMgr\nDEF CHL(PAYROLL.QMGR1) CHLTYPE(CLNTCONN) QMNAME(PAY) CONNAME(\"qm1host(1414)\")\nDEF CHL(PAYROLL.QMGR2) CHLTYPE(CLNTCONN) QMNAME(PAY) CONNAME(\"qm2host(2414)\")\nDEF CHL(PAYROLL.QMGR3) CHLTYPE(CLNTCONN) QMNAME(PAY) CONNAME(\"qm3host(3414)\")\n\n*On QMgr1\nDEF CHL(PAYROLL.QMGR1) CHLTYPE(SVRCONN) \n\n*On QMgr2\nDEF CHL(PAYROLL.QMGR2) CHLTYPE(SVRCONN) \n\n*On QMgr3\nDEF CHL(PAYROLL.QMGR3) CHLTYPE(SVRCONN)Then the app specifies the QMgr name as*PAYand the WMQ client code chooses among the three entries. Additional parameters are available for weighting the entries and retry order, which you will see in the docs.Note: the examples shown are stripped down to the essential elements that illustrate the concept. The SVRCONN entries for aproductionimplementation would include an MCAUSER and/or a channel exit, possibly SSL parms and, on V7.1 or later, some CHLAUTH rules.\n"} +{"text": "### Human: We are sending XML text messages via a remote queue definition CLIENT.DATA (transmit queue, send/recv channels etc.) from our queue manager QM_MINE queue manager QM_CLIENT and queue CLIENT.DATA. The message reaches the destination (CLIENT.DATA queue at the client's). The problem at hand is to able to receive acknowledgement messages (exact copy of the message sent) on a local queue CLIENT.DATA.ACK in QM_MINE as soon as messages reaches CLIENT.DATA in QM_CLIENTautomatically.I found couple of resources at WebSphere v7.1 infocenter onreply-to queueandmessage acknowledgementhowever they were not really helpful to me.So far I tried to use the reply to queue way. I created a transmit queue QM_MCT on QM.OCC. Every message I send to the CLIENT.DATA queue, I specified the reply-queue using setJMSReplyTo() method. However I am sure that is not it, there is more I am missing.MQ Objects Summary:QM_MINE: CLIENT_DATA (remoteQ), QM_CLIENT (transmitQ), CLIENT_DATA_ACK(localQ)QM_CLIENT: CLIENT_DATA (localQ), QM_MINE (transmitQ),And, sender/receiver channels at both ends.Source Code Fragements:Client Data Sender (under transaction):public class ClientServiceImpl extends JmsGatewaySupport implements ClientService {\n\n @Override\n public void sendClientData(String dataXML) {\n getJmsTemplate().convertAndSend(dataXML);\n }\n}Message Converter :public Message toMessage(Object o, Session session) throws JMSException, MessageConversionException {\n String dataXML = (String) o;\n TextMessage message = session.createTextMessage();\n message.setJMSReplyTo(replyToQueue);\n message.setText(dataXML);\n return message;\n}Note:Current I don't have any MDP or MDB to listen and consume messages from CLIENT_DATA queue in QM_CLIENT. I merely send it from QM_MINE and it gets moved to QM_CLIENT by MQ. Do I need to consume the messages to get this working?I use java, JMS , Spring and WebShere MQ v7.1 on Linux. Any more information will be provided upon request.### Assistant: Please see the section on theMQMD.Reportfield. Yes, you do need to set the reply-to fields so that the acknowledgement can find its way back to you. However you also need to tell WMQ that you want it to generate the report message. For what you want, set the field toMQRO_COA_WITH_FULL_DATA.\n"} +{"text": "### Human: This is in Cluster Environment. Queue Manager lost its identity in cluster and it is unable to connect to other servers. All channels to repository and others were retrying state.CPU usage is optimal in this server. This is a UNIX box.When I checked the logs below is it,AMQ9532: Program cannot set queue\n attributes.EXPLANATION: The attempt to set the\n attributes of queue\n 'SYSTEM.CLUSTER.TRANSMIT.QUEUE' on\n queue manager 'QMGR.SERVER6A' failed\n with reason code 2102.ACTION: Ensure\n that the queue is available and retry\n the operation.----- amqrmssa.c : 690 --------------------------------------------------------AMQ9999: Channel program ended\n abnormally.EXPLANATION: Channel program\n 'Channel.Coord00' ended abnormally.ACTION: Look at previous error\n messages for channel program\n 'Channel.Coord00' in the error files to\n determine the cause of the failure.----- amqrccca.c : 883 --------------------------------------------------------03/06/11 08:24:26 AMQ9544: Messages\n not put to destination queue.EXPLANATION: During the processing of\n channel 'Channel.Server6A' one or more\n messages could not be put to the\n destination queue and attempts were\n made to put them to a dead-letter\n queue. The location of the queue is\n 1, where 1 is the local dead-letter\n queue and 2 is the remote dead-letter\n queue.ACTION: Examine the contents of\n the dead-letter queue. Each message\n is contained in a structure that\n describes why the message was put to\n the queue, and to where it was\n originally addressed. Also look at\n previous error messages to see if the\n attempt to put messages to a\n dead-letter queue failed. The program\n identifier (PID) of the processing\n program was '1372200'.----- amqrmrca.c : 1318 -------------------------------------------------------Then I did recycled the queue manager it is now fine?My question here is how did the MQ resource problem occurr? CPU usage of this server is not more than 15%. Please advise.### Assistant: There are three different and unrelated problems shown in the log.AMQ9532: Program cannot set queue\n attributes.EXPLANATION: The attempt to set the\n attributes of queue\n 'SYSTEM.CLUSTER.TRANSMIT.QUEUE' on\n queue manager 'QMGR.SERVER6A' failed\n with reason code 2102.The 2102 is MQRC_RESOURCE_PROBLEM and presumably the resource issue referred to in the posting. The 2102 can be any kind of scarce resource, including semaphores, user processes, queue handles, etc. Since the QMgr was attempting to set an attribute of the queue, it would have already had a thread instantiated but it would have required additional queue handles. When something like this occurs, use your admin tool (WMQ Explorer, mqmon or one of the many 3rd party tools) to look into the number of open queue handles, open channels, etc. Note that for a resource error, it will be necessary to maintain an open connection to the QMgr or else the tool will be unable to make a new connection when the resource shortage occurs.AMQ9999: Channel program ended\n abnormally.EXPLANATION: Channel program\n 'Channel.Coord00' ended abnormally.ACTION: Look at previous error\n messages for channel program\n 'C00.US.MP00' in the error files to\n determine the cause of the failure.This error appears to actually be two different errors since it references two different channels. One of these appears to be an outbound cluster channel and the other appears to be a point-to-point channel. Neither channel mentioned in this error are associated with the first and last error message.03/06/11 08:24:26 AMQ9544: Messages\n not put to destination queue.EXPLANATION: During the processing of\n channel 'Channel.Server6A' one or more\n messages could not be put to the\n destination queue and attempts were\n made to put them to a dead-letter\n queue. The location of the queue is 1,\n where 1 is the local dead-letter queue\n and 2 is the remote dead-letter queue.ACTION: Examine the contents of the\n dead-letter queue. Each message is\n contained in a structure that\n describes why the message was put to\n the queue, and to where it was\n originally addressed. Also look at\n previous error messages to see if the\n attempt to put messages to a\n dead-letter queue failed. The program\n identifier (PID) of the processing\n program was '1372200'.The last error appears to be an inbound cluster channel. Since the first error was trying to set attributes of the cluster transmit queue, it could only have been associated with an outbound channel. Therefore the first and last error messages are unrelated. This error message appears to show an inbound message that was destined for a queue and that queue was full, PUT-disabled, or otherwise unable to accept the message. The message was therefore routed to the dead letter queue.For the resource error, I would suggest reviewing the performance report appropriate to your platform. Go to theSupportPacs pageand look for those SupportPacs named MP* and then look for the one for your platform. The Performance Reports give you specific tuning advice.You may also want to review theProblem Determinationchapter in the System Administration manual for additional advice on how to identify resource issues.TheWebSphere MQ cluster design and operationarticle in the developerWorks Mission:Messaging series has specific advice about keeping clusters healthy.Last but not least, theWebSphere MQ MustGatherpage has sections on troubleshooting for all major platforms and categorized by problem area.\n"} +{"text": "### Human: My setup is Spring 3 JMS, MVC + Websphere MQ + Websphere 7\n\n\n\n\n \n \n \nWhen I start up the server, the listener seems to start correctly since it receives the messages that are on the queue as I put them.However, once I run any simple controller/action that doesn't even have anything to do with JMS it gives me the message below over and over...DefaultMessag W org.springframework.jms.listener.DefaultMessageListenerContainer handleListenerSetupFailure Setup of JMS message listener invoker failed for destination 'queue:///ABCDEF.EFF.OUT?persistence=-1' - trying to recover. Cause: MQJMS2008: failed to open MQ queue ''.; nested exception is com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2042'.\nDefaultMessag I org.springframework.jms.listener.DefaultMessageListenerContainer refreshConnectionUntilSuccessful Successfully refreshed JMS Connection\n\nConnectionEve W J2CA0206W: A connection error occurred. To help determine the problem, enable the Diagnose Connection Usage option on the Connection Factory or Data Source.\n\nConnectionEve A J2CA0056I: The Connection Manager received a fatal connection error from the Resource Adapter for resource JMS$XXXQCF$JMSManagedConnection@2. The exception is: javax.jms.JMSException: MQJMS2008: failed to open MQ queue ''.\n\nConnectionEve W J2CA0206W: A connection error occurred. To help determine the problem, enable the Diagnose Connection Usage option on the Connection Factory or Data Source.\n\nConnectionEve A J2CA0056I: The Connection Manager received a fatal connection error from the Resource Adapter for resource jms/XXXQCF. The exception is: javax.jms.JMSException: MQJMS2008: failed to open MQ queue ''.The original listener seems to be still running correctly...but I think the controller is somehow triggering off another connection?\nDoes anyone know what I should check for or what might cause this issue?thanks### Assistant: The 2042 means \"Object in use\". Since there is no concept of exclusive use of queues for message producers, then one of your consumers is locking the queue.This behavior is controlled by thequeue definition's DEFSOPT attribute. This is at the queue manager itself and not in the managed object definitions or your factory options. From the command line while signed on as mqm (or the platform equivalent if the QMgr is on Windows, iSeries, z/OS, etc.) you would need to start runmqsc and issue the following commands to verify and then fix the problem. In my example, the QMgr is PLUTO and the example queue is SYSTEM.DEFAULT.LOCAL.QUEUE./home/mqm: runmqsc PLUTO\n5724-H72 (C) Copyright IBM Corp. 1994, 2009. ALL RIGHTS RESERVED.\nStarting MQSC for queue manager PLUTO.\n\ndis q(system.default.local.queue) defsopt\n 1 : dis q(system.default.local.queue) defsopt\nAMQ8409: Display Queue details.\n QUEUE(SYSTEM.DEFAULT.LOCAL.QUEUE) TYPE(QLOCAL)\n DEFSOPT(EXCL)\nalter ql(system.default.local.queue) defsopt(shared)\n 2 : alter ql(system.default.local.queue) defsopt(shared)\nAMQ8008: WebSphere MQ queue changed.\ndis q(system.default.local.queue) defsopt\n 3 : dis q(system.default.local.queue) defsopt\nAMQ8409: Display Queue details.\n QUEUE(SYSTEM.DEFAULT.LOCAL.QUEUE) TYPE(QLOCAL)\n DEFSOPT(SHARED)If you display the queue and find that it is already set for DEFSOPT(SHARED) then something must be specifying exclusive use of the queue through the API. That typically means a C or base Java program since these non-JMS APIs have access to low-level WMQ functionality. Those can be a little trickier to diagnose and I usually use a trace or theSupportPac MA0Wexit to display the API calls and options used. If this is the case, I'd want to know more about what is meant by \"simple controller/action\" as noted in the original post.Finally, if the queue that you are accessing is a remote queue then it will resolve to a transmit queue. The channel will always set a transmit queue to GET(INHIBITED) and acquire an exclusive lock on it. This is consistent with WMQ functionality in that an application can only GET messages from a local queue.\n"} +{"text": "### Human: Our code runs in weblogic and we MQ 6.0. No matter if I use the defaultcreateQueueConnection()orcreateQueueConnection(\"myuserid\",\"mypassword\")it always seems to use useridmqm. See code below.When I connect from version 6.0 to an older mq installion 5 it seems to throw the following errorjavax.jms.JMSSecurityException: MQJMS2013: invalid security authentication supplied for MQQueueManagerusing the defaultcreateQueueConnection()unless I send a blank userid/password as increateQueueConnection(\"\",\"\")How can I get myuserid to be send instead ?Hashtable properties = new Hashtable(2);\nproperties.put(Context.PROVIDER_URL,context);\nproperties.put(Context.INITIAL_CONTEXT_FACTORY, \"com.sun.jndi.fscontext.RefFSContextFactory\");\n\nInitialContext ctx = new InitialContext(properties);\nQueueConnectionFactory qcf = (QueueConnectionFactory) ctx.lookup(\"QCF\");\nQueueConnection qc = qcf.createQueueConnection();\njavax.jms.Queue q = (javax.jms.Queue) ctx.lookup(\"MYQUEUE\");\nQueueSession qs = qc.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\nTextMessage tm = qs.createTextMessage();\ntm.setText(outString);\nQueueSender sender = qs.createSender(q);\nsender.send(tm);\nsender.close();\nqs.close();\nqc.close();### Assistant: If you are setting the ID in the createQueueConnection, rest assured, itisbeing presented to the queue manager. The problem you are seeing is that the SVRCONN channel definitionon the QMgrhas the value MCAUSER('mqm') hard coded. This overrides any value presented by the client app.A couple of things to note here.Although you can send the ID and password, WMQ accepts these at face value. The fields exist to make the credentials available for a channel exit that can validate them. Without such an exit the channel just runs as whatever ID the app claims to be and the password is ignored.For the reason stated above, I always tell people not to trust the credentials presented unless they have such an exit. The administrator must code the appropriate value into the MCAUSER.The administrative ID ('mqm' on UNIX flavors) is NOT the appropriate value. It confers administrative authority to anyone connecting on that channel.For a LOT more on this topic and pointers to the WMQ security presentation and WMQ Security Lab guide from IMPACT, please seethis SO question.\n"} +{"text": "### Human: I am trying to write to an IBM MQSeries host with:public void WriteMessage(string message)\n{\n queueMessage = new MQMessage();\n queueMessage.WriteString(message);\n queueMessage.Format = MQC.MQFMT_STRING;\n queuePutMessageOptions = new MQPutMessageOptions();\n\n queue.Put(queueMessage, queuePutMessageOptions);\n}My errorcatch gives me an error however:Error in the applicationWhich doesn't show much of course. So I checked the event log on the server and this showed me the error:An error occurred receiving data from\n stx041774 (192.168.225.51) over\n TCP/IP. This may be due to a\n communications failure.The return code from the TCP/IP (recv) call was 10054 (X'2746').Record these values and tell the\n systems administrator.I looked up 10054 and means:An existing connection was forcibly\n closed by the remote host.Does anyone have any idea what I can do to make this work? Is there perhaps an MQC option I have to set for writing? Because I have no idea what to do with the options, I'm not even sure if this is the issue.### Assistant: I solved this issue with an option mqc.mqoo_output:queue = qManager.AccessQueue(QueueName, MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING);\n"} +{"text": "### Human: Is there any standard way of controlling concurrency and consumption in an MDB? Every suggestion I've been able to find seem to be application server or resource-adapter specific (e.g.maxSession@ActivationConfigProperty).The Problem\u2122We run some relatively heavy analysis jobs on a two-node JBoss setup (EAP 6.3), and want to parallelise jobs as well as impose an upper limit on the number of concurrent jobs so we don't swamp the database server. Jobs are started from a web front-end, and should be started whenever there's a free processing slot - there's no prioritisation or ordering constraints. We use a message queue (IBM WMQ, because of politics) to distribute \"start analysis\" messages to the nodes.Current progressAfter a lot of fiddling following various suggestions that turned out to be Non-Working Resource-Adapter-Specific Cargo-Cult Misinformation\u2122 :), Ithoughtthe problem was solved by defining an EJB pool for the MDB. This does solve the concurrency issue, but unfortunately it seems like a node with no free MDBs still pulls messages of the queue - which can leave one node underutilised and the other fully loaded with a backlog.If I understand theIBM documentationcorrectly, this behaviour should be controllable with thereadAheadAllowedconfiguration option, but this doesn't seem to influence my results at all.So, is there:A Java EE-standard way to control message consumption?A (working) IBM WQ specific configuration option?A JBoss specific way to fix it?Some other smart solution that I haven't thought of?Alternatively I could probably rework the architecture to use a topic queue, and let each node attempt something along the lines ofUPDATE Projects SET Status='inprogress' WHERE Id=42 AND Status='inqueue';- but I'd rather not go there if I don't have to, mostly because of the Change Requests required for getting the queue changed :)### Assistant: MQ, and indeed JMS, is designed and optimized to get the message as far down the pipe as possible, as fast as possible. The state of each message is tracked by the queue manager but a concurrency requirement would require the QMgr to track the state of messages in relation to one another. MQ does not do that.There is some granularity in tuning the Activation Spec connection pool and some in the transaction scoping, but these are intended to influence the dynamic behavior of the server and not specify it precisely.Managing application state across multiple messages is exactly what the ESB products such as IBM Integration Broker are designed to do. Whereas MQ is a transport that looks only at message headers to perform routing and delivery, the ESB looks at message relationships and content. Unless the JMS spec defines a concurrency management API, this division of responsibility with MQ doing transport and the ESB doing processing is not likely to change.Whether it is implemented in the ESB or JEE code, what you are describing is theMessage Dispatcher Patternfrom theEnterprise Integration Patternsbook, one ofthedefinitive architectural references in the messaging world. There are a couple ways to write this, depending on preferences for instrumentation.TokenizationApplication instances perform aGETwith wait on a token queue and under syncpoint.On receipt of a token message, the appPUTs the same message back on the token queue, again under syncpoint.The app performs aGETwith wait on the application queue under syncpoint.On receipt of an application message, the app processes it then performs aCOMMITorROLLBACKas appropriate.The app instances compete for the token messages before processing an app message. The result is that app messages are generally processed as fast as they arrive but under load the max concurrency equals the number of token messages.Generally the token messages are informational, for instance containing a counter that is incremented with each iteration and possibly instance info of the last app to write the token message. This provides some diagnostic insight as to what's going on. In some cases a monitoring app also listens on the token queue to sample that information and write to a dashboard. In that case an extra token message is added to the queue to account for the activity of the monitoring app.Standalone dispatcherThe dispatcher application listens on the advertised destination queue for messages and on an ACK queue for acknowledgement messages.A counter compares messages outstanding to{max outstanding message limit}set in the dispatcher app's configuration.If outstanding messages < limit, messages are moved to the application's input queue and the outstanding message counter incremented.When the business applicationGETs a message, it also puts a message to the dispatcher'sACKqueue, both actions under syncpoint.When the business application issuesCOMMITthe dispatcher receives the ACK and decrements the outstanding messages counter.The dispatcher app can request Confirmation on Delivery messages but these do not always correlate to the business app successfully processing the transaction. If the business app explicitly puts the ACK messages in the same unit of work as the business message that was consumed the result is rock solid.\n"} +{"text": "### Human: I'm having problem usingMQSeriesPerl module in multi-threading environment. Here what I have tried:create two handle in different thread with$mqMgr = MQSeries::QueueManager->new(). I thought this would give me two different connection to MQ, but instead I got return code 2219 on the second call toMQOPEN(), which probably means I got the same underling connection to mq from two separate call to new() method.declare only one $mqMgr as globalsharedvariable. But I can't assign reference to an MQSeries::QueueManager object to$mqMgr. The reason is\"Type of arg 1 to threads::shared::share must be one of [$@%] (not subroutine entry)\"declare only one$mqMgras global variable. Got same 2219 code.Tried to passMQCNO_HANDLE_SHARE_NO_BLOCKintoMQSeries::QueueManager->new(), so that a single connection can be shared across thread. But I can not find a way to pass it in.My question is, with Perl module MQSeriesHow/can I get separate connection to MQ queue manager from different thread?How/can I share a connection to MQ queue manager across different thread?I have looked around but with little luck, Any info would be appreciated.related question:C++ - MQ RC Code 2219Update 1: add a example that two local MQSeries::QueueManager object in two thread cause MQ error code 2219.use threads;\nuse Thread::Queue;\nuse MQSeries;\nuse MQSeries::QueueManager;\nuse MQSeries::Queue;\n\n# globals\nour $jobQ = Thread::Queue->new();\nour $resultQ = Thread::Queue->new();\n\n# ----------------------------------------------------------------------------\n# sub routines\n# ----------------------------------------------------------------------------\n\nsub worker {\n # fetch work from $jobQ and put result to $resultQ\n # ...\n}\n\nsub monitor {\n # fetch result from $resultQ and put it onto another MQ queue\n my $mqQMgr = MQSeries::QueueManager->new( ... );\n\n # different queue from the one in main\n # this would cause error with MQ code 2219\n my $mqQ = MQSeries::Queue->new( ... );\n\n while (defined(my $result = $resultQ->dequeue())) {\n # create an mq message and put it into $mqQ\n my $mqMsg = MQSeries::Message->new();\n $mqQ->put($mqMsg);\n } \n}\n\n# main\nunless (caller()) {\n # create connection to MQ\n my $mqQMgr = MQSeries::QueueManager->new( ... );\n my $mqQ = MQSeries::Queue->new( ... );\n\n # create worker and monitor thread\n my @workers;\n for (1 .. $nThreads) {\n push(@workers, threads->create('worker'));\n }\n my $monitor = threads->create('monitor');\n\n while (True) {\n my $mqMsg = MQSeries::Message->new ();\n\n my $retCode = $mqQ->get(\n Message => $mqMsg,\n GetMsgOptions => $someOption,\n Wait => $sometime\n );\n\n die(\"error\") if ($retCode == 0);\n next if ($retCode == -1); # no message\n\n # not we have some job to do\n $jobQ->enqueue($mqMsg->Data);\n }\n}### Assistant: There is a very real danger when trying to multithread with modules that the module is not thread safe. There's a bunch of things thatcanjust break messily because of the way threading works - you clone the current process state, and that includes things like file handles, sockets, etc.But if you try andusethem in an asynchronous/threaded way, they'll actreallyweird because the operations aren't (necessarily) atomic.So whilst I can't answer your question directly, because I have no experience of the particular module:Unless you know otherwise, assume youcan'tshare between threads. It might be thread safe, it might not. If it isn't, it might stilllookok, until one day you get a horrifically difficult to find bug as a result of a race condition in concurrent conditions.A shared scalar/list is explicitly described inthreads::sharedas basically safe (and even then, you can still have problems with non-atomicity if you're not locking).I would suggest therefore that what you need to do is either:have a 'comms' thread, that doesallthe work related to the module, and make the other threads use IPC to talk to it.Thread::Queuecan work nicely for this.treat each thread as entirely separate for purposes of the module. That includes loading it (withrequireandimport- notusebecause that acts earlier) and instantiating. (Youmightget away with 'loading' the module before threads start, but instantiating does things like creating descriptors, sockets etc.)lock stuff when there's any danger of interruption of an atomic operation.Much of the above also applies toforkparallelism too - but not in quite the same way, asforkmakes \"sharing\" stuff considerably harder, so you're less likely to trip over it.Edit:Looking at the code you've posted, and crossreferencing against theMQSeriessource:There is aBEGINblock, that sets up some stuff with the MQSeries at the point at which youuseit.Whilst I can't say for sure that this is your problem, it makes me very wary - because bear in mind that when it does that, it sets up some stuff - and then when your threads start, they inherit non-shared copies of \"whatever it did\" during that \"BEGIN\" block.So in light of what I suggested earlier on - I would recommend youtry(because I can't say for sure, as I don't have a reference implementation):require MQSeries; \nMQSeries->import;Put this in your code - in lieu ofuse-afterthread start. E.g. after you do thecreatesandwithinthe thread subroutine.\n"} +{"text": "### Human: I am usingJNDI lookupfor the getting the connection object forWebsphere MQBroker on tomcat server. I am usingJmsTemplatefor sending the messages to the Queue on WMQ Broker and trying to avoid the Spring Xml based configuration and for that reason i have configured the Spring boot's application.properties file to specify theJNDI lookup name.below is the property from application.properties file.spring.jms.jndi-name= java:comp/env/XXXXi am using a Spring bean to define the JmsTemplate and below is the code for it.@Configuration\npublic class JmsMessageTemplateBean {\n\n //@Value(\"${spring.jms.jndi-name}\")\n //private ConnectionFactory connectionFactory;\n\n @Bean\n public JmsTemplate jmsTemplate() throws Exception{\n JmsTemplate jmsMessagingTemplate = new JmsTemplate();\n jmsMessagingTemplate.setDefaultDestinationName(\"Some Queue\");\n jmsMessagingTemplate.setConnectionFactory(connectionFactory);\n return jmsMessagingTemplate;\n }\n}i have a couple of questions:1.How to read the JNDI property from application.properties file and set the Connection object to Jms Template in the above bean.2.I have observed that the connection object from theJNDI lookupisMQQueueConnectionFactoryand from what i have researchedJmsTemplatesupportsjavax.jms.ConnectionFactoryobject. is there a way to convert theMQQueueConnectionfactoryobject tojavax.jms.Connectionfactory.Appreciate your answers.### Assistant: I also had a hard time figuring out how to implement a Spring Boot JMS Listener, listening to an ActiveMQ queue within a JBoss application server.ActiveMQ is supported by Spring Boot autoconfiguration, but since it was inside the JBoss server Spring Boot was failing to connect ActiveMQ. \nIn fact you need to defineconnectionFactoryandjmsListenerContainerFactorybeans yourself by doing a lookup on the JNDI provider.@Configuration\n@EnableJms\npublic class ActiveMqConnectionFactoryConfig {\n\n @Value(\"${broker.url}\")\n String brokerUrl;\n\n @Value(\"${borker.username}\")\n String userName;\n\n @Value(\"${borker.password}\")\n String password;\n\n @Value(\"${queue}\")\n String queueName;\n\n private static final String INITIAL_CONTEXT_FACTORY = \"org.jboss.naming.remote.client.InitialContextFactory\";\n private static final String CONNECTION_FACTORY = \"jms/RemoteConnectionFactory\";\n\n\n @Bean\n public ConnectionFactory connectionFactory() {\n try {\n System.out.println(\"Retrieving JMS queue with JNDI name: \" + CONNECTION_FACTORY);\n JndiObjectFactoryBean jndiObjectFactoryBean = new JndiObjectFactoryBean();\n jndiObjectFactoryBean.setJndiName(CONNECTION_FACTORY);\n\n jndiObjectFactoryBean.setJndiEnvironment(getEnvProperties());\n jndiObjectFactoryBean.afterPropertiesSet();\n\n return (QueueConnectionFactory) jndiObjectFactoryBean.getObject();\n\n } catch (NamingException e) {\n System.out.println(\"Error while retrieving JMS queue with JNDI name: [\" + CONNECTION_FACTORY + \"]\");\n } catch (Exception ex) {\n System.out.println(\"Error\");\n }\n return null;\n }\n\n Properties getEnvProperties() {\n Properties env = new Properties();\n env.put(Context.INITIAL_CONTEXT_FACTORY, INITIAL_CONTEXT_FACTORY);\n env.put(Context.PROVIDER_URL, brokerUrl);\n env.put(Context.SECURITY_PRINCIPAL, userName);\n env.put(Context.SECURITY_CREDENTIALS, password);\n return env;\n }\n\n @Bean\n public DefaultJmsListenerContainerFactory jmsListenerContainerFactory(ConnectionFactory connectionFactory) {\n\n DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();\n factory.setConnectionFactory(connectionFactory);\n JndiDestinationResolver jndiDestinationResolver = new JndiDestinationResolver();\n\n jndiDestinationResolver.setJndiEnvironment(getEnvProperties());\n factory.setDestinationResolver(jndiDestinationResolver);\n return factory;\n }Then if you want to consume the queue you just define your JMS consumer class with a method annotated with@JmsListener(destination = \"${queue}\")@JmsListener(destination = \"${queue}\")\n public void receive(Message message) {\n System.out.println(\"Received Message: \" + message);\n }Hope that helps save a few hours of research ;)\nCheers\n"} +{"text": "### Human: We are new to WebSphere MQ and we would like to know if we can create 2+RQSTRchannels in different QMgrs, connecting only oneSVRchannel on the server, like:Channel Name:CH1 (RQSTR) -----> CH1 (SVR)Then on another QMgr, another Channel Named:CH1 (RQSTR) -----> CH1 (SVR)When we try to start the 2nd CH1, we got error message like \"channel is in use\".We looked up quite a lot documents and forums all saying it seems we could create multiple instance of anRQSTR, so can those all be connected to our server through oneSVRchannel? Or do we simply have to create as many asSVRchannels on the server for theRQSTRto pair up?### Assistant: No. ASVRorSDRchannel connects to one and only one remote destination at a time. It is possible to have aSVRorSDRdefined on multiple QMgrs come to a singleRCVRorRQSTRon a single QMgr.This is also true in an MQ cluster. A QMgr'sCLUSRCVRaccepts connections from all nodes in the cluster. Each of those nodes auto-defines a matchingCLUSSDRof the same name. Thus in a cluster there will be one inbound channel namedCLUSTER.QMGRand oneCLUSSDRon each remote QMgr that also has the nameCLUSTER.QMGR.Channels manage messages in transactional batches. An outbound channel has one destination so that if a batch ever fails, it knows to which remote node it has to connect in order to reconcile the transaction. An inbound channel keeps track of multiple inbound connections separately.TheRQSTR/SVRchannels are designed for the case that a firewall will allow connections initiated only from the inside. In order to get inbound messages, theRQSTRstarts the channel. This also means that theSVRcannot hang up the socket and will accept a connction from anyRQSTRthat can start it.Contrast this with the behavior of aRQSTR/SDRpair. In that case, theSDRreceives the start request from theRQSTRbut then immediately closes the socket and proceeds to connect to whatever is in itsCONNAME.When I have a B2B channel connection, I always use aRQSTR/SDRpair. MyRQSTRcan initiate the business partner'sSDRwhich is often helpful if I'm sending transactions but no messages are coming back. If I start myRQSTRand the channel comes up, that rules out connectivity issues. If messages then flow across, I know the app on the other end is up but channel triggering is not working. If the channel starts but no messages arrive, I know the remote app is down.Then when I call the business partner to report the outage and can tell themexactlywhat's wrong on their end, they think I'm a genius. Not that I do it to make people think I'm a genius, but they're generally a lot more willing to take my calls if I'm usually accurate with the diagnosis.TheRQSTRchannel was built on the assumption that you would use it with aSVRand therefore doesn't haveADOPTNEWMCAcapabilities. That's the only down side. If the network is generally reliable, it's not much of a down side so I useRQSTR/SDRpairs a lot.So to sum up, theSVRchannel is not intended to connect to multiple remote nodessimultaneously. It is intended to connect to anyoneof multiple remote nodes at a time. Since any properly configuredRQSTRcan start aSVRuse theSVRonly when you legitimately need to point it to different locations that are decided at run time and without making changes to the channel definition. Otherwise use aSDRwith multiple instances in theCONNAMEor use a classicSDRchannel and change theCONNAMEduring the failover.\n"} +{"text": "### Human: the title of the question says pretty much all: is it possible to connect to a locally running IBM MQ Light with Java and JMS ?\nIn the comment section ofthis post, Rob Nicholson says it is not possible, but I wonder if things have changed. Sadly, I was not able to find information that explicitly negate this possibility, apart this comment.Just to clarify, MQ Light runs locally, not in IBM's bluemix.### Assistant: Sure you can use JMS with MQLight!As MQLight supports the wire protocol AMQP 1.0 you can use, for instance, theApache QPid Proton library.Working Sample in two files will produce a message to a MQLight queue.Main.javaimport org.apache.qpid.jms.JmsConnectionFactory;\nimport javax.jms.*;\n\npublic class Main {\n\n public static void main(String[] args){\n try {\n ConnectionFactory cf = new JmsConnectionFactory(\"amqp://localhost:5672\");\n Connection connection = cf.createConnection();\n Session session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE);\n MessageProducer producer = session.createProducer(session.createQueue(\"QUE.BAR\"));\n producer.send(session.createTextMessage(\"foo bar\"));\n producer.close();\n session.close();\n connection.close();\n }catch(JMSException jmsException){\n jmsException.printStackTrace();\n }\n }\n}pom.xml\n\n 4.0.0\n\n com.example.test\n mqlight-jms\n 1.0-SNAPSHOT\n \n \n org.apache.qpid\n qpid-jms-client\n 0.3.0\n \n \n\n"} +{"text": "### Human: We have SQL server 2012 as the DB server and Websphere MQ on Redhat Linux as the MQ server. Our applications are on a Redhat Linux server and implemented in C++.We need distributed transaction capability so that transactions can span both the resources (DB and MQ). A distributed transaction is managed by a Transaction Manager working across Resource Managers of the resources.WMQ has the ability to act as a Distributed Transaction Manager if the individual Resource Managers(DB and MQ) provide XA operations.\nMS SQL does have a ODBC library for Linux:http://www.microsoft.com/en-us/download/details.aspx?id=28160.Does the SQL Server library support XA operations such as xa_open, etc. which can let it participate in an XA transaction managed by WMQ?Other option is to use MS Distributed Transaction Coordinator as the Transaction Manager.Is it possible to use MSDTC from a C++ program running on Linux?Does MSDTC work with WMQ acting as a Resource Manager?Thanks,\nYash### Assistant: I wish I had better news for you...Assuming you're talking about V8 (although other releases are similar), there is no support for MS SQL Server at all when using MQ as the transaction manager. You can see this in the 'databases' section of the MQ SOE:http://www-969.ibm.com/software/reports/compatibility/clarity-reports/report/html/softwareReqsForProduct?deliverableId=1350550241693&osPlatform=Linux#sw-DatabasesMSDTC can be used, but only by clients running in Windows as far as I'm aware - I don't see how you could make it work for your scenario.Another option is to use a J2EE environment (WAS/JBoss etc). This will act as the transaction manager, and MS SQL & MQ will work as resources. Still, this doesn't solve your requirement to write in C++.The only suggestions I have for you that really work therefore are:1) Review the transaction managers MQdoessupport:http://www-969.ibm.com/software/reports/compatibility/clarity-reports/report/html/softwareReqsForProduct?deliverableId=1350550241693&osPlatform=Linux#sw-TransactionServers and GatewaysSadly I'm not familiar with the details of the options on there.2) Raise an 'RFE' with IBM as their customer. This is the mechanism they provide to allow customers/external parties to request new function:http://www.ibm.com/developerworks/rfe/Although there's no guarantee it will be accepted, or which version it might end up in (or when!).\n"} +{"text": "### Human: After looking for a couple of days I have the problem to consume message from IBM MQ. I followed the documentation, but still, the system is not working fine. I'm using 4.8.0 and MQ 7.5.0.2error[2014-02-06 01:06:14,341] ERROR - JMSListener Unable to continue server startup as it seems the JMS Provider is not yet started. Please start the JMS provider now.\n[2014-02-06 01:06:14,342] ERROR - JMSListener Connection attempt : 1 for JMS Provider failed. Next retry in 20 seconds\n[2014-02-06 01:06:34,364] ERROR - JMSListener Unable to continue server startup as it seems the JMS Provider is not yet started. Please start the JMS provider now.\n [2014-02-06 01:06:34,365] ERROR - JMSListener Connection attempt : 2 for JMS Provider failed. Next retry in 40 seconds\n\nroot@sandbox:/opt/wso2esb-4.8.0/FFDC# more JMSCC0001.FDC\n----------------------------------START FFST------------------------------------\n/opt/wso2esb-4.8.0/FFDC/JMSCC0001.FDC PID:5897\n\n JMS Common Client First Failure Symptom Report\n\n\nProduct :- IBM WebSphere MQ classes for JMS\nDate/Time :- Thu Feb 06 00:54:07 CET 2014\nSystem time :- 1391644447539\nOperating System :- SunOS\nUserID :- root\nJava Vendor :- Oracle Corporation\nJava Version :- 23.3-b01\n\nSource Class :- com.ibm.mq.jms.MQQueueConnectionFactory\nSource Method :- readObject()\nProbeID :- XF001003\nThread :- name=localhost-startStop-1 priority=5 group=main ccl=org.eclipse.core.runtime.internal.adaptor.ContextFinder@1da36adaxis2 config\n \n com.sun.jndi.fscontext.RefFSContextFactory\n file:///var/tmp/jndi\n ivtQCF\n queue\n ivtQ\n \ntest jndi is workingjava JmsJndiConsumer -i file:///var/tmp/jndi -c ivtQCF -d ivtQ\nInitial context found!\nReceived message:\n\n JMSMessage class: jms_text\n JMSType: null\n JMSDeliveryMode: 2\n JMSExpiration: 0\n JMSPriority: 4\n JMSMessageID: ID:414d5120514d412020202020202020204424ee5203db0020\n JMSTimestamp: 1391646438379\n JMSCorrelationID: null\n JMSDestination: queue://QMA/QUEUE1\n JMSReplyTo: null\n JMSRedelivered: false\n JMSXAppID: JmsJndiProducer\n JMSXDeliveryCount: 1\n JMSXUserID: webservd\n JMS_IBM_Character_Set: UTF-8\n JMS_IBM_Encoding: 273\n JMS_IBM_Format: MQSTR\n JMS_IBM_MsgType: 8\n JMS_IBM_PutApplType: 28\n JMS_IBM_PutDate: 20140206\n JMS_IBM_PutTime: 00271840\nJmsJndiProducer: Your lucky number today is 324proxy\n\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n contentType\n application/xml\n \n \nI've check the network and i cannot see any connecton form esb to mq server.Any idea ?updateI have configured the axis server in the sample ($WSO2_HOME/samples/axis2Server/repository/conf/axis2.xml) with exactly the same jms transport (default).Atfer compiling the 'SimpleStockQuoteService' and starting the the server i can see that is working fine.cd wso2esb-4.8.1/samples/axis2Server/src/SimpleStockQuoteService/ && ant\ncd wso2esb-4.8.1/samples/axis2Server/ && ./axis2server.sh\n\n14/02/10 21:20:29 INFO jms.JMSListener: JMS listener started\n14/02/10 21:20:30 INFO jms.JMSListener: Connection attempt: 1 for JMS Provider for\nservice: SimpleStockQuoteService was successful!\n14/02/10 21:20:30 INFO jms.ServiceTaskManager: Task manager for service : \nSimpleStockQuoteService [re-]initialized\n14/02/10 21:20:31 INFO jms.JMSListener: Started to listen on destination : ivtQ of \ntype queue for service SimpleStockQuoteService\n14/02/10 21:20:31 INFO util.SampleAxis2ServerManager: [SimpleAxisServer] StartedI still not understand why is not working inside carbon !!!### Assistant: The only way I found to made it work is to modify the startup script (ws02server.sh) to add the MQ client java library to the classpathCARBON_CLASSPATH=/opt/mqm/java/lib/com.ibm.mq.jar:/opt/mqm/java/lib/com.ibm.mqjms.jar:\"$CARBON_CLASSPATH\"If MQ transport type is BIND (ws02 on the same server as the MQ server) the JNI library need also to be included (-Djava.library.path=/opt/mqm/java/lib)Copying the MQ java library to therepository/component/libas stated in the documentation is not working.Tested with MQ 7.5.0.2 and ws02 4.8.1 on Solaris and RHEL7\n"} +{"text": "### Human: I've been trying unsuccessfully to get a spring message driven pojo (MDP) to work in a test region (tomcat linux to mq server linux) after it works ok between two dev machines (windows tomcat client to linux server).Ports and spring configuration seem ok. Trace level logging shows all property values populated correctly. Another war can actually put on the MQ Queue using JMS from this test region tomcat server. This war uses the same tomcat context.xml file that points to the hostname of the MQ server. Resource references in context.xml and web.xml are ok. The listener is set up as described inGetting error : WebSphere MQ reason code 2538?The exception on the tomcat server comes from com.ibm.mq.jmqi which I understand is a stub to call JNI i.e., native C/C++ code presumably to be installed on the client. I was unclear whether you actually need to install the MQ client when you use JMS. We installed the MQ client but we still get this message. (Reading the docs more thoroughly I think I don't need the MQ Client. In fact, we removed it from the windows client to no ill effect)I find it odd that the exception is saying that it wants to connect to localhost. The server error files show nothing interesting.****Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2538;AMQ9204: Connection to host 'localhost(1414)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2538;AMQ9213****\n\n\norg.springframework.jms.listener.DefaultMessageListenerContainer]\nDec 05 15:22:26 DEBUG org.springframework.jms.listener.DefaultMessageListenerContainer - Could not establish shared JMS Connection - leaving it up to asynchronous invokers to establish a Connection as soon as possible\ncom.ibm.msg.client.jms.DetailedIllegalStateException: JMSWMQ0018: Failed to connect to queue manager 'QMTST' with connection mode 'Client' and host name 'localhost(1414)'.\n at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:479) ~[com.ibm.mqjms-7.5.jar:7.5.0.2 - p750-002-130704.TRIAL]\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:221) ~[com.ibm.mqjms-7.5.jar:7.5.0.2 - p750-002-130704.TRIAL]\n at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:426) ~[com.ibm.mqjms-7.5.jar:7.5.0.2 - p750-002-130704.TRIAL]\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:6902) ~[com.ibm.mqjms-7.5.jar:7.5.0.2 - p750-002-130704.TRIAL]\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6390) ~[com.ibm.mqjms-7.5.jar:7.5.0.2 - p750-002-130704.TRIAL]\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:285) ~[com.ibm.mqjms-7.5.jar:7.5.0.2 - p750-002-130704.TRIAL]\n at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6233) ~[com.ibm.mqjms-7.5.jar:7.5.0.2 - p750-002-130704.TRIAL]\n at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:120) ~[com.ibm.mqjms-7.5.jar:7.5.0.2 - p750-002-130704.TRIAL]\n at com.ibm.mq.jms.MQQueueConnectionFactory.createConnection(MQQueueConnectionFactory.java:203) ~[com.ibm.mqjms-7.5.jar:7.5.0.2 - p750-002-130704.TRIAL]\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_24]\n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_24]\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_24]\n at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_24]\n at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) ~[spring-aop-3.2.3.RELEASE.jar:3.2.3.RELEASE]\n at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198) ~[spring-aop-3.2.3.RELEASE.jar:3.2.3.RELEASE]\n at $Proxy8.createConnection(Unknown Source) ~[na:na]\n at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184) ~[spring-jms-3.2.3.RELEASE.jar:3.2.3.RELEASE]\n at org.springframework.jms.listener.AbstractJmsListeningContainer.createSharedConnection(AbstractJmsListeningContainer.java:405) [spring-jms-3.2.3.RELEASE.jar:3.2.3.RELEASE]\n at org.springframework.jms.listener.AbstractJmsListeningContainer.establishSharedConnection(AbstractJmsListeningContainer.java:373) [spring-jms-3.2.3.RELEASE.jar:3.2.3.RELEASE]\n at org.springframework.jms.listener.DefaultMessageListenerContainer.establishSharedConnection(DefaultMessageListenerContainer.java:760) [spring-jms-3.2.3.RELEASE.jar:3.2.3.RELEASE]\n at org.springframework.jms.listener.AbstractJmsListeningContainer.doStart(AbstractJmsListeningContainer.java:280) [spring-jms-3.2.3.RELEASE.jar:3.2.3.RELEASE]\n at org.springframework.jms.listener.AbstractJmsListeningContainer.start(AbstractJmsListeningContainer.java:265) [spring-jms-3.2.3.RELEASE.jar:3.2.3.RELEASE]\n at org.springframework.jms.listener.DefaultMessageListenerContainer.start(DefaultMessageListenerContainer.java:561) [spring-jms-3.2.3.RELEASE.jar:3.2.3.RELEASE]\n at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:167) [spring-context-3.2.4.RELEASE.jar:3.2.4.RELEASE]\n at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:51) [spring-context-3.2.4.RELEASE.jar:3.2.4.RELEASE]\n at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:339) [spring-context-3.2.4.RELEASE.jar:3.2.4.RELEASE]\n at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:143) [spring-context-3.2.4.RELEASE.jar:3.2.4.RELEASE]\n at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:108) [spring-context-3.2.4.RELEASE.jar:3.2.4.RELEASE]\n at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:945) [spring-context-3.2.4.RELEASE.jar:3.2.4.RELEASE]\n at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) [spring-context-3.2.4.RELEASE.jar:3.2.4.RELEASE]\n at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389) [spring-web-3.2.4.RELEASE.jar:3.2.4.RELEASE]\n at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294) [spring-web-3.2.4.RELEASE.jar:3.2.4.RELEASE]\n at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) [spring-web-3.2.4.RELEASE.jar:3.2.4.RELEASE]\n at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791) [catalina.jar:7.0.29]\n at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285) [catalina.jar:7.0.29]\n at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:7.0.29]\n at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) [catalina.jar:7.0.29]\n at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) [catalina.jar:7.0.29]\n at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618) [catalina.jar:7.0.29]\n at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:963) [catalina.jar:7.0.29]\n at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1600) [catalina.jar:7.0.29]\n at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [na:1.6.0_24]\n at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [na:1.6.0_24]\n at java.util.concurrent.FutureTask.run(FutureTask.java:138) [na:1.6.0_24]\n at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_24]\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_24]\n at java.lang.Thread.run(Thread.java:662) [na:1.6.0_24]\nCaused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2538' ('MQRC_HOST_NOT_AVAILABLE').\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:209) ~[com.ibm.mqjms-7.5.jar:7.5.0.2 - p750-002-130704.TRIAL]\n ... 45 common frames omitted\n**Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2538;AMQ9204: Connection to host 'localhost(1414)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2538;AMQ9213**: A communications error for occurred. [1=java.net.ConnectException[Connection refused],3=localhost]],3=localhost(1414),5=RemoteTCPConnection.connnectUsingLocalAddress]\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:2053) ~[com.ibm.mq.jmqi-7.5.jar:7.5.0.2 - p750-002-130704.TRIAL]\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1226) ~[com.ibm.mq.jmqi-7.5.jar:7.5.0.2 - p750-002-130704.TRIAL]\n at com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.jmqiConnect(InterceptedJmqiImpl.java:311) ~[com.ibm.mq.jmqi-7.5.jar:7.5.0.2 - p750-002-130704.TRIAL]\n at com.ibm.mq.ese.jmqi.ESEJMQI.jmqiConnect(ESEJMQI.java:337) ~[com.ibm.mq.jmqi-7.5.jar:7.5.0.2 - p750-002-130704.TRIAL]\n at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:346) ~[com.ibm.mqjms-7.5.jar:7.5.0.2 - p750-002-130704.TRIAL]\n ... 44 common frames omitted\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2538;AMQ9213: A communications error for occurred. [1=java.net.ConnectException[Connection refused],3=localhost]\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.connnectUsingLocalAddress(RemoteTCPConnection.java:810) ~[com.ibm.mq.jmqi-7.5.jar:7.5.0.2 - p750-002-130704.TRIAL]\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:1140) ~[com.ibm.mq.jmqi-7.5.jar:7.5.0.2 - p750-002-130704.TRIAL]\n at com.ibm.mq.jmqi.remote.impl.RemoteConnection.connect(RemoteConnection.java:724) ~[com.ibm.mq.jmqi-7.5.jar:7.5.0.2 - p750-002-130704.TRIAL]\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSessionFromNewConnection(RemoteConnectionSpecification.java:400) ~[com.ibm.mq.jmqi-7.5.jar:7.5.0.2 - p750-002-130704.TRIAL]\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSession(RemoteConnectionSpecification.java:299) ~[com.ibm.mq.jmqi-7.5.jar:7.5.0.2 - p750-002-130704.TRIAL]\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionPool.getSession(RemoteConnectionPool.java:164) ~[com.ibm.mq.jmqi-7.5.jar:7.5.0.2 - p750-002-130704.TRIAL]\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1598) ~[com.ibm.mq.jmqi-7.5.jar:7.5.0.2 - p750-002-130704.TRIAL]\n ... 48 common frames omitted\nCaused by: java.net.ConnectException: Connection refused\n at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.6.0_24]\n at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351) ~[na:1.6.0_24]\n at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213) ~[na:1.6.0_24]\n at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200) ~[na:1.6.0_24]\n at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) ~[na:1.6.0_24]\n at java.net.Socket.connect(Socket.java:529) ~[na:1.6.0_24]\n at java.net.Socket.connect(Socket.java:478) ~[na:1.6.0_24]\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection$5.run(RemoteTCPConnection.java:795) ~[com.ibm.mq.jmqi-7.5.jar:7.5.0.2 - p750-002-130704.TRIAL]\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection$5.run(RemoteTCPConnection.java:789) ~[com.ibm.mq.jmqi-7.5.jar:7.5.0.2 - p750-002-130704.TRIAL]\n at java.security.AccessController.doPrivileged(Native Method) ~[na:1.6.0_24]\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.connnectUsingLocalAddress(RemoteTCPConnection.java:787) ~[com.ibm.mq.jmqi-7.5.jar:7.5.0.2 - p750-002-130704.TRIAL]### Assistant: We found out that it's picking up localhost from the MQ file based JNDI bindings file. It looks like a hack but we just change localhost in the .bindings file to the IP of the MQ server and then things work.It never looks at the Tomcat context.xml file once it has found a QMGR matching name in the .bindings file.\n"} +{"text": "### Human: I was wondering if there is a way for you to configure a queue to automatically clear messages? We are striving to partially implement a component of our architecture and want to be able to send to the queue, but have the queue automatically remove the messages that are being sent so that we don't have to run scripts, etc to perform the clean-up.So far the only thing I have been able to find is to run CLEAR QLOCAL or set the messages to expire from the publishing application.### Assistant: For you use case there are a few options in IBM MQ:Create a QALIAS that points to a TOPIC object which has a topic string with no subscribers, messages put to the QA will just disappear.Have the sending application set message expiry.Use the IBM MQCAPEXPRYfeature to administratively force message expiry at the queue level.Run a script to issueCLEAR QLOCALagainst the queue. There can not be open handles on the queue for this to work.Programmatically issue the equivalent PCF command toCLEAR QLOCALagainst the queue. There cannot be open handles on the queue for this to work.Run the IBM MQdmpmqmsgutility against the queue to read and discard the messages.\n"} +{"text": "### Human: I use a Java client usingJMS/JNDI. The connection is working when using one-way SSL authenticationSSLCAUTH(OPTIONAL). The first step I did is to export the public certificate of the client:keytool -export -keystore keystore -storepass storepass -alias CLIENT -file client.cerThen I added this certificate to the MQ key repository.gsk7cmd -cert -add -db keydb.kdb -pw password -label ibmwebspheremqclient -file client.cer -format binaryAnd I finally switched toSSLCAUTH(REQUIRED)mode.I get the following error log. The message is pretty clear, it can't find my client certificate. I read that my client certificate should have a labelibmwebspheremq. What is this user id since I am connecting via Java?AMQ9637: Channel is lacking a certificate.### Assistant: As per the TechnoteSpecifying the userid in the SSL certificate label for an MQ clientthe Java and JMS clients do not find their certificate based on the label.What is often the problem is a mis-match between the trust store and the key store. I have seen two problems fairly commonly.The application specifies a trust store but not a keystore. This works great for anonymous (one-way) SSL but not for mutual authenticated SSL. The appmustspecify both key store and trust store for mutual auth.Sometimes the app specifies a trust store file but the private certs are in the key store. Or the app specifies the same file for both trust store and the key store and the personal certs are actually in a separate trust store file.Does either of these solve the problem? If not, please update the question with akeytool -cert -listfor both the key store and the trust store and the part of the command line or code that sets up the keystore/truststore.\n"} +{"text": "### Human: We come across a scenario where disk space was occupied for empty queues in linux environment.Our queue manager ended unexpectedly as the file system become full and we need to empty the q file to bring back the queue manager.But actually we dont have any messages at all in queue. This is showing a particularl queue.Why the disk space is held here? what is the root cause?### Assistant: WMQ does not shrink the queue files in real time. For example, you have 100 messages on a queue and you consume the first one. WMQ does not then shrink the file and move all the messages up by one position. If it tried to do that for each message, you'd never be able to get the throughput that you currently see in the product.What does occur is that WMQ will shrink the queue files at certain points in the processing lifecycle. There is some latency between a queue becoming empty and the file under it shrinking it but this latency is normally so small as to be unnoticeable.The event you are describing could in theory occur under some very specific conditions however it would be an extremely rare. In fact in the 15 years I've been working with WMQ I've only ever seen a couple of instances where the latency in shrinking a queue file was even noticeable. I would guess that what is actually going on here is that one of your assumptions or observations is faulty. For example:Was the queue actually empty?The queue was most definitely emptyafteryou blew away the file. How do you know it was emptybeforeyou blew away the file?If there were non-persistent messages on any queue, the queue will be empty after the QMgr restarts. This is another case where the queue can appear to be empty after the QMgr is restarted but was not at the time of failure.If a message is retrieved from a queue under syncpoint, the queue depth decrements but the message is still active in the queue file. If a queue is emptied in a single transaction it retains it's full depth until the COMMIT occurs. This can make it look like the queue is empty when it is not.Was it actually the queue file that filled up the file system?Log extents can fill the file system, even with circular logs. For example, with a large value for secondary extents log files can expand significantly and then disappear just as quickly.FDC files can fill up the file system, depending on how the allocations were made.Was it even MQ?If the QMgr shares filesystem space with other users or apps, transient files can fill up the space.One of the issues that we see very frequently is that an application will try to put more than 5,000 messages on a queue and receive a QFULL error. The very first thing most people then do is set MAXDEPTH(999999999) to make sure this NEVER happens again. The problem with this is that QFULL is a soft error from which an application can recover but filling up the filesystem is a hard error which can bring down the entire QMgr. Setting MAXDEPTH(999999999) trades a manageable soft error for a fatal error. It is the responsibility of the MQ administrator to make sure that MAXDEPTH and MAXMSGL on the queues are set such that the underlying filesystem does not fill. In most shops additional monitoring is in place on all the filesystems to raise alerts well before they fill.So to sum up, WMQ does a very good job of shrinking queue files in most cases. In particular, when a queue empties this is a natural point of synchronization at which the file can be shrunk and this usually occurs within seconds of the queue emptying. You have either hit a rare race condition in which the file was not shrunk fast enough or there is something else going on here that is not readily apparent in your initial analysis. In any case, manage MAXDEPTH and MAXMSGL such that no queue can fill up the filesystem and write the code to handle QFULL conditions.\n"} +{"text": "### Human: When a message fails to post to a WebSphere MQ queue with MQRC 2056 MQRC_Q_SPACE_NOT_AVAILABLE it goes to Dead Letter queue. It means the Original disk space we allotted for queues usage is 100%. Say file system /var/mqm has sufficient free queue storage. Even we have our dead letter queue storage also in same /var/mqm. If we already get MQRC 2056 - MQRC_Q_SPACE_NOT_AVAILABLE, then how is it possible that a message will go to the Dead Letter queue when its disk space is already full?### Assistant: In your case theMQRC_Q_SPACE_NOT_AVAILABLEdoes in fact reflect the total amount of space in the disk partition, however this is not true in all cases. For example, with older filesystems the largest file size possible was 2GB, even though the partition could hold up to about 1TB. So if a single queue file reaches 2GB the QMgr may still have plenty of space in the partition available to requeue a message to the DLQ. Although newer file systems have eliminated the 2GB file limit, WebSphere MQ does still support many file systems which have this 2GB-per-file restriction. On platforms were this restriction is not present (or in any case when the entire partition runs out of space, regardless of platform) the behavior does no harm. On those platforms where the requeue is likely to be successful, the behavior you have observed is appropriate and even desirable.So there is a difference between exhausting space for a single queue file versus exhausting all the file space in the partition. WebSphere MQ could inquire on aspects of the file system to determine in detail which case caused the error but that would add complexity to the code. What is simple and fast is to attempt a requeue when the operating system returns an out-of-space error. If the partition has space available, the requeue works. If not, then the app is no worse off than it was before the requeue attempt.\n"} +{"text": "### Human: Hi\nI have two Message Driven Beans (MDBs) running on Websphere Application Server v7.\nIt is connecting to, and receiving messages from Websphere MQ v6.\nOn the Queue Manager, we notice that the number of open channel connections keeps on growing, and appears as though the MDBs are not releasing these connections.\nI am not aware of any errors happening in the onMessage method of the MDBs which could cause it to not exit cleanly.Any advise on what could be causing this would be greatly appreciated\nThanks\nGavin### Assistant: There is a known issue with WAS v7 connecting to WMQ V6 where MDBs do not reconnect. The APAR mentions failures after a WMQ outage but other types of failure can result in similar behavior.In general, the advice is to move to WMQ v7 since WMQ V6 is out of service as of September 2011. The fix was released in v7.0.1.1 and later. No v6 fix pack is listed for delivery of this APAR, although it doesn't mention why. So if you cannot upgrade to v7.0.1.1 or later, then obtain via a PMR and apply IC64098 and see if that solves the problem.References:PSP #1316899:Information about using the WebSphere MQ messaging provider for WebSphere Application Server Version 7.0IBM IC64098: APPLICATION DOES NOT AUTOMATICALLY RECONNECT TO THE QUEUE MANAGER IF CONNECTION IS LOST WHEN USING THE MQ RESOURCE ADAPTER\n"} +{"text": "### Human: I have a application that is trying to put a message to a queue(LOG.TRANSACTION.IN) on a remote queue manager. The message ends up failing with a 2035 and is put on the DLQ on the local queue manager. On the local queue manager(QMLOCAL), the application puts the message directly on the SCTQ, since there is no remote queue definition. The application is running under an ID that has full access to MQ. I know that is not ideal, but that is for another discussion. We have an mcauser on the clusrcvr channel on the remote end(QMREMOTE) that has been granted access to the local queue. I thought I had the security worked out, but it appears that is not the case. Here is the security informationQMLOCAL:Entity application_id has the following authorizations for object SYSTEM.CLUSTER.TRANSMIT.QUEUE: \n get \n browse \n put \n inq \n set \n crt \n dlt \n chg \n dsp \n passid \n passall \n setid \n setall \n clrQMREMOTE:Entity MY_MCAUSER has the following authorizations for object LOG.TRANSACTION.IN: \n put \n crt \n setallAny help on this would be greatly appreciated.### Assistant: There are a few possibilities here. Since the message ends up in the DLQ then we know that the problem is on the remote side. If your putting application generated the 2035 then the message would never be put.This means that the MCAUSER in the CLUSRCVR channel is where the problem is. In order for it to work, it needs to have the following (Assume MY_MCAUSER is in group mqmmca):setmqaut -m QMREMOTE -g mqmmca -t qmgr -all +connect +inq +setallsetmqaut -m QMREMOTE -g mqmmca -n 'LOG.TRANSACTION.IN' -t queue -all +put +setallUnrelated to your 2035, the channel also needssetmqaut -m QMREMOTE -g mqmmca -n 'SYSTEM.CLUSTER.COMMAND.QUEUE' -t queue -all +put +setalljust to function in the cluster. Depending on your version, the channel MCAUSER might also need access toSYSTEM.CHANNEL.SYNCQ(v7 variants).An easy way to tell for sure is to enable authorization events.ALTER QMGR AUTHOREV(ENABLED)The authorization events tell you the ID that failed, the object it failed on (QMgr, queue, etc.), the API call being made and the options that were used.Then installSupportPac MS0Pinto WMQ Explorer. This will format the binary PCF event messages into human-readable form and it will be really obvious what exactly the problem is.In this case it is likely that either a) the MCAUSER lacks +setall on the QMgr or b) it's a v7 and the MCAUSER lacks the appropriate permission on the S.C.SQ as noted above.\n"} +{"text": "### Human: I am in the process of exploring integration between SSIS and IBM MQ Series. Can some point me to some artical for integration.### Assistant: You might be able to use the \"Message Queue Task\" in conjunction with some other host bridge. Here's what I found while trolling the Internet:SSIS does not support loading into/from IBM MQ Series directly out of the box. ETI is the only known Microsoft partner or other 3rd party that can handle reading and writing to IBM MQ Series. This is handled via native sequential (MQSeries Queue Message)through their Built-to-Order connectivity process. SSIS customers also have the below ways of integrating their solutions with IBM MQ Series:1.Microsoft\u2019s MSMQ-MQ Series Bridge that comes with Host Integration Server. MSMQ Task in Control Flow in SSIS can be used along with the bridge, which provides connectionless, store-and-forward messaging across messaging systems and computing platforms throughout the network.2.Using BizTalk\u2019s MQ Series Adapter to push/pull messages into/out of SSIS Data Flow Engine via various exchange mechanisms : in-memory: script component, or staging : exchanging messages via the file system or directly writing it into SQL Server tables and use a data source component to read them.3.Using the extensibility story in SSIS: build an MQ Series source/destination custom/script component directly interfacing with MQ Series native libraries.You can find the original websitehere.Here's a description of the \"Message Queue Task\" that I came across in a PDF comparing how SSIS and Informatica handle messaging.SSIS includes a Microsoft Message Queue (MSMQ) connection manager that enables\nconnectivity to MSMQ message queues. Coupled with this is a bidirectional Message Queue\ntask that enables an SSIS package to push messages onto and pop messages off a message\nqueue. The messages can be in the form of text, files or the contents of SSIS variables.\nSQL Server Service Broker which is included with SQL Server 2005 (and therefore with SSIS)\nadds asynchronous messaging functionality to database applications. Service Broker queues\naccessible from any application able to issue T-SQL code which includes SSIS.\n"} +{"text": "### Human: I'm queuing messages to a WebSphere MQ queue (NB: A point-to-point queue -- not a topic) using a stored procedure in my Oracle database. Is there a way to publish each message to multiple queues with a single call? What I would like is to find a solution that would incur zero additional latency on my database compared to sending the message to a single queue.Solutions that involve changing my WebSphere MQ settings are certainly welcome! What I had in mind was somehow creating a \"clone\" queue that got all the same messages as the original one, but I've been unable to locate anything like this in the documentation.Thanks,\nJeff### Assistant: With WMQ v7 you can do this easily and with administration only. You would create a topic object and then an alias over the topic. The Oracle app writes to the alias and does not know that it is actually publishing.Meanwhile, you make two administrative subscriptions on the topic so that publications are delivered to your two destination queues. The apps consuming them have no idea that the messages were published as opposed to delivered through point-to-point queues.If you are not familiar with the new WMQ v7 features, take a look at theInfocenter. In particular, the \"What's New in V7\" section and the sections on Pub/Sub.\n"} +{"text": "### Human: How can I make the queue manager (which exists by default in the docker image) accept any connection without authentication?I went through all the options in the web console (:9443/ibmmq/console/) and tried anything that I thought might have the effect I wanted, but couldn't find it.TIA & BR,\nChristianEdit: here's the code I'm using to connectJmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\nJmsConnectionFactory cf = ff.createConnectionFactory();\n\n// Set the properties\n\ncf.setStringProperty(WMQConstants.WMQ_HOST_NAME, HOST);\ncf.setIntProperty(WMQConstants.WMQ_PORT, PORT);\ncf.setStringProperty(WMQConstants.WMQ_CHANNEL, CHANNEL);\ncf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\ncf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, QMGR);\ncf.setStringProperty(WMQConstants.WMQ_APPLICATIONNAME, \"JmsPutGet (JMS)\");\n//cf.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, true);\n//cf.setStringProperty(WMQConstants.USERID, APP_USER);\n//cf.setStringProperty(WMQConstants.PASSWORD, APP_PASSWORD);\n\n// Create JMS objects\ncontext = cf.createContext();----------edit------------Error log afterremoving \"connection authentication\" for the QMsetting the channel auth. record (under extended) to \"As Queue Manager\"AMQ9557E: Queue Manager User ID initialization failed for '[my OS user]'. \nEXPLANATION:\nThe call to initialize the User ID '[my OS user]' failed with CompCode 2 and\nReason 2035. If an MQCSP block was used, the User ID in the MQCSP block was ''.\nACTION:\nCorrect the error and try again.### Assistant: If you are trying to disable the MQ Connection Authentication feature so that userid & passwords are not authenticated then you can do this by executing the following MQSC commands in runmqsc against the Queue Manager.ALTER QMGR CONNAUTH(' ')\nREFRESH SECURITY(*) TYPE(CONAUTH)Alternatively in the MQ web Console:Select your queue manager in the Queue Manager widgetClick propertiesGo to the Extended section and scroll downSet the \"Connection Authentication\" attribute to a blank valueClick save adn then closeSelect your queue manager in the Queue Manager widgitClick the...and select Refresh security from the drop down\"Select connection authentication\"Add widget: \"Channel authentication records\"In this widget, select the entry for your channel, click properties under \"Extended\" set client connections to \"As Queue Manager\"If required:Select your QM in the \"Queue Manager\" widget, open properties (...), \"refresh security...\", \"Connection authentication\". \nMake sure the default user name (in the standard docker installation, that's \"app\") is set in the channel properties under MCA (as sugg. by @JoshMc)\n"} +{"text": "### Human: I'm experiencing an odd behavior when running basic connectivity tests from my workstation to a remote MQ Server.I am using amqssslc.exe to connect from a command prompt.If I connect with nothing but a certificate store, it connects without issue, and returns a result indicating that it connected to the default queue manager, FOO:C:\\Program Files\\IBM\\MQ\\Tools\\c\\Samples\\Bin64>amqssslc.exe -k c:\\mycerts\\cert\n\nSample AMQSSSLC start\nConnecting to the default queue manager\nNo client connection information specified.\nUsing SSL key repository stem c:\\mycerts\\cert\nNo OCSP configuration specified.\nConnection established to queue manager FOO\nSample AMQSSSLC endIf I attempt to connect to the queue manager FOO, however, it returns a 2058 error, which typically indicates a queue manager name error.C:\\Program Files\\IBM\\MQ\\Tools\\c\\Samples\\Bin64>amqssslc.exe -k c:\\mycerts\\cert -m FOO\n\nSample AMQSSSLC start\nConnecting to queue manager FOO\nNo client connection information specified.\nUsing SSL key repository stem c:\\mycerts\\cert\nNo OCSP configuration specified.\nMQCONNX ended with reason code 2058It does this even if I copy the name directly from the result. It fails quickly, and doesn't generate a log entry in my AMQERR01.LOG file.Does this behavior indicate an issue with my CCDT file?Update:Per @JoshMc's suggestion, I ran the following command to get information about the vendor-supplied CCDT file:echo DIS CHL(*) QMNAME CONNAME|runmqsc -nThe results indicated that no queue manager was specified in the file:C:\\Program Files\\IBM\\MQ\\Tools\\c\\Samples\\Bin64>echo DIS CHL(*) QMNAME CONNAME|runmqsc -n\n5724-H72 (C) Copyright IBM Corp. 1994, 2016.\nStarting local MQSC for 'MYQUEUE.TAB'.\n 1 : DIS CHL(*) QMNAME CONNAME\nAMQ8414: Display Channel details.\n CHANNEL(FOOCHANNEL) CHLTYPE(CLNTCONN)\n CONNAME(CONNAME(xxx.xxx.xxx.xxx(1414),xxx.xxx.xxx.xxx(1414))\n QMNAME( )\n\nNo commands have a syntax error.### Assistant: If you review the source code located atC:\\Program Files\\IBM\\MQ\\Tools\\c\\Samples\\Bin64\\amqssslc.cyou can see that it does the following:If no queue manager name is specified it will set the queue manager name toNULLand printConnecting to the default queue managerIf no connection name is specified it will not setup theClientConn, andConnectOptions.ClientConnPtris left at it's defaultNULLvalue, it will printNo client connection information specified.If a SSL key repository stem is specified it will set theSslConnOptions.KeyRepositoryto this value and print outUsing SSL key repository stem and then pointConnectOptions.SSLConfigPtrto theSslConnOptions.After all of this it then issues aMQCONNXand specifies the theNULLqueue manager name and theConnectOptions. Because theConnectOptions.ClientConnPtris left at the defaultNULLvalue MQ will attempt to find the out how to connect to the queue manager via a few different other means. The order and where it looks for connection information is documented at the IBM v7.5 (or later) Knowledge Center page \"Connecting IBM WebSphere MQ MQI client applications to queue managers\". In your case it is picking up the CCDT file.When you do not specify a queue manager name it looks for a entry in the CCDT with a blankQMNAMEattribute and finds theCLNTCONNchannel that you have defined whereQMNAMEis blank. A blankQMNAMEon aCLNTCONNchannel is a special case where the MQ client will connect to any queue manager name which is listening atCONNAMEthat you specify. Because you are specifying the SSL key repository stem it will use this key repository to connect to MQ with theSSLCIPHyou have specified onCLNTCONNin the CCDT.When youdospecify the queue manager nameFOO, it attempts to find a entry in the CCDT with theQMNAMEattribute set toFOO, in your case it does not exist so you receive the2058orMQRC_Q_MGR_NAME_ERRORerror.Based on your update the CCDT channel does have a blankQMNAMEattribute and theCONNAMElists two different IP(PORT) seperated by a common. With this configuration MQ will attempt first to connect to the first IP, if the connection times out or is ended for some other reason such as the channel on the queue manager being in STOPPED status, it will then attempt to connect to the second IP.It is very possible they intend for you to connect with a blank or NULL queue manager name due to the benefit that the client will connect to any queue manager name that is listening on the CONNAME, in you case the first IP(PORT) might be queue manager FOO and the second IP(PORT) might be queue manager BAR.If you want it to work with your CCDT when you specify-m FOOyou would need to either create a new CCDT with aCLNTCONNchannel withQMNAME(FOO), or add anotherCLNTCONNchannel to your existing CCDT withQMNAME(FOO), note you can not have duplicate channel names in a single CCDT.For more information on the CCDT and what queue manager name to specify see my answer to \"Connecting to IBM MQ using CCDT file in JMS\". The answer was related to JMS but the information applies to MQI clients as well.You also have the option to specify all the details on the command line like Roger said. Runamqssslc.exe ?for usage information, it should look like this:Sample AMQSSSLC start\nParameters: [-m QMgr]\n [-c ChlName -x ConnName]\n [-k KeyReposStem] [-s CipherSpec]\n [-p any|rfc5280]\n [-f] [-b none|128_bit|192_bit[,...] ]\n [-o OcspURL]\n"} +{"text": "### Human: I have a REST service which receives some data and check the data through an ansynchronous IBM MQ request.REST controller:@RestController\n@RequestMapping(\"/request\")\npublic class RequestController {\n\n @RequestMapping(method = RequestMethod.POST)\n public Response postRequest(@RequestBody Request request) {\n\n String data = request.getData();\n\n jmsSender.send(data);\n\n // Now I need the response from MQ\n // String mqResponse = ...\n if (mqIsValid(mqResponse)) {\n return createValidResponse();\n }\n return createNotValidResponse();\n }\n}MQ sender:@Service\npublic class JmsSender {\n\n public void send(String data) {\n jmsTemplate.convertAndSend(\"QUEUE.TO.MQ\", data);\n }\n\n}MQ receiver:@Component\npublic class JmsReceiver {\n\n @JmsListener(destination = \"QUEUE.FROM.MQ, containerFactory = \"DefaultJmsListenerContainerFactory\")\n public void receiveMessage(String message) {\n // How to pass the message to the controller?\n }\n\n}How can I wait for the right data from MQ to create the correct response in the controller?Is it possible to use aBlockingQueuefor this like describedhere? In my case I have to distinguish the data. I can't just take the first data from the blocking queue.If for example there are two REST requests simultaneously (with data:abcandxyz). How can I make sure to response the right answer not just the first answer I get from MQ?I also can't change the MQ interface.### Assistant: Try using a CountDownLatch like below.@RestController\n@RequestMapping(\"/request\")\npublic class RequestController {\n\n @RequestMapping(method = RequestMethod.POST)\n public Response postRequest(@RequestBody Request request) {\n final CountDownLatch jmsLatch = new CountDownLatch (1);\n\n String data = request.getData();\n\n jmsSender.send(data, jmsLatch);\n\n try {\n latch.await(); // wait untill latch counted down to 0\n } catch (InterruptedException e) {\n return createNotValidResponse();\n }\n\n return createValidResponse();\n }\n}Modify the send method to get the CountDownLatch from controller.@Service\npublic class JmsSender {\n\n public void send(String data, final CountDownLatch jmsLatch) {\n jmsLatch.await();\n jmsTemplate.convertAndSend(\"QUEUE.TO.MQ\", data);\n }\n\n}Modify the receive method to get the same CountDownLatch from controller.@Component\npublic class JmsReceiver {\n\n @JmsListener(destination = \"QUEUE.FROM.MQ\", containerFactory = \"DefaultJmsListenerContainerFactory\")\n public void receiveMessage(String message, final CountDownLatch jmsLatch) {\n // Pass the message to the controller\n jmsLatch.countDown();\n }\n\n}The trick here is you have to spread the same CountDownLatch instance from controller to the sender and receiver class and call the countDown method after you receive the message.\n"} +{"text": "### Human: I have been looking into the RubyWMQ gem trying to connect to a Websphere queue, but am having no luck. My ultimate goal is to connect to, read and put messages to the queue using Ruby. I have used the gem authors documentation and examplesherewith no luck as well. currently I have tried this:queue = WMQ::QueueManager.connect( \n :q_mgr_name => 'MYQUEUEMANAGERNAMEHERE',\n :exception_on_error => true,\n :trace_level => 2,\n # :connect_options => WMQ::MQCNO_FASTBATH_BINDING, # this errors\n :channel_name => 'MYQUEUEMANAGERNAMEHERE',\n :connection_name => 'localhost(1414)',\n :transport_type => WMQ::MQXPT_TCP,\n :user_identifier => 'MYUSERNAMEHERE',\n :password => 'MYPASSWORDHERE')I believe the first error I am receiving has to do with the Webshpere MQ client itself, or the install of the gem. i installed RubyWMQ using this command:gem install rubywmq --platform=ruby -- '--with-mqm-include=\"C:\\Program Files\\IBM\\WebSphereMQ\\tools\\c\\include\"'I am using IBM WebSphere MQ version 7.1.0.3, located in C:\\Program Files\\IBM\\WebSphere MQ...I get this error when running my code:WMQ::QueueManager#connect(). Failed to load MQ Library:mqic32, rc=126 (WMQ::WMQException)I can see the \"mqic32.dll\" file in C:\\Program Files\\IBM\\WebSphere MQ\\bin, so I am not sure exactly what the gem code is doing..### Assistant: Managed to fix this by addingC:\\Program Files\\IBM\\WebSphere MQ\\bin64to my user$Path.Which was odd, becausebinandbin64had both been added to the System$pathvariable by the IBM install.(This is with a mingw ruby install)\n"} +{"text": "### Human: I'm trying to read off messages from a websphere mq queue and dump it in another queue.Below is the code i have to do itprivate void transferMessages()\n{\n MQQueueManager sqmgr = connectToQueueManager(S_SERVER_NAME, S_QMGR_NAME, S_PORT_NUMBER, S_CHANNEL_NAME);\n MQQueueManager dqmgr = connectToQueueManager(D_SERVER_NAME, D_QMGR_NAME, D_PORT_NUMBER, D_CHANNEL_NAME);\n if (sqmgr != null && dqmgr != null)\n {\n MQQueue sq = openSourceQueueToGet(sqmgr, S_QUEUE_NAME);\n MQQueue dq = openDestQueueToPut(dqmgr, D_QUEUE_NAME);\n if (sq != null && dq != null)\n {\n setPutMessageOptions();\n setGetMessageOptions();\n processMessages(sqmgr, sq, dqmgr, dq);\n }\n }\n}And I'm calling the above method in a for loop and creating separate threads as below.int NO_OF_THREADS = 5;\nThread[] ts = new Thread[NO_OF_THREADS];\nfor (int i = 0; i < NO_OF_THREADS; i++)\n{ \n ts[i] = new Thread(() => transferMessages());\n ts[i].Start(); \n}As you see, I'm making a fresh connection to the queue manager in the transferMessages method. Not sure for some reason, the program makes only one connection to MQ.The custom method to connect to the queue manager is below..private MQQueueManager connectToQueueManager(string MQServerName, string MQQueueManagerName, string MQPortNumber, string MQChannel)\n {\n try\n {\n mqErrorString = \"\";\n MQQueueManager qmgr;\n Hashtable mqProps = new Hashtable();\n mqProps.Add(MQC.HOST_NAME_PROPERTY, MQServerName);\n mqProps.Add(MQC.CHANNEL_PROPERTY, MQChannel);\n mqProps.Add(MQC.PORT_PROPERTY, Convert.ToInt32(MQPortNumber));\n mqProps.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);\n qmgr = new MQQueueManager(MQQueueManagerName, mqProps);\n return qmgr;\n }\n catch (MQException mqex)\n {\n //catch and log MQException here\n return null;\n }\n }Any advise what am i missing?### Assistant: That is because ofShared Conversation(SHARECNV)feature of MQ where multiple connections to queue manager from one application share the same socket. This value is a negotiated between client and queue manager while establishing a connection. By default 10 connections will be shared over a socket.You can increase the number of threads in your application to 11, then you can see a second connection being opened. More details on SHARECNV arehere.UPDATEChannel status when running 6 threads each for put and get. Note I am connecting to the same queue manager (test purpose only). SHARECNV is set to 10.2 : dis chstatus(MY.SVRCONN)\nAMQ8417: Display Channel Status details.\n CHANNEL(MY.SVRCONN) CHLTYPE(SVRCONN)\n CONNAME(127.0.0.1) CURRENT\n STATUS(RUNNING) SUBSTATE(RECEIVE)\nAMQ8417: Display Channel Status details.\n CHANNEL(MY.SVRCONN) CHLTYPE(SVRCONN)\n CONNAME(127.0.0.1) CURRENT\n STATUS(RUNNING) SUBSTATE(RECEIVE)When running 5 threads each.3 : dis chstatus(MY.SVRCONN)\nAMQ8417: Display Channel Status details.\n CHANNEL(MY.SVRCONN) CHLTYPE(SVRCONN)\n CONNAME(127.0.0.1) CURRENT\n STATUS(RUNNING) SUBSTATE(RECEIVE)\n"} +{"text": "### Human: I have configuredCachingConnectionFactorythat wraps aMQTopicConnectionFactoryandMQQueueConnectionFactorywith cache size set to 10 each.These are than used in severaljms:outbound-channel-adapter or jms:message-driven-channel-adapteras part of various spring integration workflows that I have in my application.It is noticed that once in a while the connection count on MQ channel reaches maximum allowed (about 1000) when the process stops functioning. This is a serious problem for a production application.Bringing the application down does not reduce the connection count so looks like orphaned connections on MQ side? I am not sure if I am missing anything in my spring jms / SI configuration that can resolve this issue, any help would be highly appreciated.Also I would like to log connection open and close from application but don't see a way to do that.\n//all that it needs host/port/ queue manager /channel\n\n\n \n \n \n\n\n\n\n//all that it needs host/port/ queue manager /channel\n\n\n\n \n \n\n\n//Qcf and tcf are than used in spring integration configuration as required### Assistant: You really need to show your configuration but the SpringCachingConnectionFactoryonly creates a single connection that's shared for all sessions. Turning onINFOlogging for the CCF category emits this log when a new connection is created...if (logger.isInfoEnabled()) {\n logger.info(\"Established shared JMS Connection: \" + this.target);\n}EDIT:There's nothing in your config that stands out. As I said, each CCF will have at most 1 connection open at a time.One possibility, if you have idle times, is that the network (a switch or firewall) might be silently dropping connections without telling the client or server. The next time the client tries to use its connection it will fail and create a new one but the server may never find out that the old one is dead.Typically, for such situations, enabling heartbeats or keepalives would keep the connection active (or at least allow the server to know it's dead).\n"} +{"text": "### Human: currently I am working with mule and need to write in WMQ Queue. But instead of using WMQ endpoint, I want to do it by using JMS Endpoint. Here is my configuration:\n\n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n #[flowVars['id']]\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \nI have successfully read message from WMQ Queue by using JMS endpoint. However, when I tried to write some message in WMQ Queue by using JMS Endpoint, I got following error from my server:2014-07-22 10:11:27,064 [Axis2 Task] ERROR WMQMsg - Expected MQ\n message format ' MQSTR ', but received 'MQHRF2 ' 2014-07-22\n 10:11:27,064 [Axis2 Task] WARN QMgrConnection - Moving msg into dead \n letter queue after 1 try/tries:\n 414D51206C6F63616C6D616E616765721A0CCE5320003C0 2 [Fatal Error] :1:1:\n Content ist nicht zul\u00f5ssig in Prolog. ERROR: 'Content ist nicht\n zul\u00f5ssig in Prolog.' 2014-07-22 10:11:27,064 [Axis2 Task] WARN ESBMsg\n - Error prettifying ESBMsg for log printingI know that this error occured because I tried to write into Non-JMS Queue. Also I know that I have to solve it by setting \"?targetClient=1\". However, when I tried to add the targetClient attribute into my Queue URL, I still got the error (it seems that the attribute was recognized as URL too by WMQ).Then, from my research, I found out that I can not directly set the \"?targetClient\" in the url. Instead of that, I need to create a Java Class to set the \"?targetClient\". To create those class, I follow some instructions from following URLCreate Custom JMSSupport ClassBut unfortunatelly, it also did not work for me. Anyone has an idea about how can I solve it? Thanks.NB: In Apache Camel, I can simply solve it by adding:\n queue:///LSMH.ZKSEAP.SERVICEBUS?targetClient=1 \nIs there something similar in Mule ESB?### Assistant: Just solved the problem:It is right that we need to create a java class to set the targetClient. And to do so, we can follow the link that I gave above. However, we will need to change the code a bit.\nHere is the right code:import javax.jms.Destination;\nimport javax.jms.JMSException;\nimport javax.jms.Session;\n\nimport org.mule.api.endpoint.ImmutableEndpoint;\nimport org.mule.transport.jms.Jms11Support;\nimport org.mule.transport.jms.JmsConnector;\n\nimport com.ibm.mq.jms.JMSC;\nimport com.ibm.mq.jms.MQQueue;\n\n/**\n* Implements WebSphere MQ specific JMS support for Mule. The class\n* overrides the createDestination method to intercept JMS Queue object\n* creation and sets the targetClient=1 property on created MQQueue\n* objects. This is necessary to prevent non-JMS consumers from being\n* choked by RFH2 headers.\n*/\npublic class CustomJms11Support extends Jms11Support {\n\n public CustomJms11Support(JmsConnector connector) {\n super(connector);\n }\n\n @Override\n public Destination createDestination(Session session, String name, boolean\n topic, ImmutableEndpoint ie) throws JMSException {\n Destination destination = super.createDestination(session, name, topic, ie);\n if (destination instanceof MQQueue){\n ((MQQueue) destination).setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ);\n }\n return destination;\n }\n}And then, we will need to set a property called \"JMS_IBM_Character_Set\" (If not we will get \"Expected MQ message characterSet '819', but received '1208'\" error) before send the request to JMS endpoint. Here is how I configure it:And just for your information, by changing the WMQ endpoint to JMS endpoint, for sure it improve the performance.Hopefully it would be useful :D\n"} +{"text": "### Human: The Redbook documentation details out creating a.stofile usingamqmcert, but is it possible for a .NET MQ client to just use a certificate out of the Windows certificate store (system store, ie, MMC->Add/Remove Snap-In->Certificates->Computer Account)?### Assistant: Not with current versions of WebSphere MQ. As of V6.0, WMQ began using KDB files for certs rather than the Windows cert store. This provides a common set of tooling across all the distributed platforms supported by WebSphere MQ, as well as reducing the amount of platform-specific code. If you'd like to request that WMQ once again support the Windows cert store, please create a Request For Enhancement (or upvote one if it already exists) at theRFE Community.UPDATEThe Infocenter currently mentions some use of Windows Certificate Store with the XMS classes for .Net connecting to SIBus. This is incorrect and will be removed.\n"} +{"text": "### Human: I have spring boot application which receive JSON requests and push it into IBM MQ JMS queue. There can be n number of JSON requests will be pushed to the queue. My Goal is to process each request from the queue. How can i listen to the queue and get the messages one by one to process using spring boot ?### Assistant: You need to implement listener as:1: Create configure following:@Bean\npublic MQConnectionFactory mqConnectionFactory(){\n MQConnectionFactory connectionFactory = new MQConnectionFactory();\n connectionFactory.setHostName(); //mq host name\n connectionFactory.setPort(); // mq port\n connectionFactory.setQueueManager(); //mq queue manager\n connectionFactory.setChannel(); //mq channel name\n connectionFactory.setTransportType(1);\n connectionFactory.setSSLCipherSuite(); //tls cipher suite name\n return connectionFactory;\n}\n\n\n@Bean()\npublic DefaultMessageListenerContainer myMessageEventContainer() {\n DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();\n container.setAutoStartup(true);\n container.setConnectionFactory(mqConnectionFactory);\n container.setDestinationName(//queue name//);\n container.setMessageListener(new MyEventListener());\n return container;\n}2: Implement message listener:public class MyEventListener implements MessageListener {\n\n @Override\n public void onMessage(Message message) {\n try {\n if (message instanceof TextMessage) {\n TextMessage textMessage = (TextMessage) message;\n String stringMessage = textMessage.getText();\n //do something with your message from queue\n }\n } catch (JMSException e) {\n //catch error\n }\n }\n}\n"} +{"text": "### Human: Can somebody help to understand the basic of these 3 queues with example.when do we use all 3### Assistant: Perhaps a more simple explanation: Think of a local queue as a queue which exists on the queue manager it is defined.. you can PUT and GET messages off a local queue. A remote queue is like a pointer to a queue on another queue manager which is usually on different host. Therefore messages can be PUT to it (and they will usually arrive on a local queue at that remote host) but you cannot GET messages from a remote queue.\n"} +{"text": "### Human: which is proven solution to connect mainframe and java? Which is best in WebSphere MQ / IBM CICS Transaction Gateway?Which is best solution to connect to java and mainframe COBOL?### Assistant: Presuming that by \"Java\" you mean \"Java not running on the mainframe,\" there are multiple ways to do this.CICS Web Services (SOAP)CICS Web Support (REST/POX)MQSeries with a triggered queue\"Best\" is in the eye of the beholder, it depends on what you want. None of these are new, the capability has been available for several years.For option 1, the CICS Web Services Assistant will generate WSDL from COBOL existing language structures. If you decide you don't like what it generates you can write your own WSDL and generate COBOL language structures from that. The Java program would use your favorite SOAP (or MQ) infrastructure to communicate with the CICS/COBOL program.For option 2, your CICS/COBOL program would have to be coded to be \"web aware.\" The CICS/COBOL program would have to use the WEB EXTRACT, WEB RECEIVE, and WEB SEND APIs to communicate with the Java program. The Java program would use HTTP(S) GET/POST processing to send/receive messages to the CICS/COBOL program.For option 3, your CICS/COBOL program would have to be coded to use MQGET and MQPUT to receive and send messages to the Java program. You want to have the queue defined with a backout queue name and a backout threshold, and check the latter against the backout count value. If the threshold is greater than the count, you want to move the message to the backout queue without attempting to process it in the CICS/COBOL program (it's a poison message). The java program would use JMS or whatever your favorite messaging wrapper package is to communicate with the CICS/COBOL program.\n"} +{"text": "### Human: I've built a small Java program that uses the MQ client classes to talk to a Websphere MQ server and a queue thereon. What I want is to query the size, err depth, of a certain queue at regular intervals, e.g. every 10 seconds.What I do, schematically:qm = new MQQManager()q = qm.accessQueue()depth = q.getCurrentDepth()(do something withdepth)q.close()qm.close()This works like a charm!Out of laziness, I wrote my code to go through all 6 steps of the above sequence each time. So I ended up repeating this cycle every 10 seconds. Within about half an hour, the folks who monitor the server told me I had 153 instances open on it. Clearly, simply doingclose()on the queue and QM aren't sufficient to clean up after myself.I'm going to do the obvious fix and hold on to the QM and queue for the program's lifetime. But could somebody please tell me why my previous approach is leaking resources, and what I could do about it if I chose to follow that path?UPDATE (2017-01-25)TimingandAcceptanceRoger has provided some beautiful code and some useful explanations on the topics of performance and uncommitted messages. That's cool, but Eugene's answer was exactly (and minimally) sufficient to solve my problem, and he was a bit quicker. My little app is now doing exactly what I want after I simply changedclose()todisconnect()based on Eugene's advice. Now I'm a bit torn about who should get the checkmark. My apologies to both of you!I got exactly what I wanted and I think I'm done with this question but I should add that I appreciate Roger's thoughtful answer for the useful information it provides to any possible future other reader of this question. Hopefully other people will listen to him rather than follow my lead.PerformanceTo be honest, I don't give a damn about performance. The server is much fatter than needed for what it's currently doing, and my monitoring client (the topic of this question) runs on a development machine that's usually empty. I hope it will have served its purpose within a day or two, then I'll throw it away. In the meantime, if one connect every 10s causes a performance problem, they should load balance to a Raspberry Pi or something.Uncommitted messagesI think this is a non-problem as well. The sending application enqueues in small batches of about 1-5 messages within a few milliseconds and immediately commits. The receiving application (a client I wrote, and it may well have problems) continuously listens on the queue, receives and acknowledges (commits) each message individually. So I'm reasonably sure there will never be more than 1, possibly 5 unacknowledged messages. This number is insignificant compared to the parameters of...myactualproblem,which involves a handful to a few hundred messages suffering processing delays between 5 and 20 minutes at about the same time every morning. I suspect my receiving client is being stalled by a \"hanging\" network IO operation with something other than the MQS. One step I want to take in exploring this is to demonstrate that there is indeed a queue of waiting messages on the MQS, and it's not being picked up. I'd like to see when that queue starts to build up, how long it sits there and how quickly it subsides once my client wakes up again.This connection sees between 2,000 and 10,000 messages a day with peaks corresponding to batch processes in the afternoon and evening, but the delays are happening only in the morning, often with pretty small volumes actually coming through. I'd like to see a log of queue sizes to get a better idea of what's going on. As a next step, I'll probably need to do more instrumentation in my receiving client.EnvironmentFor what it's worth, the server is running WSMQ 6, so my client uses blocking-and-waiting queue gets rather than the spiffy asynchronous notification process I would have preferred to use. My receiving client is a standalone C app running under RHEL in a VM.### Assistant: Wow! Not very efficient code. The connect is by FAR the most expensive MQ API call. Also, getting the queue depth is meaningless. It gives you ALL uncommitted and committed messages in the queue. i.e. queue depth may say there is 5 messages in the queue but your program may only retrieve 3!! You would say MQ is broken but in reality, 2 messages are uncommitted, hence, unavailable for the consumer.If you really want to get and log the information every 10 seconds then STAY connected.Here's a better way of doing it:boolean working = true;\nint openOptions = CMQC.MQOO_INQUIRE + CMQC.MQOO_FAIL_IF_QUIESCING;\nint depth = 0;\nMQQueueManager qm = null;\nMQQueue q = null;\n\ntry\n{\n qm = new MQQueueManager(\"MQA1\");\n\n while (working)\n {\n try\n {\n q = qm.accessQueue(\"TEST.Q1\", openOptions);\n depth = q.getCurrentDepth();\n// (do something with depth)\n }\n catch (MQException e)\n {\n System.out.println(\"CC = \" + e.completionCode + \" : RC=\" + e.reasonCode);\n System.out.println(e.getLocalizedMessage() );\n working = false;\n }\n finally\n {\n if (q != null)\n {\n q.close();\n q = null;\n }\n }\n\n try\n {\n if (working)\n Thread.sleep(10*1000); // time in milliseconds\n }\n catch (InterruptedException ie) {}\n }\n}\ncatch (MQException e)\n{\n System.out.println(\"CC = \" + e.completionCode + \" : RC=\" + e.reasonCode);\n System.out.println(e.getLocalizedMessage() );\n}\nfinally\n{\n try\n {\n if (q != null)\n q.close();\n }\n catch (MQException e)\n {\n System.out.println(\"CC = \" + e.completionCode + \" : RC=\" + e.reasonCode);\n System.out.println(e.getLocalizedMessage() );\n }\n\n try\n {\n if (qm != null)\n qm.disconnect();\n }\n catch (MQException e)\n {\n System.out.println(\"CC = \" + e.completionCode + \" : RC=\" + e.reasonCode);\n System.out.println(e.getLocalizedMessage() );\n }\n}\n"} +{"text": "### Human: For tests of JMS in WebSphere I have downloaded the developer version of WebSphere AS 8.0.Is WebSphere MQ (which is available as a separate product from IBM) already included in this version, or does WAS use a different JMS provider?Update: I know that in the (Apache Geronimo based) IBM WASCE (the 'community edition'), Apache ActiveMQ is used as the default JMS provider.Which product is used in WAS 8.0 / 8.5, a proprietary IBM product or an open source product like ActiveMQ as suggested in the answer below?### Assistant: WebSphere Application Server comes with a JMS provider calledService Integration Bus (SIBus). This is also know as the default messaging provider of WebSphere Application Provider and is Java EE compliant messaging engine. It has features like1) Clustering2) Supports both P2P and Pub/Sub style of messaging.3) High Availability4) Security5) And can integrate with WebSphere MQ.\n"} +{"text": "### Human: I'm very beginner ofWebsphere MQ classes for Javaprogramming.I've decided to follow this way to write a small application able to connect and read messages from a queue through TCP/IP.following this guide:http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=%2Fcom.ibm.mq.csqzaw.doc%2Fja10410_.htmAt point 4 it is suggested to testWebsphere Clientinstallation (Version: 7.0.1.8) on windows command prompt using:java -Djava.library.path=library_path MQIVPwhere 'library_path' for me is \"C:\\Program Files\\IBM\\WebSphere MQ\\java\\lib\"The application runs and I have proceeded writing a simple program withEclipse IDEhere the code:import com.ibm.mq.MQEnvironment;\n\npublic class MQtestMain {\n\n public static void main(String[] args) {\n\n System.out.println(\"main\");\n\n new MQtestMain();\n }\n\n public MQtestMain(){\n\n System.out.println(\"MQtestMain\");\n\n MQEnvironment.hostname = \"my.host.name\";\n MQEnvironment.channel = \"my.channel\";\n MQEnvironment.port = 1414;\n\n }\n\n}It has nothing to do but it is just a test to be sure that everything is correctly set.I have set a custom library with both 'com.ibm.mq.jar' and 'com.ibm.mq.jmqi.jar' from \"C:\\Program Files\\IBM\\WebSphere MQ\\java\\lib\" and no error are reported at compile time.Running the application fromEclipseit correctly prints out \"main\" and \"MQtestMain\" on console.Therefore I have proceeded to export it: File > Export > Runnable Jarsetting 'Library handling' to 'Package required libraries into generated JAR'Unfortunately if I run the program from windows command prompt:java -jar MQtest.jarhere the result:main\nMQtestMain\nException in thread \"main\" java.lang.reflect.InvocationTargetException\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\n at java.lang.reflect.Method.invoke(Unknown Source)\n at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoa\nder.java:58)\nCaused by: java.lang.NoClassDefFoundError: javax/resource/ResourceException\n at com.ibm.mq.MQEnvironment.(MQEnvironment.java:576)\n at MQtestMain.(MQtestMain.java:21)\n at MQtestMain.main(MQtestMain.java:14)\n ... 5 more\nCaused by: java.lang.ClassNotFoundException: javax.resource.ResourceException\n at java.net.URLClassLoader$1.run(Unknown Source)\n at java.net.URLClassLoader$1.run(Unknown Source)\n at java.security.AccessController.doPrivileged(Native Method)\n at java.net.URLClassLoader.findClass(Unknown Source)\n at java.lang.ClassLoader.loadClass(Unknown Source)\n at java.lang.ClassLoader.loadClass(Unknown Source)\n ... 8 moreFirst and second line are correct but I really don't understand the following errorsupdate:I try to give you more information:As I've said running the application from its mainclassfile there are no problems, while execute it from thejarfile it seems not able to find the IBM libraries.I have created a personal library ineclipsenamed \"MQ classes for Java\" containig the two jar packages used by this application.here the content of the project.classpathfile:\n\n \n \n \n \nIs there a way to link the correct libraries to the runnable jar in order to launch it form every machine with WMQ Client installed?Solution:The errors, due to some dependencies not found, have been solved includingalltheIBM classes for Javajarfiles into theWMQ Clientfolder instalation (\"C:\\Program Files\\IBM\\WebSphere MQ\\java\\lib\")### Assistant: I resolved this just by adding javax dependency:\n javax.resource\n connector-api\n 1.5\n\n"} +{"text": "### Human: Is there a solution to make this docker imagehttps://hub.docker.com/r/ibmcom/mqrun on Apple M1 chips? For Intel chips, I was able to run this image by:docker run -e LICENSE=accept -e MQ_QMGR_NAME=QM1 -p 1414:1414 -p 9443:9443 ibmcom/mqIs there a custom build or an official IBM plan to create an Apple M1 compatible version of this image?### Assistant: This has already been requested from IBM, you can view and vote on ithere.\n"} +{"text": "### Human: I have MQ server 7.1 running in machine1. I have a java app running in machine 2, that uses JMS to write messages to a queue in machine 1. The java app handles hundreds of messages per second (data coming from else where). Currently it takes about 100ms for 200 text messages (average size 600 bytes) or 2000 messages per second to write messages to the queue. Is this reasonable performance. What are some of the things that one can do to improve the performance further. i.e. faster?### Assistant: There are a number of detailed recommendations available in the WebSphere MQ Performance Reports. These are published as SupportPacs. If you start at theSupportPac landing page, the ones you want are all named MPxx and are available per-platform and per-version.As you will see from the SupportPacs, WMQ out of the box is tuned for a balance of speed and reliability across a wide variation of message sizes and types. There is considerable latitude for tuning through configuration and through design/architecture.From the configuration perspective, there are buffers for persistent and non-persistent messages, an option to reduce disk write integrity from triple-write to single-write, tuning of log file sizes and numbers, connection multiplexing, etc., etc. You may infer from this that the more the QMgr is tuned to specific traffic characteristics, the faster you can get it to go. The flip side of this is that a QMgr tuned that tightly will tend to react badly if a new type of traffic shows up that is outside the tuning specifications.I have also seen tremendous performance improvement allocating the WMQ filesystems to separate spindles. When a persistent message is written, it goes both to queue files and to log files. If both of those filesystems are in contention for the same disk read/write heads, this can degrade performance. This is why WMQ can sometimes run slower on a high-performance laptop than on a virtual machine or server of approximately the same size. If the laptop has physical spinning disk where the WMQ filesystems are both allocated and the server has SAN, there's no comparison.From a design standpoint, much performance can be gained from parallelism. The Performance reports show that adding more client connections significantly improves performance, up to a point where it then levels off and eventually begins to decline. Fortunately, the top number of clients before it falls off is VERY large and the web app server typically bogs down before WMQ does, just from the number of Java threads required.Another implementation detail that can make a big difference is the commit interval. If the app is such that many messages can be put or got at a time, doing so improves performance. A persistent message under syncpoint doesn't need to be flushed to disk until theCOMMIToccurs. Writing multiple messages in a single unit of work allows WMQ to return control to the program faster, buffer the writes and then optimize them much more efficiently than writing one message at a time.TheOf Mice and Elephantsarticle contains additional in-depth discussion of tuning options. It is part of the developerWorksMission:Messagingseries which contains some other articles which also touch on tuning.\n"} +{"text": "### Human: I want to create a queue manager and a queue on the WebSphere MQ server and I want to do two things\n1) access the queue manager and the queue using WMQ Explorer from a client box\n2) write a Java stand-alone app that runs on the client box and puts and receives message from the queue.However I am getting authentication exceptions. Please let me know what I am doing wrong?Linux Server Box :I have WebSphere MQ v7.1 installedQueue managerQM_TESTcreated (crtmqm,strmqmcommands)Local queueQ_TESTcreated (runmqscand thedefine qlocal)SVRCONN channel defined (DEFINE CHANNEL (TEST_CHANNEL) CHLTYPE (SVRCONN) TRPTYPE (TCP))started a listener (runmqlsr -t tcp -m QM_TEST -p 1414)Linux Client Box :Tried to Show/Hide the queue manager using hostname, ip address, queue manager name and the channel name; However I get the following error:Access not permitted. You are not authorized to perform this operation. (AMQ4036)\nSeverity: 10 (Warning)\nExplanation: The queue manager security mechanism has indicated that the userid associated with this request is not authorized to access the object.Tried to access the queue manager and the queue using the java code, highlights given below:public void sendMail(Mail mail) { MQConnectionFactory cf = new\nMQQueueConnectionFactory(); Connection conn = null; try { //config\ncf.setHostName(\"hostname\"); cf.setPort(1414);\ncf.setQueueManager(\"QM_TEST\"); cf.setChannel(\"TEST_CHANNEL\");\ncf.setTransportType(WMQConstants.WMQ_CM_CLIENT);//WMQ_CM_DIRECT_TCPIP);\nWMQ_CM_CLIENT\n\nconn = cf.createConnection(); //fails hereHowever I get the following error:Error occurred :JMSWMQ2013: The security authentication was not valid\n that was supplied for QueueManager 'QM_TEST' with connection mode\n 'Client' and host name 'hostname(1414)'.Can you help? How do I pass the security authentication information? For now, it is OK if I can disable security as well. Just need to get this working?Let me know if I need to provide more information.UPDATE:I have created 'mq-user' linux user (mq-users group). CHLAUTH is enabled (default).\nAfter creating the queue manager QM_TEST (using sudo mqm) I have executed the following mqsc commands again using sudo mqm:DEFINE QLOCAL(TEST_QUEUE)\nSET AUTHREC PROFILE('TEST_QUEUE') OBJTYPE(QUEUE) PRINCIPAL('mq-user') AUTHADD(PUT,GET)\nSET AUTHREC OBJTYPE(QMGR) PRINCIPAL('mq-user') AUTHADD(CONNECT)\nDEFINE CHANNEL (TEST_CHANNEL) CHLTYPE (SVRCONN) TRPTYPE (TCP)\nSET CHLAUTH(TEST_CHANNEL) TYPE(ADDRESSMAP) ADDRESS('xxx.xx.xxx.*') MCAUSER('mq-user')\nDEFINE LISTENER (TEST_LISTENER) TRPTYPE (TCP) CONTROL (QMGR) PORT (1414)\nSTART LISTENER (TEST_LISTENER)I still get AMQ4036 access not permitted error. Mind you, I access the Queue Manager and Queue from a third remote machine (client machine) logged in as a third user. However I realize I can pass 'mq-user' credentials. I wish there was a clear step by step instructions somewhere, WebShere MQ 71. infocenter is not clear enough for me.What is still missing here?### Assistant: With v7.1 of WMQ the queue manager will by default not allow administrative connections. So if the ID that you are using ismqmor if it is in themqmgroup on the MQ server, it won't have access. The easy (read: NOT SECURE) way to address this is to delete the CHLAUTH record which contains the rule. IBM has published a TechNote about thishere.A longer-term and better solution is to keep the CHLAUTH record that disallows administrative access and instead connect using a different user ID. Of course, that ID will need to exist in the MQ server and be in a group that is authorized. For more on that topic, take a look at the slides and webinar recordinghere.When you are ready to turn security back on, you can find plenty of information on whatsetmqautcommands to use att-rob.netwhere I've archived the security presentations and labs from the IMPACT and European WSTC conferences.\n"} +{"text": "### Human: In Websphere MQ series , command level for a queue manager is 701. What does it actually specify ?### Assistant: WebSphere products use a \"[version].[release].[modification].[Fix Pack]\" naming convention. For example 7.0.1.6 is the current release specified down to the Fix Pack level.Fix packs are limited to bug fixes and very limited non-disruptive functionality enhancements.Modifications can include functionality enhancements but no API changes. For example the Multi-Instance Queue Manager was introduced in 7.0.1.Releases may introduce significant new function and limited API changes but are highly forward and backward compatible withing the same version.Versions encapsulate a core set of functionality. Changes at this level may sacrifice some backward compatibility in trade for significant new functionality. For example, WMQ Pub/Sub was moved from Message Broker to base MQ in the V7 release.Since administrative functionality does not change in Fix Packs but may change at the Modification level, compatibility with administrative tools is based on the queue manager's Command Level.There is an old but stilluseful TechNotewhich described this when the numbering conventions were adopted for WMQ.\n"} +{"text": "### Human: Trying to migrate from IBM WebSphere MQ V6 to V7.One of the line that we have is((com.ibm.mq.jms.MQQueue) queue).setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ);JMSC.MQJMS_CLIENT_NONJMS_MQshows up as deprecated in V7.What is the proper replacement for the line? I looked around for a while, but couldn't find any info.### Assistant: Please see theWebSphere MQ Using Javamanual. In particular, look in theProperties of Objectssection and scroll down to Table 3. Next, find the entry in Table 3 forTARGCLIENT. In the far right column are the values for each of the setter methods. In this case, the values for thesetTargetClientmethod are:WMQConstants.WMQ_CLIENT_JMS_COMPLIANTWMQConstants.WMQ_CLIENT_NONJMS_MQIn the same manual, it is a good idea to review the installation and verification for the new version. Among other things, the classes have been repackaged and so the[CLASSPATH][3]requirements have changed.Since you are migrating from V6 to V7, another good reference is theWebSphere MQ Migrationmanual. In particular, please see the section entitledJava and JMS considerationsfor additional advice for migrating applications. Other sections in this manual will be helpful as well.Finally, it is worth mentioning that Fix Pack 7.0.1.5 has just been released and contains several Java/JMS related fixes. If you are running an earlier version of V7, it would be an extremely good idea to download and apply the maintenance. There are two ways to do this. First, the WMQ client download always has the latest version. You can always download it and install over top of a previous client. It is available as a free download atSupportPac MQC7. Alternatively, you can download the Fix Pack from theRecommended Fixespage. This is supplied as a platform-specific upgrade to the existing install, for example an EXE on Windows, an RPM for Linux, etc.\n"} +{"text": "### Human: Many times I use 'mqsc' for create MQ queue manager from script files but I don't know how to generate script files.Thanks### Assistant: There is a SupportPac that installs a program called \"saveqmgr.exe\".Here's a link to the download of the Pac:http://shrinkster.com/17kcIBM seems to frequently reorganize its website, so the above link might not work if you check back here after a long while, but the SupportPac can be found easily by doing a search for \"saveqmgr\" on the Websphere MQ page. Hope this helps!IBM has this to say about the SupportPac:AbstractThis SupportPac (saveqmgr) saves all the objects, such\n as queues, channels, etc, defined in a\n either local or remote queue manager\n to a file.Download DescriptionThis SupportPac interrogates the attributes\n of all the objects defined to a queue\n manager (either local or remote) and\n saves them to a file.Possible UsesThe format of this file is suitable for use with runmqsc.\n It is therefore possible to use this\n SupportPac to save the definitions of\n objects known to a queue manager and\n subsequently recreate that queue\n manager.\n"} +{"text": "### Human: We're trying to talk to a WebSphere MQSeries installation on the remote machine of an external organization. We don't have IBM WebSphere MQSeries ourselves.I've been looking at open source alternatives like Apache ServiceMix/Camel/ActiveMQ and also Oracle Database Gateway for WebSphere MQ (since we are using Oracle) but each solution requires both the client install provided as SupportPac MQC7 which is a free download plus the IBM jar com.ibm.mqjms.jarIs there a way to exchange messages with WebSphere MQSeries in production purely with non-Websphere MQSeries software?Thanks### Assistant: The latest WMQ client contains the jar files and all of the native WMQ diagnostics and tools. Also, note that the latest distributions include Extended Transactional Client without charge and include that functionality in the regular jar files. (In other words, no longer a separate ETClient.jar file.) The latest download is atSupportPac MQC75.Note that the download is an installer file and does not contain the jar files as a separate folder. The intention from IBM is for you to run the installer on each and every server where you will run WMQ client. Although this is a bit heavyweight versus just grabbing the jar files, the installer contains many diagnostic tools such asdspmqver, the native WMQ trace, themqrcprogram to tell you the meaning of return codes, the code samples, etc. With the full bundle installed, it is a lot easier for IBM to provide support. Considering that they provide support for a free component, requiring the full install seems reasonable to me.There are no other methods for communicating with a WebSphere MQ QMgr other than using the official WMQ client or another WMQ QMgr. Even though WMQ talks JMS, that's an API spec and not a protocol spec. It is necessary to use the Java JMS classes provided by the vendor of your chosen transport which, in this case, means using IBM's JMS classes. The same is true for running .Net code with WMQ. Gotta use IBM's classes.The one exception is that WebSphere App Server Messaging Engines can interoperate with WMQ. These are pure JMS messaging engines written in Java but they understand the WMQ formats and protocols and appear to WMQ as another QMgr. So if you have WAS you can talk to WMQ without a WMQ client or another QMgr.\n"} +{"text": "### Human: I have an MQ application that I need to use SSL connections with. I have been given a keystore to use and a password to use it, but what I am unsure of is where I need to go to set the value of the keystore password?There are a few places in the MQ DLL's that I can see a password setting, but I don't want to set it in the wrong place. All of the other SSL stuff has been under the MQENVIRONMENT and there is a password there, but I can't seem to find anything that confirms this as the correct place.What is the value I need to set for my SSL keystore's password?(NOTE: I am writing this in C# using MQ version 7.)### Assistant: The .Net classes do not use a Java keystore, but rather they use the WMQ kdb format keystore. This file format includes a \"Stash file\" which contains an obfuscated password. Point your program to the kdb in the environment variables as discussedon this pageof the docs. The kdb is actually several files with the same prefix and different suffixes. What you see in the example is that the variable includes the path and the kdb prefix but no suffix.I'm guessing the next question is \"how do I get my jks into this kdb format?\" To do this you must have GSKit installed. It is bundled with both WMQ Client and WMQ Server but depending on the version installed, the path differs slightly. Look underC:\\Program Files\\IBM\\gsk7for starters. There are several different user interfaces but the one you want is the compiled gsk7cmd.C:\\Program Files\\IBM\\gsk7\\bin>gsk7cmd.exe -keydb -convert\n\nA required value for the command was not specified: \n-db Required \n\n-Correct command usage- \n-db Required \n-pw Optional \n-target Optional \n-new_pw Optional \n-old_format or -type Optional \n-new_format Required \n-expire Optional <0 - 7300> \n-stash Optional`When converting from jks to kdb, be sure to specify the -stash option so that the program can find the password.\n"} +{"text": "### Human: When I callcom.ibm.mq.MQQueue#put(MQMessage,MQPutMessageOptions)it may hang. How can I set up a timeout for this method?\nThe same question is forcom.ibm.mq.MQQueue#get(MQMessage,MQGetMessageOptions)### Assistant: There is MQGMO_WAIT option and a WaitInterval that can be set to make the Get call to wait for a certain amount of time. For example, the following snippet makes the Get call to wait for 3 seconds.MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.Options = MQConstants.MQGMO_WAIT;\n gmo.WaitInterval = 3000;\n\n mqQueue.Get(mqMessage, gmo);There is no option to set a timeout for the Put call though. The Put call returns with an error if there is any issue.UPDATE:When a Put call is invoked, connection to queue manager is already established. If there are any issues with the connection, the Put call gets returns soon as the TCP stack notifies of such issue. As such TCP level issues affect the all applications running on the system, in my opinion, tuning must be done at the system level and not at a per application level. Also I don't think it's possible to set a timeout for a socket.write call.MQ does provide a way set a timeout for establishing connection to queue manager though. There is connection_timeout parameter in mqclient.ini you can set a timeout.\n"} +{"text": "### Human: I have installed MQ in my machine(have checked that with regedit32) But i get the error \"cannot recognise the command\" when i type \"runmqsc\" in command prompt (Environment variable is set for mqjms.jar ) What am i missing ? I want to create quemanagers and queue through command prompt in window### Assistant: What version of MQ are you using? (You can check by enteringdspmqverin the command prompt)To create a queue manager you should use the commandcrtmqm. For eaxmple if you'd like to create a queue manager using the default values and name it MyQueueManager, you should enter the following command:crtmqm MyQueueManagerIn any case I would recommend on creating queue managers through MQ Explorer, supposing you've installed it. It's much easier and fool proof.If you still want to work with the command prompt, after you've created your queue manager, type the following:runmqsc MyQueueManagerThis command will open the MQSC shell which you can use to create objects (such as queues) in your queue manager.To create a queue with default values named 'MyQueue' enter:DEFINE QLOCAL('MyQueue')\n"} +{"text": "### Human: This is very basic question about IBM WebSphere MQ V7.Regarding the Transmission Queue, my understanding is it is only used with remote queue that resides in the same queue manager. Therefore, if I want to put message to the queue, I need to put it to remote queue.It is like this.App --> Remote queue --> Transmission QueueMy question is:Is it possible to put the message directly into transmission queue like this?App --> Transmission Queue--Modified on 2014.03.17 --I found a way to put message directly into transmission queue. I do not know this is a common use, but in order to do that I needed to prependMQXQHto the message. I tried and confirmed it works. See the Infocenter referencehere.### Assistant: Do not ever put directly to a transmission queue. It is dangerous if you do not know what you are doing.You should put your message to a remote queue. A remote queue is not the same as a local queue. A remote queue is simply a pointer to a queue on another queue manager.\n"} +{"text": "### Human: I am new to Web Sphere MQ.I created a Queue Manager, Channel and Listener in AIX as follows:crtmqm MY_Q_MGR\n\nstrmqm MY_Q_MGR\n\nrunmqsc\n\nDEFINE LISTENER(MY_QM_LISTENER) TRPTYPE(TCP) PORT(5030)\n\nDEFINE CHANNEL(MY_QM_CHANNEL) CHLTYPE(SDR) CONNAME('10.128.1.51(5030)') XMITQ('MY_Q_MGR') DISCINT(0)Then I checked that QMGR is running. I saw listener in proc.Then, I tried to create MQQueueManager from java as follows and I gotMQJE001: Completion Code '2', Reason '2059'.import com.ibm.mq.MQException;\nimport com.ibm.mq.MQGetMessageOptions;\nimport com.ibm.mq.MQMessage;\nimport com.ibm.mq.MQPutMessageOptions;\nimport com.ibm.mq.MQQueue;\nimport com.ibm.mq.MQQueueManager;\nimport com.ibm.mq.constants.MQConstants;\nimport com.ibm.mq.MQEnvironment;\n\npublic class MQSample {\n\n // code identifier\n static final String sccsid = \"@(#) samples/wmqjava/MQSample.java, jmscc.samples, k700, k700-L080529 1.4.1.1 08/06/01 09:37:53\";\n\n // define the name of the QueueManager\n private static final String qManager = \"MY_Q_MGR\";\n\n // and define the name of the Queue\n private static final String qName = \"SYSTEM.DEFAULT.LOCAL.QUEUE\";\n\n /**\n * Main entry point\n * \n * @param args - command line arguments (ignored)\n */\n public static void main(String args[]) {\n try {\n MQEnvironment.hostname = \"MY IP ADDRESS\";\n MQEnvironment.channel = \"MY_QM_CHANNEL\";\n MQEnvironment.port = 5030;\n\n\n // Create a connection to the QueueManager\n System.out.println(\"Connecting to queue manager: \" + qManager);\n System.out.println(\"Connecting to queue manager is finished: \" + qManager);\n // Set up the options on the queue we wish to open\n int openOptions = MQConstants.MQOO_INPUT_AS_Q_DEF | MQConstants.MQOO_OUTPUT;\n\n // Now specify the queue that we wish to open and the open options\n System.out.println(\"Accessing queue: \" + qName);\n MQQueue queue = qMgr.accessQueue(qName, openOptions);\n MQQueueManager qMgr = new MQQueueManager(qManager); // here i got error\n System.out.println(\"Connecting to queue manager is finished: \" + qManager);\n // Set up the options on the queue we wish to open\n int openOptions = MQConstants.MQOO_INPUT_AS_Q_DEF | MQConstants.MQOO_OUTPUT;\n\n // Now specify the queue that we wish to open and the open options\n System.out.println(\"Accessing queue: \" + qName);\n MQQueue queue = qMgr.accessQueue(qName, openOptions);I am stuck here.### Assistant: You need a Sever connection (SVRCONN) type channel, notSDRtype. ASVRCONNtype channel is required for clients applications to connect to queue manager whereSDRtype channel is for communication between two queue managers.When a queue manager is created, a default SVRCONN channel,SYSTEM.DEF.SVRCONNis created. You can use this for your tests. But in production it's recommended to create your own channel and not use any predefined channels.Please see thislinkfor complete details what you need to do. This is from WebSphere MQ Quick Beginnings book.\n"} +{"text": "### Human: The sender and receiver channels between two queue managers (WebSphere MQ v7.1 running on Redhat Linux) that I have configured is going down pretty frequently. Any idea why? How can I debug this? Thanks.### Assistant: Channels are expected to go down. The idea is that they stay active as long as there is traffic and then time out. Assuming they've been configured to trigger, the presence of a message on the XMitQ causes the channel to start up again.The reason for this is that a triggered channel will generally restart if interrupted by a network failure or other adverse event. However if a channel is configured to stay running 24x7 then the only way it stops is due to one of these adverse events and that increases the likelihood that human intervention will be required to restart the channel. On the other hand, a channel that times out can survive all sorts of nasty network events that occur while it is inactive. Allowing it to time out when not in use thus improves overall reliability of the channel.So how do you cause a channel to trigger? Make sure the transmission queue contains theTRIGGER,TRIGTYPE,TRIGDATAandINITQattributes. For example, to define a transmission queue to theJUPITERQMgr:DEF QL(JUPITER) +\n USAGE(XMITQ) +\n TRIGGER +\n TRIGTYPE(FIRST) +\n TRIGDATA('MYQMGR.JUPITER') +\n INITQ(SYSTEM.CHANNEL.INITQ) +\n REPLACEThe only variable of the bunch isTRIGDATAwhich contains the name of the channel serving this XMitQ.Of course, the channel initiator must be running but in modern versions of WMQ it starts by default (based on the value of the queue manager'sSCHINITattribute) so generallywillin fact be running.The channel that is inSTOPPEDstate cannot be triggered. By default theSTOP CHLcommand usesSTATUS(STOPPED)so most of the time manually stopping a channel prevents triggering. If you want to stop a channel in such a way that it will restart (for example to test triggering) use theSTOP CHL(CHLNAME) STATUS(INACTIVE)command. If the channel is already inSTOPPEDstate, either issue theSTART CHLcommand to make it start immediately or use theSTOP CHL(CHLNAME) STATUS(INACTIVE)to change the status fromSTOPPEDtoINACTIVEwithout starting it.Once the channels are up, theDISCINTattribute of the channel determines how long it will run before timing out. The value is in seconds and defaults to 600 which is 10 minutes. TheDISCINT,KAINTandHBINTcombine to determine when the channel comes down. Note that the TCP spec calls for things using keepalive to disable them by default so if you want to use keepalive on your channels, youmustenable it in the QMgr tuning as describedhere.Please seeTriggering Channelsin the Infocenter for more on the configuration details. Take a look atSupportPac MD0CWebSphere MQ - Keeping Channels Up and Runningif you want to know more about the internals and tuning. (The SupportPac is a bit dated but the principles of tuning mostly still apply. Where there are discrepancies, the Infocenter is the authoritative version.)If you want to keep channels up continuously, setDISCINT(0)but remember that triggering remains the preferred option. Some shops need to minimize response times during the business day and so setDISCINTto a value that allows the channels to time out at night but generally keeps them running all day. If for some reason you have triggering set up right and the channels go down prior toDISCIINTyou should be able to check in the error logs for the reason why. These reside in the QMgr's directory undererrors. For example, on UNIX/Linux they are in/var/mqm/qmgrs/qmgrname/errorsand on Windows the default location isC:\\Program Files(x86)\\WebSphere MQ\\QMgrs\\qmgrname\\errors. Look for the files namedAMQERR??.LOGwhere??=01,02, or03. The logs rotate where01is current,02is next and so on. If you have a very busy QMgr you need to capture these as soon as the channel goes down or they could roll off.\n"} +{"text": "### Human: I want to use Backout and Commit at IBM MQ Client.Process OrderPut 10 messages to queueGet 10 messages from queue andBackout()I expect 10 messages exist in the queue because of Backout, but there is no messages exist in the queue. So I think Backout does not work properly. Why?Platform: .Net Core 2.1IBM Client DLL: amqmdnetstd.dll v 9.1.2Codestring hostName = \"TX32\";\nint port = 5566;\nstring channelName = \"TESTTRY\";\nstring queueName = \"TESTTRY\";\nint numberOfMsgs = 10;\nstring queueManagerName = \"DMQ1\";\nint queueOpenOptionsForPut = MQC.MQOO_OUTPUT + MQC.MQGMO_SYNCPOINT + MQC.MQOO_FAIL_IF_QUIESCING;\nint queueOpenOptionsForGet = MQC.MQGMO_SYNCPOINT + MQC.MQOO_FAIL_IF_QUIESCING;\nstring messageString = \"Bunyamin Test\";\nMQQueue queue;\n\nproperties = new Hashtable();\nproperties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\nproperties.Add(MQC.HOST_NAME_PROPERTY, hostName);\nproperties.Add(MQC.PORT_PROPERTY, port);\nproperties.Add(MQC.CHANNEL_PROPERTY, channelName);\n\n// PUT MESSAGES\nvar queueManager = new MQQueueManager(queueManagerName, properties);\nqueue = queueManager.AccessQueue(queueName, queueOpenOptionsForPut);\nvar message = new MQMessage();\nmessage.WriteString(messageString);\n\n// putting messages continuously\nfor (var i = 1; i <= numberOfMsgs; i++)\n{\n System.Console.Write(\"Message \" + i + \" <\" + messageString + \">.. \");\n queue.Put(message);\n System.Console.WriteLine(\"put\");\n}\n\nqueue.Close();\nqueueManager.Disconnect();\n\n//GET MESSAGES\nqueueManager = new MQQueueManager(queueManagerName, properties);\nqueue = queueManager.AccessQueue(queueName, queueOpenOptionsForGet);\n\n for (var i = 1; i <= numberOfMsgs; i++)\n {\n // creating a message object\n message = new MQMessage();\n queue.Get(message);\n System.Console.WriteLine(i + \" .Message \" + i + \" got = \" + \n message.ReadString(message.MessageLength));\n queueManager.Backout(); //I EXPECT 10 MESSAGES SHOULD GO BACK TO QUEUE?\n message.ClearMessage();\n}\n\nqueue.Close();\nqueueManager.Disconnect();### Assistant: I would modify your application this way.void testCommitBackout()\n {\n string hostName = \"localhost\";\n int port = 1414;\n string channelName = \"SVRCONN_CHN\";\n string queueName = \"QU1\";\n int numberOfMsgs = 10;\n string queueManagerName = \"QM1\";\n int queueOpenOptionsForPut = MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING;\n int queueOpenOptionsForGet = MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING;\n string messageString = \"Bunyamin Test\";\n MQQueue queue;\n\n Hashtable properties = new Hashtable();\n properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\n properties.Add(MQC.HOST_NAME_PROPERTY, hostName);\n properties.Add(MQC.PORT_PROPERTY, port);\n properties.Add(MQC.CHANNEL_PROPERTY, channelName);\n properties.Add(MQC.USER_ID_PROPERTY, \"myuserid\");\n properties.Add(MQC.PASSWORD_PROPERTY, \"Mylongpassword\");\n\n // PUT MESSAGES\n var queueManager = new MQQueueManager(queueManagerName, properties);\n queue = queueManager.AccessQueue(queueName, queueOpenOptionsForPut);\n\n // putting messages continuously under a syncpoint and commit after that\n for (var i = 1; i <= numberOfMsgs; i++)\n {\n var mqpmo = new MQPutMessageOptions();\n mqpmo.Options |= MQC.MQPMO_SYNCPOINT;\n var message = new MQMessage();\n message.WriteString(messageString);\n System.Console.Write(\"Message \" + i + \" <\" + messageString + \">.. \");\n queue.Put(message, mqpmo);\n System.Console.WriteLine(\"put\");\n }\n // Now commit all 10 messages.\n queueManager.Commit();\n\n queue.Close();\n queueManager.Disconnect();\n\n //GET MESSAGES\n queueManager = new MQQueueManager(queueManagerName, properties);\n queue = queueManager.AccessQueue(queueName, queueOpenOptionsForGet);\n\n // Get messages under syncpoint \n for (var i = 1; i <= numberOfMsgs; i++)\n {\n // creating a message object\n var message = new MQMessage();\n var gmo = new MQGetMessageOptions();\n gmo.Options |= MQC.MQGMO_SYNCPOINT;\n queue.Get(message, gmo);\n System.Console.WriteLine(i + \" .Message \" + i + \" got = \" +\n message.ReadString(message.MessageLength));\n message.ClearMessage();\n }\n // Backout all messages.\n queueManager.Backout(); //I EXPECT 10 MESSAGES SHOULD GO BACK TO QUEUE?\n\n queue.Close();\n queueManager.Disconnect();\n }Hope this helped.\n"} +{"text": "### Human: Good day.I'm having an issue which MQ process amqrmppa are keep increasing which currently there are 635 processes exist. Previous 2 days it only have 2++ processes but keep increasing slowly until current value.MQ version = 8.0Operating System = AIX 7This processes expected to be increase until our maxuproc limit which is 1024.When I run command,echo \"dis chs(*)\" | runmqsc MYMQ | grep channel | wc -lThe output appeared is 268.Does this means the actual process that are amqrmppa use is 268?### Assistant: Theamqrmppaprocess is MQ's channel pooling process and by default will scale up using both threads and new process instances. When it increases like this there are two possibilities.Memory leak. The question doesn't mention the complete version number. When the fix pack level is included it would be a dotted-quad format such as8.0.0.1where8.0is the major version and0.1is the support stream and Fix Pack. When the Fix Pack is known it's possible to look through the APARS to see if it is a known problem.Application error. When applications terminate client connections improperly, it leaves an orphan channel instance behind. These eventually time out but the pooling process is slow to release threads since it is quicker to reuse one than to rebuild the entire process from scratch. So the number of processes generally reflects a recent high water mark of started channels.Generally poor programming or external factors (such as firewall timeout) are more likely root causes than MQ code bugs, however the number of APARS in every Fix Pack is testament that these do happen. You might want to tune theMAXCHANsettings so that no one application can spin up more than a reasonable number of concurrent channel instances. You might also want to installBlockIP2orLogIP(fromMr. MQ) and log connection attempts.Some more notes:As a rule, the number of processes islessthan the number of concurrent channels due to dispatching channels to threads. This is tunable though and the local QMgr may have the channels set toPROCESSinstead ofTHREAD. Also, if channels are started byinetdthe result is one channel per process. (Donotdo that in a modern QMgr!)Why are you running withmaxuproc=1024? According to the Infocenter for MQ v8.0,on AIX this value should be 64000. If the recommended kernel tuning has not been performed an apparent process leak is one of the most benign errors you might see. Run themqconfigprogram and follow the advice it gives. (I believemqconfigruns on AIX and also you need to give it the full path name to the executable.)\n"} +{"text": "### Human: I have reached the ibm site but I cant find the actual logic to make use of the trigger.I have done the below code but how can i receive an intimation from the trigger?public void setTrigger()\n {\n try{\n Queue = QMGR.accessQueue(queueName, (MQC.MQOO_INQUIRE+MQC.MQOO_SET));\n Queue.setTriggerControl(1);\n Queue.setTriggerType(2);\n }\n catch(Exception e){\n System.out.println(\"------------------------\");\n System.out.println(\"trigger method\");\n System.out.println(\"------------------------\");\n System.out.println(e);\n System.out.println(\"************************\");\n }\n }How can I get the intimation whenever message came.### Assistant: First off, don't do the triggering setup via an application. It is a waste of time.Secondly, read & understand these MQ web pages:Starting IBM MQ applications using triggers > Prerequisites for triggeringStarting IBM MQ applications using triggersThird, for Java applications, create a batch file or Unix script to set up any environment variables i.e. CLASSPATH and set batch file or Unix script in the PROCESS's APPLICID field.Fourth, after you do the MQSC definition for the queue and process, don't forgot to start the trigger monitor (otherwise nothing will be triggered).Fifth, if you set Trigger Type of First then make absolutely sure that the triggered application reads every message from the queue before exiting.Sixth, triggering (Trigger First) is only good for scenarios when there are large gaps between messages or large gaps between burst of messages. If you are receiving messages every second or 2 then triggering is not good because the application start, process & exit every second or 2. And if it is a Java application, you will always have the JVM load time.Seventh, if what you really wanted was Message CallBack (Asynchronous) rather than MQ Triggering then go read:Asynchronous consumption of IBM MQ messages\n"} +{"text": "### Human: I set up a connection with Weblogic IBM Webpsphere MQ through JMS with using a secure channel using SSL.\nMy application on Weblogic received message from MQ.\nSending answer to reply queue.\nThe response header is present MQMD, it fills java. In parameter Persistence JMS send value \"1\". Other system need to received value \"0\" at Persistence. How to set this parameter to java?\nI guess that parameter is javax.jms.deliverymode. But how to set it i don't know.Anyway thank you for help.### Assistant: The corresponding property on JMS is the delivery mode (Int parameter to be set) to set Persistent and non persistent messages.You can refer this URL fromIBMfor details\n"} +{"text": "### Human: If a publisher publish some messages to a WMQ topic, but the subsciber didn't take it, then where the messages are saved? is there any way to know the message count?### Assistant: As MQ is JMS compliant, the answer is mostly a JMS answer.If the subscription is not durable and no subscription is registered, the messages for that subscriber are discarded.If the subscription is durable, MQ creates a queue (or uses a predefined one if specified by the subscriber) to deliver the messages. The messages will collect there if the subscriber is not consuming them.The 3rd case as Dave points out int he comments is that the non-durable subscriber is holding the subscription open but not consuming the messages. Since a queue is created to receive these that queue depth can be queried to determine if there's a back-up.Based on there being a queue for every subscription (durable or otherwise) just look in the durable subscriber's queue to determine the number of messages outstanding.Please also seePublish/subscribe lifecyclesin the MQ Knowledge Center for more description of the behavior and specification of durable subscriber queues.Of course, if that queue fills up the behavior changes. Depending on the settings either the publishers block or the publications continue but the messages are routed to an exception queue (if specified), the DLQ, or discarded.Thanks Dave Ware for the comments about non-durable subscriptions.\n"} +{"text": "### Human: I'm looking to setup a Queue Manager Using WebSphere MQ V7 MQ Explorer.\nAfter Creating my Queue Manager, normally I expect that some sub directories are automatically generated under it, \"Queues\", \"Topics\", \"Channels\" .. as illustrated in the photo below.In my case, no sub directories are generated, as illustrated below in the second snapshot.PS: the status of my Queue manager is :Running but disconnectedfrom WebSphere MQ Explorer.When I right-click on the QMgr Name and choose Connect, I get \"An unexpected error (2063) has occurred (AMQ4999)\"Could you advise please about a possible cause of this behavior ?### Assistant: Administrative tools -> Local Security Policy -> Local Policies -> User Rights Assignment -> Log on as a service -> Properties ->add your user hereSame problem with MQ v9 and i solved it this way.\n"} +{"text": "### Human: There is a property for WebSphere MQ queue to inhibitGETfrom the queue.\nTo set this property I found two ways.Just set the property using WebSphere MQ Explorer GUI.Alter the queue with the MQSC commandALTER QLOCAL(TEST) GET(DISABLED).Is there any way to enable or disableGETon a WebSphere MQ queue through a Java Program?### Assistant: You can use PCFChange, Copy, and Create Queuecommand to change the attributes of the queue. This can be used from Java with the aid of the PCF Java helper classes, seeHandling PCF Messages with IBM MQ classes for JavaInhibitGet (MQCFIN)Get operations are allowed or inhibited (parameter identifier: MQIA_INHIBIT_GET ).The value can be:MQQA_GET_ALLOWEDGet operations are allowed.MQQA_GET_INHIBITEDGet operations are inhibited.\n"} +{"text": "### Human: When I read about HA in Websphere MQ I always come to the point, when the best practise is to create two Queue Managers handling the same queue and use out-of-the-box load balancing. Therefore, when one is down, the other takes over his job.Well, this is great but what about the messages in the queue that belong to the Queue Manager that went down? I mean do these messages reside there (when queue is persistent of course) until QM is up and running again?Furthermore, is it possible to create a common storage for this doubled Queue Managers? Then no message would wait for the QM to be up. Every message would be delivered in the proper order. Is this correct?### Assistant: WebSphere MQ provides different capabilities for HA, depending on your requirements. WebSphere MQ clustering uses parallelism to distribute load across multiple instances of a queue. This provides availabilityof the servicebut not for in-flight messages.Hardware clustering and Multi-Instance Queue Manager (MIQM) are both designs using multiple instances of a queue manager that see a single disk image of that queue manager's state. These provide availabilityof in-flight messagesbut the service is briefly unavailable while the cluster fails over.Using these in combination it is possible to provide recovery of in-flight messages as well as availability of the service across multiple queue instances.In hardware cluster model the disk is mounted to only one server and the cluster software monitors for failure and swaps the disk, IP address and possibly other resources to the secondary node. This requires a hardware cluster monitor such as PowerHA to manage the cluster.The Multi-Instance QMgr is implemented entirely within WebSphere MQ and needs no other software. It works by having two running instances of the QMgr pointing to the same NFS 4 shared disk mount. Both instances compete for locks on the files. The first one to acquire a lock becomes the active QMgr. Because there is no hardware cluster monitor to perform IP address takeover this type of cluster will have multiple IP addresses. Any modern version of WMQ allows for this using multi-instanceCONNAMEwhere you can supply a comma-separated list of IP or DNS names. Client applications that previously used Client Channel Definition Tables (CCDT) to manage failover across multiple QMgrs will continue to work and CCDT continues to be supported in current versions of WMQ.Please see the Infocenter topicUsing WebSphere MQ with high availability configurationsfor details of hardware cluster and MIQM support.Client Channel Definition Table files are discussed in the Infocenter topicClient Channel Definition Table file.\n"} +{"text": "### Human: I've being trying to setup my java application that connects to a local queue manager in MQ7 without a WebSphere Application Server installed on my machine in binding mode. Without specifying the host in the .bindings file, running my application will throw an java exception somewhere along the lines of:com.ibm.msg.client.jms.DetailedIllegalStateException: JMSWMQ0018:\n Failed to connect to queue manager 'TBUKKKNN' with connection mode\n 'Client' and host name ''. Check the queue manager is started and if\n running in client mode, check there is a listener running. Please see\n the linked exception for more information.Although documentation for WebSphere MQ has explicitly denied possibility of connecting to MQ7 without WAS installed on same machine, my colleagues are very confident that there are workarounds for this.Much appreciated if anyone could help me with this issue. Or let me know if more clarification on my question is required.### Assistant: I wrotean articlea while back that explains how to do this so I'm a little puzzled about any documentation stating that it can't be done. Not only is there a \"workaround\" but it is officially supported and the sample programs that come with the WMQ Client install media include several that use Java and JMS but do not use a Java EE server. If for some reason you just grabbed the jar files instead of installing the vendor distribution, you can download it for free to get the samples. The v7.0 clientis hereand the v7.1 clientis here. Also, make sure to use the version of the docs that matches your client version. The v7.0 Infocenteris hereand the v7.1 Infocenteris here. Any client version can connect to a v7.0 QMgr, by the way.Anyway, your error message indicates that your Connection Factory transport type is still set to Client. You'll need to change it to BIND. The properties are describedhere. The landing page with the list of all the properties of all the administered objectsis here.\n"} +{"text": "### Human: So I'm sending an object using Spring and IBM MQ Queue:public void sendObjectMessage(final Object message) {\n\n// jmsTemplate.convertAndSend(message);\n\n jmsTemplate.send(new MessageCreator()\n {\n public Message createMessage(Session session) throws JMSException\n {\n ObjectMessage outMessage = session.createObjectMessage((Serializable) message);\n return(outMessage);\n }\n }); \n}And during debugging I can see that I am indeed sending it as an object message. But using Spring's listener implementation I am picking up the messages in the onMessage() method as JMSBytesMessages????public void onMessage(Message message) {\n System.out.println(\">>>>>>> Recieved in onMessage\");\n System.out.println(message.getClass());\n}OUTPUT:>>>>>>> Recieved in onMessage\nclass com.ibm.jms.JMSBytesMessageAnybody know whats going on here? This is difficult to debug as it seems to be happening on the queue???Thanks for your helpP.S I've also tried to catch the message usingif (message instanceof ObjectMessage) {\n object = ((ObjectMessage) message).getObject();\n}andif (message instanceof JMSBytesMessage) {\n System.out.println(\"ITS A BYTES MESSAGE!!!!!!!!!!!\"); \n}Neither of which work???### Assistant: My first guess is, that you're using WebSphere AppServer and your JMS queue object (in JNDI) is configured to be a native MQ series client, i.e. you create a JMSObjectMessage which you hand over to the session and then MQSeries thinks it has to convert to BytesMessage.\n"} +{"text": "### Human: I have a message driven bean that throws exception under certain conditions. When it throws an exception the message is not processed and put back on the queue. From what I understand with MQ and WAS (Websphere Application Server) the message should be marked as bad after x number of tries and removed from the queue. This is not happening and the message remains on the queue marked as bad.What part of the configuration in MQ and/or WAS have I missed to set correct?(The issue with the MDB throwing exceptions is NOT the point here)Thanks.### Assistant: On the queue there are attributes BOQNAME and BOQTHRESH. These must be set to the name of the backout queue where the message is to be requeued and the threshold for number of backouts before requeueing the message.In addition, the QMgr must be able to put the message onto the designated queue. Problems may include misspelling of the queue name, the backout queue being full or the account running the MDB was not authorized to put messages on the backout queue.If the MDB detects a poison message loop and has nowhere to requeue the message, it stops processing. You will still see the thread but you will be missing one or more open input handles on the queue. The app must be restarted to revive it in this instance.Avoid using the system's DLQ for the backout destination. The DLQ is where the QMgr will place messages arriving from another QMgr which cannot resolve to a destination queue. These will have a Dead Letter Header attached whereas MDB messages that are requeued will not. This can cause problems with any automation you have watching the DLQ. Therefore, it is advisable to have an exception queue per application that isnotthe DLQ.BOQTHRESH should be greater than 1 or 2 because normal operations such as shutdown of the QMgr or channel can result in a backout. I generally set BOQTHRESH to 5 or 10 but have seen people set this much higher. Depends on your tolerance for retries and whether the backouts are typically caused by transient conditions such as filling up log extents.\n"} +{"text": "### Human: I'm experiencing problems with native modules dependencies (specifically IBM MQ for js) inside a Google Cloud Function (Node v10) and didn't found anywhere the information I needed, so I've opened this question and answered myself to allow other people to find it in the future.It worked fine in the Node v8 engine but it is now deprecated. After upgrading the engine to v10 and bumping some packages (following all migration guides regarding my dependencies) the exception is thrown by theffi-napipackage duringyarn install, as follows:ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Build failed: ...s status = napi_get_instance_data(env, &d);\n ^~~~~~~~~~~~~~~~~~~~~~\n../src/ffi.cc:11:24: note: suggested alternative: 'napi_new_instance'\n napi_status status = napi_get_instance_data(env, &d);\n ^~~~~~~~~~~~~~~~~~~~~~\n napi_new_instance\n../src/ffi.cc: In function 'Napi::Object BindingHook(Napi::Env, Napi::Object)':\n../src/ffi.cc:347:24: error: 'napi_set_instance_data' was not declared in this scope\n napi_status status = napi_set_instance_data(\n ^~~~~~~~~~~~~~~~~~~~~~\n../src/ffi.cc:347:24: note: suggested alternative: 'napi_new_instance'\n napi_status status = napi_set_instance_data(\n ^~~~~~~~~~~~~~~~~~~~~~\n napi_new_instance\nIn file included from ../src/ffi.cc:3:0:\n../src/ffi.h: At global scope:\n../src/ffi.h:148:19: warning: mangled name for 'Napi::TypedArray FFI::WrapPointer(Napi::Env, T*, size_t) [with T = char*() throw ()]' will change in C++17 because the exception specification is part of a function type [-Wnoexcept-type]\n inline TypedArray WrapPointer(Env env, T* ptr, size_t length = 0) {\n ^~~~~~~~~~~\n../src/ffi.h:148:19: warning: mangled name for 'Napi::TypedArray FFI::WrapPointer(Napi::Env, T*, size_t) [with T = void*(void*, const char*) throw ()]' will change in C++17 because the exception specification is part of a function type [-Wnoexcept-type]\n../src/ffi.h:148:19: warning: mangled name for 'Napi::TypedArray FFI::WrapPointer(Napi::Env, T*, size_t) [with T = int(void*) throw ()]' will change in C++17 because the exception specification is part of a function type [-Wnoexcept-type]\n../src/ffi.h:148:19: warning: mangled name for 'Napi::TypedArray FFI::WrapPointer(Napi::Env, T*, size_t) [with T = void*(const char*, int) throw ()]' will change in C++17 because the exception specification is part of a function type [-Wnoexcept-type]\nmake: *** [Release/obj.target/ffi_bindings/src/ffi.o] Error 1\ngyp ERR! build error \ngyp ERR! stack Error: `make` failed with exit code: 2\ngyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:191:23)\ngyp ERR! stack at ChildProcess.emit (events.js:198:13)\ngyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)\ngyp ERR! System Linux 5.3.0-1020-gcp\ngyp ERR! command \"/usr/bin/node\" \"/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"rebuild\"\ngyp ERR! cwd /workspace/node_modules/ffi-napi\ngyp ERR! node -v v10.19.0\ngyp ERR! node-gyp -v v5.0.5\ngyp ERR! not ok \nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 1\nnpm ERR! ffi-napi@3.0.1 install: `node-gyp-build`\nnpm ERR! Exit status 1\nnpm ERR! \nnpm ERR! Failed at the ffi-napi@3.0.1 install script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR! /builder/home/.npm/_logs/2020-06-12T17_47_25_766Z-debug.log; Error ID: c4475859It works fine both locally (OSX Catalina node 10.21) and in Docker (tested in alpine-based node 10 and 12 major tags).### Assistant: TLDR: It is not supported yet.I've just found out some needed Native APIs for the IBM MQ package dependencies (ffi-napi specifically) were introduced inNode v10.20(napi_get_instance_dataadded in v10.20.0) but Google Cloud Functions is based onNode v10.18.1.The only work around I found so far is to downgrade theffi-napitov2.4.7using Yarn Resolutions or a custom fork. There is no public information regarding an expected release of the Node v10.20 in the Cloud Functions engine.\n"} +{"text": "### Human: How do I change the name of an existing channel. My client has informed me that they are changing the channel but keeping the CONNAME the same. I am not able to use the ALTER function. Should I DELETE and re-DEFINE the channel?### Assistant: IBM MQ does not have aRENAMEaction, so you would need toDEFINEa new channel and once you are no longer using the old channelDELETEit.To make it easier you can use theLIKEverb to copy most (if not all) of the parameters of the old channel to the new channel, for example:DEFINE CHL(NEW.CHL) CHLTYPE(SDR) LIKE(OLD.CHL)In the above case theNEW.CHLwill have the same values asOLD.CHLfor things likeXMITQ,CONNAME, etc.\n"} +{"text": "### Human: I have two docker containers which I'm building using docker-compose. One of which initializes the ibm mqs and another is the one exposes rest end points(using SpringBoot project) to send message to the ibm mq which were set up by first container. When I get the docker-compose up I am getting the below errormock-service_1 | 2020-01-29 08:07:52.928 ERROR 1 --- [nio-7090-exec-2] c.j.ids.controller.AcarsController : JMSWMQ0018: Failed to connect to queue manager 'QM1' with connection mode 'Client' and host name 'localhost(1414)'.\nacars-mock-service_1 | com.ibm.msg.client.jms.DetailedIllegalStateException: JMSWMQ0018: Failed to connect to queue manager 'QM1' with connection mode 'Client' and host name 'localhost(1414)'. Caused by: com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2538' ('MQRC_HOST_NOT_AVAILABLE').\n\nmock-service_1 | at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:203)I'm able to put the messages in the same queue if I run the SpringBoot application locally from my IDE without any error. Not sure what is the issue using separate containers. My DockerFile looks like thisFROM ibmcom/mq\nUSER root\nRUN useradd ibm-mq -G mqm && \\\n echo ibm-mq:passw0rd | chpasswd\nUSER mqm\nCOPY config.mqsc /etc/mqm/\n\nEXPOSE 9443 1414And config.mqscALTER QMGR CHLAUTH(DISABLED)docker-compose.ymlversion: '3.3'\nservices:\n ibm-mq-mock:\n build: \n context: ../mock-service/ibm-mq\n dockerfile: Dockerfile\n ports:\n - 9443:9443\n - 1414:1414\n environment:\n LICENSE: accept\n MQ_QMGR_NAME: QM1 \n mock-service:\n build:\n context: ../mock-service\n ports:\n - 7090:7090\n depends_on:\n - ibm-mq-mock\n environment:\n MQ_QMGR_NAME: QM1\n CHANNEL: DEV.ADMIN.SVRCONN\n IBM_MQ_HOST: localhost\n IBM_MQ_PORT: 1414\n IBM_MQ_USERID: admin\n IBM_MQ_PASSWORD: passw0rd\n IBM_MQ_QUEUE: DEV.QUEUE.1\n LOG_LEVEL: INFO\n PROFILE: test### Assistant: Localhost inside your spring container, is your spring container. Instead of setting the host to localhost for your MQ Connection you need your container's / host ip.How you do it depends on your host's platform, but it will be something likehost.docker.internal\n"} +{"text": "### Human: I am using this official IBM tutorial:MQ JMS application development with Spring Bootand using IBM\u00ae MQ Advanced for Developers in docker got from this docker hub page:ibmcom/mqMQ is started with this command:docker run --name mq --env LICENSE=accept --env MQ_QMGR_NAME=QM1 --publish 1414:1414 --publish 9443:9443 --detach ibmcom/mqIt's up and running, and I'm able to connect to it using connection name and channel info:ibm.mq.channel: DEV.ADMIN.SVRCONN\nibm.mq.connectionName: localhost(1414)However I get an error when I try to connect to it using the CCDT file. I get this CCDT file with this command:docker cp :/mnt/mqm/data/qmgrs/QM1/@ipcc/AMQCLCHL.TAB I've set the proper application.yml property:ibm:\n mq:\n ccdtUrl: file://but I get this error:com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ2020: Failed to connect to queue manager 'QM1' with connection mode 'Client' and supplied CCDT URL 'AMQCLCHL.TAB', see linked exception for more information.\n at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:595)\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:215)\n at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:424)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:8475)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:7815)\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl._createConnection(JmsConnectionFactoryImpl.java:303)\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:236)\n at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6016)\n at com.ibm.mq.jms.MQConnectionFactory.createConnection(MQConnectionFactory.java:6041)\n at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:196)\n at org.springframework.jms.listener.AbstractJmsListeningContainer.createSharedConnection(AbstractJmsListeningContainer.java:411)\n at org.springframework.jms.listener.AbstractJmsListeningContainer.establishSharedConnection(AbstractJmsListeningContainer.java:379)\n at org.springframework.jms.listener.DefaultMessageListenerContainer.establishSharedConnection(DefaultMessageListenerContainer.java:818)\n at org.springframework.jms.listener.AbstractJmsListeningContainer.doStart(AbstractJmsListeningContainer.java:291)\n at org.springframework.jms.listener.AbstractJmsListeningContainer.start(AbstractJmsListeningContainer.java:276)\n at org.springframework.jms.listener.DefaultMessageListenerContainer.start(DefaultMessageListenerContainer.java:612)\n at org.springframework.jms.config.JmsListenerEndpointRegistry.startIfNecessary(JmsListenerEndpointRegistry.java:242)\n at org.springframework.jms.config.JmsListenerEndpointRegistry.start(JmsListenerEndpointRegistry.java:205)\n at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:182)\n at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:53)\n at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:360)\n at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:158)\n at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:122)\n at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:879)\n at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:161)\n at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)\n at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)\n at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)\n at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)\n at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)\n at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)\n at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)\n at Application.main(Application.java:11)\nCaused by: com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2278' ('MQRC_CLIENT_CONN_ERROR').\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:203)\n ... 31 common frames omitted\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2278\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1688)\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1273)\n at com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.jmqiConnect(InterceptedJmqiImpl.java:377)\n at com.ibm.mq.ese.jmqi.ESEJMQI.jmqiConnect(ESEJMQI.java:562)\n at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:357)\n ... 30 common frames omittedThe official troubleshoot is here:2278 (08E6) (RC2278): MQRC_CLIENT_CONN_ERROR, but is says:\"It also occurs in Java\u2122 applications when a client channel definition table (CCDT) is specified to determine the name of the channel, but the table itself cannot be found.\"However the table file is found, if I mispell the filename on purpose, I get a FileNotFoundException.So, what am I missing?### Assistant: The2278 MQRC_CLIENT_CONN_ERRORas you found was because the application could not find a channel matching the queue manager name being specified.The2540 MQRC_UNKNOWN_CHANNEL_NAMEerror is because by setting theQMNAMEfield of the channelSYSTEM.DEF.CLNTCONNyou are now attempting to connect to aSVRCONNchannel calledSYSTEM.DEF.CLNTCONNwhich does not exist.By default a new queue manager comes with a default channel table found in the following location under the MQDATA path:qmgrs//@ipcc/AMQCLCHL.TABThe default channel table only contains a singleCLNTCONNchannel calledSYSTEM.DEF.CLNTCONN. This is meant only to show the default values for newly definedCLNTCONNchannels.On the queue manager your client application connects to aSVRCONNchannel. On the client side of the connection if you use a CCDT the channel type that pairs up with a queue managersSVRCONNis aCLNTCONN.Since you are connecting to aSVRCONNchannel calledDEV.ADMIN.SVRCONNyou need to define a CCDT with aCLNTCONNchannel calledDEV.ADMIN.SVRCONN.I would recommend against modifying the default CCDT and instead just create a new one.You can use the following steps to create a CCDT:echo \"DEFINE CHL(DEV.ADMIN.SVRCONN) CHLTYPE(CLNTCONN) QMNAME(QM1) CONNAME(`localhost(1414)`)\" | MQCHLLIB=/PATH/TO/CCDT MQCHLTAB=NAME_OF_CCDT runmqsc -nJust replace the values ofMQCHLLIBandMQCHLTABwith the actual path and name you want to call the CCDT, for example, to create a CCDT calledAMQCLCHL.TABin/tmpuse the following command:echo \"DEFINE CHL(DEV.ADMIN.SVRCONN) CHLTYPE(CLNTCONN) QMNAME(QM1) CONNAME(`localhost(1414)`)\" | MQCHLLIB=/tmp MQCHLTAB=AMQCLCHL.TAB runmqsc -nFor some more examples showing how to create CCDTs and how MQ selects a specific channel in the CCDT you can review this my answer toConnecting to IBM MQ using CCDT file in JMS.\n"} +{"text": "### Human: I need help, I have the following issue:AMQ9776: Channel was blocked by userid \n\nEXPLANATION: \nThe inbound channel 'TEST1.SRVCONN' was blocked from address '10.0.2.4' \nbecause the active values of the channel were mapped to a userid which should \nbe blocked. The active values of the channel were 'MCAUSER(mqm) CLNTUSER(mqm)'.And I have the following authorities records:DISPLAY CHLAUTH(*)\n 37 : DISPLAY CHLAUTH(*)\nAMQ8878: Ver detalles de registro de autenticaci\u00f3n de canal.\n CHLAUTH(SYSTEM.ADMIN.SVRCONN) TYPE(ADDRESSMAP)\n ADDRESS(*) USERSRC(CHANNEL)\n\nAMQ8878: Ver detalles de registro de autenticaci\u00f3n de canal.\n CHLAUTH(TEST1.SRVCNN) TYPE(ADDRESSMAP)\n ADDRESS(10.0.2.4) USERSRC(CHANNEL)\n\nAMQ8878: Ver detalles de registro de autenticaci\u00f3n de canal.\n CHLAUTH(TEST1.SRVCNN) TYPE(BLOCKUSER)\n USERLIST(mqm) \n\nAMQ8878: Ver detalles de registro de autenticaci\u00f3n de canal.\n CHLAUTH(SYSTEM.*) TYPE(ADDRESSMAP)\n ADDRESS(*) USERSRC(NOACCESS)\n\nAMQ8878: Ver detalles de registro de autenticaci\u00f3n de canal.\n CHLAUTH(*) TYPE(BLOCKUSER)\n USERLIST(*MQADMIN)So I don't know what else I can do, I had been reading about this problem and I created the rule to connect to the channel and I granted privilege to the user. \u00bfWhat am I missing?### Assistant: Note that for MQ v8 and later when MQ compares the MQ client user to theUSERLISTof aTYPE(BLOCKUSER)rule or to theCLNTUSERon aTYPE(USERMAP)rule, it can be set to look at either the user the client process is running under or at the user that is presented in the MQCSP and successfully authenticated by CONNAUTH. To get the later behavior you must haveChlauthEarlyAdopt=yset in theChannels:stanza of theqm.ini. For new queue managers created under MQ v8.0 LTS and MQ v9.0 LTS the default would NOT be to set this and MQ will look at the user the client process is running under. For MQ v9.0.5 CD, MQ v9.1 LTS, and MQ v9.1 CD the default is to have it set and MQ will look at the user sent in the MQCSP and successfully authenticated by CONNAUTH.Note theChlauthEarlyAdoptsetting was added at 8.0.0.5, prior to this it would always look at the user the client process is running under.By default MQ comes with the following rule:CHLAUTH(*) TYPE(BLOCKUSER)\nUSERLIST(*MQADMIN)That rule blocks all users which MQ deems to have MQ Administrative authority from connecting to ANYSVRCONNchannel on the queue manager.You added the following two rules (note unless you add ALL to your DISPLAY command it will not show all attributes, so I can only discuss what you show):AMQ8878: Ver detalles de registro de autenticaci\u00f3n de canal.\n CHLAUTH(TEST1.SRVCNN) TYPE(ADDRESSMAP)\n ADDRESS(10.0.2.4) USERSRC(CHANNEL)\n\nAMQ8878: Ver detalles de registro de autenticaci\u00f3n de canal.\n CHLAUTH(TEST1.SRVCNN) TYPE(BLOCKUSER)\n USERLIST(mqm)The first (TYPE(ADDRESSMAP)) will allow a connection fromADDRESS(10.0.2.4)to this channel and leave the user set to what is negotiated on the channel. But absent any other MAP rule that blocks connections by settingUSERSRC(NOACCESS), this rule really does not do anything.If you have aSVRCONNchannel that has a blankMCAUSERthen MQ will accept the username that is sent from the client. For most clients this is the user the process is running under, for Java and JMS it is very easy to send any user including a blank value. If both user sent by the client andMCAUSERon the channel are blank then the negotiatedMCAUSERwill be the user the message channel agent process is running under, on unix this would normally bemqm.The second rule (TYPE(BLOCKUSER)) is actually telling MQ specifically to block any channel where the user ismqmis sent from the client, this is likely the opposite of what you were trying to accomplish.If the client connecting is not an administrative application, then the best way to fix this would be to define another user and give that user permission to what it needs.See my answer to the following question for more details on how to provide MQ permissions to a low privledge user:Authorization errors with MQ8 + JDk8It would not be a good practice to allow applications to connect to a SVRCONN channel that has no security, you do not mention if you are usingCONNAUTHorTLScerts to provide security on the channel, but if you are not you should use one or the other to lock down who can connect to the channel.\n"} +{"text": "### Human: We are trying to connect to IBMMQ using CCDT file and JMS configuration.\nWe are able to connect to it but we have an issue here:since we are using spring to set connection factory with CCDT file, this is initialized once at the start of the application, but unfortunately it picks only one queue manager at a time,i.e it sends all the messages to same queue manager and it does not load balance.Though i observed, if i manually set the CCDT file before every request then its able to load balance the Queue Managers, ideally it looks to me Queue Manager is decided whenever i set the URL to CCDT file. which is wrong practice. My expectation was to initialize the connection factory with CCDT file and then this configuration will be able to load balance on its own.Can you help me this?### Assistant: This is the expected behavior. MQ does not load balance clients, it connection balances them. The connection is the single most time consuming API call and in the case of a mutually authenticated TLS connection can take seconds to complete. Therefore a good application design will attempt to connect once, then maintain that connection for the duration of the session. The JMS architecture and Spring framework both expect this pattern.The way that MQ provides load distribution (again, not truebalancing, but rather round-robindistribution) is that the client connects a hop away from a clustered destination queue. A message addressed to that clustered destination queue will round-robin among all the instances of that queue.If it is a request-reply application, the thing listening for requests on these clustered queue instances addresses the reply message using the Reply-To QMgr and Reply-To Queue name from the requesting message. In this scenario the requestors can fail over QMgr to QMgr if they lose their connection. The systems of record listening on the clustered queues generally do not fail over across queue managers in order to ensure all queue instances are served and because of transaction recovery.Short answer is that CCDT and MQ client in general arenotwhere MQ load distribution occurs. The client should make a connection and hold it as long as possible. Client reconnect and CCDT are forconnectionbalancing only.Load distribution is a feature of the MQ cluster. It requires multiple instances of a clustered queue and these are normally a network hop away from the client app that puts the message.\n"} +{"text": "### Human: I want to get multiple output from a single XML input message.\nmailbox\n\n 38ghjk\n\n\n 39ghjk\nThis is how my XML looks it contains more DocID. My requirement is I want separate output messages for each DocID. I tried with while loop but I'm not getting separate messages for each DocIDs. I can fetch all DocIDs but I'm not able to get Separate Output each DocID.Please suggest any way or solution to do it and please comment for any queries.### Assistant: DECLARE I INTEGER;\nDECLARE J INTEGER;\nSET J = CARDINALITY(InputRoot.XMLNSC.List.Docs[]);\nSET I = 1;\nWHILE I < J DO\nSET OutputRoot.XMLNSC.LIST.DocId[K] = InputRoot.XMLNSC.List.Docs[I].DocId;\nPROPAGATE TO TERMINAL 'out' delete none;\nSET I = I + 1;\nEND WHILE;Earlier I was not using propagate statement so I was getting single output but now I'm getting different output for all docid.\n"} +{"text": "### Human: Is anyone aware of an IBM Websphere MQ module compatible with python3? pymqi doesn\u2019t seem compatible and the author seems unconcerned with that fact.### Assistant: pymqiv1.10.1 compatible with python 3.x (tested with 2.7, 3.5, 3.6, 3.7, 3.8)\n"} +{"text": "### Human: I have MQ client code that can browse an Alias Queue to get the Alias Queue's base object name (i.e. the name of the Local Queue which the Alias Queue points to). However, the code only works when the MQ client connects to an MQ Manager running on the same host as the client code but NOT when the client code connects to an MQ Manager on a remote host.Client Code:MQEnvironment.hostname = \"192.168.1.3\";\nMQEnvironment.port = \"1415\";\nMQEnvironment.channel = \"ADMIN.SVRCONN\";\n\nMQQueueManager mqQueueManager = new MQQueueManager(null);\n\nint openOptions = CMQC.MQOO_BROWSE;// + CMQC.MQOO_RESOLVE_LOCAL_Q;\n\nMQQueue mqQueue = mqQueueManager.accessQueue(\"AN.ALIAS.QUEUE.NAME\", openOptions);\n\nString resolvedName = mqQueue.getResolvedQName();\n\n// resolvedName is null when the MQ Manager is on a remote host \nSystem.out.println(\"Resolved Queue Name: \" + resolvedName);When the resolved queue name of the Alias Queue is null, the MQ Manager's error logs shows the following single entry:AMQ9208: Error on receive from host devlaptop (192.168.1.5).\n\nEXPLANATION:\nAn error occurred receiving data from devlaptop (192.168.1.5) over TCP/IP.\nThis may be due to a communications failure.\nACTION:\nThe return code from the TCP/IP (recv) call was 10054 (X'2746'). Record these\nvalues and tell the systems administrator.Should it be possible for client code to get a remote MQ Manager's Alias Queue's base object name? And if so, how? Am I missing remote permissions somewhere? Or are my client codeopenOptionswrong?NOTE: The Alias Queue or any other queues in the Queue Managers are NOT clustered.### Assistant: What you are seeing at the server is the client shutting down without closing the connection. TCP closes it and the QMgr emits the error you see in the QMgr logs. If the client were receiving an error you would see it returned to the client.The question doesn't specify whether the alias you are trying to open is clustered or not. If it is clustered then we expect the resolved name to be blank as per the docs. In this case, theOPENresolves to a transmission queue but the application is not told which one. In the returned handle the application sees, the resolved queue and QMgr name are left blank.This is covered in the section onName Resolutionin the Knowledge Center. Refer to the table row withBlank queue managerin Column 1 andAlias queue with CLUSTER attributein Column 2.\n"} +{"text": "### Human: I'm trying to use rubywmq gem to publish message to a IBM MQ pub/sub topic. I do not see any direct way of publishing to topic from Ruby code.Following is the MQ TOPIC, SUB setup MQSC:DEFINE TOPIC(MY_TOPIC) TOPICSTR('COM/APP')\nDEFINE QALIAS(MY_TOPIC_Q) TARGET(MY_TOPIC) TARGTYPE(TOPIC)\n\nDEFINE QLOCAL(APP.RAW.INPUT)\nDEFINE QLOCAL(APP.VALIDATOR.INPUT)\nDEFINE QLOCAL(APP.ENRICHER.INPUT)\nDEFINE QLOCAL(APP.XFORM.INPUT)\nDEFINE QLOCAL(APP.LOGGER.INPUT)\n\nDEFINE SUB(SUB.APP.RAW.INPUT) TOPICOBJ(MY_TOPIC) TOPICSTR('MSG/RAW') DEST(APP.RAW.INPUT)\nDEFINE SUB(SUB.APP.VALIDATOR.INPUT) TOPICOBJ(MY_TOPIC) TOPICSTR('MSG/XML') DEST(APP.VALIDATOR.INPUT)\nDEFINE SUB(SUB.APP.ENRICHER.INPUT) TOPICOBJ(MY_TOPIC) TOPICSTR('MSG/VLD') DEST(APP.ENRICHER.INPUT)\nDEFINE SUB(SUB.APP.XFORM.INPUT) TOPICOBJ(MY_TOPIC) TOPICSTR('MSG/ENR') DEST(APP.XFORM.INPUT)\nDEFINE SUB(SUB.APP.LOGGER.INPUT) TOPICOBJ(MY_TOPIC) TOPICSTR('#') DEST(APP.LOGGER.INPUT)I also tried publishing to alias queue for the topic with MQRFH2 header\nRuby Code:WMQ::QueueManager.connect(:connection_name => conn_name, :channel_name => channel_name, :q_mgr_name=> queue_manager) do |qmgr|\n message = WMQ::Message.new\n message.data = 'Hello World'\n message.headers = [\n {\n header_type: :rf_header_2,\n xml: ['COM/APP/MSG/RAW']\n }\n ]\n message.descriptor[:format] = WMQ::MQFMT_STRING\n qmgr.put(q_name: 'MY_TOPIC_Q', message: message )\nendAnd then add a SUB with selector like:DEFINE SUB(SUB.APP.RAW.INPUT) TOPICOBJ(MY_TOPIC) TOPICSTR('MSG/RAW') DEST(APP.RAW.INPUT) PSPROP(RFH2) SELECTOR('route = ''COM/APP/MSG/RAW''')Couldn't succeed. Could anyone please point where the problem is or suggest an alternative? Thanks.Software Version Used:IBM WMQ Server & Client v7.5Ruby v2.3.0rubywmq v2.1.1### Assistant: Putting a message to an alias over a topic is a method to convert point-to-point apps to pub/sub. Since the API call is PUT and not PUBLISH, there is no mechanism to add a topic string to the prefix supplied by the topic object. The messages are published to the topic string as defined in the topic object and no further. YourSUB.APP.LOGGER.INPUTsubscription should be seeing the publications, but not the other ones.There are several other issues in the posted code. The crafting of an RFH2 header suggests you are relying on docs from perhaps as early as v5.3 or v6. Unfortunately, there is no mention of which version the MQ server is at or which version client libraries are being used by Ruby.There is also no mention of what you meant by \"Couldn't succeed.\" Does that mean you saw zero publications, even onSUB.APP.LOGGER.INPUTpub appeared to PUT messages OK? Or the PUT returned a bad reason code? Or that you got messages onSUB.APP.LOGGER.INPUTbut nowhere else?For debugging purposes, you can use MQ Explorer, theamqsputsample, or any of the other supplied tools to drop a message onto the alias queue and look for output. The difference between that test and your Ruby testing should help diagnose the issue.Please do come back and update your question with additional details if you'd like a less speculative response.\n"} +{"text": "### Human: I want to use IBM Websphere MQ client v7.5. I am writing standalone JMS client application to send and consume messages from the IBM WebsphereMQ server(which is running somewhere else but I have authority to send/receive messages)\nI followed steps below:Installed Websphere MQ client(Free version for 6 months) and did all basic installation.I copied required Jar to other location/host and wrote a sample JMS application to send/receive messages. I am able to communicate to with the server.My questions is : Can I use these Jars independently on any host(even in production) for life long or I should buy proper licence, install the client and then use those JARs ?Thanks,Anuj### Assistant: MQ v8.0.0.4 provides exactly what you want. See here:http://www-01.ibm.com/support/docview.wss?uid=swg21969244. Look forIBM MQ JMS and Java 'All Client'. Client is free but whoever runs the queue manager must have appropriate licenses.\n"} +{"text": "### Human: I am trying to connect to Websphere MQ from my node.js clients.\nI found two options1.Using MQTT protocol\n --- we dont have license for MQTT \n2.Using MQLight\n -- We are using a older version of websphere MQ which does not have bridge between MQLight and MQ.Are there any other options or is it possible to send messages from MQlight to MQ 7 queue/topic.### Assistant: There is no interoperability at any released version of MQ which supports AMQP, the protocol MQLight uses (at time of writing 8.0.0.3 is the newest version).The MQTT protocol is supported from MQ 7.1+, and would allow a node.js MQTT client to create and consume messages to MQ via the MQ telemetry component.\n"} +{"text": "### Human: I have Queue A. I have used this in one of my message flow which is up and running. I want to know the number of message dropped in to the queue A on particular day or time interval.Kindly help me in finding out this.### Assistant: Please have a look at the product manuals, in particular:Queue statistics informationtells how to enable queue statistics and ensure that you are collecting all the relevant data.Displaying accounting and statistics informationwhich explains, well, pretty much what the title says.And to keep this on-topic for Stack Overflow, check out theStatistics messages formatpage which tells you how to programmatically access the queue stats messages. By writing your own code to collect the messages, you can store them to a database, save them off to a file, slice and dice the numbers for pie charts, whatever.You did not mention which version of MQ that you are using and that is usually important. However, all modern versions of MQ have some queue stats instrumentation. The links I provided are from the v8.0 Knowledge Center.\n"} +{"text": "### Human: In MSMQ there is a functionality that lets users to peek at a message without actually consuming it. i.e. I peek at the next message in a Queue based on MessageID. If I am not interested in the message I can put the message back into the Queue (i.e. unacknowledged are added back to the Queue and the messageID is maintained).Similar functionality also exists in RabbitMQ. However in RabbitMQ its not done in a clean way. You can simulate peeking messages by taking the message off the queue and then not sending an acknowledgement so RabbitMQ will then add that message back to the queue. However I read that RabbitMQ can reorder the messages and increment message IDs when unacknowledged messages are re-added to the queue.Has anyone encountered this problem before.Also does any one know if IBM MQ supports this behaviour/functionality of peek and seek?regards\nD### Assistant: IBM MQ provides a way to browse messages without removing them from queue. You can start browsing messages from the beginning and iterate through all messages in a queue. You can also browse a specific message using MessageId or CorrelationId.Here is snippet in C# for browsing messages in a queue./// \n /// Browse messages in a queue\n /// \n private void BrowseMessages()\n {\n MQQueueManager qm = null;\n MQQueue queueGet = null;\n Hashtable mqProps = null;\n\n try\n {\n mqProps = new Hashtable();\n // Setup properties for connection\n mqProps.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\n mqProps.Add(MQC.HOST_NAME_PROPERTY, \"localhost\");\n mqProps.Add(MQC.PORT_PROPERTY, 1414);\n mqProps.Add(MQC.CHANNEL_PROPERTY, \"QM.SVRCONN\");\n\n // Open connection to queue manager\n qm = new MQQueueManager(\"QM\", mqProps);\n\n // Open queue for browsing\n queueGet = qm.AccessQueue(\"Q1\", MQC.MQOO_BROWSE | MQC.MQOO_FAIL_IF_QUIESCING);\n\n // In a loop browse all messages till we reach end of queue\n while (true)\n {\n try\n {\n // Need to create objects everytime\n MQMessage msg = new MQMessage();\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n\n // Use browse next option to start browsing\n gmo.Options = MQC.MQGMO_BROWSE_NEXT;\n queueGet.Get(msg, gmo);\n Console.WriteLine(msg.ReadString(msg.MessageLength));\n }\n catch (MQException mqex)\n {\n // When there are no more messages to browse, the Get call\n // will throw MQException with reason code MQC.MQRC_NO_MSG_AVAILABLE.\n // But here we close the queue and break out of loop for all exceptions\n queueGet.Close();\n break;\n }\n }\n qm.Disconnect();\n }\n catch (MQException mqex)\n {\n Console.WriteLine(mqex);\n }\n }\n"} +{"text": "### Human: I want to create a topic with name \"manipulation\" in my Java application, but I get this error:Exception in thread \"main\" com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2085'My code is:MQTopic subscriber = new MQTopic(queueManager, null, \"manipulation\",CMQC.MQTOPIC_OPEN_AS_SUBSCRIPTION, CMQC.MQSO_CREATE);as said here:Accessing queues, topics, and processes in IBM MQ classes for Java### Assistant: The code that you are using to create a subscription for topic needs slight modification to get it working:MQTopic subscriber = new MQTopic(queueManager, null, \"manipulation\",CMQC.MQTOPIC_OPEN_AS_SUBSCRIPTION, CMQC.MQSO_CREATE);In the above snippet you have specified the third parameter, i.e topic object name. When you specify a topic object name, then that object must exist before it can be used. In your case you have administratively create a topic object with namemanipulationand then use above constructor to create a subscription. Because topicmanipulationdoes not exist, anMQRC 2085exception is being thrown.You have two options:1) Administratively create a topic object \"manipulation\".2) If you don't want create a topic object, then create a subscription on the fly without using topic object name as shown belowMQTopic subscriber = queueManager.accessTopic(\"manipulation\", \"\", CMQC.MQTOPIC_OPEN_AS_SUBSCRIPTION, CMQC.MQSO_MANAGED | CMQC.MQSO_CREATE | CMQC.MQOO_FAIL_IF_QUIESCING);\n"} +{"text": "### Human: I have developed subscripe (topic) conncept using Camel. it is working fine in my local tomcat.but it is not working in my test environment tomcat. it is getting below mentioned error. kindly help me to resolve the issue and how to debug the issue.is it related to server configuration ?Errororg.apache.camel.component.jms.JmsMessageListenerContainer refreshConnectionUntilSuccessful\n SEVERE: Could not refresh JMS Connection for destination 'TOPIC-NAME' - retrying in 5000 ms. Cause: JMSWMQ0018: Failed to\n connect to queue manager 'QUEUE-MANAGER' with connection mode 'Client' and\n host name 'HOST-NAME'.; nested exception is com.ibm.mq.MQException:\n JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED')\n reason '2059' ('MQRC_Q_MGR_NOT_AVAILABLE').regards,\nGnana### Assistant: There is almost no information to go on here and therefore no way to answer with any confidence. Instead, I'll provide a diagnostic process and hopefully you will find the problem. Note that in the future if you have similar issues, it would help to list the diagnostics you have already tried so that people responding can narrow down their answers.In order for this to work, the QMgr must be running a listener, have a channel defined and available, have authorizations set up to allow the connection, and be able to resolve the queue or topic requested. With that in mind, the things I normally check and the order I check them in is as follows:Is the QMgr running.Is the listener running? On what port?Can I telnet to the QMgr on the listener port? i.e.telnet mqhost 1414.Is the channel defined? If so, is it available?Do the sample client programs work? In this case,amqspubcis the one to try.There are other considerations and if all of the above work, it is time to look into the client code and configuration, the versions of the client and server, authorizations, etc. But until you know that the basic configuration is in place to support a client connection (which was not indicated in the question) then these are the things to start with.\n"} +{"text": "### Human: I am writing an application that gets data from IBM WebSphere MQ. IBM supplies a DLL with classes to interact with MQ. However, there appear to be two main namespaces; IBM.WMQ and IBM.WMQAX. The latter seems to be a newer addition, but the former appears to be what vague answers on various web sites suggest using for .NET applications. I was hoping someone here might be able to enumerate the real differences and what advantages/disadvantages the classes in each namespace offer.### Assistant: Fromthis thread:The IBM.WMQ is IBM's version of Neil Kolban's original work of\n converting the Java classes for MQ to classes for the .NET framework.The IBM.WMQAX is IBM's COM component for accessing MQ (ActiveX)If you're coding in .NET, use IBM.WMQ since it's managed code. If\n you're coding in VB6 or VC++ then use the ActiveX com component.You could use the COM component from .NET using COM Interop, but that\n really would only make sense, IF, the classes for .NET were NOT\n available. Seeing that they are, use IBM.WMQ.\n"} +{"text": "### Human: We currently use MQ Explorer to manage a WebSphere MQ V7 on Z/OS.\nFew days ago I deleted a queue by mistake.\nLater I wanted to go back in history and look some logs to see when it exactly happened.\nMy question is, where does MQ Explorer logs all activities that takes place via MQ Explorer?Thank you### Assistant: MQ Explorer does not have such a log. If you want an audit trail of things done to your queue manager you should enable command events on the queue manager, that way you'll have an audit trail regardless of the tool used to do the deed.Command events are enabled usingALTER QMGR CMDEV(ENABLED)or if you prefer not to clutter the audit trail with Display commands, useALTER QMGR CMDEV(NODISPLAY).You may also want to consider configuration events, which provide a snapshot of a object before and after any change. For example in your example where a queue is deleted, the configuration event will contain a snapshot of what the queue looked like before it was deleted, allowing that information to be used to reinstate the queue as it was.Read more:-Command EventsCommand Event referenceConfiguration EventsCreate object Event referenceChange object Event referenceDelete object Event reference\n"} +{"text": "### Human: I just upgraded a project to VS2013 from VS2010 and now it crashes whenever I send a message via MQ, yet it worked fine under VS2010.I suspected it was something to do with VS2013, so I built one of the demo apps that comes with MQ - imqwrld.cpp which is a simple \"hello world\" app.This code alone is enough for the debug runtime library to throw an exception:#include // WebSphere MQ C++\n int main ( int argc, char * * argv ) {\n\n ImqQueue * p = new ImqQueue();\n delete p;\n return 0\n }when the ImqObject is deleted, the c rtl detects memory corruption.I suspect it is because of DLL hell. The MQ dlls have a dependency on msvcr80.dll and my program uses a different version of the library - msvcr120d.dll.Any suggestions on how I can solve this? I'm using MQ client 7### Assistant: Its a current release (up to and including 7.5) bug/restriction - the compiler that MQ produces its C++ libraries from, and the Visual Studio 2012+ compilers are apparently binary incompatible. You cannot solve nor workaround this other than to use the C or .NET API's depending on what you are trying to do...As @John M Gant commented below,hereis the official support page from IBM. BTW, it looks like MQ Series 8.0is supportedfor C++ in VS2012\n"} +{"text": "### Human: If I want to set up Websphere MQ in a distributed environment (across 2 machines in a cluster), will the queues and topics(which I understand as physical storage spaces for messages) be created on both machines?Or will the queues and topics be created on one machine only but the program (I guess it is called the websphere MQ broker) will be deployed on 2 machines and both the instances will access the same queue and topic.### Assistant: Cluster concept in WebSphere MQ is different from the traditional high availability (HA) clusters. In traditional HA cluster two systems access the same storage/data to provide HA feature. Both systems can be configured to be active at anytime and processing requests. You can also have a active/passive type of HA configuration.Unlike traditional HA cluster, WebSphere MQ cluster is different. Two queue managers do not share the same storage/data. Each queue manager is unique. WebSphere MQ cluster is more suitable for workload balance than a HA. You can have a queue with same name in multiple queue managers in a MQ cluster and when messages are put, MQ cluster will load balance them to all queues in that cluster. It should be noted the messages in each instance of a queue in cluster are independent and are not shared. If for some reason one of the queue manager in a cluster goes down, then messages in that queue manager become unavailable till the queue manager comes back.Are you aiming for workload balance or HA? If you are aim is to achieve HA, then you could look at the multi-instance queue manager feature of MQ or any other HA solutions. If you are aiming for workload balance then you can go for MQ clustering. You can also have a mix of mutli-instance queue manager and MQ clustering to achieve HA and workload balance.\n"} +{"text": "### Human: This is the sample code i am using, however, i don't know how to get a response back from put or access queue, that the message is sent.mqQueue = mqQMgr.AccessQueue(\"Queue Name\", MQC.MQOO_OUTPUT |\n MQC.MQOO_INPUT_SHARED | MQC.MQOO_INQUIRE); \n mqQueue.Put(mqMsg, mqPutMsgOpts);PUT method is a void return type, if it would have been bool for example, based on the return value - true/false, i can confirm, message was sent to the queue, that is what my question, how do i get back an acknowledgement,so that message is sent to the queue.Any inputs will be highly helpful.### Assistant: Updating as per comments clarifying the question:Enclose yourPUTin a try block and catch theMQException. If noMQExceptionwas thrown, then thePUTworked and you got back RC=0. For example, this is from the samplePUTprogram:void PutMessages()\n {\n try\n {\n // mq properties\n properties = new Hashtable();\n properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\n properties.Add(MQC.HOST_NAME_PROPERTY, hostName);\n properties.Add(MQC.PORT_PROPERTY, port);\n properties.Add(MQC.CHANNEL_PROPERTY, channelName);\n\n // display all details\n Console.WriteLine(\"MQ Parameters\");\n Console.WriteLine(\"1) queueName = \" + queueName);\n Console.WriteLine(\"2) host = \" + hostName);\n Console.WriteLine(\"3) port = \" + port);\n Console.WriteLine(\"4) channel = \" + channelName);\n Console.WriteLine(\"5) numberOfMsgs = \" + numberOfMsgs);\n Console.WriteLine(\"\");\n\n // create connection\n Console.Write(\"Connecting to queue manager.. \");\n queueManager = new MQQueueManager(queueManagerName, properties);\n Console.WriteLine(\"done\");\n\n // accessing queue\n Console.Write(\"Accessing queue \" + queueName + \".. \");\n queue = queueManager.AccessQueue(queueName, MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING);\n Console.WriteLine(\"done\");\n\n // creating a message object\n message = new MQMessage();\n message.WriteString(messageString);\n\n // putting messages continuously\n for (int i = 1; i <= numberOfMsgs; i++)\n {\n Console.Write(\"Message \" + i + \" <\" + messageString + \">.. \");\n queue.Put(message);\n Console.WriteLine(\"put\");\n }\n\n // closing queue\n Console.Write(\"Closing queue.. \");\n queue.Close();\n Console.WriteLine(\"done\");\n\n // disconnecting queue manager\n Console.Write(\"Disconnecting queue manager.. \");\n queueManager.Disconnect();\n Console.WriteLine(\"done\");\n }\n\n catch (MQException mqe)\n {\n Console.WriteLine(\"\");\n Console.WriteLine(\"MQException caught: {0} - {1}\", mqe.ReasonCode, mqe.Message);\n Console.WriteLine(mqe.StackTrace);\n }\n }As noted, this is from the sample code and a real program intended for Production would probably have more granular exception handling. That said, the API call will either succeed or throw anMQException. The exact behavior depends on your options. For example, if you request message conversion on aGETit's possible to get a conversion error whereas the exact same message retrieved as a binary payload would succeed.Previous response:I'm not sure I understand the question, but what Ithinkyou are asking is how to design a request/reply program using WebSphere MQ and that's how I'll respond. However, if by \"response\" you actually meant the reason and return code from thePUT, please clarify the question and I'll update my answer.The usual pattern for request/response is that the requesting program first opens the reply-to queue. If the name of the queue that is opened is a model queue, the queue manager creates a dynamic queue and returns a handle to that. Otherwise, the queue must be a pre-existing local queue.Once the application has a handle on the reply-to queue, it opens the request queue and creates a new request message. The name of the local reply-to queue is used to initialize thereplyToQueuefield of the request message. The local queue manager name is automatically filled in for the message'sreplyToQMgrfield. The app then puts the message and waits on the reply in the reply-to queue.If there are several app instances listening on the same reply-to queue, they usually specify a correlation ID for the specific message they want. The usual design is that the server that reads the request message puts theMQMD.MsgIDinto theMQMD.CorrelIDfield of the reply message however sometimes it transfers the incoming message ID to the outbound message ID.Be sure toCOMMITthePUTbefore issuing theGETor else you willneverget a reply.There's more on this in the Infocenter topicDesign of the Request sample programand you can find the sample programs atC:\\Program Files (x86)\\IBM\\WebSphere MQ\\tools\\dotnetin a default Windows WMQ client installation. I would encourage you to familiarize yourself with the samples and reuse some of the code from there. If you didn't actually download and install the full client, pick up a copy free atSupportPac MQC75. Then when you install it, be sure to select the option to install the SDK and sample code.\n"} +{"text": "### Human: I would like to get some opinion regarding these two JMS providers in terms of :DocumentationEasy to useFeaturesStandard ConformanceI would like to use it together with NetBeans and GlassFish.Thanks.### Assistant: HornetQ has a concise documentation on hornetq.org. Maybe it's just me but I often find myself lost on the redbooks on IBM while looking for the right documentation.HornetQ has very few dependencies making it easy to manage.You would need to compare feature by feature, but last time I looked at it HornetQ has more features.Both are JMS compliant. However with HornetQ you have standard syncs out of the box.In a another note, I made myself a performance comparison between HornetQ and WebSphere MQ and HornetQ was faster in all the usecases. I can't publish the actual comparisson due to license issues with IBM.Regarding glass fish you will have to integrate the Resource Adapter of HornetQ, but we haven't dedicated many resources on testing it.As for NetBeans that should be really easy.\n"} +{"text": "### Human: I am writing a Java application, running in a LINUX environment, that does transactions on an MQ using SYNCPOINT. It uses Websphere MQ Java Classes to interact with the MQ service. What I am doing in my code is the following (pseudo):MQGetMessageOptions gmo = new MQGetMessageOptions();\ngmo.options = MQConstants.MQGMO_FAIL_IF_QUIESCING | MQConstants.MQGMO_SYNCPOINT;\n\nMQMessage message = new Message();\nqueue.get(message, gmo);\n\n// process the message, save to database\n\ndatabaseConnection.commit();\nqueueManager.commit();I basically grab the message, process it, persist to database, then call a commit on the queueManager. The process listens for a message on TIBRV in order to do a graceful shutdown.I've been testing the process to make sure no messages are lost. I place 20k messages on a queue, then run the process. I perform a graceful shutdown call in the middle of processing. I then compare the amount of messages on the queue versus the amount of messages in database. When a graceful shutdown occurs via TIBRV message, the number of MQ messages + the number of DB messages = total messages originally on the queue.However, when I do akillorkill -9, I see that a message is lost. I always end up with a result of 19999 total messages.Is there a way I can investigate how I am losing this message? Is there anything that occurs on the Websphere App Server that I would need to be aware of?### Assistant: There is no reason to expect the numbers to reconcile when using single-phase commit. The program will always be between the WMQ and DB Commit call or else between the DB and WMQ Commit call when you kill it.What you are asking for would require 2-Phase (XA) Commit. For WMQ, 2PC would require the application to be using bindings mode and for WMQ to be the resource coordinator. You would then call MQBEGIN, execute your WMQ and DB updates, then call MQCOMMIT. This way both the WMQ and DB transactions would succeed or fail together.\n"} +{"text": "### Human: I've a problem whereby a message occasionally gets read from the Q more than once. I'm using .NET wrapper for MQSeries (amqmdnet.dll) and read messages, using Win Service.Here's how I do it with VB.NET:\n\n'QManager\n Dim properties As Hashtable = New Hashtable(4)\n\n properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT)\n properties.Add(MQC.CHANNEL_PROPERTY, channelName)\n properties.Add(MQC.HOST_NAME_PROPERTY, iPAddress)\n properties.Add(MQC.PORT_PROPERTY, port)\n\n QManager = New MQQueueManager(queueManagerName, _\n properties)\n\n\n'Q itself\ngetMessageOptions.Options = _\n MQC.MQGMO_FAIL_IF_QUIESCING Or _\n MQC.MQGMO_WAIT Or _\n MQC.MQGMO_SYNCPOINT\n\ngetMessageOptions.WaitInterval = 1000 ' read from config\n\nDim locker As New Object\n\nSystem.Threading.Monitor.Enter(locker)\n\nQ.Get(message, getMessageOptions)\n\nQManager.Commit()\n\nSystem.Threading.Monitor.Exit(locker)I heard that Q.Get(message, getMessageOptions) makes the message unavailable for other readers, QManager.Commit in turn just removes the message from the Q (by analogy with .NET Peek & Dequeue). That on its own should eliminate need for Monitor.In my Win Service multiple threads read the Q and we suspect that due to a low polling interval (100ms and less) the wrapper doesn't get enough time to update 'Read' flag of the message, so it get's picked up more than once by overlapping threads. Historically the same message gets read up to four times.Before increasing the polling interval, I wanted to make sure if I'm doing things the right way. Could anyone suggest on any problmes with my approach?Thanks.### Assistant: Let's address a number of points from the post and subsequent comments:Performing a GET in WMQ does indeed make the message unavailable to other readers. A GET outside of syncpoint permanently dequeues the message immediately whereas a GET under syncpoint makes the message unavailable to other readers unless a BACKOUT occurs. A BROWSE operation however provides no such protection.The queue manager mediates access to the messages. There is no direct manipulation by the MQ application of the queue or message internals, and thus no opportunity for the .Net wrapper to manipulate a \"Read flag\".The wait interval is how long the outstanding GET blocks the program if the queue has no available messages and with a value of 1000 that interval is one second. If there are many messages on the queue and the program loops immediately, the effective polling interval is however long it takes the program to process the message. The wait interval has no affect on throughput dequeueing messages from a deep queue since the queue manager never has to wait for a message to arrive.WMQ offers a number of different levels of reliability. These are controlled by things such as message persistence, acknowledge mode and transactionality. For example, a non-persistent message retrieved outside of a unit of work provides at-most-once reliability.With regard to threading and synchronization, theWebSphere MQ: Using .Netmanualhas this to say:The implementation of WebSphere\u00ae MQ\n .NET ensures that, for a given\n connection (MQQueueManager object\n instance), all access to the target\n WebSphere MQ queue manager is\n synchronized. The default behaviour is\n that a thread that wants to issue a\n call to a queue manager is blocked\n until all other calls in progress for\n that connection are complete. If you\n require simultaneous access to the\n same queue manager from multiple\n threads within your program, create a\n new MQQueueManager object for each\n thread that requires concurrent\n access. (This is equivalent to issuing\n a separate MQCONN call for each\n thread.)If the default connection options are\n overridden by\n MQC.MQCNO_HANDLE_SHARE_NONE or\n MQC.MQCNO_SHARE_NO_BLOCK then the\n queue manager is no longer\n synchronized.So the synchronization is done for you but the exact behavior depends on whether each thread has its own connection. This is because transactions are connection-scoped. If one connection serves many threads and one of the threads calls COMMIT then all threads under that connection are in the same unit of work and all COMMIT at once.There are a couple of possibilities that can result in duplicate messages other than browsing them. All of these are variations on messages being backed out. Backouts may not always be under program control. When many transactions are under syncpoint simultaneously, several tuning limits come into play including MAXUMSGS, log file primary and secondary extents and several others. If any of these limits are exceeded, the QMgr will cancel the oldest outstanding unit of work to make room for the next one. Another reason backouts occur is if the client connection is interrupted. In this case any GETS under syncpoint are rolled back and the messages become available again.One way to determine whether this is happening is to inspect the backout count of the messages as they are read. A robust messaging application will routinely check this value as part of poison message handling and requeue (or delete and log) messages where the backout count exceeds some arbitrary threshold. This prevents an unreadable message from permanently locking a thread. When duplicate messages are seen it might be helpful to log any messages where the backout count exceeds zero rather than simply requeueing those that exceed the threshold.Another way to see exactly what is happening is to use thetracing facilities of WMQorSupportPac MA0W. Either of these will show exactly what API calls are being performed, by which applications and threads, and with which options. If your trace shows that duplicate messages are being delivered to non-browse GET calls without BACKOUT occurring, then it is a defect for which you can request a fix.There is a slight chance if you are using older .Net code that the problem is a defect that has been fixed. I did not see any defects in the fix lists that would result in duplicate messages but if your .Net client is not at a recent v7 you should be considering upgrading soon anyway. The v7 classes are much more functional, and in fact are now fully integrated into WMQ and supported. There is also the small matter of WMQ v6 going end-of-support as of September 2011. You can get the latest WMQ client inSupportPac MQC7. If you have already installed a v7 client and need to upgrade to v7.0.1.4 you can install the latest client over the older v7 one or apply the latest Fix Pack (FP 7.0.1.4 as of this writing) from theRecommended Fixes page. The Fix Pack upgrades client as well as server installations.\n"} +{"text": "### Human: I\u2019m writing a client that receives messages from an external Websphere MQ Queue and puts them on an internal MSMQ Queue. The client will use MQ Client or, preferably, be purely managed (MQC.TRANSPORT_MQSERIES_MANAGED).Based on anexample from IBM, I have a version up and running that can do a simple IBM.WMQ.MQQueue.Get(\u2026). How can this operation be done within a transaction? I'm thinking of using non-XA transactions.### Assistant: The WMQ Single-Phase Commit is enabled by using the MQC.MQPMO_SYNCPOINT flag when putting messages or the MQC.MQGMO_SYNCPOINT flag when getting messages. To complete the unit of work, call the queue manager object's Commit or Backout method.Reference: the Backout and Commit methods in theMQQueueManagersection in the manual.As long as you are using managed code you are limited to 1-phase commit. If using unmanaged code in bindings mode (using shared memory to talk to a local WMQ QMgr) you can use XA. In that case you'd need to use the Begin method.\n"} +{"text": "### Human: How can I check from IBM MQ UI that to a specific queue if there is any consumer present### Assistant: From WMQ Explorer or any of the desktop client tools, look for an open input handle on the queue. In WMQ Explorer's default view the first two columns are the queue name and type. After that there are several columns with numbers. The first is queue depth. Next is the number of open input handles, then the number of open output handles. If you right-click on the queue name there is an option for Status. Selecting that will show you lots of details about the handles such as who has them open, what open options were used, the PID holding the handle, etc.If you wanted to do this at the command line you would use runmqsc and the display qstatus command. For example:echo 'dis qs(SYSTEM.ADMIN.COMMAND.QUEUE) type(handle) all' | runmqsc TESTQMGR\n\n5724-H72 (C) Copyright IBM Corp. 1994, 2009. ALL RIGHTS RESERVED.\nStarting MQSC for queue manager TESTQM.\n\nAMQ8450: Display queue status details.\n QUEUE(SYSTEM.ADMIN.COMMAND.QUEUE) TYPE(HANDLE)\n APPLDESC( )\n APPLTAG(er V7\\java\\jre\\bin\\javaw.exe)\n APPLTYPE(USER) BROWSE(NO)\n CHANNEL( ) CONNAME( )\n ASTATE(NONE) HSTATE(INACTIVE)\n INPUT(NO) INQUIRE(NO)\n OUTPUT(YES) PID(6236)\n QMURID(0.0) SET(NO)\n TID(*)\n URID(XA_FORMATID[00000000] XA_GTRID[] XA_BQUAL[])\n URTYPE(QMGR) USERID(T.Rob@IBM-02BE93E63E4)\nAMQ8450: Display queue status details.\n QUEUE(SYSTEM.ADMIN.COMMAND.QUEUE) TYPE(HANDLE)\n APPLDESC( )\n APPLTAG(er V7\\java\\jre\\bin\\javaw.exe)\n APPLTYPE(USER) BROWSE(NO)\n CHANNEL( ) CONNAME( )\n ASTATE(NONE) HSTATE(INACTIVE)\n INPUT(NO) INQUIRE(YES)\n OUTPUT(NO) PID(6236)\n QMURID(0.0) SET(NO)\n TID(*)\n URID(XA_FORMATID[00000000] XA_GTRID[] XA_BQUAL[])\n URTYPE(QMGR) USERID(T.Rob@IBM-02BE93E63E4)\nAMQ8450: Display queue status details.\n QUEUE(SYSTEM.ADMIN.COMMAND.QUEUE) TYPE(HANDLE)\n APPLDESC(WebSphere MQ Command Server)\n APPLTAG(ebSphere MQ\\bin\\amqpcsea.exe)\n APPLTYPE(SYSTEM) BROWSE(NO)\n CHANNEL( ) CONNAME( )\n ASTATE(NONE) HSTATE(ACTIVE)\n INPUT(EXCL) INQUIRE(YES)\n OUTPUT(NO) PID(5556)\n QMURID(0.0) SET(NO)\n TID(1)\n URID(XA_FORMATID[00000000] XA_GTRID[] XA_BQUAL[])\n URTYPE(QMGR)\n\n1 MQSC commands read.\nOne command has a syntax error.\nAll valid MQSC commands were processed.You can also do this programmatically from Java or C using PCF commands but since you specified \"from the UI\" I'm guessing this is not what you need.The DIS QS command is described more fully here:http://bit.ly/WMQdisQSIf you need the WMQ Explorer, that is here:http://bit.ly/SupportPacMQC7\n"} +{"text": "### Human: I have a general question about the JMS createQueue method. In WebSphere MQ is this method used as an alternative to the JNDI lookup? I was thinking that I could dynamically create a queue. Is this possible? Thank you.### Assistant: Assuming you meanQueueSession.createQueue, this is a very misleading method, and doesn't do what you might think:Creates a queue identity given a Queue\n name.This facility is provided for the rare\n cases where clients need to\n dynamically manipulate queue identity.\n It allows the creation of a queue\n identity with a provider-specific\n name. Clients that depend on this\n ability are not portable.Note that this method is not for\n creating the physical queue. The\n physical creation of queues is an\n administrative task and is not to be\n initiated by the JMS API. The one\n exception is the creation of temporary\n queues, which is accomplished with the\n createTemporaryQueue method.The JMS API does not provide a way of dynamically creating queues (unless you mean temporary queues, which are a very different beast used by request-response messaging). If you want to create queues are runtime, that's going to be proprietary to WebSphere.\n"} +{"text": "### Human: Has anyone worked with MQ from RPG?\nThe problem is as follows. There are several messages in the queue. All of them are with RFH2 header. Each header contains a set of NameValueData.\nI am creating a Message Handle and passing it to MQGET. Then I retrieve Properties using MQINQMP.\nQuestion. When I read several messages in a loop, using the same Message Handle instance for all (without freeing it and re-creating it for each message), will I have memory leaks?### Assistant: The IBM MQ Message Properties API is designed to be used in the following way.MQOPEN\nMQCRTMH\n\nstart-loop\n\nMQGET\nMQINQMP\n\nend-loop\n\nMQCLOSE\nMQDLTMHYou can see this demonstrated in the IBM supplied 'C' sample amqsbcg0.c. I know your question is for RPG, but the underlying API is meant to work the same for all languages.\n"} +{"text": "### Human: I have done an SSL configuration for my IBM MQ v9, created a Java client, and added the certificates both sides. A Put and Get messages works fine. My issue is I'm able to browse the message using the MQ Explorer in the server. Is it because the message is decrypted and shown? Can I keep this message encrypted to a MQ Admin user who has access to the MQ explorer.Any advice is very much appreciated.Thanks in advance,Yasothar### Assistant: Configuring encryption at the channel level only encrypts data in motion (on the network).Messages on a queue are not encrypted unless you do this at the application layer or use the IBM MQ Advanced Message Security (AMS) extension of the product, this requires additional configuration with different certs to represent the putting and getting applications as well as policies to tell MQ AMS what to encrypt and who can receive.Even with IBM MQ AMS configured, someone with MQ admin authority can still override configurations to allow viewing of messages sent, since the the MQ admin controls the policy, so can easily add themselfs as a new recipient so they can also view message that are sent.\n"} +{"text": "### Human: I am using this example from IBM. I have just copied and pasted the code:https://github.com/ibm-messaging/mq-dev-patterns/blob/master/dotnet/dotNetGet.csI am connecting to a MQ Server version 9.0.0.5I am using a console application .Net Framework 4.6.1The MQ client installed in my local machines is 9.1.0.1I can see a very strange behavior. The application run normally and it is able to get messages. But it would disconnect after exactly 10 minutes. It is always 10 minutes.This is the error catched:IBM.XMS.IllegalStateException: Failed to get a message from destination MY_QUEUE.\nIBM MQ classes for XMS attempted to perform an MQGET; however IBM MQ reported an error.\nUse the linked exception to determine the cause of this error.\n at IBM.XMS.Client.Impl.XmsMessageConsumerImpl.ReceiveInboundMessage(Int64 timeout)\n at IBM.XMS.Client.Impl.XmsMessageConsumerImpl.Receive(Int64 millis)\n at Mq_Get_Tests.SimpleConsumer.ReceiveMessages() in C:\\Users\\osotorrio\\Projects\\Temporal\\Mq_Get_Tests\\Mq_Get_Tests\\SimpleConsumer.cs:line 137\nLinked Exception : CompCode: 2, Reason: 2009*Is the IBM example missing some configuration settings to allow the client to reconnect after 10 minutes of inactivity?### Assistant: The symptoms you describe appear to be a match for APARIT26614: MQ dotnet (.NET) client channel ends abnormally when the heartbeat (HBINT) is reached.The fix is targeted for delivery in the following PTFs:\n\nVersion Maintenance Level\nv8.0 8.0.0.13\nv9.0 LTS 9.0.0.7\nv9.1 CD 9.1.3\nv9.1 LTS 9.1.0.3As of August 7th 2019 9.0.0.7 and 9.1.0.3 have been released and can be downloaded fromMQC9: IBM MQ V9 ClientsorMQC91: IBM MQ ClientsTo give some background on how things are supposed to work:A MQ client application when it connect to the queue manager will negotiate a heartbeat interval (HBINT) which is a value in seconds. The negotiatedHBINTis always the highest value negotiated between theSVRCONNand the client application.Note:ASVRCONNHBINThas a default value of300.Based on theHBINT, a TIMEOUT is calculated in one of two ways:If the negotiatedHBINTis less than 60 the TIMEOUT is 2xHBINT. (the received timeout is HBINT seconds after the HBINT has passed)If the negotiatedHBINTis greater than or equal to 60 the TIMEOUT isHBINT+ 60. (the receive timeout is 60 seconds after the HBINT has passed).If no normal traffic has been received from the queue manager in theHBINTamount of time the client should send a Heart Beat to the queue manager which should respond. The client should wait the receive timeout amount of time for the Heart Beat to be received.The queue manager can also initiate a Heart Beat to the client, but to prevent extra traffic the queue manager waits five seconds more than the negotiatedHBINTbefore sending a Heart Beat to the client.APAR IT26614 corrects the following three issues:In either Unmanaged or Managed mode it is documented that if you are not using a CCDT theHBINTwill use the value of theSVRCONNchannel. In reality if not using a CCDT theHBINTon the client side defaults to300so this is the lowestHBINTyou will see.Specific to Managed .NET the client sideHBINTcannot be lower than theSVRCONNHBINTthe connection will fail with a 2059. This problem impacts both with or without CCDT.with a CCDT you are unable to set theCLNTCONNHBINTto a value less than theSVRCONNHBINTwithout a CCDT you will be impacted if theSVRCONNHBINTis set to301or higher\nSpecific to Managed .NET the client side receive timeout was being calculated in milliseconds not seconds. In this case the defect has been present according to IBM for a long time, but did not present itself until APARIT16167: Managed .NET client application does not send heartbeat request to queue managerwas introduced in 8.0.0.10 and 9.0.0.4 (IBM also confirmed this is present in GA 9.1.0.0). The reason it was not previously a problem was that Managed .NET was never initiating the Heart Beat, the queue manager would always send the Heart Beat at HBINT + 5 seconds and the .NET client would respond. Once this was corrected, the miscalculation of the receive timeout presented itself.Based on Managed XMS.NET client version 9.1.0.1 this is what I suspect is happening:The HBINT is negotiated to 300 seconds no matter what the SVRCONN HBINT has set.The Managed XMS.NET client will send a Heart Beat to the queue manager after having not received anything from the queue manager for 300 seconds.At this point the Managed XMS.NET client will only wait 60ms for a response from the queue manager.If the Managed XMS.NET client does not receive a response in 60ms it will return a 2009 error to the application.The queue manager error logs will show a AMQ9209 with \"An error occurred receiving data from 'dnsname (xx.xx.xx.xx)' over TCP/IP.You mention seeing this only at 10 minutes (600 seconds), but I have seen it at any 300 second interval based on the latency of the network. If you are connecting to a queue manager on the same server or in the same local network segment you may never see this problem. If you are connecting over a high latency WAN circuit it may be experienced every 300 seconds. If you are connected over a segment with close to 30ms latency you may see it intermittently.I suggest you try out the 9.0.0.7 or 9.1.0.3 Managed XMS.NET client and see if it resolves the problem for you since at these releases it will wait a full 60 seconds for the Heart Beat response from the queue manager.If you want to add reconnect to the sample which would mask the issue if not using a version of MQ that includes APAR IT26614, you can use the following settings:cf.SetIntProperty(XMSC.WMQ_CLIENT_RECONNECT_OPTIONS, XMSC.WMQ_CLIENT_RECONNECT);\ncf.SetIntProperty(XMSC.WMQ_CLIENT_RECONNECT_TIMEOUT, XMSC.WMQ_CLIENT_RECONNECT_TIMEOUT_DEFAULT);\n//Note that XMSC.WMQ_CLIENT_RECONNECT_TIMEOUT_DEFAULT is 1800Note even if you use a version of MQ with APAR IT26614, the above is a good practice as it will tell the Managed XMS.NET client to automatically attempt to reconnect to the queue manager forXMSC.WMQ_CLIENT_RECONNECT_TIMEOUTseconds if the connection is lost. Reconnect does not apply to the initial connection to the queue manager, it only applies after you are connected.\n"} +{"text": "### Human: Basically, I was given a task at work that involves using IBM MQ and C#, and while I am good with C#, I am a total newbie when it comes to Network programming and IBM MQ (As in I barely started using IBM MQ yesterday).Anyway, after reading through a lot of guides, and examples, and troubleshooting a lot of stuff I managed to make a C# solution that connects to a QueueManager, and successfully sends and reads messages. However, I only managed to do so by disabling the default Authorisation, and while that was good when all I needed to do was test my Adapter class, I now need to be able to specify an User Id and a Password, and eventually restore all the Authorisation settings I disabled.Here is the problem though, whenever I try to add the USER_ID_PROPERTY property to the connectionProperties Hashtable the QMQueueManager constructor returns a Null reference System Exception.Here is the code where I build the Hashtable;Hashtable connectionProperties = new Hashtable();\n\n // Add the connection type\n connectionProperties.Add(MQC.TRANSPORT_PROPERTY, connectionType);\n\n // Set up the rest of the connection properties, based on the connection type requested\n switch (connectionType) {\n\n case MQC.TRANSPORT_MQSERIES_BINDINGS: break;\n\n case MQC.TRANSPORT_MQSERIES_CLIENT:\n case MQC.TRANSPORT_MQSERIES_XACLIENT:\n case MQC.TRANSPORT_MQSERIES_MANAGED:\n //connectionProperties.Add(MQC.USER_ID_PROPERTY, \"newUser\");\n connectionProperties.Add(MQC.HOST_NAME_PROPERTY, hostName);\n connectionProperties.Add(MQC.PORT_PROPERTY, 1421);\n connectionProperties.Add(MQC.CHANNEL_PROPERTY, channel);\n connectionProperties.Add(MQC.CONNECTION_NAME_PROPERTY, connectionName);\n break;\n\n default:\n Console.WriteLine(connectionType + \" is not a valid connection type\");\n break;\n }\n\n return connectionProperties;If I run the code as is, everything works out fine, I get connected to the Queue, send, read, and disconnect without an issue, the moment I uncomment the Use ID line, I get a Null Reference System Exception on the following line;qmQueueManager = new MQQueueManager(qManager, connectionProperties);This is the exception message that pops up:A System error occurred: System.NullReferenceException: Object reference not set to object instance.\n At IBM.WMQ.MQQueueManager.Connect (String queueManagerName)\n At IBM.WMQ.MQQueueManager..ctor (String queueManagerName, Hashtable properties)\n At MQNetworkClient.MQManager.ConnectMQ (String details) Location C: \\ Users \\ A440 \\ Documents \\ Visual Studio 2017 \\ Projects \\ MQNetworkClient \\ MQNetworkClient \\ MQManager.cs: Line 124\n At MQNetworkClient.MQManager.TryMQAction (MQSanityCheck sanityCheck, MQActionHandler mqAction, String details, String sanityFailMessage) Location C: \\ Users \\ A440 \\ Documents \\ Visual Studio 2017 \\ Projects \\ MQNetworkClient \\ MQNetworkClient \\ MQManager.cs: Line 95The error message doesn't give me much to go on, and while I checked the QueueManager's AMQError Logs but nothing gets written there.I would really appreciate any solution, work-around, or any help tracing the issue, basically, I would grateful to get any kind of advice that could potentially point me towards the right direction here.In case it is somehow relevant, I am usingIBM MQ v9, and Visual Studio 2017.Thank you.### Assistant: This is a product defect (I've also raised it as such). Basically if you provide a userid you MUST provide a password as the code dereferences the password field without first checking it is supplied... Sorry!\n"} +{"text": "### Human: I am new toIBM WebSphere MQ. I am running it within adockercontainer. The user 'sampleuser' and 'root' are part of the 'mqm' group within the conatiner. I am able to access the MQ from the host as a 'root' user and as a 'sampleuser' (I created 'sampleuser' in the host aswell).I want to enable anonymous authentication, so that irrrespective of the client user id, they should be able to access the MQ. I thoughMCAUSER('sampleuser')would do it for me. But it does't work. I get error AMQ4036 (not authorized) from the eclipse IBM explorer. Please advice.ALTER QMGR PSNPRES(SAFE)\nALTER QMGR PSMODE (ENABLED)\nDEFINE CHANNEL(SYSTEM.ADMIN.SVRCONN) CHLTYPE(SVRCONN) MCAUSER('sampleuser') REPLACEUpdate #1I updated the code to allow privileged user. But still fails.ALTER QMGR PSNPRES(SAFE)\nALTER QMGR PSMODE (ENABLED)\n\nSET CHLAUTH(*) TYPE(BLOCKUSER) USERLIST('*NOACCESS')\n\nDEFINE CHANNEL(SYSTEM.ADMIN.SVRCONN) CHLTYPE(SVRCONN) MCAUSER('sampleuser') REPLACEHere is the log, that I have got.EXPLANATION:\nThe user ID 'sampleuser' and its password were checked because the user ID is\nprivileged and the queue manager connection authority (CONNAUTH) configuration\nrefers to an authentication information (AUTHINFO) object named\n'SYSTEM.DEFAULT.AUTHINFO.IDPWOS' with CHCKCLNT(REQDADM). \n\nThis message accompanies a previous error to clarify the reason for the user ID\nand password check.\nACTION:\nRefer to the previous error for more information. \n\nEnsure that a password is specified by the client application and that the\npassword is correct for the user ID. The authentication configuration of the\nqueue manager connection determines the user ID repository. For example, the\nlocal operating system user database or an LDAP server. \n\nTo avoid the authentication check, you can either use an unprivileged user ID\nor amend the authentication configuration of the queue manager. You can amend\nthe CHCKCLNT attribute in the CHLAUTH record, but you should generally not\nallow unauthenticated remote access.Update #2Based on JohnMC's answer and refernce toProvide anonymous access to IBM WebSphere MQI finally made it work.. : )ALTER QMGR PSNPRES(SAFE)\nALTER QMGR PSMODE (ENABLED)\nALTER QMGR CHLAUTH(DISABLED)\nSET CHLAUTH(*) TYPE(BLOCKUSER) USERLIST('*NOACCESS')\nDEFINE CHANNEL(SYSTEM.ADMIN.SVRCONN) CHLTYPE(SVRCONN) MCAUSER('sampleuser') REPLACE\nALTER AUTHINFO(SYSTEM.DEFAULT.AUTHINFO.IDPWOS) AUTHTYPE(IDPWOS) CHCKCLNT(OPTIONAL)\nREFRESH SECURITY TYPE(CONNAUTH)### Assistant: I will assume you are using a supported version of MQ (7.1 or later).With MQ 7.1 and later a new queue manager by default will come with a few CHLAUTH rules, one of these disables connections to SVRCONN channels from users with MQ administrative authority. In this case you have placed the usersampleuserin theMCAUSERof the channel. Sincesampleuseris a member of the mqm group it is disallowed by default.Based on the setup you present if the connection was allowed you would be allowing any user that can connect over the network to your MQ listener port the ability to manage the queue manager, define queues, delete queues, add permissions, etc.Look at this answer by T.Rob for some more detail on how to make this work without disabling security \"Unable to connect to queue manager in WebSphere MQ 7.1\".I also have another post with some similar information \"C# MQ Connect get Error 2035 but Java MQ Connect works well\"Update #1The logs show that you are getting a connection authentication error. With MQ 8.0 and later by default the queue manager is configured to require a valid password be specified for MQ Administrative users, sincesampleuseris part of the mqm group it falls into this category.You can configure MQ Explorer to send a username and password when connecting to the queue manager.Right click the queue manager nameSelect Connection DetailsSelect Properties...Select UseridCheck the box next to \"Enable user identification\"Fill in the Userid fieldIf you leave it as \"Prompt for password\" it will ask you each time you open MQ Explorer for the password when you attempt to connect to the queue manager. You have the option of selecting \"Use saved password\" and then providing the password.I do not recommend you do this, but if you want to disable security and allow anyone to connect as a MQ administrator to your queue manager with out providing a valid password you can disable this with the following command.ALTER AUTHINFO(SYSTEM.DEFAULT.AUTHINFO.IDPWOS) AUTHTYPE(IDPWOS) CHCKCLNT(OPTIONAL)\nREFRESH SECURITY TYPE(CONNAUTH)\n"} +{"text": "### Human: As per our configuration, we have WAS version is 8.5.5.1, IBM MQ version 7.5.0.3. We are using 2 channels to connect to WMQ, one with MAXINST set to 250 and one with 500. SHARECNV is set to 10 for both. Now we have an upper limit of making maximum 1600 connections in a queue manager but we end up crossing that limit after 3-4 days of continuous running of WAS Server.I want to understand how parameters on WAS side affect this count. We are using Queue Connection Factory and Act Spec for making the connections and we have 23 of each of them. Out of these for 22 the settings in Act Spec and QCF are kept default like max server sessions=10, max connection in connection pool=10, max sessions in session pool set to 10. This services have quite low tps of around 15-20 request per minute. All 22 of them use same channel to connect to queue manager with MAXINST set to 250. 1 gets quite high load with peak of 80 requests per second(aprox 40 per server) for which max server sessions=40, max connection in connection pool=40, max sessions in session pool is set to 10.Connection Timeout, Reap Time, Unused Timeout and Aged timeout values are kept default for all.With these settings we end up making around 1200 connection on the channel used by 22 services and around 500 for the other channel after 2-3 days of continuous running. These build up over a period of time.\nNow I want to tune these settings so that we don't end up crossing the connection count limit and also don't end up having no connections available.\nSo I have a few questions:What is a better option from performance point of view- reducing max connections in connection pool or max sessions in sessions pool. What should be the ideal values for the load mentioned earlier.What should be the ideal value for Unused Timeout for Connection Pool and Session Pool which is set to 30 mins by default. If we reduce it to say 5 mins, what implications could it have on performance of failure to get the connections.Is there some setting that can be done at WMQ side so that the idle/unused connections are closed or this can happen only from the client side.DISCINT parameter value is set to zero and HBINT to 300. What should be the ideal value.I ran below command to view the connectionsecho \"DIS CONN(*) TYPE(*) CONNAME CHANNEL OBJNAME OBJTYPE\" | mqsc -e -m QM-p width=1000 | grep -o '^\\w\\+:\\|\\w\\+[(][^)]\\+[)]' | awk -F '[()]' -v OFS=\",\" 'function printValues() { if (\"CHANNEL\" in p) { print p[\"CHANNEL\"], p[\"CURSHCNV\"], p[\"CONNAME\"],p[\"CHSTADA\"],p[\"CHSTATI\"],p[\"LSTMSGDA\"],p[\"LSTMSGTI\"],p[\"OBJNAME\"],p[\"OBJTYPE\"],p[\"ASTATE\"] } } /^\\w+:/ { printValues(); delete p; next } { p[$1] = $2 } END { printValues() }' | grep MYCHANNEL\n\nMYCHANNEL,,10.215.161.65,,,,,,,NONE\nMYCHANNEL,,10.215.161.65,,,,,,,SUSPENDED\n MYCHANNEL,,10.215.161.65,,,,,MYQUEUE01,QUEUE,ACTIVEI can see a lot of connection in None and suspended state which do not have any OBJNAME or OBJTYPE associated.\nI have tried simulating the issue in Test and same thing happens and these connections keeps on increasing as we keep in hitting requests. Can someone tell me why these connections are getting created. Also it looks like these connections will never be used by the application.This is how connection are made and closed in the application:\nWe have an abstrack bean class which is extended by all MDB's@MessageDriven(activationConfig = {\n @ActivationConfigProperty(propertyName = \"acknowledgeMode\", propertyValue = \"Auto-acknowledge\"),\n @ActivationConfigProperty(propertyName = \"destinationType\", propertyValue = \"javax.jms.Queue\") })\npublic class TrackBeanV2 extends AbstractServiceBean implements MessageListener {//code}The abstrack bean handles creation and closing of connections in following manner:public abstract class AbstractServiceBean {\n\n@Resource(name = \"myQCF\", type = QueueConnectionFactory.class, shareable = true, description = \"Reply Connection Factory\")\nprivate ConnectionFactory replyCF; \n\n@PostConstruct\nprivate void postConstruct() {\n replyConnection = replyCF.createConnection();\n\n } catch (JMSException e) {\n throw new RuntimeException(\"Failed to create JMS Connection\");\n }\n\n}\n@PreDestroy\nprivate void preDestroy() {\n try {\n replyConnection.close();\n } catch (JMSException e) {\n throw new RuntimeException(\"Failed to close JMS connection\", e);\n }\n}\n\nprivate void sendResponseMessage(String outputMessageText, String jmsMessageID , Destination replyDestination) {\n TextMessage replyMessage = null;\n try { \n createSession(); \n createProducer();\n replyMessage = createReplyMessage(outputMessageText , jmsMessageID); \n sendReply(replyMessage, replyDestination); \n closeProducer();\n closeSession();\n } catch (JMSException exp) {\n handleException(exp);\n }\n}\nprivate void createSession() throws JMSException{\n replySession = replyConnection.createSession(true, 0); \n}`\nprivate void createProducer() throws JMSException{ \n replyProducer = replySession.createProducer(null); \n}\n\nprivate void closeSession() throws JMSException {\n if (replySession != null) {\n replySession.close();\n }\n}\n\nprivate void closeProducer() throws JMSException{\n if (replyProducer != null) { \n replyProducer.close(); \n }\n} \nprivate void sendReply(TextMessage replyMessage, Destination replyDestination) throws JMSException { \n logMessages(replyMessage.getText(), \"RESPONSE MESSAGE\");\n replyProducer.send(replyDestination, replyMessage);\n}I have not added other methods of the class which marshalling/unmarshalling and other stuff.### Assistant: After doing lot more analysis and trying out different WAS and MQ settings, we ruled out any issue with configuration and code. While researching found following linkhttp://www-01.ibm.com/support/docview.wss?uid=swg21605479. The issue was with Wily Introscope tool used to monitor the WAS server, it was making connections with MQ and not releasing them. We removed the monitoring from the Server and it is working fine since then. Thanks everyone here for their support.\n"} +{"text": "### Human: Where can I find the differences between the IBM MQ versions V8.0.0.5 and V9.0? I tried to look it up on IBM website but no luck.### Assistant: IBM's v9 Knowledge center page \"What's new in Version 9.0.0\" lists new things in v9.0.New family features\n are:Additional quality of protection for IBM MQ AMSWeb addressable access to the client channel definition table (CCDT)IBM MQ AMS supported in non-IBM JREs in Java clientsUpdated Resource Adapter for traditional WebSphere Application ServerEnhanced Unicode data conversion supportIBM MQ Managed File Transfer Protocol Bridge Agent logging enhancementsNew features for distributed platforms\n are:Performance monitoring API and enhanced activity trace available through publish/subscribe[Windows] LDAP authorization on Windows platforms[UNIX] runmqsc command line editor for UNIX platformsNew z/OS\u00ae features\n are:Data manager page set statisticsJMS support within CICS OSGI ServerJMS support within IMS ServerImproved control of messages by using message expiryIncreased number of active logsUsing IBM z/OSMF to automate IBM MQIBM's v9 Knowledge center page \"What's changed in Version 9.0.0\" lists what has changed.[V9.0.0.0]Changes to supported platformsFor IBM MQ Version 9.0, some changes are made to the platforms that\n are supported.[V9.0.0.0]Changes to commandsA number of commands have changed at IBM MQ Version 9.0[V9.0.0.0]Command level changes for Version 9.0The command level changes to 900 at IBM MQ Version 9.0[V9.0.0.0]Deprecated, stabilized and removed featuresA number of features are deprecated, stabilized or removed from IBM MQ\n Version 9.0.[z/OS][V9.0.0.0]z/OS: Prerequisites for Version 9.0Some prerequisites have changed for Version 9.0.[z/OS][V9.0.0.0]z/OS: Changes to OPMODEIn previous versions of IBM MQ, if a queue manager was started with\n OPMODE=(COMPAT,vrm), new functions added at command level vrm would\n always be available. In IBM MQ Version 9.0 this is no longer the case.\n"} +{"text": "### Human: I am running into an error when trying to download IBM Websphere MQ Explorer with the Eclipse Marketplace. The error reads:\n \"An error occurred while installing the items\n session context was:(profile=DefaultProfile, phase=org.eclipse.equinox.internal.p2.engine.phases.Install, operand=null -->[R]com.ibm.mq.explorer.doc 8.0.0.201506171824, action=).\n Failed to prepare partial IU: [R]com.ibm.mq.explorer.doc 8.0.0.201506171824.\"### Assistant: I haven't seen this error before and I don't normally dig into the guts of Eclipse so I do not have a good feel for what might be going wrong. But after some searching, I see this seems to be a fairly common error and I found a forum thread with a workaround. The solution has a lot of confirmation messages following it from people with a wide variety of modules who were able to complete their installs. Perhaps it will work for you.I'll quote the relevant bits and providethis linkto the source thread.So, go to Help -> Install New Software..., choose \"The Eclipse Project\n Updates -http://download.eclipse.org/eclipse/updates/4.4\" from the\n \"Work with\" list and then in the \"Eclipse Tests, Examples, and Extras\"\n category check \"Eclipse 2.0 Style Plugin Support\" and install it.\n After restarting Eclipse, install veloeclipse again and this time the\n installation will succeed.\n"} +{"text": "### Human: I am using circular logging. Because of human intervention, one of the\nqueue files is corrupted.Since the circular logging is not having the ability of recovering the \ncorrupted queue files, what will be the next steps it will take?Will queue manager create an empty queue file for that queue and start\nenrolling the messages to it? Else, it will just show the pending\nmessages in the queue but not allow the applications to process?### Assistant: As you correctly note, MQ cannot recover from a damaged queue file when it is configured for circular logging.Will queue manager create an empty queue file for that queue and start enrolling the messages to it? Else, it will just show the pending messages in the queue but not allow the applications to process?None of the above. The queue manager will return an error to any process attempting to access that queue.When a queue file is damaged, it may or may not have had messages in it. There is no automatic recovery possible that would correctly reconcile the state of any messages that may have been enqueued, therefore no further processing is done on that queue and any access returns an error. Human intervention is required in that case and the fix is to delete and redefine the queue usingrunmqsc.If additional queue recovery is required to make sure messages are not lost in such cases, linear logging is mandatory.\n"} +{"text": "### Human: My node.js code does this :var MyMQ = require( './build/release/mqconn' ) ;\nvar MyQmgrName = 'QM_CNT' ; // req.params.qmgrname ; \nMyMQ.connect ( MyQmgrName, function ( err, result ) {And my C++ code (uning nan) wants to receive the first string parameter :NAN_METHOD( MQ_Connect ) {\n\n NanScope();\n Local szQMN( args[ 0 ] );\n printf( \"(cc)>>>> qmn [%s].\\n\", szQMN ) ;... but what I get is garbage.Any clue on what am I doing wrong ?\nSebastian.### Assistant: First you should generally validate your arguments. Then you can get a string by callingToString()on the argument. For example:NAN_METHOD(MQ_Connect) {\n NanScope();\n\n if (args.Length() > 0) {\n if (args[0]->IsString()) {\n String::Utf8Value str(args[0]->ToString());\n printf(\"(cc)>>>> qmn [%s].\\n\", (const char*)(*str));\n }\n }\n"} +{"text": "### Human: I have a problem on getting message id and set it on reply's correlation id.Here's the piece of code:MQBYTE msgID;\n\nrequest_msg.messageId().copyOut(msgID, MQ_MSG_ID_LENGTH, 0);\nresponse_msg.setCorrelationId(msgID);when I checked the correlation Id of the reply, the correlation id is 0.How can I copy/get the messageId of the request and put it on the correlation id of the reply?Thanks in advance. :)### Assistant: The Infocenter pageManipulating binary strings in C++shows the data types involved asImqBinaryandMQBYTE24. As Shashi notes in the comments,MQBYTEis a single byte and incapable of containing a 24-byte message ID. The page linked above provides a reference example:#include // C++ classes\n\nImqMessage message ;\nImqBinary id, correlationId ;\nMQBYTE24 byteId ;\n\ncorrelationId.set( byteId, sizeof( byteId ) ); // Set.\nid = message.id( ); // Assign.\nif ( correlationId == id ) { // Compare.\n ...One tool to diagnose issues like this is the very usefulSupportPac MA0Wwhich is an API exit. It can show you the exact contents of the structures passed to MQ before and after an API call. Very often what is seen is that what is expected (in this case having copied theMQMD.MsgIDto theMQMD.CorrelIDis not what actually happened. In this case, I believe a trace such as that provided by MA0W would reveal that themsgIDwas accurately passed from the app to MQ but consisted of only one character.UPDATEOP asks:Variableidis anImqBinaryandmessageis anImqMessageobject, from what I knowidis not a member ofImqMessagelikemessageId,correlationId,groupIdand etc. so how canmessage.id()passed it's value onid?You are coorrect thatidis a declared variable of typeImqBinaryand not a member of theImqMessageclass. Please see the Infocenter page for theImqBinary C++ classwhich explains that:This class encapsulates a binary byte array that can be used for\n ImqMessage accounting token, correlation id, and message id values. It\n allows easy assignment, copying, and comparison.The intent of theImqBinaryclass is to provide a variable type to encapsulate a byte array with overloaded methods such that \"normal\" variable manipulations work as expected. Rather than copying the byte array one byte at a time, it can be anLVALorRVALin an assignment. Rather than comparing the array a byte at a time, you can just use comparison operators like==.So if your code were modified to use the example, it might look like this:#include // C++ classes\n\nImqMessage request_msg, response_msg ;\nImqBinary id ;\n\nid = request_msg.id( );\nresponse_msg.setCorrelationId(id);That said, I'm not sure you even need an intermediate variable. You might be able to assign the correlation ID using the output of the getter call for the message ID from the source message. Something like....response_msg.setCorrelationId( request_msg.id( ) );...might do it. I don't code C or C++ anymore so I probably got the syntax wrong or didn't do it as elegantly as it might be coded, but you should get the idea.\n"} +{"text": "### Human: I want to run a test command on MQ Server Windows Machine remotely. In order to do that, I useSupportPac MO72and I can successfully connect remotely to MQ Server with Administrator ID. Now I have MQSC console available and I want to run some OS command with creatingSERVICEobject. I defined my service as:DEFINE SERVICE('myService') STARTCMD('C:\\Windows\\System32\\PING.EXE 127.0.0.1') SERVTYPE(SERVER) CONTROL(MANUAL)The service was created successfully and now I want to start this service, so I typed:START SERVICE(myService)But I got this error:AMQ8734- Command failed - Program could not be startedAny idea?### Assistant: There's a combination of things wrong...YourSERVTYPE(SERVER)is for something which starts running and stays running (and hence whose health is monitored).SERVTYPE(COMMAND)is for something you run and ends. Only aSERVTYPE(SERVER)can be monitored for health but it ought to be long running.Yourstartcmdneeds to be a binary to launch - just the binary. TheSTARTARGSneed to hold the arguments to the command.DEFINE SERVICE('myService') + \n STARTCMD('C:\\Windows\\System32\\PING.EXE') + \n STARTARG('127.0.0.1') + \n SERVTYPE(COMMAND) + \n CONTROL(MANUAL)Of course, you might like to see its output - look at the args likeSTDOUTandSTDERRto capture output into a file.If you want the output to come back to your remote client in a queue it gets a bit more complicated. You would have to capture the output and pipe it throughamqsputor some other program to get it onto a queue, then retrieve it. The queue cannot be the same reply queue you are using with MO72 because MO72 would choke on the text, so you would have to useamqsgetcor some other program to fetch the output from the queue.\n"} +{"text": "### Human: My current setup consists of one queue, the InQueue, called \"QONE\". QONE then has 6 other queues that it sends messages to. Each of these subsequent queues has a selector on it which accepts messages based on a regular expression.There is a situation where I want to ignore a message completely. Meaning, when QONE gets a message matching a specific pattern, do not send the message down to any other queue. Instead we want to disregard the message.Can I put a selector on QONE which will serve to filter out the unwanted messages? For example, if the unwanted message is sent to QONE it will know not to send it down to any subsequent queues based on the selector's pattern.I want to avoid adding to the selectors of the subsequent queues, though I know this is an option. I'd rather remove the message at the root rather then the downstream queues. Thank you.### Assistant: The most efficient way of implementing this would be to ensure the application on QONE, which forwards the messages on to the other six queues, reads all the messages and by looking at each message, either forwards it, or does whatever should happen to these messages you want to ignore (are you planning to simply discard them, or place them on a side queue out of the way?). If the application on QONE correctly only forwards the required messages, then no selectors are required on the downstream queues.\n"} +{"text": "### Human: I want to check if anychlauthmethod is deployed for a channel or not in my MQ. So I run this command:dis chlauth(MY.CHANNEL.NAME)But I've got this message:AMQ8884: Channel authentication record not found.So, does it mean that I run a wrong command or it means that this channel has no channel authentication mechanism?### Assistant: SinceCHLAUTHrules can be put in place either with fully spelled out channel names, or with wild carded profiles, there are a few different ways to display theCHLAUTHrules in the system.In this case the best way to determine whether there is a rule that will apply to your channel when it runs is to use the following command:DISPLAY CHLAUTH(MY.CHANNEL.NAME) +\n MATCH(RUNCHECK) +\n ADDRESS(IP-address) +\n CLNTUSER(client-side-UserID)You can read more about this approach inI'm being blocked by CHLAUTH - how can I work out why?\n"} +{"text": "### Human: I want to check all the authorities and access levels of queues and channels in my MQ-manager and check if there is a client queue or channel with administrative access. In order to do that I used./dmpmqautcommand and I successfully dumped all the objects' authorities. However, I have two problems here:1- There are a lot of objects in my Q-manager which has the entity ofmqmand their authority is set to:almqi dlt chg dsp clr. So is this normal? I mean all I know is that the clients should not havemqmentity name and the authorities are not restricted at all here. Am I right?2- I want to check all the channels and queuesMCAUSERlike what I can see in MQ-Explorer on windows. Is there any way that I can check it in Linux machine?### Assistant: Whenever an MQ object is created, the user who created it (or that user's primary group in non-Windows Distributed platforms) is granted all rights to the object. In practice, this usually means that the mqm group is visible on every object when you do an auths dump. On windows, this is oftenadminID@domainin addition to mqm.On Linux you can do...echo \"dis chl(*) mcauser | runmqsc [qmgrname]...from the command line to see what the MCAUSER is on the channels. You can also see this using MQ Explorer.The defined MCAUSER for all inbound channels should be one that blocks all access. I used to recommendnobodybut since this is potentially a valid ID on some systems, I now recommend*nobody. Note that by \"inbound channels\" I mean those of typeRCVR,RQSTR,CLUSRCVR, andSVRCONN. By \"all\" I mean channels namedSYSTEM.AUTO.*,SYSTEM.DEF.*, and any that you define yourself.Make sure that an exit or aCHLAUTHrule maps the MCAUSER to the expected value when the connection request is authenticated. TheCHLAUTHrules are available on any version of MQ from 7.1 on up. This mapping ensures that only an authenticated user or partner QMgr can connect.If authorizations (setmqautorSET AUTHRECcommands) are defined without also defining theCHLAUTHrules or setting up a security exit, the effect isworsesecurity, not better. The reason being that legitimate users willappearto have restrictions placed on their connection but malicious users will be able to easily spoof an administrative user ID.Please see the basic MQ Security Hardening slides athttp://t-rob./net/linksfor more on this topic.\n"} +{"text": "### Human: I'm trying to write a simple test case to pull messages from a queue based on a message property, hitting a 7.5.0.3 QMgr and using the 7.5.0.3 client jars.Everything I have seen online says that I need to specify the message selector when I open the queue. I'm fine with that, but I only see two ways to open it:MQQueueManager.accessQueue(\n String queueName, \n int openOptions);\n\nMQQueueManager.accessQueue(\n String queueName, \n int openOptions, \n String queueMgr, \n String dynamicQueueName, \n String altUserId);Neither of these allow me to specify a message selector. I'm running this from a command line batch application, not in an app server, so using JMS selectors is not possible.Here is the IBM documentation on selectors:WebSphere MQ Message Selectorswhich shows that selection must happen as part of the MQOPEN call.### Assistant: MQ JMS API provides the type of message selection syntax you are looking for. The base MQ Java API provides message selection based on MessageId and CorrelationId and it does not yet provide type selection syntax you are looking for. The documentation link you provided is for MQ C API.Using MQ JMS API, message selection can be done as shown here:// Create JMS objects\n connection = cf.createConnection();\n session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);\n\n // Create queue destination \n Destination queDest= session.createQueue(que);\n\n // Create consumer with selector\n String selector = \"category='bucket1'\"; \n MessageConsumer cons= session.createConsumer(queDest, selector);\n\n connection.start();\n // receive messages\n Message inMessage = cons.receive(5000);\n"} +{"text": "### Human: I need to change theCONNAME('xx.xx.xxx.xx(1414)toCONNAME('yy.yy.yyy.yy(1414)for IBM MQ. I searched through the internet I did not found any command. My object definition code is given below.DEFINE CHANNEL(CHANNELNAME) +\n CHLTYPE(SDR) +\n TRPTYPE(TCP) +\n MAXMSGL(30000000) +\n DESCR('Channel to REPLY TO sender') +\n XMITQ('Sender.XMITQ') +\n CONNAME('xx.xx.xxx.xx(1414)') +\n BATCHSZ(50) +\n DISCINT(6000) +\n SHORTRTY(10) +\n SHORTTMR(60) +\n LONGRTY(999999999) +\n KAINT(AUTO) +\n LONGTMR(1200) +\n SEQWRAP(999999999) +\n CONVERT(YES) +\n MCATYPE(PROCESS) +\n HBINT(300) +\n BATCHINT(0) +\n NPMSPEED(FAST)Can I use theALTERcommand? if I delete the channel and redefine it will it cause any problem to existing channels and queues?### Assistant: You can use theALTER CHANNELcommand like this:-ALTER CHANNEL(CHANNELNAME) CHLTYPE(SDR) CONNAME('yy.yy.yyy.yy(1414)')You only need to supply the attributes that you need to change, plus always theCHLTYPE.You don't need toDELETEand re-DEFINEthe channel object, and doing so would cause the run-time state such as channel sequence numbers to get out of step.Additional ReadingALTER CHANNEL reference documentation\n"} +{"text": "### Human: I'm using Spring's JMS (v. 3.1.2)listener-containerwith a JMS connectionFactory coming from WebSphere 7's JNDI settings. The application processes messages (put/get) correctly, but thebackoutsettings set in the MQ Queue Manager don't seem to work.To fail a message consumption, I use spring transactions with asetRollbackOnly(), and it does increase the property \"Backout count\" as I can see that number increasing with the \"WebSphere MQ Explorer\" pointed to the remote queue.Reading through a few IBM docs, it describes that the IBM MQ JMSclientneeds to move the bad message to the backout queue. Spring'slistener-containerdoesn't seem to be using the MQ client in a way that enables that behaviour. The backout count just keeps increasing, as if the requeue command wasn't working.Is Spring JMS able to use that functionality? Is there anything that needs to be set in thelistener-containerfor it to be able to process the move to IBM MQ backout queues?My configuration is as follows:\n\n\n \n \n \nThe IBM MQ queue is set up with \"Backout Requeue Queue\" set toONEQUEUE.BOQ, and \"Backout Threshold\" to5.My Spring message driven POJO java code is as follows:@Transactional\npublic class MyQueueMDBean implements javax.jms.MessageListener {\n public void onMessage(javax.jms.Message msg) {\n try {\n // some code that throws some exception ...\n } catch (Exception e) {\n TransactionInterceptor.currentTransactionStatus().setRollbackOnly(); \n }\n }\n}The Stacktrace ERRORAfter the message has been rolled back 5 times, the listener starts failing to connect, as output to the logs:[org.springframework.jms.listener.DefaultMessageListenerContainer#3-14870] WARN org.springframework.jms.listener.DefaultMessageListenerContainer - Setup of JMS message listener invoker failed for destination 'ONEQUEUE' - trying to recover. Cause: MQJMS1079: Unable to write message to dead letter queue.; nested exception is com.ibm.mq.MQException: MQJE001:Completion Code '2', Reason '2035'.It looks like something is going on with the permission to backout the message, or the actual backout queue is not being retrieved correctly, which was unexpected since the get/puts were working OK. Still looking for an answer whether this is a valid approach though.### Assistant: JMS Client will put poison messages to the backout queue defined on the queue's BackoutRequeueQueue (BOQNAME) after the number of roll backs exceeds that defined in the BackoutThreshold (BOTHRESH). This means that the user running the JMS application not only needs access to the application queue, it also needs access to put to the named backout queue too.If the backout queue cannot be accessed or is not defined, the queue manager's dead letter queue (DEADQ attribute) will attempt to be used.Failure to grant the user ID+putaccess to the backout queue and/or the DLQ will result in a MQRC_NOT_AUTHORIZED (2035) reason code when a poison message meets the criteria to be requeued to the backout queue.The 2035 will be reported by the JMS exceptions, and the exact missing authorities on the exact queue name for the exact user ID will be reported in the queue manager error log.Related ReadingHandling poison messages in WebSphere MQ classes for JMS\n"} +{"text": "### Human: I have an application that I'd like to consume messages from queue A, but if queue A is empty, I'd like it to consume messages from queue B instead of sitting idle. I only ever want it to process 1 message at a time, and if the consumer is busy processing a message (from either queue), other pending messages (on either queue) should remain on their queue until the consumer is idle again (this gives other consumers a chance to process the new message).So, for example, if a message arrives on either queue A or queue B while the consumer is idle (waiting), then the consumer picks it up. If a message arrives on either queue while the consumer is currently processing a message, nothing happens until the consumer has finished processing the current message. And if a message is available on both queue A and queue B, the consumer prefers to pick the message from queue A.Edit: actually I'd be equally happy to be informed that messages are available to consume on both A & B, and implement my own logic to choose which one I actually want to pull from the queue.Subscribing to both queues at once in separate threads doesn't appear to work because:if a messageMarrives on queue A, the consumer will have to unsubscribe from queue B while it's processing messageM, then resubscribe once messageMis handled. Otherwise, \nif a message arrives on queue B, it might get picked up and dispatched simultaneously - I don't want to handle more than one message at a time.if a message arrives on both queues at once (or a message is already available on both queues when the consumer starts up or finishes processing the previous message), then it's possible that both messages will be picked up before the consumer has the chance to unsubscribe from queue B. If this happens I'd have to roll one of the messages back, but if this happens frequently the message will exceed the rollback count and get moved to a failure queue.Ideally I'd like to generalise this to the N queues case. I'm interested in solutions that ideally work via JMS, but if I have to use the IBM MQ-specific API to do this that's OK too. Is there a usage pattern, or library, that will help achieve this? Are there alternative queueing approaches/techniques/technologies that allow it?Pulling all messages off all queues and putting them onto a single queue is a no-go; we need to be able to clear individual queues independently, and different consumers may subscribe to different subsets of the N queues.### Assistant: I don't know if this will be a big change for your code, but have you thought of adding Spring Framework and especially Spring Integration in your project? Such issues as you describe are already handled there.This problem would be solved with two endpoints with event driven consumers on the two queues and a single thread pool.http://www.eaipatterns.com/EventDrivenConsumer.htmlhttp://en.wikipedia.org/wiki/Thread_pool_pattern[Edit]If you want the message to stay in the Queue until the thread is released you can follow the pattern of polling consumerhttp://www.eaipatterns.com/PollingConsumer.htmlwhich can chose as you wish from which queue to request a message first. Keep in mind that with this technique if your system processes messages faster than they arrive, you will experience some redundant polls to the queues.\n"} +{"text": "### Human: This code sends the message to Q. MQEnvironment static values are set . But MQEnvironment isnot referencedanywhere in the manager. Then how the properties (hostname, channel,port,CCSID) are provided to connect to MQ?MQEnvironment.hostname =\"10.XX.XXX.XX\";\n\n MQEnvironment.channel = \"SYSTEM.DEF.SVRCONN\";\n\n MQEnvironment.port = 1415;\n\n MQEnvironment.CCSID = 819;\n\n System.out.println(\"connecting MQQueueManager...\");\n try {\n MQQueueManager manager = new MQQueueManager(\"SXX\");\n\n MQQueue queue = null;\n\n int openOptions = MQC.MQOO_OUTPUT; //MQC.MQOO_INPUT_AS_Q_DEF |\n\n queue = manager.accessQueue(\"Q_NAME\",\n openOptions,\n null, null, null);\n // send message\n MQMessage sendMessage = new MQMessage();\n\n sendMessage.writeObject(\"TEST MESSAGE@@@@@@@@@@@@@@@@@\");\n MQPutMessageOptions pmo = new MQPutMessageOptions();\n\n queue.put(sendMessage, pmo);### Assistant: The MQQueueManager object checks to see if those values have been set in the MQEnvironment class before it makes a connection to the queue manager.Also, do NOT use the SYSTEM.DEF.SVRCONN channel as (1) it is against best practices and (2) it is a SYSTEM object that is ONLY to be used by the queue manager. Simply create or have the MQAdmin create a SVRCONN channel for you. i.e. TEST.CHL\n"} +{"text": "### Human: I'm in the process of converting a manual server provisioning process into a Ansible playbook. Part of the process involves installing WebSphere MQ client. One step involves manually running a script,mqlicense.sh, and accepting a licensing agreement in response to a prompt. How can I accomplish this in Ansible?If I run the script, the ansible process hangs. If I skip that step, I get the following error:ERROR: Product cannot be installed until the license\n agreement has been accepted.\n Run the 'mqlicense' script, which is in the root\n directory of the install media, or see the\n Quick Beginnings book for more information.UpdateFurther Googling brought me tothis ibm.com page, where it states:If want to accept the license without it being displayed, you can run\n the mqlicense.sh script with the -accept option../mqlicense.sh -acceptHowever, that does not seem to work in my case. When I run that command from the command line, the interactive prompt still comes up.### Assistant: The issue turned out to be with the mqlicense.sh script. Apparently, it uses some syntax incompatible with bash. So when I ran it on my Debian server, the script complained:./mqlicense.sh: 99: ./mqlicense.sh: [[: not foundThe solution, alluded to inthis ibm.com forum thread, was to install the korn shell (ksh), and use that to accept the license. The following tasks were included in my playbook:Includekshwith system packages:- name: Install debian packages\n apt: pkg=${item} state=installed\n with_items:\n - alien\n - kshCall the script usingksh:# Need to run this with ksh; script syntax is not bash-compliant\n- name: Accept MQ Client license\n command: ksh mqlicense.sh -accept chdir=${vsphere_wd}Ansible playbook can be found here:https://gist.github.com/klenwell/cdf2dc92ddfe2e7e18fc\n"} +{"text": "### Human: In trying to connect from an MQSeries 7.5 client to a 7.5 local server I'm getting a CSIException: JMSCS0002 which when I look up the error in the IBM codes says:JMSCS0002 \nThe call could not be completed because CommonServices has not been initialized.CommonServices is an internal component and needs to be initialized at startup but has failed.Check that the installation and classpath setup is correct.But both my compile and run classpaths include com.ibm.mq.commonservices.jar, com.ibm.msg.client.commonservices.jar, and com.ibm.msg.client.commonservices.j2se.jarI'm was using Oracle JDK 1.6. I tried using the WS MQ java but it made no difference.Any help appreciated. Thanks.Caused by: com.ibm.msg.client.commonservices.CSIException: JMSCS0002\nat com.ibm.msg.client.commonservices.workqueue.PIWorkQueueManager.enqueueItem(PIWorkQueueManager.java:67)\nat com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.enqueue(WorkQueueManager.java:225)\nat com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.enqueue(WorkQueueManager.java:194)\nat com.ibm.msg.client.wmq.common.internal.WMQThreadPool.enqueue(WMQThreadPool.java:91)### Assistant: I had been using jar files from an uninstalled MQSeries 7.5 Client because I wanted to make sure that the functionality I was using would work just with the jars provided by the free client license. According to IBM documentation taking uninstalled jars is problematic.When I switched to the jars from the installed server trial then things works ok.\n"} +{"text": "### Human: One of the vendors that we trade MQ data with has a monitor that shows the following:I've written a C# monitor of my own that takes a snap shot of the queue depth every x minutes, but I would like to know how to get the number of message enqueued and dequeued. These two stats seem to me to be of a different nature. To me queue depth is at a given point in time. The report above is actually showing \"High Q Depth\" for a 5 minute time period.Can someone point me to something in the C#/.NET MQ API guide on how these statistics can be gathered? If not, what trick or tool might be able to get these stats?### Assistant: MQ .NET has undocumented \"support\" for PCF underIBM.WMQ.PCFnamespace. There are classes likePCFAgent, PCFMessageand so on. These can be used to read PCF messages.For statics monitoring, you can turn on \"Queue Statics\" on queue. As describedherequeue statics messages include information like number of messages put or retrieved from a queue.Sample code: This code inquires a queue manager for a queue with name Q1.public void InquireQmgr()\n {\n try\n {\n PCFMessageAgent messageAgent = new PCFMessageAgent(\"QM\");\n\n PCFMessage pcfMsg = new PCFMessage(MQC.MQCMD_INQUIRE_Q);\n pcfMsg.AddParameter(MQC.MQCA_Q_NAME, \"Q1\");\n\n PCFMessage[] pcfResponse = messageAgent.Send(pcfMsg);\n int pcfResponseLen = pcfResponse.Length;\n\n for (int pcfResponseIdx = 0; pcfResponseIdx < pcfResponseLen; pcfResponseIdx++) \n {\n PCFParameter [] parameters = pcfResponse[pcfResponseIdx].GetParameters();\n foreach(PCFParameter pm in parameters)\n {\n Console.WriteLine(pm.Parameter + \" - \" + pm.GetValue());\n } \n }\n messageAgent.Disconnect();\n }\n catch(MQException ex)\n {\n Console.Write(ex);\n }\n }\n"} +{"text": "### Human: Having trouble with Ibm mq to load it in 64-bit windows machines.Dim objMQ As Object\nobjMQ=CreateObject(\"MQAX200.MQSession\")I get\"Cannot create ActiveX component.\"in 64-bit machines and it works fine in 32-bit machines OS.My question is how do i alter the above piece of code to work in 64-bit OS?### Assistant: On Windows 7 64 bit, that piece of code works fine for me. I am using MQ v7.1 though.Is there a specific reason you want to use MQAX200? There have been no updates to this interface for a long time. Instead of MQAX200, you can use the MQ .NET interface which is more up to date and has much more features than MQAX200.MQ .NET interface is shipped in \"amqmdnet.dll\" assembly and can be found in \"bin\" folder of your MQ installation. There is only one assembly that works for both 32 and 64 bit architecture. You just need to reference \"amqmdnet\" in your project. There are also number of samples under \"\\tools\\dotnet\\samples\\cs\\base\" folder.Edit: Sample code:properties = new Hashtable();\n properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\n properties.Add(MQC.HOST_NAME_PROPERTY, hostName);\n properties.Add(MQC.PORT_PROPERTY, port);\n properties.Add(MQC.CHANNEL_PROPERTY, channelName);\n\n MQQueueManager queueManager = new MQQueueManager (queueManagerName,\n properties);\n queue = queueManager.AccessQueue(queueName, \n MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING);\n"} +{"text": "### Human: I have observed that when msg is read from the queue(destructive call) later if TX is rolled back(MDB container managed TX) msg are placed back to the queue(Original or back out queue depending the on backcount & threshold settings for queue). Lets say if something happens(Repeated Network issue or some issue) due to which rollback of TX got failed then Msgs are lost.Is it true??Thanks### Assistant: As I noted in the comments to the earlier question, the short answer is \"no, WMQ will not lose those messages if theCOMMITfails\" but let us look in a bit more detail.When the client makes a connection to MQ over the network, what happens under the covers is that MQ starts a process that creates a shared-memory connection to MQ and a socket connection to the client application. The thing holding the transaction open is the shared memory process which is called a 'channel agent' in WMQ terminology.There are two cases where theCOMMITappears from the application's perspective to have failed. In the first of these, theCOMMITis delivered to the channel agent and executed, but the acknowledgement never makes it back to the application due to a network problem. From MQ's perspective, the message is not 'lost' because the app intentionally committed theGETcalls.The second case is that the network failure occurs before theCOMMITarrives at the channel agent. In this case, theCOMMITtruly has failed because it is not possible for the app to recover the connection handle in which the transaction lives. When the channel agent realizes that the TCP connection has failed, it backs out the transaction and closes the channel. The wrinkle in this process is that it may take a while for the channel agent to realize that the connection has died. In fact, the default TCP timeout on most platforms is two hours. Depending on your server's TCP settings, the transactedGETmay hold that message under syncpoint for up to two hours, making it appear to have been consumed. This is one reason that using a current level of QMgr and client is highly recommended - they rely less on TCP and more on an internal channel heartbeat protocol to detect lost connections.From the application's perspective both of these cases appear to be the same - app callsCOMMITand gets back 2009MQRC_CONNECTION_BROKEN. But in the first case, the message is gone due to theCOMMITand in the second case, the message may be delivered again. Because of this ambiguity, the app must be able to detect and gracefully handle dupe messages.Now before declaring that this is a defect in MQ, let me point out that this ambiguity of outcomes is inherent when using messaging over the network and not anything specific to WebSphere MQ. In fact, theJMS 1.1 specificationaddresses this directly in 4.4.13 where it says:If a failure occurs between the time a client commits its work on a\n Session and the commit method returns, the client cannot determine if\n the transaction was committed or rolled back. The same ambiguity\n exists when a failure occurs between the non-transactional send of a\n PERSISTENT message and the return from the sending method.It is up to a JMS application to deal with this ambiguity. In some\n cases, this may cause a client to produce functionally duplicate\n messages.A message that is redelivered due to session recovery is not\n considered a duplicate message.So the use of syncpoint can eliminate the case of lost messages because anyGETmust be followed by aCOMMITin order to permanently remove the message from the queue. By definition, theCOMMITcannot arrive until the application has seen the message. However, syncpoint cannot eliminate the possibility of duplicate messages because if aCOMMITof aGETfails, the app may see the message again. Similarly, if theCOMMITof aPUTfails, the app has no way to know whether theCOMMITfailed before or after reaching the channel agent and has no choice but to reconnect andPUTthe message again.If in fact you are experiencing 'lost' messages, the possibilities are that:The putting app failed on theCOMMITbut did not put another copy of the message.TheGETting app failed on theCOMMITand the message is not lost but actually under syncpoint. In that case, stop any orphaned channels to roll back the transaction.Other than those two cases, WMQ will not lose that persistent message.\n"} +{"text": "### Human: I'm getting below exception when i run my program as below,java -jar MQprogram.jarI have set classpath correctly which is referring to all required jars , \n\"com.ibm.mq.jmqi.jar\" also referred in classpath which has MQException.`Exception in thread \"main\" java.lang.NoClassDefFoundError: com/ibm/mq/MQException\nCaused by: java.lang.ClassNotFoundException: com.ibm.mq.MQException\n at java.net.URLClassLoader$1.run(Unknown Source)\n at java.security.AccessController.doPrivileged(Native Method)\n at java.net.URLClassLoader.findClass(Unknown Source)\n at java.lang.ClassLoader.loadClass(Unknown Source)\n at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)\n at java.lang.ClassLoader.loadClass(Unknown Source)\n at java.lang.ClassLoader.loadClassInternal(Unknown Source)\nCould not find the main class: com.test.bo.MQprogram. Program will exit.\n`I'm still unclear where the bug is.### Assistant: This is almost always caused by a combination of an incomplete client install and/or a CLASSPATH issue. Many people grab the jar files rather than performing the complete install and do not necessarily get all of them. Sometimes they just keep looking up jar files and grabbing them, without regard to different versions. IBM performed a major refactor of the Java/JMS classes as of V7.0 and made some updates since then as well. As of V7.0.1, WMQ can be installed to arbitrary directory paths and multiple installs on a server. This meant that there can now be multiple JRE/s, multiple client installs, etc. This didn't affect the CLASSPATH so much but did change dependencies such as NLS support, tracing and other things the Java classes depend on/interact with.The recommendation is to install a full WMQ client and point the CLASSPATH at the install directory. If that is not possible, then install a full clientsomewhereand grab the complere set of jars from the known-good installation. Then at least you know you have all the same version, etc.Should you decide to install the full client from IBM's distribution media, you get several additional capabilities such as diagnostics and low-level trace. It also assures that maintenance can be applied. For example, you have a problem that is corrected in a Fix Pack, you simply install the Fix Pack over top of the existing client install. The Fix Pack won't install if all you have are the jar files.The WMQ clients are available asSupportPacs. You can download one of the following:WMQ V7.0 Client ==SupportPac MQC7WMQ V7.1 Client ==SupportPac MQC71WMQ V7.5 Client ==SupportPac MQC75Be sure to use the Infocenter for the version of client you are using!WMQ V7.0 InfocenterWMQ V7.1 InfocenterWMQ V7.5 Infocenter\n"} +{"text": "### Human: I have a .NET TransactionScope that needs to contain both a MSSQL database and a IBM MQ queue.I'm using .NET 4.0 (VS2010), SQL 2008R2, MQ Server 6.0, MQ Client 7.0.1.9 in fully managed mode. All components are running on different machines.From what I've found the following pattern should work:http://publib.boulder.ibm.com/infocenter/wmqv7/v7r1/index.jsp?topic=%2Fcom.ibm.mq.doc%2Fun11400_.htmImplicit Transaction\n The following piece of code describes how a WebSphere MQ .NET application puts a message using .NET implicit transaction\n programming.Using (TransactionScope scope = new TransactionScope ()) { Q.Put\n (putMsg,pmo); scope.Complete (); }Q.close(); qMgr.Disconect();}In my code this looks like:// mq properties\n properties = new Hashtable();\n properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\n properties.Add(MQC.HOST_NAME_PROPERTY, HOSTNAME);\n properties.Add(MQC.PORT_PROPERTY, PORTNUMBER);\n properties.Add(MQC.CHANNEL_PROPERTY, CHANNELNAME);\n\n _queueManager = new MQQueueManager(queueManagerName, properties);\n _queue = _queueManager.AccessQueue(queueName, MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING);\n _gmo = new MQGetMessageOptions();\n _gmo.Options |= MQC.MQGMO_WAIT;\n _gmo.Options |= MQC.MQGMO_SYNCPOINT;\n _gmo.WaitInterval = 1000; // 1 seconds wait\n\n // in a loop\n using (TransactionScope t = new TransactionScope())\n {\n\n var message = new MQMessage();\n try\n {\n _queue.Get(message, _gmo);\n }\n catch (MQException mqe)\n { \n message = null;\n if (mqe.ReasonCode == 2033)\n {\n Console.WriteLine(\"No message available\");\n }\n else\n {\n throw;\n }\n }\n t.Complete();\n }\n\n//Afterwards:\n\n if (_queue != null)\n {\n _queue.Close();\n _queue = null;\n }\n if (_queueManager != null)\n {\n _queueManager.Disconnect();\n _queueManager.Close();\n _queueManager = null;\n }The problem with this is that all messages re-appear in the queue after the application is closed, while the work in the SQL database is committed.\nIf an exception happens inside the transactionscope, the SQL transaction rolls back while the messages in MQ appear to stay removed (until I restart the application).\nAlso, I don't see any DTC activity between the .NET client and the MQ server (is that expected?)I'm kind of lost here, any help is greatly appreciated.Which MQ client should I use? Managed, Unmanaged, XA ?Should I see DTC activity? How would I get the managed client to participate?Which objects should be created inside the transactionscope?Why do messages re-appear on the queue when the application ends even when I commit the transactionscope?UPDATEI've had this working with 7.1 on both client and server, but to get that (server) version deployed on our production environment would take too long.So I need to work with version 7.0.x on the server side, clientside I can use whatever I need.Connecting to a MQ6 server using the 7.1 client fails with errorcode 2354### Assistant: Well, you need to have at least WebSphere MQ v7.1, both client and queue manager, installed to run global transactions in fully managed mode using the TransactionScope. MS DTC will be the transaction coordinator in this case. The InfoCenter link you posted about is actually pointing to WebSphere MQ v7.1.Update:Prior to MQ v7.1, XA transactions are supported only in Unmanaged mode with MTS as the transaction coordinator. Sample code for distributed transaction in unmanaged mode ishere. You will require an additional component, Extended Transaction Client(XTC) to be installed. As per latest announcements the XTC is available for free. The installable can be found in your MQ Server installation image.When a MQ connection is disconnected (basically MQDISC is called), any uncommitted messages in a transaction will be rolled back. Because of this messages reappear on the queue.\n"} +{"text": "### Human: It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened,visit the help center.Closed10 years ago.How can i create custom channel for the websphere MQ and how to configure with java client program ,Which channel i want to create for send message to websphereMQ (Server-connection-Channel is ok)### Assistant: You will need to create a Server connection (SVRCONN) channel for your client application to send messages to a WebSphere MQ Queue. It does not matter whether the application is developed in Java, C, C# etc.You can either use MQ Explorer (GUI) or RUNMQSC(cmd line) for creating a SVRCONN channel. In MQExplorer right click on \"Channels\" and select \"Server-Connection channel\" menu. A wizard pops up which will guide you to create a channel.You can also use \"RUNMQSC\" command line tool. From a command prompt run \"runmqsc \" which opens a MQ shell. In the shell run the below command (replace <> with your preferred names) in simplest form.DEFINE CHANNEL() CHLTYPE(SVRCONN)You can also specify a number of other attributes for this command which describedhereA number of Java/JMS samples are shipped with MQ. SimplePTP.java explains how to use a SVRCONN to connect to a queue manager and send/receive messages.\n"} +{"text": "### Human: Is there a way to remove a JMS message from an IBM MQ Queue using JMSMessageId ina Java application(not using tools)? Also are such operations vendor-specific?Looked through the API for receive operations which are used to remove messages, but for removing specific messages, do we need to filter using MessageSelector and remove appropriately, or is there a more simple way? [checking for any available method which can be directly used]Can you please provide tutorials/examples [can be links too] to show the API usage for such operations?### Assistant: When you useJMSMessageIDas the only message property in a selector, WMQ optimizes the lookup to be the same as a native WMQ API get byMQMD.MessageIDwhich is an indexed field in the queue. Please see theJMS Message Selectiontopic for more details.QueueReceiver rcvr = sess.createReceiver(inputQ, \"JMSCorrelationID = '\"+msgId+\"'\")You can also do the same thing using native WMQ API calls using Java native code. You would do a normalGEToperation but specify the message ID in theMQMDstructure.myMsg.messageId = someMsgID; \nMQGetMessageOptions gmo = new MQGetMessageOptions(); \nmyQueue.get(myMsg, gmo);\n"} +{"text": "### Human: We need to execute SET AUTHREC PROFILE($cname) OBJTYPE(CHANNEL) GROUP('mq-user') AUTHADD(...) so that the channels show up WMQ Explorer, it that correct? Current the access is prevented.### Assistant: Yes. With theAUTHRECprofiles defined in this and previous questions you have authorized the user to connect to the QMgr, put requests to the command queue and receive replies on a model queue. The command server needs to know what operations on other objects the group is authorized for. As an example, it won't display or let members of the group control channels until you authorize them.A quick way to see what objects need to be authorized is the Role Based Authorities Wizard in WMQ Explorer. Right-click on the QMgr, select Object Authorities, then Add Role Based Authorities like so:Next, select Group and put in the group name:The wizard outputssetmqautcommands which you can issue from the command line asmqm. There are equivalentAUTHRECcommands for these. Rather than convert them manually, I'd recommend running thesetmqautversions, then capturing the rule using thedmpmqcfgcommand.The actual commands created in the wizard using the settings above are:setmqaut -m QM75_1 -t qmgr -g mq-user +connect +inq +dsp\nsetmqaut -m QM75_1 -n \"**\" -t q -g mq-user +dsp\nsetmqaut -m QM75_1 -n \"**\" -t topic -g mq-user +dsp\nsetmqaut -m QM75_1 -n \"**\" -t channel -g mq-user +dsp\nsetmqaut -m QM75_1 -n \"**\" -t process -g mq-user +dsp\nsetmqaut -m QM75_1 -n \"**\" -t namelist -g mq-user +dsp\nsetmqaut -m QM75_1 -n \"**\" -t authinfo -g mq-user +dsp\nsetmqaut -m QM75_1 -n \"**\" -t clntconn -g mq-user +dsp\nsetmqaut -m QM75_1 -n \"**\" -t listener -g mq-user +dsp\nsetmqaut -m QM75_1 -n \"**\" -t service -g mq-user +dsp\nsetmqaut -m QM75_1 -n \"**\" -t comminfo -g mq-user +dsp\n\nsetmqaut -m QM75_1 -n SYSTEM.MQEXPLORER.REPLY.MODEL -t q -g mq-user +dsp +inq +get\nsetmqaut -m QM75_1 -n SYSTEM.ADMIN.COMMAND.QUEUE -t q -g mq-user +dsp +inq +put\n"} +{"text": "### Human: I'm new to WebSphere MQ. I was practicing the tutorials on the IBM site, I want to know if I need two separate computer machines to send a message to a remote queue? \nI'm using a laptop, I was wondering if I create another user account, can I use that user account to send message to a remote queue?### Assistant: A remote queue in WebSphere MQ terms is simply a queue that exists on another queue manager. You do not need another server, nor even another account. Just define two queue managers on the same server, under the same account and connect them.crtmqm QMGR1\nstrmqm QMGR1\n\ncrtmqm QMGR2\nstrmqm QMGR2\n\nrunmqsc QMGR1\nDEFINE LISTENER(TCP.1414) TRPTYPE(TCP) PORT(1414) CONTROL(QMGR)\nSTART LISTENER(TCP.1414)\n\nDEFINE QL(QMGR2) USAGE(XMITQ) TRIGGER\nDEFINE CHL(QMGR1.QMGR2) CHLTYPE(SDR) TRPTYPE(TCP) + \n CONNAME('127.0.0.1(1415)') XMITQ(QMGR2) REPLACE\n* Next one not needed for the demo but usually there's\n* a channel for reply messages to return on.\nDEFINE CHL(QMGR2.QMGR1) CHLTYPE(RCVR) TRPTYPE(TCP) REPLACE\n\nSTART CHL(QMGR1.QMGR2) \n\nDEFINE QREMOTE(TARGET.QUEUE) RQMNAME(QMGR2) RNAME(TARGET.QUEUE)\nEND\n\n\nrunmqsc QMGR2\nDEFINE LISTENER(TCP.1415) TRPTYPE(TCP) PORT(1415) CONTROL(QMGR)\nSTART LISTENER(TCP.1415)\n\nDEFINE QL(QMGR1) USAGE(XMITQ) TRIGGER\nDEFINE CHL(QMGR2.QMGR1) CHLTYPE(SDR) TRPTYPE(TCP) + \n CONNAME('127.0.0.1(1414)') XMITQ(QMGR1) REPLACE\nDEFINE CHL(QMGR1.QMGR2) CHLTYPE(RCVR) TRPTYPE(TCP) REPLACE\n\nDEFINE QL(TARGET.QUEUE)\nENDYou can have as many QMgrs on one machine as resources allow. I have seem people with as many as 20 QMgrs on a server but one is the recommended number.If you have WMQ v7.0 or earlier you can have only one installation of WMQ on a machine. If you have v7.1, which is current as of this writing, then it is possible to have multiple installations on the same machine. But either way, all QMgrs on that machine run under themqmaccount (or on Windows, whatever account you installed and run WMQ under).\n"} +{"text": "### Human: I am building a Java application that should be able to connect to an IBM WebSphere MQ queue manager and I cannot understand why I keep getting this error.I already gave administration privileges to my userID usingsetmqautthrough MQ Explorer. I also defined theMCAUSERin my channel and I also associated the user with the MQ Windows group.Can anyone please give a short tutorial/example of how to connect a Java program with a WebSphere MQ installation on a Windows Environment?### Assistant: If you have setMCAUSERin the channel, then this overrides any ID presented by the client. If you still get a 2035 then there are two possibilities. The first is that the ID inMCAUSERhasn't been properly authorized usingsetmqautcommands. The second (at least for Windows) is that it's not the right ID. For example, if the channel definition hasMCAUSER(userx)instead ofMCAUSER('userx@domain')then it is entirely possible that the ID presented is not the same SID that WMQ resolves. This can happen whenuserxis defined on a laptop and on the WMQ server. The servermustbe able to resolve the ID presented to the SID that comes with it.There are additional considerations for WMQ v7.1 regarding CHLAUTH rules. If the ID presented has administrative privileges, WMQ will block it on all channels by default. This is because an administrative ID has full access to WMQ and can remotely execute code on the QMgr's host server using the WMQ services or triggering functionality. So if you have WMQ v7.1 you either need to enable WMQ admin access on the desired channel or use a non-administrative user ID to connect.Finally, the easiest way to debug all of this is to enable authorization events on the QMgr and installSupportPac MS0Pinto WMQ Explorer. This will generate an event message every time there's a 2035 and then the MS0P plugin will parse that into human-readable format. The message will tell you...What API call failed. (CONNECT,OPEN,CLOSE)The options specified on the API callThe ID making the API callThe object against which the API call was madeThis can be helpful in determining whether you have provided all the right permissions. For example, the Java and JMS classes will inquire on every object they touch. This is how they discover the DLQ name when connecting or the BOQNAME when opening a queue. So if you didn't provide+inqon the QMgr and queue you get a 2035 and the event message will show you the object and options used. Similarly, if you read a poison message and the ID doesn't have rights to the backout queue or the Dead Queue then you get a 2035 which appears (until you look at the event message) to have occurred on a queue from which you have been happily consuming messages. So please be sure to enable Auth events and use MS0P.If you want a friendly tutorial to WMQ security, there are several conference presentations archivedhere.\n"} +{"text": "### Human: My company is considering moving from Solaris to Linux, but some FUD has been raised concerning how well WebSphere MQ and Message Broker perform on RHEL. There are also concerns about support from IBM. Does anyone have experience using these tools in this environment?Thanks.### Assistant: I have had a lot of experience on WMQ and WMB on Linux and even z\\Linux both RHEL and SuSE. Both perform very well. The performance papers at IBM are a good place to start, but be aware that the testing in message broker is with small messages and a very simple flow.From an administrative point of view, they are no different then UNIX.\n"} +{"text": "### Human: Can anyone help in doing the code in java of getting the depth of the queues. We are having 4 queues in IBM WebSphere MQ and inside them there are messages.I want to write a jsp to read the queue names and their depth while running the report. How do I do that?\nCan anyone help in getting the full solution because I don't know what to do### Assistant: I doens't think there is a way to retrieve the queue depth using JMS. You can however use MQ Series specific Java API to retrieve this information. Here is the sample code. Pay attention toint openOptions = MQC.MQOO_INQUIRE;Here is thereference guideint depth = 0;\nMQQueueManager qMgr; // define a queue manager object\nString mqHost = \"\";\nString mqPort = \"\";\nString mqChannel = \"\";\nString mqQMgr = \"\";\nString mqQueue = \"\";\ntry {\n // Set up MQSeries environment\n MQEnvironment.hostname = mqHost;\n MQEnvironment.port = Integer.valueOf(mqPort).intValue();\n MQEnvironment.channel = mqChannel;\n MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,\n MQC.TRANSPORT_MQSERIES);\n qMgr = new MQQueueManager(mqQMgr);\n int openOptions = MQC.MQOO_INQUIRE;\n MQQueue destQueue = qMgr.accessQueue(mqQueue, openOptions);\n depth = destQueue.getCurrentDepth();\n destQueue.close();\n qMgr.disconnect();\n} catch (Exception err) {\n err.printStackTrace();\n}\n"} +{"text": "### Human: Can anyone help in doing the code in java of getting the depth of the queues. We are having 4 queues in IBM WebSphere MQ and inside them there are messages.I want to write a jsp to read the queue names and their depth while running the report.\nHow do I do that?### Assistant: Seehttp://blog.guymahieu.com/2008/06/11/getting-the-depth-of-an-mqseries-queue-from-java/.I re-implemented this as follows:import com.ibm.mq.*;\n\npublic class QueueManager {\n\n private final String host;\n private final int port;\n private final String channel;\n private final String manager;\n private final MQQueueManager qmgr;\n\n public QueueManager(String host, int port, String channel, String manager) throws MQException {\n this.host = host;\n this.port = port;\n this.channel = channel;\n this.manager = manager;\n this.qmgr = createQueueManager();\n }\n\n public int depthOf(String queueName) throws MQException {\n MQQueue queue = qmgr.accessQueue(queueName, MQC.MQOO_INQUIRE | MQC.MQOO_INPUT_AS_Q_DEF, null, null, null);\n return queue.getCurrentDepth();\n }\n\n @SuppressWarnings(\"unchecked\")\n private MQQueueManager createQueueManager() throws MQException {\n MQEnvironment.channel = channel;\n MQEnvironment.port = port;\n MQEnvironment.hostname = host;\n MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES);\n return new MQQueueManager(manager);\n }\n}Put the following jars on your classpath:com.ibm.mq*jarj2ee.jar\n"} +{"text": "### Human: Is it possible to implement message segmentation using JMS as it is in using Native IBM API asshown here. One posible solution I have read is message grouping for JMS. is anyone using this an alternative solution to Segmentation, using JMS?### Assistant: Yes, you can implement message segmentation using JMS as describedhere.\n"} +{"text": "### Human: I'm just little bit lost in usage of topics in WebSphere MQ 7. Suppose simple scenario:I have a process publishing messages to a topic.I have zero or more subscribers receiving the message.Any subscriber can decide to react on received message = optional \"reply\". (Side note: Initial decision was to use topics for replies as well but I will change it to queue if necessary) The published message can have eitherReplyToQueueNameconfigured or it can be system level configuration on client.The response must be correlated to original published \"request\" (because there can be more then one published request).Now how to do this? I tried to use common approach from MQ queues where the initiator choose either:Set report toMQRO_COPY_MSG_ID_TO_CORREL_ID. Receiver will take message ID from request and pass it as Correlation ID in response.Set report toMQRO_PASS_CORREL_ID+ set Correlation ID in the request message. The receiver will take Correlation ID from request and set it as Correlation ID in response message.In both cases the sender is aware of message ID or correlation ID passed to request so it can correctly correlate messages but this doesn't work with MQ topics.If I try to follow the mentioned approaches I have a problem immediately when publishing the request - the message ID is not set on publisher side (it is empty) so the first approach is not possible. If I try to set correlation ID on publisher side I will get different one on subscriber side so I cannot use it for message correlation (= second approach is not possible as well).Here is some example what happens when using topics (IDs are in Base64):Test usingMQRO_COPY_MSG_ID_TO_CORREL_ID:Send request: // After sending message publisher doesn't know its ID!\nMessage Id: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nCorrelation Id: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n\nReceived request: // Subscriber gets some ID and correlation ID (but publisher didn't set any)\nMessage Id: QU1RIExNLnF1ZXVlLm1hbp2OiU4g6AYH\nCorrelation Id: QU1RIExNLnF1ZXVlLm1hbp2OiU4g6AYF\n\nSend response: // Subscriber correctly uses message ID of incoming request\nMessage Id: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nCorrelation Id: QU1RIExNLnF1ZXVlLm1hbp2OiU4g6AYH\n\nReceived response: // Publisher gets in response completely different IDs!\nMessage Id: QU1RIExNLnF1ZXVlLm1hbp2OiU4g6AYP\nCorrelation Id: QU1RIExNLnF1ZXVlLm1hbp2OiU4g6AYNTest usingMQRO_PASS_CORREL_ID:Send request: // Publisher doesn't know its ID but it generated some random correlation ID.\nMessage Id: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nCorrelation Id: Chhv8KT+zhTjfAEdzeiB3cizw9vRy9Pf\n\nReceived request: // Subscriber got ANOTHER correlation ID!\nMessage Id: QU1RIExNLnF1ZXVlLm1hbp2OiU4g6AYY\nCorrelation Id: QU1RIExNLnF1ZXVlLm1hbp2OiU4g6AYW\n\nSend response: // Subscriber is using incorrect correlation ID.\nMessage Id: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nCorrelation Id: QU1RIExNLnF1ZXVlLm1hbp2OiU4g6AYW\n\nReceived response: // Publisher gets in response completely different IDs!\nMessage Id: QU1RIExNLnF1ZXVlLm1hbp2OiU4g6AYg\nCorrelation Id: QU1RIExNLnF1ZXVlLm1hbp2OiU4g6AYeHow to force MQ to not alter my IDs? I wrote test applications in both Java and .NET and both behaves in the same way. Or what is correct approach for my use case?### Assistant: Have you considered coding it with JMS (MQ as the implementation) instead of the MQ api directly?JMS already has the concept of areplyToin the published message and already has the concept of acorrelation idto link messages together. For the replyTo, either a queue or topic can be specified by the publisher, so you are not tied to either on the receiving end.\n"} +{"text": "### Human: I'm new trying to configure MQ servicefollowing this tutorialbut when I tried to alter the serviceSYSTEM.BROKERit says that it cannot be found. What possibly am I doing wrong?I'm using Version 7.0 of WebSphere MQ.### Assistant: Note that the article applies to WMQ v6.0 whereas in v7.0 there is no pub/sub broker. In v7.0 and higher, pub/sub is natively supported as part of the queue manager.After a quick review of the tutorial, I believe that you can safely skip all ofStep C: Set Up Pub/Sub. This step creates the queues that the V6 pub/sub broker required and then started it. V7 neither requires these queues nor has a separate pub/sub broker component to start.You can actually see this in action in the last 45 seconds or so ofthis videowhere a new QMgr is created and then, without any additional setup, a message is published and received with a subscriber.So skip Step C and continue on with the tutorial and you should be OK.\n"} +{"text": "### Human: I am working on a project where MQ client (Support PAC 7) is installed on one 64-bit Linux machine and it sends messages to server.On client machine we are using 64-bit linux JDK 1.6.25java -versionjava version \"1.6.0_25\"I have following environment variable set upMQSERVER='my_channel/tcp/SRVD10995(1414)'\n MQ_INSTALL_ROOT=/var/mqm/\n MQ_JAVA_DATA_PATH=/var/mqm/\n MQ_JAVA_INSTALL_PATH=/opt/mqm/java/\n MQ_JAVA_LIB_PATH=/opt/mqm/java/lib64\n LD_LIBRARY_PATH=/opt/mqm/java/lib64\n CLASSPATH= /opt/mqm/java/lib/com.ibm.mq.jar:/opt/mqm/java/lib/com.ibm.mqjms.jar:/opt/mqm/samp/jms/samples:/opt/mqm/samp/wmqjava/samplesbut when I run following commanddspmqver -p 6For native libraries I am seeing following message:Name: IBM WebSphere MQ\n Version: 7.0.1.6\n CMVC Level: k701-106-110721 mqjbnd=CC=2;RC=2495;AMQ8568: The native JNI library 'mqjbnd' was not found. [3=mqjbnd]::no mqjbnd in java.library.path\n Build Type: ProductionI am also getting same error message when I execute JMS code to connect to server. I do not have libmqjbnd.so is not in the /opt/mqm/java/lib64 folder, and not even in 32 bit folder.I have couple of questions :1) How do I fix this problem for client installation?\n2) Does the library file (.so) need to be there in that directory ?I will be thankful if anyone provides me answer to above questions, I have already invested many hours in this but no joy.### Assistant: There's a Technote on this specific questionhere. Let us know if the solution presented there does not resolve your problem.Update: I noticed a mismatch between your CLASSPATH which is pointing to the 32-bit libs and the other variables pointing to the 64-bit libs. WMQ provides scripts that set the variables for youas described in the Infocenter:On a UNIX system, you can use the script setjmsenv (if you are using a 32-bit \nJVM) or setjmsenv64 (if you are using a 64-bit JVM) to set the environment\nvariables. On AIX, these scripts are in the /usr/mqm/java/bin directory and,\non HP-UX, Linux, and Solaris, they are in the /opt/mqm/java/bin directory.Many people source the scripts in their .profile. Have you tried running these? Remember that simply running the script.../opt/mqm/java/bin/setjmsenv64...does not result in the env vars being set in the current shell. The script must be sourced using the dot syntax as follows:. /opt/mqm/java/bin/setjmsenv64What results do you get after sourcing the appropriate setjmsenv or setjmsenv64 script?\n"} +{"text": "### Human: Transactional log file system(/var/mqm/log) become full and i am getting MQRC 2102 resource problem with Queue Manager while attempting client connection to this queue manager. What course of action we can do to resolve this?LogPrimaryFiles=2 \nLogSecondaryFiles=8 \nLogFilePages=16384 \nLogType=CIRCULAR \nLogBufferPages=0 \nLogPath=/var/mqm/log/QMGRA/ \nLogWriteIntegrity=TripleWriteIs adding additional disk space to /var/mqm/log is the only solution?I have few queues that were full,but queue storage file system were only 60% used.Please give me some ideas on this.### Assistant: Log file pages are 4096 bytes each so a setting ofLogFilePages=16384results in log files extents of 64MB each. With a setting ofLogPrimaryFiles=2andLogSecondaryFiles=8there can be up to 10 log files for a total of 640MB. If the file system that the circular logs resides on is less than this amount, it may fill up.The optimum solution here is to increase the size of the log file disk allocation to something a little larger than the log file extents require. If that is not possible or you need a temporary fix then it is necessary to change the size of the log file requirement by reducing the number of extents and restarting the QMgr. Note that you can adjust the number of log extents but not the size of the extents. If it becomes necessary to change theLogFilePages=16384parameter then it is necessary to rebuild the QMgr.The number and size of of extents represents the total amount of data that can be under syncpoint at once but 640MB is generous in most cases. In terms of time, it also limits the longest possible duration of a unit of work on an active QMgr. This is because an outstanding transaction will be rolled back if it happens that the head pointer in the log file ever overtakes the tail pointer. For example, suppose a channel goes into retry. This holds a batch of messages under syncpoint and holds that log extent active. As applications and other channels perform their normal operations, additional transactions drive the head pointer forward. Eventually all extents will be used, and although there may be very few outstanding transactions the oldest one will be rolled back to free up that extent and advance the tail pointer forward. If the error log shows many transactions are rolled back to free log space then you really would need to allocate more space to the log file partition and bump the number of extents.\n"} +{"text": "### Human: I am trying to migrate an application from Websphere 6.1 to 7.0I noticed that many of the ibm MQ/JMS classes have changed/disappeared =)In particular, I am getting errors oncom.ibm.msg.client.jms.JmsQueue\ncom.ibm.mq.jmqi.JmqiObjectit is saying \"...cannot be resolved. It is indirectly referenced from required .class files\"Does anyone know what I can do to get this to compile?thanks### Assistant: Hard to say exactly from the description so I'll provide some general pointers that may be of help.The WMQ JMS and Java support was completely rewritten in V7 to use a common JMQI layer. This will affect the jar files that are referenced as well as the CLASSPATH and a few other things.If you have bundled the WMQ jar files into your application, you will want to delete them and reference the ones installed with WAS instead.If you used MDB listeners, you will need to switch to Activation Specs.For more info, see theIntegration of WebSphere MQ classes for JMS with WebSphere Application Serversection in theWMQ V7 Migrationmanual and the CLASSPATH settings from theEnvironmentsection in theWMQ V7 Using Javamanual.TheWebSphere Application Server V7 Migration Guidedoes not address WMQ in depth but it does have pointers to additional migration resources such as IBM Education Assistant as well as specific application and profile migration advice.\n"} +{"text": "### Human: I've got a model queue (say, MY.MODEL.QUEUE). I'm opening it in process A and get a dynamic queue created (say, AMQ.WHATEVER). I send a message to another queue, specifying AMQ.WHATEVER as a ReplyTo queue.Now, process B receives the message, and replies to the dynamic queue. However, in B I need to know what model queue AMQ.WHATEVER is related to.I couldn't find any MQINQ Selector to inquire for that. Is there any way?### Assistant: You can't get there from here. :-)There is no reverse-resolution of queues, QMgrs, etc. If you need to know the model queue that was used, it will be necessary for the programs involved to specify enough of a root name to make the dynamic queues identifiable.For example, when you open MY.MODEL.QUEUE, specify a DynamicQName of MY.MODEL.QUEUE.* or similar. Then instead of a dynamic queue AMQ.WHATEVER you end up with a dynamic queue name of MY.MODEL.QUEUE.WHATEVER. You can set the dynamic queue prefix in the administered objects for JMS or as part of the API for JMS and all the other languages.Hereis the doc page that explains the name prefixing.\n"} +{"text": "### Human: If I have a Websphere MQ queue defined on another queue manager in the cluster, is there a way I can open it for writing using the Perl interface? The code below brings back mqrc 2085.$messageQ = MQSeries::Queue->new\n (\n QueueManager => $qMgr,\n Queue => $queue,\n Options => $openOpt\n ) or die \">>>ERROR2: Unable to open the queue: $queue\\n\";\n}### Assistant: Yes! The Perl modules are a thin veneer over the WMQ API and expose all the basic options and most of the really esoteric stuff as well.When you open a queue, WebSphere MQ performs name resolution on the values you provide for Queue and QMgr names. If you provide both a Queue and a QMgr name then the object reference is fully qualified and WMQ will attempt to open it as named. So if the name you provide is the local QMgr and the clustered queue does not have a locally defined instance, the open will fail with a 2085 Unknown Object Name.The trick to opening a clustered queue is to provide a null value for the QMgr name. This causes name resolution to check the local QMgr for a queue of the same name, then finding none it checks the cluster repository and resolve the open to the clustered queue. Note that the queue must be advertised to the cluster for this to work. Specifically, the CLUSTER or CLUSNL attribute of the target queue must be non-blank and refer to a cluster that the source QMgr participates in. Similarly, the destination QMgr must also participate in the same cluster as the source QMgr.Note also that if you specify a QMgr name on the open that isnotthe local QMgr, then WMQ will attempt to resolve the QMgr name only. If it can resolve a route to that QMgr then it will send the message there. This means that in a cluster you can send a message to any queue on any QMgr so long as you know the fully-qualified name.Finally, you can define a local alias over a clustered queue. For example if you are on QMGRA and DEF QA(TARGET.QUEUE) TARGQ(TARGET.QUEUE) and then on QMGRB and QMGRC in the same cluster you DEF QL(TARGET.QUEUE) CLUSTER(MYCLUS) then it is possible to open QMGR=QMGRA QUEUE=TARGET.QUEUE and still have it work as expected. Note that the alias is NOT advertised to the cluster but the target queue is. The only issue with this approach is that the first time it is opened the API call may fail if the cluster query takes too long. When I do this in Production, I always use amqsput on the alias ahead of time to make the QMgr query the repository before the actual application opens the queue. Why would you do this? If security is a concern you probably don't want to authorize all apps directly to the cluster XMitQ because, as noted above, they could then put a message ontoanyqueue on any QMgr in the cluster, including SYSTEM.ADMIN.COMMAND.QUEUE. The alias gives you a place to hang authorizations and restrict the user to specific destinations in the cluster.So short answer, make sure you provide a null QMgr name on the Open call or set up a local alias over the clustered queue. For more about the security aspects of this, see the WMQ Security presentation athttp://t-rob.net/links\n"} +{"text": "### Human: I got a .p12 file from our server team. I need to connect MQ server using this. What i need to amqputc to work. is there any config entries i need perform before i use this.### Assistant: Short answer: Not enough info to answer your question. This topic is quite deep and a lot depends on whether your app is C or Java and whether the WMQ channel is set for mutual authentication or not.Long answer: Here's what you need to find out and why...WMQ programs use either a .kdb format key store or they use a .jks keystore. The .jks format is for Java/JMS programs and the .kdb format is generally for C programs. Since amqsputc is definitely not the thing you will be using in Production, the first thing to do is determine what you will be using in Production so that you get the right key store type. No sense in getting amqsputc to work using a kdb if your actual app needs a .jks keystore. Once you know whether you need a kdb or a jks you can proceed accordingly.The .p12 you were given will need to be loaded into the .kdb or .jks file before a WMQ program can use it. The important thing here is to understand whether the .p12 file containsyourprivate key or the QMgr's public key. Depending on whether the channel is set to require mutual authentication, either of these scenarios is valid. A program like amqsputc that accesses a kdb file looking for your private key will search for a specific label to find the right certificate. So if it's a private key you need to know that and you'll need to know the user ID that will access it because that's part of the label when you install the cert.If you use a kdb file then you need to use IBM's tooling to manage it. If you use a jks you can use IBM's tools, Sun's keytool or any compatible tool. IBM provides a GUI and a command-line tool. I recommend the command-line tool gskcapicmd for which you can find the user manualhere.To do some of the heavy lifting when creating and managing WMQ certificates, feel free to grab theWMQ Security Lab downloadsfrom my web site. The zip file contains scripts that generate kdb files and certificates. They don't do exactly what you need but you will get a good idea of how the command does most basic tasks.Take a look at theWMQ SupportPac MO04 SSL Wizard. You tell it what kind of app you have and what platform and it spits out the commands to generate keystores and certs. It will get you half way there. It would get you all the way there if you didn't have this mystery .p12 to deal with.TheWMQ product manuals are your friend. You will become quite familiar with the WMQ Security and WMQ Client manuals before you are done. If your app is Java or JMS you will also want to look at the Using Java manual.Finally, there's a lot of links to various WMQ security resourceson my web site. Some of these may be helpful.\n"} +{"text": "### Human: I feel like this is probably a pretty simple question, but this is my first foray into JMS, so I am a little unsure.I am trying to write to an existing JMS queue (and then read from another queue), for which I know the queue name, host, queue manager, and channel. How do I get a reference to this queue in the form of ajavax.jms.Destinationobject?All of the examples I have found involve callingjavax.jms.Session.createQueue(String), but since this queue already exists, I don't want to create another one, right? Or am I misunderstanding what is going on?If it matters, I am using the com.ibm.msg.client.jms driver.Thanks!### Assistant: Normally, the container in which your application runs will bind theQueuein its naming service. An application in the container can look it up with JNDI and use it.\n"} +{"text": "### Human: I have a simple JMS application deployed on OC4J under AIX server, in my application I'm listening to some queues and sending to other queues on a Websphere MQ deployed under AS400 server.The problem is that my connections to these queues are terminated/closed when it stays idle for some time with the errorMQJMS1016(this is not the problem), and when that happens I attempt to recover the connection and it works, however, the old connection is stuck at the MQ and would not terminate until it is terminated manually.The recovery code goes as follows:public void recover() {\n cleanup();\n init();\n}\n\npublic void cleanup(){\n if (session != null) {\n try {\n session .close();\n } catch (JMSException e) {\n }\n }\n if (connection != null) {\n try {\n connection.close();\n } catch (JMSException e) {\n }\n }\n}\n\npublic void init(){\n // typical initialization of the connection, session and queue...\n}### Assistant: The MQJMS1016 is an internal error and indicates that the connection loss is due to something wrong with the code or WMQ itself. Tuning the channels will help but you really need to get to the problem of why the app is spewing orphaned connections fast enough to exhaust all available channels.The first thing I'd want to do is check the versions of WMQ and of the WMQ client that are running. If this is new development, be sure you are using the WMQ v7 client because v6 is end-of-life as of Sept 2011. The v7 client works with v6 QMgrs until you are able to upgrade that as well. Once you get to v7 client and QMgr, there are quite a bit of channel tuning and reconnection options available to you.The WMQ v7 client download is here:http://bit.ly/bXM0q3Also, note that the reconnect logic in the code above does not sleep between attempts. If a client throws connection requests at a high rate of speed, it can overload the WMQ listener and execute a very effective DOS attack. Recommended to sleep a few seconds between attempts.Finally, please, PLEASE print the linked exceptions in your JMSException catch blocks. If you have a problem with a JMS transport provider, the JMS Linked Exception will contain any low-level error info. In the case of WMQ it contains the Reason Code such as 2035 MQRC_AUTHORIZATION_ERROR or 2033 MQRC_NO_MSG_AVAILABLE. Here's an example:try {\n .\n . code that might throw a JMSException\n .\n} catch (JMSException je) {\n System.err.println(\"caught \"+je);\n Exception e = je.getLinkedException();\n if (e != null) {\n System.err.println(\"linked exception: \"+e);\n } else {\n System.err.println(\"No linked exception found.\");\n }\n}If you get an error at 2am some night, your WMQ administrator will thank you for the linked exceptions.\n"} +{"text": "### Human: Any help or hint would be greatly appreciated it.\nMy ibm mq is running on dockers.\nI logged into the console using the following id and password:https://localhost:9443/ibmmq/console\nid:admin\npassword:passw0rdIn the java code below I used the same id and password.\nThe \"DEV.QUEUE.1\" exist(please see image below).com.ibm.msg.client.jms.DetailedJMSSecurityRuntimeException: JMSWMQ2013: The security authentication was not valid that was supplied for queue manager 'QM1' with connection mode 'Client' and host name 'localhost(1414)'.\nPlease check if the supplied username and password are correct on the queue manager to which you are connecting. For further information, review the queue manager error logs and the Securing IBM MQ topic within IBM Knowledge Center./*\n * (c) Copyright IBM Corporation 2018\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n package com.ibm.mq.samples.jms;\n\n\n import javax.jms.Destination;\n import javax.jms.JMSConsumer;\n import javax.jms.JMSContext;\n import javax.jms.JMSException;\n import javax.jms.JMSProducer;\n import javax.jms.TextMessage;\n\n import com.ibm.msg.client.jms.JmsConnectionFactory;\n import com.ibm.msg.client.jms.JmsFactoryFactory;\n import com.ibm.msg.client.wmq.WMQConstants;\n\n /**\n * A minimal and simple application for Point-to-point messaging.\n *\n * Application makes use of fixed literals, any customisations will require\n * re-compilation of this source file. Application assumes that the named queue\n * is empty prior to a run.\n *\n * Notes:\n *\n * API type: JMS API (v2.0, simplified domain)\n *\n * Messaging domain: Point-to-point\n *\n * Provider type: IBM MQ\n *\n * Connection mode: Client connection\n *\n * JNDI in use: No\n *\n */\n public class JmsPutGet {\n\n // System exit status value (assume unset value to be 1)\n private static int status = 1;\n\n // Create variables for the connection to MQ\n private static final String HOST = \"localhost\"; // Host name or IP address\n private static final int PORT = 1414; // Listener port for your queue manager\n private static final String CHANNEL = \"DEV.APP.SVRCONN\"; // Channel name\n private static final String QMGR = \"QM1\"; // Queue manager name\n private static final String APP_USER = \"admin\"; // User name that application uses to connect to MQ\n private static final String APP_PASSWORD = \"passw0rd\"; // Password that the application uses to connect to MQ\n private static final String QUEUE_NAME = \"DEV.QUEUE.1\"; // Queue that the application uses to put and get messages to and from\n\n\n /**\n * Main method\n *\n * @param args\n */\n public static void main(String[] args) {\n\n // Variables\n JMSContext context = null;\n Destination destination = null;\n JMSProducer producer = null;\n JMSConsumer consumer = null;\n\n\n\n try {\n // Create a connection factory\n JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\n JmsConnectionFactory cf = ff.createConnectionFactory();\n\n // Set the properties\n cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, HOST);\n cf.setIntProperty(WMQConstants.WMQ_PORT, PORT);\n cf.setStringProperty(WMQConstants.WMQ_CHANNEL, CHANNEL);\n cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\n cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, QMGR);\n cf.setStringProperty(WMQConstants.WMQ_APPLICATIONNAME, \"JmsPutGet (JMS)\");\n cf.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, true);\n cf.setStringProperty(WMQConstants.USERID, APP_USER);\n cf.setStringProperty(WMQConstants.PASSWORD, APP_PASSWORD);\n //cf.setStringProperty(WMQConstants.WMQ_SSL_CIPHER_SUITE, \"*TLS12\");\n\n // Create JMS objects\n context = cf.createContext();\n destination = context.createQueue(\"queue:///\" + QUEUE_NAME);\n\n long uniqueNumber = System.currentTimeMillis() % 1000;\n TextMessage message = context.createTextMessage(\"Your lucky number today is \" + uniqueNumber);\n\n producer = context.createProducer();\n producer.send(destination, message);\n System.out.println(\"Sent message:\\n\" + message);\n\n consumer = context.createConsumer(destination); // autoclosable\n String receivedMessage = consumer.receiveBody(String.class, 15000); // in ms or 15 seconds\n\n System.out.println(\"\\nReceived message:\\n\" + receivedMessage);\n\n context.close();\n\n recordSuccess();\n } catch (JMSException jmsex) {\n recordFailure(jmsex);\n }\n catch(Exception e) {\n System.out.println(\"exception:\"+e.getMessage());\n }\n\n System.exit(status);\n\n } // end main()\n\n /**\n * Record this run as successful.\n */\n private static void recordSuccess() {\n System.out.println(\"SUCCESS\");\n status = 0;\n return;\n }\n\n /**\n * Record this run as failure.\n *\n * @param ex\n */\n private static void recordFailure(Exception ex) {\n if (ex != null) {\n if (ex instanceof JMSException) {\n processJMSException((JMSException) ex);\n } else {\n System.out.println(ex);\n }\n }\n System.out.println(\"FAILURE\");\n status = -1;\n return;\n }\n\n /**\n * Process a JMSException and any associated inner exceptions.\n *\n * @param jmsex\n */\n private static void processJMSException(JMSException jmsex) {\n System.out.println(jmsex);\n Throwable innerException = jmsex.getLinkedException();\n if (innerException != null) {\n System.out.println(\"Inner exception(s):\");\n }\n while (innerException != null) {\n System.out.println(innerException);\n innerException = innerException.getCause();\n }\n return;\n }\n\n }UpdateCommented out these two lines:cf.setStringProperty(WMQConstants.USERID, APP_USER);\ncf.setStringProperty(WMQConstants.PASSWORD, APP_PASSWORD);Outcome:Sent message:\n\n JMSMessage class: jms_text\n JMSType: null\n JMSDeliveryMode: 2\n JMSDeliveryDelay: 0\n JMSDeliveryTime: 1626132731104\n JMSExpiration: 0\n JMSPriority: 4\n JMSMessageID: ID:414d5120514d312020202020202020203c98ea6001540140\n JMSTimestamp: 1626132731104\n JMSCorrelationID: null\n JMSDestination: queue:///DEV.QUEUE.1\n JMSReplyTo: null\n JMSRedelivered: false\n JMSXAppID: JmsPutGet (JMS) \n JMSXDeliveryCount: 0\n JMSXUserID: app \n JMS_IBM_PutApplType: 28\n JMS_IBM_PutDate: 20210712\n JMS_IBM_PutTime: 23321072\nYour lucky number today is 837\n\nReceived message:\nYour lucky number today is 837\nSUCCESS### Assistant: For channel DEV.APP.SVRCONN and QMgr QM1 authorisation is disabled by default.Try to remove APP_USER and APP_PASSWORD. Notice: admin and passw0rd are only for admin console.Or see my this answer and disable authorisation:IBM MQ authentication\n"} +{"text": "### Human: We have 2 appl. In which App2 sending & App1 is receiving msg. Below is the configuration.App1 => Q Name : GIBTNBN.RCV.SYS1.TO.SYS2\n ChannelName: GIBTNBN.SVRCONN\n QMgr: M1\nApp2 => Q Name : IBLPWTW.SYS1.TO.SYS2.STATUS\n ChannelName: IBLPWTW.SVRCONN.TLS\n QMgr: M2I know only about SDR/RCVR type of channels. But here I see at both appl's side type of Channel is Server Connection. As per IBM specs => \"To send messages using a server channel, you must also create, on the other queue manager, a receiver channel with the same name as the server channel.\" I am wondering how despite of having different channel name and channel Type (as per spec it should be RCVR Type & with same name 'IBLPWTW') at receiver side , communication is still happening.Please help me out to identify how SVRCONN channel type work.### Assistant: SDR/RCVR channels are used to allow for one direction communication between two queue managers.SVRCONN channels are used to allow applications to connect to a queue manager over the network, the application can both send and receive data over the SVRCONN channel. If the application happens to use CCDTs to specify the client end of the connection details these are called CLNTCONN channels and would pair with a SVRCONN channel. CCDTs are not required, applications can specify connection details programmatically or via JMS/XMS JNDI such as \".bindings\" files.In your setup you may have both types in use, if you don't see SDR/RCVR channels then perhaps the two queue managers communicate over a MQ cluster using CLUSSDR/CLUSRCVR channels.\n"} +{"text": "### Human: I'm trying to create an extension using quarkus in order to use ibm mq as for a native executable.\nUntil now I've created (in the runtime module) the ConnectionFactory producer:@ApplicationScoped\npublic class ConnectionFactoryProducer {\n\n @Produces\n @ApplicationScoped\n @DefaultBean\n public JmsConnectionFactory connectionFactory() throws JMSException {\n\n JmsFactoryFactory ff;\n JmsConnectionFactory factory;\n ff = JmsFactoryFactory.getInstance(JmsConstants.WMQ_PROVIDER);\n factory = ff.createConnectionFactory();\n // Always work in TCP/IP client mode\n factory.setIntProperty(CommonConstants.WMQ_CONNECTION_MODE, CommonConstants.WMQ_CM_CLIENT);\n factory.setStringProperty(CommonConstants.WMQ_HOST_NAME, \"localhost\");\n factory.setIntProperty(CommonConstants.WMQ_PORT, 1414);\n factory.setStringProperty(CommonConstants.WMQ_CHANNEL, \"DEV.ADMIN.SVRCONN\");\n factory.setStringProperty(CommonConstants.WMQ_QUEUE_MANAGER, \"QM1\");\n factory.setStringProperty(WMQConstants.USERID, \"admin\");\n factory.setStringProperty(WMQConstants.PASSWORD, \"passw0rd\");\n return factory;\n }\n\n}The deployment module contains the processor:public final class IbmExtProcessor {\n\n private static final String FEATURE = \"ibm-ext\";\n\n @BuildStep\n FeatureBuildItem feature() {\n return new FeatureBuildItem(FEATURE);\n }\n\n}Where FEATURE is the name of the extension.But when I try to execute the code using the extension by importing it as a dependency in my project nothing happens. \nIt looks like classes that use the dependency are no more in the application context.\nExample of a message producer:public class NumberProducer implements Runnable {\n\n private final Random random = new Random();\n private final ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor();\n @Inject\n private ConnectionFactoryProducer cf;\n private ConnectionFactory c;\n\n\n\n void onStart(@Observes StartupEvent ev) throws JMSException {\n c=cf.connectionFactory();\n scheduler.scheduleWithFixedDelay(this, 0L, 1L, TimeUnit.SECONDS);\n }\n\n void onStop(@Observes ShutdownEvent ev) {\n scheduler.shutdown();\n }\n\n @Override\n public void run() {\n JMSContext context = c.createContext();\n Queue destination=context.createQueue(\"queue:///DEV.QUEUE.1\");\n try {\n TextMessage message = context.createTextMessage(String.format(\"Value : %d\", random.nextInt(100)));\n JMSProducer producer = context.createProducer();\n producer.send(destination, message);\n System.out.println(message);\n } catch (Exception e) {\n throw e;\n }\n }\n}In this case i will never get the print of the message variable. Anyone can help? I think i've missed something in the extension but i can't figure out what could be.### Assistant: AMQP will not work when you have to connect to a classic IBM MQ channel. It that cases you have to use thecom.ibm.mq.allclientjar. Despite the introspection and thread spawning it is possible to use thecom.ibm.mq.allclientin a Quarkus native image. You will need the followingquarkus.native.additional-build-args:-J-Dcom.ibm.mq.cfg.useIBMCipherMappings=false,\\\n-J-Dcom.ibm.msg.client.commonservices.ffst.suppress=-1,\\\n--initialize-at-run-time=org.apache.http.impl.auth.NTLMEngineImpl\\,com.ibm.mq.jmqi.remote.impl.RemoteReconnectThread\\,com.ibm.mq.jmqi.JmqiDefaultThreadPool\\,com.ibm.msg.client.wmq.compat.jms.internal.MQJMSMessage\\,com.ibm.msg.client.commonservices.workqueue.WorkQueueManager,\\\n-H:ResourceConfigurationFiles=resources-config.json,\\\n-H:ReflectionConfigurationFiles=reflection-config.json,\\\n-H:+ReportUnsupportedElementsAtRuntime,\\\n--report-unsupported-elements-at-runtimeThe first system property is needed when using a non IBM JDK.I've added the second system property to avoid FFDC logging; (which will try to write to a local filesystem).\nThe first class mentionedinitialize-at-run-timestuff is because of the use of a SecureRandom.The rest is for the two class loading paths to the WorkQueueManager. The WorkQueueManager itself is needed because it spawns Threads at runtime.Regarding reflection you have to define a reflection-config.json for the classescom.ibm.msg.client.jms.internal.JmsFactoryFactoryImplcom.ibm.mq.jmqi.remote.api.RemoteFAPcom.sun.security.cert.internal.x509.X509V1CertImplThe last class is needed when you use SSL/TLS in your connection to the MQ channel.Also a resources-config.json is needed with{\"pattern\": \".+properties$\"}because the IBM MQ code uses ResourceBundles with a number of properties files for error messages.When using SSL/TLS you have to explicitly set the SSLSocketfactory on the JmsConnectionFactory:connectionFactory.setObjectProperty(\"XMSC_WMQ_SSL_SOCKET_FACTORY\", sslSocketFactory);Depending on how you configure the JmsConnectionFactory and the version of thecom.ibm.mq.allclientjar you might get errors on \"XMSC_WMQ_HOST_NAME\" configuration. These errors are bugs in the IBM-code and have nothing to do with the native image.\n"} +{"text": "### Human: Is there any way to purge IBM MQ Queue programmatically? I have few messages lying in the Queue but when I read the messages using Consumer code , the messages are still present in the queue. I am assuming there are some uncommitted messages present in queue. I do not have access to MQ explorer so I want to clear the queue programmatically. (either through JMS code or IBM MQ implementation way)Currently my consumer has jar filecom.ibm.mq-6.0.2.1.jarSo I prefer to use WMQ classes rather than JMS.### Assistant: Here is a fully functioning Java/MQ program called 'EmptyQ.java' that will delete all messages on a queue until the queue is empty. Note: It is one of the sample MQ/Java programs that I postedhere.import java.text.SimpleDateFormat;\nimport java.util.Date;\nimport java.util.Hashtable;\n\nimport com.ibm.mq.MQException;\nimport com.ibm.mq.MQMessage;\nimport com.ibm.mq.MQGetMessageOptions;\nimport com.ibm.mq.MQQueue;\nimport com.ibm.mq.MQQueueManager;\nimport com.ibm.mq.constants.CMQC;\n\n/**\n * Program Name: \n * EmptyQ\n *\n * Description: \n * This java class will connect to a remote queue manager with the\n * MQ setting stored in a HashTable, loop to retrieve (delete) all messages from\n * a queue then close and disconnect.\n *\n * Sample Command Line Parameters: \n * bindings mode: \n * -m MQA1 -q TEST.Q1 \n * \n * client mode:\n * -m MQA1 -q TEST.Q1 -h 127.0.0.1 -p 1414 -c TEST.CHL -u UserID -x Password\n *\n * @author Roger Lacroix\n */\npublic class EmptyQ\n{\n private static final SimpleDateFormat LOGGER_TIMESTAMP = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss.SSS\");\n\n private Hashtable params;\n private Hashtable mqht;\n\n /**\n * The constructor\n */\n public EmptyQ()\n {\n super();\n params = new Hashtable();\n mqht = new Hashtable();\n }\n\n /**\n * Make sure the required parameters are present.\n * \n * @return true/false\n */\n private boolean allParamsPresent()\n {\n boolean b = params.containsKey(\"-m\") && params.containsKey(\"-q\");\n\n if (params.containsKey(\"-c\"))\n {\n b = b && params.containsKey(\"-c\") && params.containsKey(\"-h\") && params.containsKey(\"-p\");\n }\n\n if (b)\n {\n try\n {\n if (params.containsKey(\"-p\"))\n Integer.parseInt((String) params.get(\"-p\"));\n }\n catch (NumberFormatException e)\n {\n b = false;\n }\n }\n\n return b;\n }\n\n /**\n * Extract the command-line parameters and initialize the MQ HashTable.\n * \n * @param args\n * @throws IllegalArgumentException\n */\n private void init(String[] args) throws IllegalArgumentException\n {\n int port = 1414;\n if (args.length > 0 && (args.length % 2) == 0)\n {\n for (int i = 0; i < args.length; i += 2)\n {\n params.put(args[i], args[i + 1]);\n }\n }\n else\n {\n throw new IllegalArgumentException();\n }\n\n if (allParamsPresent())\n {\n if (params.containsKey(\"-c\"))\n {\n try\n {\n port = Integer.parseInt((String) params.get(\"-p\"));\n }\n catch (NumberFormatException e)\n {\n port = 1414;\n }\n\n mqht.put(CMQC.CHANNEL_PROPERTY, params.get(\"-c\"));\n mqht.put(CMQC.HOST_NAME_PROPERTY, params.get(\"-h\"));\n mqht.put(CMQC.PORT_PROPERTY, new Integer(port));\n if (params.containsKey(\"-u\"))\n mqht.put(CMQC.USER_ID_PROPERTY, params.get(\"-u\"));\n if (params.containsKey(\"-x\"))\n mqht.put(CMQC.PASSWORD_PROPERTY, params.get(\"-x\"));\n }\n\n // I don't want to see MQ exceptions at the console.\n MQException.log = null;\n }\n else\n {\n throw new IllegalArgumentException();\n }\n }\n\n /**\n * Connect, open queue, loop and get all messages then close queue and\n * disconnect.\n *\n */\n private void receive()\n {\n String qMgrName = (String) params.get(\"-m\");\n String inputQName = (String) params.get(\"-q\");\n MQQueueManager qMgr = null;\n MQQueue queue = null;\n int openOptions = CMQC.MQOO_INPUT_AS_Q_DEF + CMQC.MQOO_INQUIRE + CMQC.MQOO_FAIL_IF_QUIESCING;\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.options = CMQC.MQGMO_FAIL_IF_QUIESCING + CMQC.MQGMO_ACCEPT_TRUNCATED_MSG;\n MQMessage receiveMsg = null;\n int msgCount = 0;\n boolean getMore = true;\n\n try\n {\n if (params.containsKey(\"-c\"))\n qMgr = new MQQueueManager(qMgrName, mqht);\n else\n qMgr = new MQQueueManager(qMgrName);\n EmptyQ.logger(\"successfully connected to \" + qMgrName);\n\n queue = qMgr.accessQueue(inputQName, openOptions);\n EmptyQ.logger(\"successfully opened \" + inputQName);\n\n while (getMore)\n {\n receiveMsg = new MQMessage();\n\n try\n {\n // get the message on the queue - request only 1 byte - make it go as fast as possible.\n queue.get(receiveMsg, gmo, 1);\n msgCount++;\n }\n catch (MQException e)\n {\n if ( (e.completionCode == CMQC.MQCC_FAILED) && \n (e.reasonCode == CMQC.MQRC_NO_MSG_AVAILABLE) )\n {\n // All messages read.\n getMore = false;\n break;\n }\n else if ( (e.completionCode == CMQC.MQCC_WARNING) && \n (e.reasonCode == CMQC.MQRC_TRUNCATED_MSG_ACCEPTED) )\n {\n msgCount++;\n }\n else\n {\n EmptyQ.logger(\"MQException: \" + e.getLocalizedMessage());\n EmptyQ.logger(\"CC=\" + e.completionCode + \" : RC=\" + e.reasonCode);\n getMore = false;\n break;\n }\n }\n }\n }\n catch (MQException e)\n {\n EmptyQ.logger(\"CC=\" + e.completionCode + \" : RC=\" + e.reasonCode);\n }\n finally\n {\n EmptyQ.logger(\"deleted \" + msgCount + \" messages\");\n\n try\n {\n if (queue != null)\n {\n queue.close();\n EmptyQ.logger(\"closed: \" + inputQName);\n }\n }\n catch (MQException e)\n {\n EmptyQ.logger(\"CC=\" + e.completionCode + \" : RC=\" + e.reasonCode);\n }\n try\n {\n if (qMgr != null)\n {\n qMgr.disconnect();\n EmptyQ.logger(\"disconnected from \" + qMgrName);\n }\n }\n catch (MQException e)\n {\n EmptyQ.logger(\"CC=\" + e.completionCode + \" : RC=\" + e.reasonCode);\n }\n }\n }\n\n /**\n * A simple logger method\n * \n * @param data\n */\n public static void logger(String data)\n {\n String className = Thread.currentThread().getStackTrace()[2].getClassName();\n\n // Remove the package info.\n if ((className != null) && (className.lastIndexOf('.') != -1))\n className = className.substring(className.lastIndexOf('.') + 1);\n\n System.out.println(LOGGER_TIMESTAMP.format(new Date()) + \" \" + className + \": \" + Thread.currentThread().getStackTrace()[2].getMethodName() + \": \" + data);\n }\n\n /**\n * main line\n * \n * @param args\n */\n public static void main(String[] args)\n {\n EmptyQ write = new EmptyQ();\n\n try\n {\n write.init(args);\n write.receive();\n }\n catch (IllegalArgumentException e)\n {\n System.err.println(\"Usage: java EmptyQ -m QueueManagerName -q QueueName [-h host -p port -c channel] [-u UserID] [-x Password]\");\n System.exit(1);\n }\n\n System.exit(0);\n }\n}\n"} +{"text": "### Human: I have a requirement to get just a specific message from a queue based on its correlation ID.Is there a way where we can get a message for the corresponding correlation ID and remove only that message from the queue without deleting the others.The options which I have tried they retrieve the message but removing the other messages from the queue as well while finding my messageI have used the following openOptions in accessQueue method while browsing the queueMQC.MQOQ_INPUT_SHARED | MQC.MQOO_FAIL_IF_QUIESCING | MQC_MQOO_INQUIRE | MQC.MQOOBROWSEAnd the following options to get the messageString correlation ID = \n\n MQMessage respMessage = new MQMessage();\n\n respMessage.correlationId = correlation ID.getBytes();\n\n MQGetMessageOptions msg = new MqGetMessageOptions(); \n msg.options = MQC.MQGMO_NO_WAIT + MQC.MQGMO_FAIL_IF_QUIESCING + MQC.MQGMO_CONVERT + MQC.MQGMO_BROWSE_NEXT\n\n msg.matchOptions = MQC.MQMO_MATCH_MSG_ID\n\nmsg.waitInterval = 2000;\n\nqueue.get(respMessage, msg);### Assistant: You have many issues with your code.(1) As Morag said, remove the MQGMO_BROWSE_NEXT option if you want to remove the message from the queue (i.e. destructive get).respMessage.correlationId = correlation ID.getBytes();\nmsg.matchOptions = MQC.MQMO_MATCH_MSG_ID(2) You are setting the CorrelId but then requesting to match on MsgId. That won't work. You will get reason code of MQRC_NO_MSG_AVAILABLE (2033).(3) MsgIds and/or CorrelIds should never be converted to a string or start as a string. MsgIds and/or CorrelIds will contain binary data. Hence, MsgIds and CorrelIds should always be a byte array. i.e. byte[]Here is a screenshot of a message's MsgId and CorrelId:(4) You have MQGMO_NO_WAIT option but you set waitInterval to 2000. If you want to wait for up to 2 seconds for a message to arrive then you need to use the MQGMO_WAIT option.MQGetMessageOptions msg = new MqGetMessageOptions();(5) \"msg\" is a terrible variable name. It will only confuse people because they will think it references a message. i.e. MQMessage class. It is far better to call the variable \"gmo\".i.e.MQGetMessageOptions gmo = new MqGetMessageOptions();\ngmo.options = CMQC.MQGMO_WAIT + CMQC.MQGMO_FAIL_IF_QUIESCING + CMQC.MQGMO_CONVERT;\ngmo.waitInterval = 2000;\ngmo.matchOptions = CMQC.MQMO_MATCH_CORREL_ID;\n"} +{"text": "### Human: I'm trying to send a message to a IBM MQ queue from my spring boot service. Configuration is as follows:Application.propertiesibm.mq.queueManager=QM1\nibm.mq.queue=DEV.QUEUE.1\nibm.mq.channel=DEV.APP.RECEIVER\nibm.mq.host=localhost\nibm.mq.port=1414ConectionFactory Bean@Bean\n public MQQueueConnectionFactory mqQueueConnectionFactory() {\n MQQueueConnectionFactory mqQueueConnectionFactory = new MQQueueConnectionFactory();\n mqQueueConnectionFactory.setHostName(host);\n try {\n mqQueueConnectionFactory.setTransportType(WMQConstants.ADMIN_QUEUE_DOMAIN);\n mqQueueConnectionFactory.setCCSID(1208);\n mqQueueConnectionFactory.setChannel(channel);\n mqQueueConnectionFactory.setPort(port);\n mqQueueConnectionFactory.setQueueManager(queueManager);\n } catch (Exception e) {\n e.printStackTrace();\n }\n return mqQueueConnectionFactory;\n }IBM MQ Explorer picturesqueuechannellistenerWhen i try to send a message i get the error:'2' ('MQCC_FAILED') raz\u00f3n '2539' ('MQRC_CHANNEL_CONFIG_ERROR').What i'm missing? The error sugest than my chammel type is not adecuate to my request, but i don't know waht does it means.Thanks in advance.### Assistant: Client programs connect to SVRCONN channels, not RECEIVERs.\n"} +{"text": "### Human: Client Details:The issues occurs with code acting as a producer pushing messages into IBM MQ queues and topics. The producer is exposed as a REST interface using WebApi2 and is deployed on IIS. We are using C# .NET (4.5.2) client to connect to IBM MQ. We connect using the CCDT file AMQCLCHL.TAB to get the client connection details. The underlying libraries used are Apache NMS (1.8.0.4573) and IBM XMS (2.5.0.3).Exception Received:CWSMQ0006E: An exception was received during the call to the method ConnectionFactory.CreateConnection: CompCode: 2, Reason: 2058.Error Details:The client correctly works and we are able to push hundred thousands messages through to MQ queues and topics. However, after a random period of time ranging from few hours to more than 1 week, the client starts failing with the error noted above. Few more details:The error is resolved by restarting the IIS pool or reloading the applicationConnecting to the same MQ server from another client (IIS server 2) continues to work when first client (IIS server 1) continues to have issuesError seen in AMQERR01.LOG file.AMQ9516: File error occurred.\n\nEXPLANATION: The filesystem returned error code 6 for file'\\\\...\\AMQCLCHL.TAB'. \n\nACTION: Record the name of the file '\\\\...\\AMQCLCHL.TAB' and tell the systems administrator, who should ensure that file '\\\\...\\AMQCLCHL.TAB' is correct and available.Error code 6 isERROR_INVALID_HANDLE.### Assistant: This happens when the connection was closed (could be remote server restart, network issues, etc...). This really takes me back - I remember dealing with this back in 2002 connecting a Java J2EE application to MQ on an OS/390.Recently IBM has implemented auto reconnect settings that can be set in the CCDT or manually on the C# object. This is summarized on theXMS page, andthe documentation for implementing that is here.The properties Client Reconnect Options, Client Reconnect Timeout, and Connection Namelist can also be set via Client Channel Definitions Table (CCDT) or by enabling the client reconnection via the mqclient.ini file.\n"} +{"text": "### Human: I am running below command from (commandline only not web client) Webspere MQ client v 8.0.0.9 and i am not able to connect MQ server/opt/mqm/samp/bin/amqsgetc Q-name Q-manageri am exportingexport MQCHLTAB=xxx.TAB ---------xxx.TAB under /var/mqm\nexport MQCHLLIB=/var/mqm\nexport MQSSLKEYR=/var/mqm/ssl/cms/cert -------- cert.kdb under cms dir using\nexport MQSERVER=channel-name/TCP/'xx.xx.xx.xx(xxx)'Error i am getting is07/04/2018 09:22:20 AM - Process(6024.1) User(username) Program(amqsgetc)\n Host(hostname) Installation(Installation1)\n VRMF(8.0.0.9) QMgr(.)\n\nAMQ9641: Remote CipherSpec error for channel 'ch-name' to host\n'MQ-server-ip(port)'.\n\nEXPLANATION:\nThe remote end of channel 'ch-name' on host 'MQ-server-ip(port)' has had\na CipherSpec error. The channel did not start.\nACTION:\nReview the error logs on the remote system to discover the problem with the\nCipherSpec.\n----- cmqxrfpt.c : 573 --------------------------------------------------------### Assistant: The short answer is to remove theMQSERVERenvironment variable. For further details and references read below.If you specify theMQSERVERenvironment variable MQ will only use this information and ignore the the CCDT environment variables (MQCHLLIBandMQCHLTAB).This is referenced in the IBM MQ Knowledge Center pageConfiguring > Configuring connections between the server and clients > Using IBM MQ environment variables > MQSERVER > Using MQSERVER.If you use the MQSERVER environment variable to define the channel\n between your IBM\u00ae MQ MQI client machine and a server machine, this is\n the only channel available to your application, and no reference is\n made to the client channel definition table (CCDT).Further information on how MQ application will determine connection details is referenced in the IBM MQ Knowledge Center pageDeveloping applications > Developing MQI applications with IBM MQ > Writing client procedural applications > Running applications in the IBM MQ MQI client environment > Connecting IBM MQ MQI client applications to queue managersWhen an application running in an IBM MQ client environment issues an\n MQCONN or MQCONNX call, the client identifies how it is to make the\n connection. When an MQCONNX call is issued by an application on an IBM\n MQ client, the MQI client library searches for the client channel\n information in the following order:Using the contents of the ClientConnOffset or ClientConnPtr fields of the MQCNO structure (if supplied). These fields identify the\n channel definition structure (MQCD) to be used as the definition of\n the client connection channel. Connection details can be overridden by\n using a pre-connect exit. For more information, see Referencing\n connection definitions using a pre-connect exit from a repository.If the MQSERVER environment variable is set, the channel it defines is used.If an mqclient.ini file is defined and contains a ServerConnectionParms, the channel that it defines is used. For more\n information, see Configuring a client using a configuration file and\n CHANNELS stanza of the client configuration file.If the MQCHLLIB and MQCHLTAB environment variables are set, the client channel definition table they point to is used.If an mqclient.ini file is defined and contains ChannelDefinitionDirectory and ChannelDefinitionFile attributes, these\n attributes are used to locate the client channel definition table. For\n more information, see Configuring a client using a configuration file\n and CHANNELS stanza of the client configuration file.Finally, if the environment variables are not set, the client searches for a client channel definition table with a path and name\n that are established from the DefaultPrefix in the mqs.ini file. If\n the search for a client definition table fails, the client uses the\n following paths:UNIX and Linux systems: /var/mqm/AMQCLCHL.TABWindows: C:\\Program Files\\IBM\\WebSphere MQ\\amqclchl.tabIBM i: /QIBM/UserData/mqm/@ipccIBM MQ Appliance: _AMQCLCHL.TAB. They appear under the mqbackup:// URI.You cannot specify Cipherspec using theMQSERVERenvironment variable. This is referenced in the IBM MQ Knowledge Center pageConfiguring > Configuring connections between the server and clients > Using IBM MQ environment variables > MQSERVERMQSERVER environment variable is used to define a minimal channel.\n MQSERVER specifies the location of the IBM\u00ae MQ server and the\n communication method to be used.You cannot use MQSERVER to define an SSL channel or a channel with\n channel exits. For details of how to define an SSL channel, see\n Protecting channels with SSL.\n"} +{"text": "### Human: We are using IBM MQ XMS C# client ver 9.0 (on .NET 4.6.2 framework) to work with IBM MQ. I just need to know of all the messages on a given queue without removing them off the queue.We also got the Consumers set up for the queue. Need both consumers & browsers working in tandem. Browser should not remove messages but still need to get all the messages.So I have set up a QueueBrowser like below, but queueBrowser.GetEnumerator() doesn't get messages at all.With the same code if Create a MessageConsumer and attach a listener, it will get the messages posted the queue. So issue with QueueBrowser only.Can anyone point out why its happening like this. Why queueEnumerator.MoveNext() always return false, indicating no messages on the queue.XMSFactoryFactory xMSFactoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\n\n // Create WMQ Connection Factory.\n IConnectionFactory connectionFactory = xMSFactoryFactory.CreateConnectionFactory();\n\n connectionFactory.SetStringProperty(XMSC.WMQ_HOST_NAME, \"hostname\");\n connectionFactory.SetIntProperty(XMSC.WMQ_PORT, portNumber);\n connectionFactory.SetStringProperty(XMSC.WMQ_CHANNEL, \"channelName\");\n connectionFactory.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);\n connectionFactory.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, \"QueueManagerName\");\n\n // Create connection.\n connectionWMQ = connectionFactory.CreateConnection();\n connectionWMQ.ExceptionListener = new ExceptionListener(OnXMSException);\n\n // Create session\n ISession sessionWMQ = connectionWMQ.CreateSession(false, AcknowledgeMode.AutoAcknowledge);\n\n IDestination destination = sessionWMQ.CreateQueue(\"QueueName\"); \n\n\n IQueueBrowser queueBrowser = sessionWMQ.CreateBrowser(destination);\n\n connectionWMQ.Start();\n\n Thread thread = new Thread(KeepBrowsingMessaegs);\n thread.Start();\n\n --end of the method\n\n private void KeepBrowsingMessaegs()\n {\n IEnumerator queueEnumerator = queueBrowser.GetEnumerator();\n while (!cancellationTokenSource.IsCancellationRequested)\n {\n\n if (queueEnumerator.MoveNext())\n {\n ITextMessage textMessage = queueEnumerator.Current as ITextMessage;\n if (textMessage != null)\n {\n System.Diagnostics.Trace.Write(textMessage);\n }\n }\n }\n }### Assistant: OP mentioned the following in the comments:We have consumers running to read the message as part of business case and want to set up browser so that we just get a copy of message so that we can track it in a separate application to log of all the message received.I am providing some options below.Option 1Do not have a separate application just for the purpose of log the messages received, instead have your \"business case\" application log the messages as part of the processing.Option 2Setup two queues, the first would receive the inbound messages and be consumed by an application that would log the messages and then put a copy of it to a second queue which would be consumed by your \"business case\" application.Option 3Use IBM MQ pub/sub features to create two copies of the message, one of which will be consumed by an application that would log the messages and the other would be consumed by your \"business case\" application. Note this only copies the message body, the MQ Message Descriptor (MQMD) which is meta data about the messages (things like put time, put date, message id, userid) will not be duplicated. Many apps do not look at the MQMD so it may not be a issue for you.The setup would look like this:Create aQALIASfor the inbound messages, this alias will point to a topic string by specifying the target is a topic object:DEFINE QALIAS(INBOUND.QUEUE) TARGET(INBOUND.TOPIC) TARGTYPE(TOPIC)Define theTOPICobject:DEFINE TOPIC(INBOUND.TOPIC) TOPICSTR(INBOUND/TOPIC)Create twoQLOCALobjects, one to be consumed by the application that would log the messages and the other to be consumed by your \"business case\" application:DEFINE QLOCAL(INBOUND.QUEUE.LOGGER)\nDEFINE QLOCAL(INBOUND.QUEUE.PROCESSOR)Define two administrativeSUBSCRIPTIONobjects to subscribe both queues to the topic topic string:DEFINE SUB(INBOUND.QUEUE.LOGGER.SUB) TOPICSTR(INBOUND/TOPIC) DEST(INBOUND.QUEUE.LOGGER)\nDEFINE SUB(INBOUND.QUEUE.PROCESSOR.SUB) TOPICSTR(INBOUND/TOPIC) DEST(INBOUND.QUEUE.PROCESSOR)The result of the above setup is that every message that is put to a queue calledINBOUND.QUEUEwill have a copy published to the two queuesINBOUND.QUEUE.LOGGERandINBOUND.QUEUE.PROCESSOR.Option 4You could setup threeQLOCALobjects, one would be the queue for inbound messages, you would have a program read from this queue and then write a copy of the message to the other two queues. There is an open source tool maintained by Capitalware calledMessage Multiplexer (MMX)which can read from a source queue and write to one or more queues, this does duplicate the MQMD along with the message body.The setup would look like this:Create threeQLOCALobjects, the first one to be consumed an application which will make a copy to the second to be consumed by the application that would log the messages and the third to be consumed by your \"business case\" application:DEFINE QLOCAL(INBOUND.QUEUE)\nDEFINE QLOCAL(INBOUND.QUEUE.LOGGER)\nDEFINE QLOCAL(INBOUND.QUEUE.PROCESSOR)Option 5There is a commercial product calledMQ Message Replication (MQMR)that can make an exact copy of the message going to your \"business case\" application queue to one or more other queues using a MQ API exit. I have not used this personally but the setup would be just two QLOCAL queues, the first would be consumed by your \"business case\" application, the second would be consumed by the application that would log the messages.DEFINE QLOCAL(INBOUND.QUEUE)\nDEFINE QLOCAL(INBOUND.QUEUE.LOGGER)\n"} +{"text": "### Human: I could successfully connect to IBM MQ from a camel route and initialize the connection factory bean but now I want to connect with SSL.I create the key store on the server side for the queue manager and create the certificate and add it to it.I create a trust store on the client side and add the certificate to it.And now I want the MQ connection factory to refer to the trust store while connecting to the server.Here is what I tried:\n \n \n \n \n \n \n \n But this doesn't work. The following exception was returned:JMSWMQ0018: Failed to connect to queue manager 'QM_TEST_SSL' \n with connection mode 'Client' and host name '10.3.13.161(1415)'.; \n nested exception is com.ibm.mq.MQException: JMSCMQ0001: \n WebSphere MQ call failed with compcode '2' ('MQCC_FAILED')\n reason '2397' ('MQRC_JSSE_ERROR').Can anyone please help to direct me how to do that?### Assistant: From a security standpoint the Client should only receive generic error messages which could relate to a number of problems. The best place to find out exactly why you client was rejected is the Queue Manager logs. I would suggest looking there to see if there are any errors that help you further determine the problem.\nFrom the info given i can think of 3 problems it could be:The Queue Manager channel is set with an attribute of SSLCAUTH(REQUIRED) however from the description you've given here the client doesn't appear to be using it's own certificate to connect. SSLCAUTH(REQUIRED) will mean that the Queue Manager will only accept connections on the particular channel where the client is connecting with a certificate it trusts. Check the channel definition and setSSLCAUTH(OPTIONAL)Depending on your version of IBM MQ the CipherSpec you have used (SSL_RSA_WITH_NULL_MD5) is considered weak and will not be accepted by default. You can reenable these deprecated CipherSpecs and the instructions on how to do so can be found on thefollowing Knowledge Center pageThe truststore \"C:/Servers/TrustStore/truststore.jks\" is not being picked up by the client and so the client cannot trust the Queue Manager's certificate. Double check the path you have supplied and remove the \"file:\" you have added to the path (unless you were specifically instructed to include it).\n"} +{"text": "### Human: I am trying to connect to Queue Manager using MQ api and I am able to connect to queue managerMQQueueManager queueManager=new MQQueueManager(qmgrName);\nqueueManager.accessQueue(qName,MQOO_OUTPUT);But when I try to connect to the same queue manager using JMS it fails with 2058 code.Not sure if I am missing something with JMSMQQueueConnectionFactory qcf=new MQQueueConnectionFactory();\n qcf.setQueueManager(qmgrName);\n qcf.setPort(1414);\n qcf.setHostname(\"localhost\");\n qcf.createQueueConnection();### Assistant: You have two or more queue managers on the local host. In your first example you connect in bindings mode so the queue manager is selected by name and you get the right one. In the second example the connection is being made over a client connection and so is received by the QMgr listening on 1414 which is not the one that you intend so the connection is rejected.Please note that if both QMgrs have a listener on 1414 the connection will succeed or fail depending on which QMgr was started first. Only one can bind to that port so the first one started on it gets to use it. This might lead to what appears to be inconsistent behavior.Please seeConnection modes for IBM MQ classes for JMSwhich advises \"To change the connection options used by the IBM MQ classes for JMS, modify the Connection Factory propertyCONNOPT.\" The acceptable values are provided on the page but you almost always want it to set for Standard Bindings (MQCNO_STANDARD_BINDING).\n"} +{"text": "### Human: As stated in the title. I have queue manager with IPADDR configured as (IPV4). However any time I start listener on that queue manager it listens trough TCP6.WebSphere Version: 7.5### Assistant: Please note the documentation on theMigrating a queue manager to IPv6page which states that:The preferred IP version that two systems use for communicating (if\n both IPv4 and IPv6 are available) is determined by a new queue manager\n attribute IPADDRV.This parameter only has an effect if the hostname\n resolves ambiguously to both an IPv4 address and an IPv6 address.(Emphasis added.) Note that a parameter whose effect depends on resolving a DNS name would apply mainly tooutboundconnections.What you want is theIPADDRparameter of theDEFINE LISTENERcommand which states:IP address for the listener specified in IPv4 dotted decimal, IPv6\n hexadecimal notation, or alphanumeric host name form. If you do not\n specify a value for this parameter, the listener listens on all\n configured IPv4 and IPv6 stacks.This is the exception to theIPADDRVguidance about name resolution applying to outbound connections. If you put a DNS name in theIPADDRof the listener, then the listener will use whichever IP version address to which that name resolves, or if it resolves to both IPV4 and IPV6 will take the version set inIPADDRV.Since you reportIPADDRVas having no effect then the listener is either bound to an IPV6 address or DNS name, or else the listener is not bound to any particular address and is listening promiscuously on all interfaces.\n"} +{"text": "### Human: ByIn MQ HA server (multi-instance) both the queue managers shows the status us Running Else where.\nUnable to stop or start the queue manager.\nNo queue manager logs or error logs are getting created.\nMQ file system seems to be good.### Assistant: Verify that you have the latest fixpack installed to be sure you have fix forAPAR IV50422which reports a multi-instance queue manager as running elsewhere when it is not.Please also confirm the shared file system you are using meets therequirements.The way that the MQ multi-instance feature works is as follows:One qmgr is started on one node. Another qmgr is started on another \nnode. Both qmgrs access the same qmgr data. Both try to get the lock on \nthe same \"master\" file. The successful qmgr regards itself as the active\nqmgr, writes identification information into the \"master\" file, and \nholds onto the lock. It commences full running as the active qmgr.The unsuccessful qmgr regards itself as the standby qmgr and simply \nretries trying to obtain the lock on \"master\".The active qmgr \"monitors\" the \"master\" file, reading it every 10s to \ncheck that the information it wrote into it when it became the active \nqmgr is unchanged.If the active qmgr ends for whatever reason, the lock on \"master\" is \ndropped and the standby qmgr then gains the lock and becomes the active \nqmgr, writing its info into \"master\" and starting up full running.It seems to me your problem may be with the lock on the master file. \nThe switching between active and standby queue managers is governed by \nlocks on files (\"active\", \"master\" and \"standby\") in the queue manager \ndata directory.In WebSphere MQ the following files are created by the queue manager /var/mqm/qmgrs/QMGR/active /var/mqm/qmgrs/QMGR/master These files contain status information. \nPlease check to see if these files are locked and if you are unable to \nrelease the file lock.There are 4 files that come into play to determine what mode and status \nmulti-instance qmgrs are in: \namqmfsck.lck, active, standby, master. These files are used by various \nmq process to determine status and functions of the qmgrs. Check the status of those files, as they may falsely be indicating qmgr as running when it is not.\n"} +{"text": "### Human: I have written an ant script to transfer a single file using IBM WebSphere MQ File Transfer Edition.\n \n \n \nFor two files, the script would look like below:\n \n \n \n \nHow can I modify the script so that it can support multiple files by accepting a string (e.g. a.txt,b.txt,c.txt) as parameter?### Assistant: How can I modify the script so that it can support multiple files?Since your example already sends multiple files, presumably you are asking how to transfer avariablenumber of files to be determined at run time. There are a few options.Use a wildcarded filespec. All matching files will be transferred.Transfer an entire directory recursively.Dynamically generate the file transfer XML so as to include a filespec for each individual file.Use a monitor that starts file transfers based on trigger criteria.Based on the update, the requirement is to pass a string containing file names. Most likely, you will want to use Option #3 above. Pass the string of file names to something that can parse them, then generate the XML. This can be done with shell scripting, or in Ant using something likeant-contrib, or many other ways. There is nothing in the XSD for MQMFT that allows specification of file names natively as a delimited string.\n"} +{"text": "### Human: When using IBM.XMS to send messages to a topic that does not exist no exception is thrown. When trying the same with a queue, I am kindly notified that the queue manager or queue don't exist.This is how I create a connection and send messages to a topic:XMSFactoryFactory xmsFactoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\nIConnectionFactory ibmConnectionFactory = xmsFactoryFactory.CreateConnectionFactory();\nibmConnectionFactory.SetStringProperty(XMSC.WMQ_HOST_NAME, \"frimasrv\");\nibmConnectionFactory.SetIntProperty(XMSC.WMQ_PORT, 1415);\nibmConnectionFactory.SetStringProperty(XMSC.WMQ_CHANNEL, \"CH1\");\nibmConnectionFactory.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);\nibmConnectionFactory.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, \"API\");\n\nIConnection connection = ibmConnectionFactory.CreateConnection();\nconnection.ClientID = \"client id\";\nISession session = connection.CreateSession(false, AcknowledgeMode.AutoAcknowledge);\n\nIDestination destination = session.CreateTopic(\"this.does.not.exist\");\nIMessageProducer producer = session.CreateProducer(destination);\nIMessageConsumer durableConsumer = session.CreateDurableSubscriber(destination, \"subscriptionName\");\n\nIMessage myMessage = session.CreateTextMessage(\"text\");\nproducer.Send(myMessage);Supplement the call of session.CreateTopic(...) with session.CreateQueue(...) and session.CreateProducer(...) will fail. This is the behaviour I also expect when using topics.My questions are:How come that no problems arise when sending to a topic that does not exist? \nIs part of my configuration wrong?\nIs there some other way to verify if a topic actually exists?### Assistant: How come that no problems arise when sending to a topic that does not\n exist?Because the moment you send a message to a topic or subscribe to a topic it exists. The queue manager will auto-vivify it for you.According to the JMS 2.1 specification:Some products require that topics be statically defined with\n associated authorization control lists, and so on; others don\u2019t even\n have the concept of topic administration.IBM MQ is one of the products that does not require topics to be statically defined.You may have misunderstood IBM MQ's use of topic objects. These do not define the topics themselves, but rather they provide a pointer to the place in the topic hierarchy where an access control list applies. For example, consider the following topic hierarchy:Produce\n Fruits\n Apple\n Banana\n Cranberry\n Vegetables\n Asparagus\n Beet\n CeleryIf youdefine a topicFruitsand point it at the topic stringProduce/Fruitsyou can then authorize people to publish or subscribe to the portion of the topic tree from Produce/Fruits on down. Those with the authorization will not be able to accessProduce/Vegetablesunless you provide them access through a topic object pointing there.As a rule, it is best to define topic objects all at a certain level of the topic tree. As you can see above, defining a topic object atProducegrants access to the entire topic tree, but you need only one topic object. Define the objects at the second level and you need two to cover the tree (one atFruitsand one atVegetables) but have more granularity in the security model. Define the topics at the third level and you have extreme granularity, but also have many more topic objects to administer.IBM MQ defines a default topic objectSYSTEM.BASE.TOPICwhich points to the root of the global topic space. Anyone with access toSYSTEM.BASE.TOPICcan access any topic. By default, this includes only MQ administrators.If you define a topic calledFruitsand point it at the topic stringProduce/Fruitsthen you have two choices when you want to open that topic. If you open the topicobjectwhich results in IBM MQ substituting the topicstringto which the object points. You can also open the topicstringdirectly. Either of these results in the same effective authorization since IBM MQ always authorizes based on the final topic string.If you specify both a topic objectanda topic string, the topic string in the defined object is used as the prefix to the string that you provide. The two are concatenated to produce the full topic string. For example, if you specify both the topic objectFruits(which points to the stringProduce/Fruitsin the example above)andthe stringProduce/Fruits, MQ concatenates these and vivifies a topic calledProduce/Fruits/Produce/Fruits. Try not to do that. IF you do need to do that, make sure you understand the mechanics as described in theCombining topic stringspage.If you check the IBM MQ Pub/Sub API or the IBM implementation of the topic connection factory, you will see that these contain two fields, one for the topic object and one for the topic string.When you specify a topicobjectin your connection factory, that objectmustexist. Specify a topicstringand MQ will auto-vivify it for you if you are authorized to that string.I am guessing the ID you are using has admin rights or has been granted access toSYSTEM.BASE.TOPICsince you are able to publish at all. You will therefore not receive any errors for any topic string to which you publish.Please see also theTopic Stringspage in the manual for a general background of how IBM MQ manages topics.\n"} +{"text": "### Human: Tomcat has a built-in JDBC connection pooling, but unfortunately no built-in JMS connection pooling.We are migrating a legacy Tomcat web application from WebSphere MQ version 6 to 7. \nUnfortunately, connection pooling has been removed in WebSphere MQ 7 as described here:http://www-01.ibm.com/support/docview.wss?uid=swg21665128Now we are afraid that we will run into troubles if we just use the following code for configuring MQ in Tomcat:The reason for our concerns is that this will not use a pooled JMS provider when using MQ 7. For details, see alsohttp://activemq.apache.org/jmstemplate-gotchas.htmlAlternative solutions we see are:1) Use of AtomikosAtomikos has a com.atomikos.jms.AtomikosConnectionFactoryBean that can be used instead of MQQueueConnectionFactory\nBut using an XA transaction manager is a huge overhead when we don't need XA2) Use Spring's CachingConnectionFactorylooks like a good solution, but unfortunately our legacy application does not use Spring.\nSo we assume that using CachingConnectionFactory would mean quite some effort.3) Use Apache Commons Poollooks promising too, but implementing it correctly for JMS will require some good JMS knowledgeOur questions:is there a JMS provider that can be used to wrap MQQueueConnectionFactory and that will pool connections, sessions, producers and consumers?did anyone succeed in implementing one of the alternative solutions we outlined above?### Assistant: As proposed by Umapathy in option 3, we now opted for the approach using Spring's CachingConnectionFactory, and it works well even for a non-Spring application. All you need to do is add the Spring Jars to the classpath, and wrap the MQQueueConnectionFactory with a CachingConnectionFactory.We chose to create our own Tomcat QueueConnectionFactoryFactory that enables us to leave the original application code completely untouched, you just need to replace the original MQ connection factory from the Tomcat configuration file (shown above in the question) with the following XML definition:Here is the (simplified) code (without error checking) for the RSFCachingMQQueueConnectionFactoryFactory:public class RSFCachingMQQueueConnectionFactoryFactory implements ObjectFactory{\n\npublic Object getObjectInstance (Object obj, Name name, Context nameCtx, Hashtable environment)\n throws NamingException {\n Reference ref = (Reference) obj;\n String beanClassName = ref.getClassName();\n Class beanClass = Class.forName(beanClassName);\n if (CachingConnectionFactory.class.isAssignableFrom(beanClass)){\n MQQueueConnectionFactoryFactory cff = new MQQueueConnectionFactoryFactory();\n Reference mqReference = new Reference(\n MQQueueConnectionFactory.class.getName());\n\n Enumeration allAddrs = ref.getAll();\n while (allAddrs.hasMoreElements()){\n mqReference.add(allAddrs.nextElement());\n }\n\n MQQueueConnectionFactory cf = (MQQueueConnectionFactory)cff.getObjectInstance(mqReference, name, nameCtx, environment);\n CachingConnectionFactory ccf = (CachingConnectionFactory)beanClass.newInstance();\n ccf.setTargetConnectionFactory(cf);\n return ccf;\n }\n }\n"} +{"text": "### Human: Currently on our Tomcat configuration with JNDI is based on this recommendation which currently is working.How do I connect to a Websphere MQ (MQ Series) server using JMS and JNDI?Since we are upgrading to v8 I would like to take advantage of the JMS 2.0 features. This would require updating the jar files to the JMS 2.0 versions.So I have removed the following jars from the tomcat lib folder.com.ibm.mq.jarcom.ibm.mqjms.jarconnector.jardhbcore.jargeronimo-j2ee-management_1.0_spec-1.0.jargeronimo-jms_1.1_spec-1.0.jarAnd replaced them with these jars. Base on thislinkcom.ibm.mq.allclient.jarcom.ibm.mq.traceControl.jarMy JNDI configuration matches this configuration.\"\n PORT=\"1414\"\n CHAN=\"\"\n TRAN=\"1\"\n QMGR=\"\"/>Now with the updated jar files I'm getting the following exceptions.Caused by: java.lang.NoClassDefFoundError: javax/jms/JMSRuntimeException\n at com.ibm.mq.jms.MQQueueConnectionFactoryFactory.getObjectInstance(MQQueueConnectionFactoryFactory.java:69)\n at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:141)\n at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)\n at org.apache.naming.NamingContext.lookup(NamingContext.java:842)\n at org.apache.naming.NamingContext.lookup(NamingContext.java:153)\n at org.apache.naming.NamingContextBindingsEnumeration.nextElementInternal(NamingContextBindingsEnumeration.java:117)\n at org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:71)\n at org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:34)\n at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:138)\n at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:110)\n at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:82)\n at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)\n at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)\n at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)\n at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:347)\n at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:724)\n at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)\n ... 7 moreQuestions:Should I be including another jar file to the class path?Or has the configuration of JNDI changed for v8?### Assistant: Please doNOTtry adding the JMS Jar found in the MQ installation. IBM has as of v8.0 repackaged JMS so that a stand-alone install of the jar files is now supported. But only if you use the complete and intact set of jars and do not mix and match them on a whim. To do so would be reckless and ill-advised.You are on the right track but for your purposes I would go grab the file fromthe latest 8.0.0.x MQ Client Fix Pack. I would then go tothe Technote that explains the install procedureand try that.I'm sure that IBM has a process for grabbing jars from the server install, however since these appear to be packaged differently, I'd put my money on the package designed and tested for stand-alone delivery - e.g. the one I linked to above.By the way, since this is now supported if it doesn't work you can open a PMR, tell IBM you followed their instructions to the letter, and make them walk through fixing it with you. (Then post here what it was that fixed it.)But they won't do that if you just go grabbing random jar files and hope it works.\n"} +{"text": "### Human: Just want to confirm the correct way the MQ delivers messages to the MQOutput node. Recently came across a situation where i a felt bit confused. Here is the scenario.I have a local queue on Qmgr,say(A) which receives messages from applications and have a local broker associated with this qmgr(A) with a message flow deployed, which consumes messsages from this queue and drops it to another local(L.B) queue on Queue manager (B).To successfully deliver the messages to qmgr(B) do i have toCreate a remote queue definition on Qmgr(A) with transmission queue name matching the remote queue manager name, here(B) \nMQOutput node value set as, queue->remote queue definition name on (A) and queue manager value as blankorto create only the transmission queue that matches with the name of the remote queue manager name, here(B).\nMQOutput node value set as queue-> target local queue (L.B) and Queue manager value as (B).When i follow with the first process, noticed messages reaching the destination and when i follow with the later one, noticed messages sitting up in the local queue itself.Is there any necessity to always create 'n' number of remote queue definitions when it needs to drop messages to 'n' number of local queues?Kindly guide me to better understand this. Thanks in advance to each of you.### Assistant: There is no necessity to create n remote queue definitions, MQ is happy to accept output marked as destined for \"Queue Name\" on \"Queue Manager Name\".You say that when using method 2. that your messages are \"sitting up in the local queue\". There are a few things you must check to solve this problem.I assume the named queue L.B is defined on QMgr B and not QMgr A?I assume the local queue the messages are sitting on is a transmission queue?Have you defined a channel to read messages from the transmission queue they are stuck on?Have you started the channel which should be moving the messages off the transmission queue to QMgr B?\n"} +{"text": "### Human: We are working on Integrating websphere MQ with boomi,The Configuration in Boomi for JMS connector is as follows:For JMS Connection :Authentication Present:\nUser : adminstrator\npassword : xxxxx\nJMS Server : Websphere MQ\nConnection type : Single QM connection\nQueue Manager : BoomiQMGR\nChannel Name : BoomiSCFor JMS operation:Destination : queue:BoomiQ(where BoomiQ is the Queue Name, \"queue:\" as mentioned in the boomi Documentation)But the Problem is, \nwith these configuration we encounter the below error in boomi:*\"Test execution of TestProcess completed with errors. Embedded message: Unable to retrieve JMS message; Caused by: JMSCC0005: The specified value 'queue:BoomiQ' is not allowed for 'XMSC_DESTINATION_NAME'.\"From what we can tell in reading around this occurs due to WebSphere MQ destination naming restrictions, we are using WEBSPHERE version : WS_MQ_V8.0_TRIAL_FOR_WINDOWS_ML(downloaded from IBM Site)Can someone help us out on this?Please suggest if we are missing anything.\nThanks in Advance.### Assistant: The problem looks to be the format of the Queue Name: queue:BoomiQ isn't valid for the WMQ JMS client.If the Queue on the QueueManager was say MyQueue, then either ensure that MyQueue is passed to JMS or queue:///MyQueue.\n"} +{"text": "### Human: I'm new to active MQ.I have a requirement to create a local Active MQ and connect it to a remote IBM MQ.Can anyone help me on how to connect to Distributed Queue manager and Queues .### Assistant: You can use Apache Camel to bridge between the two providers. The routes can be run from within the broker, pull from the ActiveMQ queue and push to the WMQ Queue (or the other way around). The concept is almost like the concept of a Channel in WMQ pulling from a transmit queue and pushing it to the appropriate destination on the remote queue manager.Assuming you are using WMQ V7+ for all QMgrs and Clients, its simply a matter of learning how to set up the route and configure the connection factories. Older versions of WMQ and you may have to understand how to deal with RFH2 headers for native WMQ clients if they are the consumers.The most simple route configured in spring would look like:\n \n \nThe \"wmq\" and \"amq\" would point to beans where the JMS components are configured. This is where you would set up you connection factories to each provider and how the clients behave (transacted or not for example), so I'll hold off on giving an example on that.This would go in the camel.xml (or whatever you name it) and get imported from your broker's XML. ActiveMQ comes with several examples you can use to get you started using Camel JMS components. Just take a look at the default camel.xml that comes with a normal install.\n"} +{"text": "### Human: Is there a way to find the total number of messages that pass through an IBM websphere MQ queue manager over a specific period of time?### Assistant: This sounds like a perfect use of the MQ Accounting and Statistics feature. Among other things, these features record the number of messages (with a persistent and non-persistent count) and also number of bytes (not all messages are the same size).You can turn on Accounting and Statistics for just a selection of queues and/or channels or for everything.Further Reading:Accounting and statistics messagesTurning on Queue AccountingTurning on Queue StatisticsSupplied tool to view the output\n"} +{"text": "### Human: I'm trying to configure a clustered websphere application server that connects to a clustered MQ.However, the the information I have is details for two instances of MQ with different host names, server channels and queue manager which belongs to the same MQ cluster name.On the websphere console, I can see input fields for hostname, queue manager and server channel, I cannot find anything that I can specify multiple MQ details.If I pick one of the MQ detail, will MQ clustering still work? If not, how will I enable MQ clustering given the details I have?### Assistant: WebSphere MQ clustering affects the behavior of how queue managers talk amongst themselves. It doesnotchange how an application connects or talks to a queue manager so the question as asked seems to be assuming some sort of clustering behavior that is not present in WMQ.To set up the app server with two addresses, please seeConfiguring multi-instance queue manager connections with WebSphere MQ messaging provider custom propertiesin the WAS v7 Knowledge Center for instructions on how to configure a connection factory with a multi-instanceCONNAMEvalue.If you specify a valid QMgr name in the Connection Factory and the QMgr to which the app connects doesn't have that specific name then the connection is rejected. Normally a multi-instanceCONNAMEis used to connect to a multi-instance QMgr. This is a single highly available queue manager that can be at one of two different IP addresses so using a real QMgr name works in that case. But if the QMgrs to which your app is connecting are two distinct and different-named queue managers, which is what you described, you should specify an asterisk (a*character) as the queue manager name in your connection factory as describedhere. This way the app will not check the name of the QMgr when it gets a connection.If I pick one of the MQ detail, will MQ clustering still work? If not,\n how will I enable MQ clustering given the details I have?Depends on what you mean by \"clustering\". If you believe that the app will see one logical queue which is hosted by two queue managers, then no. That's not how WMQ clustering works. Each queue manager hosting a clustered queue gets a subset of messages sent to that queue. Any apps getting from that queue will therefore only ever see the local subset.But if by \"clustering\" you intend to connect alternately to one or the other of the two queue managers and transmit messages to a queue that is in the same cluster but not hosted on either of the two QMgrs to which you connect, then yes it will work fine. If your Connection Factory knows of only one of the two QMgrs you will only connect to that QMgr, and sending messages to the cluster will still work. But set it up as described in the links I've provided and your app will be able to connect to either of the two QMgrs and you can easily test that by stopping the channel on the one it connects to and watching it connect to the other one.Good luck!UPDATE:To be clear the detail provide are similar to hostname01, qmgr01,\n queueA, serverchannel01. And the other is hostname02, qmgr02, queueA,\n serverchannel02.WMQ Clients will connect to two different QMgrs using a multi-instanceCONNAMEonly when...The channel name used on both QMgrs is the exactly the sameThe application uses an asterisk (a*character) or a space for the QMgr name when the connection request is made (i.e. in the Connection Factory).It is possible to have WMQ connect to one of several different queue managers where the channel name differs on each by using a Client Connection Definition Table, also known as a CCDT. The CCDT is a compiled artifact that you create usingMQSCcommands to defineCLNTCONNchannels. It contains entries for each of the QMgrs the client is eligible to connect to. Each can have a different QMgr name, host, port and channel. However, when defining theCCDTthe administrator defines all the entries such that the QMgr name is replaced with the application High Level Qualifier. For example, the Payroll app wants to connect to any 1 of 3 different QMgrs. The WMQ Admin defines a CCDT with three entries but usesPAY01,PAY02, andPAY03for the QMgr names. Note this does not need to match the actual QMgr names. The application then specifies the QMgr name asPAY*which selects all three QMgrs in the CCDT.Please seeUsing a client channel definition table with WebSphere MQ classes for JMSfor more details on the CCDT.Is MQ cluster not similar to application server clusters?No, not at all.Wherein two-child nodes are connected to a cluster. And an F5 URL will\n be used to distribute the load to each node. Does not WMQ come with a\n cluster url / f5 that we just send message to and the partitioning of\n messages are transparent?No. The WMQ cluster provides a namespace within which applications and QMgrs can resolve non-local objects such as queues and topics. The only thing that ever connects to a WebSphere MQ cluster is a queue manager. Applications and human usersalwaysconnect to specific queue managers. There may be a set of interchangeable queue managers such as with the CCDT, but each is independent.With WAS the messaging engine may run on several nodes, but it provides a single logical queue from which applications can get messages. With WMQ each node hosting that queue gets a subset of the messages and any application consuming those messages sees only that subset.HTTP is stateless and so an F5 URL works great. When it does maintain a session, that session exists mainly to optimize away connection overhead and tends to be short lived. WMQ client channels are stateful and coordinate both single-phase and two-phase units of work. If an application fails over to another QMgr during a UOW, it has no way to reconcile that UOW.Because of the nature of WMQ connections, F5 isneverused between QMgrs. It is only used between client and QMgr for connection balancing and not message traffic balancing. Furthermore, the absence or presence of an MQ cluster is entirely transparent to the application which, in either case, simply connects to a QMgr to get and./or put messages. Use of a Multi-InstanceCONNAMEor a CCDT file makes that connection more robust by providing multiple equivalent QMgrs to which the client can connect but that has nothing whatever to do with WMQ clustering.Does that help?Please see:ClusteringHow Clusters WorkQueue manager groups in the CCDTConnecting WebSphere MQ MQI client applications to queue managers\n"} +{"text": "### Human: I am trying to connect a queue manager from a standalone program and am getting the following error.Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED').I understand that the connecting ID needs to be configured at the MQ to allow this connection.But strangely, when I try to connect from Websphere Application Server (WAS), I am successfully connected to the queue.\nMy standalone program is using the same JDK as WAS.Should the JVM ID for both these programs be the same?I am using a CCDT file to connect to the queue.### Assistant: Well it is authorization error on client connection. No doubt about that. Seeherefor troubleshooting technote.For start make sure that user which are you using is given proper rights (it isn't). Make sure that you are not using MQ administrator account with WMQ v7.1 or newer. \nSince 7.1 MQ Administrators are not allowed to create client connection with default configuration. This default can be changed. Seehere.One option is to use MCA user on client channel. This overrides whatever user you are passing. It is explainedhere.WAS is either using different user or bindings connection mode.\n"} +{"text": "### Human: I have zero experience with Websphere MQ Messenger. I need to build a .NET application that will read from an 7.1 MQ Series queue, manipulate the message and write it to another queue.I want to try and build a POC to do this. Is it possible to install a Websphere MQ server and client on a non networked Windows 7 machine to build this POC. If so, what MQ software do I need and are their trial versions available?Thanks### Assistant: You can install WebSphere MQ on a stand alone machine. Both queue manager and your .NET application must run on the same machine in that case. Download WMQ v7.5 server installation from IBM site. While installing choose to install Windows Client also. Server component is installed by default. After installation use WebSphere MQ Explorer to create queue manager. Many .NET samples are shipped with the product and you can find them in tools directory of WMQ. installation.\n"} +{"text": "### Human: I am working with someone who is trying to achieve a load-balancing behavior using JMS Queues with IBM Websphere MQ. As such, they have multiple Camel JMS consumers configured to read from the same Queue. Despite that this behavior is undefined according to the JMS spec (last time I looked anyway), they expect a sort of round-robin / load-balancing behavior. And, while the spec leaves this undefined, I'm led to believe that the normal behavior of Websphere MQ is to deliver the message to only one of the consumers, and that itmaydo some type of load-balancing. See here, for example:When multi MessageConsumer connect to same queue(Websphere MQ),how to load balance message-consumer?But in this particular case, it appears thatbothconsumers are receiving the same message.Can anyone who is more of an expert with Websphere MQ shed any light on this? Is there any situation where this behavior is expected? Is there any configuration change that can alleviate this?I'm leaning towards telling everyone here to use the native Websphere MQ clustering facility and go away from having multiple consumers pointing at the same Queue, but that will be a big change for them, so I'd love to discover a way to make this work.Not that I'm a fan of relying on anything that's undefined, but if they're willing to rely on IBM specific behavior, I'll leave that up to them.### Assistant: The only way for them to both receive the same messages are:There are multiple copies of the message.The apps are browsing the message without a lock, then circling back to delete it.The apps are backing out a transaction and making the message available again.The connection is severed before the app acknowledges the message.Having multiple apps compete for messages in a queue is a recommended practice. If one app goes down the queue is still served. In a cluster this is crucial because the cluster will continue to direct messages to the un-served queue instance until it fills up.If it's a Dev system, installSupportPac MA0Wand tell it to trace just that one queue and you will be able to see exactly what is happening.See the JMS spec in section 4.4. The provider must never deliver a second copy of an acknowledged message. Exception is made for session handling in 4.4.13 which I cover in #4 above. That's pretty unambiguous and part of the official spec so not an IBM-specific behavior.\n"} +{"text": "### Human: In WAS console, on the Queues page, there is an option called 'Target Client' and the options are MQ and JMS. Now MQ i understand is websphere MQ, but what is JMS? Any JMS provider other than Websphere MQ? Because in my case the target is actually websphere MQ but i have selected JMS here and it still works fine.### Assistant: Target client defines how the message will intepreted by the receiving application.\nIf you choose MQ, then a RFH2 header will be added with MQ specific info otherwise JMS info will be added (jms_bytes, jms_text etc..).IBM has some info about it\n"} +{"text": "### Human: I am choosing between two options for a client server application -First - Go for a TCP/IP (Pure socket based) approach with multithreaded server and manage the synchronization of send and receive myself.Second - use and WebSphere MQ approach (MQI). Basically one input Queue and one output Queue for the server. The clients write to the server input queue and the server puts the reply in output queue with some correlation identifier etc. So only 2 queues needed.The server program is multithreaded (thread pools) and multiple threads will read on the input queue and write on the output queue.Question - I am leaning towards the second approach but have few doubts -Are MQI calls thread safe? Do I have to use some mutual exclusion forMQGETandMQPUTfor the queues.Will the performance of MQ based approach be lower than socket based. By performance I mean two things.a. Are IBM MQ queue operation slower than direct socket connections in general?b. Will the mutual exclusion locks onMQGETandMQPUTslow down the message processing?c. I plan to have a load of around 10000 messages per second (each around 100 bytes). The replies will be about 5 KB (XML messages). Is this a practical load for IBM MQ based approach?Note - The language is C++ and operating system for the server is Solaris.### Assistant: The use case you are describing is incredibly narrow. It's never just a case of \"sockets or queues\" but other considerations must factor into the business case:How will the thing be monitored and managed? Will it be necessary to write all the parts that report system health to the NOC and provide message stats, or can I use what MQ provides?Do I need queuing or is this truly a synchronous app?Is this really point-to-point or do the apps involved participate in an ecosystem of services and upstream/downstream connections? What else does it need to integrate with?Is there a need for message enrichment, routing, fan-in, fan-out, pub/sub or other functionality? Write code or use WMQ/WMQ Broker native features?Do the connections require authentication? Encryption? Write code or use WMQ native features?Are there regulatory compliance factors involved and if so what's the cost of auditing custom code vs. COTS transport?Does the shop have deep C++ skills and prepared to maintain that depth of bench for the lifetime of the code?How is the connection configuration managed and does it support HA and DR seamlessly? Write code or use WMQ native features?How will exception logic and automatic reconnect be managed? Write code or use WMQ native features?The business case has to consider a lot more than raw speed. This is especially true when both alternatives are capable of meeting the throughput requirement as should be the case here. Once the functional requirements are met it is all these other aspects (and more I haven't thought of off the top of my head) that must be considered in the business case.As for the specific questions...Access to the queues is managed the way you'd hope. Multiple threads compete for the same messages but a message delivered to one is not delivered to another thread. Exceptions are if the message is rolled back and becomes available again or the app is using pub/sub and intentionally receiving more than one copy of the message.On the app side, the calls are thread safe within a session. So all threads using the same sessionCOMMITtogether. Usually a pair of threads using request/reply operates cooperatively. Otherwise, one session per thread gives you what you need.As for performance, this is an apples-to-oranges comparison. The question is whether a C++ sockets program that provides all the services, diagnostics, resiliency and other features of an async messaging transport performs on par with that transport. The answer there is usually no. WMQ has been optimized for 20 years to do one thing and to do it extremely well. A new custom C++ sockets program will move data faster but not provide the same functionality. So it comes down to whether the app needs so little of WMQ's functionality that it's cheaper in the long run to custom code the few functions it needs, then maintain that for the life of the app. Again, the answer is usually no.For specifics on message throughput rates, go to theSupportPacspage and look for the ones with names beginning MP__ for theplatform and version you need. Achieving 10k MPS for small messages is possible on even modest hardware.\n"} +{"text": "### Human: I am trying to put some messages from a JMS code to a local queue defined in local queue manager. I have defined a local QueueLQin WebSphere MQ and using JMS code to put messages. Am I doing it proper here. I am not seeing the messages in WebSphere queue.Here is the code:try {\n MQQueueConnectionFactory cf = new MQQueueConnectionFactory();\n //set up the Connection Configuration values\n\n // Set the properties\n cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, \"HostName\");\n cf.setIntProperty(WMQConstants.WMQ_PORT, 1414);\n cf.setStringProperty(WMQConstants.WMQ_CHANNEL, \"SYSTEM.DEF.SVRCONN\");\n cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\n cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, \"TEST.JMS\");\n\n //JNDI is Not used Here\n MQQueueConnection connection = (MQQueueConnection) cf.createQueueConnection();\n\n MQQueueSession session = (MQQueueSession) connection.createQueueSession(true, Session.CLIENT_ACKNOWLEDGE);\n MQQueue queue = (MQQueue) session.createQueue(\"queue:///LQ\");\n MQQueueSender sender = (MQQueueSender) session.createSender(queue);\n MQQueueReceiver receiver = (MQQueueReceiver) session.createReceiver(queue);\n\n long uniqueNumber = System.currentTimeMillis() % 1000;\n\n JMSTextMessage message = (JMSTextMessage) session.createTextMessage(\"MQJMSTest \"+ uniqueNumber); \n //MQMessage message = (MQMessage) session.createTextMessage(\"MQJMSTest \"+ uniqueNumber);\n\n\n // Start the connection\n connection.start();\n\n sender.send(message);\n System.out.println(\"Sent message:\\\\n\" + message);\n\n //JMSMessage receivedMessage = (JMSMessage) receiver.receive(10000);\n // System.out.println(\"\\\\nReceived message:\\\\n\" + receivedMessage);\n\n sender.close();\n receiver.close();\n session.close();\n connection.stop();\n connection.close();\n\n System.out.println(\"\\\\nSUCCESS\\\\n\");\n\n} catch (JMSException e) {\n // TODO Auto-generated catch block\n //e.printStackTrace();\n System.out.println(e);\n System.out.println(\"\\\\nFAILURE\\\\n\");\n}\n catch (Exception e){\n System.out.println(e);\n System.out.println(\"\\\\nFAILURE\\\\n\");\n}### Assistant: According to this, you've created a transacted session:connection.createQueueSession(true, Session.CLIENT_ACKNOWLEDGE);According tothe docs,When an application closes a transacted session, an implicit rollback\n occurs. When an application closes a connection, an implicit rollback\n occurs for all the connection's transacted sessions.A rollback would remove any messages on the queue before they ever became visible outside the application that PUT them. So I'm thinking you might want to COMMIT the transaction, yes?sender.send(message);\n\n // ADD THIS HERE ===========================\n session.commit();\n // ADD THIS HERE ===========================\n\n System.out.println(\"Sent message:\\\\n\" + message);\n\n // THE COMMIT MUST HAVE OCCURRED BEFORE YOU CAN GET THE MESSAGE\n // BACK OUT OF THE QUEUE IN THE NEXT LINES\n\n //JMSMessage receivedMessage = (JMSMessage) receiver.receive(10000);\n // System.out.println(\"\\\\nReceived message:\\\\n\" + receivedMessage);\n\n // ===================================================\n // DON'T FORGET TO COMMIT THE MESSAGE ON THE WAY BACK OUT OR IT WILL\n // JUST GE TPUT BACK ON THE QUEUE AGAIN.\n // session.commit();\n // ===================================================\n\n\n sender.close();\n receiver.close();\n session.close();PS: Please see the section onJMS Exception handling. The JMS Exception is a multi-tiered structure in which it is expected that vendor-specific diagnostics are placed in the lower-level elements. Only by printing those lower-level elements is it possible to know what the transport layer thinks is wrong.\n"} +{"text": "### Human: I have a simple code to put 2 messages into a queue.1) I set the connectionNameList with two servers.2) Those two servers are independent, but have the same Queue Manager and Queue defined with same name, such as \"QMgr\" and \"TEST.IN\"3) I set the setClientReconnectOptions(WMQConstants.WMQ_CLIENT_RECONNECT);I hope when the first server is down, it should send the messages to 2nd one.The test I did:a) I send first message, sender.send(message); It worked.b) sleep 30 seconds.During this time, I shutdown the first serverc) then sleep done, try to send 2nd message, but it failed to send immediatelyFurther more, I tried more, I did try{} catch{} for 2nd message, and in the catch{}, I try to sender.send(message), it still fails.Any idea why it is different than what I expected. I will really appreciate your reply.public static void main(String[] args) throws Exception\n{\n MQQueueConnectionFactory cf = new MQQueueConnectionFactory();\n cf.setConnectionNameList(\"10.230.34.191(1418),10.230.34.169(1418)\");\n\n cf.setQueueManager(\"QMgr\");\n cf.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n cf.setClientReconnectOptions(WMQConstants.WMQ_CLIENT_RECONNECT);\n cf.setClientReconnectTimeout(600);\n\n System.out.println(\"connect list \" + cf.getConnectionNameList());\n\n MQQueueConnection connection = (MQQueueConnection) cf\n .createQueueConnection(\"mqm\", \"passwd\");\n MQQueueSession session = (MQQueueSession) connection.createQueueSession(false,\n Session.AUTO_ACKNOWLEDGE);\n MQQueue queue = (MQQueue) session.createQueue(\"queue:///TEST.IN\");\n MQQueueSender sender = (MQQueueSender) session.createSender(queue);\n\n long uniqueNumber = System.currentTimeMillis() % 1000;\n JMSTextMessage message = (JMSTextMessage) session.createTextMessage(\"SimplePTP \"\n + uniqueNumber);\n\n // Start the connection\n connection.start();\n\n sender.send(message);\n System.out.println(\"Sent message:\\\\n\" + message);\n\n System.out.println(\"sleep 30 seconds\");\n Thread.sleep(30000);\n uniqueNumber = System.currentTimeMillis() % 1000;\n message = (JMSTextMessage) session.createTextMessage(\"SimplePTP \" + uniqueNumber);\n sender.send(message);\n\n sender.close();\n session.close();\n connection.close();\n\n System.out.println(\"\\\\nSUCCESS\\\\n\");\n }### Assistant: Well this is the simplest test case and should have worked. How did you bring down the first queue manager? Did you down it with a-roption. Remember, without the-roption the clients will not reconnect when queue manager is ended withendmqmcommand.endmqm -r Assuming you used-roption and it still did not work, then my suggestion would be to try the following:Set an exception listener to know what is going on with reconnection. Exception listener would be invoked when the connection is broken and reconnection attempt starts till either reconnection is successful or fails. Exception listener sample code would be something like this:conn.setExceptionListener(new ExceptionListener() {\n\n public void onException(JMSException e) {\n System.out.print(e);\n }\n});\n"} +{"text": "### Human: I'm about to prepare a deployment specification for the Websphere MQ production environment. As always I hate reinventing the wheel hence the question:\nIs there an article, specififaction of best practices when it comes to deploying and maintaining the Webshpere MQ production environment?Here are more specific doubts of mine:Configuration versioning (MQSC, dmpmqcfg, etc).Deploying new objects (MQSC or manual instructions?)Deployment automation (maybe basing on the diff of dmpmqcfg?).Deploying and versioning configuration alterations.Currently I am simply creating MQ objects manually and versioning the output of dmpmqcfg. However, in a while there are going to be too many deployments to handle it like this.### Assistant: That's an extremely broad question so I'll try to respond before a moderator deletes it. :-)The answer depends on many things such as whether MQ clusters are in use, the approaches to high availability and disaster recovery, the security requirements, whether the QMgrs are configured as dedicated or shared infrastructure, etc. However, there are a few patterns that I follow in almost all cases, including non-Production. This is because things like monitoring and security tend to get dropped at deployment time if not tested in Dev and don't work as expected in Prod.I use a script to create my QMgrs in Production to insure that basics like generating the X.509 certificate (or CSR) is always done according to standards, that any exits or exit parm files are present, that certain SupportPac executables (likeq) are present in/opt/mqm/bin,circular queues, etc. It also checks for negative factors such as GSKit not being installed.I have a baseline script that is run against all QMgrs. This script sets up the DLQ, any queues for monitoring agents, enables events as required, sets up system services, trigger monitors, listeners, etc. The exception is B2B gateway QMgrs which are handled in a class all their own and have very specific configurations not used on the internal network.\ncluster.I have several classes of QMgr with specific configuration requirements. These include cluster repositories (where primary and secondary are distinct sub-types), service-provider QMgrs, and service consumer QMgrs. These all have secondary scripts run against them.I have scripts per-cluster to join or suspend a QMgr in cases where clustering is used (which for me is almost 100% since v7.1).These set up a QMgr's infrastructure. Then I maintain scripts for each application. So for example, if there's a Payroll app, I'll have queues and possibly topics with names containing aPAYnode such asPAY.EMPLOYEE.UPDT.REQ.V032.PRD. Corresponding to that will be a single script for allPAY.**queues. Used to be one forsetmqautcommands too, but these are now in the same script as the objects. I only ever have one version of the script and keep a history of changes in the script. This way when I need to recreate a QMgr, I just run all the scripts for it. Similarly, if I need to deploy thePAYobjects on another QMgr, I just copy the script to that server.When defining objects for clusters, I always do aDEFINE NOREPLACEthat contains all the run-time attributes such as whether the queue is enabled in the cluster. The queue is always defined as disabled in the cluster and for triggering but because I useNOREPLACEre-running the script doesn't change whatever state it has in, say, a month. Those things that are configuration and not run-time, such as the description, are handled in anALTERimmediately after theDEFINEand theseareupdated each time the script is run. There's an article on thishere.Finally, the scripts I use are of the self-executing, self-documenting variety. For example, many people put all the MQSC commands into a script then do something like:runmqsc < payroll.mqsc > payroll.outTONS of problems here. The main one is that it relies on the operator to know a lot and execute the script right all the time. For example, suppose (s)he forgets to capture the output? Or overwrites a previous output? Or doesn't getSTDERRbecause (s)he needs to do the2>&1at the end and doesn't know redirection that well?So my scripts are all written inkshhandle all the capturing of output, complete with time and date stamping andSTDERR, can freely mix MQSC with OS commands, etc. All you do is go to the scripts directory for that QMgr and. ./*kshto build/rebuild a QMgr.I do of course also take regular configuration dumps, but these are more for running queries and reports like \"how many QMgrs have this channel defined and where are they?\" kind of thing.Also, when taking backups there is almost NEVER a good reason to back up a QMgr at a point in time. However, if it is required be sure to stop the QMgr first. Also, think long and hard about capturing certificates in a backup. Many people are good about locking the certificate directory so onlymqmcan read it but often the backups are unprotected. As long as you aren't trying to restore on top of Production, many shops let you restore the Production/var/mqm/*files to your own sandbox. If the QMgr's KDB files are included, you just lost them. An alternative is to put the certificates in/etcor some other directory that is protected but not backed up with the QMgr's directories.\n"} +{"text": "### Human: We are developing a console application using c# to access IBM WMQ. We are using IBM Message Service Client for .net (XMS) and WebSphere MQ Client. Here are the code example:XMSFactoryFactory xff = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\n IConnectionFactory cf = xff.CreateConnectionFactory();\n cf.SetStringProperty(XMSC.WMQ_HOST_NAME, \"host\");\n cf.SetIntProperty(XMSC.WMQ_PORT, 1445);\n cf.SetStringProperty(XMSC.WMQ_CHANNEL, \"channel\");\n cf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);\n cf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, \"queueManager\");\n cf.SetIntProperty(XMSC.WMQ_BROKER_VERSION, XMSC.WMQ_BROKER_V1);\n cf.SetStringProperty(XMSC.USERID, @\"userid\");\n cf.SetStringProperty(XMSC.PASSWORD, @\"\");\n\n IConnection conn = cf.CreateConnection();\n conn.ExceptionListener = new ExceptionListener(OnXMSExceptionReceived);\n Console.WriteLine(\"connection created\");\n ISession sess = conn.CreateSession(false, AcknowledgeMode.AutoAcknowledge);We kept getting the following error:\n CWSMQ0044E: The user is not authorized to connect to the queue manager. The application has tried to connect to a queue manager without authorization. Ensure th\nat appropriate authority exists on the queue manager for this user.But we have no problem to access the same MQ using spring integration. here is the settings for spring integration:\n \n \n \n \n \n\n\n\n \n \nI am new to XMS and .net, do not know how to pass the authentication info for connecting to MQ. any recommendations are highly welcome!### Assistant: XMS .NET and MQ JMS clients work little different. When connecting to queue manager, XMS .NET first sends the currently logged in Windows user id and then sends the application specified user id. If these two user ids are same, then connection is created. But if they are different then you will getCWSMQ0044Eerror. This is basically MQ Reason code 2035, MQRC_NOT_AUTHORIZED. However in case of MQ JMS, only the application specified user id is sent, Windows user id is not sent. Hence you don't see the error.There are number of ways to address the issue you are seeing when using XMS .NET:1) Use a MQ Server side Security Exit.2) Channel Authentication Records (Available from MQ v7.1 onwards)This issue has been discussedhere.\n"} +{"text": "### Human: This a follow-up based onMQ (Websphere 7) persist message to file system.How do you set up an .exe program from an MQ support pack (such as the Q utility in MA01) to execute each time a message is received? Can this be setup in MQ Explorer? (We are using 7.0 on Windows 2008/R2).### Assistant: There are a few ways to do this.Set the application up under Windows control (since you mentioned the QMgr is on Windows.) The app would run as a service, with recovery options to restart it if the service fails. The application would be programmed (or configured in the case of Q) to process the queue using GETs with a VERY long wait period. Some additional error handling is required to do something sensible when the QMgr is not available. This works great for copying messages to multiple queues but isn't appropriate for queue-to-file since the file would never close.Run the application as a WebSphere MQ service. Defining theSERVICEobject usingCONTRIL(QMGR)causes MQ to start the service when the QMgr boots and stop it when the QMgr is shut down. Since the service is a child process of the QMgr, no need to worry about how to handle errors when the QMgr isn't available.Trigger the program based on non-zero queue depth. Define a process object describing the command to be executed, enable triggering on the queue withTRIGTYPE(FIRST)and run a trigger monitor. Whenever the queue has depth > 0 and no open input handles, the process object fires and executes the command. The thing you start must know how to parse the command line so the easiest thing to do if you have someone else's executable is use a script to start it. The script parses the trigger message and fires off the executable. Or perhaps the script ignores the trigger message and just runs the exe. I generally use Korn Shell or Perl and both are available on Windows.I wrote an article showing how to keep event queues from filling using a triggered version of Q. The article assumes you want the queues to remain mostly full so uses triggering on depth of about 80%. The same techniques could be used (in a much simpler implementation, by the way) to fire off the Q program whenever the queue depth became non-zero.UPDATEProbably should have linked the article. ;-)Mission:Messaging: Easing administration and debugging with circular queues\n"} +{"text": "### Human: I am working in a new project.The project consists of using websphere MQ, Websphere server.\nWe have queue in the Websphere MQ including Queue manager.We also have the queue and connection factory defined in the websphere application server. Now, my question here is why we need o create queue and connection factory in the websphere application server, even they are defined in the WEBSPHERE MQ.Can't our application directly use the queue defined in the Websphere MQ?Please clear my query.Thank you in advance.### Assistant: Actually, the Connection factory isnotdefined in WebSphere MQ. The queue is but it's not the same as what you are creating in WAS.When using JMS the objects have two interfaces. The JMS API is the interface seen by the code and developers. The Service Provider Interface is the part that interacts with a particular JMS transport provider. It takes both of these to make a JMS object such as a QCF or Destination.When you create an object definition in WAS (or any JNDI repository, for that matter) what is created is an object that the program can refer to (the JMS API part) but that also \"knows\" how to talk to the specific transport provider as well (the SPI part). So when you define a queue in WAS it is a directory entry that points to an actual physical queue defined in the transport provider, in this case WebSphere MQ. Similarly, when you define a Connection Factory, it is also nothing more than a directory entry that conforms to the JMS API and also \"knows\" how to talk to the transport provider using its proprietary protocol and wire formats. In this case since the transport provider is WebSphere MQ, that Connection Factory directory entry has to know about things like QMgr name, host, port, channel, SSL/TLS details, etc.In some cases where the app serveristhe transport provider (i.e. WAS with Service Integration Bus as the JMS transport) creating the JMS object definition creates the physical object at the same time.The reverse is also true. In WebSphere MQ when you crate a queue or topic using WebSphere MQ Explorer, you have the opportunity to define the JMS object definition, provided that you have configured WMQ Explorer to talk to the repository where the managed objects are stored. For example, you can use LDAP to store managed object definitions, point both WebSphere MQ Explorer and WAS at the LDAP directory and manage all the JMS objects there.So to reiterate, defining the JMS object in WAS creates only the directory entry and not the actual WMQ object. This is true for any external JMS transport that you use with WAS.\n"} +{"text": "### Human: How to identify a channel type(sender or receiver) through the event messages sent by the queue manager to queue SYSTEM.CHANNEL.EVENT.QUEUE during a channel stopped or retrying state ?I'm reading it using class PCFMessage.### Assistant: The event message contains the channel name but not the type. (SeeChannel and Bridge Eventstopic in the Infocenter for specifics.)My approach for this is that when my monitoring program starts up, I issue a PCF message to display all the channel names and their type and then store this information in a table. (The PCF equivalent ofDIS CHL(*) CHLTYPE.) Then as the channel events arrive, match the channel name to the table entry to retrieve the channel type. It is of course possible to cache any number of the static channel attributes such asCONNAME,MCAUSER, etc. and you can ask for as many as you need in the PCF command.If an event shows up for a channel not in the table, you can always issue a new PCF command to look up the new channel on the fly and then add the attributes to the cache you built when the program started. Hopefully, your QMgr is not so volatile as to define new channels so often that this would be a problem. However, if that were the case you could enable configuration events and then you'd be notified when new channels were defined.\n"} +{"text": "### Human: I'm developing integration solution withmessage broker. Solution communicates with the back-end system usingwebsphere mq. During development process I don't have an access to the real back-end service so I have to mock it somehow. Mock implementation has to read message from queue, perform simple transformation, and put message back to queue. To achieve that, I've considered creating separate message flow but what I'm actually looking for is ready-made solution which I could leverage these tasks to.Does anybody know any tool that might be useful for that purpose?### Assistant: How about setting up your own QMgr? Or even your own broker and QMgr? According to the license terms of recent versions of WebSphere Message Broker, anyone with a single paid license is entitled to install any or all of the broker components on developer desktops (Windows and Linux). The InfocetnerLicense Requirementstopic states:Your license also covers use of the product for development and unit\n test purposes. All developers in your organization, who are working on\n resources and applications for WebSphere Message Broker, can install\n one copy of all components on their computer. They can create and\n configure a broker environment without any functional or resource\n restrictions. Installation of the WebSphere Message Broker Toolkit\n limits this use to Windows, Linux on x86, and Linux on x86-64\n computers. The unit test environment is limited to these three\n platforms even if you have purchased a license for WebSphere Message\n Broker for z/OS.\n"} +{"text": "### Human: Every change in the production environment has to be versioned and tracked down to specific person who changed it and why.Is there a possibility to use some tool for that? If not, how to use SVN or GIT for MQ configuration?What are the best practices for changes inWebsphere MQconfiguration?I know that all of the configuration lays in the/var/mqm/qmgrs/QMNAMEdirectory. But these are not text files, hence simple SVN won't tell me what got changed.### Assistant: WebSphere MQ isn't like a static compiled artifact but rather is a living system that is in part self-managing. Things like clusters, triggers, instrumentation and even applications all can change settings on MQ objects at run time.What many shops choose to do is to store the object definitions and authorization control lists in MQSC scripts and keep those files in SVN or other change control system. Then to capture live changes they enable and monitorConfiguration Eventswhich report details of changes and the user ID that initiated them.In particular, objects in a WMQ cluster are more volatile at run time and so the scripts should reflect this fact. The object attributes can be categorized as to whether they are static properties or represent run-time state. MQSC scripts can take advantage of this by defining the static properties and the dynamic properties in separate steps. By using theREPLACEandNOREPLACEoptions it is possible to write the script so that cluster state is preserved whenever the script is re-run. This supports a change control methodology of storing all relevant objects in versioned scripts rather than writing a new script for each change to the system. Capturing the delta between the script versions gives you all the static properties and monitoring and the event messages gives you a view of all changes, including updates to dynamic properties that aren't captured in the scripts.The 2-step object definition looks like this:* Stateful attributes use NOREPLACE so rerunning the script does not\n* reset them to default values at run-time\nDEFINE QLOCAL (APP.FUNCTION.SUBFUNCTION.QA) +\n GET(DISABLED) +\n PUT(DISABLED) +\n NOTRIGGER +\n NOREPLACE\n\n* Static values use the REPLACE option to make sure any changes\n* are recorded next time the script runs\nALTER QLOCAL (APP.FUNCTION.SUBFUNCTION.QA) +\n DESCR('APP service queue for QA') +\n DEFPSIST(NO) +\n BOTHRESH(5) +\n BOQNAME('APP.FUNCTION.BACKOUT.QA') +\n CLUSTER('DIV_QA') +\n CLUSNL(' ') +\n DEFBIND(NOTFIXED)There is more detail on this methodology inMission:Messaging: Migration, failover, and scaling in a WebSphere MQ cluster.\n"} +{"text": "### Human: I have a process that usesJMSTemplateto selectively dequeue from an MQ queue based on JMS header values.When the dequeue query matches messages at the front of the queue, the dequeue rate is approximately 60-70 msg/second. However, when the query matches messages only 50, 100 or 200 messages deep the dequeue rate drops to 1 msg / 3-4 seconds.The fast dequeue query isThreadId='24' or ThreadId='PRIMARY'. The slow dequeue query isThreadId='24'.The real reason for the slow processing times might be something else, but I observe the change in processing times with nothing more than the change in deselect query.I suspect this processing speed is not usual. What could possibly be going wrong?### Assistant: Querying deep queues by headers is not really recommended as the headers are not indexed. This might be the issue. Queries on CorrelationId and MessageId (if they are on the format 'ID:48-hex-digits') will be indexed and are very quick (~1ms / query on very deep queues, depending on setup).We faced this issue as well and choose to encode a correlation identifier in the correlation id header instead of in JMS string properties (MQRFH2/usr) headers.This was on MQ 7.0\n"} +{"text": "### Human: Is there a way to consume messages from a WebSphere MQ queue in batches? e.g.messages = queue.receiveBatch( BATCH_SIZE )Where it would return a collection of messages ( e.g. List[Message] ) up to aBATCH_SIZEin asingle \"receive\"?(I can call receiveBATCH_SIZEtimes within a transaction, but that is not what I am looking for)Ifmessage groupscan solve it, what would it look like? Although it does not seem to be the right solution as \"message groups\" seem to be reading messages one by one.### Assistant: No. WMQ has read-ahead in which non-persistent messages are streamed to the client but even there the client executes a singleGET(or language equivalent) per message.One of the attributes of async messaging is supposed to be that messages are atomic. Any dependency of messages on other messages is called an affinity and message affinities break the async model. (However every transport makes some accommodation for affinities and message grouping is an example of that.) So aGETis the atomic unit of work which has a 1:1 correspondence to a message.WMQ messages can be of arbitrary size up to 100MB and messages larger than that can be segmented where one logical message is split across multiple physical messages. In the case of a segmented message, oneGETwill result in consumption of multiple messages, however to the app only one logical message is returned.WMQ Channels use batches and until recently these were constructed strictly by message count. However the aforementioned variability in message sizes made tuning channels extremely difficult if both large and small messages traversed the same channel. In v7.1 of WMQ channel batches now are bounded by a message count or a byte count, whichever is hit first. Any notion of messageGETbatching would require similar tuning functionality in order to prevent severe impacts to memory. There would be additional interactions with logging, queue sizes, etc. Note also that if one message failed, the entire batch would have to be rolled back.If the intent is to improve performance, use transactions. When receiving messages under syncpoint you can tune the number of messages toGETbetweenCOMMITcalls. You can considerably improve performance withCOMMITintervals > 1, however this falls off above a threshold which you can determine with a bit of trial and error. The Performance Reports can help determine the best number for your platform. These are available from theSupportPacs main page. Look for the entries with names like MPxx.If the messages are non-persistent and you can afford to lose some of them on disconnect, then you can use read-ahead - assuming you have a modern version of WMQ. This will stream messages to the application's WMQ client so that the next message is already in the local buffer whenGETis called.By the way, the link in the original post was to the WMB docs. The WMQ docs can be foundhere.\n"} +{"text": "### Human: Two separate processes are communicating via JMS over MQ.The writer sets a string property:new MessageAction() {\n public void actOn(Message message) throws JMSException {\n logger.debug(\"Setting message property (GmmThreadId, CASHFLOW-1234)\");\n message.setStringProperty(\"GmmThreadId\", \"CASHFLOW-1234\");\n }\n});ThisMessageActionis executed, as shown in the logs:Setting message property (GmmThreadId, CASHFLOW-1234)The reader uses a message selector to obtain this message. (using Spring's JmsTemplate v1 -an old version I know, but it's baked into our vendor's framework and we're compelled to use it.)template.receiveSelected(queue, \"GmmThreadId = 'CASHFLOW-1234' or GmmThreadId IS NULL\");The only messages on the queue are ones for which the logs show that the writer set the message property. In the logs for the reader, I enumerate the properties and also try to log the value of GmmThreadId. It also shows that the property GmmThreadId does not exist.message property JMS_IBM_PutDate = 20111003\nmessage property JMSXAppID = WebSphere MQ Client for Java\nmessage property JMS_IBM_Format = MQSTR\nmessage property JMS_IBM_PutApplType = 28\nmessage property JMS_IBM_MsgType = 8\nmessage property JMSXUserID = MUSR_MQADMIN\nmessage property JMS_IBM_PutTime = 23551798\nmessage property JMSXDeliveryCount = 2\nmessage had GmmThreadId property of nullNote, if my message selector is only\"GmmThreadId = 'CASHFLOW-1234'\"then nothing is dequeued.Using WebSphere MQ Explorer to view the message, I cannot find anywhere to view the application set message properties. The message type is MQSTR, if that makes any difference.Both reader and writer applications are running in WebSphere v6.Where am I going wrong?### Assistant: As indicated bythis threadthe message properties will be suppressed if the destination type is 'MQ'. For me, this is configured in the WebSphere App Server console. I changed the queue type to 'JMS' and the message properties were persisted.\n"} +{"text": "### Human: I am working on a Spring application where we have implemented code to send messages through IBM MQ.Now we have been advised not to directly use MQ APIs directly and instead use JMS.The steps I followed :created a JNDI name to connect to the Message queue configured as:\n >/>\nI need a connecton factory object to connect to the JMS Provider and I have configured it as:\n \n \n \n \nFurther I have injected the above 2 beans in JMSTemplate class:\n \n \n Now since my purpose is to remove dependency on MQ APIs, do you think the configuration above (especially for connection factory) looks good?### Assistant: Ifyour code doesn't refer to any of the MQ classes (i.e. it references that bean only as a JMSConnectionFactoryandyou don't rely on any other non-standard features of MQ, then this should make your code reasonably easy to port.I wouldn't bet that switching to another product would require zero code changes (many JMS implementations seem to have some interesting peculiarities), but you're definitely on the right way.\n"} +{"text": "### Human: We have a queue which needs to be monitored for message not being processed for a long time.\nwe setQSVCINT(1800000)that is 30 mins.This event occurs only if there is no successful get operations orMQPUTcalls have been detected within an interval greater than the limit specified. (30 minutes)In our case queue is continuously getting message(MQPUT) in 30 minutes interval of time, so service interval high is not triggered.Do we have any alternative to check the age of the message and get alerted?### Assistant: Before answering the question, let's reset a slight misconception in the premise. Queue Service Interval measures the time between aPUTto an empty queue or aGETthat does not empty the queueand the nextGET. So the reason that you are not getting any event messages is not due to PUT activity but ratherto a lack of GET activity that would trigger an event. In other words, once the queue has depth, you will not get anyQSVCINTVLevents until aGEToccurs. Also, the events toggle betweenOKandHIGHso that once you get aHIGHyou will not get anotherHIGHbut should eventually see anOK. Once you get theOKevent you won't get another until aHIGHcondition occurs as a result of a lateGET.So imagine that a program puts 10 messages on the queue and another reads the first message and then dies. ThePUTcalls will not generate an event but will start the timer. Since the now-non-empty queue defaults to anOKinterval state, no event is enerated on the firstGETwhich we stipulated occured immediately. Since there were no subsequentGETcalls, the timer continues to run but no event will be generated. New messages can continue to arrive but the event will only trigger at this point on aGETcall that occurs 30 or more minutes after the one successfulGET.If you were hoping to get aQSVCINTVL(HIGH)event base don noGETactivity for more than 30 miniutes, it does not work that way.Still with me? Great! Now on to the answer.If you display the queue status (for example using theDIS QS(QUEUE.NAME)command) it provides the lastGETtime and date. TheDIS QL(QUEUE.NAME) CURDEPTHcommand provides the depth of the queue. These two commands can be issued to runmqsc in scripts or directly to the command server using PCF commands and will allow you to directly inquire as to the time since the last successfulGETon the queue, irrespective of anyGETactivity such as that required to drive events.Using this method you can first validate that the queue has depth (because presumably we don't care if there are noGETcalls on an empty queue) and then if so, see how long it's been since the lastGETeven if the consuming program has died and there are noGETcalls being made.Hope that helps.\n"} +{"text": "### Human: Has anyone experienced an issue where WAS does not use the Windows username when connecting to a Websphere MQ resource? None of our developer boxes have ever experienced this problem in the past, they've been able to send the username through for MQ to do authorization. But we have a new developer machine that does not appear to be sending the username, and thus the connection to MQ can't be made.We tried specifying a J2C authentication alias to the QCF with a DefaultPrincipalMapping, but that didn't work.SOLUTION:Found out that the problem was that the server was installed and running as a Windows service. When we created a new server profile which was run by the user and not as a service, it used the Windows username when connecting to MQ.### Assistant: I suspect the problem might actually be the opposite of what you are describing. In older versions of WAS if theUser ID field of the Connection Factory panelwas left blank, WAS would send a blank ID. WebSphere MQ would have no value to pass along to the Object Authority Manager and so the channel would run under authority of the Message Channel Agent's process - which is always administrative. Thus, older versions of WAS commonly ran with administrative rights, although this was not widely recognized as such. You can verify this by looking at the status of the running channel and see if the MCAUSER field is blank.Newer versions of WAS now try a bit harder to find an ID to send to WMQ if the configuration panel is blank. Because of this new installations and upgrades of existing installations often fail to authorize to WMQ using the same channel that previously worked.The interesting part of all this is that the only way this is an issue is if the QMgr has a blank value on the MCAUSER channel attribute. If the QMgr has a blank MCAUSER and no exit is setting MCAUSER at CONNECT time, then the channel allows administrative access. If the channel does not have SSL with SSLPEER set or an exit to authenticate the connection then that administrative access is available to anonymous users. Why is this an issue? Because WebSphere MQ comes with the ability to initiate OS commands based on arrival of a message. This means that any user with WMQ admin rights can remotely execute arbitrary OS commandsas a feature of the software. It follows that this capability MUST be locked down, even from legitimate applications if there is to be any accountability of the messages flowing through the network.The fact that your app is able to present an ID that succeeds and another ID that fails would seem to indicate that the QMgr is allowing administrative access and, I would wager, doing so for anonymous connections. D'oh! MUCH better to fix the QMgr's security than to fix the connection problem by setting the \"right\" ID in WAS. For more on this, see theHardening WebSphere MQpresentation from the IMPACT conference.\n"} +{"text": "### Human: I've a VB6 application with MQSeries Automation Classes for ActiveX. The problem is when i'm writing the message con the queue. I use this code :This is how I open the connection and the relative queue :Set MQSess = New MQSession\n//Access Queue\nSet QMgr = MQSess.AccessQueueManager(QueueManagerName)\n\nDim Queue As MQQueue\nDim msg As MQMessage\nDim pmo As MQPutMessageOptions\n\nDim ArrCar() As Byte\n\nSet pmo = New MQPutMessageOptions\n\nSet Queue = QMgr.AccessQueue(QueueName, OpenOption , RemoteQueueManagerName)\n//OpenOption is a integer with value of 16 (MQOO_OUTPUT) \n\nstrMsgAppo = Translate(\"*MESSAGE_TO_INSERT*\", ASCII_To_EBCDIC_Table())\n\nReDim ArrCar(Len(strMsgAppo) - 1)\nFor lngI = 1 To Len(strMsgAppo)\n ArrCar(lngI - 1) = Asc(Mid(strMsgAppo, lngI, 1))\nNext lngI\n\nCall msg.Write(ArrCar) //Write the ByteArray\n\nCall Queue.Put(msg, pmo)The ASCII_To_EBCDIC_Table is a function used to change the encoding.The error i'm getting from MQ is :MQAX200.MQMessage::Write CompletionCode = 2, ReasonCode = 2043, ReasonName = MQRC_OBJECT_TYPE_ERRORIs Anyone using this activex and can help me on how to write message in a queue?### Assistant: In the code snippet provided, I'm not seeing where the connection to the QMgr is made nor where the queue is opened. Both of these steps must be completed before it is possible to put messages on the queue.The 2043 reason code occurs when there is an invalid option in the Message Options field for aPUTor anOPEN. In this case the problem could either be on the PUT or an implicitOPEN, depending on what's in the code that was not provided and whether it contains anOPEN.My suggestion would be to refer to the .Net samples provided in the installation and reconcile between those and your application. The samples reside atC:\\Program Files (x86)\\IBM\\WebSphere MQ\\tools\\dotnet\\samplesin a default V7 installation.\n"} +{"text": "### Human: I trying to create queues using PCF command in the WebSphere API as detailed in$MQM_HOME/samp/pcf/samples/PCF_CreateQeue.java. The creation fails when i add a descriptioncommand.addParameter(PCFConstants.MQCA_Q_DESC, \"Created using MQMonitor\");I get the error:com.ibm.mq.pcf.PCFException: MQJE001: Completion Code 2, Reason 3015 : MQRCCF_CFST_PARM_ID_ERRORIs there another way of setting the description, i'm using version 6 of the API.### Assistant: TheCommands pagein the PCF manual states that:The required parameters and the\n optional parameters are listed. On\n platforms other than z/OS\u00ae, the\n parametersmust occur in the order:All required parameters, in the order stated, followed byOptional parameters as required, in any order, unless specifically\n noted in the PCF definition.The sectionChange, Copy and Create Queuelists the required parameters in the following order:MQCA_Q_NAMEMQIA_Q_TYPEOptional parameters, including QDescThe same manual provides required parameters and their order for all PCF commands so no need to play hide-and-seek trying out parms and orders in the future.\n"} +{"text": "### Human: I would like to authenticate the user against the MQ Series before user places the Queue message in Queue manager. I am using the IBM MQ Series V7. I would like to know how does the authentication and Key certificate works in terms of validation. It will be great if i can get any helpful links on the same.### Assistant: These might be of some help...Mission:Messaging: Scripted WebSphere MQ key file management for UNIX and Windowshttp://bit.ly/3L1njaMission:Messaging: Planning for SSL on the WebSphere MQ networkhttp://bit.ly/3loirThey key is that you authenticate using SSL and SSLPEER or an exit. But the user can still present any ID and it is accepted. You enforce the authentication against a particular user ID by placing the ID in the MCAUSER field of the channel. If it's a channel with only one authorized user, hard code this. If the channel has many authorized users, use an exit such as BlockIP2 fromhttp://mrmq.dkto map the SSL DN to an ID and set the MCAUSER at connect time. Make sure if you use the exit to set MCAUSER in the channel definition to 'nobody' so that if the exit is misconfigured the channel will fail safe instead of wide open.See my Hardening WebSphere MQ Security presentation athttp://t-rob.net/linksfor additional details.\n"} +{"text": "### Human: Hi im currently using themq-golang-jms20library for golang to connect to a ibm queue, but im trying to create a consumer with the \"JMSMessageID\" selector but the library is giving me the \"Only selectors on JMSCorrelationID are currently supported\" does anybody knows how else could i consume a specific message using the message Id from the queue ?### Assistant: Thank you for submitting this as agit issue.I've merged a PR to allow get byJMSMessageIDtoday, so if you pull down the latest library frommainyou should be all set!\n"} +{"text": "### Human: I am using the low level direct IBM MQ library to push messages on the queue and retrieve them. I was trying to setup the application such that messages can come in, say by pulling data of a database and then pushing records onto the queue and actually same code may read messages. I was mostly wanted to setup a thread that would pull messages once they come up.This code runs, the first PUT works but the second one does not work and hangs. Am I not understanding the flow hereAlso, if I take the code from the second below around the \"GET\", could I write a thread that calls that routine every 500 milliseconds, waiting for new messages to come in.final int putOptions = MQC.MQPMO_NO_SYNCPOINT\n | MQC.MQPMO_SYNC_RESPONSE;\n this.mqPMO = new MQPutMessageOptions();\n this.mqPMO.options = putOptions;\n // This code hangs !!!! (error here)\n mqueue.put(msg, this.mqPMO);...public void bootstap() {\n MQEnvironment.hostname = \"localhost\";\n MQEnvironment.port = 1414;\n MQEnvironment.channel = \"DEV.ADMIN.SVRCONN\";\n MQEnvironment.properties.put(MQConstants.APPNAME_PROPERTY, \"my_application_name\");\n MQEnvironment.enableTracing(5);\n\n MQQueueManager mqManager = null;\n MQQueue mqueue = null;\n try {\n // MQCNO_CLIENT_BINDING is not available for Java or .NET as they have their own mechanisms for choosing the bind type.\n final String qmName = \"QM1\";\n final String userId = \"admin\";\n final String Password = \"passw0rd\";\n final Hashtable h = new Hashtable();\n\n h.put(MQConstants.USER_ID_PROPERTY, userId);\n h.put(MQConstants.PASSWORD_PROPERTY, Password);\n h.put(MQConstants.USE_MQCSP_AUTHENTICATION_PROPERTY, true);\n mqManager = new MQQueueManager(qmName, h);\n //mqManager = new MQQueueManager(qmName, WMQConstants.WMQ_CM_BINDINGS);\n \n this.mqGMO = new MQGetMessageOptions();\n this.mqGMO.options = MQC.MQGMO_NO_SYNCPOINT |\n MQC.MQGMO_WAIT |\n MQC.MQGMO_CONVERT |\n MQC.MQGMO_FAIL_IF_QUIESCING;\n this.mqGMO.matchOptions = MQC.MQMO_MATCH_CORREL_ID;\n this.mqGMO.waitInterval = MQC.MQWI_UNLIMITED;\n\n int openOptions = MQC.MQOO_INPUT_SHARED |\n MQC.MQOO_OUTPUT;\n mqueue = mqManager.accessQueue(\"DEV.QUEUE.1\", openOptions);\n logger.info(\">> Find connection handle queue manager - \" + mqueue);\n\n {\n final MQMessage msg = new MQMessage();\n final String correlId = \"0002\";\n final String byteArry = this.hexStringToByteArray(correlId);\n\n logger.info(\">>> correlId: \" + correlId);\n logger.info(\">>> byteArry: \" + byteArry);\n\n msg.correlationId = byteArry.getBytes();\n msg.format = MQConstants.MQFMT_STRING;\n // ... and write some text in UTF8 format\n msg.writeUTF(\"{{ Hello, World }}}\");\n\n // Use the default put message options...\n // Or: pmo.options = MQConstants.MQPMO_ASYNC_RESPONSE\n final int putOptions = MQC.MQPMO_NO_SYNCPOINT\n | MQC.MQPMO_SYNC_RESPONSE;\n this.mqPMO = new MQPutMessageOptions();\n this.mqPMO.options = putOptions;\n\n // put the message //\n mqueue.put(msg, this.mqPMO);\n logger.info(\" >>> Continue to get routine\");\n }\n\n {\n // This code works !!! get the message\n MQMessage retrievedMessage = new MQMessage();\n retrievedMessage.correlationId = this.hexStringToByteArray(\"0001\").getBytes();\n mqueue.get(retrievedMessage, this.mqGMO);\n\n // And prove we have the message by displaying the UTF message text\n String msgText = retrievedMessage.readUTF();\n logger.info(\"~~~~ The message is: \" + msgText);\n }\n\n {\n final MQMessage msg = new MQMessage();\n final String correlId = \"0001\";\n final String byteArry = this.hexStringToByteArray(correlId);\n\n logger.info(\">>> correlId: \" + correlId);\n logger.info(\">>> byteArry: \" + byteArry);\n\n msg.correlationId = byteArry.getBytes();\n msg.format = MQConstants.MQFMT_STRING;\n // ... and write some text in UTF8 format\n msg.writeUTF(\"{{ Hello, World }}}\");\n\n // Use the default put message options...\n // Or: pmo.options = MQConstants.MQPMO_ASYNC_RESPONSE\n final int putOptions = MQC.MQPMO_NO_SYNCPOINT\n | MQC.MQPMO_SYNC_RESPONSE;\n this.mqPMO = new MQPutMessageOptions();\n this.mqPMO.options = putOptions;\n // This code hangs !!!! (error here)\n mqueue.put(msg, this.mqPMO);\n }\n\n\n mqueue.close();\n mqManager.disconnect();\n } catch(final Exception e) {\n logger.error(\"Error at MQ manager\", e);\n }\n }### Assistant: First off, do NOT use MQEnvironment class as it is not thread safe. You should be using a Hashtable for MQ connection information.Secondly, what is with all of the final declarations? Very odd.Your code doesn't make any sense. Here is what I see your code doing:Set MQ connection information uses the MQEnvironment classSet UserId and Password in a HashtableConnect to the queue managerOpen the queueSet 'correlId' to \"0002\"final String byteArry = this.hexStringToByteArray(correlId);This line of code does not make any sense. The method name doesn't match your code. A Hex string should be in the format of \"30303032\" for \"0002\" and return a byte array i.e. byte[] but it is returning a String. So, I have no idea what the hexStringToByteArray method is doing.Also, the MsgId, CorrelId and GroupId fields of the MQMD structure are 24 bytes in length.Write the message data in a UTF format. Why? Does the receiving application require UTF format?Put the message on the queue.Set the CorrelId for the receive message to \"0001\" but converted to a strange representation by hexStringToByteArray method.Get a message from the queue with a wait interval of unlimited. Since there is no message on the queue that will match that CorrelId then MQ client library will wait forever!!!!!Create another MQMessage and set the CorrelId to \"0001\" but converted to a strange representation by hexStringToByteArray method.Write the message data in a UTF format. Why? Does the receiving application require UTF format?Put the message on the queue.Close the queueDisconnect from the queue managerHere is a fully functioning Java/MQ program that will put 2 messages on a queue with unique CorrelIds (i.e. \"0001\" & \"0002\") and then retrieve the message with a CorrelId of \"0002\".import java.io.IOException;\nimport java.text.DecimalFormat;\nimport java.text.SimpleDateFormat;\nimport java.util.Date;\nimport java.util.Hashtable;\n\nimport com.ibm.mq.MQException;\nimport com.ibm.mq.MQGetMessageOptions;\nimport com.ibm.mq.MQMessage;\nimport com.ibm.mq.MQPutMessageOptions;\nimport com.ibm.mq.MQQueue;\nimport com.ibm.mq.MQQueueManager;\nimport com.ibm.mq.constants.CMQC;\n\n/**\n * Program Name\n * MQTest11B\n *\n * Description\n * This java class will connect to a remote queue manager with the\n * MQ setting stored in a HashTable, put 2 message on a queue with unique CorrelIds\n * and then retrieve the message with a CorrelId of \"0002\".\n *\n * Sample Command Line Parameters\n * -m MQA1 -h 127.0.0.1 -p 1414 -c TEST.CHL -q TEST.Q1 -u UserID -x Password\n *\n * @author Roger Lacroix\n */\npublic class MQTest11B\n{\n private static final SimpleDateFormat LOGGER_TIMESTAMP = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss.SSS\");\n\n private Hashtable params;\n private Hashtable mqht;\n private String qMgrName;\n private String outputQName;\n\n /**\n * The constructor\n */\n public MQTest11B()\n {\n super();\n params = new Hashtable();\n mqht = new Hashtable();\n }\n\n /**\n * Make sure the required parameters are present.\n * @return true/false\n */\n private boolean allParamsPresent()\n {\n boolean b = params.containsKey(\"-h\") && params.containsKey(\"-p\") &&\n params.containsKey(\"-c\") && params.containsKey(\"-m\") &&\n params.containsKey(\"-q\") &&\n params.containsKey(\"-u\") && params.containsKey(\"-x\");\n if (b)\n {\n try\n {\n Integer.parseInt((String) params.get(\"-p\"));\n }\n catch (NumberFormatException e)\n {\n b = false;\n }\n }\n\n return b;\n }\n\n /**\n * Extract the command-line parameters and initialize the MQ HashTable.\n * @param args\n * @throws IllegalArgumentException\n */\n private void init(String[] args) throws IllegalArgumentException\n {\n int port = 1414;\n if (args.length > 0 && (args.length % 2) == 0)\n {\n for (int i = 0; i < args.length; i += 2)\n {\n params.put(args[i], args[i + 1]);\n }\n }\n else\n {\n throw new IllegalArgumentException();\n }\n\n if (allParamsPresent())\n {\n qMgrName = (String) params.get(\"-m\");\n outputQName = (String) params.get(\"-q\");\n\n try\n {\n port = Integer.parseInt((String) params.get(\"-p\"));\n }\n catch (NumberFormatException e)\n {\n port = 1414;\n }\n \n mqht.put(CMQC.CHANNEL_PROPERTY, params.get(\"-c\"));\n mqht.put(CMQC.HOST_NAME_PROPERTY, params.get(\"-h\"));\n mqht.put(CMQC.PORT_PROPERTY, new Integer(port));\n mqht.put(CMQC.USER_ID_PROPERTY, params.get(\"-u\"));\n mqht.put(CMQC.PASSWORD_PROPERTY, params.get(\"-x\"));\n\n // I don't want to see MQ exceptions at the console.\n MQException.log = null;\n }\n else\n {\n throw new IllegalArgumentException();\n }\n }\n\n /**\n * Connect, open queue, write a message, close queue and disconnect.\n *\n */\n private void testSendAndReceive()\n {\n MQQueueManager qMgr = null;\n MQQueue queue = null;\n int openOptions = CMQC.MQOO_INPUT_SHARED | CMQC.MQOO_OUTPUT | CMQC.MQOO_FAIL_IF_QUIESCING;\n MQPutMessageOptions pmo = new MQPutMessageOptions();\n pmo.options = CMQC.MQPMO_NO_SYNCPOINT | CMQC.MQPMO_FAIL_IF_QUIESCING;\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.options = CMQC.MQGMO_NO_SYNCPOINT | CMQC.MQGMO_WAIT | CMQC.MQGMO_CONVERT | CMQC.MQGMO_FAIL_IF_QUIESCING;\n gmo.matchOptions = CMQC.MQMO_MATCH_CORREL_ID;\n gmo.waitInterval = CMQC.MQWI_UNLIMITED;\n MQMessage sendmsg;\n String msgData;\n DecimalFormat df = new DecimalFormat(\"0000\");\n\n try\n {\n qMgr = new MQQueueManager(qMgrName, mqht);\n logger(\"successfully connected to \"+ qMgrName);\n\n queue = qMgr.accessQueue(outputQName, openOptions);\n logger(\"successfully opened \"+ outputQName);\n \n /*\n * Code to send 2 messages with a specific CorrelId. i.e. 0001 and 0002\n */\n for (int i=0; i < 2; i++)\n {\n // Define a simple MQ message, and write some text\n sendmsg = new MQMessage();\n sendmsg.format = CMQC.MQFMT_STRING;\n sendmsg.messageId = CMQC.MQMI_NONE;\n sendmsg.correlationId = df.format(i+1).getBytes();\n\n // Write message data\n msgData = \"This is a test message from MQTest11B. CorrelID is \"+new String(sendmsg.correlationId);\n sendmsg.writeString(msgData);\n\n // put the message on the queue\n queue.put(sendmsg, pmo);\n logger(\"Sent: Message Data>>>\" + msgData);\n }\n \n /*\n * Code to receive a message with a specific CorrelId. i.e. 0002\n */\n \n // Define a simple MQ message, and write some text\n MQMessage receiveMsg = new MQMessage();\n receiveMsg.messageId = CMQC.MQMI_NONE;\n receiveMsg.correlationId = \"0002\".getBytes();\n\n // get the message on the queue\n queue.get(receiveMsg, gmo);\n\n if (CMQC.MQFMT_STRING.equals(receiveMsg.format))\n {\n String msgStr = receiveMsg.readStringOfByteLength(receiveMsg.getMessageLength());\n logger(\"Received: Message Data>>>\" + msgStr);\n }\n else\n {\n byte[] b = new byte[receiveMsg.getMessageLength()];\n receiveMsg.readFully(b);\n logger(\"Received: Message Data>>>\" + new String(b));\n }\n }\n catch (MQException e)\n {\n logger(\"CC=\" +e.completionCode + \" : RC=\" + e.reasonCode);\n }\n catch (IOException e)\n {\n logger(\"IOException:\" +e.getLocalizedMessage());\n }\n finally\n {\n try\n {\n if (queue != null)\n {\n queue.close();\n logger(\"closed: \"+ outputQName);\n }\n }\n catch (MQException e)\n {\n logger(\"CC=\" +e.completionCode + \" : RC=\" + e.reasonCode);\n }\n try\n {\n if (qMgr != null)\n {\n qMgr.disconnect();\n logger(\"disconnected from \"+ qMgrName);\n }\n }\n catch (MQException e)\n {\n logger(\"CC=\" +e.completionCode + \" : RC=\" + e.reasonCode);\n }\n }\n }\n\n /**\n * A simple logger method\n * @param data\n */\n public static void logger(String data)\n {\n String className = Thread.currentThread().getStackTrace()[2].getClassName();\n\n // Remove the package info.\n if ( (className != null) && (className.lastIndexOf('.') != -1) )\n className = className.substring(className.lastIndexOf('.')+1);\n\n System.out.println(LOGGER_TIMESTAMP.format(new Date())+\" \"+className+\": \"+Thread.currentThread().getStackTrace()[2].getMethodName()+\": \"+data);\n }\n\n /**\n * main line\n * @param args\n */\n public static void main(String[] args)\n {\n MQTest11B write = new MQTest11B();\n\n try\n {\n write.init(args);\n write.testSendAndReceive();\n }\n catch (IllegalArgumentException e)\n {\n logger(\"Usage: java MQTest11B -m QueueManagerName -h host -p port -c channel -q QueueName -u UserID -x Password\");\n System.exit(1);\n }\n\n System.exit(0);\n }\n}And the output should look like this:2021/07/02 14:01:59.316 MQTest11B: testSendAndReceive: successfully connected to MQA1\n2021/07/02 14:01:59.332 MQTest11B: testSendAndReceive: successfully opened TEST.Q1\n2021/07/02 14:01:59.332 MQTest11B: testSendAndReceive: Sent: Message Data>>>This is a test message from MQTest11B. CorrelID is 0001\n2021/07/02 14:01:59.347 MQTest11B: testSendAndReceive: Sent: Message Data>>>This is a test message from MQTest11B. CorrelID is 0002\n2021/07/02 14:01:59.347 MQTest11B: testSendAndReceive: Received: Message Data>>>This is a test message from MQTest11B. CorrelID is 0002\n2021/07/02 14:01:59.347 MQTest11B: testSendAndReceive: closed: TEST.Q1\n2021/07/02 14:01:59.347 MQTest11B: testSendAndReceive: disconnected from MQA1\n"} +{"text": "### Human: I am trying to connect to a remote MQ on the company I work, using the following command, which comes after installing the MQ Client (IBM MQ version 9.04.0) on my machine,Input:P:\\>amqssslc -s TLS_RSA_WITH_AES_256CBC_SHA256 -k \"t:\\Desktop\\certificates\\key\" -x \"server.com(1414)\" -c \"0000%XXXX%QMGR\" -m QMGROutput:Sample AMQSSSLC start Connecting to queue manager\nUsing the server connection channel 0000%XXXX%QMGR\non connection name server.com(1414).\nUsing SSL CipherSpec TLS_RSA_WITH_AES_256CBC_SHA256\nUsing SSL key repository stem t:\\Desktop\\certificates\\key\nNo OCSP configuration specified\nMQCONNX ended ith reason code 2393Where the-kindicates the key.* path, which is a group of files (kdb, rdb, sht). These files were created usingIKeyMan - IBM Key Managerfrom acer.jksfile that current developers use to connect on a web app.The error log file shows the following error:06/11/202020 19:29:45 - Process(25780.1) User(username) Program(amqssslc.exe)\n Host(myhost) Installation(Installation1)\n VRMF(9.1.3.0)\n Time(2020-06-11T09:24:53.270Z)\n RemoteHost(xx.xx.xxx.56)\n CommenInsert1(0000%XXXX%QMGR)\n CommenInsert2(server.com(1414))\n\nAMQ9642: No SSL or TLS certificate for channel '0000%XXXX%QMGR'.\n\nEXPLANATION:\nThe channel '0000%XXXX%QMGR' did not supply a certificate to use during SSL\nor TLS handshaking, but a certificate is required by the remote queue manager. \n\nThe remote host is 'server.com(1414)'. \n\nThe channel did not start.\nACTION:\nEnsure that the key repository of the local queue manager or MQ client contains\na certificate which is associated with the queue manager or client.\nAlternatively, if appropriate, change the remote channel definition so that its\nSSLCAUTH attribute is set to OPTIONAL and it has no SSLPEER value set.Where it leads me to believe that the error is related to the handshake on the channel side.Jks certificate works for the other developers who make the connection to the queue on the server.My mqclient.ini file has the following added configuration:TCP:\n KeepAlive = Yes\n\nCLientExithPath: \n ExitsDefaultPath=C:\\ProgramData\\IBM\\MQ\\exits\n ExitsDefaultPath64=C:\\ProgramData\\IBM\\MQ\\exits64\n\nSSL: \n OCSPAuthentication=NO\n OCSPCheckExtension=NO\n CDPCheckExtension=NOWhat could be the issue? I have also tried changing thelabel of my certificateto indicate a personal certificate there is on the key.kdb file, however, it drops a different error, what I was told from the IT guys at the company I work, is that this certificate label is not needed.### Assistant: In the end the OP (@EdgarHernandez) noticed the error was a typo in the CipherSpec,TLS_RSA_WITH_AES_256CBC_SHA256instead of the correct nameTLS_RSA_WITH_AES_256_CBC_SHA256was causing/contributing to the 2393Putting my troubleshooting notes from the comments in this answer for so they are searchable for future SO users looking at similar errors.There is a difference in how Java/JMS selects a cert to send to the queue manager and how a client using the C libraries selects the cert to send to the queue manager.Java/JMS:Java does not use cert label, it provides a cert that it thinks is a match to present to the queue manager based on what issuers that queue manager trusts, so it is good enough to have the a personal cert that is issued by a CA that the queue manager trusts.C library client:C library clients (whichamqssslcis) bases cert selection this on the cert label. By default it will look for a labelibmwebspheremq, so if you run as a useredgarthe cert the MQ client will look for isibmwebspheremqedgarIn MQ v8.0 and later you can specify a alternate label than the default value.amqssslcdoes this with the-llabel option. So if your cert was labeled justedgar, you should be able to add-l edgarto pick up the cert.Use the following command to check that you have a personal cert listed, it should be prefixed with a-in the first column, if it is only prefixed with a!then it is only the public portion of the key, not the private.runmqakm -cert -list -db t:\\Desktop\\certificates\\key.kdb -stashed\n"} +{"text": "### Human: I am wring custom java code to read messages from Websphere MQ (version 8) and read all the headers from the MQ message.When I use the MQHeaderList to parse all the headers the list size is 0:MQMessage message = new MQMessage();\nqueue.get(message, getOptions);\nDataInput in = new DataInputStream (new ByteArrayInputStream (b));\nMQHeaderList headersfoundlist = null;\nheadersfoundlist = new MQHeaderList (in);\nSystem.out.println(\"headersfoundlist size: \" + headersfoundlist.size());However, I read only a specific MQRFH2 it worksMQMessage message = new MQMessage();\nqueue.get(message, getOptions);\nDataInput in = new DataInputStream (new ByteArrayInputStream (b));\nMQRFH2 rfh2 = new MQRFH2(in);\nElement usrfolder = rfh2.getFolder(\"usr\", false);\nSystem.out.println(\"usr folder\" + usrfolder);How can I parse all the headers of the MQ Message?### Assistant: DataInput in = new DataInputStream (new ByteArrayInputStream (b));What's that about? Not sure why you want to do that.It should just be:MQMessage message = new MQMessage();\nqueue.get(message, getOptions);\nMQHeaderList headersfoundlist = new MQHeaderList(message);\nSystem.out.println(\"headersfoundlist size: \" + headersfoundlist.size());Read morehere.Update:@anshu's comment about it not working, well, I've always found MQHeaderList class to be very buggy. Hence, that is why I don't use it.Also, 99.99% messages in MQ will only ever have 1 embedded MQ header (i.e. MQRFH2). Note: A JMS message == MQRFH2 message. The only case where you will find 2 embedded MQ headers are for messages on the Dead Letter Queue.i.e.{MQDLH}{MQRFH2}{message payload}Is there a real need for your application to process multiple embedded MQ headers? Is your application putting/getting JMS messages (aka MQRFH2 messages)?If so then you should do something like the following:queue.get(receiveMsg, gmo);\n\nif (CMQC.MQFMT_RF_HEADER_2.equals(receiveMsg.format))\n{\n receiveMsg.seek(0);\n MQRFH2 rfh2 = new MQRFH2(receiveMsg);\n\n int strucLen = rfh2.getStrucLength();\n int encoding = rfh2.getEncoding();\n int CCSID = rfh2.getCodedCharSetId();\n String format= rfh2.getFormat();\n int flags = rfh2.getFlags();\n int nameValueCCSID = rfh2.getNameValueCCSID();\n\n String[] folderStrings = rfh2.getFolderStrings();\n for (String folder : folderStrings)\n System.out.println.logger(\"Folder: \"+folder);\n\n if (CMQC.MQFMT_STRING.equals(format))\n {\n String msgStr = receiveMsg.readStringOfByteLength(receiveMsg.getDataLength());\n System.out.println.logger(\"Data: \"+msgStr);\n }\n else if (CMQC.MQFMT_NONE.equals(format))\n {\n byte[] b = new byte[receiveMsg.getDataLength()];\n receiveMsg.readFully(b);\n System.out.println.logger(\"Data: \"+new String(b));\n }\n}\nelse if ( (CMQC.MQFMT_STRING.equals(receiveMsg.format)) ||\n (CMQC.MQFMT_NONE.equals(receiveMsg.format)) )\n{\n Enumeration props = receiveMsg.getPropertyNames(\"%\");\n if (props != null)\n {\n System.out.println.logger(\"Named Properties:\");\n while (props.hasMoreElements())\n {\n String propName = props.nextElement();\n Object o = receiveMsg.getObjectProperty(propName);\n System.out.println.logger(\" Name=\"+propName+\" : Value=\"+o);\n }\n }\n\n if (CMQC.MQFMT_STRING.equals(receiveMsg.format))\n {\n String msgStr = receiveMsg.readStringOfByteLength(receiveMsg.getMessageLength());\n System.out.println.logger(\"Data: \"+msgStr);\n }\n else\n {\n byte[] b = new byte[receiveMsg.getMessageLength()];\n receiveMsg.readFully(b);\n System.out.println.logger(\"Data: \"+new String(b));\n }\n}\nelse\n{\n byte[] b = new byte[receiveMsg.getMessageLength()];\n receiveMsg.readFully(b);\n System.out.println.logger(\"Data: \"+new String(b));\n}\n"} +{"text": "### Human: We are trying to make our project which currently runs on WebSphere also work on Liberty.In trying to get an MDB to work I get the following error: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2085' ('MQRC_UNKNOWN_OBJECT_NAME')The relevant portion of the server.xml:\n \n\n\n\n \nThe values in the Liberty configuration were taken from WebSphere.My question is if the reason for this error can only be that the queue name is incorrect, or if something could be missing from the configuration.Update:the solution turned out to be to change destinationRef to destination and add useJNDI=\"true\"### Assistant: If you look at the logs on MQ and it appears to be trying to open an MQ object calledjms/incomingRequestQueue, try replacingdestinationRefwithdestinationLookup. Some methods of specifying the destination for an activation spec just pass the value straight to MQ instead of doing a lookup in the JNDI context for an admin object and fetching the right property.See the notes inthis tableabout the relationship between destination and destinationLookup. DestinationRef is a property that Liberty adds and I'm not sure how it all relates to the properties the resource adapter actually exposes but may be making this switch unnecessary. It all depends on what string you're trying to look up as a queue on the queue manager.Additionally, for those who might have this issue and are using thedestinationproperty (likely in conjuntion with JMS 1.1/Java EE 6), wheredestinationLookupdoesn't exist, you can specifyuseJNDI=\"true\"as a property on the activation spec to resolve this, see the table linked above.\n"} +{"text": "### Human: I have a XMS MQ Client app that is pulling off messages from a series of MQ endpoints. There are certain reason codes for which the process can continue, and for some that it should abort. For example aMQRC_Q_MGR_NOT_AVAILABLE2059 for one endpoint shouldn't abort the whole process. Consequently I would like to check for this reason code.cf = factoryFactory.CreateConnectionFactory();\nforeach (Endpoint e in env.GetEndpoints())\n{\n Console.WriteLine(\"Consuming messages from endpoint {0}({1})\", e.host, e.port);\n\n // Set the properties\n SetConnectionProperties(cf, e);\n\n try\n {\n ReceiveMessagesFromEndpoint(cf);\n }\n catch (XMSException ex)\n {\n Console.WriteLine(\"XMSException caught: {0}\", ex);\n Console.WriteLine(\"Error Code: {0}\", ex.ErrorCode);\n Console.WriteLine(\"Error Message: {0}\", ex.Message);\n }\n}Problem is that the only attributes available on the XMSException to examine areex.ErrorCodeandex.Message, which are respectively:Error Code: CWSMQ0006andError Message: CWSMQ0006E: An exception was received during the call to the method ConnectionFactory.CreateConnection: CompCode: 2, Reason: 2059.I can see the Reason in the Message, but can't find a method or attribute to retrieve it.### Assistant: There are probably 2 ways to do it1) You can use the LinkedExceptionSomething like the followingtry\n {\n }\n catch (XMSException e)\n {\n if(e.LinkedException!=null)\n Console.WriteLine(e.LinkedException.Message);\n else\n Console.WriteLine(e);\n }2) Reference amqmdnet.dll as well to the project and use MQException.Something liketry\n {\n }\n catch (XMSException e)\n {\n if(e.LinkedException!=null)\n {\n IBM.WMQ.MQException inner = (IBM.WMQ.MQException)e.LinkedException;\n Console.WriteLine(\"Reason:\"+ inner.ReasonCode);\n }\n else\n Console.WriteLine(e);\n }\n"} +{"text": "### Human: I've got a Spring Integration flow which uses an inbound gateway to get messages from an IBM MQ queue:However I'm not capable of assigning security settings. In particular, I need an username, password and userAuthenticationMQCSP = false (for reasons beyond the scope of this post, I won't get into details but my broker will throw a MQRC = 2009 otherwise).I've followed theIBM guide to connect with jmsTemplateand works just fine. This uses the officialSpring boot starter from IBM MQwhich will kindly create a connection factory and will autoconfigure it with some defaults from application.properties:ibm.mq.queueManager=myQMName\nibm.mq.channel=myChannel\nibm.mq.connName=myhostname(myPort)\nibm.mq.user=username\nibm.mq.password=*******\nibm.mq.userAuthenticationMQCSP=falseNow, back to the Spring Integration case. According to theint-jms:inbound-gateway spec, a connectionFactory will be injected to the gateway, by name (attribute: connection-factory) which is set up to be \"jmsConnectionFactory\" by defaultBy default, all of the JMS adapters that require a reference to the\n ConnectionFactory automatically look for a bean named\n jmsConnectionFactory. That is why you do not see a connection-factory\n attribute in many of the examples. However, if your JMS\n ConnectionFactory has a different bean name, you need to provide that\n attribute.I don't see any way to set up a predictable name for the connection factory that I can plug into the int-jms:inbound-gateway.Now, taking a different approach, as perthis exampleI've created my connectionFactory with an adecuate name:\n \n \n \n \n \nBut now I need somewhere to put the credentials and the security parameters. Looking at the example above, it looks like I need to plug something like:\n \n \n \nHowever it is unclear to me how to implement this SecureJMSConnectionAdapter.Additionally, if I set up my own connection factory, I will lose all of MQ boot starter automagic thanks to this annotation on theMQAutoConfiguration class:@ConditionalOnMissingBean(value=javax.jms.ConnectionFactory.class)Any ideas on how to put these pieces together?EDIT: Just to avoid any possible red herrings to anyone, the MQRC2009 was irrelevant to ibm.mq.userAuthenticationMQCSP=false.### Assistant: Some of my old projects I used a bean like this:\n \n \n \nShould work well as a wrapper for yourcom.ibm.mq.jms.MQQueueConnectionFactory, but you have to use thisjmsQueueConnectionFactoryin the target components.Although it looks like the mentionedIBM MQ JMS Springdoesn't that for us properly exposing ajmsConnectionFactorybean. You can rely on the default from Spring Integration in this case or use thatjmsConnectionFactoryexplicitly for theconnection-factory.Also with Spring Boot you should consider to go away from XML configuration and give a chance for Spring Integration Java DSL:https://docs.spring.io/spring-integration/docs/5.1.7.RELEASE/reference/html/#java-dsl\n"} +{"text": "### Human: I'm having a hard time trying to connect to my institution's MQ v9.I was provided connectivity info by the MQ team:-String hostName = '...'\nint port = ...\nString queueManager = '...'\nString channel = '...'\nString userId = 'ABC123'\nString password = '...'Given the following code...JmsConnectionFactory cf = JmsFactoryFactory.\n getInstance(WMQConstants.WMQ_PROVIDER).\n createConnectionFactory()\n\ncf.setStringProperty(WMQConstants.WMQ_HOST_NAME, hostName)\ncf.setIntProperty(WMQConstants.WMQ_PORT, port)\ncf.setStringProperty(WMQConstants.WMQ_CHANNEL, channel)\ncf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT)\ncf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, queueManager)\ncf.setStringProperty(WMQConstants.USERID, userId)\ncf.setStringProperty(WMQConstants.PASSWORD, password)\n// tried with both `true` and `false`... same error\ncf.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, true)\n\nConnection connection = cf.createConnection()\nconnection.start()\nconnection.close()... I'm getting this error:-Exception in thread \"main\" com.ibm.msg.client.jms.DetailedJMSSecurityException: \nJMSWMQ2013: The security authentication was not valid \nthat was supplied for queue manager '...' with connection \nmode 'Client' and host name '...'.\nPlease check if the supplied username and password \nare correct on the queue manager to which you are \nconnecting. \nCaused by: com.ibm.mq.MQException: JMSCMQ0001: IBM \nMQ call failed with compcode '2' ('MQCC_FAILED') reason \n'2035' ('MQRC_NOT_AUTHORIZED').I was told by the MQ team that the log has something like this:------ amqzfuca.c : 4527 -------------------------------------------------------\n04/17/2019 10:32:20 AM - Process(10468.40757) User(...) Program(...)\n Host(...) Installation(Installation1)\n VRMF(9.1.0.1) QMgr(...)\n Time(2019-04-17T15:32:20.542Z)\n RemoteHost(...)\n CommentInsert1(...)\n CommentInsert2(...)\n CommentInsert3(CLNTUSER(XYZ) ADDRESS(...))\n\nAMQ9777E: Channel was blocked\n\nEXPLANATION:\nThe inbound channel '...' was blocked from address '...' \nbecause the active values of the channel matched a record\nconfigured with USERSRC(NOACCESS). The active values of the channel were\n'CLNTUSER(XYZ) ADDRESS(...)'.... and it fails because it's using the wrong credential to connect.While I passed in a different credential (user ID: ABC123), the MQ log sees the user ID I used to log into my machine (user ID: XYZ).Why does the credential I explicitly passed in get omitted? How do I fix this?I'm using this dependency:\n com.ibm.mq\n com.ibm.mq.allclient\n 9.1.2.0\nI'm not using IBM JRE... more precisely, I'm using Oracle JDK 1.8 on my Mac, if that helps.Thank you.UPDATE 2019-04-22I was able to get more accurate logs from MQ team now since I'm trying too many things at the same time.If I setUSER_AUTHENTICATION_MQCSPtotrue, then my machine's user ID (XYZ) is passed in.If I setUSER_AUTHENTICATION_MQCSPtofalse, then I'm getting different error message now:-04/22/2019 01:19:49 PM - Process(1147099.9759) User(...) Program(...)\n Host(rofesb911a) Installation(Installation1)\n VRMF(9.1.0.1) QMgr(...)\n Time(2019-04-22T18:19:49.323Z)\n RemoteHost(...)\n CommentInsert1(wa03598)\n CommentInsert2(REQUIRED)\n CommentInsert3(MCAUSER(ABC123) CLNTUSER(ABC123) ADDRESS(...))\n\nAMQ9790I: The failed authentication check was caused by a CHLAUTH record with\nCHCKCLNT(REQUIRED).\n\nEXPLANATION:\nThe user ID 'ABC123' and its password were checked because the inbound\nconnection matched a channel authentication record with CHCKCLNT(REQUIRED).\n\nThe active values of the channel were 'MCAUSER(ABC123) CLNTUSER(ABC123)\nADDRESS(...)'. The MATCH(RUNCHECK) mode of the DISPLAY CHLAUTH\nMQSC command can be used to identify the relevant CHLAUTH record.The good news is it's seeing the correct user ID (ABC123), but I was told the password is invalid. I don't believe it was a password problem because I was able to use that same credential to access other protected web services.### Assistant: Your MQ team have given you the credentials to use (i.e. user id and password) so I would assume that they have turned on user id and password checking on the queue manager.Queue Manager is not using ADOPTCTX(YES)ADOPTCTX(YES) is a setting on the queue manager that indicates that once user id and password have been verified as being correct, the user id (in your case \"ABC123\") should then be used for all further security checks (e.g. am I allowed to use this queue). If this setting is NO, then after the password validation is complete, it will actually use the client machine logged on user id which is also sent up to the queue manager (in your case \"XYZ\"). It seems likely that this is the case on your queue manager.USER_AUTHENTICATION_MQCSP modeThere are actually two ways that a user id and password can be sent from a Java client application to the queue manager.The first (decades old) was in use prior to IBM MQ V8, and used a restricted length flow (12 chars max each field) that was originally there for DOS SNA clients to send the two fields to the QMgr. This flow across the network was also the way the client logged on user id got sent to the queue manager, and so only one could be sent.The newer one, added in MQ V6, and made more useful with password checking natively in the queue manager in MQ V8, was the MQCSP structure, which allowed for variable length user id and password fields. This was a different network flow from the one that sends the client logged on user id, and so both are sent to the queue manager.When you setUSER_AUTHENTICATION_MQCSPto true, you were telling the Java client to use the second mode. This gives the opportunity to be tripped up by the ADOPTCTX(NO) setting. If you set it to false, the only user id that makes it to the queue manager is ABC123 (in your example) and will likely give you a different, perhaps successful result.Try your application withUSER_AUTHENTICATION_MQCSPset to false, and when it works, advise your MQ team that they should use ADOPTCTX(YES) which is also now the default value, then you can switch back toUSER_AUTHENTICATION_MQCSPset to true.\n"} +{"text": "### Human: I am trying to connect to MQ using XMS .Net. The MQ is currently setup on the server and using IBM.WMQ I am able to connect to it. Now I want to explore the IBM XMS as it supports API so in future we can try connecting to MQ from .net full-framework or .net core clients.Spent 2 days over the web but not able to find a full sample where this is implemented. I also don't want to install the MQ client on my local machine. Is there a way to do this? Are there any good articles available for the same?### Assistant: Following link provides an overview of XMS.NEThttp://www-01.ibm.com/support/docview.wss?uid=swg27024064IBM MQ Redistributable package can be used to develop MQ .NET applications without installing the Client.You will have to use MQ v9.0.5 or above to use XMS.NET client.You can download the latest redistributable package from the following link9.1.0 IBM MQ C and .NET redistributable client for Windows x64If you have MQ client install then there are samples located at \"MQ_INSTALL_PATH\\Tools\\dotnet\\samples\\cs\\xms\\simple\\wmq\" and following link provides a brief description about the sampleshttps://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.xms.doc/xms_csamp.htmlFollowing is the code sample to get a message asynchronously using Message listeners./// \n /// Setup connection to MQ queue manager using XMS .NET\n /// \n private void ibmmqSetupConnection()\n {\n XMSFactoryFactory factoryFactory;\n IConnectionFactory cf;\n IDestination destination;\n IMessageConsumer consumerAsync;\n MessageListener messageListener;\n // Get an instance of factory.\n factoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\n\n // Create WMQ Connection Factory.\n cf = factoryFactory.CreateConnectionFactory();\n\n // Set the properties\n cf.SetStringProperty(XMSC.WMQ_HOST_NAME, \"host.ibm.com\");\n cf.SetIntProperty(XMSC.WMQ_PORT, 1414);\n cf.SetStringProperty(XMSC.WMQ_CHANNEL, \"QM.SVRCONN\");\n cf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);\n cf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, \"QM1\");\n cf.SetStringProperty(XMSC.USERID, \"myuserid\");\n cf.SetStringProperty(XMSC.PASSWORD, \"passw0rd\");\n\n // Create connection.\n connectionWMQ = cf.CreateConnection();\n // Create session with client acknowledge so that we can acknowledge \n // only if message is sent to Azure Service Bus queue\n sessionWMQ = connectionWMQ.CreateSession(false, AcknowledgeMode.ClientAcknowledge);\n // Create destination\n destination = sessionWMQ.CreateQueue(\"INPUTQ\");\n // Create consumer\n consumerAsync = sessionWMQ.CreateConsumer(destination);\n\n // Setup a message listener and assign it to consumer\n messageListener = new MessageListener(OnMessageCallback);\n consumerAsync.MessageListener = messageListener;\n\n // Start the connection to receive messages.\n connectionWMQ.Start();\n\n // Wait for messages till a key is pressed by user\n Console.ReadKey();\n\n // Cleanup\n consumerAsync.Close();\n destination.Dispose();\n sessionWMQ.Dispose();\n connectionWMQ.Close();\n }\n"} +{"text": "### Human: I have two applications SystemA and SystemB communicating via request and response messages and using correlation IDs.I would like to be able to test SystemA in isolation without having to rely on the availability of our IBM MQ broker and SystemB. Ideally I would like to do it in our continuous integration environment (Jenkins). I am looking for common approaches to this problem, before I code a solution myself in-house.How can I create a mockup of the IBM MQ broker and SystemB for the purpose of testing SystemA in isolation?### Assistant: Why mock the queue? Have you considered mocking the consumer from the queue instead? This would be simpler and would leave the queues in place for when the full featured service became available.\n"} +{"text": "### Human: I'm trying to connect to WebSphere MQ. But when I try to connect to the logs, I see the message:AMQ5540: The WebSphere MQ Client for Java application did not specify the user\nID and password\n\nExplanation:\n\nThe queue administrator is configured to request a user ID and password,\nbut these data not specified.\n\nLaw:\n\nMake sure that the application contains the correct user ID and password,\nor change the queue manager configuration to OPTIONAL to allow\nConnect to applications that do not specify a user ID and password.How can I configure the queue manager configuration for OPTIONAL?### Assistant: IBM MQ Technote \"AMQ5540, AMQ5541 and AMQ5542, application did not supply a user ID and password, 2035 MQRC_NOT_AUTHORIZED\" describes how resolve this issue.I would suggest you look at how to provide a valid username and password instead of disabling this check by setting it toOPTIONAL, but the above Technote shows both how to send the password from various types of applications and how to set it toOPTIONAL.\n"} +{"text": "### Human: Is arefresh security type(ssl)command needed or not after we deploy renewed certs into keystore. I usually execute this command after certs renewal, but I saw cases where this command is not executed and still the channels picked up the new certs. Are the certs which are put into the keystore are coming into effect immediately or we need to perform ssl refresh.### Assistant: To ensure that all connections in or out of the queue manager are using current information in the key store you should always run theREFRESH SECURITY TYPE(SSL)after any updates are made (for example to the private key or even adding new trusted CA certs).The first time any MQ process needs to access the key store, the process will read the key store and cache it in memory. In a default configuration the connections into the queue manager are handled by processes that keep running so they would hold onto that key store cache after the first inbound connection to the queue manager which requires the key store. In a default configuration outbound channel connections use separate runmqchl processes that start when the channel is started so they always read the current key store each time.This means that in some cases things may work without aREFRESH SECURITY TYPE(SSL)for example:If a SDR channel withMCATYPE(PROCESS)starts, a new runmqchl process is started and will read the key store fresh and pick up any changes.If no inbound TLS connection has been received since the last time the queue manager was started then even if you make changes to the key store they will be picked up the first time an inbound TLS connection is received.Morag Hughson gave a presentation at Capitalware's MQ Technical Conference v2.0.1.4 titled \"MQ SSL/TLS Channels Including V8 changes\". The notes portion of page 10 of the PDF have a good summary of whatREFRESH SECURITY TYPE(SSL)does.Refreshing SSL on WebSphere MQ - NotesThis feature was introduced in WebSphere MQ V6.The SSL environment set up to run SSL channels in a channel process has a cached view of the key repository made at initialization time.\n If you make changes to your key repository, i.e. add, remove or update\n certificates, for example, because your are replacing a certificate\n that is about to expire, this cached view needs to be refreshed in\n order for the SSL channels to start using the new certificates.In order to refresh this cached view of the SSL environment, without disrupting any non-SSL channels, use the REFRESH SECURITY TYPE(SSL)\n command. This will stop all the SSL channels on the queue manager, new\n cached view(s) of the key repository will be made and all the sending\n type channels will be started again. Receiving type channels will get\n restarted as the partner end retries the connection.Non-SSL channels will be unaffected by this command and will continue to run.Also use this command to pick up other changes, such as a new Key Repository locations, or new LDAP CRL/ARL locations.IBM documents this in the IBM MQ Knowledge Center, below are two pages with information on the topic:IBM MQ v7.5 KC page \"Refreshing SSL or TLS security\"About this taskWhen a channel is secured using Secure Sockets Layer (SSL) or TLS, the\n digital certificates and their associated private keys are stored in\n the key repository. A copy of the key repository is held in memory\n while a channel is running. If you make a change to the key\n repository, you can refresh the copy of the key repository that is\n held in memory without restarting the channel.When you refresh the cached copy of the key repository, all SSL or TLS\n channels that are currently running are updated:Sender, server, and cluster-sender channels that use SSL or TLS are allowed to complete the current batch of messages. The channels then\n run the SSL handshake again with the refreshed view of the key\n repository.All other channel types that use SSL or TLS are stopped. If the partner end of the stopped channel has retry values defined, the\n channel retries and runs the SSL handshake again. The new SSL\n handshake uses the refreshed view of the contents of the key\n repository, the location of the LDAP server to be used for the\n Certificate Revocation Lists, and the location of the key repository.\n In the case of server-connection channel, the client application loses\n its connection to the queue manager and has to reconnect to continue.MQ v7.5 KC page \"REFRESH SECURITY\" states:Usage notes for REFRESH SECURITYWhen you issue the REFRESH SECURITY TYPE(SSL) MQSC command, all\n running SSL channels are stopped and restarted. Sometimes SSL channels\n can take a long time to shut down and this means that the refresh\n operation takes some time to complete. There is a time limit of 10\n minutes for an SSL refresh to complete (or 1 minute on z/OS), so it\n can potentially take 10 minutes for the command to finish. This can\n give the appearance that the refresh operation has \"frozen\". The\n refresh operation will fail with an MQSC error message of AMQ9710 or\n PCF error MQRCCF_COMMAND_FAILED if the timeout is exceeded before all\n channels have stopped. This is likely to happen if the following\n conditions are true:The queue manager has many SSL channels running simultaneously when the refresh command is invokedThe channels are handling large numbers of messagesIf a refresh fails under these conditions, retry the command later\n when the queue manager is less busy. In the case where many channels\n are running, you can choose to stop some of the channels manually\n before invoking the REFRESH command....When using TYPE(SSL):On platforms other than z/OS, the command updates all SSL channels regardless of whether a security refresh is needed.If a refresh is to be performed, the command updates all SSL channels currently running, as follows:Sender, server and cluster-sender channels using SSL are allowed to complete the current batch. In general they then run the SSL handshake\n again with the refreshed view of the SSL key repository. However, you\n must manually restart a requester-server channel on which the server\n definition has no CONNAME parameter.All other channel types using SSL are stopped with a STOP CHANNEL MODE(FORCE) STATUS(INACTIVE) command. If the partner end of the\n stopped message channel has retry values defined, the channel retries\n and the new SSL handshake uses the refreshed view of the contents of\n the SSL key repository, the location of the LDAP server to be used for\n Certification Revocation Lists, and the location of the key\n repository. In the case of a server-connection channel, the client\n application loses its connection to the queue manager and has to\n reconnect in order to continue.\n"} +{"text": "### Human: I wrote a client to read segmented message sent via MQ but getting error message. Below code work perfectly fine but it read single message at time, Application has to concatenate the segmented message which is not what I wantedpublic void getMessage(){\n\n try {\n\n MQEnvironment.hostname = \"\"; \n MQEnvironment.channel = \"\"; \n MQEnvironment.port = ;\n\n MQQueueManager QMgr = new MQQueueManager(\"MQManager\");\n\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n\n gmo.options = MQConstants.MQOO_INPUT_AS_Q_DEF|\n MQConstants.MQGMO_WAIT|\n MQConstants.MQGMO_ALL_SEGMENTS_AVAILABLE|\n MQConstants.MQGMO_LOGICAL_ORDER;\n\n gmo.matchOptions = MQConstants.MQMO_NONE;\n gmo.waitInterval = MQConstants.MQWI_UNLIMITED;\n\n MQMessage message = new MQMessage();\n MQQueue queue = QMgr.accessQueue(\"QName\",\n gmo.options);\n\n while(true){\n\n queue.get(message, gmo);\n int dataLength = message.getDataLength(); \n System.out.println(message.readStringOfCharLength(dataLength));\n message.clearMessage();\n }\n } catch (Exception e) {\n\n e.printStackTrace();\n }\n }When I added MQGMO_SYNCPOINT to options, it fails with com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2046'.Not sure why this fails, if I can atleast get this to work, I will be able to commit after safely processing all segmented message in the application.public void getMessage(){\n\n try {\n\n MQEnvironment.hostname = \"\"; \n MQEnvironment.channel = \"\"; \n MQEnvironment.port = ;\n\n MQQueueManager QMgr = new MQQueueManager(\"MQManager\");\n\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n\n gmo.options = MQConstants.MQOO_INPUT_AS_Q_DEF|\n MQConstants.MQGMO_WAIT|\n MQConstants.MQGMO_ALL_SEGMENTS_AVAILABLE|\n MQConstants.MQGMO_LOGICAL_ORDER|\n MQConstants.MQGMO_SYNCPOINT;\n\n gmo.matchOptions = MQConstants.MQMO_NONE;\n gmo.waitInterval = MQConstants.MQWI_UNLIMITED;\n\n MQMessage message = new MQMessage();\n MQQueue queue = QMgr.accessQueue(\"QName\",\n gmo.options);\n\n while(true){\n\n queue.get(message, gmo);\n int dataLength = message.getDataLength(); \n System.out.println(message.readStringOfCharLength(dataLength));\n QMgr.commit();\n message.clearMessage();\n }\n } catch (Exception e) {\n\n e.printStackTrace();\n }\n }When I try to read segmented message as a single message; it fails with \ncom.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2046'.I would appreciate if some could help solve this issue; I am not really sure what is wrong with the below code. This is my preferred way to read the segmented message.public void getMessage(){\n\n\n try {\n\n MQEnvironment.hostname = \"\"; \n MQEnvironment.channel = \"\"; \n MQEnvironment.port = ;\n\n MQQueueManager QMgr = new MQQueueManager(\"MQManager\");\n\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n\n gmo.options = MQConstants.MQOO_INPUT_AS_Q_DEF|\n MQConstants.MQGMO_WAIT|\n MQConstants.MQGMO_COMPLETE_MSG;\n\n gmo.matchOptions = MQConstants.MQMO_NONE;\n gmo.waitInterval = MQConstants.MQWI_UNLIMITED;\n\n MQMessage message = new MQMessage();\n MQQueue queue = QMgr.accessQueue(\"QName\",\n gmo.options);\n\n while(true){\n\n queue.get(message, gmo);\n int dataLength = message.getDataLength(); \n System.out.println(message.readStringOfCharLength(dataLength));\n message.clearMessage();\n }\n } catch (Exception e) {\n\n e.printStackTrace();\n }\n }### Assistant: The issue is that you are usinggmo.optionsas the open options for theaccessQueuemethod and the get message options for theget. You are mixing both open options and get message options into this field.Each option is represented by a bit in the options field. When you use that field as the open options the bits are being interpreted by MQ as open options even if you specify get message options, conversely when you use the field as the get message options they are being interpreted by MQ as get message options.Lets look at the values of each option you are specifying in the your samples represented as hex along with the equivalent open or get option based on the value:MQOO_INPUT_AS_Q_DEF 0x00000001\nMQGMO_WAIT 0x00000001\n\nMQOO_INPUT_SHARED 0x00000002\nMQGMO_SYNCPOINT 0x00000002\n\nMQOO_RESOLVE_NAMES 0x00010000\nMQGMO_COMPLETE_MSG 0x00010000\n\nMQOO_BIND_NOT_FIXED 0x00008000\nMQGMO_LOGICAL_ORDER 0x00008000\n\nMQOO_RESOLVE_LOCAL_Q 0x00040000\nMQOO_RESOLVE_LOCAL_TOPIC 0x00040000\nMQGMO_ALL_SEGMENTS_AVAILABLE 0x00040000Because you are incorrectly using this as open options withQMgr.accessQueue(\"QName\",gmo.options);MQ is interpreting this in unexpected ways.For your first \"working\" example, the open options would be interpreted as specified below, these specific open options together would not cause any problems for local queues, this is why it is \"working\" even though it is not correct:MQOO_INPUT_AS_Q_DEF 0x00000001\nMQOO_INPUT_AS_Q_DEF 0x00000001 //MQGMO_WAIT\nMQOO_RESOLVE_LOCAL_Q 0x00040000 //MQGMO_ALL_SEGMENTS_AVAILABLE\nMQOO_RESOLVE_LOCAL_TOPIC 0x00040000 //MQGMO_ALL_SEGMENTS_AVAILABLE\nMQOO_BIND_NOT_FIXED 0x00008000 //MQGMO_LOGICAL_ORDERIn your second example that fails with2046 (MQRC_OPTIONS_ERROR)it is because the options are being interpreted as specified below. You cannot haveMQOO_INPUT_AS_Q_DEFandMQOO_INPUT_SHAREDtogether in the open options, this causes the2046:MQOO_INPUT_AS_Q_DEF 0x00000001\nMQOO_INPUT_AS_Q_DEF 0x00000001 //MQGMO_WAIT\nMQOO_RESOLVE_LOCAL_Q 0x00040000 //MQGMO_ALL_SEGMENTS_AVAILABLE\nMQOO_RESOLVE_LOCAL_TOPIC 0x00040000 //MQGMO_ALL_SEGMENTS_AVAILABLE\nMQOO_BIND_NOT_FIXED 0x00008000 //MQGMO_LOGICAL_ORDER\nMQOO_INPUT_SHARED 0x00000002 //MQGMO_SYNCPOINTIn your third example that fails with2046 (MQRC_OPTIONS_ERROR)it is because the options are being interpreted as specified below.MQOO_RESOLVE_NAMESis documented as valid only in the MQ C++ APIs, this causes the2046:MQOO_INPUT_AS_Q_DEF 0x00000001\nMQOO_INPUT_AS_Q_DEF 0x00000001 //MQGMO_WAIT\nMQOO_RESOLVE_NAMES 0x00010000 //MQGMO_COMPLETE_MSGUsing theMQOO_INPUT_AS_Q_DEFas a get message option is not causing any issues because it has the same value asMQGMO_WAITwhich you already have in each of your examples, having this is not changing the behavior of the get message options.MQGMO_WAIT 0x00000001 //MQOO_INPUT_AS_Q_DEF\nMQGMO_WAIT 0x00000001The following based on your second and third examples should work:public void getMessage(){\n\n\n try {\n\n MQEnvironment.hostname = \"\"; \n MQEnvironment.channel = \"\"; \n MQEnvironment.port = ;\n\n MQQueueManager QMgr = new MQQueueManager(\"MQManager\");\n\n // Set up the options on the queue we wish to open\n int openOptions = MQConstants.MQOO_INPUT_AS_Q_DEF;\n\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n\n gmo.options = MQConstants.MQGMO_WAIT|\n MQConstants.MQGMO_ALL_SEGMENTS_AVAILABLE|\n MQConstants.MQGMO_LOGICAL_ORDER|\n MQConstants.MQGMO_SYNCPOINT|\n MQConstants.MQGMO_COMPLETE_MSG;\n\n gmo.matchOptions = MQConstants.MQMO_NONE;\n gmo.waitInterval = MQConstants.MQWI_UNLIMITED;\n\n MQMessage message = new MQMessage();\n MQQueue queue = QMgr.accessQueue(\"QName\", openOptions);\n\n while(true){\n\n queue.get(message, gmo);\n int dataLength = message.getDataLength(); \n System.out.println(message.readStringOfCharLength(dataLength));\n QMgr.commit();\n message.clearMessage();\n }\n } catch (Exception e) {\n\n e.printStackTrace();\n }\n }If you run themqrcutility that comes with full MQ client installs you can find out what the error code translates to:$mqrc 2046\n\n 2046 0x000007fe MQRC_OPTIONS_ERROR\n"} +{"text": "### Human: If a Solaris based MQ Manager is sending messages to an intermediate Windows MQ Manager that then sends on messages to a Linux MQ manager, does the CCSID need to be changed on them all to be the same? I don't think so but I am being pushed to do so...I have an issue where a client is sending messages from an application on Solaris via an intermediate MQ Manager on Windows but the Linux MQ Manager final destination based application receives the message with CR/LF line ending characters it can't deal with. Should the receiver end group write a conversion exit program? Or an MCA?### Assistant: IBM MQ does not deal with line feeds. It is not like transferring a file with ftp and using ascii mode where ftp will convert from Unix LF end of line to Window CR and LF end of line. For MQ it is just another character in the character set to translate. If the sending app is sending data that includes CR/LF characters, MQ will treat them as any other character in the data. If the receiving application expecting a file with end of lines to be sent as a MQ message it would be required to deal with the end of lines.MQ Classes for Java applications running on a Solaris server default to CCSID 819, and a IBM MQ queue manager running on Solaris also will default to CCSID 819.CCSID 819is described asISO 8859-1 ASCII.I created a file called test.txt containing the single word \"test\" and ran unix2dos against the file.The output below shows the ASCII characters as HEX values:$cat test.txt | hexdump -C\n00000000 74 65 73 74 0d 0a |test..|\n00000006Note that in the above output the ASCII hex values0dis theCRand0ais theLF, these are the common Windows end of line.If we assume that the default CCSID 819 is used for both the Solaris MQ Classes for Java application and the Solaris queue manager, then we can start out with the assumption that the above two hex values represent CR/LF at the end of each line.You stated that your Windows queue manager has CCSID 437 which is typical for a US based Windows server.CCSID 437is described asUSA PC-DATAand is also ASCII.Linux queue managers typically default to CCSID 1208.CCSID 1208is described asUTF-8 with IBM PUAand is a Variable Byte character set it can have from 1 to four bytes per character. This can represent over a million characters including all ASCII characters. All 127 ASCII characters are represented in UTF-8 as the same single byte HEX values as in ASCII.Going from ASCII to UTF-8 is loss less, going from UTF-8 to ASCII can have loss if non-ASCII characters are used since there is not a equivalent character in ASCII and MQ converts it to the default substitution character with HEX value1A. I have seen this for example with a Euro symbol. Most if not all of the first 255 characters of UTF-8 are the same as CCSID 819.Given the above CCSID assumptions the conversion would look like this:Original IBM MQ Classes for Java app running on Solaris sending data with CR/LF end of line characters:$cat test.txt | hexdump -C\n00000000 74 65 73 74 0d 0a |test..|\n00000006Solaris Queue Manager Sender channel with CONVERT(YES) sending to Windows Queue Manager with CCSID 437:cat test.txt | iconv -f IBM819 -t IBM437 | hexdump -C\n00000000 74 65 73 74 0d 0a |test..|\n00000006As expected the output is the same since both 819 and 437 are ASCII character sets and the data was not representing any thing above the first 127 ASCII characters.Solaris Queue Manager Sender channel with CONVERT(YES) sending to Windows Queue Manager with CCSID 437 Sender channel with CONVERT(YES) sending to Linux Queue Manager with CCSID 1208:cat test.txt | iconv -f IBM819 -t IBM437 | iconv -f IBM437 -t UTF-8 | hexdump -C\n00000000 74 65 73 74 0d 0a |test..|\n00000006As expected the output is the same since both 819 and 437 are ASCII character sets and the first 127 characters of UTF-8 (1208) are normal ASCII characters.Summary: If the sending application is sending CR/LF in the data, MQ message conversion will not change this and if the CCSIDs in use are the above listed CCSIDs it does not even change the actual HEX character value. The sending application would need to change what they are sending or the receiving application would need to accommodate these characters.A good reference on ASCII, UNICODE, UTF-8 and more can be found in the article \"Unicode, UTF8 & Character Sets: The Ultimate Guide\".\n"} +{"text": "### Human: Problem: MQ7 has a hard limit of a maximum 100MB jms message. For large payloads ( xml ) that are close that, can this be compressed on the queue to shorten the data length?I tried compressing a 7MB jms string message using the MQ ZLIB compression on the svr.def.conn channel and it didn't make any difference to the data length of the jms message. I only set the one channel and expected the channel that is used would compress the data going into the queue.MQ Server: 7.5\nClient: JAVA\nMessage Type: String### Assistant: Channel level compression is used to compress the data in transit between the two ends of the channel, in your case between the JMS client and the MQ SVRCONN channel. The messages themselves will be compressed while going over the network but not while sitting on the queue.\n"} +{"text": "### Human: JMS app requires seven parameters to make successful SSL connection with MQ series given here,https://github.com/ibm-messaging/mq-tls-ssl-wizard/blob/master/com.ibm.mq.ssl-wizard/src/tlswizard/samples/SSLSampleJMS.javaI am trying to interpret these parameters,Conname- the connection name of the server queue manager in the same format as the CONNAME parameter on the MQSC DEFINE CHANNEL command, but without the port specified.I guess this is host namePort - the connection port of the server queue manager.This is port numberSvrconnChannelName - the name of the server connection channel on the server queue manager with which the sample program will try to connect.QMgrName - the name of the server queue manager.SSLCiph - the SSL CipherSpec.I am using SSL_RSA_WITH_AES_256_CBC_SHA.SSLKeyr - the name of a single store, which is both the keystore and truststore.I generated myjksfile.jks using mycertfile.cert using mypassword with below command and provided path of this file in program as \"C:\\Users\\abc\\myjksfile.jks\",keytool -import -trustcacerts -keystore myjksfile.jks -storepass changeit -noprompt -alias ibmWebSphereMQUTQX -file C:\\mqlib\\mycertfile.certSSLKeyrPassword - the SSL key repository password\nthe password which I used to generate myjksfile.jks fileRunning above program with these seven parameters results this exception,com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0018: Failed to connect to \nqueue manager 'XXXX' with connection mode 'Client' and host name \n'xxxx.yyyyyy.com(XXXXX)'.Check the queue manager is started and if running in\nclient mode, check there is a listener running. Please see the linked \nexception for more information. at \ncom.ibm.msg.client.wmq.common.internal.Reason.reasonToException\n(Reason.java:580) at \ncom.ibm.msg.client.wmq.common.internal.Reason.createException\n(Reason.java:216) at com.ibm.msg.client.wmq.internal.WMQConnection. \n(WMQConnection.java:431) at \ncom.ibm.msg.client.wmq.factories.WMQConnectionFactory.\ncreateV7ProviderConnection(WMQConnectionFactory.java:6789) at \ncom.ibm.msg.client.wmq.factories.WMQConnectionFactory.\ncreateProviderConnection(WMQConnectionFactory.java:6157)\nat com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.\ncreateConnection(JmsConnectionFactoryImpl.java:285)\nat com.ibm.mq.jms.MQConnectionFactory.createCommonConnection\n(MQConnectionFactory.java:6126) at \ncom.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection \n(MQQueueConnectionFactory.java:115) at \nSSLSampleJMS.runSample(SSLSampleJMS.java:176)\nat SSLSampleJMS.main(SSLSampleJMS.java:135)\nCaused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with\ncompcode '2' ('MQCC_FAILED') reason '2393' ('MQRC_SSL_INITIALIZATION_ERROR').\nat com.ibm.msg.client.wmq.common.internal.Reason.createException\n(Reason.java:204)... 8 more\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2393;AMQ9204: Connection to\nhost 'xxxx.yyyyyy.com(XXXXX)' rejected.\n[1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2393;AMQ9771: SSL handshake failed.\n[1=java.lang.IllegalArgumentException[Cannot support\nSSL_RSA_WITH_AES_256_CBC_SHA with currently installed \nproviders],3=xxxx.yyyyyy.com/XX.XXX.XXX.XXX:XXXXX (xxxx.yyyyyy.com),4=SSLSocket.createSocket,5=default]],3=xxxx.yyyyyy.com(XXXXX),5=RemoteTCPConnection.makeSocketSecure]\nat com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:2098)\nat com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1347)\nat com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:350)\n... 7 more\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2393;AMQ9771: SSL handshake\nfailed. [1=java.lang.IllegalArgumentException[Cannot support\nSSL_RSA_WITH_AES_256_CBC_SHA with currently installed \nproviders],3=xxxx.yyyyyy.com/XX.XXX.XXX.XXX:XXXXX\n(xxxx.yyyyyy.com),4=SSLSocket.createSocket,5=default]\nat com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.makeSocketSecure\n(RemoteTCPConnection.java:2001) at com.ibm.mq.jmqi.remote.impl.\nRemoteTCPConnection.connnectUsingLocalAddress(RemoteTCPConnection.java:855)\nat com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.protocolConnect\n(RemoteTCPConnection.java:1262) at \ncom.ibm.mq.jmqi.remote.impl.RemoteConnection.connect\n(RemoteConnection.java:714) at \ncom.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.\ngetSessionFromNewConnection(RemoteConnectionSpecification.java:356)\nat com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.\ngetSession(RemoteConnectionSpecification.java:265)\nat com.ibm.mq.jmqi.remote.impl.RemoteConnectionPool.\ngetSession(RemoteConnectionPool.java:144)\nat com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1709)\n... 9 more\nCaused by: java.lang.IllegalArgumentException: Cannot support\nSSL_RSA_WITH_AES_256_CBC_SHA with currently installed providers\nat com.ibm.jsse2.o.(o.java:29)\nat com.ibm.jsse2.as.setEnabledCipherSuites(as.java:5)\nat com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.makeSocketSecure\n(RemoteTCPConnection.java:1994)\n... 16 more\nProcess finished with exit code 0### Assistant: Above exception was cause of using wrong cipher suite on JMS clint side. I was using SSL_RSA_WITH_AES_256_CBC_SHA cipher suite on client side and was getting \"java.lang.IllegalArgumentException[Cannot support\nSSL_RSA_WITH_AES_256_CBC_SHA with currently installedproviders.\" Using correct cipher suite (TLS_RSA_WITH_AES_256_CBC_SHA) at JMS client side made handshake successful between JMS client and MQ series.\nRef:http://www-01.ibm.com/support/docview.wss?uid=swg1IV66840\n"} +{"text": "### Human: I am trying to connect to a remote IBM MQ server (v.8.0) and am receiving the error below. I'm using .Net 4.5.2 on Windows 10.\nI have modified the SimplePut.exe program that ships with the client install. I think I may be missing something to do with the client certificate I was issued and have installed following their instructions. Possibly the CertificateLabel setting? I am very new to IBM MQ so any help is much appreciated.-h -p 1434 -s TLS_RSA_WITH_AES_256_CBC_SHA256 -q INS -l connection -k *SYSTEMThe error shown at the queue manager when I run the program is as follows:Cause . . . . . :\nThere is a mismatch between the CipherSpecs on the local and remote ends of\nchannel ''. The channel will not run until this mismatch is resolved.\nThe local CipherSpec is 'TLS_RSA_WITH_AES_256_CBC_SHA256' and the remote\nCipherSpec is 'TLS_RSA_WITH_AES_128_CBC_SHA256'.\nRecovery . . . :\nChange the channel definition for '' so that both ends have matching\nCipherSpecs and restart the channel.### Assistant: MQ v8.0 Knowledge Center page \"Configuring SSL for managed IBM MQ .NET\" states the following:c. If needed, edit the Windows Group Policy to set the CipherSpec, then, for the Windows Group Policy updates to take effect, restart the computer.anda. Set the MQEnvironment or the SSLCipherSpec value to denote the connection as a secured connection. The value that you specify is used to identify the SSL protocol being used (SSL or TLS) andmust match with any preference that you have specified in the Windows Group Policy.MQ v8.0 Knowledge Center page \"CipherSpec support for the managed .NET client\" goes into some more detail:For the IBM MQ.NET managed client, the SSL settings are for the Microsoft.NET SSLStream class. For SSLStream, a CipherSpec, or a preference list of CipherSpecs,can be set only in the Windows group policy, which is a computer-wide setting. SSLStream then uses the specified CipherSpec or preference list during the handshake with the server. In case of other IBM MQ clients, the CipherSpec property can be set in the application on the IBM MQ channel definition and the same setting is used for SSL negotiation.As a result of this restriction, the SSL/TLS handshake might negotiate any supported CipherSpec regardless of what is specified in the IBM MQ channel configuration.Therefore, it is likely that this will result in errorAMQ9631on the queue manager. To avoid this error,set the same CipherSpec as the one that you have set in the application as the SSL configuration in the Windows group policy.Windows group policyWhen a CipherSpec is set on the Windows group policy, the same CipherSpec must be set for the SSLCipherSpec property value on the SVRCONN channel and in the application.If the Windows group policy is set to the default, that is the group policy is not enabled/edited for CipherSpec setting, applications must set the same default value of the CipherSpec from the Windows group policy SSL configurationin the MQEnvironment class or in the MQQueueManager constructor hashtable properties.UPDATE on specifying cert label with Managed .NETMQ v8.0 Knowledge Center page \"Using certificates for the managed .NET client\" goes into detail of the two options to allow MQ to find the cert:Matching certificates by certificate labelIf you set the certificate label, the IBM MQ managed .NET client searches the Windows certificate store with the given label name to identify the client certificate. It loads all matching certificates and uses the first certificate on the list. There are two options for setting the certificate label:The certificate label can set on the MQEnvironment class accessing MQEnvironment.CertificateLabel.The certificate label can also be set in a hash table properties, supplied as input parameter with MQQueueManager constructor as shown in the following example.Hashtable properties = new Hashtable();properties.Add(\"CertificateLabel\", \"mycert\");The name(\"CertificateLabel\") and the value are case sensitive.Matching certificates by stringIf certificate label is not set, then the certificate that matches the string \"ibmwebspheremq\" and the current logged on user (in lower case) is searched for and used.UPDATE with additional helpful blog post@renz found the IBM developerWorks MQdev Blog posted by Sudhanshu Pant \"MQ v8: SSL connection in Managed MQ .NET\" which also has good information with screen shots.\n"} +{"text": "### Human: I am new to IBM Websphere MQI am trying add messages to a Remote websphere MQ queue manager. I am getting following error while trying to connect to it.Also, I have tried many possible solutions provided in forums like changing .net framework to 3.5 also I am getting good ping while I ping the remote machine but I am unable to connect to it using C# code. The queue manager listener is up and running, but this is the error I am getting2538 - MQRC_HOST_NOT_AVAILABLEwhile trying to do this.queueManager = new MQQueueManager();I am using .net framework 4.5. Any help would be appreciated.### Assistant: MQRC_HOST_NOT_AVAILABLEcould mean that your client is unable to find the Queue Manager you have told it to look for. Given that you have said your code isqueueManager = new MQQueueManager();I suspect you haven't told your .NET some key bits of information it needs to know to be able to find the Queue Manager. In order to connect a MQ Client to a Queue Manager, it needs to know thechannel to connect intoHostname of the machine running the Queue ManagerPort that the Queue manager is running onFor .NET these can be supplied in different ways which are detailed in theknowledge center doc on the MQQueueManager class.From that page the example code to connect to a Queue Manager says:MQEnvironment.hostname = \"fred.mq.com\"; // host to connect toMQEnvironment.port = -1; // port to connect to. If not set, this defaults to 1414 for WebSphereMQ Client connections.MQEnvironment.channel = \"channel.name\"; // the CASE-SENSITIVE name of the SVRCONN channel on the queue managerMQQueueManager qMgr = new MQQueueManager(\"MYQM\");Also note that the call to create a MQQueueManager also takes a parameter which is the name of the Queue Manager connecting to.Check that you are providing all of the necessary information that a client needs to connect including the name of the Queue Manager. If it is still failing then the check the Queue Manager's logs for any error messages (if there are none the Client really isn't getting to the Queue Manager otherwise the error message will say why the Queue Manager isn't responding)\n"} +{"text": "### Human: I have this test code that listens for messages forever. If it gets one it prints it out. What I want to do is avoid having to construct a MQMessage object prior to each get(). How do i reuse a MQMessage for multiple calls to get()?using System;\nusing IBM.WMQ;\n\nnamespace WMQ {\n class Program {\n static void Main(string[] args) {\n string QueueManagerName = \"A1PATA00\";\n string channelName = \"ECACHE\";\n string connectionName = \"A1PATA00.WORLDSPAN.COM(1414)\";\n var queueManager = new MQQueueManager(QueueManagerName, channelName, connectionName);\n MQQueue get = queueManager.AccessQueue(\"SPLASH.ECAC.2\", MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQGMO_FAIL_IF_QUIESCING);\n var gmo = new MQGetMessageOptions();\n gmo.Options = MQC.MQGMO_FAIL_IF_QUIESCING | MQC.MQGMO_WAIT;\n gmo.WaitInterval = 10000000;// wait time\n // var queueMessage = new MQMessage(); <--- i want to do this new once!\n while (true) {\n var queueMessage = new MQMessage(); // <-- only works if I do this every time i do a get\n get.Get(queueMessage, gmo);\n var strReturn = queueMessage.ReadString(queueMessage.MessageLength);\n Console.WriteLine(strReturn);\n }\n }\n }\n}### Assistant: When I see questions like this, I shake my head. You do not\nunderstand object oriented concepts in the .NET VM (framework) and\ngarbage collection.Also, why don't you write pure C# code?Finally, in a world where security is very important, your code does\nnot support either SSL/TLS and/or UserID & Password authentication.(1) Please notice where I am defining the MQMessage object (very important).There is basically no difference in memory usage or speed between the following 2 code snippets:(A)MQMessage msg = null;\nwhile (true)\n{\n msg = new MQMessage();\n get.Get(msg, gmo);\n Console.WriteLine(msg.ReadString(msg.MessageLength));\n}(B)MQMessage msg = new MQMessage();\nwhile (true)\n{\n get.Get(msg, gmo);\n Console.WriteLine(msg.ReadString(msg.MessageLength));\n msg.ClearMessage();\n msg.MessageId = MQC.MQMI_NONE;\n msg.CorrelationId = MQC.MQCI_NONE;\n}I prefer (A) because it is cleaner and easier to read.(2) When you use 'var', you are forcing the .NET framework to guess at what you are doing. Do pure object oriented programming.\ni.e.MQMessage msg = new MQMessage();(3) Explicitly setting the channel name and connection name in the MQQueueManager does not allow setting of MQ security information. Also, do NOT use the MQEnvironment class as it is NOT thread safe. It is far better to put all the information in a Hashtable and pass the Hashtable to the MQQueueManager class. Here is a MQ .NET managed-mode example using a Hashtable for MQ connection information:using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Text;\nusing IBM.WMQ;\n\nnamespace MQTest02\n{\n class MQTest02\n {\n private Hashtable inParms = null;\n private Hashtable qMgrProp = null;\n private System.String qManager;\n private System.String outputQName;\n\n /*\n * The constructor\n */\n public MQTest02()\n : base()\n {\n }\n\n /// Make sure the required parameters are present.\n /// true/false\n /// \n private bool allParamsPresent()\n {\n bool b = inParms.ContainsKey(\"-h\") && inParms.ContainsKey(\"-p\") &&\n inParms.ContainsKey(\"-c\") && inParms.ContainsKey(\"-m\") &&\n inParms.ContainsKey(\"-q\");\n if (b)\n {\n try\n {\n System.Int32.Parse((System.String)inParms[\"-p\"]);\n }\n catch (System.FormatException e)\n {\n b = false;\n }\n }\n\n return b;\n }\n\n /// Extract the command-line parameters and initialize the MQ variables.\n /// \n /// \n /// IllegalArgumentException \n private void init(System.String[] args)\n {\n inParms = Hashtable.Synchronized(new Hashtable());\n if (args.Length > 0 && (args.Length % 2) == 0)\n {\n for (int i = 0; i < args.Length; i += 2)\n {\n inParms[args[i]] = args[i + 1];\n }\n }\n else\n {\n throw new System.ArgumentException();\n }\n\n if (allParamsPresent())\n {\n qManager = ((System.String)inParms[\"-m\"]);\n outputQName = ((System.String)inParms[\"-q\"]);\n\n qMgrProp = new Hashtable();\n qMgrProp.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\n\n qMgrProp.Add(MQC.HOST_NAME_PROPERTY, ((System.String)inParms[\"-h\"]));\n qMgrProp.Add(MQC.CHANNEL_PROPERTY, ((System.String)inParms[\"-c\"]));\n\n try\n {\n qMgrProp.Add(MQC.PORT_PROPERTY, System.Int32.Parse((System.String)inParms[\"-p\"]));\n }\n catch (System.FormatException e)\n {\n qMgrProp.Add(MQC.PORT_PROPERTY, 1414);\n }\n\n if (inParms.ContainsKey(\"-u\"))\n qMgrProp.Add(MQC.USER_ID_PROPERTY, ((System.String)inParms[\"-u\"]));\n\n if (inParms.ContainsKey(\"-x\"))\n qMgrProp.Add(MQC.PASSWORD_PROPERTY, ((System.String)inParms[\"-x\"]));\n\n if (inParms.ContainsKey(\"-s\"))\n qMgrProp.Add(MQC.SECURITY_EXIT_PROPERTY, ((System.String)inParms[\"-s\"]));\n\n System.Console.Out.WriteLine(\"MQTest02:\");\n Console.WriteLine(\" QMgrName ='{0}'\", qManager);\n Console.WriteLine(\" Output QName ='{0}'\", outputQName);\n\n System.Console.Out.WriteLine(\"QMgr Property values:\");\n foreach (DictionaryEntry de in qMgrProp)\n {\n Console.WriteLine(\" {0} = '{1}'\", de.Key, de.Value);\n }\n }\n else\n {\n throw new System.ArgumentException();\n }\n }\n\n /// Connect, open queue, read a message, close queue and disconnect.\n ///\n /// \n /// MQException \n private void testReceive()\n {\n MQQueueManager qMgr = null;\n MQQueue queue = null;\n int openOptions = MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING;\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n MQMessage receiveMsg = null;\n\n try\n {\n qMgr = new MQQueueManager(qManager, qMgrProp);\n System.Console.Out.WriteLine(\"MQTest02 successfully connected to \" + qManager);\n\n queue = qMgr.AccessQueue(outputQName, openOptions, null, null, null); // no alternate user id\n System.Console.Out.WriteLine(\"MQTest02 successfully opened \" + outputQName);\n\n receiveMsg = new MQMessage();\n\n queue.Get(receiveMsg, gmo);\n System.Console.Out.WriteLine(\"Message Data>>>\" + receiveMsg.ReadString(receiveMsg.MessageLength));\n }\n catch (MQException mqex)\n {\n System.Console.Out.WriteLine(\"MQTest02 cc=\" + mqex.CompletionCode + \" : rc=\" + mqex.ReasonCode);\n }\n catch (System.IO.IOException ioex)\n {\n System.Console.Out.WriteLine(\"MQTest02 ioex=\" + ioex);\n }\n finally\n {\n try\n {\n queue.Close();\n System.Console.Out.WriteLine(\"MQTest02 closed: \" + outputQName);\n }\n catch (MQException mqex)\n {\n System.Console.Out.WriteLine(\"MQTest02 cc=\" + mqex.CompletionCode + \" : rc=\" + mqex.ReasonCode);\n }\n try\n {\n qMgr.Disconnect();\n System.Console.Out.WriteLine(\"MQTest02 disconnected from \" + qManager);\n }\n catch (MQException mqex)\n {\n System.Console.Out.WriteLine(\"MQTest02 cc=\" + mqex.CompletionCode + \" : rc=\" + mqex.ReasonCode);\n }\n }\n }\n\n /// main line\n /// \n /// \n // [STAThread]\n public static void Main(System.String[] args)\n {\n MQTest02 mqt = new MQTest02();\n\n try\n {\n mqt.init(args);\n mqt.testReceive();\n }\n catch (System.ArgumentException e)\n {\n System.Console.Out.WriteLine(\"Usage: MQTest02 -h host -p port -c channel -m QueueManagerName -q QueueName [-u userID] [-x passwd] [-s securityExit]\");\n System.Environment.Exit(1);\n }\n catch (MQException e)\n {\n System.Console.Out.WriteLine(e);\n System.Environment.Exit(1);\n }\n\n System.Environment.Exit(0);\n }\n }\n}To run MQTest02 using your information, it would be:MQTest02.exe -h A1PATA00.WORLDSPAN.COM -p 1414 -m A1PATA00 -c ECACHE -q SPLASH.ECAC.2\n"} +{"text": "### Human: I have used the below command to remove all queues in cluster in the queue managerecho \"ALTER QLOCAL(*) CLUSTER('') CLUSNL('')\" | runmqsc ${qmgr}.I have got the error as1 : ALTER QLOCAL(*) CLUSTER('') CLUSNL('')\nAMQ8147: WebSphere MQ object * not found.\nOne MQSC command read.\nNo commands have a syntax error.\nOne valid MQSC command could not be processed.My need is to remove all queues which are in cluster in the queue manager. Thanks in advance### Assistant: You can't use the wildcard character (*) when altering MQ Objects. Instead you have to specify the exact object you want to alter and that object has to exist. This is the reason your command fails (as it is looking for an object called*which does not exist.If you want to change multiple objects you have to either use a third party tool which supports this or you have to do it programmatically. If you opt to do it programmatically your program has to do the followingQuery your Queue Manager for the objects you want to alter. This could be done usingecho \"DISPLAY QLOCAL(*) CLUSTER()\" | runmqsc -e The above command should only display Queues in the specified cluster and the -e option will mean you won't see1 : DISPLAY QLOCAL(*) CLUSTER()in the output. However, if the command returns any objects you will get output similar to and you will get a return code of 0:5724-H72 (C) Copyright IBM Corp. 1994, 2016.\nStarting MQSC for queue manager ROB.\n\n\nAMQ8409: Display Queue details.\n QUEUE(LOCAL) TYPE(QLOCAL)\n CLUSTER()\nAMQ8409: Display Queue details.\n QUEUE(QL) TYPE(QLOCAL)\n CLUSTER()If the command fails to find any Queues however you will see the following error and you will get a return code of 0:5724-H72 (C) Copyright IBM Corp. 1994, 2015.\nStarting MQSC for queue manager QMROB.\n\n\nAMQ8147: WebSphere MQ object * not found.\nOne MQSC command read.\nNo commands have a syntax error.\nOne valid MQSC command could not be processed.So before you can pipe the Queue names back intorunmqscyou have to get the raw Queue namesTrim the output to remove everything except for the Q name. This can be done in a number of ways but i would personally use grep and sed . First we only want the lines that haveQUEUEon them so we use grep to remove everything except for the round brackets (and it's contents) after QUEUE. Then we use sed to remove the round brackets. You end up with something like this:grep -o -P \"(?<=QUEUE)(.+?)\" | sed -e 's/[(|)]//gIf we add that onto our previous command we get:echo \"DISPLAY QLOCAL(*) CLUSTER()\" | runmqsc -e | grep -o -P \"(?<=QUEUE)\\(.+?\\)\" | sed -e 's/[(|)]//gwhich gives us the output:LOCAL\nQLFinally we want to push this back intorunmqscto alter all of the Queues as needed, we can do this using xargs. We want to push it through xargs twice as the first one will make sure each Queue name goes through as an individual command which is executed by the second one:xargs -n 1 | xargs -I {} echo \"ALTER QUEUE({}) CLUSTER('') CLUSNL('')\" | runmqsc Putting the whole thing together should get you something like:echo \"DISPLAY QLOCAL(*) CLUSTER()\" | runmqsc -e | grep -o -P \"(?<=QUEUE)\\(.+?\\)\" | sed -e 's/[(|)]//g | xargs -n 1 | xargs -I {} echo \"ALTER QUEUE({}) CLUSTER('') CLUSNL('')\" | runmqsc Of course the above is just an example of how you could do it in one line, however it would be much better to do it via a shell script where you can add checks in between each step to make sure you're not about to do something to your Queues you don't want to.While testing as well you could use the-vflag onrunmqscas this will verify the commands without performing the actions - So you can see the output and runmqsc will tell you if there are any problems, without doing it immediately.\n"} +{"text": "### Human: I have been trying to read and write messages to MQ from UFT. I am using the dotnet factory instance. i have reached till a point where i am able to connect to MQ while i am facing a problem in accessing the queue and read and write messages.The code is as follows.strQMgrName = \"queue manager name\"\nstrMQMDllPath = \"C:\\\\Program Files (x86)\\\\IBM\\WebSphere MQ\\\\bin\\\\amqmdnet.dll\"\nSet oMqEnvironment = DotNetFactory.CreateInstance(\"IBM.WMQ.MQEnvironment\",strMQMDllPath)\noMqEnvironment.Hostname = \"host name\"\noMqEnvironment.Port = \"port number\"\noMqEnvironment.Channel = \"channel name\"\n\n\nSet oMQC = DotNetFactory.CreateInstance(\"IBM.WMQ.MQC\",strMQMDllPath)\n' qmanager name,channel name, connection name\nSet oMqQMgr = DotNetFactory.CreateInstance(\"IBM.WMQ.MQQueueManager\",strMQMDllPath,strQMgrName)oMqQMgr.isConnected ' gives trueNow i wan to use the methodpublic MQQueue AccessQueue(string queueName, int openOptions)of the instance IBM.WMQ.MQQueueManager. can someone guide me in doing the same and let me know how i can push messages and read messages from the mentioned queueThank you### Assistant: After a lot of googling and reading IBM documentation , i was able to put and get messages in MQ from UFT. .. Below in the code snippet that worked for me .. Hope this helps some one .. I was working on PUT and GET separately, hence there might be some repetition in the code.Prerequisite for this.. You have to download MQ Client from IBM site and install it on PC where UFT is installed.. IBM MQ client is a freewareDim oMQEnvironment\n Dim oMQM\n Dim oMQC\n Dim oMQMessage\n Dim oMQQueue\n Dim intOpenOptions\n\n\n strMQMDLLPath = \"C:\\\\Program Files (x86)\\\\IBM\\WebSphere MQ\\\\bin\\\\amqmdnet.dll\"\n strHostName= \"Host Name\"\n intPort = \"Port Number\"\n strChannel =\"Channel Name\"\n strMessage =\"UFT Test Message\"\n strMQManager = \"Quemanager Name\"\n strMessageQueue = \"Queue Name\"' This part of the code is blatantly copied from one of the posts online. Will post the link once i find it again'for application(UFT) to connect to a queue manager in client modeSet oMQEnvironment = DotNetFactory.CreateInstance(\"IBM.WMQ.MQEnvironment\",strMQMDLLPath)\n\n 'Initize the Environment\n With oMQEnvironment\n .HostName = strHostName \n .Port = intPort\n .Channel = strChannel \n End with\n\n On Error Resume Next\n 'Create MQ Instatnces\n Set oMQM = DotnetFactory.CreateInstance(\"IBM.WMQ.MQQueueManager\",strMQMDLLPath)\n\n 'Check if MQM Connected\n If Err.Number <> 0 Then\n Reporter.ReportEvent micFail , \"Step: Creating MQM Object\" , \"Unable to Connect to MQ Manager at\" & strHostName\n 'Exit Test\n End If\n\n Set oMQC = DotnetFactory.CreateInstance(\"IBM.WMQ.MQC\",strMQMDLLPath)\n Set oMQMessage = DotnetFactory.CreateInstance(\"IBM.WMQ.MQMessage\",strMQMDLLPath)\n\n 'Declare Q open options\n intOpenOptions = oMQC.MQOO_OUTPUT or oMQC.MQOO_FAIL_IF_QUIESCING ' 16 + 8192\n\n 'Open the Q to post the messages\n If strRemoteMQManager = \"\" Then\n Set oMQQueue = oMQM.AccessQueue(strMessageQueue , intOpenOptions)\n Else \n Set oMQQueue = oMQM.AccessQueue(strMessageQueue , intOpenOptions ,strRemoteMQManager, \"\",\"\" )\n End If\n\n 'Format Message\n With oMQMessage\n .CharacterSet = 819\n .WriteString(strMessage)\n End with\n\n 'Post Message\n With oMQQueue\n .Put(oMQMessage)\n .Close()\n End WithNow for getting the message from MQDim oMQEnvironment\nDim oMQM\nDim oMQC\nDim oMQMessage\nDim oMQQueue\n\nstrMQMDLLPath = \"C:\\\\Program Files (x86)\\\\IBM\\WebSphere MQ\\\\bin\\\\amqmdnet.dll\"\nstrHostName= \"host name\"\nintPort = \"port number\"\nstrChannel =\"channel name\"\nstrMessage =\"UFT Test Message\"\nstrMessageQueue = \"message queue intended to access\"\nstrMQManager = \"mq manager name\"\nstrRemoteMQManager=\"\"\n\n'Create MQ Instances\nSet oMQC = DotnetFactory.CreateInstance(\"IBM.WMQ.MQC\",strMQMDLLPath)\n\n'set the properties of the Queue manager\nSet properties = DotNetFactory.CreateInstance(\"System.Collections.Hashtable\")\n properties.Add oMQC.HOST_NAME_PROPERTY, strHostName\n properties.Add oMQC.PORT_PROPERTY, intPort\n properties.Add oMQC.CHANNEL_PROPERTY, strChannel\n\n'access the queue manager \nSet oMQM = DotnetFactory.CreateInstance(\"IBM.WMQ.MQQueueManager\",strMQMDLLPath,strMQManager,properties)\n\n'here We are trying to browse the message one by one and keep the messages on the queue.\n\n'Declare Q open options\nSet oMQQueue = oMQM.AccessQueue(strMessageQueue,oMQC.MQOO_BROWSE)\nSet oMQGetMessageOptions = DotNetFactory.CreateInstance(\"IBM.WMQ.MQGetMessageOptions\",strMQMDLLPath) \noMQGetMessageOptions.Options = oMQC.MQGMO_BROWSE_FIRST\n\nSet oMQMessage = DotnetFactory.CreateInstance(\"IBM.WMQ.MQMessage\",strMQMDLLPath)\n\n oMQQueue.Get oMQMessage,oMQGetMessageOptions\n\nSet mqGetNextMsgOpts = DotNetFactory.CreateInstance(\"IBM.WMQ.MQGetMessageOptions\",strMQMDLLPath) \nmqGetNextMsgOpts.Options = oMQC.MQGMO_BROWSE_NEXT\n\nbrowseMessages = true\n\nDo while browseMessages\n on error resume next\n messageText = oMQMessage.ReadString(oMQMessage.MessageLength)\n 'Print messageText\n Set oMQMessage = DotnetFactory.CreateInstance(\"IBM.WMQ.MQMessage\",strMQMDLLPath)\n oMQQueue.Get oMQMessage,mqGetNextMsgOpts\n if Err.Number <> 0 then browseMessages =false \n 'Clear both MsgID and CorrelID for next use.\n oMQMessage.MessageId = oMQC.MQMI_NONE\n oMQMessage.CorrelationId = oMQC.MQCI_NONE \nLoop \n\n'Cleanup\nSet oMQQueue = Nothing \nSet oMQMessage= Nothing \nSet oMQOpenOptions= Nothing \nSet oMQM= Nothing \nSet oMQEnvironment = Nothing\n"} +{"text": "### Human: I am using Websphere mq v 7.5. When I try to send message to Queue, I get following error :JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED')\n Provided Username and password are wrong.I don't have any credentials to provide as it doesn't ask at time of installation. My camel-context configuration is given below:\n \n \n\n \n \n \n \n \n \n ### Assistant: The 2035 error you received will have more information to explain it in the queue manager error log. The fact that the JMS error message mentions a user ID and password is misleading, it could be one of a number of security failures, not necessarily that one, I suspect you are being caught by a default security rule (CHLAUTH rule) that bans the use of SYSTEM channels.Look in your queue managerAMQERR01.LOGand then read the following post for more help on how to deal with a failure caused by a CHLAUTH rule.I'm being blocked by CHLAUTH - how can I work out why?\n"} +{"text": "### Human: I am working on below configuration for messaging using Spring and Webphere MQ.I have a requirement of implementing retrying logic for a scenario, where I receive a message from the queue and put the message data on to a Elastic search server (search server is non transactional), if the search server is down I have to rollback the message on to the queue again and process the message after some interval of time(for example: 30 seconds) . this retry has to be done for 5 times. after 5 times the message has to be put on a Dead letter queue .we are using Tomcat as the server.we are using spring integration jms:message-driven-channel-adapter for message receivingHow can I implement this behavior with spring and Websphere MQ?I have crawled across many sites, and I could find support for Active MQ but not for IBM MQ.\n \n ${queue_hostname}\n \n \n ${queue_port}\n \n \n ${queue_manager}\n \n \n 1\n \n \n\n \n \n \n \n \n \n false\n \n \n\n \n \n \n\n \n \n \n \n \n \n \n \n \n false\n \n \n 20000\n \n ### Assistant: There is nothing in the JMS spec about delayed redeliveries. Some brokers have a custom mechanism/policy to implement it; you'll have to look at the broker documentation.As has been said before, you can use the delivery count header to give up after some number of retries.EDITIn response to your comment below...Only if you are using a version of MQ that supports JMS 2.0 - it looks like you are using a very old version requiringJmsTemplate102. 1.0.2 is ancient; 1.1 has been out for years; Spring has supported JMS 2.0 for a nearly 3 years. If you have a JMS 2.0 broker (and client library), set thedeliveryDelay on a JmsTemplate bean. Then, configure the outbound channel adapter to use that template via thejms-templateproperty.In order to get visibility to the redelivery count, either pass the whole message into your service or, with a POJO method, configure it to get that header...public MyReply process(@Payload MyObject foo,\n @Header(\"JMSXRedeliveryCount\") int redeliveryCOunt) {\n ...\n}Again, this is a JMS 2.0 feature (the header) although some brokers provide it in 1.1.\n"} +{"text": "### Human: We have a scenario where we want a node.js app to consume messages from a backend system that currently puts messages to an Websphere MQ queue (through SAP PI).In MQ 8.0.0.3, there is a beta of AMQP support.https://www.ibm.com/developerworks/community/blogs/messaging/entry/mq_support_for_mq_light_beta_now_available?lang=enHowever, I can't find a conclusive answer to how I get assured delivery. The perfect solution would be for the node.js app to register its subscription as durable, but how do I do that? We'll change the queue that SAP PI uses to an alias queue pointing to a topic. Using the mqlight client in node.js, version 1.0### Assistant: You can achieve assured delivery between MQ applications and Node.js applications using the MQ Light library. MQ Light supports at-least-once messaging (not exactly-once) so you will have to bear this in mind when you design your solution. It will have to handle receiving duplicate messages.It sounds like you might have read thearticle on how to bridge MQ to MQ Lightwhich explains some of the MQ queue-to-topic options.In order to cope with the Node.js application being offline when messages are put by the SAP application, you can create a durable destination when you issue the MQ Light subscribe call. For example:// Destination and its messages expire 24 hours after Node.js client disconnects\nvar options = { qos: mqlight.QOS_AT_LEAST_ONCE, autoConfirm: false, ttl: (60 * 60 * 24 * 1000)};\n\nclient.subscribe(pattern, share, options, function(err, pattern) {\n if (err) {\n console.error('Problem with subscribe request: %s', err.message);\n process.exit(1);\n }\n\n if (pattern) {\n if (share) {\n console.log('Subscribed to share: %s, pattern: %s', share, pattern);\n } else {\n console.log('Subscribed to pattern: %s', pattern);\n }\n }\n});You'll need to make sure that the messages your SAP application puts do not have an expiry time (i.e. they setMQEI_UNLIMITED). Otherwise they could expire from the destination before the Node.js app has had a chance to consume it.Secondly note how I've usedautoConfirm: falsein the above example. That means that if the Node.js application gets a message from its destination, the message will not be deleted from the destination until you explicitly callmessage.confirmDelivery()in your MQ Light app. That allows you to make sure the message has been processed completely in the Node.js app (you've written it to a file, or to a database, or done whatever you need to do with it) before removing it from MQ.As you say, the MQ Light feature in MQ is still in beta and is not currently supported by IBM. However there is a statement of direction to say that it will be a supported feature in the future.\n"} +{"text": "### Human: MQ FTE docs thatAn example use of this exit point is to perform some completion tasks,\n such as sending an e-mail or a WebSphere MQ message to flag that the\n transfer has completed.However how this message sending can be done? My understanding is that FTE will simpy put my exit jar into their classpath and then just call appropriate method when transfer finished.How can I aquire connection to the QM then? Do I need to do some magic, and on first call create connection to the MQ?We have very simple use case. We want FTE to put notification message into queue when transfer finished. We are initiating transfer by putting XML command queue, so we can usereplyqueue element. However doc states that it uses dynamic temporary queue, but it is not what we need. So we need this exit logic then...Or maybe do you have other idea how to achieve mentioned use case?Many thanksPawel### Assistant: How can I acquire connection to the QM then?TheMQCONNXcall tends to work best if using the Java API. AConnectionFactoryif using JMS classes.Do I need to do some magic...Although the MQ functionality appears to be magic, it is actually just highly advanced technology....and on first call create connection to the MQ?Define \"first.\" First call from FTE? No. The exit loses the connection context between calls. First call to MQ from within the exit? Sure.When the exit receives control from FTE, just connect to MQ, open the desired queue, andPUTthe notification message. The exit has access to the FTE job fields, including the name/value pairs from the job definition. You will need to pass it the destination queue name in the job definition if that value is variable from call to call.\n"} +{"text": "### Human: I am trying to put a message into Websphere MQ queue from an Orchestration which is deployed on Cast Iron Live. I have used secure connector since the orchestation is deployed on Cast Iron. When I am trying to execute the flow, it fails and the message is not placed in MQ queue. The below are the errors:Error while trying to call remote operation execute on Secure Connector for activity\ncom.approuter.module.mq.activity.MqPut and Secure Connector LocalSecureConnector, \nerror is Unable to put message on queue null. MQ returned error code 2538.\n\nUnable to put message on queue null. MQ returned error code 2538.\nFault Name : Mq.Put.OperationActivityId : 163\nMessage: Unable to put message on queue null. MQ returned error code 2538.\nActivity Name:Put MessageFault Time: 2015-07-15T05:40:29.711ZCan someone please help me resolve this. Please let me know if any further details are required.Here are the details:Cast Iron flow is deployed on Cast Iron Cloud i.e Cast Iron LiveMQ is running on-premiseThe port I am trying to connect is 1414.Have a secure connector running on the machine where MQ is installed.MQ version is 8.In Cast Iron flow, I am using an MQ connector, by giving the hostname where MQ is running, port: 1414, Channel Name : SYSTEM.DEF.SVRCONN and username as mqm. Tired using my log on username, by adding it to mqm group. But this also dosent seem to work.### Assistant: The return code is instructive:2538 0x000009ea MQRC_HOST_NOT_AVAILABLEThis indicates that Cast Iron is attempting to contact MQ using a client connection and not finding a listener at the host/port that it is using.There are a couple of possibilities here but not enough info to say which it might be. I'll explain and provide some diagnostics you can try.The 2538 indicates an attempt to contact the QMgr has failed. This might be that, for example, the QMgr isn't listening on the configured port (1414) or that the MQ listener is not running.The error code says the queue name is \"null\". The question doesn't specify which queue name the connector is configured with but presumably it's been configured withsomequeue name. This error code suggests the Secure Connector on the MQ server side doesn't have its configuration installed.The Cast Iron docs advise connecting with an ID in themqmgroup but do not mention that on any MQ version 7.1 or higher this is guaranteed to fail unless special provisions are made to allow the admin connection. It may be that it's actually failing for an authorization error and the connector not reporting the correct error.If it is as simple as the listener not running, that's easy enough to fix. Just start it and make sure it's on 1414 as expected.Next, ensure that the Secure Connector has the configuration that was created using the Cast Iron admin panel. You need to understand why the error code says the queue name is null.Now enable Authorization Events and Channel Events in the QMgr and try to connect again. The connector on the MQ server should connect when started and if successful you can see this by looking at the MQ channel status. However, if unsuccessful, you can tell by looking at the event messages or the MQ error logs. Both of these will show authorization failures and connection attempts, if the connection has made it that far.The reason I'm expecting 2035 Authorization Error failures is that any QMgr from v7.1 and up will by default allow an administrative connection on any channel. This is configured in the default set ofCHLAUTHrules. The intent is that the MQ admin would have to explicitly provision admin access by adding one or more newCHLAUTHrules.For reasons of securitySYSTEM.DEF.*andSYSTEM.AUTO.*channels shouldneverbe used for legitimate connections. The Best Practice is to define a newSVRCONN, for example one namedCAST.IRON.SVRCONNand then define a CHLAUTH rule to allow the administrative connection.For example:DEFINE CHL(CAST.IRON.SVRCONN) CHLTYPE(SVRCONN) TRPTYPE(TCP) REPLACE\nSET CHLAUTH('CAST.IRON.SVRCONN') TYPE(ADDRESSMAP) +\n ADDRESS('127.0.0.1') +\n USERSRC(MAP) MCAUSER('mqm') +\n ACTION(REPLACE) \nSET CHLAUTH('CAST.IRON.SVRCONN') TYPE(BLOCKUSER) +\n USERLIST('*NOBODY') +\n WARN(NO) ACTION(REPLACE)The first statement defines the new channel.The next one allows the connections from127.0.0.1which is where the Secure Connector lives.(Presumably you installed the internal Secure Connection on the same server as MQ, yes?)Ideally the connector would use TLS on the channel and instead of IP filtering theCHLAUTHrule would filter based on the certificate Distinguished Name. This rule is not nearly so slective and allows anyone on the local host to be an MQ administrator by using this channel.The last statement overrides the defaultCHLAUTHrule which blocks*MQADMINwith a new rule that blocks*NOBODYbut just for that channel.\n"} +{"text": "### Human: I'm trying to figure out under what conditions I would want to implement a remote queue versus a local one for 2 endpoint applications.Consider this scenario: AppAon ServerAneeds to send messages to AppBon ServerBvia MQServer1.It seems like the simplest configuration would be to create a single local queue on MQServer1 and configure AppA to put messages to the local queue while configuring AppB to get messages from the same local queue. Both AppA and AppB would connect to the same Queue Manager but execute different commands.What sort of circumstances would require the need to install another MQ server (e.g. MQServer2) and configure a remote queue on MQServer1 which instead sends the messages from AppA over a channel to a local queue on MQServer2 to be consumed by AppB?I believe I understand the benefit of remote queuing but I'm not sure when it's best used over a more simpler design.### Assistant: Here are some problems with what you call the simpler design that you don't have with remote queuing:-Time Independance- Server1 has to be available all the time, whereas with a remote queue, once the messages have been moved to Server B, Server A and Server 1 don't need to be online when App B wants to get its messages.Network Efficiency- with two client applications putting or getting from a central queue, you have two inefficient network hops, instead of one efficient channel batched network connection from Server A to Server B (no need for Server 1 in the middle)Network Problems- No network, no messages. Whereas when they are stored locally, any that have already arrived can be processed even while the network is down. Likewise, the application putting messages is also not held up by a network problem, the messages sit on the transmit queue easy to be moved, and the application can get on with the next thing.Of course your applications should be written so that they aren't even aware of the difference, and it's just configuration changes that switch you from one design to the other.\n"} +{"text": "### Human: I've created a Queue manager calledQM_MQ_TESTcrtmqm QM_MQ_TEST\nstrmqm QM_MQ_TEST\nrunmqsc QM_MQ_TEST\n\nDEFINE CHANNEL(QM_MQ_TEST) CHLTYPE(SVRCONN)\n\ndefine listener(TCP.LISTENER) trptype(tcp) control(qmgr) port(1414)\n\nALTER AUTHINFO(SYSTEM.DEFAULT.AUTHINFO.IDPWOS) AUTHTYPE(IDPWOS) CHCKCLNT(NONE)\n\nSET CHLAUTH(QM_MQ_TEST_SVRCONN) TYPE(ADDRESSMAP) ADDRESS(*) USERSRC(CHANNEL)\nSET CHLAUTH(QM_MQ_TEST_SVRCONN) TYPE(BLOCKUSER) USERLIST('nobody')Still I could see below error in QM logs.06/11/2015 12:19:26 PM - Process(10886.618) User(mqm) Program(amqzlaa0)\n Host(abcd.com) Installation(Installation1)\n VRMF(8.0.0.2) QMgr(QM_MQ_TEST)\n\nAMQ8077: Entity 'oracle' has insufficient authority to access object\n'QM_MQ_TEST'.\n\nEXPLANATION:\nThe specified entity is not authorized to access the required object. The\nfollowing requested permissions are unauthorized: connect\nACTION:\nEnsure that the correct level of authority has been set for this entity against\nthe required object, or ensure that the entity is a member of a privileged\ngroup.\n----- amqzfubx.c : 670 --------------------------------------------------------\n06/11/2015 12:19:26 PM - Process(11046.643) User(mqm) Program(amqrmppa)\n Host(abcd.com) Installation(Installation1)\n VRMF(8.0.0.2) QMgr(QM_MQ_TEST)\n\nAMQ9557: Queue Manager User ID initialization failed for 'oracle'.\n\nEXPLANATION:\nThe call to initialize the User ID 'oracle' failed with CompCode 2 and Reason\n2035.\nACTION:\nCorrect the error and try again.### Assistant: There are two problems evident.DEFINE CHANNEL(QM_MQ_TEST) CHLTYPE(SVRCONN)\nSET CHLAUTH(QM_MQ_TEST_SVRCONN) TYPE(ADDRESSMAP) ADDRESS(*) USERSRC(CHANNEL)\nSET CHLAUTH(QM_MQ_TEST_SVRCONN) TYPE(BLOCKUSER) USERLIST('nobody')\n ^^^^^^^^Notice how the name of the defined channel doesn't match the profile names in the CHLAUTH rules? These rules cannot possibly apply to the channel that was defined.The second problem is that the user IDoraclehas no authority to connect to the QMgr. Generally you want to grant+connect +inqon the QMgr itself, then grant+put +get +browse +inqon the queues. If you want to be more precise, grant+put +inqon one queue and+get +browse +inqon the other.Note that you always have to grant+inqfor Java or JMS applications because IBM's classes make inquiries on the objects to which they connect or open. For example, on connecting to MQ they inquire as to the version and if a DLQ is specified. On connecting to a queue they look for things likeMAXMSGLandBOQNAME.So you may or may not need+inqdepending on what the application is written in and how it is coded. You may also need other permissions such as+passid. The best way to work through the required permissions is to installSupportPac MS0Pinto MQ Explorer, then enable Authorization Events. If another authorization error occurs, the event message will tell you the object against which the call failed, the ID requesting access, the API call being made at the time, and the exact options specified for the call. All of this will be in human-readable language and accessible through MQ Explorer so you don't have to go hunt down error log entries each time.Finally, since IBM's docs and much of the casual advice you get on the Internet gets it wrong, make sure you understand what happens when you authorize a Principal versus a Group.On all versions of MQ prior to v8.0, and by default in v8.0, when you run asetmqautorSET AUTHRECagainst a principal, MQ goes out and looks up the primary group for that ID and substitutes that in the permission grant. When the ID's primary group is not what was expected, this can lead to unexpected authorization of large populations of accounts. As a rule, grant authorizations on groups instead of principals.There are two narrow exceptions to this. The first is that in MQ v8.0 it is possible to configure MQ to authorize directly against principals. The problem with this is that a script full of authorization grants on principals will succeed without warnings regardless of whether that configuration setting has been made. The only way to know it worked is to dump the resulting authorization records and reconcile against the original script. If you are not prepared to do this, avoid granting auths by principal on non-Windows platforms.Windows has always been an exception because MQ records the authorization grant against a Windows Security ID or \"SID\" and the SID for an account is functionally equivalent to one for a group. The problem comes in if the ID used in the authorization grant is unqualified.For example, on a Windows QMgr if I were to execute this command...SET AUTHREC OBJTYPE(QMGR) PRINCIPAL('oracle') AUTHADD(CONNECT)...then Windows would attempt to resolve the accountoraclefirst against the local SAM database, then against the domain controllers it knows about in whatever search order they happen to be in at the moment.So assume the ID is defined on the last of 5 domain controllers that Windows searches and that someone creates a new account calledoracleon one of the DCs earlier in the search chain. TheMCAUSER(oracle)in the channel will resolve to a different account with a different SID. The connection will fail with an error thatEntity 'oracle' has insufficient authority to access object 'QM_MQ_TEST'despite your being able to display auiths records in which \"oracle\" is clearly granted access.So if you ever do decide to grant access on the Principal instead of the Group, make sure that the v8.0 QMgr is set to honor that, or on Windows that you specifyoracle@[host name here]for a local account ororacle@[domain name here]for a domain account both in the authorization command and in theMCAUSER.\n"} +{"text": "### Human: I'm new in IBM MQ. Using the following code I can easily put a message in a queue and get that message.public void QueuePut()\n{\n queue = queueManager.AccessQueue(\"Q1\", MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING);\n MQMessage message = new MQMessage();\n message.WriteString(\"stackoverflow\");\n\n MQPutMessageOptions putMessageOptions = new MQPutMessageOptions(); \n putMessageOptions.Options += MQC.MQPMO_ASYNC_RESPONSE;\n\n queue.Put(message, putMessageOptions);\n}\n\n\npublic void QueueGet()\n{\n\n queue = queueManager.AccessQueue(\"Q2\", MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING);\n MQMessage gotMessage = new MQMessage();\n\n queue.Get(gotMessage);\n\n string str = message.ReadString(gotMessage.MessageLength);\n}You can easily see I'm writing a message to 'Q1' and reading it from 'Q2' since Q1 isalias queueNow, the thing I want is to get information about the message that I got in the QueueGet function. What I want to know is that gotMessage comes from 'Q1' even If I'm reading it in 'Q2'.### Assistant: TheBaseQueueNamewill point to the real queue an alias queue refers to. In this case the queue being opened to get queues is the real queue itself. HenceBaseQueueNamewill not point to anything.It's not right to useMQC.MQCA_BASE_Q_NAMEwhile opening a queue as it's not a queue open option. All queue open options begin withMQOO_.You can use PCF classes to query an alias queue and find it's base queue name. But at the moment I am unaware if there is a way to find the alias(es) of a base queue.Edit:Alias queueis not really a queue like theLocal queue. As the name suggests, it's another name for a local queue. It will not hold any messages. When an application opens an Alias queue, the queue manager resolves it to actual queue.Aliasing helps1) To hide queue/topic it is pointing to. This way applications are unaffected by any change to queue/topic.2) Provide different level of authority to applications. One application can put but not get while another application can get but not put to the same queue.\n"} +{"text": "### Human: I have a JMSReceiver class which is listening on a MQ Queue. This class implements the MessageListener interface. I wish to implement the logic to retry a message for specified number of times by getting the message to rollback. To do so I have to catch the business exception and wrap it in a RuntimeException so that message gets rolled back to the MQ and gets replayed. i wish to implement this in better way.Current Implementationclass JMSReceiver implements MessageListener{\npublic void onMessage(Message msg){\n logger.info(\"**********Message received in consumer\");\n try {\n //Do some business which throws a business exception\n } catch (Exception e) {\n try {\n logger.info(\"####Redelivery count\"+msg.getIntProperty(\"JMSXDeliveryCount\"));\n if(msg.getIntProperty(\"JMSXDeliveryCount\")<10){\n logger.info(\"####MQ ISSUE: Redelivery attempted for message. Redelivery attempt: \"+msg.getIntProperty(\"JMSXDeliveryCount\"));\n throw new RuntimeException(\"Redelivery Attempted\"+e.getMessage()); \n }else{\n logger.info(\"####MQ ISSUE: Redelivery attempts exhausted for message\");\n }\n } catch (JMSException e1) { \n e1.printStackTrace();\n logger.info(\"####MQ ISSUE: Exception occured while getting JMSXDeliveryCount\");\n }\n }\n }ExpectedThe above implementation works. It rollsback the message to MQ and the redelivery count increases. I even tried doing session.rollback() but when I do that the redelivery count does not increase and I can replay the message. Please advise a better way to implement this ?### Assistant: You can create JMS session with CLIENT_ACKNOWLEDGE as message acknowledge mode. And then in the onMessage() method, do not call msg.Acknowledge(). Not calling msg.Acknowledge() will ensure the same is delivered again.session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);Note that calling Acknowledge() on one message will acknowledge all messages received since the last time the method was called.UpdateSession creationconnection = cf.createConnection(\"user\",\"password\");\n System.out.println(\"Connection created.\");\n session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);\n System.out.println(\"Session created.\");OnMessage() method - Message is being acknowledged on 6th attempt.consumer.setMessageListener(new MessageListener() {\n public void onMessage(Message msg) {\n try {\n // Display the message that just arrived\n System.out.println(msg);\n\n if(msg.getIntProperty(\"JMSXDeliveryCount\") > 5){\n msg.acknowledge();\n }\n } // end try\n catch (Exception e) {\n System.out.println(\"Exception caught in onMessage():\\n\" + e);\n }\n return;\n } // end onMessage()\n }); // end setMessageListener\n"} +{"text": "### Human: I have followed all the steps very closely to create key store, client certificate, servercertificate using with the help of below videos :**\"Configuring WMQ Explorer for TLS (Part1, Part2, Part3, Part4) as below\".**\nPart 1: WMQ Explorer TLS 1 of 4: Create the QMgr's KDB and certificate**\nPart 2: WMQ Explorer TLS 2 of 4: Create the user's JKS and certificate\nPart 3: WMQ Explorer TLS 3 of 4: Configure WMQ Explorer preferences\nPart 4: WMQ Explorer TLS 4 of 4: ConnectingNow, I am trying to connect from IBM Websphere MQ Client (V7.5.0.3) to the IBM WebSphere MQServer (V7.5.0.2)server queue manager using SSL.From the IBM WebSphere MQ Explorer (Client Side) : \n\na) Provided the Queue Manager Name : jmsdemo\nb) Selected the radio-button \"Connect directly\"\nc) Hostname or IP Address : Server IP\nd) Port number : Server Port of the Queue Manager that i am trying to connect.\ne) Server-connection channel : Server Connection Channel \n (This server connection channel has below parameters\n MCA --> MUSR_MQADMIN\n SSL --> SSL Cipher Spec : \"TLS_RSA_WITH_AES_128_CBC_SHA256\"\n SSL Authentication : Required\n\nf) After finishing all the steps, when i press the \"Finish\" Button. I am getting the below \nerrors.\n\nPlease let me know if i missing/doing something wrong in-order to connect to SSL?References :a) Below error in the UI (IBM WebSphere MQ Explorer client side) :Queue manager jmsdemo is not available for client connection due to an SSL configuration error.(AMQ4199) Queue manager jmsdemo is not available for client connection due to an SSLconfiguration error. (AMQ4199) Severity: 30 (Severe Error)\n Explanation: The user is trying to connect to a remote queue manager using a secure connection.\n Response: Check the SSL configuration of the target queue manager and the local SSL trust store.b) Below error information is extracted \"AMQERR01\" error file (from Server Side)https://docs.google.com/document/d/19b-N4qc0zXw4HiwZv5pmmeixqeClDDHgWpylalkHhqY/edit#Thanks \nJK### Assistant: This errorAMQ9660: SSL key repository: password stash file absent or unusableis likely to be caused by corrupt stash file. A stash file contains the password for the key repository. I suggest you try the following steps:1) Go to folder where the queue manager's key repository (the .kdb file) is located.2) Locate the stash (.sth) file of the key repository and delete it.3) Then open the .kdb file in \"IBM Key Management Tool\" with the current password.4) Once kdb file is opened, click on \"Key Database File -> Stash Password\" menu. This will create the stash file again.5) (May be required): Then do aREFRESH SECURITY TYPE(SSL)for the queue manager inrunmqsc.Then attempt to connect.\n"} +{"text": "### Human: I am trying to connect to a MQ server queue via a .NET client. I need to use the certificate for secured communication. Here is the code that I have:MQEnvironment.SSLKeyRepository = \"*SYSTEM\";\nMQEnvironment.ConnectionName = connectionName;\nMQEnvironment.Channel = channelName;\nMQEnvironment.properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\nMQEnvironment.SSLCipherSpec = \"TLS_RSA_WITH_AES_256_CBC_SHA\"; \n\nqueueManager = new MQQueueManager(queueManagerName, channelName, connectionName);\n\nqueue = queueManager.AccessQueue(SendQueueName,MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING);\nqueueMessage = new MQMessage();\nqueueMessage.WriteString(message);\nqueueMessage.Format = MQC.MQFMT_STRING;\nqueue.Put(queueMessage, new MQPutMessageOptions());Every time I try to put the message on the queue, I get this error messageReason Code: 2059\nMQexp.Message: MQRC_Q_MGR_NOT_AVAILABLEI have checked my variables for the queue manager name, queue name etc and they are correct. \nI was also able to connect to a different queue without SSL, I believe that my code is not furnishing enough information to establish a successful connection.Any help on this would be appreciated.Thanks,\nKunal### Assistant: I had the same problem and error message. After enabling tracing I was able to isolate the problem. \nI always wondered, how the client is selecting the correct client certificate from the store. The trace output revealed following:000001B2 15:53:46.828145 20776.10 Created an instance of SSLStreams\n000001B3 15:53:46.828145 20776.10 Setting current certificate store as 'Computer'\n000001B4 15:53:46.828145 20776.10 Created store object to access certificates\n000001B5 15:53:46.834145 20776.10 Opened store\n000001B6 15:53:46.834145 20776.10 Accessing certificate - ibmwebspheremqmyusername\n000001B7 15:53:46.835145 20776.10 TLS12 supported - True\n000001B8 15:53:46.837145 20776.10 Setting SslProtol as Tls\n000001B9 15:53:46.837145 20776.10 Starting SSL AuthenticationIn my case, I had to set thefriendly name of the client certificateto ibmwebspheremqmyusername(replace \"myusername\" with your userid) and set the label in the code aswell:properties.Add(MQC.MQCA_CERT_LABEL, \"ibmwebspheremqmyusername\");To enable tracing, add following to your app.config/web.config where the path points to a location that contains a file namedmqtrace.config:\n \nSample content of mqtrace.config (specified directories must exist in advance):\n\n 2\n C:\\MQTRACEPATH\n C:\\MQERRORLOGPATH\nHere are some links for more detail:Tracing:https://www.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.dev.doc/q123550_.htmWhy label:http://www-01.ibm.com/support/docview.wss?uid=swg21245474\n"} +{"text": "### Human: We need to issue some MQ commands from a MB flow.\nThe way to go is to send a PCF command, but I dont know how to create it.\nAny pointers ?\nSebastian.### Assistant: To issue commands to an MQ Queue Manager via PCF messages you can look at the examples in /opt/mqm/samp/pcf/samples on *nix or where ever you have installed MQ. (On Windows try \"C:\\Program Files (x86)\\IBM\\WebSphere MQ\\tools\\pcf\\samples\").To issue the commands 'from' broker you can use a Java compute node and use methods in the supplied Java package com.ibm.mq, for example sending a query to find out what queues are defined on a queue manager:import com.ibm.mq.headers.pcf.PCFMessageAgent;\nimport com.ibm.mq.headers.pcf.PCFMessage;\nimport com.ibm.mq.constants.MQConstants;\n\ntry\n{\n // local queue manager\n String queueManager = \"QMGR_broker\"; // local queue manager name \n PCFMessageAgent agent = new PCFMessageAgent(queueManager);\n\n // remote queue manager\n String host = \"localhost\"; // host name of the queue manager machine\n int port = 1414; // default queue manager tcp listener port\n String channel = \"SYSTEM.DEF.SVRCONN\";//Default channel\n PCFMessageAgent agent = new PCFMessageAgent(host, port, channel);\n\n // Create the PCF message type for the inquire.\n PCFMessage pcfCmd = new PCFMessage(MQConstants.MQCMD_INQUIRE_Q_NAMES);\n // Queue name = wildcard.\n pcfCmd.addParameter(MQConstants.MQCA_Q_NAME, \"*\");\n // Queue type = ALL.\n pcfCmd.addParameter(MQConstants.MQIA_Q_TYPE, MQConstants.MQQT_ALL);\n\n // Execute the command. The returned object is an array of PCF messages.\n PCFMessage[] pcfResponse = pcfCM.agent.send(pcfCmd);\n\n // e.g. extract the queue names from the response object\n String[] names = (String[])pcfResponse[0].getParameterValue(MQConstants.MQCACF_Q_NAMES);\n}Alternatively you can put the PCF messages on the MQ queue (SYSTEM.ADMIN.COMMAND.QUEUE if you're on anything but z/OS) that the queue manager is listening for events on. You will then also need to define a 'reply to' queue in your message. You can do this from broker with an MQOutput node.However that means you need to know theexact format of the PCF messagethat you want to send and what it's reply will look like, I think it is much easier to use the provided Java examples to do the message processing and formatting for you.\n"} +{"text": "### Human: I have installed a trial version of MQ and now im trying to create a queue manager.\nRunning the command crtmqm givescrtmqm -q QManager\nbash: crtmqm: command not found### Assistant: It's most likely the case that your path isn't set up correctly.Find out where thecrtmqmis located (such as withfind / -name crtmqm) and add that directory to your path (in your favorite startup file, like.profileor.bash_profile).Youmayalso then need to open up a new session (or even log in again), depending on which startup file was changed.\n"} +{"text": "### Human: How would I set up MQ so that every message received is immediately written to file system? \nI have the \"redbooks\", but at least need someone at least point me to a chapter or heading in the book to figure it out.We are a .NET shop. I have written C# via API to read the queue, and we currently use BizTalk MQ adapter. Our ultimate goal is to write same message to multiple directories in file system to \"clone\" the feed for our various test environments (DEV, STAGE, TRAINING, etc..). The problem with BizTalk is that when we consume the message, we map it at the same time to a new message, so the message is already changed, and we want the original raw message to be cloned, not the morphed one. Our vendors don't offer multiple copies of the feed, for example, they offer DEV and PROD, but we have 4 systems internally.I suppose I could do a C# Windows Service to do it, but I would rather use built-in features of MQ if possible.### Assistant: There is no configuration required. If the message is persistent, WMQ writes it to disk. However, I don't think that's going to help you because they are not written as discrete messages. There's no disk file to copy and replication only works if the replicated QMgr is identical to the primary and is offline during the replication.There are a number of solutions to this problem but as of WMQ V7, the easiest one is to use the built-in Pub/Sub functionality. This assumes that the messages are arriving over a QMgr-to-QMgr channel and landing on a queue where you then consume them.In that case, it is possible to delete the queue and create an alias of the same name over a topic. You then create a new queue and define an administrative subscription that delivers messages on the topic into the new queue. Your app consumes from the new queue.When you need to send a feed to another QMgr or application, define a new subscription and point it at the new destination queue. Since this is Pub/Sub, MQ will replicate the original message as many times as there are subscriptions and the first application and its messages are not affected. If the destination you need to send to isn't accessible over MQ channels (perhaps DEV and QA are not connected, for example), you can deliver the messages to the new queue, use QLoad fromSupportPac MO03to write them to a file and then use another instance of QLoad to load them onto a different QMgr. If you wanted to move them in real time, you could set up the Q program fromSupportPac MA01to move them direct from the new subscription queue on QMgr1 to the destination queue on QMgr2. And you can replicate across as many systems as you need.The SupportPacs main page ishere.If all you are using is the Redbooks, you might want to have a look at the Infocenters. Be sure to use the Infocenter matching the version of WMQ you are using.WMQ V7.0 InfocenterWMQ V7.1 InfocenterWMQ V7.5 Infocenter\n"} +{"text": "### Human: I see the following error message in AMQERR01.LOG on the mq server printed repeatedlyAMQ9209: Connection to host 'client-host (...)' for channel\n'TEST_CHANNEL' closed.\n\nEXPLANATION:\nAn error occurred receiving data from 'client-host (...)' over\nTCP/IP. The connection to the remote host has unexpectedly terminated.\n\nThe channel name is 'TEST_CHANNEL'; in some cases it cannot be determined and\nso is shown as '????'.followed by:AMQ9999: Channel 'TEST_CHANNEL' to host 'client-host (...)' ended\nabnormally.\n\nEXPLANATION:\nThe channel program running under process ID 5022 for channel 'TEST_CHANNEL'\nended abnormally. The host name is 'client-host (...)'; in some\ncases the host name cannot be determined and so is shown as '????'.In the Action of the second message it says \"Note that this message can be excluded\ncompletely or suppressed by tuning the \"ExcludeMessage\" or \"SuppressMessage\"\"Why does this occur? Is this normal to have these errors and can these be suppressed as suggested?### Assistant: The message usually indicates that an application has terminated without first closing the channel. Occasionally it indicates that a firewall or other stateful network inspection has terminated the socket after a period of inactivity.The correct answer in the first case is to change the applications to properly manage connections. In the second case, upgrading to the latest client and server and using the new client channel tuning can prevent network timeouts on idle channels.The ability to suppress specific error messages is for those who are unable to address the root causes of these problems. As long as you aren't losing MQ messages, suppressing these errors increases the signal-to-noise ratio in the error logs. However, this is only considered a temporary measure and if you need to debug something you may need to re-enable the suppressed errors.\n"} +{"text": "### Human: I am trying to recevie logically grouped messages from an remote MQ using .Net client using native api [amqmdnet - WebSphere MQ Classes for .NET], which was put by java client using native api.While we are getting the logically grouped messages we are seeing some header information in all the messages in that group which will be showing differently in each editors, [notepad++, editplus etc.]The below specified header information's is appended in every logical message in that group something like \"MDE \"We are using thegetmessageoptions,openoptionsas below,mintMQQueueOpenOptions = IBM.WMQ.MQC.MQOO_INPUT_SHARED + IBM.WMQ.MQC.MQOO_FAIL_IF_QUIESCING\nmobjMQGetMessageOptions = New MQGetMessageOptions\nmobjMQGetMessageOptions.Options = IBM.WMQ.MQC.MQGMO_NO_SYNCPOINT + IBM.WMQ.MQC.MQGMO_FAIL_IF_QUIESCING\n'mobjMQGetMessageOptions.Options = mobjMQGetMessageOptions.Options + MQC.MQGMO_LOGICAL_ORDER 'Or MQC.MQGMO_ALL_MSGS_AVAILABLECode snippet to read the all the logical message in that group,'=================================\n ' INTANTIATE THE MQ MESSAGE OBJECT\n objMQMessage = New MQMessage\n objMQMessage.Format = MQC.MQFMT_STRING\n '=================================\n ' CLEAR THE MESSAGE VARIABLE\n strMQMessage = \"\"\n\n Do\n '============================\n ' GET THE MESSAGE FROM THE MQ\n mobjMQQueue.Get(objMQMessage, mobjMQGetMessageOptions)\n\n '============================\n ' READ THROUGH THE MESSAGE\n strMQMessage += objMQMessage.ReadString(objMQMessage.MessageLength)\n\n '============================\n ' SET GMO.MATCHOPTIONS TO GROUP ID, INITIALLY IT WAS SET TO \"MQC.MQMO_NONE\" \n mobjMQGetMessageOptions.MatchOptions = MQC.MQMO_MATCH_GROUP_ID\n\n '============================\n ' DO UNTIL - MESSAGE IS THE LAST IN THE GROUP OR THE GROUP CONSISTS OF ONLY ONE MESSAGE.\n Loop While (mobjMQGetMessageOptions.GroupStatus <> MQC.MQGS_LAST_MSG_IN_GROUP)\n\n '====================================\n ' COLLECT THE MESSAGE IN AN ARRAYLIST\n If Not String.IsNullOrEmpty(strMQMessage) Then objMQMessageList.Add(strMQMessage)\n\n '============================\n ' COMMIT THE FETCH OPERATION\n mobjMQQueueManager.Commit()How we can remove this header information from each message?### Assistant: TheMQMDEcontains MQMD fields that exist in the version-2 MQMD, but not in the version-1 MQMD. The Infocenter topicOverview for MQMDdescribes how theMQMDversion affects behavior of the GET call:On the MQGET call, if the application provides a version-1 MQMD, the\n queue manager prefixes the message returned with an MQMDE, but only if\n one or more of the fields in the MQMDE has a non-default value. The\n Format field in MQMD will have the value MQFMT_MD_EXTENSION to\n indicate that an MQMDE is present.Based on this, I would suggest providing a Version 2MQMD. Perhaps this will solve the problem:'=================================\n ' INTANTIATE THE MQ MESSAGE OBJECT\n objMQMessage = New MQMessage\n objMQMessage.Version = 2\n objMQMessage.Format = MQC.MQFMT_STRING\n '=================================Since theobjMQMessageis reused for successive calls, you may need to set the version before each GET.The IBM MQ Knowledge Center page \"MQMDE - Message descriptor extension > Overview for MQMDE\" also has some useful information on the topic:Usage:Applications that use a version-2 MQMD will not encounter an MQMDE structure. However, specialized applications, and\n applications that continue to use a version-1 MQMD, might encounter an\n MQMDE in some situations. The MQMDE structure can occur in the\n following circumstances:Specified on the MQPUT and MQPUT1 callsReturned by the MQGET callIn messages on transmission queues\n"} +{"text": "### Human: I am trying to receive the message from the queue using ANSI-C and MQGET function. The problem is that I always get error 2010 (MQRC_DATA_LENGTH_ERROR).I found out that this error concerns parameter 7 of the MQGET call (DataLength). The message on my queue has 7157460 bytes. The channel I am using for MQGET has the \"Maximum message length\" set to 104857600 (as well as the queue holding the message).I am even using the MQGET from this example:http://www.capitalware.biz/dl/code/c/msg2file.zipAnd I still end up with error 2010. What am I doing wrong? Should I somehow increase the maximum size of the message in MQSERVER environment variable?MQGET call:/* ... */\nMQLONG messlen; /* message length received */\n\nMQGET(Hcon, /* connection handle */\n Hobj, /* object handle */\n &md, /* message descriptor */\n &gmo, /* get message options */\n buflen, /* pBuffer length */\n pBuffer, /* pointer to message buffer */\n &messlen, /* message length */\n &CompCode, /* completion code */\n &Reason); /* reason code */### Assistant: I've got it! The answer is to use MQCONNX call to connect to queue manager.Example:#include \n/* ... */\nMQCNO mqcno = {MQCNO_DEFAULT} ; /* Connection options */\nMQCD mqcd = {MQCD_CLIENT_CONN_DEFAULT}; /* Channel Defs */\n\n/* ... */\nmqcd.MaxMsgLength = 104857600L; /* 100 MB */\n\nMQCONNX(mQueueManager.Name,\n &mqcno,\n &mQueueManager.ConnectionHandle,\n &mQueueManager.CompletionCode,\n &mQueueManager.ReasonCode);It worked like a charm!But please remember - if you find yourself needing to increase the maximum message size - think twice. There is probably something wrong with the design. In another words - MQ should not be used for transferring big messages. MQ File Transfer Edition is one of the solutions then.\n"} +{"text": "### Human: We know that MQ server could be configured such that new receiver will not be able to connect to MQ server if there is already receiver connecting to the same MQ queue. Error will look like below:Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2042' ('MQRC_OBJECT_IN_USE')But is there any way to configure server or client to allow new receiver to connect to MQ server and disconnect any existing receiver connection?Below is currently how my receiver connects to server. I wonder if something could be done to setIntProperty.cf = new MQQueueConnectionFactory();\ncf.setHostName(mqHost);\ncf.setPort(mqPort);\ncf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\ncf.setQueueManager(mqQueueManager);\ncf.setChannel(mqChannel);\n\nconn = (MQQueueConnection) cf.createQueueConnection();\nsession = (MQQueueSession) conn.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE);\nqueue = (MQQueue) session.createQueue(mqQueue);\nreceiver = (MQQueueReceiver) session.createReceiver(queue);Thanks!Gerry### Assistant: OK, you are mixing different concepts here. Your application is using a CLNTCONN channel to connect to the QMgr's SVRCONN channel. Yopu can have as many connections on a SVRCONN channel as memory and system resources allow. The connection is not the problem.The '2042' ('MQRC_OBJECT_IN_USE') indicates that the program is gaining exclusive access to the queue. There are two fixes for this:Don't use exclusive access to the queue. Check theDEFSOPTvalue of the queue to see if it is set toEXCLorSHARED. If you need it to be sharable, make sure the queue setting reflects that.If you need the queue to remain exclusive (for example because messages are sequence dependent), stop the previous connection before attempting a new connection. When a program does not close a connection gracefully, an orphaned channel agent holds the connection's queues open. Eventually the agent times out and any exclusive input queues become available again. If programs are leaving orphaned channels, fix the programs. As a short-term measure, you can manually stop orphaned channels to release the lock on the input queue.\n"} +{"text": "### Human: I've got a clustered partner in WMQ on distributed platforms (HP-UX). They and the qmgr they are putting messages to are both members of \"my\" cluster, but have never utilized the cluster relationship to communicate amonst themselves. They have a remote queue def, transmit queue (named as the queue manager), unique point to point sender/receiver channel pair, etc., but he claims that a TRACE ROUTE from one to the other is magically utilizing the SYSTEM.CLUSTER.TRANSMIT.QUEUE and the cluster channel (presumably), even though the remote queue, of course, has configured no such thing.Is there any strange anomalie of MQ that would cause a standard REMOTE queue to choose to use the cluster path without expecting it to?The queues on either side are NOT shared in the cluster of course.### Assistant: I think we've answered our own question. Can't imagine how I managed to follow the rules all along, and never elicit this behavior. If the supposed transmit queue specified in the remote queue definition does not have USAGE(XMITQ) specified, but rather, (NORMAL), and the transmit queue specified in the RQ is indeed the name of the known queue manager in the cluster, then voila, we have the cluster being used regardless of the definition explicitly configured in the remote queue definition itself. What a handy way to migrate from remote queue / unclustered definitions, to clustered ones.\n"} +{"text": "### Human: I use the following to write queue contents to a file:q -xb -ITESTQ -mTEST > messages.outI had 3 binary messages in the queue that got written to the file successfully. Now I have a need to load the same file back to the queue (same queue at a later time). When I do:q -xb -oTESTQ -mTEST < messages.outIt puts 9 messages instead of 3. I am guess the formatting is misread while the file is loaded. I've noticed there is -X option in the q program. What is the usage of it? What other options I have?### Assistant: Youreallyneed to look at the QLoad program (SupportPac MO03) for this. Same author as the Q program and every bit as good a tool. Also free. As the author explains in the manual:Ever since I released my MA01 (Q Utility) SupportPac I have had\n periodic requests to explain how it can be used to unload, and\n subsequently reload, messages from a queue. The answer has always been\n that this is not what MA01 is for and that surely there must be a\n utility available. Well, after sufficient numbers of these requests I\n looked for a utility myself and didn\u2019t really find anything which\n fitted the bill. What was needed was a very simple, some would say\n unsophisticated, program which unloaded a queue into a text file. The\n notion of a text file was important because a number of users wanted\n the ability to change the file once it had been created. I also find\n that text based files are more portable and so this seemed useful if\n we want to unload a queue, say on Windows, and then load the messages\n again on a Solaris machine. The disadvantage of this approach is that\n the file is larger than it would be in binary mode. Storing data using\n the hex representation of the character rather than the character\n itself essentially uses twice as much space. However, in general I do\n not envisage people using this program to unload vast amounts of\n message data but a few test messages or a few rogue messages on the\n dead letter queue which are then changed and reloaded elsewhere.\n"} +{"text": "### Human: Why doesn't the following create the LOCAL quue definition? I see a remote queue definition with the name REMOTE_QUEUE? Do I need to create another DEFINE QLOCAL for LOCAL_QUEUE?DEFINE QREMOTE (LOCAL_QUEUE) RNAME (REMOTE_QUEUE)\n RQMNAME(REMOTE_QUEUE_MANAGER) XMITQ(REMOTE_QUEUE_MANAGER) REPLACE### Assistant: When you issueDEFINE QREMOTE(LOCAL_QUEUE)you are making a routing entry that tells WMQ \"any time someone onthisQMgr opens a queue namedLOCAL_QUEUEthen instead, usethesevalues for the queue name, the QMgr name and, if specified, resolve to this XMitQ\". This entry shows up when you list all the defined queues but it isn't a queue that can hold messages. The only way to create a queue that can hold messages isDEFINE QLOCAL.The next step is to define the actual target queue where messages can land. Defining the QRemote on the local QMgr does not also define the QLocal on the target QMgr. To do that, you would need to sign onto the target QMgr with Explorer or connect on the command line usingrunmqscand issue theDEFINE QLOCAL(REMOTE_QUEUE)there.It is a bit unfortunate that your example used names likeREMOTE_QUEUEbecause onREMOTE_QUEUE_MANAGERit is actually a QLocal.FYI - totally unrelated but you might want to consider using dots as name separators likeREMOTE.QUEUEinstead ofREMOTE_QUEUEsince WMQ recognizes these as node separators and authorization wildcards respect them.\n"} +{"text": "### Human: I have traditional (com.ibm.mq.jar) MQ application in Java for testing purpose. Now I need to use that application to send some messages to JMS. When I try to set any JMS property on MQ message, for example:message.setStringProperty(\"JMSDestination\", \"queue:///\" + queueName);I always get error: 2471 -MQRC_PROPERTY_NOT_AVAILABLE. It works if I just removeJMSfrom the property name.Is it possible to set JMS properties directly onMQMessage? What is a correct way to do that on MQ level?Btw. I have the same application in .NET where setting JMS properties this way is possible so I'm only trying to use the same code in Java.### Assistant: It is not allowed to do this manually. Please use the JMS API to set JMS properties.Restrictions to MQ properties are explainedhere.One thing is interessting in that document page though,The names of properties specified directly as MQRFH2 elements are not guaranteed to be validated by the MQPUT call.You could perhaps work around this, on a short term basis. There seems to be no guarantee that setting the MQRFH2 elements directly will not be validated, though.\n"} +{"text": "### Human: If i create an environment variable will it exist in all flows within the execution group? I need to have a value which has to be shared between two flows in the same execution group.### Assistant: Nope. The environment variable has its scope set for a particular flow. If you want to share a value between two flows, either you will have to pass it on as a message or use User defined properties (UDP) to set it to all flows in the execution group.\n"} +{"text": "### Human: What are the cases a queue manager can loose its connectivy to repository in cluster encironment?\nI have an environment where a queue manager is losing its connectivity to repository often and i need to refresh the cluster to fix this and to re-establish communication with other queue manager in the cluster.Our cluster has 100 queue managers and we have 2 repositories in it.### Assistant: There are a few different issues that can cause this. One is if there are explicitly definedCLUSSDRchannels pointing to a non-repository QMgr. This causes repository messages to arrive at the non-repos QMgr which can cause itsamqrrmfarepository process to die. Another is that there have been a few APARS (such asthis one) which can lead to that process dieing. The solutions, respectively, are to fix the configuration issues or to apply the latest Fix Pack. Another issue, less commonly seen, is that a message to a new QMgr will error out before the new QMgr can resolve to the local QMgr. In this case, theREFRESHdoesn't actually cause the remote QMgr to resolve, it just provides time for the resolution to complete.Debugging this involves isolating the possible causes. Check thatamqrrmfais running. Check that all non-repository QMgrs have one and ONLY one explicitly defined CLUSSDR channel. Verify that all repositories have one and ONLY one explicitly defined CLUSSDR to each other repository. If overlapping clusters are used make sure to NOT overlap the channels. This means avoiding channel names likeTO.QMGRand prefer names likeCLUSTER.QMGR. Verify this by insuring channels do not use theCLUSNLattribute and use theCLUSTERattribute instead. Finally, reconcile the objects in both repositories and the non-repository by issuingDIS CLUSQMGR(*)andDIS QCLUSTER(*). The repositories should have identical object inventories. If that's wrong then there's the problem. The non-repository should have an entry for every QMgr it has previously talked to.One thing I have seen in the past was that an administrator had scheduled aREFRESH CLUSTER. His thinking was that this was something they needed to do to fix the cluster so why not run it on a regular basis? So he scheduled it to run daily. Then each night it made the QMgr forget about the other QMgrs in the cluster and the first time an app resolved a remote QMgr each day there was a flurry of repository traffic. This caused enough of a delay that there were a few 2087 errors each morning. Not thatyouwould do such a thing. :-)\n"} +{"text": "### Human: When I set MQMD.Expiry and MQM.Report (= MQRO_EXPIRATION_WITH_FULL_DATA) in Message Broker, where do messages go if they expire?Should I catch them in the MQInput node?If so, how do I differentiate between these and other errors?### Assistant: I found the answer:You have to set the MQMD.ReplyToQ in the message header. That way it will return to that queue once it expire. (Keep in mind a message is only thrown out when an MQGET is performed on that queue(Just moving this from comments in case any misses it.)\n"} +{"text": "### Human: We are using IBM's WebSphere MQ, and having issues creating administrative subscriptions via scripts. One of the params expects an existing model queue but for some reason it is missing from our environment. Maybe that's an issue altogether but wondering is there a way to bypass the model queue and create a subscription anyways?The link I'm looking at is the Messages & Codes manual section containingAMQ8464. \nPlease scroll down to see AMQ8464. I guess we're missing theInsert_3but hopefully there is a way around not having it. The full text of the error is as follows:If the command entered was Change or Display, the subscription\n specified does not exist. If the command entered was Copy,\n the source subscription does not exist. If the command entered was\n Create, the system default MQ subscription does not exist.Thanks for any ideas.### Assistant: This error can be thrown when attempting to copy or delete a subscription and the expected existing subscription isn't found. Since you are attempting to define a subscription then we can assume that the last case described in the error manual is the one we want -SYSTEM.DEFAULT.SUBdoes not exist. This subscription is defined when the QMgr is created (assuming a v7.0 or greater version of WMQ). There are two ways to get it back.Define the subscription manually. All that is required for this to work is to specify all the fields in the subscription.Use thestrmqm -ccommandas described here. This will redefine any default system objects that have been manually deleted, including the default subscription.The reason that #1 works is that WMQ will use whatever parameters that you provide on yourDEFINEcommand and then any you leave out it looks at theSYSTEM.DEFAULT.SUBobject to determine the system local default value. If you supplyallof the values, then it has no need to look at the default object and just defines whatever you tell it. That means you can define your own subscription or for that matter you can defineSYSTEM.DEFAULT.SUBjust by specifying all the parms. The followingDEFINEstatement recreatesSYSTEM.DEFAULT.SUBwithout having to stop and restart the QMgr using the-coption:DEFINE SUB(SYSTEM.DEFAULT.SUB) + \n TOPICSTR('') +\n TOPICOBJ('') +\n DEST('') +\n DESTQMGR('') +\n PUBAPPID('') +\n SELECTOR('') +\n USERDATA('') +\n PUBACCT(0000000000000000000000000000000000000000000000000000000000000000) + \n DESTCORL(000000000000000000000000000000000000000000000000) +\n DESTCLAS(PROVIDED) +\n EXPIRY(UNLIMITED) + \n PSPROP(MSGPROP) + \n PUBPRTY(ASPUB) +\n REQONLY(NO) + \n SUBSCOPE(ALL) + \n SUBLEVEL(1) + \n VARUSER(ANY) +\n WSCHEMA(TOPIC) +\n SUBUSER('')\n"} +{"text": "### Human: I am novice in IBM WebSphere MQ and I would like to ask you about the best approach to solve the following task.I use WebSphere MQ 7.0 and I have implemented an java app to check MQ queue on incoming messages.Incoming queue opened via the following code:int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_INQUIRE;\nMQQueue incomingQueue = \n qManager.accessQueue(qName, openOptions, null, null, null);Now, the task is to check in real-time mode when new messages appear inincomingQueueand process them.I permanently check queue depth via invocation ofincomingQueue.getCurrentDepth()in while-loop and check if it is bigger than zero then I get new messages.That works, but I believe it is not a good approach.What is the best approach to be notified when a new incoming message appeared in MQ Queue?Thank you.### Assistant: Just call the queue.Get(msg) method. This is a blocking call and will return only when there is a message on a queue.If the above is not suitable as it is a blocking call, you could look at WMQ JMS that provides a message listener. The message listener is used to receive messages on a callback method while the main thread can continue to do other work.There are good samples that comes with MQ. You can find them under (on Windows) \\tools\\jms\\samples and tools\\wmqjava\\samples.\n"} +{"text": "### Human: MQQueueclass in both .NET and Java API for WebSphere MQ contains three similar methods:PutForwardMessagePutReplyMessagePutReportMessageI understand purpose of the first one because it takes passed message, makes a copy of the message and puts it to the queue but what is a purpose of second and third method?The documentation forPutReplyMessagesays:Put a reply message onto the queue using message as the original messageThe documentation forPutReportMessagesays:Put a report message onto the queue using message as the original messageNothing more. Really great and helpful doc.It looks like all three methods do the same. They take original message passed to the method, makes a copy of the message (including body and properties) and sets some control fields likeMessageIdorCorrelationIdbased on original message and put the newly created message into the queue. The only difference between them is settingMessageTypeand probably some conditions how control headers should be copied. But why and when do I need these methods?I would expect thatPutReplyMessagewill take a new message with reply body and original message with request and configure reply message with necessary fields like message type and correlation Id before putting it to the queue. This version seems pretty use less because I always have to create my own reply message to specify its content and configure everything myself. Once I do that, I can simply use thePutmethod instead ofPutReplyMessage.### Assistant: When a message is forwarded, all of the message header fields remain intact. This includes message type, identity context, etc. The user or app must have +passall authorization and cannot change the header fields but can only pass them.When a reply message is sent, the original message context is used to setsomefields in the message header of the reply but the identity context of the reply message is inherited from the putting application rather than from the original message. The putter can choose to override some of the fields in the reply message header, for example whether to pass theMsgIDas theMsgIDof the reply, put it in theCorrelIDfield or put application-defined values in these fields.A report message is intended to be used to send application-defined report messages such asACKorNACK. These are different from the WMQ-defined COA or COD report messages. By convention, the requester can ask for no message data, partial data or all data but the putting application is free to honor as much or as little of the request as it wants.The WebSphere MQ native formats and message types are defined in theApplication Programming Guideand theApplication Programming Reference. I believe it is probably not appropriate to duplicate this information in each language manual but I've submitted feedback from the Infocenter .Net manual page suggesting that they could at least link to the appropriate section in the related document.\n"} +{"text": "### Human: I have two very basic questions on WebSphere MQ - given that I had been kind of administrating it for past few months I tend to think that these are silly questionsIs there a way to \"deactivate\" a\nqueue ? (for example through a\nrunmqsc command or through the\nexplorer interface) - I think not. I\nthink what I can do is just delete\nit.What will happen if I create a\nremote queue definition if the real\nremote queue is not in place? Will\nit cause any issues on the queue\nmanager? - I think not. I think all\nI will have are error messages in\nthe logs.Please let me know your thoughts.\nThanks!### Assistant: 1 Is there a way to \"deactivate\" a\n queue?Yes. You can change the queue attributes like so:ALTER Q(QUEUE_NAME) PUT(DISABLED) GET(DISABLED)Any connected applications will receive a return code on the next API call telling them that the queue is no longer available for PUT/GET. If these are well-behaved programs they will then report the error and either end or go into a retry loop.2 What will happen if I create a\n remote queue definition if the real\n remote queue is not in place?The QRemote definition will resolve to a transmit queue. If the message can successfully be placed there your application will receive a return code of zero. (Any unsuccessful PUT will be due to hitting MAXDEPTH or other local problem not connected to the fact that the remote definition does not exist.)The problem will be visible when the channel tries to deliver the message. If the remote QMgr has a Dead Letter Queue, the message will go there. If not, it will be backed out onto the local XMitQ and the channel will stop.\n"} +{"text": "### Human: Does WebSphere MQ v7 guarantee the recovery of in-flight messages after failover to a standby queue manager?If so, how is this accomplished?\nThanks### Assistant: There are two primary types of standby instances which support this level of recovery. The first is in a traditional hardware cluster such as Power HA, HACMP, Veritas, MSCS and so forth. The other is a Multi-Instance Queue Manager (MIQM). Both of these are capable of running the queue manager on more than one server with data and log files occupying shared disk which is accessible to all instances.In both cases, persistent messages which have been committed prior to the termination of the primary QMgr will be recovered. The secondary QMgr will assume possesion of the data and log files during the failover event. From the perspective of the failover node it is the same as if the QMgr was just starting up after a shutdown or crash, it just hapens to now be running on a different server.The main differences between a hardware cluster versus MIQM is that a hardware cluster fails over the IP address and possibly non-MQ processes as well. The MIQM recovers only the MQ processes and comes up on a different IP address. Applications with V7 clients can be configured with multi-instance connection details to allow for the multiple IP addresses.So for these solutions in which the state of the QMgr and any in-flight messages is stored on shared disk, bringing the QMgr up with the same shared disk but on a different node recovers the state of the QMgr, including any in-flight messages.\n"} +{"text": "### Human: Hi I am working with MQFTE. I need to know more in detail about how mqfte works and what are the internal process that takes place during a operation.The IBM links about mqfte/red books is good , but it doesn't have in depth contents.Could you please suggest me some links/ebooks to know more about mqfte and mq?.Thanks in Advance......### Assistant: Unfortunately, not too many 3rd party links and the only books I am aware of are the few Redbooks. However, this will be a start:WebSphere MQ FTE Home PageWebSphere MQ FTE InfocenterWebSphere MQ FTE Fix ListIBM Redbook:Getting Started with WebSphere MQ FTEWebSphere training(Including WMQ FTE)WebSphere MQ product pageWebSphere MQ v7 documentationWebSphere MQ v6 documentationWebSphere MQ RequirementsWebSphere MQ Recommended FixesWebSphere MQ SupportPacsWebsphere MQ 6+ Certification Book- Links to resources for self-studydeveloperWorks articleSecuring WebSphere MQ FTEdeveloperWorksMission:Messagingcolumn has in-depth articles on some of the trickier areas of WebSphere MQ family products.T-Rob.nethas a collection of WMQ security info, links, articles and all back-episodes ofThe Deep Queuepodcast.\n"} +{"text": "### Human: I'm currently developing a small EJB 3 application for WebSphere AS 7 with WebSphere-MQSeries. It's a very simple app that mainly consists of one MDB listening on a queue, convert the incoming messages and write the extracted data into a db. I've finally got up it and running, but I'm a bit confused regarding ActivationConfig annotations in the code, the ibm-ejb-jar-bnd.xml and the activation spec in WAS itself. My main question is, why do I need ALL of them? Why should/could I specify things like the queue name or destinaton type via annotation (@ActivationConfigProperty) when I still need a activation spec in WAS where I also specify the destination e.g. Queue-Name? I addition I also need a binding via an xml file? Is that right? Is it also possible to specify the activationspec-name via annotation and thus get rid of the xml binding file? Can I avoid creating the activation spec in WAS?Hope someone can clarify things, thanks.### Assistant: You cannot avoid the Activation Spec entity because it is responsible to open connection to your JMS provider, query messages according to various options like the message selector filter.According toWebSphere 7 InfoCenterEJB-3 annotations can replace activation specification properties from binding file but the properties required by WebSphere are not standard.So as far as I know, you have to provide:either the binding file, written manually or edited with the deployer tooleither at deployment setting properties in the administrative console or in automated jython/wsadmin scriptBe awarethat the Activation Spec is a runtime component that can be stopped, typically after some rollbacks on messages. In that case, it no longer consumes message and your MDB has nothing to process until you re-activate it from the WebSphere console.\n"} +{"text": "### Human: With WebSphere MQ, where is a message addressed to a remote queue manager and PUT under syncpoint control stored until MQCMIT is issued?### Assistant: Messages that are addressed to a remote queue manager resolve to a transmit queue. Which transmit queue they resolve to depends on how the message will be sent to the remote QMgr. The message will resolve locally to either a user-defined transmit queue for a SDR or SVR channel, or it will resolve to SYSTEM.CLUSTER.TRANSMIT.QUEUE for a clustered channel.For any message that is put under syncpoint, the message is written to the transaction logs and, if the message is persistent, to the queue file. The queue depth increases to reflect that the message is in the queue but the message is not made available to other programs (such as the channel agent) until the COMMIT occurs.So if your message is going to a clustered queue manager and you PUT under syncpoint, you will see the depth of the cluster transmit queue increase. At that point the message is at least in the transaction log and possibly also written to the queue file. As soon as the message is committed, it becomes available to the channel.\n"} +{"text": "### Human: I have installed Websphere MQ V7. and created queue manager and channels , but the problem is i cannot create any queues on the explorer and when check in the error log files ,there's no errors thrownHow can i be helped### Assistant: It sounds as though you can see the queues in Explorer but creating a new queue fails. If what you meant was that you are unable to get Explorer to connect at all, then please clarify the question.When you can see queues but can't create them, there's a very good chance that you are getting authorization errors. You can test this theory by enabling authorization events:runmqsc ALTER QMGR AUTHOREV(ENABLED)If this is the problem then you will see event messages being generated in theSYSTEM.ADMIN.QMGR.EVENTqueue.Another way to verify this is to set the MCAUSER of the SVRCONN channel to an administrative value. If you are using Linux, that would be 'mqm' and on Windows it depends on how you installed it but MUSR_MQADMIN usually works.runmqsc ALTER CHL(SYSTEM.ADMIN.SVRCONN) CHLTYPE(SVRCONN) MCAUSER('mqm')If this solves the problem then it was authorization errors. Keep in mind that hard-coding the MCAUSER to an administrative value means that anyone connecting to that channel has administrative rights.If security is important you will want to make sure that any inbound channel with a blank MCAUSER or an administrative account in MCAUSER authenticates connections using SSL or an exit. Channels for low-privileges access must have a low-privileged account in the MCAUSER or else they allow administration. These include channels of type RCVR, RQSTR, CLUSRCVR and SVRCONN, and specifically those namedSYSTEM.DEF*andSYSTEM.AUTO.*as well as any user-defined channels. For much more discussion of WMQ security, please see theWMQ Hardeningpresentation athttps://t-rob.net/links/or post questions here on SO.\n"} +{"text": "### Human: This is a follow up on the question below, but it deserves another question.Are server-conn and client-conn channels the only channels that could have more than one instances?To my understanding, a receiver (or cluster receiver) channel usually pair up with a single sender (or cluster sender) channel. How can one side being single instance while the other side being multiple instances?Thanks.### Assistant: Consider a CLUSRCVR channel for a minute. You define one of these and then all members of the cluster use the same one to talk to the local QMgr. Similarly, a single SVRCONN channel definition can server connections from many users (think SYSTEM.ADMIN.SVRCONN for instance, with 50 users attached to it.)The same principle works for RCVR or RQSTR channels. For example, suppose that you create a channel on your local QMgr called BRANCH.TO.CENTRAL with the intention that each branch office uses the channel to send daily sales numbers to the home office. Each of the queue managers can have only one instance of a BRANCH.TO.CENTRAL channel defined. The branch queue managers can have only one instance of the channel running but the central office can have many instances of the channel active at the same time. Typically you would not do this and would either use a cluster or named channel pairs, but it does serve to illustrate the case.So the rule of thumb is that inbound channels (SVRCONN, RCVR, RQSTR and CLUSRCVR) can have many running instances using a single channel definition while outbound channels can have only one running instance.Does that help or just muddy things up?\n"} +{"text": "### Human: We are trying to connect to IBM MQ Server v 9.1.0.x. from RHEL 8.3 using .net core 3.1 and IBMMQDotnetClient 9.2.0.1 standard library from nuget.We are stuck on getting CompCode: 2 Reason: 2059 error.We know what is the reason: during ssl negotiation cipher spec is set to TLS_RSA_WITH_AES_128_CBC_SHA256 but the channel has it set to TLS_RSA_WITH_AES_256_CBC_SHA256.ERR*.TRCCommentInsert2(TLS_RSA_WITH_AES_256_CBC_SHA256)CommentInsert3(TLS_RSA_WITH_AES_128_CBC_SHA256)AMQ9631E: The CipherSpec negotiated during the SSL handshake does not match the\nrequired CipherSpec for channelWe had the same issue on Windows but doingDisable-TlsCipherSuite -Name TLS_RSA_WITH_AES_128_CBC_SHA256has resolved the issue.What we've done already:We are specifying SSL_CIPHER_SPEC_PROPERTY as TLS_RSA_WITH_AES_256_CBC_SHA256.Unfortunately it is ignored, as we are using managed client (MQC.TRANSPORT_MQSERIES_MANAGED) it's the only valid option for managed library. All security calls are transferred to internal security providers (Schanel/SslStreams on Windows and OpenSsl on Linux).We know that we should alter cipher policy on Linux, do you have any idea how to:Disable TLS_RSA_WITH_AES_128_CBC_SHA256 on RHEL?UPDATEDisable-TlsCipherSuite -Name TLS_RSA_WITH_AES_128_CBC_SHA256is a Powershell cmd.UPDATE 1On Linux (RHEL8.3) During handshake my frame looks like:Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 (0xc02c) \n Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (0xc030) \n Cipher Suite: TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 (0x009f) \n Cipher Suite: TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 (0xcca9) \n Cipher Suite: TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (0xcca8) \n Cipher Suite: TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (0xccaa) \n Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 (0xc02b)\n Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (0xc02f)\n Cipher Suite: TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 (0x009e)\n Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 (0xc024)\n Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 (0xc028)\n Cipher Suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 (0x006b)\n Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 (0xc023)\n Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 (0xc027)\n Cipher Suite: TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 (0x0067)\n Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA (0xc00a)\n Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (0xc014)\n Cipher Suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA (0x0039)\n Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA (0xc009)\n Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (0xc013)\n Cipher Suite: TLS_DHE_RSA_WITH_AES_128_CBC_SHA (0x0033)\n Cipher Suite: TLS_RSA_WITH_AES_256_GCM_SHA384 (0x009d)\n Cipher Suite: TLS_RSA_WITH_AES_128_GCM_SHA256 (0x009c)\n **Cipher Suite: TLS_RSA_WITH_AES_256_CBC_SHA256 (0x003d)**\n **Cipher Suite: TLS_RSA_WITH_AES_128_CBC_SHA256 (0x003c)**\n Cipher Suite: TLS_RSA_WITH_AES_256_CBC_SHA (0x0035)\n Cipher Suite: TLS_RSA_WITH_AES_128_CBC_SHA (0x002f)\n Cipher Suite: TLS_EMPTY_RENEGOTIATION_INFO_SCSV (0x00ff)UPDATE 2We managed to force cipher used during negotiation and then during MakeSecuredConnection. Unfortunately it's only doable on .NET5.0 and hack in MakeSecureConnection is needed.I tried the same approach using .net core 3.1 but failed probably because of use of AuthenticateAsClientAsync.Here is .NET5.0 IBM MQ Client 9.2.0.1 hackDecompile the code of IBMMQClient (amqmdnetstd.dll)Mark .csproj as .NET5.0net5.0EditMakeSecureConnectionmethod in classMQEncryptedSocketas followsonly .NET5.0if (!RuntimeInformation.IsOSPlatform(OSPlatform.Linux))\n {\n stream.AuthenticateAsClient(\"*\", x509Certificate2Collection, sslProtocol, sslCertRevocationCheck);\n }\n else\n {\n //stream.AuthenticateAsClient(\"*\", x509Certificate2Collection, sslProtocol, sslCertRevocationCheck);\n var sslClientOptions = new SslClientAuthenticationOptions()\n {\n CertificateRevocationCheckMode = sslCertRevocationCheck ? X509RevocationMode.Offline : X509RevocationMode.NoCheck,\n ClientCertificates = x509Certificate2Collection,\n EnabledSslProtocols = sslProtocol, \n TargetHost = \"*\", \n RemoteCertificateValidationCallback =ClientValidatingServerCertificate,\n LocalCertificateSelectionCallback = FixClientCertificate,\n CipherSuitesPolicy = new CipherSuitesPolicy(new List() { Enum.Parse(cipherSpec) })\n };\n TrText(method, $\"Setting Cipher for AuthenticateAsClient {string.Join(':',sslClientOptions.CipherSuitesPolicy.AllowedCipherSuites)}\");\n stream.AuthenticateAsClient(sslClientOptions);\n }for .net core 3.1 you have to callstream.AuthenticateAsClientAsync(sslClientOptions);Since there is no methodAuthenticateAsClientoverload acceptingSslClientAuthenticationOptionsparameter..net standard 2.0 and 2.1 don't have CipherSuitesPolicy parameter in classSslClientAuthenticationOptionsthat's why I had to move the library from .net standard 2.0 to .net5.0 (with success) and .net core 3.1 without.Do you have any clue how is it possible to make it work on .net core 3.1?### Assistant: I had the same issue when connecting with .NET MQ client to a channel using TLS_RSA_WITH_AES_256_CBC_SHA256 cipher.In the MQ server logs I saw that my client tried to connect withTLS_RSA_WITH_AES_256_GCM_SHA384even if I was setting the cipher spec toTLS_RSA_WITH_AES_256_CBC_SHA256in my code.cf.SetStringProperty(XMSC.WMQ_SSL_CIPHER_SPEC, \u201cTLS_RSA_WITH_AES_256_CBC_SHA256\u201d);To solve it I had to set the system default cipher in the file /etc/ssl/openssl.cnf to AES256-SHA256.[system_default_sect]\n\u2026\nCipherString = AES256-SHA256My application is built on .NET 6.\n"} +{"text": "### Human: I am trying to configure one @JMSListener which will listen to multiple queue managers in my Springboot application which is listening to IBM MQ. Below are the 2 bean i have created and the requirement is to listen to both queue actively :@Value(\"${ibm.mq.queueManager.A}\")\nString jmsMQConnectionFactoryA;\n\n@Value(\"${ibm.mq.queueManager.B}\")\nString jmsMQConnectionFactoryB;\n\n@Bean\n@Primary\npublic MQQueueConnectionFactory jmsMQConnectionFactoryB() {\n MQQueueConnectionFactory mqQueueConnectionFactory = new MQQueueConnectionFactory();\n URL url = JMSConfiguration.getURL(this.urlFileLocation);\n try {\n mqQueueConnectionFactory.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n mqQueueConnectionFactory.setClientReconnectOptions(WMQConstants.WMQ_CLIENT_RECONNECT_Q_MGR);\n mqQueueConnectionFactory.setCCDTURL(url);\n mqQueueConnectionFactory.setQueueManager(jmsMQConnectionFactoryB);\n } catch (Exception e) {\n e.printStackTrace();\n }\n return mqQueueConnectionFactory;\n}\n\n \n\n @Bean\n public MQQueueConnectionFactory jmsMQConnectionFactoryB() {\n MQQueueConnectionFactory mqQueueConnectionFactory = new MQQueueConnectionFactory();\n URL url = JMSConfiguration.getURL(this.urlFileLocation);\n try {\n mqQueueConnectionFactory.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n mqQueueConnectionFactory.setClientReconnectOptions(WMQConstants.WMQ_CLIENT_RECONNECT_Q_MGR);\n mqQueueConnectionFactory.setCCDTURL(url);\n mqQueueConnectionFactory.setQueueManager(jmsMQConnectionFactoryA);\n } catch (Exception e) {\n e.printStackTrace();\n }\n return mqQueueConnectionFactory;\n }EDIT 1 :Added 2 containerFactory using above connections and 2 JMSTemplate (as i need to publish message as well) Below is the updated working code@Bean\n JmsListenerContainerFactory jmsContainerFactoryA() {\n DefaultJmsListenerContainerFactory factory = new \n DefaultJmsListenerContainerFactory();\n factory.setConnectionFactory(jmsMQConnectionFactoryA());\n factory.setRecoveryInterval((long) 60000);\n factory.setSessionAcknowledgeMode(2);\n factory.setSessionTransacted(true);\n // factory.setMaxMessagesPerTask(concurrencyLimit);\n return factory;\n }\n\n@Bean\nJmsListenerContainerFactory jmsContainerFactoryB() {\n DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();\n factory.setConnectionFactory(jmsMQConnectionFactoryB());\n factory.setRecoveryInterval((long) 60000);\n factory.setSessionAcknowledgeMode(2);\n factory.setSessionTransacted(true);\n // factory.setMaxMessagesPerTask(concurrencyLimit);\n return factory;\n}\n\n@Bean\npublic MQQueue jmsResponseQueue() {\n MQQueue queue = null;\n try {\n queue = new MQQueue(\"QueueOut\");\n queue.setBaseQueueName(wmq_out_base_queue);\n } catch (JMSException e) {\n e.printStackTrace();\n }\n return queue;\n}\n\n@Bean\npublic JmsTemplate jmsTemplateB() {\n JmsTemplate template = new JmsTemplate();\n template.setConnectionFactory(jmsMQConnectionFactoryB());\n template.setDefaultDestination(jmsResponseQueue());\n template.setMessageConverter(oxmMessageConverter());\n return template;\n}\n\n@Bean\npublic JmsTemplate jmsTemplateA() {\n JmsTemplate template = new JmsTemplate();\n template.setConnectionFactory(jmsMQConnectionFactoryA());\n template.setDefaultDestination(jmsResponseQueue());\n template.setMessageConverter(oxmMessageConverter());\n return template;\n}Class2.java@Value(\"${wmq_out_base_queue}\")\n String wmq_out_base_queue;\n\n @Autowired\n JmsTemplate jmsTemplateA;\n \n @Autowired\n JmsTemplate jmsTemplateB;\n\n @JmsListener(containerFactory=\"jmsContainerFactoryA\",destination = \"${wmq_in_base_queue}\")\n public void reciveMessageA(Message message) {\n LOGGER.info(\"Received message is: \" + message); \n this.jmsTemplateA.convertAndSend(wmq_out_base_queue, \"Some Message\");\n }\n \n @JmsListener(containerFactory=\"jmsContainerFactoryB\",destination = \"${wmq_in_base_queue}\")\n public void reciveMessageB(Message message) {\n LOGGER.info(\"Received message is: \" + message); \n this.jmsTemplateA.convertAndSend(wmq_out_base_queue, \"Some Message2\");\n }### Assistant: You need to disable JMS auto configuration and configure 2 connection factories, 2 container factories using those connection factories and 2 JmsTemplates (if you are also publishing).I am trying to configure one @JMSListener which will listen to multiple queue managersIn order to have a@JmsListenerto do this you need to add 2@JmsListenerannotations to the method, with each one having thecontainerFactoryproperty set to the respective container factory.\n"} +{"text": "### Human: From a Java app I'm trying to browse messages from a mainframe IBM MQ queue (EBCDIC messages). I need to browse messages, not consume them. Here is the code:JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\nJmsConnectionFactory cf = ff.createConnectionFactory();\n\n// Set properties\ncf.setStringProperty(WMQConstants.WMQ_HOST_NAME, host);\ncf.setIntProperty(WMQConstants.WMQ_PORT, port);\ncf.setStringProperty(WMQConstants.WMQ_CHANNEL, channel);\ncf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\ncf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, qmgr);\ncf.setIntProperty(WMQConstants.WMQ_RECEIVE_CONVERSION, WMQConstants.WMQ_RECEIVE_CONVERSION_QMGR);\n\nQueueBrowser browser = context.createBrowser(context.createQueue(\"queue:///\" + queueName + \"?targetClient=1\"));\nEnumeration enumeration = browser.getEnumeration();\n\nwhile (enumeration.hasMoreElements()) {\n TextMessage messageInTheQueue = (TextMessage) enumeration.nextElement();\n System.out.println(messageInTheQueue);\n nbRecords++;\n}The result ofSystem.out.println()looks like:JMSMessage class: jms_text\n JMSType: null\n JMSDeliveryMode: 2\n JMSMessageID: ID:c1d4d840d4d8e3c1e2f24040404040405e2432bd21aa1b02\n JMSTimestamp: 1579537307450\n JMSRedelivered: false\n JMSXAppID: \n JMSXDeliveryCount: 1\n JMSXUserID: \n JMS_IBM_Character_Set: IBM037\n JMS_IBM_Encoding: 273\n JMS_IBM_Format: MQSTR \n JMS_IBM_MsgType: 8\n JMS_IBM_PutApplType: 8\n JMS_IBM_PutDate: 20200120\n JMS_IBM_PutTime: 16214745\n\u00cd\u00cd\u00d1\u00c0 ...I would like to convert this EBCDIC message\u00cd\u00cd\u00d1\u00c0 ...to something readable (ASCII).I tried to castenumeration.nextElement()toJMSByteMessagebut get this exception:class com.ibm.msg.client.jms.internal.JmsTextMessageImpl cannot be cast to class com.ibm.jms.JMSBytesMessageHow could I do that?Solution:\nUse theMQ classesfor Java instead of theMQ JMS classesfor Java:byte[] strData = new byte[theMessage.getMessageLength()];\ntheMessage.readFully(strData, 0, theMessage.getMessageLength());Some example here:https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q030840_.htm### Assistant: Regarding the OP's original code, the following documentation states that receive conversion & CCSID are only valid for the MQDestination class:https://www.ibm.com/docs/en/ibm-mq/9.2?topic=reference-properties-mq-classes-jms-objectsTherefore thiscanbe done with the IBM MQ Classes for JMS. You just have to do it in a more round-about fashion.In order to make the QueueBrowser read EBCDIC formatted messages, you need to cast the JMS Queue to MQDestination, then set the receiveConversion & receiveCCSID, then when creating the browser, cast the MQDestination back to regular JMS Queue. Like so:JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\nJmsConnectionFactory cf = ff.createConnectionFactory();\n\n// Set properties\ncf.setStringProperty(WMQConstants.WMQ_HOST_NAME, host);\ncf.setIntProperty(WMQConstants.WMQ_PORT, port);\ncf.setStringProperty(WMQConstants.WMQ_CHANNEL, channel);\ncf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\ncf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, qmgr);\n\nJMSContext context = cf.createContext();\nMQDestination targetQueue = (MQDestination) context.createQueue(\"queue:///\" + queueName)\ntargetQueue.setReceiveCCSID(WMQConstants.CCSID_UTF8);\ntargetQueue.setReceiveConversion(WMQConstants.WMQ_RECEIVE_CONVERSION_QMGR);\ntargetQueue.setMessageBodyStyle(WMQConstants.WMQ_MESSAGE_BODY_MQ);\nQueueBrowser browser = context.createBrowser((Queue) targetQueue);\nEnumeration enumeration = browser.getEnumeration();\n\nwhile (enumeration.hasMoreElements()) {\n TextMessage messageInTheQueue = (TextMessage) enumeration.nextElement();\n System.out.println(messageInTheQueue);\n nbRecords++;\n}You also don't need to use the JMS URI properties for setting the target client when doing it this way, as MQDestination has all the necessary getters/setters to modify loads of properties that would otherwise be done with a URI.For more information on MQDestination, consult the following docs:https://www.ibm.com/docs/en/ibm-mq/9.2?topic=jms-mqdestination\n"} +{"text": "### Human: I need a help for the captioned subject. Request your suggestion here.I am using spring boot framework to get the messages from IBM MQ 8.0.0.9. The attached program meets the basic expectation. However, It always uses the OS credential (in specifically Windows Login credential) to connect to the IBM MQ. But I would like it to use the credential this is given in property file. Even if, I intentionally give wrong credential in the property files, the program happily connects with the IBM MQ (using windows login credential which has access to the IBM MQ as well).Here is the MQ Details - \nMQ Version 8.0.0.9, \nQM Version 8.0.0.9, \nCONNAUTH - Not Set, \nCHLAUTH - Disabled, \nQMGR CONNAUTH - Not Set, \nCHCKCLNT - OPTIONAL, \nAUTHINFO - SYS.DEFAULT.AUTHINFO.IDPWOSCould you suggest what I am doing wrong here in the attach program. I have tried the commented line of code as well.@EnableJms\n@Configuration\n@EnableTransactionManagement\npublic class JmsConfig {\n @Value(\"${ibm.mq.host}\")\n private String host;\n @Value(\"${ibm.mq.port}\")\n private Integer port;\n @Value(\"${ibm.mq.queueManager}\")\n private String queueManager;\n @Value(\"${ibm.mq.channel}\")\n private String channel;\n @Value(\"${ibm.mq.responseQueue}\")\n private String responseQueue;\n @Value(\"${ibm.mq.userName}\")\n private String userName;\n @Value(\"${ibm.mq.password}\")\n private String password;\n @Value(\"${ibm.mq.receiveTimeout}\")\n private long timeout;\n\n @Autowired(required=true)\n @Qualifier(value=\"responseListener\")\n MessageListener responseListener;\n\n @Bean (name=\"queueConnectionFactory\")\n public MQQueueConnectionFactory mqQueueConnectionFactory() {\n MQQueueConnectionFactory mqQueueConnectionFactory = new MQQueueConnectionFactory();\n\n try {\n mqQueueConnectionFactory.setHostName(host);\n mqQueueConnectionFactory.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n mqQueueConnectionFactory.setChannel(channel);\n mqQueueConnectionFactory.setPort(port);\n mqQueueConnectionFactory.setQueueManager(queueManager);\n mqQueueConnectionFactory.setCCSID(819);\n /*\n mqQueueConnectionFactory.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, true);\n mqQueueConnectionFactory.setStringProperty(WMQConstants.USERID, userName);\n mqQueueConnectionFactory.setStringProperty(WMQConstants.PASSWORD, password);\n mqQueueConnectionFactory.setStringProperty(CMQC.USER_ID_PROPERTY, userName);\n mqQueueConnectionFactory.setStringProperty(CMQC.PASSWORD_PROPERTY, password);\n */\n } catch (JMSException e) {\n log.error(\"Error occured: \" + e);\n }\n\n return mqQueueConnectionFactory;\n }\n\n @Primary\n @Bean (name=\"userCredentialsConnectionFactoryAdapter\")\n @DependsOn(value = { \"queueConnectionFactory\" })\n UserCredentialsConnectionFactoryAdapter getUserCredentialsConnectionFactoryAdapter(\n MQQueueConnectionFactory mqQueueConnectionFactory) {\n UserCredentialsConnectionFactoryAdapter userCredentialsConnectionFactoryAdapter = new UserCredentialsConnectionFactoryAdapter();\n userCredentialsConnectionFactoryAdapter.setUsername(userName);\n userCredentialsConnectionFactoryAdapter.setPassword(password);\n userCredentialsConnectionFactoryAdapter.setTargetConnectionFactory(mqQueueConnectionFactory);\n return userCredentialsConnectionFactoryAdapter;\n }\n\n @Bean (name=\"simpleMessageListenerContainer\")\n @DependsOn(value = { \"userCredentialsConnectionFactoryAdapter\" })\n public SimpleMessageListenerContainer queueResponseContainer(ConnectionFactory userCredentialsConnectionFactoryAdapter) {\n SimpleMessageListenerContainer simpleMessageListenerContainer = new SimpleMessageListenerContainer();\n simpleMessageListenerContainer.setConnectionFactory(userCredentialsConnectionFactoryAdapter);\n simpleMessageListenerContainer.setConnectLazily(true);\n simpleMessageListenerContainer.setDestinationName(responseQueue);\n simpleMessageListenerContainer.setMessageListener(responseListener);\n return simpleMessageListenerContainer;\n }\n\n @Bean\n public JmsOperations jmsOperations(ConnectionFactory userCredentialsConnectionFactoryAdapter) {\n JmsTemplate jmsTemplate = new JmsTemplate(userCredentialsConnectionFactoryAdapter);\n jmsTemplate.setReceiveTimeout(timeout);\n return jmsTemplate;\n }\n}\n\n====================\n\n@Component(value=\"responseListener\")\npublic class ResponseListener implements MessageListener {\n\n public void onMessage(Message message) { \n ...\n }\n}\n\n===================\n\n@Component\npublic class ContainerChecker {\n\n @Autowired\n SimpleMessageListenerContainer queueContainer;\n\n @Scheduled(fixedRate = 300000)\n public void reportContainerStatus() throws ServiceException{\n if(!queueContainer.isActive()) {\n ...\n } else {\n ...\n }\n }\n}### Assistant: Based on the updates in your comments:Your application is using the IBM MQ classes for JMS from IBM MQ v8.0.0.9Your application is connecting to a IBM MQ queue manager also running v8.0.0.9.The queue manager has CONNAUTH disabled [QMGR CONNAUTH('')]The queue manager has CHLAUTH disabled [`QMGR CHLAUTH(DISABLED)'].In your configuration you show the following bean:@Bean (name=\"userCredentialsConnectionFactoryAdapter\")\n@DependsOn(value = { \"queueConnectionFactory\" })\nUserCredentialsConnectionFactoryAdapter getUserCredentialsConnectionFactoryAdapter(\n MQQueueConnectionFactory mqQueueConnectionFactory) {\n UserCredentialsConnectionFactoryAdapter userCredentialsConnectionFactoryAdapter = new UserCredentialsConnectionFactoryAdapter();\n userCredentialsConnectionFactoryAdapter.setUsername(userName);\n userCredentialsConnectionFactoryAdapter.setPassword(password);\n userCredentialsConnectionFactoryAdapter.setTargetConnectionFactory(mqQueueConnectionFactory);\n return userCredentialsConnectionFactoryAdapter;\n}You also have the following commented out code:/*\n mqQueueConnectionFactory.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, true);\n mqQueueConnectionFactory.setStringProperty(WMQConstants.USERID, userName);\n mqQueueConnectionFactory.setStringProperty(WMQConstants.PASSWORD, password);\n mqQueueConnectionFactory.setStringProperty(CMQC.USER_ID_PROPERTY, userName);\n mqQueueConnectionFactory.setStringProperty(CMQC.PASSWORD_PROPERTY, password);\n */With IBM MQ classes for JMS v8.0 and later the default for the settingWMQConstants.USER_AUTHENTICATION_MQCSPisFALSE. This denotes that the client should work in compatibility mode, this means the MQ client works as it did in version 7.5 and lower, MQCSP did not exist in those older versions and the username and password specified were sent in some fields calledRemoteUserIdentifierandRemotePasswordand were limited to 12 characters.With MQ v8 and higher the IBM MQ classes for JMS now support a new way to send the username and password, this is the MQCSP struction. This has some benefits for example it can passwords that are longer than 12 characters. IfWMQConstants.USER_AUTHENTICATION_MQCSPisTRUEthe username and password specified will be sent in the MQCSP structure and theRemoteUserIdentifierthat is used in compatibility mode is instead filled in with the username the process is running under and theRemotePasswordfield is left blank.I can't find anything that leads me to believe that theuserCredentialsConnectionFactoryAdapterbean does anything with theWMQConstants.USER_AUTHENTICATION_MQCSPsetting so this would lead me to believe it should be sending the username and password you specified in the fields calledRemoteUserIdentifierandRemotePassword. If you used the commented out code instead it would send the username and password you specified in the MQCSP and your windows login id that is running the process would be sent in theRemoteUserIdentifierfield.A queue manager at v8 with the configuration you have specified will completely disregard anything in the MQCSP structure and will only look at theRemoteUserIdentifierfield. You also said CHLAUTH is DISABLED, so this means that there are no CHLAUTH rules in place that would restrict or change the username that the client sends. If theSVRCONNchannel has a blank MCAUSER, then the userid sent in theRemoteUserIdentifierfield will be used for queue authorization checks.I suspect that when you noted your \"windows login credential\" coming across to the queue manager it was when you hadWMQConstants.USER_AUTHENTICATION_MQCSPset toTRUE. By setting this toFALSEyou can specify any ID you want to be sent to MQ and because of the configuration of the queue manager it will accept that ID and use it, the password is not verified.Since the password is not checked by MQ it does not matter what value if any you specify for the password, the following would be able to connect sending the specified username.mqQueueConnectionFactory.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, FALSE);\nmqQueueConnectionFactory.setStringProperty(WMQConstants.USERID, userName);Notes about the queue manager setupBecause CONNAUTH is not configured and CHLAUTH is also DISABLED you can connect to the queue manager and specify themqmid (if the queue manager is on Unix) or theMUSR_MQADMINid (if the queue manager is on Windows) and you would have full MQ authority over all queues on the queue manager.The current configuration provides no security to prevent anyone that has access connect over the network to the queue manager's host and port from accessing any resources the queue manager has available, in most cases this could also be leveraged to execute anything you want on the server where the queue manager runs.\n"} +{"text": "### Human: I want to stream data from IBM MQ. I have tried outthis codeI found on Github.I am able to stream data from the Queue but each time it streams, it takes all the data from it. I just want to take the current data that is pushed into the queue. I looked up on many sites but didn't find the correct solution.In Kafka we had something likeKafkaStreamUtilsfor streaming the near-real-time data. Is there anything similar to that in IBM MQ so that it streams only the latest data?### Assistant: The sample in the link you provided shows that it calls the following method to recieve from the the IBM MQ:CustomMQReciever(String host , int port, String qm, String channel, String qn)If you review CustomMQRecieverhereyou can see that it is only Browsing the messages from the queue. This means the message will still be on the queue and the next time you connect you will receive the same messages:MQQueueBrowser browser = (MQQueueBrowser) qSession.createBrowser(queue);If you wanted to remove the messages from the queue you would need to call a method that does consume them from the queue instead of browsing them from the queue. Below is an example of changes toCustomMQReciever.javathat should accomplish what you want:Under theinitConnection()change the above code to the following to cause it to remove the messages from the queue:MQMessageConsumer consumer = (MQMessageConsumer) qSession.createConsumer(queue);Get rid of:enumeration= browser.getEnumeration();Underreceive()change the following:while (!isStopped() && enumeration.hasMoreElements() )\n {\n\n receivedMessage= (JMSMessage) enumeration.nextElement();\n String userInput = convertStreamToString(receivedMessage);\n //System.out.println(\"Received data :'\" + userInput + \"'\");\n store(userInput);\n }To something like this:while (!isStopped() && (receivedMessage = consumer.receiveNoWait()) != null))\n {\n String userInput = convertStreamToString(receivedMessage);\n //System.out.println(\"Received data :'\" + userInput + \"'\");\n store(userInput);\n }\n"} +{"text": "### Human: I am a java developer. I have created the Queue connection factories and Queues in WAS 8.0.0.10 in order to connect to IBM MQ. I want to test the timeout scenario, hence, i purposely shut down the IBM MQ. It took about 2-3 minutes to get the expected timeout result. I want to decrease the value of timeout, however, i could not find any configuration in there.May i know is there possible to configure the timeout value? Because i try out almost all the timeout configuration, but none of them helps. Thank you.### Assistant: It depends on which TIMEOUT you are trying to configure.The TCP Connection Timeout for an initial connection can be configured by setting theConnect_Timeoutvalue to the number of seconds you want the connection to wait for an initial TCP connection. This would apply for instance if the server was down, or a network connection to the server was down. If the server was up and reachable over the network and only the MQ listener (or all of MQ) was shutdown then the response from the server to a connection to the MQ listener port would be an immediate \"Connection refused\" and you would never hit the TCP Connection Timeout.You can setConnect_Timeoutin various ways, two of which are:mqclient.ini file (seeLocation of the client configuration file) in the TCP stanza, for example:TCP:\n Connect_Timeout=30Passing a java system property equivalent to the above, for example:-Dcom.ibm.mq.cfg.TCP.Connect_Timeout=30If you are looking for how to set the timeout of a existing connection to MQ there are a few things to note:IBM MQ clients/queue managers by default send heartbeat messages when a channel is idle. TheHBINTof theSVRCONNchannel will define the interval in seconds at which a heart beat message is sent if no other traffic has passed over the channel for JMS MQ clients.Normally the client should always initiate the HB and the queue manager will respond. If the queue manager does not receive a HB request inHBINT+5 seconds it will initiate a HB to the client and expect a response.The timeout is based upon 2*HBINTforHBINT's of less than 60 seconds andHBINT+ 60 forHBINT's of over 60 seconds. The defaultHBINTon aSVRCONNis 300 so the TIMEOUT of a MQ connection to a channel with the defaultHBINTwould be 360 seconds. You mention 2 - 3 minutes I suspect if you timed it on a watch it would be 6 minutes.If you wanted to set the timeout to 30 seconds then you would alter theSVRCONNchannelsHBINTto 15 seconds, for example:ALTER CHL(CHL.NAME) CHLTYPE(SVRCONN) HBINT(15)Note that the value only takes effect the next time you make a client connection to the channel, it would not impact the HBINT of already running channels.Additional note that when connecting to MQ queue managers v6 or older, client HB messages are only sent when the client is in a GET with WAIT operation, not at other times.\n"} +{"text": "### Human: I'm losing my ever-loving mind over this one.I'm trying to output a list of local queues with their current depth and maximum depth. The following command basically does the job:display qlocal(*) curdepth maxdepthHowever, I'm getting all the SYSTEM.* queues and I don't want them in the list. Theoretically I can use the where( ) filter to do this, but it seems like this most useful function is just not possible because...display qlocal(*) where(???? nl 'SYSTEM*') curdepth maxdepth...what do I put for ???? I've tried all sorts including the seemingly obvious 'queue' but nothing works. Am I stuck with separately processing the output (a chore at the best of times due to its horrid formatting) to rid myself of these?### Assistant: The command below might help. As you can't filter using the queue name in the 'where' parameter, the best solution would be to parse the output. The below command basically formats the mqsc object output to single lines and the egrep removes everything that starts with SYSTEM.echo \"dis ql(*) curdepth maxdepth\" | runmqsc QMNAME | sed 's/^[^ ].*$/%/g' | tr -s \" \" | tr -d \"\\n\" | tr \"%\" \"\\n\" | egrep -v \"^ QUEUE\\(SYSTEM\"\n"} +{"text": "### Human: I'm building a program which will start listening to an IBM queue. And for this I'm using the IBM.XMS.dll which came with the Websphere MQ Client installation for Windows. I'm asking myself, when I deploy this to acceptance or production, then probably I have to install the Websphere MQ Client also on that machine?And my other question is, do I have to reference the IBM.XMS.dll like this:C:\\Program Files\\IBM\\WebSphere MQ\\bin\\IBM.XMS.dll? I tried with just putting the IBM.XMS.dll in my build folder of my .NET solution but that doesn't work because the dll has dependencies to other dll's.EDITAfter looking at samples, I've seen that the samples written by IBM are referencing the dlls in the GAC. So I did the same.pressCtrl+RTypeC:\\WINDOWS\\assembly\\GAC_MSIL\\IBM.XMSPressEnterFind the IBM.XMS.dll and reference this one in your solution### Assistant: After looking at samples, I've seen that the samples written by IBM are referencing the dlls in the GAC. So I did the same.pressCtrl+RTypeC:\\WINDOWS\\assembly\\GAC_MSIL\\IBM.XMSPressEnterFind the IBM.XMS.dll and reference this one in your solution\n"} +{"text": "### Human: I've an issue with one of our applications. The application is a self-writen Java application that connects through JMS to more than 50 different message queues and consumes messages from those queues.From a functional perspective the processing of all messages from the different queues works fine. However while testing we found out that the processing of the different messages is far to slow. We are only able to process a few messages per queue per minute.To better understand what is going on I've made with JMC a flightrecording and saw that there is a lot of blocking time for each thread that consumes messages from a message queue:Picture: Blocking JMS threadsBeside this graph I saw also in the flight recording that a lot of time is spent with accesing a specific WeakHashMap to close and get and XAResource.Picture: Lock instancesThe next step what I did was analysing how the JMS bitronix configuration looks like. Here are the relevant parts:On the Tomcat server-level I've got the resource.properties file that is loaded by bitronix:resource.cf1.className=com.ibm.mq.jms.MQXAQueueConnectionFactory\nresource.cf1.uniqueName=jms/cf\nresource.cf1.minPoolSize=1\nresource.cf1.maxPoolSize=60\nresource.cf1.driverProperties.hostName=genadev0059.mycompnany.com\nresource.cf1.driverProperties.port=1515\nresource.cf1.driverProperties.channel=APPL_CHL\nresource.cf1.driverProperties.transportType=1\nresource.cf1.driverProperties.queueManager=DEVInside of Spring application XML I have the following bean definitions to settup the connection:\n\n\n\n \n\nAdditional to this one, I've for each message queue and own class that processes messages from this queue:\n \n \n \n \nI assume that the error is related to the way how the connection is configured. I tried different other approaches, but the result of the blocking threads is always the same.Any inputs or suggestions are highly welcomed.### Assistant: How many \"actual\" connections is there on the queue manager side? You should be using 1 connection per thread. If you share a connection between the threads then that is why you see the blocking.\n"} +{"text": "### Human: I am trying to implement Customer receiver for WSMQ data source in Spark streaming. I followed the example providedhere.Later I followed example atthis Github repository.I am getting three issues:1: Error (This error comes after the program runs for some time)java.net.ConnectException: Connection refused\n at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)\n at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)\n at org.apache.kafka.common.network.Selector.poll(Selector.java:238)\n at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:192)\n at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:191)\n at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:122)\n at java.lang.Thread.run(Thread.java:745)The program doesn't remove the messages from WSMQ even though I used this code while creating the sessionMQQueueSession qSession = (MQQueueSession) qCon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);I need to implement a reliableReceiverexplained at Custom Receiver Spark API. It says:To implement a reliable receiver, you have to use store(multiple-records) to store data. This flavour of store is a blocking call which returns only after all the given records have been stored inside Spark. If the receiver\u2019s configured storage level uses replication (enabled by default), then this call returns after replication has completed. Thus it ensures that the data is reliably stored, and the receiver can now acknowledge the source appropriately. This ensures that no data is caused when the receiver fails in the middle of replicating data \u2013 the buffered data will not be acknowledged and hence will be later resent by the source.I don't know what to do about store(multiple-records)?I can't figure out why these errors are happening and how I can implement a reliableReceiver.Here is the code:public class JavaConnector extends Receiver {\n\n String host = null;\n int port = -1;\n String qm=null;\n String qn=null;\n String channel=null;\n transient Gson gson=new Gson();\n transient MQQueueConnection qCon= null;\n String topic=null;\n\n Enumeration enumeration =null;\n private static MQQueueReceiver receiver = null;\n\n\n public JavaConnector(String host , int port, String qm, String channel, String qn) {\n super(StorageLevel.MEMORY_ONLY_2());\n this.host = host;\n this.port = port;\n this.qm=qm;\n this.qn=qn;\n this.channel=channel;\n\n\n }\n\n public void onStart() {\n // Start the thread that receives data over a connection\n new Thread() {\n @Override public void run() {\n try {\n initConnection();\n receive();\n }\n catch (JMSException ex)\n {\n ex.printStackTrace();\n }\n catch (Exception ex)\n {\n ex.printStackTrace();\n }\n }\n }.start();\n }\n\n public void onStop() {\n\n // There is nothing much to do as the thread calling receive()\n // is designed to stop by itself isStopped() returns false\n\n }\n\n /** Create a MQ connection and receive data until receiver is stopped */\n private void receive() throws InterruptedException {\n System.out.print(\"Started receiving messages from MQ\");\n\n\n try {\n\n JMSTextMessage receivedMessage= null;\n int cnt =0;\n\n //JMSTextMessage receivedMessage = (JMSTextMessage) receiver.receive(10000);\n\n boolean flag=false;\n while (!isStopped() && enumeration.hasMoreElements()&&cnt<50 )\n {\n\n receivedMessage= (JMSTextMessage) enumeration.nextElement();\n receivedMessage.acknowledge();\n String userInput = receivedMessage.getText();\n\n ArrayList list = new ArrayList();\n list.add(userInput);\n Iterator itr = list.iterator();\n store(itr);\n cnt++;\n\n }\n /*while (!isStopped() && receivedMessage !=null)\n {\n\n // receivedMessage= (JMSTextMessage) enumeration.nextElement();\n String userInput = receivedMessage.getText();\n\n store(userInput);\n receivedMessage.acknowledge();\n\n }*/\n\n // Restart in an attempt to connect again when server is active again\n //restart(\"Trying to connect again\");\n\n stop(\"No More Messages To read !\");\n qCon.close();\n System.out.println(\"Queue Connection is Closed\");\n\n }\n catch(Exception e)\n { Thread.sleep(100);\n System.out.println(\"WRONG\"+e.toString());\n e.printStackTrace();\n restart(\"Trying to connect again\");\n }\n catch(Throwable t) {\n Thread.sleep(100);\n System.out.println(\"WRONG-1\"+t.toString());\n // restart if there is any other error\n restart(\"Error receiving data\", t);\n }\n\n\n\n }\n\n public void initConnection() throws JMSException,InterruptedException {\n try {\n MQQueueConnectionFactory conFactory = new MQQueueConnectionFactory();\n conFactory.setHostName(host);\n conFactory.setPort(port);\n conFactory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);\n conFactory.setQueueManager(qm);\n conFactory.setChannel(channel);\n conFactory.setMsgBatchSize(100);\n\n\n qCon = (MQQueueConnection) conFactory.createQueueConnection();\n MQQueueSession qSession = (MQQueueSession) qCon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\n MQQueue queue = (MQQueue) qSession.createQueue(qn);\n MQQueueBrowser browser = (MQQueueBrowser) qSession.createBrowser(queue);\n qCon.start();\n //receiver = (MQQueueReceiver) qSession.createReceiver(queue);\n enumeration= browser.getEnumeration();\n\n\n } catch (Exception e) {\n Thread.sleep(1000);\n }\n }\n\n @Override\n public StorageLevel storageLevel() {\n return StorageLevel.MEMORY_ONLY_2();\n }### Assistant: Finally I was able to solve this.\nSolution 1: The steaming context tries to write into Kafka, since kafka was down and It was giving me IO error. That was foolish of me. :)Solution 2: I was supposed to use MessageListener, QueueBrowser is used for reading the messages it doesn't consume the message actually.\n"} +{"text": "### Human: I am using MQ PCF command in Java to create MQ queues and updating their parameters. Following is the code I am using.PCFMessageAgent agent = new PCFMessageAgent(queueManager);\nagent.setCheckResponses(false);\nPCFMessage[] responses;\nPCFMessage request = new PCFMessage(MQConstants.MQCMD_CHANGE_Q);\nresponses = agent.send(request);I am setting the following attributes on the requestMQCA_Q_NAME=TestTQ1\nMQIA_BACKOUT_THRESHOLD=0\nMQIA_MAX_MSG_LENGTH=4194304\nMQIA_MAX_Q_DEPTH=500\nMQIA_Q_TYPE=1and I get the following response\nCompletion Code = 2\nReason Code = 3014Documentation says that this is due toParameter identifier is not valid.\nThe MQCFIN or MQCFIN64 Parameter field value was not valid.The question is how do I know which parameter is incorrect?### Assistant: The first PCFMessage in responses should have one PCFParamter, which should be a MQCFIN, whose type is MQIACF_PARAMETER_ID and whose value will contain the ID of the attribute that the error is on.int errParamId = responses[0].getIntParameterValue(MQC.MQIACF_PARAMETER_ID);\n"} +{"text": "### Human: Hey so I have a queue of messages which need sequential processing. Now this processing involves calling a Web service (which might be down sometimes) so I have to make the message retrieval transactional. As far as I know, when there's any exception midway, the whole transaction rolls back and the message isn't lost right?But what's also needed is high availability on the message consumer, so I have two instances of the listener listening in on my queue. Now will the transaction ensure that a second message isn't retrieved by the other instance of the listener until the first one is completely done processing the first message? Or will I have to do something more to make sure that no message is sent out of the queue until the one before that is fully done processing.If any additional configuration is needed, would it be in the MQ or on the listener?I'm using websphere mq as the message broker and spring integration for retrieving the messages. Thanks for the help.EDIT:With the token thing the first concern would be high availability on the queue manager itself. The queue which holds this token has to be part of some queue manager. Now if we have a failover, that control queue will no longer be accessible. Which kinda means that that we need another control queue ready in case of a failover.We can't have listeners listening in on that DR control queue during normal operations though. (Let's say we have a mechanism to actually make sure that the \"data\" queue is perfectly replicated). The listener instances should know that a failover has initiated so that it can stop listening to the control queue during normal ops and switch over to the secondary. I can't do this using the listener instance alone. The actual producer which puts messages into the queue will have to notify the listener instances to stop listening to the normal ops control queue and switch over to the secondary. This would be kinda tricky if there's any intermediate connection problem (and the normal ops queue manager isn't really down) but that's too much of a corner case.With high availability of the control queue taken care of, we kinda have the same problem as the non sharable during low load scenarios. Now we have occasional spikes in load but there are slump periods. (During the night and stuff). This token system is not really reactive right? It's more of periodic thing. So let's say we don't get any messages for a few hours. The listeners will still be constantly checking the queue coz the token message keeps triggering one instance after another. Which more or less makes it a poller really. I might as well have multiple listener instances each polling at like different times of the hour right? It's not really event driven per se.Third would really be the question of inserting the token message. During first install or during a failback, we'll have that extra manual step of manually inserting this token (since the token would be lost in failover sometimes) . We can't really make one of the listener instances do it since if a listener instance doesn't find the message it kinda means that some other listener instance has the token. So this logic has to be separate. And if we actually put some meaningful info into this token message, it has to be a utility that has to be triggered rather than an insertion through the UI.I guess the first and third aren't really problems, but just extra overhead which wouldn't be needed if we went for a poller implementation. The second one is what's bothering me most.### Assistant: You need to be passing tokens. Here's how that works:First, create a second queue and place a single message into it. Now start up each program with the following logic.Get the token message off the token queue under syncpoint using an unlimited or long wait interval and theFAIL_IF_QUIESCINGoption.Put the token message back on the token queue in the same UOW.Get the next message off of the application queue under the same UOW.Process the application's message normally.Commit the UOW.You can use as many app instances as you want. You will see one input handle on each of the two queues for each app instance. No app instance will have to handle errors due to exclusive use of a queue.Since there is only one token message and only one app can hold it under syncpoint at a time, only one of the apps can be actively processing an application message. Since theGEToff the app queue is dependent on a successfulGEToff the token queue, all application messages are processed in strict sequence.Note: The app will process the application messages with as many concurrent threads as there are token messages on the token queue. If anyone ever adds another token message to the token queue, strict sequence processing is lost. For this reason read/write access to that queue must NOT be granted to anyone other than the app service account. Also, it is common for that token message to be structured so that the app can recognize it. If a stray unrelated message lands there the app should ignore it and throw a warning.You will see a fairly even distribution of messages between the two apps. If you use more than two apps you might see a wildlyuneven distribution because queue handles are managed in a stack. As an instance commits its UOW the next instance's handle is at the top of the stack so it gets the next message. While it is handling that message the instance that just committed will have it'sGETplaced on top of the stack. If you have 3 or more listening instances chances are only the first two will see any traffic.This assures that messages are processed off the queue one at a time. It doesnotassure that you won't get dupes.If you do everything under syncpoint, no messages will ever be lost. However there's a scenario in which a message is retrieved and processed, then theCOMMITcall fails. In that case the transaction is rolled back and the same message becomes available again. If you are using 1-phase commits and not XA the processing for that message will not be rolled back.The nice thing is that the token message will be under syncpoint too and that fixes the issue in which an orphaned client channel takes a while to release the transaction. A new connection will get messages which are older than the message held under syncpoint by the orphan transaction. Eventually the channel agent times out releasing the message back to the queue but effectively changing its position to bebehindany messages that were processed while it was sequestered.In this scenario the token message is also sequestered so after this type of connection loss message processing temporarily stops and waits for the channel agent to time out. If that were ever to happen, just issue aSTOP CHANNELcommand on the instance with the UOW.Update based on additional question details specific to this answerThe queue which holds this token has to be part of some queue manager.\n Now if we have a failover, that control queue will no longer be\n accessible. Which kinda means that that we need another control queue\n ready in case of a failover.The token queue is as available or as unavailable as the application queue. Only one is needed. If the app requires HA then a Multi-Instance QMgr or a hardware HA cluster should be used. These share disk so the QMgr that comes up in the failover is the same one the app has been connected to, just at a different physical location.If the app needs DR it's possible to replicate the disk under the QMgr's logs and data directories to a DR site. However, nothing should be listening on those instances while processing is going on in the primary data center.The listener instances should know that a failover has initiated so\n that it can stop listening to the control queue during normal ops and\n switch over to the secondary. I can't do this using the listener\n instance alone.Why not? WMQ has had reconnectable clients for a really long time and the multi-instance features in v7.0.1 made reconnecting drop-dead simple. As an admin your job is to make sure that no more than one instance of the app and token (not trigger!) queue are available. During an outage, the client goes into retry without requiring any application code to drive it. It finds whichever of the instances is up and connects.The actual producer which puts messages into the queue will have to\n notify the listener instances to stop listening to the normal ops\n control queue and switch over to the secondary.The question was about serialization with concurrent consumers. This is about a design in which producers and consumers have to rendezvous at a common location. Different problem that happens to overlap this one only in that it is complicated somewhat by serialization. Ask a different question if you need to explore topologies.This token system is not really\n reactive right? It's more of periodic thing. So let's say we don't get\n any messages for a few hours. The listeners will still be constantly\n checking the queue coz the token message keeps triggering one instance\n after another.This does not use triggering. It uses a token (not trigger!) message the way a filesystem or database uses a lock in order to facilitate serialization. Whichever listener gets the token message then does a get with unlimited wait on the application queue. The other listeners have a get with unlimited wait on the token (not trigger!) queue. Basically, they sit around idle until a message arrives. Zero reconnections, zero polls, zero CPU cycles. If you need to know they are alive, let them time out on the application queue once in a while. This rolls back their UOW on the token queue which passes the token to another listener.Third would really be the question of inserting the token message.\n During first install or during a failback, we'll have that extra\n manual step of manually inserting this token (since the token would be\n lost in failover sometimes).Why? Do you experience MQ losing persistent messages under syncpoint often? If so you are doing it wrong. ;-) In a situation with strict serialization requirements there can be only one active instance of a queue. If for some reason there are other instances of the application queue pre-defined other than through disk replication there would be one instance of the token (not trigger!) queue also predefined alongside it and one token (not trigger!) message waiting in each queue. Surely nobody would do such a thing in the face of strict message order requirements, but if they did those queues would surely be get-disabled while not in use.We can't really make one of the listener\n instances do it since if a listener instance doesn't find the message\n it kinda means that some other listener instance has the token.Correct. The listenerscouldcheck queue depth, transactions, input handles, etc, but it is generally wise to avoid mixing application logic with control logic.So\n this logic has to be separate. And if we actually put some meaningful\n info into this token message, it has to be a utility that has to be\n triggered rather than an insertion through the UI.Why? Your coders handle structured data in app messages, right? If this is perceived to be significantly more difficult, someone's doing it wrong. ;-) Write an instance of a formatted token (not trigger!) message to a queue, then offload that to a file. When you need to reinitialize the queue, use Q or QLoad to first clear the queue, then load the file into it.Thatutility would be the one to open the queue for exclusive use, check for depth, check for handles, etc. prior to performing its magic. When I do this for consulting clients I typically define a service that initializes the queue on MQ startupandalso provide a feature in the application GUI for the operations and support staff. So long as the app managing the token (not trigger) queue gets it for exclusive access during these operations it really doesn't matter how it's done or by how many instances of the control app.As a rule I also use the structure in the message to send commands to the listeners. There's the real token message, and then there's messages that command the app instances to do things. For example, it's really nice to have a non-transactional \"ping\" capability. I if I drop more ping messages on the token (not trigger!) queue in a single UOW than I have app instances listening, I am guaranteed to contact all of them. In this way I can detect zombies. Depending on how much instrumentation is required the listeners can react to the ping by providing a status (uptime, messages processed, etc.) in the log, to the console, to an event queue, etc.I guess the first and third aren't really problems, but just extra\n overhead which wouldn't be needed if we went for a poller\n implementation.That's good because this is all pretty standard stuff. The problem lies mainly with the requirements for serialization conflicting with those for HA/DR. What you are looking for is global transactional atomicity to implement a single logical queue across multiple physical locations. IBM MQ has never attempted to provide that, although the WAS Messaging Engine has. The closest MQ comes is to use two MQ appliances with memory-to-memory replication of message and transaction data but that is good to only a few miles before light-speed latency begins to significantly impact throughput. It doesn't handle your DR needs. In fact,nothingshort of synchronous replication does that if you want a zero recovery point at the DR datacenter.\n"} +{"text": "### Human: I need PyMQI on my windows 86x. \nI try to build setup.py with msvc as compiler \nBut when i try to do it I get the following errors:C:\\Python27\\Lib\\pymqi-1.5.4>python setup.py build client\nBuilding PyMQI client 32bits\nrunning build\nrunning build_py\nrunning build_ext\nbuilding 'pymqi.pymqe' extension\nC:\\Users\\Admin\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe /c /nologo /Ox /MD\n /W3 /GS- /DNDEBUG -DPYQMI_SERVERBUILD=0 \"-Ic:\\Program Files\\IBM\\WebSphere MQ\\tools\\c\\include\" -IC:\\Python27\\include -IC\n:\\Python27\\PC /Tcpymqi/pymqe.c /Fobuild\\temp.win32-2.7\\Release\\pymqi/pymqe.obj\npymqe.c\npymqi/pymqe.c(240) : error C2275: 'MQCSP' : illegal use of this type as an expression\n c:\\Program Files\\IBM\\WebSphere MQ\\tools\\c\\include\\cmqc.h(4001) : see declaration of 'MQCSP'\npymqi/pymqe.c(240) : error C2146: syntax error : missing ';' before identifier 'csp'\npymqi/pymqe.c(240) : error C2065: 'csp' : undeclared identifier\npymqi/pymqe.c(240) : error C2059: syntax error : '{'\npymqi/pymqe.c(247) : error C2065: 'csp' : undeclared identifier\npymqi/pymqe.c(247) : error C2224: left of '.AuthenticationType' must have struct/union type\npymqi/pymqe.c(248) : error C2065: 'csp' : undeclared identifier\npymqi/pymqe.c(248) : error C2224: left of '.CSPUserIdPtr' must have struct/union type\npymqi/pymqe.c(249) : error C2065: 'csp' : undeclared identifier\npymqi/pymqe.c(249) : error C2224: left of '.CSPUserIdLength' must have struct/union type\npymqi/pymqe.c(250) : error C2065: 'csp' : undeclared identifier\npymqi/pymqe.c(250) : error C2224: left of '.CSPPasswordPtr' must have struct/union type\npymqi/pymqe.c(251) : error C2065: 'csp' : undeclared identifier\npymqi/pymqe.c(251) : error C2224: left of '.CSPPasswordLength' must have struct/union type\npymqi/pymqe.c(256) : error C2065: 'csp' : undeclared identifier\npymqi/pymqe.c(256) : warning C4133: '=' : incompatible types - from 'int *' to 'PMQCSP'\nerror: command 'C:\\\\Users\\\\Admin\\\\AppData\\\\Local\\\\Programs\\\\Common\\\\Microsoft\\\\Visual C++ for Python\\\\9.0\\\\VC\\\\Bi\nn\\\\cl.exe' failed with exit status 2### Assistant: There is a solution on this page:https://github.com/dsuch/pymqi/issues/35First inpymqi/pymqe.cfile the declaration lineMQCSP csp = {MQCSP_DEFAULT};should be moved to the beginning of methodpymqe_MQCONNX, right after:PyObject* user_password = NULL;After doing this the build and installation succeed butimport pymqigives an error:ImportError: No module named pymqeThis can be fixed by copyingpymqe.pydfrom the path\\pymqi-1.5.4\\build\\lib.win32-2.7\\pymqi, topymqi-1.5.4\\pymqi\n"} +{"text": "### Human: I'm trying to configureHermesJMS v1.14withWebSphereMQ v8.0, but I can not. I've seen several tutorials, and I've followed them, although none were exactly these versions.This is what I've done. I've downloaded this trial versionMQ V8.0 Trial for Multiplatform Multilingual eAssembly. I've installed it following these instructionshttp://www-01.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.ins.doc/q008640_.htm?lang=en.Then, I open HermesJMS and set the provider like first part of demo_mq.html (outdated link removed), but the libraries are:com.ibm.mq.commonservices.jarcom.ibm.mq.jarcom.ibm.mqjms.jarcom.ibm.mq.pcf.jarThen I click onScan, this is important, because this step is supposed to load all the classes of the jars, which we have to use later.Then I create the session, using the Loader I've just configured and, when you change the Loader, the combo with the Classes should refresh with the Connection Factories, in particular I have to usecom.ibm.mq.jms.MQQueueConnectionFactory, but it doesn't appear, seems like the previous step of scanning doesn't work.I've looked into the jars, and I know the classMQQueueConnectionFactoryis insidecom.ibm.mq.jar.So, is there any step I forgot? Do I need other libraries?Don't hesitate to ask for more information.Thanks in advance.UPDATE:Adding more information based on T.Rob answerYou didn't mention having applied the Fix Pack. There are a number of Java fixes in 8.0.0.1-3 that might make your setup more interesting and which you'd want to avoid.Yes, I used it, I forgot mention that, sorry.The same page also explains that the setmqjmsenv program can be used to set up the environmentI didn't mention this, I usedsetmqenvto configurePATHenvironment variable.SOLUTION to this 1st problem:I already solved it, but I think there is no \"procedure\" to do that, I found this in this webhttp://talksoa.blogspot.com.es/2013/12/configure-hermes-jms-to-connect.htmlWait, found a solution. You must first select the classpath group name, in the case above its WMQ7, from the drop down in the middle pane next to the 'Loader:' Then go back up to the first pane and select IBM WebSphereMQ under pluginI did something like this and voila! The class appears. Now I'm trying to configure the properties:Plug In: IBM WebSphereMQConnection Factory: Class -> com.ibm.mq.jms.MQQueueConnectionFactoryProperty: hostName ->Property: port -> (I had to change the default port 1414)Property: queueManager -> MY.QUEUE.MANAGERProperty: transportType -> 1And, when I doRight button->DiscoverI get the following error:ERROR hermes.browser.tasks.HermesBrowserTaskListener - MQJE001: Completion Code '2', Reason '2035'.I've looking for this error and it seems to be an authority error, so I've done:setmqaut -m MY.QUEUE.MANAGER -t qmgr -g +allmyUseris a user which I added tomqmgroup.Hope you can help me.Thanks.### Assistant: Then, I open HermesJMS and set the provider like first part ofhttp://www.hermesjms.com/demos/demo_mq.html, but the libraries are...You might want to try using IBM's specification for theCLASSPATHas found in the same documentation manual that you linked above. Their pageEnvironment variables used by IBM MQ classes for JMSexplains that you need only include one jar in theCLASSPATHand the manifest pulls in the others.The same page also explains that thesetmqjmsenvprogram can be used to set up the environment. You can run that, then capture the environment variable settings and arrange for Hermes to inherit them through explicit settings or through the service ID used to launch it.Also, be sure to use the IBM-provided tools to validate that the client has been properly installed and that you can connect to MQ using a known-good piece of software. It would be unfortunate to struggle away with Hermes for a week only to find out the MQ listener is on a different port or that you spelled the channel name wrong.You didn't mention having applied the Fix Pack. There are a number of Java fixes in 8.0.0.1-3 that might make your setup more interesting and which you'd want to avoid.I've downloaded this trial versionMQ V8.0 Trial for Multiplatform Multilingual eAssembly...If you go to thewebsphere-mqtag wiki, you will find links to MQ Advanced for Developers. It's a full-function, non-expiring, version of MQ you can have for free. The trial download will eventually expire. Hopefully not before you get Hermes talking to it, but it will expire and usually at the most inopportune moment.There too will be some links to the Fix Packs, but you can also easily (yes, that's debatable) find these by going to IBM Fix Central and searching.\n"} +{"text": "### Human: My requirement is to read a csv and send multiple xml messages to IBM mq.The xmls created from csv are to be sent in a single batch or transaction.\nReason being the system reading these messages is not idempotent, and in case some xml messages are sent across and the remaining fail. I need to persist the failed xml messages for manual re-processing.Would be great if someone can point me a feature where multiple xml messages can be en-queued as a single batch.### Assistant: You seem to have conflicting requirements.Sending the messages in a batch is easy. You put them all under syncpoint, then issueCOMMIT. As long as there are not more messages than the queue depth or transaction UOW limits can hold, you are fine.Receiving them in a batch is another matter altogether. IBM MQ has message grouping and theBIND_ON_OPENparameter to make sure all affiliated messages go to the same place and can be accounted for.So far, this is all easy and based on options in the basic MQ API or JMS API. The greater issue I see is the statement that \"the system reading these messages is not idempotent\" which is a fancy way of saying that it does not detect and gracefully handle dupe messages. That's kind of a problem with any async messaging transport unless XA is used. It must either gracefully handle dupe messages or use a transaction coordinator to ensure there are no dupe messages. I'll assume for the moment that you are using 2-phase commit so this requirement is being met.The other potential issue arises from \"I need to persist the failed xml messages for manual re-processing.\" Not sure what \"manual reprocessing\" means here. IBM MQ will persist the messages, just mark it as such when youPUTit on the queue. When the QMgr is restored the messages will be delivered. However this statement seems to hint at a High Availability or Disaster Recovery requirement such that the messages are replicated.So the short answer is to choose persistence as message property when putting the message and to do so under 2-phase commit.The longer answer depends on what the references to idempotence and recovery actually allude to. If there are requirements here you'll need to add detail to the question.\n"} +{"text": "### Human: Hello i am new to IBM WebSphere MQ File Transfer Edition and i have this question:First i need to explain the situation: I have an Agent declared and i want to create a Transfer to run every minute in a folder, and it will delete the source file.I want to know what happen when a transference is running and another minute pass. Will the Agent start a new Transference? If it creates a new , will it try to send again the files that are in the first Transference if they are still in the folder? or the Agent is going to wait until it finish the first transference and start the new one?Thanks for your help in advance!### Assistant: [\nUPDATED/CORRECTION:\n- Previously I stated that a scheduled transfer will not wait before starting a new instance, however this is incorrect. Testing I have performed has shown that a scheduled transfer will indeed not start a new instance of the transfer if a previously instance has not completed. Sorry for any confusion!\n]If you are using a \"scheduled transfer\":http://pic.dhe.ibm.com/infocenter/wmqfte/v7r0/topic/com.ibm.wmqfte.doc/create_schedule.htmthen the scheduled transfer willnotstart a new instance if a previous instance (transfer started by the scheduler) is already running. In this case, the WebSphere MQ FTE agent will instead publish a \"skipped\" audit message to the SYSTEM.FTE/LOG/ topic with the supplement:A previous instance of a repeating scheduled transfer (id:###...) is still running.However, I suggest you also look at Resource Monitoring as an alternative approach to scheduled transfers as it is a much more powerful feature.Read the following section of the WebSphere MQ FTE Infocenter about the topic and it should give you plenty of information to get going and try it out yourself:http://pic.dhe.ibm.com/infocenter/wmqfte/v7r0/topic/com.ibm.wmqfte.doc/resource_monitoring.htmI hope this helps you!\n"} +{"text": "### Human: I saw lots of examples likehttp://hursleyonwmq.wordpress.com/2007/05/29/simplest-sample-applications-using-websphere-mq-jms/, even on IBM publib. As I guess this code had a flaw: Queue connection closed in main block, and not infinallyas I expected.What is the right way to close MQ connection without leaks?### Assistant: I think it is better to do it in finally.\ni.e.finally\n{\n try\n {\n session.close();\n }\n catch (Exception ex)\n {\n System.err.println(\"session.close() : \" + ex.getLocalizedMessage());\n }\n\n try\n {\n connection.close();\n }\n catch (Exception ex)\n {\n System.err.println(\"connection.close() : \" + ex.getLocalizedMessage());\n }\n}\n"} +{"text": "### Human: I have a problem when i try to get message with put date/time beetween two dates (beginDate and endDate). Here is my query receiveSelected(\"JMSTimestamp BETWEEN \" + pBeginDate + \"AND \" + pEndDate). A message is in the queue and the timestamp is between the two values passed in argument. But nothing is returned by the query### Assistant: I've tried on a recent WMQ version and this works correctly; I've output the 10 messages, the timestamp and the message id. Then only got some of the messages.The correct ones are returned: have you confirmed the message is committed? and visible?You do mention 'date' - is the selector in the correct format..------------------------------------------------------------------------\n0:1389200177672 ID:414d5120514d5f76385f62696c626f20ff30cd5220008002\n1:1389200178874 ID:414d5120514d5f76385f62696c626f20ff30cd5220008003\n2:1389200180076 ID:414d5120514d5f76385f62696c626f20ff30cd5220008004\n3:1389200181277 ID:414d5120514d5f76385f62696c626f20ff30cd5220008005\n4:1389200182477 ID:414d5120514d5f76385f62696c626f20ff30cd5220008006\n5:1389200183677 ID:414d5120514d5f76385f62696c626f20ff30cd5220008007\n6:1389200184877 ID:414d5120514d5f76385f62696c626f20ff30cd5220008008\n7:1389200186078 ID:414d5120514d5f76385f62696c626f20ff30cd5220008009\n8:1389200187279 ID:414d5120514d5f76385f62696c626f20ff30cd522000800a\n9:1389200188479 ID:414d5120514d5f76385f62696c626f20ff30cd522000800b\n-------------------------------------------------------------------------------\nReceiving....\nSelector is : JMSTimestamp BETWEEN 1389200181277 AND 1389200186078\n--------------------------------\n1389200181277 ID:414d5120514d5f76385f62696c626f20ff30cd5220008005\n--------------------------------\n1389200182477 ID:414d5120514d5f76385f62696c626f20ff30cd5220008006\n--------------------------------\n1389200183677 ID:414d5120514d5f76385f62696c626f20ff30cd5220008007\n--------------------------------\n1389200184877 ID:414d5120514d5f76385f62696c626f20ff30cd5220008008\n--------------------------------\n1389200186078 ID:414d5120514d5f76385f62696c626f20ff30cd5220008009\n--------------------------------\n"} +{"text": "### Human: I am working on a Notification Service using IBM MQ messaging provider with JBoss eap 6.1 environment. I am successfully able to send messages via MQ JCA provider rar i.e. wmq.jmsra.rar file. However on consumer part my current configuration looks like this@MessageDriven( \n activationConfig = { \n @ActivationConfigProperty(propertyName=\"destinationType\", propertyValue=\"javax.jms.Queue\"), \n @ActivationConfigProperty(propertyName=\"destination\", propertyValue=\"F2.QUEUE\"),\n @ActivationConfigProperty(propertyName=\"providerAdapterJNDI\", propertyValue=\"java:jboss/jms/TopicFactory\"),\n @ActivationConfigProperty(propertyName=\"queueManager\", propertyValue=\"TOPIC.MANAGER\"),\n @ActivationConfigProperty(propertyName=\"hostName\", propertyValue=\"10.239.217.242\"),\n @ActivationConfigProperty(propertyName=\"userName\", propertyValue=\"root\"),\n @ActivationConfigProperty(propertyName = \"channel\", propertyValue = \"TOPIC.CHANNEL\"),\n @ActivationConfigProperty(propertyName = \"port\", propertyValue = \"1422\") \n\n })My problem is that consumer of this service does not want to add any port numbers, hostName, queueManager properties in these beans. Also they do not want to use ejb-jar.xml to externalize these configs. I have researched and found that we can add a domain IBM Message Driven Bean but with no success. Any suggestions on what I can do here to externalize all these configurations ?EDIT: Adding --> The JCA resource adapter is deployed at consumer end if it makes it any easier.Thanks### Assistant: You can actually externalize an MDBs activation spec properties to the server configuration file.Create the ejb-jar.xml file, but do not put the actual value in the file, use a property placeholder:\n hostName\n ${wmq.host}\nDo this for all of the desired properties.Ensure that property replacement for Java EE spec files (ejb-jar.xml, in this case) is enabled in the server configuration file:\n trueThen, in the server configuration file, provide values for your properties:\n Once your MDBs are packaged, you will not need to change any of the files in the MDB jar - just provide the properties in the server configuration.\n"} +{"text": "### Human: Following on from aprior questionwe have discovered some behaviour which I cannot understand with MQ channels.At startup, we issue the following commands:STRSBS SBSD(QMQM/QMQM)\nSTRMQM MQMNAME(IA001.QUEUE.MANAGER)\nSTRMQMCSVR MQMNAME(IA001.QUEUE.MANAGER)\nSTRMQMLSR MQMNAME(IA001.QUEUE.MANAGER)\nDLYJOB DLY(300)\nSTRMQMMQSC SRCMBR(IA1_RESTRT) SRCFILE(MQSCRIPTS/MQSETUP) MQMNAME(IA001.QUEUE.MANAGER)The script run at the end contains a series of channel start commands. Periodically we get an error in this step with a channel 'in use' and when investigating we find the channel is running.The delay shown above was recently introduced as we thought the various pieces might need time to start properly before the channels were started, however this uncovered something curious in that we encountered the 'in use' error with three channels.It seems that, given time, the channels are starting themselves. But I cannot figure out how or why? I'm not 100% familiar with channel initiation but from what I can learn from the documentation we do not have it set up \u2013 I scanned a configuration dump and found no entries of INITQ( ) with anything other than blanks.What is starting our channels? I cannot replicate this behaviour on our test system at all.### Assistant: If a channel was previously in RETRYING status before the queue manager last ended, this state is remembered over the restart and your channel will be out back into RETRYING upon queue manager restart, and may then successfully connect.\n"} +{"text": "### Human: In the followingJBoss/HornetQ user manual pageyou can see how HornetQ provides a mechanism for streaming data to a Message for a Queue using a java.io.InputStream. A JMS version of the same code is given. Has anyone come across an equivalent using IBM MQSeries / WebsphereMQ?Say I have a large amount of data to place in the JMS Message which to me is just a stream of bytes. In the Hornet example, the stream is only read when the message is sent, so if it is, say a FileInputStream, then we only need enough memory to buffer a chunk of the bytes. I can use a javax.jms.BytesMessage to send in chunks of bytes and use the BytesMessage to buffer them. The problem with this is that the IBM implementation of BytesMessage (com.ibm.msg.client.jms.internal.JmsBytesMessageImpl) has to cache them until the Message is sent and if that is a large amount of data it is a problem. Worse it appears that although I am only sending bytes, the IBM implementation appears to keep duplicate copies, one in a BytesArrayOutputStream the other in a DataOutputStream.### Assistant: In WebSphere MQ the closest thing to what you describe is areference message. The method described in the Infocenter requires custom programming of channel exits to grab the filesystem object and put it into a message before it is transmitted over the channel. A complementary exit on the remote side saves the payload to a file and puts a reference to the file in the message that is returned to the app.We also have programs in WMQ that take STDIN or a pipe at one end and put messages to a queue on the other end. A pair of these can act as a pipe through which line-oriented ASCII data flows between processes on separate machines. However, there's no JMS implementation of this and it doesn't work too well for binary data.\n"} +{"text": "### Human: I am importing a Jar file \"com.ibm.mq.jar\" into my workspace(Eclipse IDE).\nWhile importing, a screen came where I could see all the classes in the Jar file.After I imported it into the work space, I was able to import the package and following statement didn't give any error.import com.ibm.mq.*;But, in code I am not able to use any of the classes which were there in the package.\nLike, \"MQC\" is a class in the package, but in code it doesn't reflect(\"MQC cannot be resolved as a type\" error comes if I try to use it).This jar file actually contains Websphere MQ API classes.Can anyone advise, what am I missing.### Assistant: If you're using MQ 7, check its documentationhere. There was some stuff going on about deprecation ofcom.ibm.mq.mqcand, depending on the version you use, that class was replaced bycom.ibm.mq.constants.MQConstants. Like this one, there are other cases.In factcom.ibm.mqonly contains the exceptionMQException, so you won't find any classes there. I suggest you check the version you're using and dig a little deeper into the docs, as a first step.\n"} +{"text": "### Human: My application receives MQTT messages via JMS on a Websphere AS. The MQTT endpoint is a Websphere MQ.Is there any way to identify the sender of the message (the sending device, not Websphere MQ ;-) )? I could not find a matching field in the jms message header...### Assistant: When creating the MQTT channel there are options to use either the MQTT Client ID or the Username for authorization checks. If the channel is configured to use JAAS and the option to use the Username is selected, IbelievetheMQMD.UserIDinherits the Username. I don't have JAAS authentication configured but when I get some time later I'll test it and update.I was able to test the option that uses the ClientID for authorization and it doesnotresult in the client ID ending up in theMQMD.UserIDfield.Since identity propagation is a common requirement, I'd suggest raising aRequest For Enhancement(RFE) stating that either Client ID or Username should propagate to theMQMD.UserID, depending onthe channel setting.\n"} +{"text": "### Human: getting below error after i configure MQ connection factory.java.lang.ClassCastException: com.ibm.ejs.jms.JMSQueueConnectionFactoryHandle incompatible with com.ibm.mq.jms.MQQueueConnectionFactorymy code snippet where the exception is pointing to :String queueConnectionJndi = props.getProperty(queueConnection + MQ_CONN);\n queueConnectionFactory = MQQueueConnectionFactory)initialContext.lookup(queueConnectionJndi);I am not able to find out the root cause of this.can any body please help me on this, Thanks in advance.### Assistant: There is no way to be sure without more context, but it looks like this method call:initialContext.lookup(queueConnectionJndi);is returning an object of type com.ibm.ejs.jms.JMSQueueConnectionFactoryHandle which cannot be cast to com.ibm.mq.jms.MQQueueConnectionFactory.Can you provide more context?\n"} +{"text": "### Human: I see a bunch of errors that looks likeAMQ8077: Entity 'tcs-mq-user ' has insufficient authority to access object 'SYSTEM.INTERNAL.REPLY.QUEUE'on the mq error logs whenever I access the queue objects via MQ Explorer. This is repeated for many system objects such as....SYSTEM.MQEXPLORER.REPLY.MODEL SYSTEM.ADMIN.COMMAND.QUEUE\n SYSTEM.SELECTION.VALIDATION.QUEUE SYSTEM.DEFAULT.MODEL.QUEUE\n SYSTEM.RETAINED.PUB.QUEUE SYSTEM.PENDING.DATA.QUEUE\n SYSTEM.NDURABLE.MODEL.QUEUE SYSTEM.MQSC.REPLY.QUEUE\n SYSTEM.JMS.TEMPQ.MODEL SYSTEM.INTERNAL.REPLY.QUEUE\n SYSTEM.INTER.QMGR.PUBS SYSTEM.INTER.QMGR.FANREQ\n SYSTEM.INTER.QMGR.CONTROL SYSTEM.HIERARCHY.STATE\n SYSTEM.DURABLE.SUBSCRIBER.QUEUE SYSTEM.DURABLE.MODEL.QUEUE\n SYSTEM.DOTNET.XARECOVERY.QUEUE SYSTEM.DEFAULT.REMOTE.QUEUE\n SYSTEM.DEFAULT.MODEL.QUEUE SYSTEM.DEFAULT.LOCAL.QUEUE\n SYSTEM.DEFAULT.INITIATION.QUEUE SYSTEM.DEFAULT.ALIAS.QUEUE\n SYSTEM.DEAD.LETTER.QUEUE SYSTEM.CLUSTER.TRANSMIT.QUEUE\n SYSTEM.CLUSTER.REPOSITORY.QUEUE SYSTEM.CLUSTER.REPOSITORY.QUEUE\n SYSTEM.CLUSTER.HISTORY.QUEUE SYSTEM.CLUSTER.COMMAND.QUEUE\n SYSTEM.CICS.INITIATION.QUEUE SYSTEM.CICS.INITIATION.QUEUEHow do I get rid of these?### Assistant: When WMQ Explorer paints the queues screen, it needs to enumerate all the queues and does so by issuing the command server equivalent ofDIS Q(*)as a PCF command. The results of that command are returned on a per-queue basis so each queue the user has access to display returnsMQCC=0whereas each queue the user has no access to display returnsMQCC=2, MQRC=2035. Since it does this for each queue hat is defined, you will need to authorizetcs-mq-userto at least display all queues.Sincetcs-useris in themq-usergroup (based on notes in previous postings) then do this:SET AUTHREC PROFILE('**') GROUP('mq-users') OBJTYPE(QUEUE) AUTHADD(DSP)Note that you needtwoasterisks in the profile name because WMQ recognizes dot characters as node separators. For example, using a profile ofSYSTEM*would match a queue namedSYSTEM_QUEUEbut not one namedSYSTEM.QUEUEbecause the single asterisk wildcard matches only a single node in the name. A two-asterisk wildcard likeSYSTEM**would match both names. To match allSYSTEMqueues, you usually would use the patternSYSTEM.**, including the dot and both asterisks. That way the pattern excludes user-defined names likeSYSTEMICbut matches all the default object names. To match all queues, just use the pattern**as shown in the command example above.You will also get many of the same errors on the other objects. To get around all of these in one step, first apply the base authorizations as explained in the post onViewing Channels in WebSphere MQ Explorer. That gives the ability to display and/or inquire on all objects, then you can add more specific profiles to allow put, get, browse, etc. on just the objects wheremq-userrequires more access.You may also want to have a look at theWebSphere MQ Security HeatsUp article on developerWorks for more background and setmqaut commands.\n"} +{"text": "### Human: I think I tried to start a channel that is already running or whatever. Whenever I start the sender channel, the receiver channel goes to a PAUSED state.I looked it upand found something about AdoptNewMCA configuration, not sure how to set it at the queue manager level. How do I fix this smoothly. Merely stopping and restarting the channels does not do it.Error log says:/02/2012 12:38:41 PM - Process(19161.269) User(mqm) Program(amqrmppa)\n Host() Installation(Installation1)\n VRMF(7.1.0.0) QMgr(QM_TEST2)\n\nAMQ9514: Channel 'QM_TEST1.TO.QM_TEST2' is in use.\n\nEXPLANATION: The requested operation failed because channel\n''QM_TEST1.TO.QM_TEST2' is currently active. ACTION: Either end the channel\nmanually, or wait for it to close, and retry the operation.\n----- amqrcsia.c : 1042 ------------------------------------------------------- \n08/02/2012 12:38:41 PM - Process(19161.269) User(mqm) Program(amqrmppa)\n Host(...) Installation(Installation1)\n VRMF(7.1.0.0) QMgr(QM_TEST2)\n\nAMQ9999: Channel ''QM_TEST1.TO.QM_TEST2' to host '17.2.33.44' ended abnormally.\n\nEXPLANATION: The channel program running under process ID 19161 for\nchannel ''QM_TEST1.TO.QM_TEST2' ended abnormally. The host name is\n'17.2.33.44'; in some cases the host name cannot be\ndetermined and so is shown as '????'. ACTION: Look at previous error\nmessages for the channel program in the error logs to determine the\ncause of the failure. Note that this message can be excluded\ncompletely or suppressed by tuning the \"ExcludeMessage\" or\n\"SuppressMessage\" attributes under the \"QMErrorLog\" stanza in qm.ini.\nFurther information can be found in the System Administration Guide.\n----- amqrmrsa.c : 887 --------------------------------------------------------### Assistant: When looking these things up, I'd start first with the product manuals. In this case, the Infocenter topic on channel statessays thata channel in PAUSED state is waiting on a retry interval. Thesub-topic on channel errorsexplains why sending or receiving channels can be in retry:If a channel is unable to put a message to the target queue because\n that queue is full or put inhibited, the channel can retry the\n operation a number of times (specified in the message-retry count\n attribute) at a time interval (specified in the message-retry interval\n attribute). Alternatively, you can write your own message-retry exit\n that determines which circumstances cause a retry, and the number of\n attempts made. The channel goes to PAUSED state while waiting for the\n message-retry interval to finish.So if you stop your channels, you should see a message in the XMitQ on the sending side. If you GET-enable that queue you can browse the message, look at the header and see which queue it is destined for. On the receiving side, look to see if that queue is full.Classic fast-sender, slow-consumer problem here. If the consumer can't keep up, the messages back up on the receiving QMgr, then the channel goes to retry and they begin to back up on the sending QMgr. Got to monitor depth and input handles on request queues.\n"} +{"text": "### Human: I want to write ascriptfile that will append the arrived MQ messages in the Queue Manager in a log file.Please help### Assistant: If you want all messages arriving on a channel, you can use the LogIP exit from the BlockIP2 page ofmrmq.dk. An API exit such asSupportPac MA0Wcan log all messages put. An API exit can catche messages from local applications as well as those arriving over channels.If you want to script this, you can use a program such as Q (fromSupportPac MA01) to remove the messages from the queue as they arrive and append them to a file.For example,#!/usr/bin/ksh\n\nq -IMYQMGR/MY.QUEUE >> logfile.txtTypically, the script is triggered and configured to append new messages to the file. The problem with this is that it destructively removes the messages. If there is an application of record needing to use those messages it isn't a great solution. You could browse the queue but there's no guarantee of getting the messages before the app of record gets them - and the browse would periodically restart at the head of the queue so you might log the same message twice.Another scripting option is thePerl MQSeriesmodule. This module exposes all the options of the WMQ API as well as object-oriented methods. If you need something quick and dirty, the Q program is delivered as an executable. If you want something powerful that exposes all the APIs to your script (and don't mind compiling it) the Perl MQSeries module is a great way to go. Here's a code snippet, taken from the module's samples, showing how to GET messages:while (1) {\n $sync_flag = 0;\n undef $outcome;\n my $request_msg = MQSeries::Message::->new();\n my $status = $request_queue->\n Get('Message' => $request_msg,\n 'GetMsgOpts' =>\n {\n 'WaitInterval' => 5000, # 5 seconds\n 'Options' => (MQSeries::MQGMO_WAIT |\n MQSeries::MQGMO_SYNCPOINT_IF_PERSISTENT |\n MQSeries::MQGMO_CONVERT |\n MQSeries::MQGMO_FAIL_IF_QUIESCING),\n },\n );\n unless ($status) { # Error\n my $rc = $request_queue->Reason();\n die \"Error on 'Get' from queue $qmgr_name/$request_qname:\\n\" .\n \"\\tReason: $rc (\" . MQReasonToText($rc). \")\\n\";\n }\n next if ($status < 0); # No message availableOne thing people have done in the past is to convert the queue to an alias over a topic. The app that uses the messages is redirected to GET from a new queue and an administrative subscription connects the topic to the new queue. At this point the real app gets all the messages and a new subscription can be made for logging messages going through the topic.\n"} +{"text": "### Human: I have a simple program connecting to a remote queue manager which seems to work fine and I can send and receive messages. However I have noticed that with every connection I am getting errors in the windows application event manager:Error on receive from host myhost (12.213.143.252).An error occurred receiving data from my host(12.213.143.252) over\n TCP/IP. This may be due to a communications failure.The return code from the TCP/IP recv() call was 10054 (X'2746').\n Record these values and tell the systems administrator.I thought this might be that I am not disconnecting on the client side correctly though I'm not sure what I am doing wrong. Here is the code I am using to test connecting which is still causing this issue:XMSFactoryFactory factoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ); \n IConnectionFactory cf = factoryFactory.CreateConnectionFactory();\n\n cf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, WebSphereConfigObject.QueueManager);\n cf.SetStringProperty(XMSC.WMQ_HOST_NAME, WebSphereConfigObject.Host);\n cf.SetIntProperty(XMSC.WMQ_PORT, WebSphereConfigObject.Port);\n cf.SetStringProperty(XMSC.WMQ_CHANNEL, WebSphereConfigObject.ServerConnectionChannel);\n cf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);\n IConnection connection = cf.CreateConnection();\n ISession session = connection.CreateSession(false, AcknowledgeMode.AutoAcknowledge);\n connection.Start();\n session.Close();\n connection.Stop();\n connection.Close();any help much appreciated!### Assistant: From what I have seen that event 10054 is logged by a queue manager process, amqrmppa. The event is logged when socket connection between this queue manager process and the XMS client application terminates abruptly.Normal termination does not log any event.\n"} +{"text": "### Human: In a Java program running in two Websphere nodes the following race scenario happens in a distributed transaction managed by Websphere Transaction Manager. The transaction spans across a JMS (Websphere-MQ) Transaction Source and a Database (Oracle) Transaction Source. I would like to understandWhy this (Exception in Thread 2, at step B6) exception happened? \nI expected no issues to happen. Thread 2 had proceeded only after making sure T1 is locked in Transaction TX2, so it is natural that Thread 1 was waiting for T1 table lock (within Transaction TX1) to be released. What I'm wondering about is that why did Thread 2 encounter a stage3CommitProcessing exception? How could I get more details about it, as the exception doesn't breathe any informtaion about it?How to debug such transaction related race scenario? I know it might be difficult to reproduce. But I think there could be some Websphere related logs that I could enable to see what made the commit fail during stage3? It would be great if someone could point me in that direction.How it could be avoided/resolved?Thread 1 (Running in Websphere node 1)A1: Start TX1\nA2: Read messages (maximum of 1000 at a time) from Queue Q1\nA3: LOCK TABLE T1 IN EXCLUSIVE MODE\n Got exception \"ORA-02049\": distributed transaction waiting for lock. \nRefer Log 1 for stack traceThread 2 (Running in Websphere node 2)B1: Start TX2\nB2: Read messages (maximum of 1000 at a time) from Queue Q1\nB3: LOCK TABLE T1 IN EXCLUSIVE MODE\nB4: Batch execute\n MERGE INTO T1 the messages read\nB5: Batch insert messages into T2\nB6: Commit TX2\n Got JTA transaction unexpectedly rolled back (maybe due to a timeout). Refer Log 2 for stack trace. This was while ***stage3CommitProcessing***.Log 1:org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [LOCK TABLE T1 IN EXCLUSIVE MODE]; nested exception is java.sql.SQLSyntaxErrorException: ORA-02049: timeout: distributed transaction waiting for lockat org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:94)\nat org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)\nat org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)\nat org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:406)\nat org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:518)\nat org.springframework.jdbc.core.simple.SimpleJdbcTemplate.update(SimpleJdbcTemplate.java:248)\nat com.test.OracleTableLock.processMessage(OracleTableLock.java:52)\nat sun.reflect.GeneratedMethodAccessor833.invoke(Unknown Source)\nat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)\nat java.lang.reflect.Method.invoke(Method.java:600)\nat org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)\nat org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)\nat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)\nat org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)\nat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)\nat org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)\nat $Proxy153.receiveMessage(Unknown Source)\nat com.test.BatchProcessor.processMessage(BatchProcessor.java:343)\nat sun.reflect.GeneratedMethodAccessor779.invoke(Unknown Source)\nat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)\nat java.lang.reflect.Method.invoke(Method.java:600)\nat org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)\nat org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)\nat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)\nat org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)\nat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)\nat org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)\nat $Proxy155.receiveMessage(Unknown Source)\nat sun.reflect.GeneratedMethodAccessor778.invoke(Unknown Source)\nat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)\nat java.lang.reflect.Method.invoke(Method.java:600)\nat org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:273)\nat org.springframework.scheduling.support.MethodInvokingRunnable.run(MethodInvokingRunnable.java:65)\nat org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:51)\nat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:453)\nat java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:329)\nat java.util.concurrent.FutureTask.runAndReset(FutureTask.java:162)\nat org.springframework.scheduling.commonj.TimerManagerTaskScheduler$TimerScheduledFuture.timerExpired(TimerManagerTaskScheduler.java:112)\nat com.ibm.ws.asynchbeans.timer.TimerImpl.callListenerMethod(TimerImpl.java:298)\nat com.ibm.ws.asynchbeans.timer.GenericTimer.run(GenericTimer.java:216)\nat com.ibm.ws.asynchbeans.J2EEContext$RunProxy.run(J2EEContext.java:264)\nat java.security.AccessController.doPrivileged(AccessController.java:224)\nat javax.security.auth.Subject.doAs(Subject.java:495)\nat com.ibm.websphere.security.auth.WSSubject.doAs(WSSubject.java:131)\nat com.ibm.websphere.security.auth.WSSubject.doAs(WSSubject.java:89)\nat com.ibm.ws.asynchbeans.J2EEContext$DoAsProxy.run(J2EEContext.java:335)\nat java.security.AccessController.doPrivileged(AccessController.java:251)\nat com.ibm.ws.asynchbeans.J2EEContext.run(J2EEContext.java:1146)\nat com.ibm.ws.asynchbeans.timer.TimerImpl.runListenerAsCJWork(TimerImpl.java:425)\nat com.ibm.ws.asynchbeans.am._Alarm.fireAlarm(_Alarm.java:333)\nat com.ibm.ws.asynchbeans.am._Alarm.run(_Alarm.java:230)\nat com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1550)\nCaused by: java.sql.SQLSyntaxErrorException: ORA-02049: timeout: distributed transaction waiting for lock\n\nat oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:91)\nat oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)\nat oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)\nat oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)\nat oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)\nat oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)\nat oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:183)\nat oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:942)\nat oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1222)\nat oracle.jdbc.driver.OracleStatement.executeUpdateInternal(OracleStatement.java:1706)\nat oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1674)\nat oracle.jdbc.driver.OracleStatementWrapper.executeUpdate(OracleStatementWrapper.java:275)\nat com.ibm.ws.rsadapter.jdbc.WSJdbcStatement.pmiExecuteUpdate(WSJdbcStatement.java:1683)\nat com.ibm.ws.rsadapter.jdbc.WSJdbcStatement.executeUpdate(WSJdbcStatement.java:1041)\nat org.springframework.jdbc.core.JdbcTemplate$1UpdateStatementCallback.doInStatement(JdbcTemplate.java:508)\nat org.springframework.jdbc.core.JdbcTemplate$1UpdateStatementCallback.doInStatement(JdbcTemplate.java:1)\nat org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:395)\n... 50 moreLog 2:org.springframework.transaction.UnexpectedRollbackException: JTA transaction unexpectedly rolled back (maybe due to a timeout); nested exception is javax.transaction.RollbackException\n at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1012)\n at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)\n at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)\n at com.test.BatchProcessor.processMessage(BatchProcessor.java:359)\n at sun.reflect.GeneratedMethodAccessor1541.invoke(Unknown Source)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)\n at java.lang.reflect.Method.invoke(Method.java:600)\n at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)\n at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)\n at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)\n at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)\n at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)\n at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)\n at $Proxy204.receiveMessage(Unknown Source)\n at sun.reflect.GeneratedMethodAccessor1540.invoke(Unknown Source)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)\n at java.lang.reflect.Method.invoke(Method.java:600)\n at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:273)\n at org.springframework.scheduling.support.MethodInvokingRunnable.run(MethodInvokingRunnable.java:65)\n at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:51)\n at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:453)\n at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:329)\n at java.util.concurrent.FutureTask.runAndReset(FutureTask.java)\n at org.springframework.scheduling.commonj.TimerManagerTaskScheduler$TimerScheduledFuture.timerExpired(TimerManagerTaskScheduler.java:112)\n at com.ibm.ws.asynchbeans.timer.TimerImpl.callListenerMethod(TimerImpl.java:298)\n at com.ibm.ws.asynchbeans.timer.GenericTimer.run(GenericTimer.java:216)\n at com.ibm.ws.asynchbeans.J2EEContext$RunProxy.run(J2EEContext.java:264)\n at java.security.AccessController.doPrivileged(AccessController.java:224)\n at javax.security.auth.Subject.doAs(Subject.java:495)\n at com.ibm.websphere.security.auth.WSSubject.doAs(WSSubject.java:131)\n at com.ibm.websphere.security.auth.WSSubject.doAs(WSSubject.java:89)\n at com.ibm.ws.asynchbeans.J2EEContext$DoAsProxy.run(J2EEContext.java:335)\n at java.security.AccessController.doPrivileged(AccessController.java:251)\n at com.ibm.ws.asynchbeans.J2EEContext.run(J2EEContext.java:1146)\n at com.ibm.ws.asynchbeans.timer.TimerImpl.runListenerAsCJWork(TimerImpl.java:425)\n at com.ibm.ws.asynchbeans.am._Alarm.fireAlarm(_Alarm.java:333)\n at com.ibm.ws.asynchbeans.am._Alarm.run(_Alarm.java:230)\n at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1550)\nCaused by: javax.transaction.RollbackException\n at com.ibm.tx.jta.TransactionImpl.stage3CommitProcessing(TransactionImpl.java:1217)\n at com.ibm.tx.jta.TransactionImpl.processCommit(TransactionImpl.java:991)\n at com.ibm.tx.jta.TransactionImpl.commit(TransactionImpl.java:913)\n at com.ibm.ws.tx.jta.TranManagerImpl.commit(TranManagerImpl.java:377)\n at com.ibm.tx.jta.TranManagerSet.commit(TranManagerSet.java:161)\n at com.ibm.ws.tx.jta.UserTransactionImpl.commit(UserTransactionImpl.java:293)\n at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1009)\n ... 37 more### Assistant: Assuming that this is a WebSphere MQ resource oproblem, let's try to answer your questions in turn.Why this (Exception in Thread 2, at step B6) exception happened?Why did Thread 2 encounter a stage3CommitProcessing exception?How could I get more details about it?Chances are that the QMgr involved has not been configured with sufficient log space to contain all the messages that are under syncpoint. Although you have taken care to serialize access to the database, the queue is not serialized and so the QMgr must manage up to 2000 records under syncpoint at once. More details are available in the QMgr's error log.How to debug such transaction related race scenario?Are there Websphere related logs that I could enable to see what made the commit fail during stage3?Take a look in/var/mqm/qmgrs/[QMgr name]/errors/AMQERR01.logfor details of whether it was WebSphere MQ that rolled back the transaction.Also, print the JMS linked exceptions. Always. JMS provides a multi-level exception where the lower levels contain provider-specific error information. Often these convey to the application the same information you would otherwise have to go digging through the QMgr's error logs to get.If I'm correct about the cause of the problem, the easiest way to test it is to have two instances try to read 100 records each under syncpoint.How it could be avoided/resolved?Size the logs so that they can contain all of the messages that might be under syncpoint at any given moment. For example, if the messages are each 1k in size and you need 1000 of them under syncpoint for each of 10 instances, you will need at a minimum about 10MB of log extents. These are defined by the QMgr's Primary and Secondary log size and count settings. Remember that the QMgr also maintains syncpoints, for example when managing channels, and so whatever space you calculate needs to take into account channel batch sizes and a few MB for QMgr internal transactions.Please see the section in the Infocenter oncalculating log file sizesfor more detail. For more background, please seeCircular vs. Linear Logsin IBM developerWorks.\n"} +{"text": "### Human: Does anybody have experience with configuring distribution lists (sending a message to one queue, and having that message be forwarded to several other queues) for Websphere MQ v7? I want to configure it on my queue manager, rather than the client having to know all the queues to send the messages to. Also, I would prefer not to use a topic, because I want to be able to manage each queue separately. Is there some configuration file, or some way to use WebSphere MQ Explorer to do this?Thanks### Assistant: A program that uses a distribution list doesn't have to \"know\" the queues it sends to in the sense of hard-coding the names. But itdoeshave to supply the list of queue names. Typically you can place these into a namelist and have the sending program retrieve them there. When the program callsPUTit must also be prepared to parse a structure of return codes rather than a single MQRC.However, you really should reconsider using a topic. You can create administrative subscriptions for each destination queue. This allows you to send the publications to any local or remote queue that you like. It also have the advantage of being able to add or delete destinations without having to restart - or worse, recompile - the sending application.You can use WMQ Explorer either to manage a namelist or to manage the topic and administrative subscriptions. The topic/subscriptions method is the only way to do this purely through configuration. To use distribution lists requires a program specifically designed for the purpose.\n"} +{"text": "### Human: I have to a develop a .NET Windows Service application that should run on an Active/Active cluster.A Windows Service instance (one instance among many in cluster nodes) should listen to an IBM Websphere MQ and distribute the queue items to all cluster nodes (including the distributor node) based on the load on each service instance. When the primary node fails, another service instance on secondary node should takeover the distribution task. Also, the distributor node should be able to control the concurrency level ofTaskSchedulerinstance in Windows Service on all the nodes. For this, I should be able to communicate between cluster nodes without having a DB table or another queue.I googled and found there is aC/C++ Platform SDKavailable. But, Is there any .NET API available to check the hearbeat and to perform intra-communication between nodes inside a cluster server? Or if you could suggest me a best way to implement this would be very helpful. Thanks.### Assistant: There are probably much better platforms than Windows Clustering for this, but since you asked about Windows Clustering here's my take:The MSCS/WSFC cluster API doesn't really provide a mechanism for intra-process communication beyond the fairly limited cluster database (really just a replicated registry key). But you could use the cluster API/tools to host the coordinator process and provide high availability.The easiest way to do this would be to just build a normal Windows service for your coordinator and then use the built in \"Generic Service\" cluster resource/application type to monitor it. That will let you assign an IP address to the coordinator that will follow it around the cluster. Note that moving the coordinator service will be disruptive, so if the node crashes that is hosting the coordinator, there will be downtime while it is started up on the surviving node.I don't really see any reason to make the processing agents cluster aware. Just run them as services on each node, and let the coordinator monitor which ones are online.\n"} +{"text": "### Human: I'm trying to fix a problem with an application that sends a message to the SWIFT network. The application is a .NET application and it uses IBM'samdqmdnet.dllassembly to communicate with the WebSphere MQ server. On the WebSphere MQ server the SWIFT Alliance software is running.The messages are sent from the application, but does not enter the SWIFT network. Some investigation has revealed the following error message:MQSeries Queue 'MQSWIFT/SWIFT.SENDER', Nbr 123, Session 4567, Sequence 890, Conversion error (From)\n MQ Msg Id : AMQ MQSWIFT X -\n Message Info : Error in FIN block 1: can not find tag F01 in message\n{.1.:.F.0.1. (rest of message removed)The start of the message sent is{1:F01and to me this looks like the message is encoded in UNICODE (UTF-16) but the SWIFT software expects ASCII. The SWIFT software sees{.1.:.F.0.1..My question is: How do I send the message to the WebSphere MQ queue using ASCII encoding?The connection has the propertiesMQC.TRANSPORT_PROPERTY,MQC.HOST_NAME_PROPERTYandMQC.CHANNEL_PROPERTYset.The queue is opened using the optionsMQC.MQOO_OUTPUTandMQC.MQOO_FAIL_IF_QUIESCING.The message is created using the formatMQC.MQFMT_STRINGand default put message options:var mqMessage = new MQMessage { Format = MQC.MQFMT_STRING };\nmqMessage.WriteString(swiftMessage);\nvar mqMessageOptions = new MQPutMessageOptions();\nqueue.Put(mqMessage, mqMessageOptions);I have noticed that theMQCenumeration has the valueCODESET_819which probably refers to ASCII but I have no idea if I need to use it and how.### Assistant: The solution that worked for me was to set theCharacterSetproperty of theMQMessageto819:var mqMessage = new MQMessage {\n Format = MQC.MQFMT_STRING,\n CharacterSet = 819\n}\nmqMessage.WriteString(swiftMessage);A collegaue also told me that I should be able to use theMQMessage.Writeoverload that accepts a byte array. Something along these lines:var mqMessage = new MQMessage();\nmqMessage.Write(Encoding.ASCII.GetBytes(swiftMessage));However, I have not verified that this alternative approach works.\n"} +{"text": "### Human: I have a repository queue manager say REPQMGR in a WebSphere MQ cluster. What mqsc command should i use on REPQMGR to get all the queue manager's list in the cluster. In specific i need to inquire a property value from all queue managers.### Assistant: runmqsc\nDIS CLUSQMGR(*) CLUSTER(clusname) ALLThis command will show you all the QMgrs in the cluster. You can also specify a particular attribute that you want to know about instead of usingALL.If you are writing script, have a look atSupportPac MO72. This is a version of runmqsc that a) can operate as a client; b) has a number of useful formatting options; and c) also managed CCDT files.In particular, you can tell MO72 to return results on a single line rather than the standard runmqsc two-column format. This means that a script can look for the object name and attribute name on the same output line rather than having to parse many lines for a single object.\n"} +{"text": "### Human: I have a JMS-based application that I am running in on Websphere 6.0, and am migrating to Websphere 7. Both Websphere servers are backed with a Websphere MQ 6.0 server. I receive the following exception when attempting to deploy a test servlet to the Websphere 7 server:javax.jms.JMSSecurityException: MQJMS2008: failed to open MQ queueWebsphere 6.0 : RHEL 5.3Websphere 7.0.0.15: RHEL 5.3Websphere MQ 6.0: Windows Server 2003Servlet Test Code:public class JMSTestServlet extends HttpServlet {\n private static final long serialVersionUID = 1L;\n\n /**\n * @see HttpServlet#HttpServlet()\n */\n String MQConnectionFactory, MQQueue; \n\n public JMSTestServlet() {\n super();\n // TODO Auto-generated constructor stub\n System.out.println(\"JMSTestServlet: loading\");\n\n URL urlProps = getClass().getClassLoader().getResource(\"META-INF/startup.properties\");\n Properties props = new Properties();\n try\n {\n System.out.println(\"JMSTestServlet: loading properties\");\n props.load( urlProps.openStream() );\n\n MQConnectionFactory = props.getProperty(\"MQConnectionFactory\"); \n MQQueue = props.getProperty(\"MQQueue\"); \n\n System.out.println(\"JMSTestServlet: loading properties ... done!\");\n\n sendMessage(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\");\n } catch (IOException e)\n {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n\n protected void sendMessage(String messageString) { \n QueueConnectionFactory fact;\n QueueConnection qConn = null;\n try { \n System.out.println(\"JMSTestServlet: creating context\");\n Context ctx = new InitialContext();\n fact = (QueueConnectionFactory)ctx.lookup(MQConnectionFactory);\n Destination destination = (Destination)ctx.lookup(MQQueue);\n\n System.out.println(\"JMSTestServlet: creating QueueConnection\");\n qConn = fact.createQueueConnection(); \n QueueSession qSess = qConn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\n MessageProducer prod = qSess.createProducer(destination); \n\n\n System.out.println(\"JMSTestServlet: sending Message\");\n TextMessage message = qSess.createTextMessage();\n message.setText(messageString);\n prod.send(message); \n\n System.out.println(\"JMSTestServlet: done sendMessage()\");\n } catch ( JMSException ex ) {\n ex.toString(); \n ex.printStackTrace();\n ex.getLinkedException().toString();\n ex.getLinkedException().printStackTrace();\n } catch ( NamingException ex ) {\n System.out.println(\"JMSTestServlet: naming exception \" + ex.toString());\n ex.printStackTrace();\n } catch ( Exception ex ) {\n System.out.println(\"JNDI API lookup failed: \" + ex.toString());\n ex.printStackTrace(); \n } finally {\n System.out.println(\"JMSTestServlet: cleaning up sendMessage()\");\n\n try\n {\n if ( qConn != null ) qConn.close();\n } catch (JMSException e)\n {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n }\n\n /**\n * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)\n */\n protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n try { \n String messageString = request.getParameter(\"message\"); \n sendMessage(messageString);\n } finally {\n }\n }Properties file is:MQConnectionFactory=jms/QUEUECONNFACTORY\nMQQueue=jms/QUEUEWhen deployed to Websphere 6 I get messages in my remote queues. When I deploy to Websphere 7, I get:[4/13/11 14:53:55:622 EDT] 0000005c ConnectionEve A J2CA0056I: The Connection Manager received a fatal connection error from the Resource Adapter for resource JMS$QUEUECONNFACTORY$JMSManagedConnection@15. The exception is: javax.jms.JMSSecurityException: MQJMS2008: failed to open MQ queue 'QUEUE'.\n[4/13/11 14:53:55:622 EDT] 0000005c ConnectionEve W J2CA0206W: A connection error occurred. To help determine the problem, enable the Diagnose Connection Usage option on the Connection Factory or Data Source.\n[4/13/11 14:53:55:623 EDT] 0000005c ConnectionEve A J2CA0056I: The Connection Manager received a fatal connection error from the Resource Adapter for resource jms/QUEUECONNFACTORY. The exception is: javax.jms.JMSSecurityException: MQJMS2008: failed to open MQ queue 'QUEUE'.\n[4/13/11 14:53:55:625 EDT] 0000005c SystemErr R javax.jms.JMSSecurityException: MQJMS2008: failed to open MQ queue 'QUEUE'.I'm pretty sure I've configured the queues and connection factories on both Websphere servers the same. I'm at a loss as to how to resolve this issue, and the Google is of no help.Update 2011-04-15:I've extracted the following error from the logs:com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2035'I've read up on it at a few locations, and I really can't see where there's a difference between WAS 6 and WAS 7 to cause this issue.I'm running Websphere on both Linux hosts as root. I have a root account created on the Windows machine with full permissions to the MQ installation:setmqaut -t qmgr -m QM_webspheremq -p root +all### Assistant: I'll take a shot at answering this old post since it has been \"Bumped by Community user\" every four months since January 2019.First some background:WAS 6.0Included MQ jar files from Websphere MQ v5.3Depending on the specific version of WAS 6.0, the jars would be from Websphere MQ v5.3 CSD08 up to CSD14WAS 7.0.0.15Is supposed to include WebSphere MQ JCA resource adapter Version 7.0.1.3 (the default behavior here would have been that of the MQ v5.3 jars), but because of a bug, if you upgraded from WAS 7.0.0.0 to WAS 7.0.0.15, the WebSphere MQ JCA resource adapter Version 7.0.0.0 which came with WAS 7.0.0.0 would stay in place.The difference:With MQ v5.3 jar files, when you callfact.createQueueConnection();, a blank userid would be sent to the queue manager. If theSVRCONNchannel you connected to had a blankMCAUSERattribute then the connection would be running under the authority of the user account the Windows MQ queue manager was running as. In other words you would get full authority to the the queue manager and all queues (full MQ admin authority).With MQ v7.0.0.0 resource adapter, when you callfact.createQueueConnection();the JVM process ID will be sent to the queue manager. If theSVRCONNchannel you connect to had a blankMCAUSERattribute then the Windows MQ queue manager would attempt to run the connection under the authority of the JVM process ID. Based on the information in your question this would be the userroot.Summary:It worked under Websphere 6.0 because the connection runs with full MQ Admin authority.It failed under Websphere 7.0.0.15 because the connection runs withrootuser authority, and in this case you only provided therootuser withallauthority to the queue manager (qmgr) itself, but no authority to theQUEUE.Websphere must first connect to and inquire the queue manager object before it would open any queues. The error you got wasjavax.jms.JMSSecurityException: MQJMS2008: failed to open MQ queue 'QUEUE'.. This means that you did successfully connect to the queue manager, but then failed to connect to the queue.This could have been fixed by providing authority for theQUEUEto therootuser:setmqaut -t q -m QM_webspheremq -n QUEUE -p root +put +get +browse +inq +dspNote all of the versions of software listed in the question are now (8.5 years later) out of support from IBM. It would also not be advisable to have aSVRCONNchannel with a blankMCAUSERunless you were using some other method such as a security exit to set the MCAUSER to a non-MQ Admin id. In current IBM MQ versions you can use TLS with a client cert mapped on the queue manager to a non-MQ Admin id, or TLS without a cert + connection authentication to validate a user id and password sent by the client at the queue manager.\n"} +{"text": "### Human: Here is the scenario,$hostname\nserver1I have the below script in server1,#!/bin/ksh\necho \"Enter server name:\"\nread server\n\nrsh -n ${server} -l mquser \"/opt/hd/ca/scripts/envscripts.ksh\"\nqdisplay\n # script ends.In above script I am logging into another server say server2 and executing the script \"envscripts.ksh\" which sets few alias(Alias \"qdisplay\") defined in it.I can able to successfully login to server1 but unable to use the alias set by script \"envscripts.ksh\".Geting below error,-bash: qdisplay: command not foundcan some please point out what needs to be corrected here.Thanks,\nVignesh### Assistant: The other responses and comments are correct. Yourrshcommand needs to execute both the ksh script and the subsequent command in the same invocation. However, I thought I'd offer an additional suggestion.It appears that you are writing custom instrumentation for WebSphere MQ. Your approach is to remote shell to the WMQ server and execute a command to display queue attributes (probably depth).The objective of writing your own instrumentation is admirable, however attempting to do it as remote shell is not an optimal approach. It requires you to maintain a library of scripts on each MQ server and in some cases to maintain these scripts in different languages.I would suggest that a MUCH better approach is to use the MQSC client available inSupportPac MO72. This allows you to write the scripts once, and then execute them from a central server. Since the MQSC commands are all done via MQ client, the same script handles Windows, UNIX, Linux, iSeries, etc.For example, you could write a script that remotely queried queue depths and printed a list of all queues with depth > 0. You could then either execute this script directly against a given queue manager or write a script to iterate through a list of queue managers and collect the same report for the entire network. Since the scripts are all running on the one central server, you do not have to worry about getting$PATHright, differences in commands like tr or grep, where ksh or perl are installed, etc., etc.Ten years ago I wrote the scripts you are working on when my WMQ network was small. When the network got bigger, these platform differences ate me alive and I was unable to keep the automation up and running. When I switched to using WMQ client and had only one set of scripts I was able to keep it maintained with far less time and effort.The following script assumes that the QMgr name is the same as the host name except in UPPER CASE. You could instead pass QMgr name, hostname, port and channel on the command line to make the script useful where QMgr names do not match the host name.#!/usr/bin/perl -w\n#-------------------------------------------------------------------------------\n# mqsc.pl\n#\n# Wrapper for M072 SupportPac mqsc executable\n# Supply parm file name on command line and host names via STDIN.\n# Program attempts to connect to hostname on SYSTEM.AUTO.SVRCONN and port 1414 \n# redirecting parm file into mqsc.\n#\n# Intended usage is...\n#\n# mqsc.pl parmfile.mqsc\n# host1\n# host2\n# \n# -- or --\n#\n# mqsc.pl parmfile.mqsc < nodelist\n#\n# -- or --\n#\n# cat nodelist | mqsc.pl parmfile.mqsc\n#\n#-------------------------------------------------------------------------------\nuse strict;\n$SIG{ALRM} = sub { die \"timeout\" };\n\n$ENV{PATH} =~ s/:$//;\n\nmy $File = shift;\ndie \"No mqsc parm file name supplied!\" unless $File;\ndie \"File '$File' does not exist!\\n\" unless -e $File;\n\nwhile () {\n my @Results;\n chomp;\n next if /^\\s*[#*]/; # Allow comments using # or *\n s/^\\s+//; # Delete leading whitespace\n s/\\s+$//; # Delete trailing whitespace\n # Do not accept hosts with embedded spaces in the name\n die \"ERROR: Invalid host name '$_'\\n\" if /\\s/;\n\n # Silently skip blank lines\n next unless ($_);\n\n my $QMgrName = uc($_);\n\n #----------------------------------------------------------------------------\n # Run the parm file in\n eval {\n alarm(10);\n @Results = `mqsc -E -l -h $_ -p detmsg=1,prompt=\"\",width=512 -c SYSTEM.AUTO.SVRCONN &1 | grep -v \"^MQSC Ended\"`;\n };\n\n if ($@) {\n if ($@ =~ /timeout/) {\n print \"Timed out connecting to $_\\n\";\n } else {\n print \"Unexpected error connecting to $_: $!\\n\";\n }\n }\n alarm(0);\n\n if (@Results) {\n print join(\"\\t\", @Results, \"\\n\");\n }\n}\nexit;The parmfile.mqsc is any valid MQSC script. One that gathers all the queue depths looks like this:DISPLAY QL(*) CURDEPTH\n"} +{"text": "### Human: I wrote a API EXIT for WebSphere MQ 7 on Windows, when I put to or get from queue a simple message from command line like: \"amqsput\" or \"amqsget\", I would get some log files containing information like time, message data, queue name, etc.That's what I expect for my test program writen in Java, but when I used code below:MQMessage msg = new MQMessage();msg.writeUTF(\"Hello, World!\");MQPutMessageOptions pmo = new MQPutMessageOptions();queue.put(msg, pmo);I got blank log file. Then I used code below:MQMessage msg = new MQMessage();msg.writeString(\"Hello, World!\");MQPutMessageOptions pmo = new MQPutMessageOptions();queue.put(msg, pmo);Then I saw familar data in log file.I opened MQ explorer, I saw two messages in \"Message Browser\":Hello, World!%Hello, World!I'm totally lost here, where is this \"%\" from? My api exit didn't record the put action because of the encoding?Any advices would be appreciated!\nThank you!### Assistant: I'm pretty certain I remember reading somewhere thatwriteUTF()outputs length information as well as the string.Ah, yes, here it is:From IBM's owndocoonWriteUTF():This method takes an ActiveX string and writes it into the message data buffer at the current position in UTF format. The data writtenconsists of a 2-byte length followed by the character data. DataOffset is incremented by the length of the string if the method succeeds.(my italics). As you've already discovered,WriteString()is the way to do itwithouta length.\n"} +{"text": "### Human: I'm currently working in C# and I need to check the state of the JMS connection that i made (whether it's connected / disconnected). I'm sure that I can connect and disconnect succesfully..its just that i need to display the status of the connection in my UI.Is there any properties of the JMS connection that states connection status? Or is there any other method that i can use to check the connection status?Thanks for your help. :)Currently, I'm using the ExceptionListener to listen for any exceptions and a flag will be set to false when any exception is catched. And when I'm connecting, I will set the flag to true vice versa when i disconnect, I will set the flag to false.This flag will be used by my UI to detect whether the connection is up or not.However I was thinking that if theres any property / methods of the IBM connection which can be used to show the state of the connection as its a much better solution. For SonicMQ, theres .getConnectedState() which shows whether the connection is active or inactive.I was wondering whether if IBM have something similar to SonicMQ?### Assistant: You can use theConnection.setExceptionListener()method to be notified asynchronously of exceptions detected in the connection. If a problem is detected theonException()method is called.Be sure to set theFAILIFQUIESCEproperty on the factories and destinations so that your connection is notified and closed in an orderly fashion when the QMgr is shut down by the administrator.In v7 of WMQ it is possible so enable session reconnection in the transport. In this case, the application may not be aware that the connection was interrupted but you can treat it as having been continuously connected.Note that, for the most part, exceptions are driven by the application's API calls. So if the connection is lost, you may not know about it in real time but rather find out when an API call is made. If the application sits idle for long periods of time and you want a real-time display of connection status. Please see also \"How to find out if JMS Connection is there?\" for more on that topic.WMQ v7 has options to reconnect the client automatically. You must be using v7 at both the client and the server for this to work. Since v6 is end-of-life as of Sept 2011, it is best if you develop this app on v7. You can download the v7 client asSupportPac MQC7. WhenJMS client reconnectis enabled, the application may not be aware of the connection activity except as a delay in responding to an API call while the connection is rebuilt. The length of that delay depends on channel tuning set by the administrator and in the connection factory.\n"} +{"text": "### Human: I am disconnecting from MQQueue and MQQueueManager with the following code:Queue.Close();\nlog.Info( \"Queue IsOpen: \" + Queue.IsOpen.ToString() );\nQueue = null;\n\nQueueManager.Disconnect();\nQueueManager.Close();\nlog.Info( \"QM IsOpen: \" + QueueManager.IsOpen.ToString() );\nlog.Info( \"QM IsConnected: \" + QueueManager.IsConnected.ToString() );\nQueueManager = null;And I get the following log entries for this:Queue IsOpen: false\nQM IsOpen: false\nQM IsConnected: falseBut after few hours when I runnetstat -ncommand from command prompt I get a long list of connections to MQ server and the State in those connections isCLOSE_WAIT.Any ideas why the TCP connections doesn't get fully closed? Are there any way that I could kill those from code? Currently I'll have to restart the client app which cleans up the open connections.WebSphere MQ version is 6.0.2.6 and the .NET libraries are from MQ 7.### Assistant: Looking in the Migration Guide there's a section calledUpgrading a WebSphere MQ client from Version 6.0 to Version 7.0which suggests a possible explanation. It states that as of v7 the TCP tuning is stored in the client configuration file. So if you have enabled TCP Keepalive in the Windows registry, the v7 client will ignore it. The format and location of the file is described inWebSphere MQ client configuration file.Of course for this to be the problem, there has to be a socket leak. You did not mention which version of WMQ V7 client you have but the Fix Pack README files do show a number of APARs related to socket leaks, failure to clean up after disconnects and so forth. None of these directly mention C# or .Net but there are enough problems around connection/disconnection issues to make it worth an upgrade.So first & easiest fix to attempt is to add TCP Keepalive to the client configuration file and see if it helps. Disable connection sharing while you are in there as well. It's not supposed to be a factor but then it's not supposed to leak sockets either. Can't hurt. Next is to applyFix Pack 7.0.1.2(latest as of this writing) and see if that fixes the problem. After that, it's PMR time. Hope that helps.\n"} +{"text": "### Human: I'm not extremely familiar with IBM MQSeries, but I am writing c# scripts which write and read files from my queue server. The problem is my read works but my write doesn't. Please notice that I am using the same queue so don't bother going in that direction.My code firstly accesses the MQserver with the following code:MQQueueManager qManager;\nMQQueue queue;\nMQMessage queueMessage;\nMQGetMessageOptions queueGetMessageOptions;\nMQPutMessageOptions queuePutMessageOptions;\n\nstring QueueName;\n\npublic MQAccess(string queueName, string queueManager, string connection, string channel)\n{\n QueueName = queueName;\n\n qManager = new MQQueueManager(queueManager, channel, connection);\n\n queue = qManager.AccessQueue(QueueName, MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING);\n}I am able to read files from my queue with this code:public bool NextMessage(ref string message, ref DateTime putDateTime)\n{\n queueMessage = new MQMessage();\n queueMessage.Format = MQC.MQFMT_STRING;\n queueGetMessageOptions = new MQGetMessageOptions();\n\n queueGetMessageOptions.Options = MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING;\n\n try\n {\n queue.Get(queueMessage, queueGetMessageOptions);\n }\n catch (MQException mqex)\n {\n if (mqex.ReasonCode == MQC.MQRC_NO_MSG_AVAILABLE)\n {\n message = \"\";\n return false;\n }\n else\n throw mqex;\n }\n message = queueMessage.ReadString(queueMessage.MessageLength);\n putDateTime = queueMessage.PutDateTime;\n\n if (message.StartsWith(\"\u00b4\u2557\u2510\"))\n {\n message = message.Substring(3, message.Length - 3);\n }\n\n return true;\n}If I however try to write with the following code it gives me errors:public void WriteMessage(string message)\n{\n queueMessage = new MQMessage();\n queueMessage.WriteString(message);\n queueMessage.Format = MQC.MQFMT_STRING;\n queuePutMessageOptions = new MQPutMessageOptions();\n\n queue.Put(queueMessage, queuePutMessageOptions);\n}My error catch gives me the error:Error in the applicationWhich doesn't show much of course. So I checked the event log on the server and this showed me the error:An error occurred receiving data from\n stx041774 (192.168.225.51) over\n TCP/IP. This may be due to a\n communications failure.The return code from the TCP/IP (recv)\n call was 10054 (X'2746'). Record these\n values and tell the systems\n administrator.I looked up 10054 and means:An existing connection was forcibly\n closed by the remote host.Does anyone have any idea what I can do to make this work? Is there perhaps an MQC option I have to set for writing? Because I have no idea what to do with the options, I'm not even sure if this is the issue.Please keep in mind that I also close my connection every time with:public void Close()\n{\n queueMessage = null;\n queue.Close();\n qManager.Close();\n}\n\n~MQAccess()\n{\n queueMessage = null;\n queue.Close();\n qManager.Close();\n}### Assistant: Squig was close but no cigar. When you open the queue, you need to specify both inputandoutput on the open options if you want to both read and write messages. The example code has only input options specified.\n"} +{"text": "### Human: When calling:MQQueueConnectionFactory cf ...\ncf.createConnection();The com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.handshakeCompleted method begins:public void handshakeCompleted(HandshakeCompletedEvent event) {\n X509Certificate[] peerCertificateChain = event.getPeerCertificateChain();\n ...getPeerCertificateChain in javax.net.ssl.SSLSession:default X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException {\n throw new UnsupportedOperationException(\"This method is deprecated and marked for removal. Use the getPeerCertificates() method instead.\");\n}causing this exception:Exception in thread \"HandshakeCompletedNotify-Thread\" java.lang.UnsupportedOperationException: This method is deprecated and marked for removal. Use the getPeerCertificates() method instead.\n at java.base/javax.net.ssl.SSLSession.getPeerCertificateChain(SSLSession.java:295)\n at java.base/javax.net.ssl.HandshakeCompletedEvent.getPeerCertificateChain(HandshakeCompletedEvent.java:173)\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.handshakeCompleted(RemoteTCPConnection.java:2448)\n at java.base/sun.security.ssl.TransportContext$NotifyHandshake$1.run(TransportContext.java:685)\n at java.base/sun.security.ssl.TransportContext$NotifyHandshake$1.run(TransportContext.java:682)\n at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)\n at java.base/sun.security.ssl.TransportContext$NotifyHandshake.run(TransportContext.java:682)\n at java.base/java.lang.Thread.run(Thread.java:832)The project's only IBM MQ dependency is:com.ibm.mq:com.ibm.mq.allclient:9.2.0.0Why is javax.net.ssl.getPeerCertificateChain() calling that deprecated method? It looks like the problem is in the HandshakeCompletedEvent class, not MQ.Edit: This issue started with Java 15.### Assistant: In the latest release, they apparently provide JAVA 17 support.Sources:https://www.ibm.com/common/ssi/ShowDoc.wss?docURL=/common/ssi/rep_ca/8/899/ENUSLP21-0278/index.htmlhttps://search.maven.org/artifact/com.ibm.mq/com.ibm.mq.allclient/9.2.4.0/jar\n"} +{"text": "### Human: I am trying to extract AAA and BBB from the output of the command \"dspmq\". \n$dspmq<- this command gives output as -->QMNAME(AAA) STATUS(Running)\nQMNAME(BBB) STATUS(Running)But it doesn't work with the below code.perl -e 'use Data::Dumper qw(Dumper);my @qmgrlist = `dspmq`;$size = @qmgrlist;foreach my $i (@qmgrlist){my @temp1 = split /QMNAME\\(/, $i;print @temp1;}'AAA) STATUS(Running)\n\nBBB) STATUS(Running)I am able to truncate\"QMNAME(\"but unable to truncate those to the right ofAAAandBBB. Basically I want to get the string between\"QMNAME(\"and the immediate\")\". Please assist.### Assistant: I think a regex approach is better thansplit()here, but you could usesplit()by splitting on parentheses and taking the second item in the returned list.for (@qmgrlist) {\n say +(split /[()]/)[0];\n}And a brief note on your use of command-line options to run this code. You can make it simpler if you a) pipe the output ofqspmqinto your code and b) use-nto process a record at a time.$ perl -nE 'say +(split /[()]/)[1]' `dspmq`There's also-Mto load modules (e.g.-MData::Dumper), but you don't seem to be using Data::Dumper any more.\n"} +{"text": "### Human: I'd like set up a battery of tests for testing new installations of QMs. Most of them will be in a \"remote\" setup. I'd like to be able to send a message to the new QM and receive a response. Is there any way to make a \"loop\" just with normal configuration (i.e. without using exits) ?### Assistant: My former employer was a bank and we had many connections to clearing \nhouses and other vendors. On many of these I was able to have the business partner set up loopback queues on their end. These consisted of a QRemote on my QMgr that pointed to a QRemote on the other side, which pointed to a QLocal on the originating QMgr on my side. When a message isPUTto the QRemote it flowed to the other side, landed on the QRemote there, then was directed back to the QLocal.If the message didn't make it back, we would then start our inbound channel (which was defined as aRQSTRon our side). If this caused the channel to start and the message arrived then we knew the channel initiator on the other side was down but at least we could keep the channel running until it was fixed. But if this didn't work we knew there was some problem on their side other than channel triggering.And, yes, this was production. We figured that non-transactional instrumentation messages are valid in Production environments. As far as we were concerned, this was the same as a ping or cluster control message. Of course, we had a web screen and other instrumentation to kick them off so usage of the utility was controlled and were recorded.There are similar methods in which QMgr aliasing is used and this can greatly cut down on the number of loopback queues needed in a large network. Do NOT be tempted to do this! When we use QRemotes that specify a fully-qualified destination, all they can do is send and receive loopback messages on the prescribed queue. But if a QRemote is used without anRQNAMEthen it can be used to send messages toanyqueue on the adjacent QMgr.Let's say you haveQMAandQMB:runmqsc QMA\nDEFINE QLOCAL(QMB.LOOPBACK) REPLACE\nDEFINE QREMOTE(QMB.LOOPBACK.RMT) +\n XMITQ(QMB) +\n RQMNAME(QMB) +\n RNAME(QMB.QMA.LOOPBACK.RMT) +\n REPLACE\nEND\n\nrunmqsc QMB\nDEFINE QREMOTE(QMB.QMA.LOOPBACK.RMT) +\n XMITQ(QMA) +\n RQMNAME(QMA) +\n RNAME(QMB.LOOPBACK) +\n REPLACENow you can go to the server hostingQMAand do:echo Hello World | amqsput QMB.LOOPBACK.RMT QMANote that the name of the loopback reflector onQMBhasbothQMgr names in it. This is because you probably want to set up lopback from both sides and cannot useQMB.LOOPBACK.RMTboth as a reflectorandto initiate loopbacks. In that case the object inventory looks more like this:runmqsc QMA\nDEFINE QLOCAL(QMB.LOOPBACK) REPLACE\nDEFINE QREMOTE(QMB.LOOPBACK.RMT) +\n XMITQ(QMB) +\n RQMNAME(QMB) +\n RNAME(QMB.QMA.LOOPBACK.RMT) +\n REPLACE\n\nDEFINE QREMOTE(QMA.QMB.LOOPBACK.RMT) +\n XMITQ(QMB) +\n RQMNAME(QMB) +\n RNAME(QMA.LOOPBACK) +\n REPLACE\nEND\n\nrunmqsc QMB\nDEFINE QREMOTE(QMB.QMA.LOOPBACK.RMT) +\n XMITQ(QMA) +\n RQMNAME(QMA) +\n RNAME(QMB.LOOPBACK) +\n REPLACE\n\nDEFINE QLOCAL(QMA.LOOPBACK) REPLACE\nDEFINE QREMOTE(QMA.LOOPBACK.RMT) +\n XMITQ(QMA) +\n RQMNAME(QMA) +\n RNAME(QMA.QMB.LOOPBACK.RMT) +\n REPLACE\nENDNote that all of the objects sort out based on the name of the remote QMgr. Some people prefer names likeLOOPBACK.QMB.RMTto make all the loopback queues cluster together in a list of objects or a backup.All of this is a great target for automation since the names of the objects can all be derived from the names of the QMgrs.\n"} +{"text": "### Human: I'm trying to build a custom mq exit to archive messages that hit a queue. I have the following code.class MyMqExits implements WMQSendExit, WMQReceiveExit{\n\n@Override\npublic ByteBuffer channelReceiveExit(MQCXP arg0, MQCD arg1, ByteBuffer arg2) {\n // TODO Auto-generated method stub\n\n if ( arg2){\n def _bytes = arg2.array()\n def results = new String(_bytes)\n println results;\n }\n\n return arg2;\n}\n...The content of the message (header/body) is in the byte buffer, along with some unreadable binary information. How can I parse the message (including the body and the queue name) from arg2? We've gone through IBM's documentation, but haven't found an object or anything that makes this easy.### Assistant: Assuming the following two points:1) Your sender application has not hard coded the queue name where it puts messages. So you can change the application configuration to send messages to a different object.2) MessageId of the archived message is not important, only message body is important.Then one alternative I can think of is to create an Alias queue that resolves to a Topic and use two subscribers to receive messages.1) Subscriber 1: An administratively defined durable subscriber with a queue provided to receive messages. Provide the same queue name from which your existing consumer application is receiving messages.2) Subscriber 2: Another administratively defined durable subscriber with queue provided. You can write a simple java application to get messages from this queue and archive.3) Both subscribers subscribe to the same topic.Here are steps:// Create a topic\ndefine topic(ANY.TOPIC) TOPICSTR('/ANY_TOPIC')\n// Create an alias queue that points to above created topic\ndefine qalias(QA.APP) target(ANY.TOPIC) targtype(TOPIC)\n// Create a queue for your application that does business logic. If one is available already then no need to create.\ndefine ql(Q.BUSLOGIC)\n// Create a durable subscription with destination queue as created in previous step.\ndefine sub(SB.BUSLOGIC) topicstr('/ANY_TOPIC') dest(Q.BUSLOGIC)\n// Create a queue for application that archives messages.\ndefine ql(Q.ARCHIVE)\n// Create another subscription with destination queue as created in previous step.\ndefine sub(SB.ARCHIVE) topicstr('/ANY_TOPIC') dest(Q.ARCHIVE)Write a simple MQ Java/JMS application to get messages fromQ.ARCHIVEand archive messages.\n"} +{"text": "### Human: How can we disable authorizations on MQ version 7.0.1.3 on windows platform?I know in version 7.0 you can disable channel authorizations. But I cannot find a way to disable authorizations in 7.0.1.3.### Assistant: The authorizations on 7.0.1.3 can be disabled by putting environment variable MQSNOAUT=yes on both windows and UNIX. The variable has to be set before creation of queue manager and during the life cycle of queue manager, authorizations cannot be re-enabled.Below link explains in detail the use of MQSNOAUT:http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=%2Fcom.ibm.mq.amqzag.doc%2Ffa13260_.htm\n"} +{"text": "### Human: I'm very new to ibm mq, I find out the documents or books related to mb are so few, the only one I found is 'WebSphere MQ Using Java' written in 2004. But the real world has changed a lot.\n I installed and verified mq server 7.5 on redhat linux 64 bit successfully according tothisI also created queue managermyqm1, queueLQ.TEST, channelJAVA.CHANNELand did some test through command lines on server to ensure they work well. However when I installed a mq client on windows xp and wrote below java code, it always throw aexception:com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2035'my code:import com.ibm.mq.*; import com.ibm.mq.constants.MQConstants;/** * Simple example program */ public class MQSample {// code identifier\nstatic final String sccsid = \"@(#) MQMBID sn=p000-L120604 su=_H-IvIK4nEeGko6IWl3MDhA pn=MQJavaSamples/wmqjava/MQSample.java\";\n\n// define the name of the QueueManager\nprivate static final String qManager = \"myqm1\";\n// and define the name of the Queue\nprivate static final String qName = \"LQ.TEST\";\n\n/**\n * Main entry point\n *\n * @param args - command line arguments (ignored)\n */\npublic static void main(String args[]) {\n try {\n MQEnvironment.hostname = \"58.2.221.196\"; \n MQEnvironment.channel = \"JAVA.CHANNEL\"; \n MQEnvironment.port = 1414;\n MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES);\n MQEnvironment.userID = \"mqm\"; \n MQEnvironment.password = \"mqm\";\n MQEnvironment.CCSID = 1208;\n\n // Create a connection to the QueueManager\n System.out.println(\"Connecting to queue manager: \" + qManager);\n MQQueueManager qMgr = new MQQueueManager(qManager);\n\n // Set up the options on the queue we wish to open\n int openOptions = MQConstants.MQOO_INPUT_AS_Q_DEF | MQConstants.MQOO_OUTPUT;\n\n // Now specify the queue that we wish to open and the open options\n System.out.println(\"Accessing queue: \" + qName);\n MQQueue queue = qMgr.accessQueue(qName, openOptions);\n\n // Define a simple WebSphere MQ Message ...\n MQMessage msg = new MQMessage();\n // ... and write some text in UTF8 format\n msg.writeUTF(\"Hello, World!\");\n\n // Specify the default put message options\n MQPutMessageOptions pmo = new MQPutMessageOptions();\n\n // Put the message to the queue\n System.out.println(\"Sending a message...\");\n queue.put(msg, pmo);\n\n // Now get the message back again. First define a WebSphere MQ\n // message\n // to receive the data\n MQMessage rcvMessage = new MQMessage();\n\n // Specify default get message options\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n\n // Get the message off the queue.\n System.out.println(\"...and getting the message back again\");\n queue.get(rcvMessage, gmo);\n\n // And display the message text...\n String msgText = rcvMessage.readUTF();\n System.out.println(\"The message is: \" + msgText);\n\n // Close the queue\n System.out.println(\"Closing the queue\");\n queue.close();\n\n // Disconnect from the QueueManager\n System.out.println(\"Disconnecting from the Queue Manager\");\n qMgr.disconnect();\n System.out.println(\"Done!\");\n } catch (MQException ex) {\n ex.printStackTrace();\n System.out.println(\"A WebSphere MQ Error occured : Completion Code \" + ex.completionCode\n + \" Reason Code \" + ex.reasonCode);\n\n\n } catch (java.io.IOException ex) {\n System.out.println(\"An IOException occured whilst writing to the message buffer: \" + ex);\n }\n return;\n} }Can anybody throw a light to me on that? I'm totally down.### Assistant: To expand on Shashi's answer, since WMQ V7.1 the default CHLAUTH rules block all access on all SVRCONN channelsandthey block administrative access on all SVRCONN channels. If you really want to connect toJAVA.CHANNELasmqmthen you will need to overridebothof these behaviors.If you are actually willing to allow remote, unauthenticated connections to the QMgr with an administrative user ID, then you have the option of disabling CHLAUTH rules altogether. You can do this by issuing theALTER QMGR CHLAUTH(DISABLED)command inrunmqschowever this is HIGHLY discouraged because it leaves the QMgr open to anonymous remote code execution using the WMQ administrative user ID. This is, however, what you appear to be trying to do.The recommended approach would be to use an ID that isnotadministrative. For example, if you made an ID calledmquserwith a private group also calledmquserthen you could grant it rights to connect and inquire on the QMgr and to open the designated queue for put, get, browse and inquire. Since the ID is not administrative, it would be relatively safe to use on unauthenticated channels. You could change your code to specify the ID asmquserinstead ofmqmand then use a CHLAUTH rule to allow the connection. For example:SET CHLAUTH('JAVA.CHANNEL') TYPE(USERMAP) +\n CLNTUSER('mquser') USERSRC(MAP) +\n MCAUSER('mquser') ACTION(ADD)The above rule tells the QMgr \"when you see a connection from themquserID onJAVA.CHANNEL, then set MCAUSER tomquserand allow the connection.\"When you grant permissions, remember to grant them on the group and not the user. For example, if usingsetmqautuse the-goption and not the-poption. If there are any issues with authorization errors, you can sort these out easily using event messages. First, enable events using theALTER QMGR AUTHOREV(ENABLED). This will cause the QMgr to emit an event message into theSYSTEM.ADMIN.QMGR.EVENTqueue. You can useSupportPac MH05orSupportPac MS0Pto parse the event messages. For any given authorization event the message tells you the ID that requested access, the API call (connect, open, close etc.), the object the call was made against and the exact options that were used.Prior to WMQ V7.1, WebSphere MQ allowed all remote connections, even anonymous, administrative ones. Although this allowed you to connect easily, in today's more hostile network environment the ability to remotely and anonymously execute code on the QMgr's host server is seen as an unacceptable security risk. So now a new QMgr is set to not allowanyremote administrative access by default. As the administrator this requires you to explicitly disable security to get the old behavior or to explicitly provision secure access.\n"} +{"text": "### Human: I'd like to write some code to monitor the queue size on Websphere 7 MQ.\nThis is the code I've come up withMQEnvironment.hostname = \"10.21.1.19\"; \n MQEnvironment.port = 1414;\n MQEnvironment.channel = \"SYSTEM.CDEF.SVRCONN\";\n MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES);\n\n MQQueueManager qMgr = new MQQueueManager(\"MYQMGR\");\n\n MQQueue destQueue = qMgr.accessQueue(\"PUBLISH\", MQC.MQOO_INQUIRE);\n System.out.println(destQueue.getCurrentDepth());\n destQueue.close();\n qMgr.disconnect();How do I know what the \"Channel\" is?How do I know what the queue manager name is that I pass into MQQueueManager?Or is there another API that I should look at?I need it work with WRS 7 SIB and MQ.Thanks\nJeff Porter### Assistant: I used the jars from WS 7.0.1.1com.ibm.mq.jar\ncom.ibm.mq.jmqi.jar\ncom.ibm.mq.jmqi.system.jar\ncom.ibm.mq.commonservices.jar\ncom.ibm.mq.headers..jar\ncom.ibm.mq.jmqi.remote.jarI got the Queue Manager name and the Channel name from \"IBM Webshpere MQ Explorer\" (Client Connection node in the tree)import com.ibm.mq.MQEnvironment;\n import com.ibm.mq.MQQueue;\n import com.ibm.mq.MQQueueManager;\n import com.ibm.mq.constants.CMQC;\n int openOptions = CMQC.MQOO_INQUIRE + CMQC.MQOO_FAIL_IF_QUIESCING + CMQC.MQOO_INPUT_SHARED;\n\n MQEnvironment.hostname = \"10.2.51.19\";\n MQEnvironment.port = 1414;\n MQEnvironment.channel = \"SW1_QM_CH1\";\n\n MQQueueManager qMgr = new MQQueueManager(\"SW1_QM\");\n\n MQQueue destQueue = qMgr.accessQueue(\"E_RETRY\", openOptions);\n System.out.println(\"E_RETRY size:\" + destQueue.getCurrentDepth());\n destQueue.close();\n qMgr.disconnect();Hope this helps someone else out!\n"} +{"text": "### Human: I've developed a library using the latest IBM amqmdnet.dll assembly, 9.1.3When I run the .NET Core console application (2.2) I got the following exceptionTypeLoadException: Could not load type 'System.Web.Configuration.WebConfigurationManager' from assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.I've disassembled the file with dotPeek and it references System.WebStanding atdocumentationit supports .NET Core. The assembly I've created is a standard .NET Class library and when referenced by a .NET Full Framework console application it works.Any suggestion?\nThanks### Assistant: amqmdnet.dllis only for .net framework not core.In the documentationlinkyou provided it states:From IBM MQ Version 9.1.1, the amqmdnetstd.dll library is available for .NET Standard support on Windows. Sample applications, including source files, are also supplied; see Sample applications for .NET.I suggest you useamqmdnetstd.dll.\n"} +{"text": "### Human: I have a micro-service which subscribes to atopicin WebSphere MQ. The subscription ismanagedanddurable. I explicitly set thesubscription name, so that it can be used to connect back to the queue, after recovering from any micro service failure. The subscription works as expected.But I might have to scale up the micro service and run multiple instances. In this case I will end up with having multiple consumers to the same topic. But here it fails with error2429 : MQRC_SUBSCRIPTION_IN_USE. I am not able to run more than one consumer to the topic subscription. Note : A message should be sent only to one of the consumers.Any thought ?IBM Websphere Version : 7.5\nI use the C-client API to connect to the MQ.### Assistant: When using a subscriber what you describe is only supported via the IBM MQ Classes for JMS API. In v7.0 and later you can use Cloned subscriptions (this is a IBM extension to the JMS spec), in addition in MQ v8.0 and later you can alternately use Shared subscriptions which is part of the JMS 2.0 spec. With these two options, multiple subscribers can be connected to the same subscription and only one of them will receive each published message.UPDATE 20170710According to this APARIV96489: XMS.NET DOESN'T ALLOW SHARED SUBSCRIPTIONS EVEN WHEN CLONESUP PROPERTY IS ENABLED, XMS.NET is also supposed to support Cloned subscriptions but due to a defect this is will not be supported until 8.0.0.8 or 9.0.0.2 or if you request the IFIX for the APAR above.You can accomplish something similar with other APIs like C by converting your micro-service to get from a queue instead of subscribing to a topic.To get the published messages to the queue you have two options:Setup a administrative subscription on the queue manager. You can do this a few different ways. The example below would be using a MQSC command.DEFINE SUB('XYZ') TOPICSTR('SOME/TOPIC') DEST(SOME.QUEUE)Create a utility app that can open a queue and create a durable subscription with that provided queue, the only purpose of this app would be to subscribe and unsubscribe a provided queue, it would not be used to consume any of the published messages.Using the above method, each published message can only be read (GET) from the queue by one process or thread.\n"} +{"text": "### Human: Can there more than one listener to a queue manager ? I have used one listener/queue manager combination so far and wonder if this possible. This is because we have 2 applications connecting to same queue manager and seems to have problem with that.### Assistant: There are a couple meanings for the termlistenerin an MQ context. Let's see if we can clear up some confusion over the terminology and then answer the question as it relates to each.As defined in the spec, aJMS listeneris an object that implements a callback mechanism. It listens on destinations for messages and callsonMessagewhen they arrive. The destinations may be queues or topics hosted by any JMS-compliant transport provider.In IBM MQ terms, alisteneris a process (runmqlsr) that handles inbound connection requests on a server. Although these can handle a variety of protocols, in practice they are almost exclusively TCP listeners that bind a port (1414 by default) and negotiate connection requests on sockets.TCP PortsTim's answer applies to the second of these contexts. MQ can listen for sockets on multiple ports and indeed it is quite common to do so. Each listener listens on one and only one port. It may listen on that port across all network interfaces or can be bound to a specific network interface. No two listeners can bind to the same combination of interface and port though.In a B2B context the best practice is to run a dedicated listener for each external business partner to isolate each of their connections across dedicated access paths. Internally I usually recommend separate ports for QMgr-to-QMgr, app-to-QMgr and interactive user connections.In that sense it is possible to run multiple listeners on a given QMgr. Each of those listeners can accept many connections. Their job is to negotiate the connection then hand the socket off to a Message Channel Agent which talks to the QMgr on behalf of the remotely connected client or QMgr.JMS ListenersBased on comments, Ulab refers to JMS listeners. These objects establish a connection to a queue manager and then wait inGETmode for new messages arriving on a destination. On arrival of a message, they call theonMessagemethod which is an asynchronous callback routine.As to the question \"can there more than one (JMS) listener to a queue manager?\" the answer is definitely yes. A multi-threaded application can have multiple listeners connected, multiple application instances can connect at the same time, and many thousands of application connections can be handled by a single queue manager with sufficient memory, disk and CPU available.Of course, each of these applications is ultimately connected to one or more queues so then the question becomes one of whether they can connect tothe samequeue.Many listeners can listen on the same queue so long as they do not get exclusive access to it. Each will receive a portion of the messages arriving.Listeners on QMgr-managed subscriptions are exclusively attached to a dynamic queue but multiple instances on the same topic will all receive the same messages.If the queue is clustered and there is more than one instance of it multiple listeners will be required to get all the messages since they will normally be distributed by MQ workload distribution across those instances.\n"} +{"text": "### Human: i'm trying to make transactional an entire flow of Spring integration, the flow starts with an adapter to an IBM MQ Queue, and then we have a complex flow with ActiveMQ Queues, and i'm getting a com.atomikos.icatch.HeurHazardException: Heuristic Exception when atomikos is trying to register the resources.Here's my applicationContext.xml.\n \n \n \n \n \n\n\n\n \n \n \n\n\n\n \n\n\n\n \n \n \n\n\n\n \n \n\n\n \n \n \n \n\n\n\n \n \n \n\n\n\n\n\n.\n. //OTHER SPRING INTEGRATION ELEMENTS\n.\n //Final Channel to the output adapter.\n\n\n\n \n \n \n \n com.atomikos.icatch.standalone.UserTransactionServiceFactory\n \n \n \n\n\n\n \n \n\n\n\n \n\n\n\n\n \n \n \n \n\n\n \n\n\n\n \n \n \nThis is the exception:INFO com.atomikos.icatch.config.imp.AbstractUserTransactionService USING core version: 3.9.3\nINFO com.atomikos.icatch.config.imp.AbstractUserTransactionService USING com.atomikos.icatch.automatic_resource_registration = true\nINFO com.atomikos.icatch.config.imp.AbstractUserTransactionService USING com.atomikos.icatch.client_demarcation = false\nINFO com.atomikos.icatch.config.imp.AbstractUserTransactionService USING com.atomikos.icatch.threaded_2pc = false\nINFO com.atomikos.icatch.config.imp.AbstractUserTransactionService USING com.atomikos.icatch.serial_jta_transactions = true\nINFO com.atomikos.icatch.config.imp.AbstractUserTransactionService USING com.atomikos.icatch.serializable_logging = true\nINFO com.atomikos.icatch.config.imp.AbstractUserTransactionService USING com.atomikos.icatch.log_base_dir = .\\\nINFO com.atomikos.icatch.config.imp.AbstractUserTransactionService USING com.atomikos.icatch.max_actives = 50\nINFO com.atomikos.icatch.config.imp.AbstractUserTransactionService USING com.atomikos.icatch.checkpoint_interval = 500\nINFO com.atomikos.icatch.config.imp.AbstractUserTransactionService USING com.atomikos.icatch.enable_logging = true\nINFO com.atomikos.icatch.config.imp.AbstractUserTransactionService USING com.atomikos.icatch.output_dir = .\\\nINFO com.atomikos.icatch.config.imp.AbstractUserTransactionService USING com.atomikos.icatch.log_base_name = tmlog\nINFO com.atomikos.icatch.config.imp.AbstractUserTransactionService USING com.atomikos.icatch.max_timeout = 300000\nINFO com.atomikos.icatch.config.imp.AbstractUserTransactionService USING com.atomikos.icatch.tm_unique_name = 10.200.204.8.tm\nINFO com.atomikos.icatch.config.imp.AbstractUserTransactionService USING java.naming.factory.initial = com.sun.jndi.rmi.registry.RegistryContextFactory\nINFO com.atomikos.icatch.config.imp.AbstractUserTransactionService USING java.naming.provider.url = rmi://localhost:1099\nINFO com.atomikos.icatch.config.imp.AbstractUserTransactionService USING com.atomikos.icatch.service = com.atomikos.icatch.standalone.UserTransactionServiceFactory\nINFO com.atomikos.icatch.config.imp.AbstractUserTransactionService USING com.atomikos.icatch.force_shutdown_on_vm_exit = false\nINFO com.atomikos.icatch.config.imp.AbstractUserTransactionService USING com.atomikos.icatch.default_jta_timeout = 10000\nWARN com.atomikos.datasource.xa.XAResourceTransaction XAResourceTransaction 10.200.204.8.tm001540002610.200.204.8.tm157: no XAResource to commit - the required resource is probably not yet intialized?\nWARN com.atomikos.icatch.imp.CommitMessage Unexpected error in commit\ncom.atomikos.icatch.HeurHazardException: Heuristic Exception\nat com.atomikos.datasource.xa.XAResourceTransaction.commit(XAResourceTransaction.java:707)\nat com.atomikos.icatch.imp.CommitMessage.send(CommitMessage.java:72)\nat com.atomikos.icatch.imp.PropagationMessage.submit(PropagationMessage.java:83)\nat com.atomikos.icatch.imp.Propagator$PropagatorThread.run(Propagator.java:79)\nat com.atomikos.icatch.imp.Propagator.submitPropagationMessage(Propagator.java:58)\nat com.atomikos.icatch.imp.HeurHazardStateHandler.onTimeout(HeurHazardStateHandler.java:131)\nat com.atomikos.icatch.imp.CoordinatorImp.alarm(CoordinatorImp.java:933)\nat com.atomikos.timing.PooledAlarmTimer.notifyListeners(PooledAlarmTimer.java:112)\nat com.atomikos.timing.PooledAlarmTimer.run(PooledAlarmTimer.java:99)\nat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)\nat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)\nat java.lang.Thread.run(Thread.java:744)I need the entire flow from the inputChannel to concentradorOutputChannel to be within the TX.Thanks for your help.### Assistant: Solved, just needed to remove the files tmlog.lck and tmlog6.log\n"} +{"text": "### Human: I have connected remotely to a QMgr via MQ Explorer on Windows. The MQ server version is 7.5.0.1. I can put messages inSYSTEM.ADMIN.COMMAND.EVENTfrom MQ Explorer successfully and when I dumpSYSTEM.ADMIN.COMMAND.EVENT, I can see my messages. As long as I know, I should be able to run PCF commands and MQSC commands via this channel. So, I putDISPLAY QMGR ALLmessage inside this queue and I can successfully see this message on MQ Server. My question is how can I run this message remotely via this channel? Thanks.IBM Doc indicates that I should be able to receive the command result inSYSTEM.MQSC.REPLY.QUEUE. But I can not browse this queue from client MQ Explorer. The queue type for this queue isModel.### Assistant: Couple of problems here.First, you are using the wrong queue. The command server listens onSYSTEM.ADMIN.COMMAND.QUEUE. The queue to which you are sending messages,SYSTEM.ADMIN.COMMAND.EVENTis the queue to which the QMgr puts event messages after executing commands, provided of course that command events are enabled.The second problem, as Jason mentions, is that therunmqscprocessor takes human-readable script and converts it into commands the QMgr can understand. Passing textual commands directly to the command server won't work.Typically we do what you want by passing the commands to runmqsc directly such as...echo DISPLAY QMGR ALL | runmqsc MYQMGRNAMEIf you require the ability to do this as a client, then you want to either downloadSupportPac MO72, or head over to MQ Gem and pick up a copy ofMQSCX. Either of these will accept the command above on a local queue manager, and both can also be supplied with MQ Channel params and connect to a remote QMgr.In addition to this basic functionality, the MQSCX product also has its own internal script parsing and execution. Suppose, for instance, that you want to do something depending on the command level of the QMgr.Usingrunmqscyou could issue the command above, filter the resulting 2-column output throughgrep,awk, or similar, then capture the final output into a variable. You might need to do this multiple times to capture multiple values, invoking a newrunmqsceach time and parsing the output in your script. You must then generate the string for the actual command you wanted to run when you started all this, and pass it to another invocation ofrunmqsc.Alternatively, MQSCX lets you issue theDISPLAYcommand, then reference the resulting values directly by name. For example, you can pass MQSCX a couple lines of script telling it to inquire on the QMgr and then take a conditional action based on the command version, all without ever having to drop back into shell, bat or Perl script.Full disclosure, I do not work for or get a commission from MQ Gem. I just don't like to beat my head against the wall writing 100 lines of code where 2 will do. If you do any amount of MQSC scripting, the ROI on MQSCX is measured in minutes. And it happens to be 100% on-topic as an answer to this question.\n"} +{"text": "### Human: I want to log messages that come into MQ Queue to database/file or another logging queue and I can not modify existing code. Are there any methods to implement some kind of message logging utility that will act like HTTP sniffer? Or maybe MQ have some built-in finctionality to log messages?Thanks in advance for your ansers.### Assistant: I think this is possible by creating ALIAS QUEUE that points to a topic.AssumingRECV.Qas the queue that your application currently receives messages from and processes.1) First create a topic, sayLOG.TO.DATABASE.2) Then create an alias queueALIAS.LOG.TO.DATABASEwithBase objectset toLOG.TO.DATABASEand setBase TypeasTopic.3) Then create a local queueLOG.TO.DATABASE.Q4) Create a durable subscription,SUB.FOR.RECV.Qthat points toRECV.Qas destination.5) Create another durable subscriptionSUB.FOR.LOG.TO.DABASEthat points toLOG.TO.DATABASE.Qas destinationNow the sender application need to put messages toALIAS.LOG.TO.DATABASE. Since the alias queue actually points to topic, the messages gets published ontoLOG.TO.DATABASE. To this topic we have two subscriptions registered, so both will get the same message. Your consumer application will continue to work as is whereas a new application can be written to process messages from other subscription.\n"} +{"text": "### Human: On several occasions I have received the following error from a .Net (C#, 4.0) application out of the blue on sending a message thru a producer:CWSMQ0082E: Failed to send to CompCode: 2, Reason: 2009. A problem was encountered whilst sending a message. See the linked exception for more information.Of course, theLinkedException(why not use theInnerExceptionIBM???) is null i.e. no more information available.Code I'm using (pretty straightforward):var m = _session.CreateBytesMessage();\nm.WriteBytes(mybytearray);\n\nm.JMSReplyTo = myreplytoqueue;\nm.SetIntProperty(XMSC.JMS_IBM_MSGTYPE, MQC.MQMT_DATAGRAM);\n\nm.SetIntProperty(XMSC.JMS_IBM_REPORT_COA, MQC.MQRO_COD);\nm.SetIntProperty(XMSC.JMS_IBM_REPORT_COD, MQC.MQRO_COA);\n\nmyproducer.Send(m, DeliveryMode.Persistent, mypriority, myttl);(Offtopic: I hate theSetIntPropertyway of setting properties. Which came up with that idea? It takes ages to look up all sorts of constants all over the place and its allowed values.)The exception is thrown on the .Send method. I'm using XMS.Net (IA9H / 2.0.0.7). Theonly Google resultthatturns upturns out to have a different reason code (and even if it were the same, it should be fixed in my version if I understand correctly). This occurs randomly (though it seems to happen more often when it's been a while since a message has been sent/received) and I have no way to reproduce this.I have ab-so-lute-lynoidea how to troubleshoot this or even where to start looking. Is this something caused by the server-side? Is it caused by XMS.net or some underlying IBM WebSphere MQ infrastructure?Some results that I found thatseemsimilar are suggesting to setSHARECNVto any value higher than 0 or to \"true\" / \"yes\" butthe documentationexplicitly tells me the default is 10. Also; I have no idea if this is the cause so changing it to another value feels like a shotgun approach.Anybody any idea on how to go about solving this? I could of course just catch the exception, tear everything (channels, sessions, whatever) down and restart but that's just plain ugly IMHO.### Assistant: The 2009 return code means \"Connection Broken.\" Basically, the underlying TCP socket is gone and the client finds out about it at the time of the API call. It is possible to tune the channels using heartbeat and keepalive so that WMQ tries harde to keep the socket alive. However if the socket is timed out by the underlying infrastructure, nothing WMQ can do will help. Examples we've seen are that firewalls and load balancers are often set to detect idle connections and sever them.Modern versions of WMQ client will attempt toreconnect transparently. The application just blocks a bit longer when this occurs.Short of using the automatic reconnect, the only solution is in fact to rebuild the connection. Since it will get a new connection handle, all the object handles must be rebuilt as well.Many of the tuning functions described here are available through theclient configuration file, available in v7.0 and greater clients. In particular, theTCP stanzaof that file enables keepalive. (The TCP spec says that if keepalive is provided, it must be disabled by default.) The QMgr hasa similar ini filewith configuration stanzas, including one for keepalive. The latest WMQ client is available asSupportPac MQC71if you need that.\n"} +{"text": "### Human: Does anyone know if there is an implementation ofjavax.jms.QueueConnectionFactoryfor WebSphere MQ and where to get it? I Googled it and searched IBM website but couldn't find anything. I don't want to retrieve the connection or factory from Websphere MQ via JNDI, I need my own connection factory.### Assistant: I think you need three jarscom.ibm.mq.jar\ncom.ibm.mqbind.jar\ncom.ibm.mqjms.jarYou instantiate aMQQueueConnectionFactoryand i hope you can take it from there.And here's more info:IBMs HOWTOOh, and MQ can do \"real\" JMS instead of MQ - only the JMS implementation seemed to have problems closing the Channel properly - at least in our environment.\n"} +{"text": "### Human: I have Sender and receiver console applications for IBM MQ XMS. The sender populates the Queue and the receiver dequeue the queue manger using receive method. I am using the while loop with bool value to keep running the receiver so that whenever a new message is available in the queue receiver can get that data.\nNow i want to change the receiver code to Asynchronous Message Listener instead of consumer.Receive().\nThe code snippet is,consumerAsync = sessionWMQ.CreateConsumer(destination); \nmessageListener = new MessageListener(OnMessageCallBack);\nconsumerAsync.MessageListener = messageListener;\n\nconnectionWMQ.Start();\nWhile(true)\n{\n console.writeline(\"Wait for message\");\n}The above code fetches only the already available data and not the new one. For example if i have 2 data in my queue while starting the receiver application those messages getting downloaded. but when i keep the receiver application running and send a new data from sender app its not getting downloaded and i have to restart the receiver application to get that data. The similar scenario was working fine with\nsynchronous mode consumer.ReceiveNoWait().What am I missing?### Assistant: Version of XMS? Version 9.2 has a bug that was confirmed by IBM 10.28.2020. They're working on a fix.No APAR yet.Temporary solution would be to downgrade to client version 9.1.Update: Received a fix built on version 9.2.0.1IT34722. Tested ok. Should be released with fixpack 9.2.0.4.\n"} +{"text": "### Human: I am currently reading from a remote queue, which is filled with transactions (messages). I am reading it by accessing the queue and measuring the size of records.getOptions.options = MQC.MQGMO_CONVERT + MQC.MQGMO_WAIT;queue.getCurrentDepth();Only when the size of the queue is greater than 0. I proceed to get the message.My problem is that for some messages I get the following error:\nMQJE001: Completion Code '2', Reason '2033'.But only for some messages, the funny thing is that I have a custom retry variable and the 3rd retry gets a blank message.My possible solutions:At first I thought it could be the waitInterval and I have been varying it from 150 ms to 30 seconds. For some messages I get them correctly in less than 100 ms. But the messages that give me problems take all the waitInterval and then give the error and get the blank message to the third retry.The second test was to verify the parameters of the MQMessage class, where I originally have:messageType: 8encoding: 273format:characterSet: 0When I get a message correctly, the following parameters remain:messageType: 8encoding: 273format: MQSTRcharacterSet: 819When I have a message that causes error 2033 at the third retry I get a blank message and the parameters change to the following:messageType: 8encoding: 273format:characterSet: 819I came to think that the messages in the queue were not indicating the correct format. So I contacted support and they verified that all messages have the correct conversion headers.So I am still in doubt as to why this problem, if someone has faced something similar, would appreciate your comment. Thank you.### Assistant: You are treating IBM MQ as a database and that will cause you all kinds of grief.This is how you should be retrieving the messages:MQGetMessageOptions gmo = new MQGetMessageOptions();\ngmo.options = CMQC.MQGMO_WAIT + CMQC.MQGMO_FAIL_IF_QUIESCING;\ngmo.waitInterval = 5000; // wait up to 5 seconds\nMQMessage receiveMsg = null;\nboolean getMore = true;\n\nwhile(getMore)\n{\n receiveMsg = new MQMessage();\n\n try\n {\n // get the message on the queue\n queue.get(receiveMsg, gmo);\n\n /*\n * Now go do something with the message\n */\n }\n catch (MQException e)\n {\n if ( (e.completionCode == CMQC.MQCC_FAILED) &&\n (e.reasonCode == CMQC.MQRC_NO_MSG_AVAILABLE) )\n {\n // No message - loop again\n }\n else\n {\n System.out.println(\"MQException: \" + e.getLocalizedMessage());\n System.out.println(\"CC=\" + e.completionCode + \" : RC=\" + e.reasonCode);\n getMore = false;\n }\n }\n catch (IOException e)\n {\n System.out.println(\"IOException:\" +e.getLocalizedMessage());\n }\n}\n"} +{"text": "### Human: We have enabled SSL onMQ version '7.1.0.7'OS->'Linux 2.6.32-642.11.1.el6.x86_64'two months back [aug-2016] and its working fine with SSL enabled and disabled modeJava Client usesjdk1.7.0_21Worked cipher/suite ->SSL_RSA_WITH_RC4_128_SHA <> RC4_SHA_USWhen I try to connect to a MQ v7.1.0.7 queue manager the application is throwing below error:com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2397'.\n at com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:228)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnection(MQClientManagedConnectionFactoryJ11.java:553)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnection(MQClientManagedConnectionFactoryJ11.java:593)\n at com.ibm.mq.StoredManagedConnection.(StoredManagedConnection.java:95)\n at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:198)\n at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:882)In the queue manager error logAMQERR01.LOGI see this:AMQ9616: The CipherSpec proposed is not enabled on the server.\n\n EXPLANATION: The SSL or TLS subsystem at the server end of a channel\n been configured in such a way that it has rejected the CipherSpec\n proposed by an SSL or TLS client. This rejection occurred during the\n secure socket handshake (i.e. it happened before the proposed\n CipherSpec was compared with the CipherSpec in the server channel\n definition).We have aMQ v6.0.2.12queue manager where this is working fine.Could some one provide help what went wrong for system , which was working before?Resolved by adding below lines in qm.ini fileSSL:\n AllowSSLV3=Y\n AllowWeakCipherSpec=YUpdated (2017/01/27) with additional questions:Worked belowTLSv1TLS_RSA_WITH_DES_CBC_SHA SSL_RSA_WITH_DES_CBC_SHA TLSv1 TRUETLS_RSA_WITH_3DES_EDE_CBC_SHA SSL_RSA_WITH_3DES_EDE_CBC_SHA TLSv1 TRUEFailed withTLSv1.2TLS_RSA_WITH_RC4_128_SHA256 SSL_RSA_WITH_RC4_128_SHA TLSv1.2 FALSEI tried with these settings:SSLContext sslContext = SSLContext.getInstance(\"TLSv1\");-Dcom.ibm.mq.cfg.preferTLS=true-Dcom.ibm.mq.cfg.useIBMCipherMappings=falseError iscom.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2397'In theAMQERR01.LOGThere is a mismatch between the CipherSpecs on the local and remote ends\nof channel 'TEST.CH'. The channel will not run until this mismatch is \nresolved.The CipherSpec required in the local channel definition is \n'TLS_RSA_WITH_RC4_128_SHA256'. The name of the CipherSpec negotiated during\nthe SSL handshake is 'RC4_SHA_US'. A code is displayed if the name of the\nnegotiated CipherSpec cannot be determinedUpdated (2017/01/29) with additional questions:SSLContext sslContext = SSLContext.getInstance(\"TLSv1.2\");MQEnvironment.sslFipsRequired = true;MQEnvironment.sslCipherSuite =\"SSL_RSA_WITH_AES_256_CBC_SHA256\";ALTER CHANNEL(TEST.CH) CHLTYPE(SVRCONN) SSLCIPH(TLS_RSA_WITH_AES_256_CBC_SHA256)REFRESH SECURITY TYPE(SSL)Client Execute/apps/java/jdk1.7.0_21/bin/java -Dcom.ibm.mq.cfg.preferTLS=true -Dcom.ibm.mq.cfg.useIBMCipherMappings=false -classpath .:/tmp/mqssl/com.ibm.mq.jmqi.jar:/tmp/mqssl/com.ibm.mq.jar:com.ibm.ws.webservices.thinclient_8.5.0.jar MQProducerSSLGetting error asMQJE001: Completion Code '2', Reason '2400'MQRC_UNSUPPORTED_CIPHER_SUITE (2400)Updated (2017/01/30) with additional questions:Still same error , but in my client java prg have enabledSystem.setProperty(\"javax.net.debug\", \"all\");to see all activities while execute client. Its PrintingTLS_RSA_WITH_AES_256_CBC_SHA256asIgnoring unavailable cipher suiteas belowIgnoring unavailable cipher suite: TLS_RSA_WITH_AES_256_CBC_SHA256Before callMQJE001: Completion Code '2', Reason '2400'. \nMQJE001: Completion Code '2', Reason '2400'.Tested with IBM-JDK-71 Same ExceptionSSL_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA<><>ECDHE_ECDSA_3DES_EDE_CBC_SHA256SSL_ECDHE_RSA_WITH_NULL_SHA<><>ECDHE_RSA_NULL_SHA256Updated (2017/01/31) with additional questions:com.ibm.mq.jarSpecification-Version: 7.1.0.1 \nSpecification-Vendor: IBM Corporation \nImplementation-Title: WebSphere MQ classes for Java \nImplementation-Version: 7.1.0.1 - k710-001-120424com.ibm.mq.jmqi.jarSpecification-Version: 7.1.0.1 \nSpecification-Vendor: IBM Corporation \nImplementation-Title: WebSphere MQ Interface for Java \nImplementation-Version: 7.1.0.1 - k710-001-120424Updated (2017/01/31 A) with additional questions:Since MQ and Client Running in same machine ,gotSpecification-Version: 7.1.0.7jarsTesting done with 2 scenariosby changing the classpathWithout-Dcom.ibm.mq.cfg.useIBMCipherMappings=falsejdk1.7.0_21/bin/java -Dcom.ibm.mq.cfg.preferTLS=true -classpath .:/opt/mqm/java/lib/com.ibm.mq.jmqi.jar:/opt/mqm/java/lib/com.ibm.mq.jar MQProducerSSLgot exceptionMQJE001: Completion Code '2', Reason '2400'With-Dcom.ibm.mq.cfg.useIBMCipherMappings=false/apps/hostlink/java/jdk1.7.0_21/jdk1.7.0_21/bin/java -Dcom.ibm.mq.cfg.preferTLS=true -Dcom.ibm.mq.cfg.useIBMCipherMappings=true -classpath .:/opt/mqm/java/lib/com.ibm.mq.jmqi.jar:/opt/mqm/java/lib/com.ibm.mq.jar MQProducerSSLgot exceptionMQJE001: Completion Code '2', Reason '2393'com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2393'. \nat com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:232) \nat com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnection(MQClientManagedConnectionFactoryJ11.java:553) \nat com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnection(MQClientManagedConnectionFactoryJ11.java:593) \nat com.ibm.mq.StoredManagedConnection.(StoredManagedConnection.java:96) \nat com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:198) \nat com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:893) \nat com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:780) \nat com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:729) \nat com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:177) \nat com.ibm.mq.MQQueueManager.(MQQueueManager.java:674) \nat MQProducerSSL.main(MQProducerSSL.java:89) \nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2393;AMQ9204: Connection to host 'localhost(2017)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2393;AMQ9771: SSL handshake failed. [1=java.lang.IllegalArgumentException[Cannot support TLS_RSA_WITH_AES_256_CBC_SHA256 with currently installed providers],3=localhost/127.0.0.1:2017 (localhost),4=SSLSocket.createSocket,5=default]],3=localhost(2017),5=RemoteTCPConnection.makeSocketSecure]Updated (2017/01/31 B) with additional questions:MQEnvironment.sslFipsRequired = false; \nMQEnvironment.sslCipherSuite = \"TLS_RSA_WITH_AES_128_CBC_SHA256\"; \nALTER CHANNEL(TEST.CH) CHLTYPE(SVRCONN) SSLCIPH(TLS_RSA_WITH_AES_128_CBC_SHA256) \n/apps/hostlink/java/jdk1.7.0_21/jdk1.7.0_21/bin/java -Dcom.ibm.mq.cfg.preferTLS=true -Dcom.ibm.mq.cfg.useIBMCipherMappings=false -classpath .:/opt/mqm/java/lib/com.ibm.mq.jmqi.jar:/opt/mqm/java/lib/com.ibm.mq.jar MQProducerSSLMQJE001: Completion Code '2', Reason '2397'.MQJE001: Completion Code '2', Reason '2397'.\ncom.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2397'.\n at com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:232)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnection(MQClientManagedConnectionFactoryJ11.java:553)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnection(MQClientManagedConnectionFactoryJ11.java:593)\n at com.ibm.mq.StoredManagedConnection.(StoredManagedConnection.java:96)\n at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:198)\n at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:893)\n at com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:780)\n at com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:729)\n at com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:177)\n at com.ibm.mq.MQQueueManager.(MQQueueManager.java:674)\n at MQProducerSSL.main(MQProducerSSL.java:89)Worked below TLSv1----Spec----TLS_RSA_WITH_DES_CBC_SHA---Suite----SSL_RSA_WITH_DES_CBC_SHATLSv1 TRUENot working , when given below parameters , throwing **MQJE001: Completion Code '2', Reason '2400'** \n\n-Dcom.ibm.mq.cfg.useIBMCipherMappings=false \n-Dcom.ibm.mq.cfg.preferTLS=truedoubt on TLSv1 , if TLSv1 working without above parameters , why need to provide -Dcom.ibm.mq.cfg.preferTLS=true for TLSv2?even with IBM-JDK 7.1 also TLSv2 not working, what could be issue?Need to try with MQ8?Updated (2017/02/01) with additional questions:Complete Exception in consoleMQJE001: Completion Code '2', Reason '2397'.\ncom.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2397'.\n at com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:232)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnection(MQClientManagedConnectionFactoryJ11.java:553)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnection(MQClientManagedConnectionFactoryJ11.java:593)\n at com.ibm.mq.StoredManagedConnection.(StoredManagedConnection.java:96)\n at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:198)\n at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:893)\n at com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:780)\n at com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:729)\n at com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:177)\n at com.ibm.mq.MQQueueManager.(MQQueueManager.java:674)\n at MQProducerSSL.main(MQProducerSSL.java:89)\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2397;AMQ9204: Connection to host 'localhost(2017)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2397;AMQ9771: SSL handshake failed. [1=javax.net.ssl.SSLHandshakeException[Error signing certificate verify],3=localhost/127.0.0.1:2017 (localhost),4=SSLSocket.startHandshake,5=default]],3=localhost(2017),5=RemoteTCPConnection.protocolConnect]\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:2098)\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1347)\n at com.ibm.mq.MQSESSION.MQCONNX_j(MQSESSION.java:924)\n at com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:221)\n ... 10 more\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2397;AMQ9771: SSL handshake failed. [1=javax.net.ssl.SSLHandshakeException[Error signing certificate verify],3=localhost/127.0.0.1:2017 (localhost),4=SSLSocket.startHandshake,5=default]\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:1310)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnection.connect(RemoteConnection.java:714)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSessionFromNewConnection(RemoteConnectionSpecification.java:356)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSession(RemoteConnectionSpecification.java:265)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionPool.getSession(RemoteConnectionPool.java:144)\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1709)\n ... 13 more\nCaused by: javax.net.ssl.SSLHandshakeException: Error signing certificate verify\n at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)\n at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1886)\n at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:276)\n at sun.security.ssl.ClientHandshaker.serverHelloDone(ClientHandshaker.java:987)\n at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:285)\n at sun.security.ssl.Handshaker.processLoop(Handshaker.java:868)\n at sun.security.ssl.Handshaker.process_record(Handshaker.java:804)\n at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1016)\n at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312)\n at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1339)\n at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1323)\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection$6.run(RemoteTCPConnection.java:1280)\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection$6.run(RemoteTCPConnection.java:1273)\n at java.security.AccessController.doPrivileged(Native Method)\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:1271)\n ... 18 more\nCaused by: java.security.NoSuchAlgorithmException: SHA224withRSA Signature not available\n at java.security.Signature.getInstance(Signature.java:224)\n at sun.security.ssl.JsseJce.getSignature(JsseJce.java:241)\n at sun.security.ssl.HandshakeMessage$CertificateVerify.(HandshakeMessage.java:1552)\n at sun.security.ssl.ClientHandshaker.serverHelloDone(ClientHandshaker.java:982)\n ... 29 morefrom AMQERR01.LOG----- amqrmrsa.c : 930 --------------------------------------------------------\n01/31/2017 08:45:00 PM - Process(14444.328) User(mqm) Program(amqrmppa)\n Host(testvm) Installation(Installation1)\n VRMF(7.1.0.7) QMgr(TLSTEST.QM)\n\nAMQ9665: SSL connection closed by remote end of channel '????'.\n\nEXPLANATION:\nThe SSL or TLS connection was closed by the remote host 'localhost (127.0.0.1)'\nduring the secure socket handshake. The channel is '????'; in some cases its\nname cannot be determined and so is shown as '????'. The channel did not start.\nACTION:\nCheck the remote end of the channel for SSL and TLS errors. Fix them and\nrestart the channel.\n----- amqccisa.c : 6478 -------------------------------------------------------\n01/31/2017 08:45:00 PM - Process(14444.328) User(mqm) Program(amqrmppa)\n Host(testvm) Installation(Installation1)\n VRMF(7.1.0.7) QMgr(TLSTEST.QM)\n\nAMQ9492: The TCP/IP responder program encountered an error.\n\nEXPLANATION:\nThe responder program was started but detected an error. \n\nThe host name was 'localhost (127.0.0.1)'; in some cases the host name cannot\nbe determined and so is shown as '????'.\nACTION:\nLook at previous error messages in the error files to determine the error\nencountered by the responder program.\n----- amqrmrsa.c : 930 --------------------------------------------------------removed old jars from classpath , but still same exceptionConsole Output have below lines printed for Algorithmmatching alias: ibmwebspheremqtlstest.qm\n*** Certificate chain\nchain [0] = [\n[\n Version: V3\n Signature Algorithm: SHA1withRSA,In client , passing key.jks file , which is created at MQ level with 'runmqckm'whether need to specify different Algorithm on creation for TLSv2 ?TLSV2 WORKED WITH JDK8 and ibm/java-x86_64-71SSLContext sslContext = SSLContext.getInstance(\"TLSv1.2\");Oracle JDK8MQEnvironment.sslFipsRequired = false; \nMQEnvironment.sslCipherSuite = \"TLS_RSA_WITH_AES_128_CBC_SHA256\"; \nALTER CHANNEL(TEST.CH) CHLTYPE(SVRCONN) SSLCIPH(TLS_RSA_WITH_AES_128_CBC_SHA256)IBM-JDK 7.1MQEnvironment.sslFipsRequired = false;\nMQEnvironment.sslCipherSuite = \"SSL_RSA_WITH_NULL_SHA256\";\nALTER CHANNEL(TEST.CH) CHLTYPE(SVRCONN) SSLCIPH(TLS_RSA_WITH_NULL_SHA256)But question onhow to work any TLSv2 cipher with lesser version of Oracle java than 8?To resolve/work-around the issue:will try one by one1) use the IBM JVM2) test with Oracle Java v83) Try MQ v84) other option to setSSLCAUTH=OPTIONALand not require client side certificate.Trying with JDK8 and MQ8Now Trying to do the same with JDK8 + MQ8 , MQServer8 and MQSeriesGSKit-8.0.0-4.x86_64 installed , but now issue with creating certificate with runmqckm commandexport LD_LIBRARY_PATH=/opt/mqm/gskit8/lib64 \nexport PATH=$PATH:/opt/mqm/gskit8/bin \nrunmqckm \n\nbash: runmqckm: command not foundpartially Worked with runmqakmBut failed to create jks files as belowrunmqakm -keydb -create -db /var/mqm/qmgrs/TLSTEST\\!QM/ssl/key.jks -pw password -type jks \nCTGSK3017W The database type \"jks\" is not recognized.ResolvedNo Need to set below pathexport LD_LIBRARY_PATH=/opt/mqm/gskit8/lib64 \nexport PATH=$PATH:/opt/mqm/gskit8/bin### Assistant: IBM MQFix Pack 7.1.0.7released November 19th 2015 includes the following APAR:IV73396: DEPRECATION OF SSLV3 CIPHERSPECS IN WEBSPHERE MQ V7 QUEUE MANAGERSPROBLEM DESCRIPTION:Once this change is applied, any queue managers created will disallow the use of the following CipherSpecs on channel definitions associated with the queue manager:AES_SHA_USRC4_SHA_USRC4_MD5_USTRIPLE_DES_SHA_USDES_SHA_EXPORT1024RC4_56_SHA_EXPORT1024RC4_MD5_EXPORTRC2_MD5_EXPORTDES_SHA_EXPORTNULL_SHANULL_MD5FIPS_WITH_DES_CBC_SHAFIPS_WITH_3DES_EDE_CBC_SHAAttempting to use or configure one of these CipherSpecs will result in one or more of the following messages in the queue manager error log: AMQ8242,AMQ9616, AMQ9635.This was a result of SSLv3 being formally deprecated in June 2015 as a result of the IETF approving and publishingRFC7568IntroductionSince it was released in 1996, the SSLv3 protocol [RFC6101] has been subject to a long series of attacks, both on its key exchange mechanism and on the encryption schemes it supports. Despite being replaced by TLS 1.0 [RFC2246] in 1999, and subsequently TLS 1.1 in 2002 [RFC4346] and 1.2 in 2006 [RFC5246], availability of these replacement versions has not been universal. As a result, many implementations of TLS have permitted the negotiation of SSLv3.The predecessor of SSLv3, SSL version 2, is no longer considered sufficiently secure [RFC6176]. SSLv3 now follows.There is a very good IBM developerWorks blog post \"SSL and TLS Cipher Specification Deprecations for the MQ Product\" posted May 19 2016 by Miguel A. Rodriguez that goes into detail about which ciphers are deprecated in various Fix Packs.I would recommend that you find a supported TLSv1.2 cipher to use that is compatible with both the Java client and the IBM MQ SVRCONN channel. There were many updates as a result of SSLv3 being deprecated which opened up more TLS ciphers to Java clients using either IBM or Non-IBM JREs.A good write up about the changes IBM made to the Java client cipher support is IBM developerWorks blog post \"MQ Java, TLS Ciphers, Non-IBM JREs & APARs IT06775, IV66840, IT09423, IT10837 -- HELP ME PLEASE!\" posted on June 9th 2016 by Tom Leend.The reason you do not have a problem with IBM MQ v6.0.2.12 is because that version has been out of support for over four years (since September 30th 2012) and IBM would not release any security updates for a End of Service version like it does for supported versions.I would recommend that you move to a supported version of IBM MQ. When considering which version to upgrade to, note that two of thecurrentlysupported versions will be going out of support over the next 16 months:MQ v7.1 goes out of support in less than four months onApril 30th 2017.MQ v7.5 goes out of support onApril 30th 2018.MQ v8.0 and v9.0 do not have currently announced end of support dates.IBM developerWorks blog post \"MQ Java, TLS Ciphers, Non-IBM JREs & APARs IT06775, IV66840, IT09423, IT10837 -- HELP ME PLEASE!\" states that APARIV66840which added theuseIBMCipherMappingssetting is included in 7.1.0.7 and this should allow the use of TLSv1.2 Cipherspecs with a Oracle JRE.The table in the APARIV66840has this information:The following WebSphere MQ CipherSuite to CipherSpec mappings have\nbeen enabled by this APAR for WebSphere MQ v7.1 and v7.5 where the\nclasses for Java and classes for JMS support SHA-2:\ufff4Oracle CipherSuite IBM MQ CipherSpec\nTLS_RSA_WITH_NULL_SHA256 TLS_RSA_WITH_NULL_SHA256\nTLS_RSA_WITH_AES_128_CBC_SHA256 TLS_RSA_WITH_AES_128_CBC_SHA256\nTLS_RSA_WITH_AES_256_CBC_SHA256 TLS_RSA_WITH_AES_256_CBC_SHA256If you compare that to the v7.1 Knowledge center pageSpecifying CipherSpecs, you find that all three of those are TLSv1.2 Cipherspecs.For comparison with the IBM JRE Ciphersuite name, the v7.1 Knowledge center pageSSL CipherSpecs and CipherSuites in WebSphere MQ classes for Javalists a similar mapping:IBM CipherSuite IBM MQ CipherSpec\nSSL_RSA_WITH_NULL_SHA256 TLS_RSA_WITH_NULL_SHA256\nSSL_RSA_WITH_AES_256_CBC_SHA TLS_RSA_WITH_AES_256_CBC_SHA\nSSL_RSA_WITH_AES_256_CBC_SHA256 TLS_RSA_WITH_AES_256_CBC_SHA256UPDATE (2017/01/27) to address further questionsThe MQ CipherSpec TLS_RSA_WITH_RC4_128_SHA256 is not one of those listed in APARIV66840has having been enabled for non-IBM JREs under MQ v7.1, it is only listed under v8.0. Above I listed the three TLSv1.2 CipherSpecs that were added to MQ v7.1.I would suggest you try TLS_RSA_WITH_AES_256_CBC_SHA256 as the CipherSpec on the MQ channel and TLS_RSA_WITH_AES_256_CBC_SHA256 as the Java CipherSuite.The settings below should work with the my suggested CipherSpec/CipherSuite, please note that I changed it fromTLSv1toTLSv1.2SSLContext sslContext = SSLContext.getInstance(\"TLSv1.2\");\n-Dcom.ibm.mq.cfg.preferTLS=true\n-Dcom.ibm.mq.cfg.useIBMCipherMappings=falseUPDATE (2017/01/30) to try and address further questionsIn your question you mention these jar files in your classpath:/tmp/mqssl/com.ibm.mq.jmqi.jar:/tmp/mqssl/com.ibm.mq.jarWill you please confirm which version of the IBM MQ product each of these are from, you can do this on linux with the unzip utility:unzip -p com.ibm.mq.jar META-INF/MANIFEST.MF|grep Implementation-VersionOutput will be:Implementation-Version: x.x.x.x - pxxx-xxx-YYMMDDUPDATE (2017/01/31) to address further questionsAPARIV66840which includes the-Dcom.ibm.mq.cfg.useIBMCipherMappings=falsesetting is not included in MQ until v7.1.0.7, this is the version you stated is being used.Based on the output you provided the jar files you are referencing are from a v7.1.0.1 install which doesnotinclude support for TLS on non-IBM JREs such as Oracle JRE.You also note that the jar files are in/tmp/mqssl, please note that prior to v8 of MQ IBM does not support copying the jar files outside of the default location where they are installed.IBM Technote \"Supported way to install WebSphere MQ Java jar files, JMS jar files, or C/C++ libraries\" states:+++ Section 1: MQ 7.xThe only supported way to get the MQ jar files or the MQ C/C++ library files onto a system is to install either:the WebSphere MQ product orthe WebSphere MQ Client SupportPacs.To legally download and use a client you must first accept the terms and conditions specified in the License Agreement.Do not copy the WebSphere MQ jar files to application EAR or WAR files.Do not copy the WebSphere MQ jar or MQ C/C++ library files from other machines:Fix Packs cannot be applied to an \"installation\" where jar or C/C++ library files have been copied from another machine, and this makes it much more difficult to ensure that all of these jar/library files are kept in step with each other, and are at compatible levels.Copying jar/library files between machines can also result in multiple copies of the files residing on the same machine, which can cause problems servicing the code and debugging problems.If your application is on the same server as the MQ v7.1.0.7 Queue Manager then you can just reference the jar file that are in the directory/opt/mqm/java/lib.If your application is not on the same server and you plan to stay with v7.1 or go with v7.5 I would recommend installing the latest full client install, see my note above on suggestions for versions based on when they are End of Service.If you decide to go with v8 or v9, IBM Technote \"Supported way to install WebSphere MQ Java jar files, JMS jar files, or C/C++ libraries\" also states:b) Starting with MQ 8.0.0.4, you can use Redistributable files:Installation scenarios for MQ 8.0 and 9.0 in Linux and Windows- Chapter 8: You need to redistribute MQ runtime libraries with your application.How to download the MQ 8.0.0.4+ and MQ 9.0.0.x redistributable client images for Linux x86-64 and Windows 64-bitBitesize Blogging: MQ 8.0.0.4 Redistributable ClientsWhat this means is that with v8.0.0.4 and higher you can download a MQ JMS and Java only redistributable client.The MQ JMS and Java only redistributable client client packages are available from FixCentralhere.UPDATE (2017/01/31 A) to address further questionsAfter searching on the error you are receiving I found this dW Answers post \"Why do I get AMQ9771, 2393 SSL Initialization error from a MQ Java/JMS application when trying to use an TLS AES 256 cipher?\". It states that the following:In this case, the issue is caused by attempting to use AES 256 strong\ncipher algorithms.Most Java JREs, including Oracle/Sun and IBM's have Import Limits on\nCryptographic Algorithms enabled. This limits the maximum key sizes\nand also some algorithms.When trying to use a AES 256 cipher, such as\nECDHE_RSA_AES_256_CBC_SHA384 orTLS_RSA_WITH_AES_256_CBC_SHA256with a\nMQ Java/JMS application, you need to ensure your JRE supports this\ncipher. In most cases, when the stronger cipher algorithms are needed,\nsuch as AES 256 ciphers, the JCE Unlimited Strength Jurisdiction\nPolicy Files must be obtained and installed in the JDK/JRE.This is noted in the JDK/JRE documentation: For Oracle 1.7:http://docs.oracle.com/javase/7/docs/technotes/guides/security/SunProviders.htmlThe link above to the oracle site states:If stronger algorithms are needed (for example, AES with 256-bit\nkeys), theJCE Unlimited Strength Jurisdiction Policy Filesmust be\nobtained and installed in the JDK/JRE.It is the user's responsibility to verify that this action is\npermissible under local regulations.I would suggest that you either use the lower CipherSuiteTLS_RSA_WITH_AES_128_CBC_SHA256, or follow the advise above to obtain and install theJCE Unlimited Strength Jurisdiction Policy Files.UPDATE (2017/02/01) to address further questionsThe error that caught my eye wasCaused by: java.security.NoSuchAlgorithmException: SHA224withRSA Signature not available.I searched on google for this and found the following dW Answers post \"How to resolve issue with MQ v7.x Java client getting SSL error NoSuchAlgorithmException: SHA224withRSA Signature not available?\" which states the following:Assuming using Oracle JVM:We have found that the root cause of the issue is the signature\nalgorithm SHA224withRSA is not supported by Oracle JRE 1.7, see\nsignature algorithms available:https://docs.oracle.com/javase/7/docs/technotes/guides/security/SunProviders.htmlIn the above link the table of interest is under \"The SunRsaSign Provider\" which lists the following supported signature algorithms:MD2withRSAMD5withRSASHA1withRSASHA256withRSASHA384withRSASHA512withRSANote thatSHA224withRSAisnoton the list.The same dW Answers post goes on to state:This signature algorithm is available in the IBM JVM and also in\nOracle JVM 1.8.https://docs.oracle.com/javase/8/docs/technotes/guides/security/SunProviders.htmlIn the above link the table of interest is under \"The SunRsaSign Provider\" which lists the following supported signature algorithms:MD2withRSAMD5withRSASHA1withRSASHA224withRSASHA256withRSASHA384withRSASHA512withRSANote thatSHA224withRSAison the list.Recommendations from the dW post:Try with Oracle Java 8 (1.8)Try with IBM JavaUPDATE (2017/02/01 B) to address further questionsTaking into account all of the information gathered through the troubleshooting above the answer is that it is not possible to use a TLSv1.2 cipher with a Oracle Java less than 8 using MQ v7.1.0.7 MQ Java client.Based on the last dW Answers post I provided, IBM suggested trying with MQ v8, but I do not think they tested this configuration so it may also not work.If you do want to try with MQ v8 I would suggest you go with the latest v8.0.0.5 Java only redistributable client client packages which I provided links already.\n"} +{"text": "### Human: I'd like to implement a kind of a tracing mechanism within IIB. Can the IIB (WMB) publish messages to a topic, using the MQ* nodes and not JMS*? I don't see any node that could do so.### Assistant: Using the below code, you could set the Topic.SET OutputRoot.Properties.Topic = 'Sample';This will be followed by Publication Node which submits the message to the topic. This will be given out to any subscribers waiting for that topic.\n"} +{"text": "### Human: Hello I have one big problem with connecting to IBM WebSphere MQ using JMSI use:Win 7JDK 1.7IBM WebSphere MQ server 7.5.0.2GlassFish 4.0I make one QueueManager namedtest1and one queue in that namedtest1qand one channel for negotiation namedtest1channelMy code is here:StandaloneSender s = new StandaloneSender();\ntry{\n s.send(\u201chello word\u201d);\n}catch (Exception e){\n e.printStackTrace();\n}StandaloneSender.javaimport javax.jms.Message;\nimport javax.jms.QueueConnection;\nimport javax.jms.QueueSender;\nimport javax.jms.QueueSession;\nimport javax.jms.Session;\nimport javax.naming.NamingException;\n\npublic class StandaloneSender {\n private P2PUtils utils;\n private QueueConnection connection;\n private QueueSession session;\n private QueueSender sender;\n public void send(String message) throws NamingException, JMSException, IOException {\n StandaloneSender sender = new StandaloneSender();\n sender.connect();\n sender.sendMessage(message);\n sender.disconnect();\n }\n\n public StandaloneSender() {\n utils = new P2PUtils();\n }\n\n private void connect() throws NamingException, JMSException {\n connection = utils.getConnection();\n session =\n connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\n sender = session.createSender(utils.getQueue());\n System.out.println(\"Sender started.\");\n }\n\n private void sendMessage(String text) throws JMSException {\n Message message = session.createTextMessage(text);\n sender.send(message);\n System.out.println(\n \"Sent message <\"\n + text\n + \"> with ID <\"\n + message.getJMSMessageID()\n + \">\");\n }\n private void disconnect() throws JMSException {\n sender.close();\n session.close();\n connection.close();\n System.out.println(\"Sender stopped.\");\n }\n}P2PUtils.javaimport javax.jms.JMSException;\nimport javax.jms.Queue;\nimport javax.jms.QueueConnection;\nimport javax.jms.QueueConnectionFactory;\nimport javax.naming.Context;\nimport javax.naming.NamingException;\n\npublic class P2PUtils extends JmsUtils {\n\n private static final String QCF_NAME = \"test1\";\n private static final String QUEUE_NAME = \"test1q\";\n\n public QueueConnection getConnection() throws NamingException, JMSException {\n Context context = getInitialContext();\n QueueConnectionFactory qcf =\n (QueueConnectionFactory) context.lookup(QCF_NAME);\n return qcf.createQueueConnection();\n }\n\n public Queue getQueue() throws NamingException {\n Context context = getInitialContext();\n return (Queue) context.lookup(QUEUE_NAME);\n }\n}JmsUtils.javaimport java.util.Properties;\n\nimport javax.naming.Context;\nimport javax.naming.InitialContext;\nimport javax.naming.NamingException;\n\npublic class JmsUtils {\n private static final String CF_CLASS_NAME = \"com.ibm.mq.jms.context.WMQInitialContextFactory\";\n private static final String WMQ_URL = \"localhost:1414/SYSTEM.DEF.SVRCONN\";\n\n protected Context getInitialContext() throws NamingException {\n Properties props = new Properties();\n props.put(Context.INITIAL_CONTEXT_FACTORY, CF_CLASS_NAME);\n props.put(Context.PROVIDER_URL, WMQ_URL);\n return new InitialContext(props);\n }\n}But I have got this exception from glassfish:[2014-02-17T16:35:25.286+0330] [glassfish 4.0] [SEVERE] [] [] [tid: _ThreadID=25 _ThreadName=Thread-4] [timeMillis: 1392642325286] [levelValue: 1000] [[\n javax.naming.ServiceUnavailableException: Unable to connect to the target queue manager localhost:1414/SYSTEM.DEF.SVRCONN [Root exception is com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2539'.]\n at com.ibm.mq.jms.context.MQContext.(MQContext.java:196)\n at com.ibm.mq.jms.context.WMQInitialContextFactory.getInitialContext(WMQInitialContextFactory.java:29)\n at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)\n at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)\n at javax.naming.InitialContext.init(InitialContext.java:242)\n at javax.naming.InitialContext.(InitialContext.java:216)\n at com.surena.MQ.JmsUtils.getInitialContext(JmsUtils.java:17)\n at com.surena.MQ.P2PUtils.getConnection(P2PUtils.java:16)\n at com.surena.MQ.StandaloneSender.connect(StandaloneSender.java:32)\n at com.surena.MQ.StandaloneSender.send(StandaloneSender.java:22)\n at com.surena.servlet.MainServlet.doGet(MainServlet.java:50)\n at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)\n at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)\n at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)\n at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)\n at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)\n at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)\n at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)\n at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)\n at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)\n at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357)\n at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)\n at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188)\n at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)\n at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)\n at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)\n at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)\n at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)\n at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)\n at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)\n at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)\n at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)\n at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)\n at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)\n at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)\n at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)\n at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)\n at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)\n at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)\n at java.lang.Thread.run(Thread.java:744)\nCaused by: com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2539'.\n at com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:247)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnection(MQClientManagedConnectionFactoryJ11.java:588)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnection(MQClientManagedConnectionFactoryJ11.java:630)\n at com.ibm.mq.StoredManagedConnection.(StoredManagedConnection.java:107)\n at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:205)\n at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:911)\n at com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:799)\n at com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:750)\n at com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:157)\n at com.ibm.mq.MQQueueManager.(MQQueueManager.java:757)\n at com.ibm.mq.pcf.PCFAgent.connect(PCFAgent.java:230)\n at com.ibm.mq.pcf.PCFAgent.(PCFAgent.java:163)\n at com.ibm.mq.pcf.PCFMessageAgent.(PCFMessageAgent.java:140)\n at com.ibm.mq.jms.context.MQContext.(MQContext.java:183)\n ... 39 more\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2539;AMQ9204: Connection to host 'localhost(1414)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2539;AMQ9503: Channel negotiation failed. [3=SYSTEM.DEF.SVRCONN]],3=localhost(1414),5=RemoteConnection.initSess]\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:2053)\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1226)\n at com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.jmqiConnect(InterceptedJmqiImpl.java:311)\n at com.ibm.mq.ese.jmqi.ESEJMQI.jmqiConnect(ESEJMQI.java:337)\n at com.ibm.mq.MQSESSION.MQCONNX_j(MQSESSION.java:924)\n at com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:236)\n ... 52 more\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2539;AMQ9503: Channel negotiation failed. [3=SYSTEM.DEF.SVRCONN]\n at com.ibm.mq.jmqi.remote.impl.RemoteConnection.initSess(RemoteConnection.java:1111)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnection.connect(RemoteConnection.java:727)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSessionFromNewConnection(RemoteConnectionSpecification.java:400)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSession(RemoteConnectionSpecification.java:299)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionPool.getSession(RemoteConnectionPool.java:164)\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1598)\n ... 57 more]]And this from IBM MQ2/17/2014 14:41:51 - Process(3924.1) User(MUSR_MQADMIN) Program(runmqlsr.exe)\n Host(PROGRAMMER1) Installation(Installation1)\n VRMF(7.5.0.2)\nAMQ6118: An internal WebSphere MQ error has occurred (20006047)\n\nEXPLANATION:\nAn error has been detected, and the MQ error recording routine has been called.\nACTION:\nUse the standard facilities supplied with your system to record the problem\nidentifier and to save any generated output files. Use either the MQ Support\nsite: http://www.ibm.com/software/integration/wmq/support/, or IBM Support\nAssistant (ISA): http://www.ibm.com/software/support/isa/, to see whether a\nsolution is already available. If you are unable to find a match, contact your\nIBM support center. Do not discard these files until the problem has been\nresolved. \n----- amqxfdcp.c : 867 --------------------------------------------------------\n2/17/2014 14:41:51 - Process(3924.1) User(MUSR_MQADMIN) Program(runmqlsr.exe)\n Host(PROGRAMMER1) Installation(Installation1)\n VRMF(7.5.0.2)\nAMQ6184: An internal WebSphere MQ error has occurred on queue manager test1 \n .\n\nEXPLANATION:\nAn error has been detected, and the WebSphere MQ error recording routine has\nbeen called. The failing process is process 3924.\nACTION:\nUse the standard facilities supplied with your system to record the problem\nidentifier and to save any generated output files. Use either the MQ Support\nsite: http://www.ibm.com/software/integration/wmq/support/, or IBM Support\nAssistant (ISA): http://www.ibm.com/software/support/isa/, to see whether a\nsolution is already available. If you are unable to find a match, contact your\nIBM support center. Do not discard these files until the problem has been\nresolved.I used all jar file that included in MQ installation directoryplease help me.### Assistant: From your exception from glassfish I've picked out the interesting bits:-javax.naming.ServiceUnavailableException: Unable to connect to the target\nqueue manager localhost:1414/SYSTEM.DEF.SVRCONN [Root exception is\ncom.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2539'.\n\n\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2539;\nAMQ9204: Connection to host 'localhost(1414)' rejected.\n[1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2539;\nAMQ9503: Channel negotiation failed. [3=SYSTEM.DEF.SVRCONN]],\n3=localhost(1414),5=RemoteConnection.initSess]\n\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2539;\nAMQ9503: Channel negotiation failed. [3=SYSTEM.DEF.SVRCONN]There are various hints here for you. The first is the MQRC return code 2539. You can look this up using the mqrc command line tool that comes with IBM MQ. Just typemqrc 2539and it will report:-2539 0x000009eb MQRC_CHANNEL_CONFIG_ERROR.Also we have a couple of error messages:-AMQ9204: Connection to host 'localhost(1414)' rejected.\nAMQ9503: Channel negotiation failed. [3=SYSTEM.DEF.SVRCONN]You can see the full error message description using the mqrc tool as well, just typemqrc AMQ9204. So we're getting the idea here that your network connection (channel) was not working right and the queue manager didn't like it for some reason. The next thing is to see what the queue manager had to say about it, as you did. In you error log you say you saw:-2/17/2014 14:41:51 - Process(3924.1) User(MUSR_MQADMIN) Program(runmqlsr.exe)\n Host(PROGRAMMER1) Installation(Installation1)\n VRMF(7.5.0.2)\nAMQ6118: An internal WebSphere MQ error has occurred (20006047)Now this is indicating that there is likely an FDC file that has been cut as well which will give more details, but there is also another error code that you can look up, again with the mqrc tool. Type inmqrc 0x20006047and it will report:-536895559 0x20006047. xecX_E_CONV_NOT_SUPThis suggests that it was unable to cope with data conversion between your client and the queue manager. The FDC file will give you more details.\n"} +{"text": "### Human: I need to install a fresh copy of Websphere MQ Server on a Windows machine.However, the queue manager and other details need to be migrated from the Websphere MQ Server which is in place on another system.Of what I could gather from my excavations from the internet is that there exists a support pac(MS03) from IBM which provides with the functionality. The executable beingsaveqmgr.exefor MQ versions upto 7.0 and dmpmqcfg for MQ 7.1 on Windows platform.My question is: what should be the command that should be run to secure the details of the queue manager?Also,after getting the required information in a file how do I userunmqsccommand to restore all the definitions?Thanks in advance!### Assistant: The following command can be used to backup the queue manager config using saveqmgr (MS03 Support Pac) to a file:saveqmgr -m QUEUE_MANAGER -f BACKUP_FILEThe following command can be used to backup the queue manager config using dmpmqcfg in version 7.1 and higher to a file:dmpmqcfg -m QUEUE_MANAGER > BACKUP_FILEThe following command can be used to restore the queue manager config using runmqsc:runmqsc QUEUE_MANAGER < BACKUP_FILEFor the aboveQUEUE_MANAGERis the name of the queue manager you want to backup/restore andBACKUP_FILEis the name of the text file containing the backup.\n"} +{"text": "### Human: I'm working on a standalone Java application that GETs several messages from one MQ queue, processes the data contained within the messages and then PUTs a new message onto another MQ queue. One of the requirements is for the GET and PUT operations to be within the same unit of work and I am able to do this by specifyingMQGMO_SYNCPOINTandMQGMO_SYNCPOINTget/put message options.What I don't understand how to do using the Java MQ API is perform the MQCMIT and MQBACK operations to explicitly commit or rollback the MQ unit of work.I've searched on the IBM MQ InfoCenter website and the JavaDoc but I can't find anything on the APIs used for committing and rolling back a unit of work.The version of WebSphere MQ I'm using is 7.5 and I'm connecting to the queue manager using binding mode.Would anyone be able to provide some example code showing how to explicitly commit or rollback the MQ unit of work using the Java MQ APIs or point me in the direction of the appropriate JavaDoc page please?### Assistant: The basic flow is that when you send the messages in a transaction it will hold the messages in a buffer until either a commit or rollback is called: if a commit is performed then the messages are sent, otherwise they are discarded.Below is a sample from Novell using the JMS APIs which should be the same as WebSphere MQ if you're using the JMS API :http://www.novell.com/documentation/extend52/Docs/help/MP/jms/tutorial/txSession-1.htmUPDATE :Below is another question on StackOverflow that has code for committing / rolling back using the Websphere MQ APIs :java websphere MQ\n"} +{"text": "### Human: Linux Server Box running WebSphere MQ Server v7.1:I have created a user 'mq-user' that belongs to 'mq-users' group in Linux. Then I created a queue managerQM_TEST, and used MQSC to issue the following commands to create a queue and set up the security:SET AUTHREC OBJTYPE(QMGR) PRINCIPAL('mq-user') AUTHADD(ALL)\nSET AUTHREC PROFILE(SYSTEM.MQEXPLORER.REPLY.MODEL) OBJTYPE(QUEUE) PRINCIPAL('mq-user') AUTHADD(INQ,DSP,GET)\nSET SET AUTHREC PROFILE(SYSTEM.ADMIN.COMMAND.QUEUE) OBJTYPE(QUEUE) PRINCIPAL('mq-user') AUTHADD(INQ,DSP,PUT)\nDEFINE CHANNEL (TEST_CHANNEL) CHLTYPE (SVRCONN) TRPTYPE (TCP) MCAUSER('mq-user')\nSET CHLAUTH(TEST_CHANNEL) TYPE(ADDRESSMAP) ADDRESS(*) MCAUSER('mq-user')\nDEFINE QLOCAL (TEST_QUEUE)\nSET AUTHREC PROFILE(TEST_QUEUE) OBJTYPE(QUEUE) PRINCIPAL('mq-user') AUTHADD(ALL)\nDEFINE LISTENER (TEST_LISTENER) TRPTYPE (TCP) CONTROL (QMGR) PORT (1414)\nSTART LISTENER (TEST_LISTENER)Linux Client Box running WebSphere MQ Client v7.1 and WebSphere MQ Explorer:I am logged in as my username (arrehman) which is not part of mq-users group. However I am able to access the queue I created above both via a Java Application and via MQ Explorer clientwithout passing any user credentials. Why is it this way if security is in effect?Any further details needed, please let me know. Thanks.### Assistant: This line:SET CHLAUTH(TEST_CHANNEL) TYPE(ADDRESSMAP) ADDRESS(*) MCAUSER('mq-user')Says the following:For connections requestingTEST_CHANNEL...Originating fromanyIP address...Set the MCAUSER tomq-userIn other words, enable the channel such that any connections inherit the privileges ofmq-userregardless of where they originate and what identity they present. So the behavior you are seeing is the expected behavior based on theCHLAUTHrule above.There are a few other problems with the rules as listed:The use ofPRINCIPALrather thanGROUP. On non-windows servers if you specifyPRINCIPALwhat happens is that the QMgr looks up that ID, queries its primary group and then sets authorizations based on that. So ifmq-usershas a primary group ofstafforusersthat that is what gets authorized instead ofmq-usersand is probably not what you intended. Always usegroupso that you get the result you intend withsetmqautorAUTHREC.GrantingALLon the QMgr makes the ID/group administrative. One of the privileges at the QMgr level isSETand any user in a group withSETrights can set, among other things, authorization control lists. So even though you only grantedAUTHADD(INQ,DSP,PUT)themq-usersID can submit PCF commands to grant all access to all objects. Only grantCONNECTandINQUIREon the QMgr if that's all you need.There's an assumption stated (in bold, actually) that you would have expected to be required to pass user credentials. Please be aware that WMQ does not validate a user ID and password if you do provide them. It accepts the ID that you assert. The password field is available to exits which can be used to validate the ID and password against, for example, LDAP or the local OS. Such an exit can be purchased from a 3rd party or written but base WMQ doesn't do anything with the password. Had you specifiedUSERSRC(CHANNEL)on the mapping, then your ID would have been used and most likely rejected. But the rejection would have been either because it is in themqmgroup (which is blocked by a defaultCHLAUTHrule) or because there are noAUTHRECrecords for the group it is in.For more about hardening WMQ, there are a number of resources collectedhere. TheHardening WebSphere MQpresentation is from v7.0. Although v7.1 has new controls, the principals remain the same:Authenticate the connection using IP filtering (for apps or QMgrs where the connection originates in a locked datacenter), SSL/TLS and/or an exitMap the authenticated identity to anMCAUSERvalue by hard-coding it in the channel or by using an exit orCHLAUTHrule to dynamically set itAdministrative connections and high-value applications should be authenticated using TLS\n"} +{"text": "### Human: I have wrote an MQ app, which is exe, but it only runs for a single instance and terminates itself. The desired functionality is to have it running continuously and keep processing the data and once the data is exhausted, it should keep listening for the new data.May some one please suggest me what needs to be done?Thanks!### Assistant: Currently your application probably loops through messages until it gets back a return code indicating that the queue is empty. In order to keep listening for new data, you need to do two things:Don't exit the loop when you get back a return code for \"empty queue.\" Loop around and attempt anotherReceive(). Youmustcombine this with the next recommendation though.When you perform theReceive()do so using a time-out. For example,consumer.Receive(20000)will wait 20 seconds for the next message before timing out.If you do not include the timeout, then the application will throw massive numbers of unsatisfied GET requests at the QMgr which will appear to be a runaway app and/or a runaway QMgr and you will see processes with high CPU utilization.You could sleep betweenReceive()calls but this is not very performant. Using aReceive(TIMEOUT)blocks the thread only while no messages are available. As soon as a message arrives, there is no delay in passing it to the thread. If you manually sleep the thread, it must poll the queue and will only do so at setsleep()intervals.The alternative is that you can set up a callback method so that the thread doesn't block. For example, if you have a callback methodOnNewMessageCallbackyou can create an async message listener withMessageListener messageListener = new MessageListener(OnNewMessageCallback);Both of these methods are described in the samples. If you installed the SDK and samples, these will be underC:\\Program Files (x86)\\IBM\\WebSphere MQ\\tools\\dotnet\\samplesor the equivalent, depending on where you installed WMQ.In case you are wondering how to tell the difference between \"no message on queue\" and some more serious error, check theMQException.ReasonCode. If it is 2033, then theReceive()timed out. That and all the other reason codes are definedhere.Once you have a program that will successfully loop around and wait for new messages, then you can either choose to run it as a service as described in Simon's response, or interactively as you do now.If you are developing on WMQ v6 please be aware that v6 is end-of-service as of September 2012 and that the .Net integration ismuchbetter in v7.0 or v7.1 of WMQ. You can download the latest WMQ v7.0 client with .Net classes fromSupportPac MQC7. The corresponding Infocenter ishere. The v7.1 client will be aSupportPacwhen it is released, but the exact name is not yet known. I'll try to remember to update this with a link when it is available. As of today, the v7.1 client is available through Passport Advantage using your IBM customer account. The v7.1 Infocenter ishere.\n"} +{"text": "### Human: I am trying to write a health check for our JMS connection that connects to MQ using IBM JMS integrations codeibm-messaging/mq-jms-spring. I need to detect that the connection to MQ has been lost. I hooked the exceptionListener for the DefaultJmsListenerContainerFactory and that tells me when I lose the connection to MQ but I cannot find anything in the JMS stack that tells me when the connection gets (re)established.Code that calls the ExceptionListener@Override\nprotected void establishSharedConnection() {\n try {\n super.establishSharedConnection();\n }\n catch (Exception ex) {\n if (ex instanceof JMSException) {\n invokeExceptionListener((JMSException) ex);\n }\n logger.debug(\"Could not establish shared JMS Connection - \" +\n \"leaving it up to asynchronous invokers to establish a Connection as soon as possible\", ex);\n }\n}### Assistant: From a strictly JMS perspective, when theonExceptionmethod of yourExceptionListeneris invoked it is up to your application to re-establish the JMS connection usingConnectionFactory.createConnection. This is a blocking call so once it returns successfully then you know the connection has been re-established.If you're delegating the JMS connection management to Spring it's unlikely you will be able to be informed about when the JMS connection is re-established. I don't see any hooks in Spring JMS for this.\n"} +{"text": "### Human: I need to send message from spring integration to Non jms application via IBM MQI have tried to send message but unfortunately, the receiver non jms application is not able consume due to unwanted Jms headers Included in the message and getting data format exceptionHow to remove jms headers before sending message to non jms application using spring integrationI have found some reference link in IBM MQ sitehttps://www.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q032140_.htm### Assistant: There are a number of ways to do this, as can be seen in the spread of comments and answers you have already received. How you do it really depends on you.As Daniel states you can modify the queue url.As Morag states you can use MQSC to alter the queue.You can also do this by code. You haven't provided any code so its not easy to tell you how to do this, but if you cast your destination (queue) to an MQDestination you can exclude the RFH2 headers using the IBM JMS API.RFH2 will be excludedimport javax.jms.Destination;\n import com.ibm.mq.jms.MQDestination;\n import com.ibm.msg.client.wmq.WMQConstants;\n ...\n\n Destination destination = ...\n ...\n\n\n MQDestination mqDestination = (MQDestination) destination;\n destination.setTargetClient(WMQConstants.WMQ_CLIENT_NONJMS_MQ);I have this tested with this service in Springimport com.ibm.mq.jms.MQDestination;\nimport com.ibm.msg.client.wmq.WMQConstants;\n\nimport org.apache.commons.logging.Log;\nimport org.apache.commons.logging.LogFactory;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.jms.core.JmsTemplate;\nimport org.springframework.stereotype.Service;\n\nimport javax.jms.*;\n\n@Service\npublic class SendMessageNonJmsService {\n\n protected final Log logger = LogFactory.getLog(getClass());\n\n final private JmsTemplate myNonJmsTemplate;\n\n @Autowired\n private ConnectionFactory connectionFactory;\n\n SendMessageNonJmsService(JmsTemplate myNonJmsTemplate) {\n this.myNonJmsTemplate = myNonJmsTemplate;\n }\n\n public void sendAsNonJms(String msg) {\n Destination destination = null;\n JMSContext context = connectionFactory.createContext();\n destination = context.createQueue(\"queue:///audit\");\n try {\n MQDestination mqDestination = (MQDestination) destination;\n mqDestination.setTargetClient(WMQConstants.WMQ_CLIENT_NONJMS_MQ);\n }\n catch (JMSException ex) {\n logger.warn(\"JMSException preparing message destination : \"\n + ex.getErrorCode() + \" : \"\n + ex.getMessage());\n }\n myNonJmsTemplate.send(destination, session -> session.createTextMessage(msg));\n }\n\n}As an alternative if you want your sending code to be as simple aspublic void sendAsNonJms(String msg) {\n myNonJmsTemplate.send(\"audit\", session -> session.createTextMessage(msg));\n }Then you can set a destination resolver on your JmsTemplate@Bean(\"myNonJmsTemplate\")\n public JmsTemplate myNonJmsTemplate() {\n JmsTemplate jmsTemplate = new JmsTemplate(connectionFactory);\n jmsTemplate.setDestinationResolver(new OurDestinationResolver());\n return jmsTemplate;\n }where your destination resolver looks something like:import com.ibm.mq.jms.MQDestination;\nimport com.ibm.msg.client.wmq.WMQConstants;\nimport org.apache.commons.logging.Log;\nimport org.apache.commons.logging.LogFactory;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.jms.support.destination.DestinationResolver;\n\nimport javax.jms.*;\n\npublic class OurDestinationResolver implements DestinationResolver {\n\n protected final Log logger = LogFactory.getLog(getClass());\n\n @Autowired\n private ConnectionFactory connectionFactory;\n\n @Override\n public Destination resolveDestinationName(Session session, String dest, boolean pubSub) throws JMSException {\n Destination destination = null;\n\n if (pubSub) {\n destination = session.createTopic(dest);\n } else {\n destination = session.createQueue(dest);\n }\n\n MQDestination mqDestination = (MQDestination) destination;\n mqDestination.setTargetClient(WMQConstants.WMQ_CLIENT_NONJMS_MQ);\n\n return destination;\n }\n}\n"} +{"text": "### Human: IBM goes to great lengths documenting the possible error-codes for different MQ-related functions, but I cannot find an existing library function to translate the integer codes into human-readable strings.Something like libc'sstrerror(3)or OpenSSL'sERR_error_string(3)...I suppose, the programmers and operators are expected to have a handy (if dog-eared) reference book...Or does the function exist -- and just is not easy to find?### Assistant: You can convert the number, e.g. 2035, into a string such as \"MQRC_NOT_AUTHORIZED\" using theMQRC_STRfunction that is shipped in header filecmqstrc.h.If you want more than just the string representation of the constant, you could look into calling themqrcexecutable that is shipped with distributed platform versions of IBM MQ, and scraping the output. In my view the string version of the constant is enough for most people.#include /* Include for MQI Constants */\n#include /* Convert MQRC into string */\n\n:\n\nMQCONN(QMName,\n &hConn,\n &CompCode,\n &Reason);\nif (Reason)\n{\n printf(\"MQCONN to QMgr %.48s failed with reason %d (%s)\\n\",\n QMName, Reason, MQRC_STR(Reason));\n :\n}\n"} +{"text": "### Human: I have a setup where there is a JMS Producer and JMS receiver. The sender application sends a message like :source text \u27e8\u0435, \u0451, \u0438, \u044e, \u044f\u27e9 abcdefgJMS receiver after receiving the message, puts it to a IBM MQ queue using pure IBM MQ API classes.While putting this message to MQ I am getting the below exception:INFO | 2020-09-17 09:45:19 | [main] mimq.MQReceiver (MQReceiver.java:211) - IO Exception Occurred: Input length = 1\njava.nio.charset.UnmappableCharacterException: Input length = 1\n at java.nio.charset.CoderResult.throwException(CoderResult.java:282)\n at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:816)\n at com.ibm.mq.jmqi.system.JmqiCodepage.stringToBytes(JmqiCodepage.java:923)\n at com.ibm.mq.MQMessage.writeString(MQMessage.java:2848)\n at com.ibm.mimq.MQReceiver.sendToAnotherQueue(MQReceiver.java:192)\n at com.ibm.mimq.MQReceiver.main(MQReceiver.java:113)Below is myMQ PUTcode :public static void sendToLocalQueue(String msg) {\n \n int port = 1414;\n String host = \"some-host\";\n String channel = \"some-channel\";\n String manager = \"some-QM\";\n String user = \"user\"; \n String passwd = \"passwd\";\n String qname = \"TEST\";\n String qmname = \"some-QM\";\n \n MQQueueManager qMgr;\n MQQueue inputQ;\n \n try { \n \n Hashtable h = new Hashtable();\n h.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);\n MQEnvironment.properties = h;\n MQEnvironment.hostname = host;\n MQEnvironment.port = port;\n MQEnvironment.channel = channel;\n \n MQEnvironment.userID = user;\n MQEnvironment.password = passwd;\n MQEnvironment.disableTracing();\n MQException.log = null;\n qMgr = new MQQueueManager(manager);\n \n MQMessage m = new MQMessage(); \n m.applicationOriginData = \"AMPS\";\n m.messageType = MQC.MQMT_DATAGRAM;\n m.format = MQC.MQFMT_STRING;\n m.encoding = MQC.MQENC_NATIVE;\n m.priority = 4;\n m.persistence = MQC.MQPER_PERSISTENT;\n m.characterSet = MQC.MQCCSI_Q_MGR;\n //m.characterSet = 1208;\n m.expiry = MQC.MQEI_UNLIMITED;\n m.writeString(msg);\n \n MQPutMessageOptions putOptions = new MQPutMessageOptions();\n putOptions.options = MQC.MQPMO_SYNCPOINT | MQC.MQPMO_FAIL_IF_QUIESCING; \n \n logger.info(\"Putting message to LAN MQ (TEST queue)....\"); \n qMgr.put(qname, qmname, m, putOptions);\n qMgr.commit();\n \n \n } catch(MQException me) {\n logger.info(\"Error Code : \" +me.getErrorCode());\n logger.info(\"LocalizedMessage : \" +me.getLocalizedMessage());\n logger.info(\"Message : \" +me.getMessage());\n logger.info(\"Reason : \" +me.getReason());\n me.printStackTrace();\n \n } catch (IOException e) {\n // TODO Auto-generated catch block\n logger.info(\"IO Exception Occurred : \" +e.getLocalizedMessage());\n e.printStackTrace();\n } \n}It is unable to put the message to the queue due to Unmappable character. The encoding is set to UTF-8 at Queue Manager level.However when I replace the below line :m.characterSet = MQC.MQCCSI_Q_MGR;With the line :m.characterSet = 1208;The issue is no more there.My question is why this conversion is not getting done at MQ level. What are settings I need to check to ensure the correct conversion. I have tried the below techniques, but not working :Setting java parameter as : -Dfile.encoding=UTF-8Myenvironment:Server : Linux\nMQ : 9.0 or 7.5\nJava : 1.8One more thing to mention, the same setup was working with 7.5 but not working with MQ 9.0 after migration. I know with my above one line code change I can pass the message. But I want to understand in MQ level, if I am missing out some configurations. Any advise would be much appreciated.Thank You.UPDATEThe Client Machine from where I am sending the Message over to MQ has CCSID :MQMD.CodedCharSetId = 1208The MQ server where I am connecting and sending the message has this :getDefaultProperty(Object) returns [819(0x333)] Integer\nsetCCSID(int) setter [819(0x333)]So when I am setting 1208 explicitely in my code it is working. When not the conversion is failing.UPDATE-2The valueMQC.MQCCSI_Q_MGR is Zeroas I saw in the jar. Hence the code is designed like this, if the value is Zero, it will fetch the default value from the Jar which is set to819. I learnt this when I turned on the MQ tracing. And the code is like this :getDefaultProperty(Object) returns [819(0x333)] Integer\nsetCCSID(int) setter [819(0x333)]This code is present inside the jar. So we need to explicitly set the charset value on the message. In my case it is 1208.### Assistant: The reason why this worked at MQ v7.5 and not at MQ v9.0 is because prior to IBM MQ v8.0 the IBM MQ classes for Java encoded data usingjava.nio.charset.Charset.encode(CharBuffer)which results in a default replacement of malformed or untranslatable data. Since the defaultcharacterSetis 819 (ASCII), this would result in any character you send that can not be converted to ASCII to be transparently replaced with the default replacement character, in most cases this means the data was replaced with the?character.After v8.0 the default behavior changed to report this situation as an error and no longer replace malformed or untranslatable data by default.Your solution to set the character set to UTF-8 is the best solution as this results in the exact data you intended to send being sent.Another option is to tell MQ to use the prior behavior.The description of the new behavior as well as how to configure IBM MQ classes for Java to use the prior behavior is described in the IBM MQ 9.0 Knowledge Center pageDeveloping applications>Developing JMS and Java applications>Using IBM MQ classes for Java>Character string conversions in IBM MQ classes for Java:From IBM\u00ae MQ Version 8.0, some of the default behavior regarding\ncharacter string conversion in the IBM MQ classes for Java\u2122 has\nchanged.Before IBM MQ Version 8.0, string conversions in IBM MQ classes for\nJava was done by calling the\njava.nio.charset.Charset.decode(ByteBuffer) and\nCharset.encode(CharBuffer) methods.Using either of these methods results in a default replacement (\nREPLACE) of malformed or untranslatable data.This behavior can obscure errors in applications, and lead to\nunexpected characters, for example ?, in translated data. From IBM MQ\nVersion 8.0, to detect such issues earlier and more effectively, the\nIBM MQ classes for Java use CharsetEncoders and CharsetDecoders\ndirectly and configure the handling of malformed and untranslatable\ndata explicitly.From IBM MQ Version 8.0, the default behavior is to REPORT such issues\nby throwing a suitable MQException....Setting system defaults--From IBM MQ Version 8.0, the following two Java system properties are\navailable to configure default behavior regarding character string\nconversion.com.ibm.mq.cfg.jmqi.UnmappableCharacterActionSpecifies the action to be taken for untranslatable data on encoding and decoding.\nThe value can be REPORT, REPLACE, or IGNORE.com.ibm.mq.cfg.jmqi.UnmappableCharacterReplacementSets or gets the replacement bytes to apply when a character cannot be mapped\nin an encoding operation The default Java replacement string is used\nin decoding operations.To avoid confusion between Java character and native byte\nrepresentations, you should specify\ncom.ibm.mq.cfg.jmqi.UnmappableCharacterReplacement as a decimal number\nrepresenting the replacement byte in the native character set.For example, the decimal value of ?, as a native byte, is 63 if the\nnative character set is ASCII-based, such as ISO-8859-1, while it is\n111 if the native character set is EBCDIC.If you wanted to mimic the prior behavior you would set the following system properties:-Dcom.ibm.mq.cfg.jmqi.UnmappableCharacterAction=REPLACE\n-Dcom.ibm.mq.cfg.jmqi.UnmappableCharacterReplacement=63You can also set it Programmatically with something like this:System.setProperty(\"com.ibm.mq.cfg.jmqi.UnmappableCharacterAction\", \"REPLACE\");\nSystem.setProperty(\"com.ibm.mq.cfg.jmqi.UnmappableCharacterReplacement\", \"63\");\n"} +{"text": "### Human: These packages seem to have similar functionality. What's the difference?### Assistant: IBMMQDotnetClientis \"IBM MQ classes for .NET Standard\" also known as known as Base .NET Classes.Where asIBMXMSDotnetClient: called XMS that has the same set of interfaces as the Java\u2122 Message Service (JMS) API.Renders a JMS-like API and Implements JMS 1.1 Specification. Most of the features available in IBMMQDotnetClient are available in XMS as well and on top of these features,there are additional features like \"Asynchronous message consumer\", Message selectors, Poison message handling etc.Basically the difference is if you want to use JMS-like API's and looking for features like Asynchronous message consumer or message selectors,then you can use XMS.\n"} +{"text": "### Human: I am able to connect to IBM mq through Pymqi using installed MQ client v9 on my Linux machine. There is requirement of connecting through SSL. How should I create key repository for two way TLS(mTLS)?### Assistant: I have configured mutual tls between a python application using PyMQI backed with theIBM MQ toolkit for MacOS(9.1.5.0) and a queue manager running on aRaspberry Pi(9.2.0.0).I have used self-signed certificates to make it easier to illustrate an end-to-end example of a TLS configuration with MQ. This would not normally be used in a production environment; your MQ administrator will typically provide any certificates that you might need to use which are often issued by a certificate authority. Where this is the case you can skip the certificate creation steps below.Here are the steps I took:Initial server and Python code setupSetup an IBM MQ server followingthis tutorialwhich provides the default developer configuration.Pulled in the the python sample code fromthis tutorialand put a message toDEV.QUEUE.1without TLS configured.General ConfigCreated some working directories on my Mac client.mkdir tlsTest\ncd tlsTest\nmkdir client\nmkdir serverQueue Manager configCreate the server keystore.cd serverrunmqakm -keydb -create -db key.kdb -pw -stashlsCheck to seekey.crl key.kdb key.rdb key.sth.Check that the store is empty.runmqakm -cert -list -db key.kdb -stashedNo certificates were found.Create the server certificate and put it in the new keystorekey.kdbrunmqakm -cert -create -db key.kdb -stashed -dn \"cn=qm,o=ibm,c=uk\" -label ibmwebspheremq -type cmsCheck the certificate.runmqakm -cert -list -db key.kdb -stashedCertificates found\n* default, - personal, ! trusted, # secret key\n- ibmwebspheremqqm1The '-' denotes the client's private key and personal certificate in this keystore.Extract the queue manager's public key.runmqakm -cert -extract -label ibmwebspheremq -db key.kdb -stashed -file QM.certCheck to see the certificate file.lsQM.cert key.crl key.kdb key.rdb key.sthInspect the certificate.runmqakm -cert -details -file QM.cert -stashedClient ConfigChange to the client directory.cd ../clientCreate the client keystore.runmqakm -keydb -create -db client.kdb -pw -stashCreate the client certificate and put it in the new keystoreclient.kdb.runmqakm -cert -create -db client.kdb -stashed -dn \"cn=pymqi,o=test,c=uk\" -label ibmwebspheremq -type cmsExtract the client's public key.runmqakm -cert -extract -label ibmwebspheremq -db client.kdb -stashed -file Client.certOptionally inspect the certificate by modifying previousrunmqakm -cert -listcommands from the earlier server steps.Exchange public keysPopulate the client's keystore with the queue manager's public key.runmqakm -cert -add -label ibmwebspheremq -db client.kdb -stashed -file ../server/QM.certCheck the certificate.runmqakm -cert -list -db client.kdb -stashedCertificates found\n* default, - personal, ! trusted, # secret key\n! ibmwebspheremqqm1\n- ibmwebspheremqappThe '!' shows that the queue manager's public key is trusted.Populate the queue manager's keystore with the client's public key.Change to the server directory.cd ../serverrunmqakm -cert -add -label ibmwebspheremq -db key.kdb -stashed -file ../client/Client.certCheck the certificates.runmqakm -cert -list -db key.kdb -stashedCertificates found\n* default, - personal, ! trusted, # secret key\n! ibmwebspheremqapp\n- ibmwebspheremqqm1Configure TLS on the Queue ManagerMove thekey.kdbandkey.sthfiles from thetlsTest/serverdirectory to/var/mqm/qmgrs/ssl/QM1directory on the queue manager's file system.Modify theDEV.APP.SVRCONNchannel to accept TLS 1.2 cipher suites.runmqsc QM1ALTER CHANNEL(DEV.APP.SVRCONN) CHLTYPE(SVRCONN) SSLCIPH(ANY_TLS12)Refresh the queue manager's security subsystem.REFRESH SECURITY(*) TYPE(SSL)TLS enabled the MQ PyMQI applicationAdd cipher spec and label into the Python app and include the sco options.cd.SSLCipherSpec = b'ANY_TLS12'\nsco = pymqi.SCO()\n#include file name but not file extension\nsco.KeyRepository = b'tlsTest/client/client'\nsco.CertificateLabel =b'ibmwebspheremqapp'Change theqmgr.connectline to addscooptions.qmgr.connect_with_options(queue_manager, user=b'app', password=b'', cd=cd, sco=sco)Test Python app.Alternate configuration to use environment variables to reference label and keystoreChange the python app to remove label and keystore.#sco = pymqi.SCO()\n#sco.KeyRepository = b'tlsTest/client/client'\n#sco.CertificateLabel =b'ibmwebspheremqapp'\n#qmgr.connect_with_options(queue_manager, user=b'app', password=b'', cd=cd, sco=sco)\nqmgr.connect_with_options(queue_manager, user=b'app', password=b'', cd=cd)Set environment variables.export MQSSLKEYR=tlsTest/client/client\nexport MQCERTLABL=ibmwebspheremqappTest Python app.\n"} +{"text": "### Human: I am trying to consume message from MQ but the code hangs and doesn't show output.JmsFactoryFactory FF = jmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\nJmsConnectionFactory cf = FF.createConnectionFactory();\ncf.setStringProperty(WMQConstants.WMQ_HOST_NAME, HOST);\ncf.setStringProperty(WMQConstants.WMQ_PORT, PORT);\ncf.setStringProperty(WMQConstants.WMQ_CHANNEL, CHANNEL);\ncf.setStringProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\ncf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, QMGR);\ncf.setStringProperty(WMQConstants.WMQ_APPLICATIONNAME, \"JMS\");\nConnection connection = cf.createConnection();\nSession session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);\ndestination = session.createQueue(queuename);\nMessageConsumer consumer1 = session.createConsumer(destination);\n\nMessage reply = consumer1.receive();\nSystem.out.println(reply);It doesn't show the message and hangs and doesn't even terminate.### Assistant: You need to callstart()on your instance ofjavax.jms.Connectionin order to get messages to flow to the consumer, e.g.:connection.start()Also, it's worth noting that callingjavax.jms.MessageConsumer#receive()is expected to block until a message is received so you're seeing the expected behavior there. If you don't want to block you can calljavax.jms.MessageConsumer#receive(long)and specify a timeout (in milliseconds).\n"} +{"text": "### Human: I am trying to publish a simple message to ibmmq using java.The message sending is successful.But when i check the queue on ibm console .The Message is showed asBut I am expecting as simple String.Here is my code.when I am trying to convert I am getting below message \nThe message of type jms_bytes can not have its body assigned to java.lang.Stringimport com.ibm.mq.*;\nimport com.ibm.mq.constants.MQConstants;\nimport com.ibm.mq.jms.MQQueueConnectionFactory;\nimport com.ibm.msg.client.jms.JmsFactoryFactory;\nimport com.ibm.msg.client.wmq.WMQConstants;\n\nimport javax.jms.*;\nimport java.io.IOException;\nimport java.util.Hashtable;\n\npublic class PublisherTest\n{\n static private String CHANNEL = \"anychannel\";\n static private int PORT = 1414;\n static private String HOST = localhost;\n static private String QMANAGER = \"QM1\";\n static private String QUEUE = \"queue.test\";\n static private String USER = USER;\n static private Hashtable props =\n new Hashtable();\n static MQQueueManager qMgr = null;\n\n static private void putMsgOnQueue(String message) {\n // Disabling IBM cipher suite mapping due to\n // using Oracle Java and not IBM Java\n System.setProperty(\"com.ibm.mq.cfg.useIBMCipherMappings\", \"false\");\n // Enabling SSL debug to view the communication\n System.setProperty(\"javax.net.debug\", \"ssl:handshake\");\n\n props.put(MQConstants.CHANNEL_PROPERTY, CHANNEL);\n props.put(MQConstants.PORT_PROPERTY, PORT);\n props.put(MQConstants.HOST_NAME_PROPERTY, HOST);\n props.put(MQConstants.USER_ID_PROPERTY, USER);\n props.put(MQConstants.PASSWORD_PROPERTY, PASSWORD);\n props.put(MQConstants.SSL_CIPHER_SUITE_PROPERTY, \"TLS_RSA_WITH_AES_256_CBC_SHA256\");\n\n\n try {\n\n qMgr = new MQQueueManager(QMANAGER, props);\n\n\n // MQOO_OUTPUT = Open the queue to put messages\n // MQOO_INPUT_AS_Q_DEF = Using queue-defined defaults\n int openOptions = MQConstants.MQOO_OUTPUT;\n\n\n // creating destination\n MQQueue queue = qMgr.accessQueue(QUEUE, openOptions);\n\n // specify the message options...\n MQPutMessageOptions pmo = new MQPutMessageOptions(); // Default\n\n\n // MQPMO_ASYNC_RESPONSE = MQPUT operation is completed without the\n // application waiting for the queue manager to complete the call\n // Using this option can improve messaging performance,\n // particularly for applications using client bindings.\n pmo.options = MQConstants.MQPMO_ASYNC_RESPONSE;\n\n // create message\n MQMessage mqMessage = new MQMessage();\n\n\n System.out.println(\"Writing message to queue: \" + QUEUE);\n mqMessage.writeString(message.toString());\n\n // Put message on queue\n queue.put(mqMessage, pmo);\n\n // Close queue\n queue.close();\n\n // Get status\n MQAsyncStatus asyncStatus = qMgr.getAsyncStatus();\n\n // Print status code (0 = successful)\n System.out.println(asyncStatus.reasonCode);\n\n } catch (MQException e) {\n System.out.println(\"The connection to MQ could not be established.\" + e.getMessage());\n\n } catch (IOException e) {\n System.out.println(\"Error while writing message.\" +\n e.getMessage());\n } finally {\n try {\n qMgr.disconnect();\n } catch (MQException e) {\n System.out.println(\"The connection could not be closed.\" +\n e.getMessage());\n }\n }\n }\n\n\n public static void main(String[] args) {\n\n putMsgOnQueue(\"WELCOME\");\n }\n}ANY Help Would be Appreciated.### Assistant: The default message format is MQFMT_NONE. This means the message body consists of bytes. Your code is not setting message format. So my thinking is that MQ Console is indicating such messages as binary.Suggest you set the message format as string and run. This sets the message format as string.MQMessage mqMessage = new MQMessage();\n mqMessage.format = MQConstants.MQFMT_STRING;\n"} +{"text": "### Human: I have developed a Java application to read the messages from MQ. The Java application has to read all the messages from the MQ, put them in to the list and return the list. I am usingwhileloop to read the messages one by one and breaking out if I caught the 2033 exception and return the list.My issue is I am getting 2033 exception after reading the single message. For example, I have pushed some 10 messages to the queue and run my application, the first loop reads the first message and put it in to the list. But in the second loop it throwing 2033 exception while getting the second message. Then I need to run the application to read the second message and same thing happens.Since I am new to MQ, I cant find the route cause why its happening. I am using Java8 and IBM MQ core library. Below is my code..package com.reciever.mq;\n\n\nimport com.ibm.mq.*;\nimport com.ibm.mq.constants.MQConstants;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\nimport java.io.IOException;\nimport java.util.*;\n\n\npublic class MQReceiver {\n\n private static final Logger LOGGER = LoggerFactory.getLogger(MQReceiver.class);\n\n private static int GET_OPTIONS_CONSTANT = MQConstants.MQGMO_WAIT |\n MQConstants.MQGMO_PROPERTIES_COMPATIBILITY |\n MQConstants.MQGMO_ALL_SEGMENTS_AVAILABLE |\n MQConstants.MQGMO_COMPLETE_MSG |\n MQConstants.MQGMO_ALL_MSGS_AVAILABLE |\n MQConstants.MQGMO_SYNCPOINT;\n\n public static MQQueueManager queueManager;\n\n public static void main(String[] args) throws MQException {\n\n Hashtable mqOptions = new Hashtable<>();\n\n mqOptions.put(MQConstants.HOST_NAME_PROPERTY, \"host.name\"); //just a placeHolder\n mqOptions.put(MQConstants.CHANNEL_PROPERTY, \"channelName\");\n mqOptions.put(MQConstants.USER_ID_PROPERTY, \"userName\");\n mqOptions.put(MQConstants.TRANSPORT_PROPERTY, MQConstants.TRANSPORT_MQSERIES);\n mqOptions.put(MQConstants.PORT_PROPERTY, 1980);\n\n queueManager = new MQQueueManager(\"queueManager\", mqOptions);\n int options = MQConstants.MQOO_INPUT_AS_Q_DEF | MQConstants.MQOO_OUTPUT\n | MQConstants.MQOO_FAIL_IF_QUIESCING | MQConstants.MQOO_PASS_ALL_CONTEXT | MQConstants.MQOO_INQUIRE;\n\n MQQueue mq = queueManager.accessQueue(\"queueNametoRead\", options);\n MQException.logExclude(2033);\n\n MQMessage mqMessage = new MQMessage();\n MQGetMessageOptions getOptions = new MQGetMessageOptions();\n getOptions.options = GET_OPTIONS_CONSTANT;\n getOptions.waitInterval = 1;\n\n //byte[] buffer = null;\n\n List msgList = new ArrayList<>();\n\n System.out.println(\"Current depth : \" + mq.getCurrentDepth());\n\n boolean hasMsges = true;\n\n while(hasMsges){\n\n byte[] buffer = null;\n\n try{\n\n mq.get(mqMessage, getOptions);\n\n buffer = new byte[mqMessage.getDataLength()];\n mqMessage.readFully(buffer);\n\n queueManager.commit();\n\n System.out.println(\"Recieved Message....\");\n msgList.add(buffer);\n\n } catch (MQException e) {\n if((e.completionCode == MQConstants.MQCC_FAILED) &&\n (e.reasonCode == MQConstants.MQRC_NO_MSG_AVAILABLE)){\n System.out.println(\" No more messages.. : \" + e.getReason());\n\n break;\n }else if (e.getReason() != 2033) {\n LOGGER.error(\"Error getting message from the queue: \" + \"\", e);\n }\n } catch (IOException e) {\n LOGGER.error(\"Error reading the message from the queue: \" + \"\", e);\n }\n /* finally {\n if(mq != null) mq.close();\n if(queueManager != null) queueManager.disconnect();\n }*/\n\n }\n\n System.out.println(\"Final List size : \" + msgList.size());\n\n }\n\n}Below are my sysouts after running the programCurrent depth : 9\nRecieved Message...\n No more messages.. : 2033\nFinal List size : 1From the above output, its printed current depth is 9. But its breaking out during the second loop.### Assistant: The message ID and correlation ID fields are populated when a message is got from the queue. If you use the sameMQMessageto get the next message then you must first reset those two fields. So just before you call thegetmethod add these two lines.mqMessage.messageId = MQConstants.MQMI_NONE;\n mqMessage.correlationId = MQConstants.MQCI_NONE;\n"} +{"text": "### Human: I have created a queue manager using\nthese commands in a linux machinecrtmqm MQ1\nstrmqm MQ1\nrunmqsc MQ1the queue manager is created successfully,i wanted to know on which port is the queue manager MQ1 running, i tried all possible waysnetstat -auand alsops -efcommand. It looks like it is running on a different port. I am unable to find the correct port number where it is running, could anyone help?### Assistant: By default a new IBM MQ queue manager will not have a listener running on any port.There is one defaultLISTENERobject on a new queue manager which looks like this:$echo \"dis listener(SYSTEM.DEFAULT.LISTENER.TCP)\"|runmqsc MQ1\n....\n 1 : dis listener(SYSTEM.DEFAULT.LISTENER.TCP)\nAMQ8630: Display listener information details.\n LISTENER(SYSTEM.DEFAULT.LISTENER.TCP) CONTROL(MANUAL)\n TRPTYPE(TCP) PORT(0)\n IPADDR( ) BACKLOG(0)\n DESCR( ) ALTDATE(yyyy-mm-dd)\n ALTTIME(hh.mm.ss)If you were to start thisLISTENERthePORT(0)means to start on the default port which is1414.Best practice is to not use SYSTEM objects and create a new object such as:DEFINE LISTENER(LISTENER.1414.TCP) TRPTYPE(TCP) PORT(1414) CONTROL(QMGR)TheCONTROL(QMGR)tells the queue manager to start the listener when the queue manager is started and stop it when the queue manager is ended.You can manually start and stop the above listener with the commands:START LISTENER(LISTENER.1414.TCP)\nSTOP LISTENER(LISTENER.1414.TCP)\n"} +{"text": "### Human: I have a Spring Boot app (1.5.2) that I need to act as a (JMS) client to an IBM MQ (7.0.1.2) instance; in order to read messages from Queues.I am struggling to determine which JARs I need and where I can source them from.I have reviewed the IBM website and various other sources but have found them somewhat contradictory.Questions:What JARs do I need?com.ibm.mq.allclient? Does this work with version 7.0?Where and how do I get the JARs?Note: I have JMS up and running \"locally\" with no problems using ActiveMQ.Thanks in advance### Assistant: 1) It depends on the version, but from V8 onwards com.ibm.mq.allclient is the easiest one to use.2) All versions of MQ client are forward and backward compatible with all versions of MQ queue manager. 7.0 went out of support (and so no longer receives security fixes) back in 2015. 7.5 is the oldest in support version, but I'd recommend going to MQ 9 LTS for your client.3) The MQC support pack is the easiest way:MQC75 (7.5)http://www-01.ibm.com/support/docview.wss?uid=swg24032744MQC8 (8.0)http://www-01.ibm.com/support/docview.wss?uid=swg24037500MQC9 (9.0)http://www-01.ibm.com/support/docview.wss?uid=swg24042176Be prepared for this not to 'just work' based on your experience with ActiveMQ. ActiveMQ is a totally different JMS implementation to IBM MQ, and unfortunately the JMS specification is loose enough that migration between providers isn't always seamless.\n"} +{"text": "### Human: Using Java/Spring to interact with a WebSphere MQ and trying to send a message to it, Spring keeps adding the following header information to it:RFH \u00cc \u00b8MQSTR \u00b8 jms_text queue:///MY.QUEUE.INFORMATION.TESTqueue:///MY.QUEUE.INFORMATION.TEST1234567892BEGINNING_OF_MY_PAYLOADHow would I remove everything and only send my payload? One could refer to my payload in the snippet above asBEGINNING_OF_MY_PAYLOAD.Here's the function I'm using:public void sendMessage(final String text) {\n this.jmsTemplate.send(new MessageCreator() {\n @Override\n public Message createMessage(Session session) throws JMSException {\n Message message = session.createTextMessage(text);\n destination = session.createQueue(\"MY.QUEUE.INFORMATION.TEST\");\n springJmsConsumer.setDestination(destination);\n message.setJMSReplyTo(destination);\n return message;\n }\n });\n }### Assistant: Figured it out. Anytime we want to remove headers from our Spring JMS message being sent out to a WebSphere MQ, always use the following:this.jmsTemplate.convertAndSend(\"queue:///YOUR.QUEUE.NAME.HERE?targetClient=1\", text);So now my function looks like:public void send(String text) {\n this.jmsTemplate.convertAndSend(\"queue:///MY.QUEUE.INFORMATION.TEST?targetClient=1\", text);\n}\n"} +{"text": "### Human: Can sombody share WebSphere Code for setting up expiration of message in Queue.I know that ther is a JMSAPI to do set the expiration of message.\\But this JMS-API is not applicable to WebSphere MQ API of Java Code.I am using the following Code to produce the messages.MQMessage.write & MQMessage.writeUTFregards\nkarthik### Assistant: Use the link for more information. Here is the basic of an MQ/Java application:MQPutMessageOptions pmo = new MQPutMessageOptions();\npmo.options = CMQC.MQPMO_FAIL_IF_QUIESCING;\n\nMQMessage sendmsg = new MQMessage();\nsendmsg.messageId = CMQC.MQMI_NONE;\nsendmsg.correlationId= CMQC.MQCI_NONE;\nsendmsg.format = CMQC.MQFMT_STRING;\nsendmsg.messageType = CMQC.MQMT_DATAGRAM;\nsendmsg.expiry = timeToLive; // expiry is in tenths of a second\nsendmsg.write(msg.getBytes());\n\noutQ(sendmsg, pmo);\n"} +{"text": "### Human: I am getting a message from MQ with the following codeMQQueue queue = mqManager.AccessQueue(queueName, openOptions);\n\nMQGetMessageOptions gmo = new MQGetMessageOptions();\ngmo.Options = MQC.MQGMO_FAIL_IF_QUIESCING | MQC.MQGMO_WAIT;\ngmo.WaitInterval = MQC.MQWI_UNLIMITED;\n\nqueue.Get(message, gmo);\n\nstring message = message.ReadString(message.MessageLength);The problem is I need access to the header information of this message as well. Namely the userId from whom the message was sent which is found in the header information. How can I access the header information of the message?### Assistant: Access theUserid property of MQMessage- i.e.,message.UserIdpublic string UserId { get; set; }UserId is part of the identity context of the message. The queue manager generally provides the value. You can override the value if you have authority to set the identity context.\n"} +{"text": "### Human: I have a code which disconnects queuemanger when the connection is broken or exception is thrown like belowif (queueManagerreceive != null)\n if (queueManagerreceive.IsConnected)\n {\n if (queuereceive != null)\n {\n queuereceive.Close();\n }\n queueManagerreceive.Disconnect();\n }So i have issue with the above code when i have a 'MQRC_RECONNECT_TIMED_OUT' \nexception then when it does a queuemanager.Disconnect() it throws an exception \"MQRC_CONNECTION_BROKEN\" and obviously which breaks the code as an exception is thrown so when i use queuemanager.Close() there was no exception thrown and the service was stable.What is the difference? what should i use to drop and recreate a new connection?Please help.### Assistant: TheMQQueueManager.Disconnect()closes all queues/topics/processed opened and closes the connection to queue manager. CallingDisconnect()on an already disconnected connection helps in freeing any resources allocated internally.MQQueueManager.Closemethod is actually an inherited method of it's base class and this method closes any internal objects theMQQueueManagerhas allocated. . But you must always callDisconnectinstead ofClosebecause theDisconnectmethod closes the connection to queue manager whileClosedoes not.AfterMQRC_RECONNECT_TIMED_OUTerror you have to create a new connection again using new MQQueueManager constructor.You are getting aMQRC_RECONNECT_TIMED_OUTerror which means that an established connection was broken (for whatever reason) and the MQ client attempted to reconnect for 30 minutes but still could not establish connection. You have to understand the reasons for this:1) Is your queue manager down for that long?2) Is there a network issue which is preventing connection to queue manager?3) If your are using a multi-instance queue manager, why application is not getting connected to stand-by instance?\n"} +{"text": "### Human: I have a queue definition like below:DEFINE QLOCAL(TRIG.QLOCAL) + \n DESCR('Example Queue for Triggering') + \n DEFPRTY(0) + \n DEFSOPT(SHARED) + \n GET(ENABLED) + \n MAXDEPTH(5000) + \n MAXMSGL(4194304) + \n MSGDLVSQ(PRIORITY) + \n PUT(ENABLED) + \n QDEPTHHI(80) +\n QDPHIEV(ENABLED)+\n RETINTVL(999999999) + \n TRIGTYPE(EVERY) + \n PROCESS(TRIG.PROCESS) + \n INITQ(TRIG.INITQ) + \n USAGE(NORMAL) + \n REPLACEI have defined the process like below:DEFINE PROCESS(TRIG.PROCESS) APPLTYPE(UNIX) +\n APPLICID(/appn/sy31/QdepthHiAlert.sh) +\n ENVRDATA(' ') +\n USERDATA(' ') \n DESCR('PROCESS FOR TESTING QDEPTH HIGH EVENT') +\n REPLACEI have a trigger monitor running as service like below:SERVICE(TRIGGER_MONITOR) STATUS(RUNNING)\n PID(49610840) SERVTYPE(SERVER)\n CONTROL(QMGR) STARTCMD(/usr/bin/runmqtrm)\n STARTARG(-m PACOHB20 -q SYSTEM.DEFAULT.INITIATION.QUEUE)Here are my questions:I thought, all the trigger messages will be processed by trigger monitor script. If we don't configure it on theINITQ, process which is associated with the queue will not run. Is that correct?If Yes, Our trigger monitor is not running on the queue'sINITQ(TRIG.INITQ). Must we run the trigger monitor on theINITQtoo?When we are configuring the transmission queues for triggering, we have defined the trigger data and process definitions. Though we didn't configure the trigger monitor on the initiation queue, the channel is started since we haverunmqchion thesystem.channel.initiation.queue. Sorunmqtrmandrunmqchifunction similarly?In here, we have the triggering for EVERY message and queue depth high event. In both the cases, trigger message will be placed to the sameINITQ. So, how do we know what kind of alert we are receiving?### Assistant: OK, let's take these one at a time.I thought, all the trigger messages will be processed by trigger\n monitor script. If we don't configure it on the INITQ, process which\n is associated with the queue will not run. Is that correct?If I understand what you are asking, it is whether the process is fired if there's nothing listening on the initiation queue. That is correct. The application queue must haveTRIGGERset and specify theINITQvalue. The specified initiation queue must have an open input handle in order for MQ to format and place the trigger message.If Yes, Our trigger monitor is not running on the INITQ : TRIG.INITQ.\n do we must run the trigger monitoring on the INITQ too?Yes. The queue'sINITQis where the QMgr will place any trigger messages. The QMgr will not place the trigger messagesunlessthere is an open input handle on that initiation queue, and that handle had better be from a trigger monitor it it won't work.When we are configuring the transmission queues, for triggering, we\n have defined the trigger data and process definitions. Though we\n didn't configure the trigger monitor on the initiation queue, channel\n got run since we have runmqchi on the INITQ. So runmqtrm and runmqchi\n function similarly?The channel initiator is a LOT more forgiving of sloppy configuration than is the trigger monitor. It's easy to work out from the channel definition which transmission queue it uses. So MQ figures that if the administrator defined a queue of typeXMITQset it toTRIGGERthen the intent must be to start a channel. It then works backward from the channel defs to discoverwhichchannel is associated with that queue.But there are no such safe assumptions withrunmqtrm. Youmustconnect the dots from the queue'sINITQandPROCESSattributes to the trigger monitor listening on the specifiedINITQand the associated process starting, correctly reading the trigger message, and then processing the queue as intended.In here, we have the triggering for EVERY message and queue depth high\n event. In both the cases, trigger message will be placed to the same\n INITQ. So, how do we know what kind of alert we are receiving?These are two different things. Only one type of triggering can be specified on a queue and it is one ofFIRST,DEPTH, orEVERY. You can also specify that the QMgr will emit an event message to an event queue (not an initiation queue) when the queue depth exceeds some threshold.The two things are related but completely different types of instrumentation. The triggering instrumentation is designed to start processes under certain conditions. The queue depth events are designed to feed real-time operational information to monitoring agents listening on the event queues.For more about triggering, including a mini-tutorial built around a useful application and sample scripts to implement it, please seeMission:Messaging: Easing administration and debugging with circular queues\n"} +{"text": "### Human: I would like to deploy ActiveMQ in order to connect and communicate with other MOM implementations of jms such as WebsphereMQ, Tibco EMS, Oracle WebLogic JMS etc.As far as I have researched online this seems to be possible by building a so-called bridge on top of activemq that will be able to communicate with the other end, regardless of the underlying wire protocol each jms implementation uses.Examples though are scarce and often times minimal and so a point of confusion is whether I need to include jms client jars from each such implementation (Weblogic, WebsphereMQ, TIBCO EMS etc) in my classpath and bridge configuration. Can this be done without any such jars?Since the goal is to connect to separate organizations MOMs I would like to avoid using any 3rd party, potentially licensed, jar.### Assistant: ...a point of confusion is whether I need to include JMS client jars\n from each such implementation (Weblogic, Websphere MQ, TIBCO EMS etc)\n in my classpath and bridge configuration. Can this be done without any\n such jars?TL;DR: You need the vendor's proprietary classes.JMS defines the API and leaves the wire format and other implementation details to the transport vendor. Furthermore, in the proprietary implementations the wire formats can change significantly version to version. (One of the advantages of proprietary code is the ability to make such large structural changes when doing so improves performance, reliability or function.)The one place where two JMS implementations have commonality is when the messages are in memory. Since all of the transport vendor's implementations inherit from the same Java JMS classes, it is usually possible to instantiate message objects from two different transport vendors and copy from one to the other. To do this, youmusthave the jars of each supported transport provider.In fact, this is how most JMS bridge products that I've used work. The bridge code uses fully-qualified class names to reference the classes from two different vendors. It then creates two connection factories, one for each transport, and two different destinations, also one for each transport. It then reads a message from a queue on one provider, copies it to the message object on the other transport provider, then writes the message.There are of course many \"gotchas\" with this approach. I'll list a few of the obvious ones:Mapping destinations across providers is manual.Identity propagation is not enforceable and requires the bridge to have quasi- or full-admin rights.Transactionality across the providers is at best difficult, at worst impossible.Correlation identifiers must be mapped by the bridge if they are mapped at all. This makes the bridge more complex and requires it to use a database or other persistent storage.The vendor-specific classes often have a superset of the attributes and methods specified by the JMS spec. If used, these are stripped away during the copy.Due to message segmentation, grouping and other affinities, there may not be a 1:1 correlation across the bridge.Due to differences in implementation of such things as high availability, the physical network structure of one transport provider may not map 1:1 to that of another transport provider. This tends to limit the bridge function to the simplest common denominator of the two transports.The issues raised by a general-purpose bridge include all of the issues of a 2-party bridge, raised as the exponent of the number of transports supported. So if a 2-transport bridge is of difficultyx, then for planning purposes assume a 5 transport bridge is of difficulty(x)**5.That's not to say \"don't code a bridge\" since these turn out to be very useful. Just be aware, it's not a trivial task.\n"} +{"text": "### Human: I'm trying to implement receive exit in java as proposed here:http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.0.1/com.ibm.mq.csqzaw.doc/jm11171_.htm// This method implements the receive exit interface\n public ByteBuffer channelReceiveExit(MQCXP channelExitParms,\n MQCD channelDefinition,\n ByteBuffer agentBuffer)\n {\n // Complete the body of the receive exit here\n }I see that exit method is called, and following documentation I expect agentBuffer to contain data of incoming message. But agentBuffer appears to be null everytime, so that I see no way to affect the message data.Any clue would be appreciated.UPD\nI was wrong about agentBuffer is always null, it is not. Following T.Rob answer I managed to catch several calls with MQCXP.ExitReason = 14 (MQXR_XMIT). \nWith one of these calls I receive message data in buffer, and it looks possible to modify such data. \nBut still, there is a problem with other calls, having the same ExitReason, but not corresponding to any real message transmission. I need to skip such calls, but yet have no idea how to distinguish them.Any idea how can I do it?### Assistant: There are several kinds of channel exit in MQ. The MCA channels (QMgr-to-QMgr) make an exit point available when the entire message is in the buffer. This exit point invokes the Message Exit. All channels, MCA and MQI (client), make Send/Receive exit points available. The Send/Receive exit points are exercised any time that a transmission from one channel agent to another is invoked.In the case of client channels, the receive exit may be invoked for flows that do not include message transport, or they may be invoked many times for a single message. It is up to the program to check theMQCXPstructureto determine the API call that is flowing over the client channel and whether the agent buffer should or should not contain anything at that point in time.Note that Send and Receive exits normally work in pairs. Since the queue manager does not invoke Java programs from the MCA, any corresponding Send or Receive exit on the queue manager's side would be written in C.See the manual page onChannel send and receive exit programsfor more info.\n"} +{"text": "### Human: I have a fairly good grasp on when and where using SingleWrite can be advantageous as a log algorithm in MQ. It benefits high throughput, low concurrency workloads. When the work load is more concurrent, TripleWrite's overhead is less of a factor.What I don't understand and am struggling to find ANY information about is how TripleWrite (the default for Websphere MQ since v6) is actually implemented. I know it doesn't actually write every transaction to the log three times, and that it only behaves differently from SingleWrite when partial pages are concerned. But what does it do differently? Does it call fsync three times?I don't have any real practical purpose or problem to solve, this is more curiosity than anything. I've been working with Websphere MQ for a couple of years and would like to understand this better.Is anyone able to shed any light?Edit:I've thought about it some more and one of the options is that it is something similar to InnoDB's DoubleWrite. InnoDB has a double write buffer that all changes are written to first sequentially, before the updates are written to the data file. On recovery either you have a complete successfully written double write buffer to recover from, or the table data was never modified.I am not sure if this is similar to MQ's TripleWrite because it has been asserted in several different instances that TripleWrite does not repetitively write all the pages, and that TripleWrite only behaves differently from SingleWrite when applied to partial pages.### Assistant: Very roughly speaking its something like the following (Remember the issue is only ever about partial pages which are less and less likely as you move up releases of MQ - that's why the benefit of single write is very minimal mostly)Imagine MQ wrote 10 bytes into a page, so has lots of space left in the log page (which are fixed sizes). When MQ then wants to write more bytes (either the rest of the page now the logger has moved on, or potentially (less likely) a small amount more data), it cant just write over that page as the disk may crash mid write and would potentially corrupt what was already needed to preserve to maintain integrity (the first 10 bytes). Hence the 2nd write (with more data) occurs elsewhere and is followed by a 3rd write which goes over the original page. Because it always know which writes were successful, it knows whether the original page or the 'elsewhere' page should be used during the recovery step.\n"} +{"text": "### Human: I am using WMQ to access an IBM WebSphere MQ on a mainframe - using c#.We are considering spreading out our service on several machines, and we then need to make sure that two services on two different machines cannot read/get the same MQ message at the same time.My code for getting messages is this:var connectionProperties = new Hashtable();\n\nconst string transport = MQC.TRANSPORT_MQSERIES_CLIENT;\nconnectionProperties.Add(MQC.TRANSPORT_PROPERTY, transport);\nconnectionProperties.Add(MQC.HOST_NAME_PROPERTY, mqServerIP);\nconnectionProperties.Add(MQC.PORT_PROPERTY, mqServerPort);\nconnectionProperties.Add(MQC.CHANNEL_PROPERTY, mqChannelName);\n\n_mqManager = new MQQueueManager(mqManagerName, connectionProperties);\n\nvar queue = _mqManager.AccessQueue(_queueName, MQC.MQOO_INPUT_SHARED + MQC.MQOO_FAIL_IF_QUIESCING);\nvar queueMessage = new MQMessage {Format = MQC.MQFMT_STRING};\nvar queueGetMessageOptions = new MQGetMessageOptions {Options = MQC.MQGMO_WAIT, WaitInterval = 2000};\nqueue.Get(queueMessage, queueGetMessageOptions);\n\nqueue.Close();\n_mqManager.Commit();\nreturn queueMessage.ReadString(queueMessage.MessageLength);Is WebSphere MQ transactional by default, or is there something I need to change in my configuration to enable this?Or - do I need to ask our mainframe guys to do some of their magic?Thx### Assistant: Unless you actively BROWSE the message (ie read it but leave it there with no locks), only one getter will ever be able to 'get' the message. Even without transactionality, MQ will still only deliver the message once... but once delivered its goneMQ is not transactional 'by default' - you need to get with GMO_SYNCPOINT (MQ transactions) and commit at the connection (MQQueueManager level) if you want transactionality (or integrate with .net transactions is another option)If you use syncpoint then one getter will get the message, the other will ignore it, but if you subsequently have an issue and rollback, then it is made available to any getter (as you would want). It is this scenario where you might see a message twice, but thats because you aborted the transaction and hence asked for it to be put back to how it was before the get.\n"} +{"text": "### Human: Websphere Message Broker: File in File out example. \nI have an XML file with repeating element structure. How can I access and modify value of a particular element in ESQL.\nI worte following code..CREATE PROCEDURE CopyEntireMessage() BEGIN\n --SET OutputRoot = InputRoot;\n DECLARE I INTEGER 1;\n DECLARE J INTEGER;\n SET J = CARDINALITY(OutputRoot.*[]);\n WHILE I < J DO\n SET OutputRoot = InputRoot;\n SET OutputRoot.XMLNS.person.student[I].name = 'XYZ';\n SET I = I + 1;\n END WHILE;\n END;But its not working. Picking up the file from input folder but i cannot see anything in Output folder.\nBut if I commentSET OutputRoot.XMLNS.student[I].name = 'XYZ';then file is available in output folder as it is without any change.My XML file is as below\n \n ABC\n 20\n
city1
\n
\n \n PQR\n 20\n
city2
\n
\n
can anybody help me on this?### Assistant: This compute module should do what you need, tested at 9001 on linux:CREATE COMPUTE MODULE FileInputOutput_Compute\n CREATE FUNCTION Main() RETURNS BOOLEAN\n BEGIN\n -- CALL CopyMessageHeaders();\n CALL CopyEntireMessage();\n\n FOR source AS OutputRoot.XMLNSC.person.student[] DO\n SET source.name = 'XYZ';\n END FOR;\n\n\n RETURN TRUE;\n END;\n\n CREATE PROCEDURE CopyMessageHeaders() BEGIN\n DECLARE I INTEGER 1;\n DECLARE J INTEGER;\n SET J = CARDINALITY(InputRoot.*[]);\n WHILE I < J DO\n SET OutputRoot.*[I] = InputRoot.*[I];\n SET I = I + 1;\n END WHILE;\n END;\n\n CREATE PROCEDURE CopyEntireMessage() BEGIN\n SET OutputRoot = InputRoot;\n END;\nEND MODULE;A couple of notes, firstly it is not good practice to redefine the auto-generated procedures, if you need to reuse functionality which sets every field in a message then it would be wise to create a new procedure to do this.XMLNS is also deprecated so use XMLNSC instead, it is higher performance and has all the same capabilities as XMLNS which is retained only to support legacy applications.\n"} +{"text": "### Human: I'm attempting to get MQ v6 to segment messages using the message flag MQMF_SEGMENTATION_ALLOWED and the put message option MQPMO_LOGICAL_ORDER as suggested in IBM's help guide.ImqMessage message;\nmessage.setFormat(MQFMT_STRING); \nmessage.setMessageFlags(MQMF_LAST_MSG_IN_GROUP | MQMF_SEGMENTATION_ALLOWED);\n\n/* ... */\n\nImqPutMessageOptions pmopts;\npmopts.setOptions(MQPMO_LOGICAL_ORDER);\n\nif (!queue.put(message, pmopts))\n{\n buflen;\n m_iLastError = queue.reasonCode();\n CString reason;\n reason.Format(_T(\"%d\"), queue.reasonCode());\n _errorMsg = \"Reason code: \" + reason;\n /* throw exception etc.. */ \n}Regardless whether I specify these flags, when I call put(), it always returns a false and has the reason code (2010) MQRC_DATA_LENGTH_ERROR.Are there any common gotchas associated with v6 and segmentation (such as it not being available on Windows, anything glaring like that...), or any suggestions of things to try?Apologies for the slightly context-free code sample btw. I'll try and answer questions that people have about my issue as best I can.### Assistant: Okay, I found the solution to that particular error: A message that is larger than thechannel's max message lengthwill not be placed on the queue regardless of whether the message can be segmented or the max message sizes allowed by the queue and queue manager.Setting the channel's max message size cannot be solely done by callingImqChannel::maximumMessageLength(). There's a config change required via the command line:Enterrunmqsc YOUR_QUEUE_MANAGER_NAMEIn the prompt, check the existing channel's max message length (in v6, the default is 4MB):display channel(CHANNEL_NAME)You'll get something likeCHANNEL(SYSTEM.DEF.SVRCONN) CHLTYPE(SVRCONN)\nALTDATE(2013-07-12) ALTTIME(09.57.15)\nCOMPHDR(NONE) COMPMSG(NONE)\nDESCR( ) HBINT(300)\nKAINT(AUTO) MAXMSGL(4194304) <- max length, obvs ;-)\nMCAUSER( ) MONCHL(QMGR)\nRCVDATA( ) RCVEXIT( )\nSCYDATA( ) SCYEXIT( )\nSENDDATA( ) SENDEXIT( )\nSSLCAUTH(REQUIRED) SSLCIPH( )\nSSLPEER( ) TRPTYPE(TCP)To increase the size:alter channel(CHANNEL_NAME) CHLTYPE(SVRCONN) MAXMSGL(104857600)for 100MBNow you need to set the channel's value in code as well usingImqChannel::maximumMessageLength(104857600)or it'll use the default of 4MB.MAXMSGL will take precedence over this call, so passing a value > MAXMSGL will have no effect.Now, when you callput(), any message without segmentation will cause the error 2030 (MQRC_MSG_TOO_BIG_FOR_Q) or 2031 (MQRC_MSG_TOO_BIG_FOR_Q_MGR). With segmentation, the message should now be split and the segments placed on the queue.Hope this helps someone!\n"} +{"text": "### Human: I am trying to establish a connection with MQ from Java. I am using the following sample code from IBM, but it is possible to be outdated. How can i resolve the issue / what am i missing?import com.ibm.mq.*; // Include the WebSphere MQ classes for Java package\nimport com.ibm.mq.jmqi.*;\nimport com.ibm.mq.constants.MQConstants;\n\npublic class MQSample\n{\n private String qManager = \"your_Q_manager\"; // define name of queue\n // manager to connect to.\n private MQQueueManager qMgr; // define a queue manager\n // object\n public static void main(String args[]) {\n new MQSample();\n }\n\n public MQSample() {\n try {\n\n // Create a connection to the queue manager\n\n qMgr = new MQQueueManager(qManager);\n\n // Set up the options on the queue we wish to open...\n // Note. All WebSphere MQ Options are prefixed with MQC in Java.\n\n int openOptions = MQConstants.MQOO_INPUT_AS_Q_DEF |\n MQConstants.MQOO_OUTPUT ;\n\n // Now specify the queue that we wish to open,\n // and the open options...\n\n MQQueue system_default_local_queue =\n qMgr.accessQueue(\"SYSTEM.DEFAULT.LOCAL.QUEUE\",\n openOptions);\n\n // Define a simple WebSphere MQ message, and write some text in UTF format..\n\n MQMessage hello_world = new MQMessage();\n hello_world.writeUTF(\"Hello World!\");\n\n // specify the message options...\n\n MQPutMessageOptions pmo = new MQPutMessageOptions(); // accept the // defaults,\n // same as MQPMO_DEFAULT\n\n // put the message on the queue\n\n system_default_local_queue.put(hello_world,pmo);\n\n // get the message back again...\n // First define a WebSphere MQ message buffer to receive the message into..\n\n MQMessage retrievedMessage = new MQMessage();\n retrievedMessage.messageId = hello_world.messageId;\n\n // Set the get message options...\n\n MQGetMessageOptions gmo = new MQGetMessageOptions(); // accept the defaults\n // same as MQGMO_DEFAULT\n // get the message off the queue...\n\n system_default_local_queue.get(retrievedMessage, gmo);\n\n // And prove we have the message by displaying the UTF message text\n\n String msgText = retrievedMessage.readUTF();\n System.out.println(\"The message is: \" + msgText);\n // Close the queue...\n system_default_local_queue.close();\n // Disconnect from the queue manager\n\n qMgr.disconnect();\n }\n // If an error has occurred in the above, try to identify what went wrong\n // Was it a WebSphere MQ error?\n catch (MQException ex)\n {\n System.out.println(\"A WebSphere MQ error occurred : Completion code \" +\n ex.completionCode + \" Reason code \" + ex.reasonCode);\n }\n // Was it a Java buffer space error?\n catch (java.io.IOException ex)\n {\n System.out.println(\"An error occurred whilst writing to the message buffer: \" + ex);\n }\n }\n} // end of sampleThe error I'm getting:\"C:\\Program Files\\Java\\jdk1.7.0_09\\bin\\java\" -Didea.launcher.port=7536 \"-Didea.launcher.bin.path=M:\\IntelliJ IDEA 12.1.4\\bin\" -Dfile.encoding=UTF-8 -classpath \"C:\\Program Files\\Java\\jdk1.7.0_09\\jre\\lib\\charsets.jar;C:\\Program Files\\Java\\jdk1.7.0_09\\jre\\lib\\deploy.jar;C:\\Program Files\\Java\\jdk1.7.0_09\\jre\\lib\\javaws.jar;C:\\Program Files\\Java\\jdk1.7.0_09\\jre\\lib\\jce.jar;C:\\Program Files\\Java\\jdk1.7.0_09\\jre\\lib\\jfr.jar;C:\\Program Files\\Java\\jdk1.7.0_09\\jre\\lib\\jfxrt.jar;C:\\Program Files\\Java\\jdk1.7.0_09\\jre\\lib\\jsse.jar;C:\\Program Files\\Java\\jdk1.7.0_09\\jre\\lib\\management-agent.jar;C:\\Program Files\\Java\\jdk1.7.0_09\\jre\\lib\\plugin.jar;C:\\Program Files\\Java\\jdk1.7.0_09\\jre\\lib\\resources.jar;C:\\Program Files\\Java\\jdk1.7.0_09\\jre\\lib\\rt.jar;C:\\Program Files\\Java\\jdk1.7.0_09\\jre\\lib\\ext\\access-bridge.jar;C:\\Program Files\\Java\\jdk1.7.0_09\\jre\\lib\\ext\\dnsns.jar;C:\\Program Files\\Java\\jdk1.7.0_09\\jre\\lib\\ext\\jaccess.jar;C:\\Program Files\\Java\\jdk1.7.0_09\\jre\\lib\\ext\\localedata.jar;C:\\Program Files\\Java\\jdk1.7.0_09\\jre\\lib\\ext\\sunec.jar;C:\\Program Files\\Java\\jdk1.7.0_09\\jre\\lib\\ext\\sunjce_provider.jar;C:\\Program Files\\Java\\jdk1.7.0_09\\jre\\lib\\ext\\sunmscapi.jar;C:\\Program Files\\Java\\jdk1.7.0_09\\jre\\lib\\ext\\sunpkcs11.jar;C:\\Program Files\\Java\\jdk1.7.0_09\\jre\\lib\\ext\\zipfs.jar;M:\\untitled\\out\\production\\untitled;D:\\MavenRepository\\com\\ibm\\mq\\mq\\7.0.1.1\\mq-7.0.1.1.jar;D:\\MavenRepository\\com\\ibm\\mq\\jmqi\\7.0.1.1\\jmqi-7.0.1.1.jar;M:\\Monitor_NEW\\Engine\\lib\\ojdbc14_g-10.2.0.jar;D:\\MavenRepository\\com\\ibm\\mq\\mqjms\\7.0.1.1\\mqjms-7.0.1.1.jar;M:\\IntelliJ IDEA 12.1.4\\lib\\idea_rt.jar\" com.intellij.rt.execution.application.AppMain MQSample\nException in thread \"main\" java.lang.NoClassDefFoundError: javax/resource/ResourceException\n at com.ibm.mq.MQQueueManager.(MQQueueManager.java:153)\n at MQSample.(MQSample.java:28)\n at MQSample.main(MQSample.java:20)\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n at java.lang.reflect.Method.invoke(Method.java:601)\n at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)\nCaused by: java.lang.ClassNotFoundException: javax.resource.ResourceException\n at java.net.URLClassLoader$1.run(URLClassLoader.java:366)\n at java.net.URLClassLoader$1.run(URLClassLoader.java:355)\n at java.security.AccessController.doPrivileged(Native Method)\n at java.net.URLClassLoader.findClass(URLClassLoader.java:354)\n at java.lang.ClassLoader.loadClass(ClassLoader.java:423)\n at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)\n at java.lang.ClassLoader.loadClass(ClassLoader.java:356)\n ... 8 more### Assistant: add the connector-1.0.jar dependency into your project.\n"} +{"text": "### Human: I am trying to use the GnuWin32 version of OpenSSL to fetch certificates from several WebSphere MQ queue managers. All attempts result in OpenSSL keeping the connection open until I manually hit ENTER.I tried piping various text into the commandas per this SO questionandthis SO question, but with no luck.Ideally, OpenSSL would close the connection once the input file or piped text hit EOF.Examples:echo QUIT | openssl s_client -connect qmgrhost:1414 -showcerts \n\nopenssl s_client -connect qmgrhost:1414 -showcerts < responsefile.txtThe examples using theQUITcommand appear to work in the other SO question because they are hitting an HTTP server. Since this is WMQ in my case, the connection handshake is different and sendingQUIT(or anything else I've tried) doesn't get it to close the connection. I could probably feed it a giant file until the QMgr choked and killed the connection but I'm trying to be as polite as possible to the server. The current method of supplying an ENTER from the keyboard is causing FDC dumps on each connection as it is, setting off all kinds of alarms and making the Tivoli guys mad at me.So best case would be a string or hex value the QMgr interprets as a graceful rejection and closes the connection. Second best case isanymethod that allows this to be scripted and we'll accept the FDC files as a cost of automating this function.UPDATE: 31 May 2013I've since moved to AIX where this works perfectly. The s_client hangs up immediately after making the connection when run in a script and piping a newline into it. However, I'd still like to have a solution for Windows. Does anyone know if the Cygwin version works or has the same problem? Is it Windows signalling/POSIX issue? Code bug?### Assistant: It seems that this problem is related to a synchronization issue between the Batch file and the openssl.exe program. I need your collaboration in order to do some tests and report the result. Below is a Batch-JScript hybrid script for the first test. The JScript section have two parts; the first oneWScript.Stdout.WriteLine(\"QUIT\");is entirely equivalent toecho QUITBatch command. The second part (with two lines) is similar, but it load the keyboard buffer with \"QUIT\" and an Enter key instead of send the string via STDOUT.I need you to make a test with both sections of the JScript code and report the result (the double-slash//mark the rest of the line as comment). If we are lucky, theopenssl.exeprogram will end with theSendkeysmethod; if not, try to send a \"QUIT\" string viaSTDOUTand type just an Enter key withSendkeys. If theopenssl.exeprogram terminate before returning the desired information then the problem is almost solved, because in this case we can synchronize the sending of the Enter key until the desired information had been received fromopenssl.exe.Save the following as a.batfile. Try it, then comment out theWscriptline, uncomment theWshShelllines, and then try it again.@if (@CodeSection == @Batch) @then\n\n:: The first line above is...\n:: in Batch: a valid IF command that does nothing.\n:: in JScript: a conditional compilation IF statemente that is false,\n:: so this section is omitted until next \"at-sign end\".\n\n@echo off\nCScript //nologo //E:JScript \"%~F0\" | openssl s_client -connect qmgrhost:1414 -showcerts \ngoto :EOF\n\n\n@end\n\n\n// JScript section\n\nWScript.Stdout.WriteLine(\"QUIT\");\n\n// var WshShell = WScript.CreateObject(\"WScript.Shell\");\n// WshShell.SendKeys(\"QUIT{ENTER}\");You may also try withString.fromCharCode(26)to generate a Ctrl-Z (EOF) character, both inWriteLineorSendkeysmethods; for example:WshShell.SendKeys(\"QUIT{ENTER}\" + String.fromCharCode(26));\n"} +{"text": "### Human: I've been studying the vagaries of channel statuses, how they get to those states and what to do to get them stopped or started. I've got a pretty solid understanding now, but a colleague brought up the topic of channel resets.I've done them occasionally when I couldn't explain what was going on, but now I understand things a bit better I'm not sure his advice to \"always reset\" when stopping troublesome channels is the right advice.Searching for info online, it's clear that when recreating channels it is obvious a reset would be needed but in the case if stuff just breaking \u2013 whether a queue manager is unexpectedly dropped or the network breaks or stuff like that \u2013 is a reset a good idea in general or should I only bother if I see sequence errors or it otherwise refuses to start when I know it should?### Assistant: FYI, if you are resetting from the sending side of the channel, its OK to set the sequence number to 1. The receiving side will then also go back to 1. QED :-)If you are resetting from the receiving side of the channel, you must use the sequence number that the sender was expecting.These numbers are in the queue manager error logs on both sides.If the channel is in RETRY state, it will try to use the new sequence numbers when it does the next retry. This could be up to 20 minutes away if you are using the default retry attributes on the sender channel. A simple way to bump this is to STOP the channel and then START it again straight away.HTH, G.\n"} +{"text": "### Human: I'm a beginner on WebSphere MQ, I was working on MQ 6 and it was working fine, but now I've installed MQ 7.1 and when I try to create a new Queue Manager I can do it But it can't connect and it gives me the following error :Do you have any idea about that? Thank you :)### Assistant: You can look up any WebSphere MQ error code if either the WebSphere MQ Client or Server are installed using themqrccommand. In this case:C:\\Users\\MUSR_MQADMIN>mqrc 2059\n\n 2059 0x0000080b MQRC_Q_MGR_NOT_AVAILABLEThe 2059 usually indicates that the listener is not running or the queue manager is down. There's a different error code if the listener is running and the QMgr name is wrong and another one if the connection is made to the right QMgr but the channel name is wrong. Sometimes you can get a 2059 if the channel was closed at the server side by an exit but since you didn't mention any exits, I'm assuming in this case that its listener problem.Hopefully by now you are defining a listener object rather than usinginetdor therunmqlsrcommand. Defining an object and setting it to start and stop under QMgr control is the most reliable way to configure it.Once you get past the 2059, you should be aware that as of WMQ V7.1, the queue managers are secure by default and won't acceptanyremote client connections unless you explicitly authorize them. This is the opposite of the behavior of V6 where on a newly defined queue manager running a listener, anyone with a TCP route to it could administer it and remotely execute OS code as themqmuser. So I expect that the next problem you run into will be 2035 errors.I've been told this means more work for the WMQ administrator. The only case in which that's true is if the V6 or earlier queue manager had been configured without security. If the tasks to secure a V7.0 QMgr are compared to the tasks to provision access on a v7.1 and higher QMgr are compared, provisioning access turnds out to be easier. However if you liked the V7.0 behavior, you can always alter the QMgr to disableCHLAUTHrules. Needless to say, leaving security enabled is highly encouraged.To debug security errors, alter the QMgr to enable authorization events using therunmqsccommandALTER QMGR AUTHOREV(ENABLED). Next, download and installSupportPac MS0Pinto WebSphere MQ Explorer. Then when you do get a security error, use WebSphere MQ Explorer to look at the queue. Right-click on the queue and select the option to parse the event messages. This will tell you in excruciating detail all the information you need to debug the authorization error.Finally, if you wish to read up on the new security features, go tot-rob.net/linksand look at the conference presentations there. There are also some articles indexed if you scroll down.\n"} +{"text": "### Human: I have the below configurations in Spring , it is working fine but performance is too low (it takes 1 min for 20 messages). Can you please suggest me changes to increase the performance. \n 1 \n \n \n \n \n \n \n \n \n false \n \n \n \n \n tree.queue.manager \n ORANGE.QUEUE \n \n \n \n I am calling from spring asJMSSender obj = (JMSSender) context.getBean(\"jmsSender\");And My Sender program is :@Cacheable(\"message\")\n\n public void sendMesage() {\n\n jmsTemplate.send(new MessageCreator() {\n public Message createMessage(Session session)throws JMSException {\n message = (Message) session.createTextMessage(stringBuffer.toString());\n return message;\n }\n });\n\n }\n}### Assistant: A common problem when using JMSTemplate to send messages out of JavaEE containers is the it's extremly slow since it acquires a new connection for each message (and then closes it). You would probably need a pooled/cached connection to gain speed here.Read this article, it's written for ActiveMQ, but applies in a similar way to WebSphere MQ:http://activemq.apache.org/jmstemplate-gotchas.htmlYou can setup a cached connection factory in spring using something like this:Then use it instead of the original one for JMS connections.\n"} +{"text": "### Human: I have something like Message forwarder / router for MQ messages. I'm trying to forward messages based on some rules. This forwarding is simply done by receiving message from one queue, creating a new message (with same or modified content) and putting it to another queue. The existence of the forwarder should be as transparent as possible.At the moment my problem isPutApplicationTypemessage property. It looks like I cannot change this property. I have both .NET and Java sample implementation and I'm trying to simply use:MQMessage forwardedMessage = new MQMessage();\nforwardedMessage.putApplicationType = CMQC.MQAT_UNIX;It doesn't matter what value I try to use. .NET version always sends message withMQAT_DEFAULT/MQAT_WINDOWS_NTand Java version always sends message withMQAT_JAVA.Is it possible to change this header? If not can it cause some issue to legacy systems if I don't change the value? Why is it not possible to change the value?Btw. forwarding original message also doesn't work - my application will changePutApplicationTypeproperty as well.Edit: If I use native C API will I be able to control content of this property?### Assistant: As T.Rob, said you need to read the manaul (WMQ Using Java or WMQ Using .Net). Forwarding a message is not a simple task as you listed above. There are several options/parameters that need to be set correctly.Here is a Java code snippet with all of the exception handling remove:int openInputOptions = MQC.MQOO_INQUIRE + MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_INPUT_SHARED + MQC.MQOO_SAVE_ALL_CONTEXT;\nint openOutputOptions = MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_PASS_ALL_CONTEXT;\n\nMQQueue _inQ = _qMgr.accessQueue( inQueueName, openInputOptions, null, null, null );\n\nMQQueue _outQ = _qMgr.accessQueue( outputQueueName, openOutputOptions, null, null, null );\n\nMQGetMessageOptions getOptions = new MQGetMessageOptions();\ngetOptions.options = MQC.MQGMO_NO_WAIT + MQC.MQGMO_FAIL_IF_QUIESCING;\n\nMQMessage mqMsg = new MQMessage();\n\nmqMsg.correlationId = MQC.MQCI_NONE;\nmqMsg.messageId = MQC.MQMI_NONE;\n\n_inQ.get(mqMsg, getOptions);\n\nMQPutMessageOptions pmo = new MQPutMessageOptions();\npmo.options = MQC.MQPMO_FAIL_IF_QUIESCING + MQC.MQPMO_PASS_ALL_CONTEXT;\npmo.contextReference = _inQ;\n\n_outQ.put(mqMsg, pmo);\n"} +{"text": "### Human: While clearing the queue in WebSphere MQ, whats the difference between using the clear command and mqget API call ?### Assistant: The CLEAR command issues a single command which clears the queue, while Clearing using the MQGET command reads the queue until it's empty.Practically, one can Clear using MQGET without having to acquire an exclusive lock on the queue. On the other hand, if the queue is in use somewhere, the CLEAR command will fail.The IBM documentation lists the difference as follows:If you use the CLEAR command, all of the messages are cleared from the queue. However, if the queue is already opened exclusively by another application or if the queue contains uncommitted messages, the command fails immediately and none of the messages are cleared.If you use the MQGET API call, the messages are got from the queue until no more messages are available. However, MQGET does not recognize uncommitted messages, which means that there could still be uncommitted messages on the queue. Also, the command might fail if the queue is already exclusively opened by another application.\n"} +{"text": "### Human: We are getting an exception thrown when attempting to connect to IBM MQ through TLS ({\"MQRC_HOST_NOT_AVAILABLE\"}) using the .net standard nuget package, IBMMQDotnetClient. The project is using .net framework 4.7.2. We are able to connect without using SSL, and also we are able to connect using SSL when we switch to the .net framework nuget package, WebSphereMQClient, using the exact same code and setup (just swapping out the nuget libraries will allow it to work).Additionally, I'm not able enable tracing for the .net standard library. The documentation indicates that the environment varable MQDOTNET_TRACE_ON needs to be set, but even after that I'm not getting anything generated. I've tried adding other variables like MQERRORPATH but still not seeing any trace files.Codevar queueManagerName = \"QM1\";\nvar hostName = \"hostname.com\";\nvar channel = \"DEV.APP.SVRCONN\";\nvar queueName = \"DEV.QUEUE.1\";\nvar port = \"1414\";\n\nvar sslKeyRepository = \"*USER\";\nvar cipherSpec = \"TLS_RSA_WITH_AES_256_CBC_SHA256\";\n\nHashtable prop = new Hashtable();\n\nprop.Add(MQC.HOST_NAME_PROPERTY, hostName);\nprop.Add(MQC.PORT_PROPERTY, port);\nprop.Add(MQC.CHANNEL_PROPERTY, channel);\nprop.Add(MQC.CONNECT_OPTIONS_PROPERTY, MQC.MQCNO_RECONNECT);\nprop.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\n\nprop.Add(MQC.SSL_CERT_STORE_PROPERTY, sslKeyRepository);\n\nprop.Add(MQC.SSL_CIPHER_SPEC_PROPERTY, cipherSpec);\n \ntry { \n var queueManager = new MQQueueManager(queueManagerName, prop);\n MQQueue _queue = queueManager.AccessQueue(queueName, MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING);\n\n}\ncatch (Exception ex)\n{\n Console.WriteLine(ex.Message);\n}Error from the client AMQERR01.LOG:7/16/2021 7:16:12 PM - Process(15212.1) User(Eric.Kaufman) Program(ConsoleApp1)\n Host(DLW011309) Installation(Unknown)\n VRMF(9.2.2.0)\n Time(2021-07-16T23:16:12.121Z)\n ArithInsert1(0) ArithInsert2(0)\n CommentInsert1(hostname.com(1414))\n CommentInsert2(TCP/IP)\n CommentInsert3( (Exception))\n \nAMQ9202E: Remote host not available, retry later.\n\nEXPLANATION:\nThe attempt to allocate a conversation using TCP/IP to host\n'hostname.com(1414)' for channel \n(Exception) was not successful. However the error may be a transitory one and\nit may be possible to successfully allocate a TCP/IP conversation later. \n\nIn some cases the remote host cannot be determined and so is shown as '????'.\nACTION:\nTry the connection again later. If the failure persists, record the error\nvalues and contact your systems administrator. The return code from TCP/IP is 0\n(X'0'). The reason for the failure may be that this host cannot reach the\ndestination host. It may also be possible that the listening program at host\n'hostname.com(1414)' was not running. If\nthis is the case, perform the relevant operations to start the TCP/IP listening\nprogram, and try again.Error from queue manager logs07/16/21 23:16:12 - Process(401.18) User(mqm) Program(amqrmppa)\n Host(a55a7574679b) Installation(Installation1)\n VRMF(9.2.2.0) QMgr(QM1)\n Time(2021-07-16T23:16:12.102Z)\n RemoteHost(XXX.XXX.XXX.XXX)\n ArithInsert1(420)\n CommentInsert1(????)\n CommentInsert2(gsk_secure_soc_read)\n CommentInsert3(XXX.XXX.XXX.XXX)\n\nAMQ9665E: SSL connection closed by remote end of channel '????'.\n\nEXPLANATION:\nThe SSL or TLS connection was closed by the remote host 'XXX.XXX.XXX.XXX'\nduring the secure socket handshake. The channel is '????'; in some cases its\nname cannot be determined and so is shown as '????'. The channel did not start.\nACTION:\nCheck the remote end of the channel for SSL and TLS errors. Fix them and\nrestart the channel.\n----- amqccisa.c : 11155 ------------------------------------------------------\n07/16/21 23:16:12 - Process(401.18) User(mqm) Program(amqrmppa)\n Host(XXXXXXXXX) Installation(Installation1)\n VRMF(9.2.2.0) QMgr(QM1)\n Time(2021-07-16T23:16:12.103Z)\n CommentInsert1(????)\n CommentInsert2(401)\n CommentInsert3(XXX.XXX.XXX.XXX)\n\nAMQ9999E: Channel '????' to host 'XXX.XXX.XXX.XXX' ended abnormally.\n\nEXPLANATION:\nThe channel program running under process ID 401 for channel '????' ended\nabnormally. The host name is 'XXX.XXX.XXX.XXX'; in some cases the host name\ncannot be determined and so is shown as '????'.\nACTION:\nLook at previous error messages for the channel program in the error logs to\ndetermine the cause of the failure. Note that this message can be excluded\ncompletely or suppressed by tuning the \"ExcludeMessage\" or \"SuppressMessage\"\nattributes under the \"QMErrorLog\" stanza in qm.ini. Further information can be\nfound in the System Administration Guide.### Assistant: This ended up being user error on my part, but I'll include my steps in case it ends up being helpful to someone else. The environment variables to enable tracing did work but needed Visual Studio to be restarted in order to take into effect. The three that I ended up using were:MQDOTNET_TRACE_ON = \"2\",\nMQERRORPATH = \"C:\\MQERRORLOGPATH\",\nMQTRACEPATH = \"C:\\MQTRACEPATH\"After that the trace file was generated, and I was able to find this exception:System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.This was because I was using a self signed certificate. After adding the certificate to the Trusted Root Certification Authorities folder in Windows Cert Manager I was able to connect successfully.\n"} +{"text": "### Human: I am quite new to IBM MQ's. Mine is a multi-instance queue manager.One instance is like fail-over.How can I connect to them even if one of is down.I am not sure whether my terminology is right or not?I am trying to connect using below example nowhttps://raw.githubusercontent.com/ibm-messaging/mq-dev-samples/master/gettingStarted/jms/JmsPutGet.java### Assistant: Instead of populatingWMQ_HOST_NAMEandWMQ_PORTpopulateWMQ_CONNECTION_NAME_LISTwith a comma separated list that is in the formathost1(port1),host2(port2). IBM MQ will attempt to connect to host1 first and if it fails it will attempt host2 during the initial connection attempt.If you want the client to reconnect on failure you will need to enable mq auto reconnect like this:cf.setClientReconnectOptions(WMQConstants.WMQ_CLIENT_RECONNECT);\ncf.setClientReconnectTimeout(1800); // how long in seconds to continue to attempt reconnection before failing\n"} +{"text": "### Human: When running the GET sampleamqsgetI can connect normally in the queue...C:\\Program Files\\IBM\\MQ\\bin>amqsget QUEUE1\nSample AMQSGET0 start\nno more messages\nSample AMQSGET0 endHowever when usingamqsgetcI get an error\"MQCONNX ended with reason code 2058\":C:\\Program Files\\IBM\\MQ\\bin>amqsgetc QUEUE1\nSample AMQSGET0 start\nMQCONNX ended with reason code 2058Explicitly adding the queue manager at the end does not work as well.Thisarticlefrom IBM summarizes the problem causes but it still not clear why one is working and not the other. Thisother articleexplains the sample programs.### Assistant: amqsgetwill connect to a queue manager on your local machine using shared memory pipes. This means as long as it is on the same machine as your queue manager it can find the queue manager and connect to it.amqsgetcwill connect to a queue manager over the network. Because, by default, it doesn't know where the queue manager is you will need to tell it how to connect to the queue manager. You can tell amqsgetc (or any client application) how to connect ot a queue manager in one of 3 ways:Programmatically. If you have a custom application you can program in the connection details to hard code them.This is not an option for amqsgetc.MQSERVER environment variable. If you set this environment variable then you amqsgetc will pick up the details it needs. The variable should be in the format://
()for exampleChannel1/TCP/localhost(1414).This pagehas more details about MQSERVER.A CCDT file. If you create a CCDT file then you amqsgetc can pick this up in order to find the connection details you need. More on CCDT fileshere\n"} +{"text": "### Human: I'm pretty new to IBM MQ, but I have looked at samples from IBM and written a tool in Java that can list queue names. I'm using PCFAgent:PCFAgent agent = new PCFAgent(hostname, port, channelName);\n\nPCFParameter[] parameters = { new MQCFST(CMQC.MQCA_Q_NAME, \"*\"),\n new MQCFIN(CMQC.MQIA_Q_TYPE, CMQC.MQQT_LOCAL)};\n\nMQMessage[] responses = agent.send(CMQCFC.MQCMD_INQUIRE_Q_NAMES, parameters);\n MQCFH cfh = new MQCFH(responses[0]);\n\nfor (int i = 0; i < cfh.parameterCount; i++) {\n System.out.println (PCFParameter.nextParameter (responses [0]));\n}This works fine when there are no username/password authorization on the MQ, but when this is in place, I get the error RC2035 \"MQRC_NOT_AUTHORIZED\".Is it possible to authenticate by specifying username/password somehow, using PCFAgent like this?(Or, is there another way to authenticate and list queues?)### Assistant: You can use the alternate PCFAgent constructor which takes an MQQueueManager object.To set connection parameters and UserID/password when creating the MQQueueManager object, use either the static MQEnvironment class, or pass a hashtable of desired properties on the MQQueueManager constructor.https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_8.0.0/com.ibm.mq.javadoc.doc/WMQJavaClasses/com/ibm/mq/MQQueueManager.htmlhttps://www.ibm.com/support/knowledgecenter/en/SSFKSJ_8.0.0/com.ibm.mq.javadoc.doc/WMQJavaClasses/com/ibm/mq/MQEnvironment.htmlHashtable> props = new Hashtable>();\n\nprops.put(MQConstants.TRANSPORT_PROPERTY, MQConstants.TRANSPORT_MQSERIES_CLIENT);\nprops.put(MQConstants.HOST_NAME_PROPERTY, hostname);\nprops.put(MQConstants.CHANNEL_PROPERTY, channel);\nprops.put(MQConstants.PORT_PROPERTY, new Integer(port));\nprops.put(MQConstants.USER_ID_PROPERTY, userName);\nprops.put(MQConstants.USE_MQCSP_AUTHENTICATION_PROPERTY, Boolean.TRUE);\nprops.put(MQConstants.PASSWORD_PROPERTY, password);\n\nMQQueueManager qm = new MQQueueManager(\"MY.QM\", props);\n\nPCFAgent agent = new PCFAgent(qm);\n"} +{"text": "### Human: I try to connect to a new MQ setup using IBM JMS example code for testing:https://developer.ibm.com/messaging/learn-mq/mq-tutorials/develop-mq-jms/private static final String HOST = \"MYIP\"; // Host name or IP address\nprivate static final int PORT = MYPORT; // Listener port for your queue manager\nprivate static final String CHANNEL = \"MY.APP.SVRCONN\"; // Channel name\nprivate static final String QMGR = \"MYQMGR\"; // Queue manager name\nprivate static final String APP_USER = \"MYUSER\"; // User name that application uses to connect to MQ\nprivate static final String APP_PASSWORD = \"\"; // Password that the application uses to connect to MQ\nprivate static final String QUEUE_NAME = \"MYQUEUE\"; // Queue that the application uses to put and get messages to anand// Set the properties\ncf.setStringProperty(WMQConstants.WMQ_HOST_NAME, HOST);\ncf.setIntProperty(WMQConstants.WMQ_PORT, PORT);\ncf.setStringProperty(WMQConstants.WMQ_CHANNEL, CHANNEL);\ncf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\ncf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, QMGR);\ncf.setStringProperty(WMQConstants.WMQ_APPLICATIONNAME, \"JmsPutGet (JMS)\");\ncf.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, true);\ncf.setStringProperty(WMQConstants.USERID, APP_USER);\ncf.setStringProperty(WMQConstants.PASSWORD, APP_PASSWORD);Assume all parameters provided and used are correct (HOST, PORT, CHANNEL, QMGR, QUEUE_NAME), since I can connect to the manager and see the queue with a read-only user using MQ Explorer and I get Errors when modifying the parameters, that there is no such QMGR running, just to make sure the problem is related to USERID and PASSWORD.\nMy example works great with another queue, where I have to use UserID + password authentication.Now the Setup-team provided me a technical user userid, but no password, since this is not needed.Exception in thread \"main\" com.ibm.msg.client.jms.DetailedJMSSecurityRuntimeException: JMSWMQ2013: The security authentication was not valid that was supplied for QueueManager 'MYQUEUEMANAGER' with connection mode 'Client' and host name 'MYIP(MYPORT)'.\nPlease check if the supplied username and password are correct on the QueueManager to which you are connecting.\n at com.ibm.msg.client.jms.DetailedJMSSecurityException.getUnchecked(DetailedJMSSecurityException.java:270)\n at com.ibm.msg.client.jms.internal.JmsErrorUtils.convertJMSException(JmsErrorUtils.java:173)\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createContext(JmsConnectionFactoryImpl.java:478)\n at com.ibm.mq.samples.jms.JmsTestClient.main(JmsTestClient.java:78)\nCaused by: com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED').Can somebody please direct me to the correct configuration or which parameter to set to connect with a passwordless user via JMS?update#1: I tried to set password empty or do not to set string property WMQConstants.PASSWORD of cause.### Assistant: In your code you have set the propertyWMQConstants.USER_AUTHENTICATION_MQCSPtotrue. This tells your Java client that you want to use the Connection Authentication feature which was added in v8 to provide a userid and password for authentication.If you want to use the old mechanism to only provide a user id then you need to set this to false. For example:cf.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, false);This is refered to as Compatability Mode and is applicable to Java applications trying to connect to IBM MQ (e.g. MQ Explorer)Reference:https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_8.0.0/com.ibm.mq.sec.doc/q118680_.htm\n"} +{"text": "### Human: I'm trying to consume an IBM MQ (version 8.0.0.8) with SSL using a Java client built basically with:Oracle JKD 8 and IBM JRE 7 (for testing purposes I have one client for each of them)com.ibm.mq.allclient-9.1.0.0.jarjavax.jms-api-2.0.1.jarspring-jms-4.3.7.RELEASE.jarspring-jms-4.3.7.RELEASE.jarThe MQ is a Request/Reply type.I have the correct certificate and all MQ properties set, but for some reason the connection \u201cdrops\u201d and I get no errors on my client side and my requests never get any response and keeps running \u201cforever\u201d, never getting any response. The only clue that I have is an error message in the MQ log that says:Process(31600.16) User(QMQM) Jobname(JOB_NAME)\n Host(HOST_NAME)\n VRMF(8.0.0.8) QMgr(MANAGER_NAME)\n AMQ9638: SSL communications error for channel 'CHANNEL_NAME'. EXPLANATION:\n Cause . . . . . : An unexpected SSL communications error occurred for a channel, as reported in the preceding messages. The\nchannel is 'CHANNEL_NAME';The strange thing is that the SSL Handshake happens, my certificate is accepted by the MQ, but for some reason something happens after this. I\u2019m trying using both Oracle JRE 8 and IBM JRE 7. Maybe is something on MQ side (IBM MQ v8.0.0.8) or some configuration that I\u2019m missing on my side.I have already installed the JCE Unlimited Policies, so the problem is not CipherSpec X CipherSuite.I'm using -Djavax.net.debug=all and I can see that my certificate is being used correctly and I can't see any problems there...My contact point on the MQ Team told me that for some reason my application is revoking the certificate (something related with CLR), but I have no idea why this would happen.My Java code:public Message callMQ() {\n\n Message message = null;\n\n try {\n\n MQConnectionFactory factory = mqQueueConnectionFactory();\n JMSContext context = factory.createContext();\n\n Destination requestQueue = context.createQueue(\"queue:///REQUEST_QUEUE\");\n Destination replyQueue = context.createQueue(\"queue:///REPLY_QUEUE\");\n\n JmsTemplate jmsTemplate = new JmsTemplate(factory);\n\n FIXMLRootInbound inbound = new FIXMLRootInbound();\n String xml = XmlUtil.xmlObjectToString(inbound);\n\n message = jmsTemplate.sendAndReceive(requestQueue,\n session -> {\n Message req = session.createTextMessage(xml);\n req.setJMSCorrelationID(UUID.randomUUID().toString());\n req.setJMSDestination(requestQueue);\n req.setJMSReplyTo(replyQueue);\n return req;\n });\n\n } catch (Throwable e) {\n e.printStackTrace();\n }\n\n return message;\n }\n\n private MQConnectionFactory mqQueueConnectionFactory() throws NoSuchAlgorithmException, KeyStoreException,\n IOException, CertificateException, UnrecoverableKeyException, KeyManagementException, JmsException {\n\n SSLSocketFactory sslSocketFactory = sslContext().getSocketFactory();\n\n MQEnvironment.sslSocketFactory = sslSocketFactory;\n MQEnvironment.sslCipherSuite = \"TLS_RSA_WITH_AES_256_CBC_SHA\";\n MQEnvironment.sslFipsRequired = false;\n\n MQConnectionFactory mqQueueConnectionFactory = new MQQueueConnectionFactory();\n mqQueueConnectionFactory.setHostName(host);\n try {\n mqQueueConnectionFactory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);\n mqQueueConnectionFactory.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE,\n WMQConstants.WMQ_CM_CLIENT);\n mqQueueConnectionFactory.setQueueManager(queueManager);\n mqQueueConnectionFactory.setSSLCipherSuite(\"TLS_RSA_WITH_AES_256_CBC_SHA\");\n mqQueueConnectionFactory.setCCSID(285);\n mqQueueConnectionFactory.setChannel(channel);\n mqQueueConnectionFactory.setPort(port);\n mqQueueConnectionFactory.setSSLSocketFactory(sslSocketFactory);\n mqQueueConnectionFactory.setSSLFipsRequired(false);\n } catch (Exception e) {\n log.error(\"Error creating MQQueueConnectionFactory.\", e);\n }\n\n return mqQueueConnectionFactory;\n }\n\n private SSLContext sslContext() throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException, UnrecoverableKeyException, KeyManagementException {\n\n try (InputStream cert = new FileInputStream(\"C:\\\\myplace\\\\Dev\\\\Certificates\\\\MY_KEYSTORE.jks\")) {\n\n final KeyStore caCertsKeyStore = KeyStore.getInstance(\"JKS\");\n caCertsKeyStore.load(cert, \"changeit\".toCharArray());\n\n final KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());\n final TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());\n\n CertPathBuilder cpb = CertPathBuilder.getInstance(\"PKIX\");\n PKIXRevocationChecker rc = (PKIXRevocationChecker)cpb.getRevocationChecker();\n rc.setOptions(EnumSet.of(\n PKIXRevocationChecker.Option.PREFER_CRLS,\n PKIXRevocationChecker.Option.ONLY_END_ENTITY,\n PKIXRevocationChecker.Option.SOFT_FAIL,\n PKIXRevocationChecker.Option.NO_FALLBACK));\n\n PKIXBuilderParameters pkixParams = new PKIXBuilderParameters(caCertsKeyStore, new X509CertSelector());\n pkixParams.addCertPathChecker(rc);\n\n kmf.init(caCertsKeyStore, \"changeit\".toCharArray());\n tmf.init( new CertPathTrustManagerParameters(pkixParams) );\n\n final SSLContext sslContext = SSLContext.getInstance(\"TLS\");\n sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), new SecureRandom());\n\n return sslContext;\n\n } catch (Exception e) {\n throw new RuntimeException(\"Exception creating SSLContext\", e);\n }\n }### Assistant: Since you are using the 9.1.0.0com.ibm.mq.allclient.jaryou do not need all of the code you have related to the key store, for example:SSLSocketFactory sslSocketFactory = sslContext().getSocketFactory();\n\n//Note that MQEnvironment is used with IBM MQ Classes for Java not IBM MQ Classes for JMS\nMQEnvironment.sslSocketFactory = sslSocketFactory;\nMQEnvironment.sslCipherSuite = \"TLS_RSA_WITH_AES_256_CBC_SHA\";\nMQEnvironment.sslFipsRequired = false;\n\nmqQueueConnectionFactory.setSSLSocketFactory(sslSocketFactory);\n\nprivate SSLContext sslContext() throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException, UnrecoverableKeyException, KeyManagementException {\n\n try (InputStream cert = new FileInputStream(\"C:\\\\myplace\\\\Dev\\\\Certificates\\\\MY_KEYSTORE.jks\")) {\n\n final KeyStore caCertsKeyStore = KeyStore.getInstance(\"JKS\");\n caCertsKeyStore.load(cert, \"changeit\".toCharArray());\n\n final KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());\n final TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());\n\n CertPathBuilder cpb = CertPathBuilder.getInstance(\"PKIX\");\n PKIXRevocationChecker rc = (PKIXRevocationChecker)cpb.getRevocationChecker();\n rc.setOptions(EnumSet.of(\n PKIXRevocationChecker.Option.PREFER_CRLS,\n PKIXRevocationChecker.Option.ONLY_END_ENTITY,\n PKIXRevocationChecker.Option.SOFT_FAIL,\n PKIXRevocationChecker.Option.NO_FALLBACK));\n\n PKIXBuilderParameters pkixParams = new PKIXBuilderParameters(caCertsKeyStore, new X509CertSelector());\n pkixParams.addCertPathChecker(rc);\n\n kmf.init(caCertsKeyStore, \"changeit\".toCharArray());\n tmf.init( new CertPathTrustManagerParameters(pkixParams) );\n\n final SSLContext sslContext = SSLContext.getInstance(\"TLS\");\n sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), new SecureRandom());\n\n return sslContext;\n\n } catch (Exception e) {\n throw new RuntimeException(\"Exception creating SSLContext\", e);\n }\n}You can instead replace that with setting the following two system properties, this will work with both Oracle and IBM Java:System.setProperty(\"javax.net.ssl.keyStore\", \"C:\\\\myplace\\\\Dev\\\\Certificates\\\\MY_KEYSTORE.jks\");\nSystem.setProperty(\"javax.net.ssl.keyStorePassword\", \"changeit\");The above settings have always worked for IBM Java, but with Oracle Java this did not work with older versions of MQ. It was fixed for Oracle java in the following versions of IBM MQ (Base 9.0 and 9.1 have the same fix):Version Maintenance Level\nv7.1 7.1.0.8\nv7.5 7.5.0.7\nv8.0 8.0.0.5IBM Java and Oracle Java have different CipherSuite names, these are documented in the IBM MQ v9.1 Knowledge center page \"TLS CipherSpecs and CipherSuites in IBM MQ classes for JMS.You have specifiedTLS_RSA_WITH_AES_256_CBC_SHAin the posted code, this would be theSSLCIPHvalue on the MQ Queue managerSVRCONNchannel, and would map to the following CipherSuites:IBM Java:SSL_RSA_WITH_AES_256_CBC_SHAOracle Java:TLS_RSA_WITH_AES_256_CBC_SHARelated to the above, if you are using Oracle Java you need to set the following system property so that the MQ JMS classes will be able to use the right mapping of the Oracle CipherSuite name:System.setProperty(\"com.ibm.mq.cfg.useIBMCipherMappings\", \"false\");The error you provided appears to be from the IBM i MQ Queue manager, but does not provide enough information to diagnose the problem.The error states the following:An unexpected SSL communications error occurred for a channel, as reported in the preceding messages.Can you edit your question and provide the details from the \"preceding messages\".You statedfor some reason my application is revoking the certificate (something related with CLR)It could be that the MQ queue manager is attempting itself to connect to the OCSP server specified in the your client cert's AuthorityInfoAccess (AIA) certificate extension. If MQ can not reach this OCSP server with a default configuration the connection will be denied. If you are unable to update your network to allow connection to the OCSP server then you can disable this check but note that you will not know if a cert is revoked. To disable the checking the following can be added to the queue manager'sqm.inifileSSLstanza:SSL:\n OCSPAuthentication=Optional\n OCSPCheckExtensions=noOne last comment, the CipherSuite you listed in your example codeTLS_RSA_WITH_AES_256_CBC_SHAis a TLS1.0 CipherSuite. Like SSL before it this and TLS1.1 are commonly deprecated across many industries. I looked for reference to post and a google of \"tls 1.0 end of life\" gives many references.Quoting one \"TLS 1.0 end-of-life on June 30th, 2018\" below:The DeadlineThe PCI Council is responsible for determining when older protocols are phased out. They initially decided TLS 1.0 would\n reach end of life on 30 June 2016, later extending the date to 30 June\n 2018. The final deadline has past and all web servers, web browsers, web software and email applications have had to discontinue TLS 1.0\n support, or fall foul of important security updates.I would suggest choosing one listed as TLS1.2 in the Knowledge center page I linked to above for exampleTLS_RSA_WITH_AES_256_CBC_SHA256.\n"} +{"text": "### Human: I'm trying to implement MQ publish/subscribe in a C#/.Net application.I've following the instructions in this tutorial:https://tekslate.com/publish-subscribe-in-websphere-mq-series/a) Queue manager: QMb) TCP Listener running, port: 1420c) Topic name: NEWS.SPORTS.CRICKETd) Subscription name also: NEWS.SPORTS.CRICKETe) Topic string: NEW/SPORTS/CRICKETf) Destination queue: SportsQI'm successfully able to to a \"test publish\" in MQ Explorer.\nI see \"message count = 1\" in the subscription.\nI see \"queue depth = 1\" in SportsQI'm able to connect to QM, I'm able to access the topic ... but it just hangs when I do a \"topic.Get(message\")Q: Why is MQ \"Get()\" hanging?????Code:using IBM.WMQ;\nusing System;\nusing System.Collections;\n\nnamespace HelloSubscribe\n{\n class Program\n {\n static void Main(string[] args)\n {\n string qmName = \"QM\";\n string hostName = \"localhost\";\n string strPort = \"1420\";\n string channelName = \"SYSTEM.DEF.SVRCONN\";\n string transport = MQC.TRANSPORT_MQSERIES_CLIENT;\n\n Hashtable connectionProperties = new Hashtable();\n connectionProperties.Add(MQC.HOST_NAME_PROPERTY, hostName);\n connectionProperties.Add(MQC.PORT_PROPERTY, strPort);\n connectionProperties.Add(MQC.CHANNEL_PROPERTY, channelName);\n\n MQQueueManager mqQueueManager = new MQQueueManager(qmName, connectionProperties);\n\n string topicObject = null;\n string topicString = \"NEWS/SPORTS/CRICKET\";\n string subscriptionName = \"NEWS.SPORTS.CRICKET\";\n string topicName = \"NEWS.SPORTS.CRICKET\";\n int openOptionsForGet = MQC.MQSO_CREATE | MQC.MQSO_FAIL_IF_QUIESCING | MQC.MQSO_DURABLE | MQC.MQSO_RESUME;\n MQTopic destForGet = mqQueueManager.AccessTopic(topicString, null, openOptionsForGet, null, subscriptionName);\n\n MQMessage messageForGet = new MQMessage();\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.Options |= MQC.MQGMO_WAIT | MQC.MQGMO_FAIL_IF_QUIESCING;\n gmo.WaitInterval = 1000; // wait 60 seconds\n destForGet.Get(messageForGet, gmo);\n string msg = messageForGet.ReadLine();\n\n destForGet.Close();\n mqQueueManager.Disconnect();\n mqQueueManager.Close();\n }\n }\n}I'm running WebSphere MQ 7.5, using the installed version of amqdnet.dll, and Visual Studio 2015.### Assistant: MQ Administrative SubscriptionThe tutorial you reference has you setup MQ Administrative subscriptions to subscribe topic strings to specific MQ queues, in this way any message published to a topic that matches the topic string of the subscription will be put to the queue you specify on the MQ Administrative subscription for exampleSportsQ, to read the message from the queue you would treat it as a queue not as a topic and access it withAccessQueuemethod for example:string queueName = \"SportsQ\";\n int openOptionsForGet = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_FAIL_IF_QUIESCING;\n MQQueue destForGet = mqQueueManager.AccessQueue(queueName, openOptionsForGet, null, null, null);Managed durable subscriptionWhat you are demonstrating in the code you provided is called a Managed durable subscription, in the background MQ will create a queue with a prefix likeSYSTEM.MANAGED.DURABLE.and subscribe this to the topic string. If you disconnect and then resume with the same \"subscription name\" then you will be connected to the same Managed queue and receive any messages that were published while you were not connected.Note that outside of something called a Retained publications in which MQ will save the most recent publication for future subscribers, you do not receive any messages published to a topic string before you subscribe, this is why you would not see the message you published via MQ Explorer prior to creating the Managed durable subscription.Based on what you provided you should be able to just publish a new message to the topic string and your application would receive it.Unmanaged durable subscriptionAnother option is to delete the MQ Administrative subscription you created and alter your program to make a unmanaged subscription where you provide a queue destination, for example:string queueName = \"SportsQ\";\n int QueueOpenOptionsForGet = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_FAIL_IF_QUIESCING;\n int TopicOpenOptionsForGet = MQC.MQSO_CREATE | MQC.MQSO_FAIL_IF_QUIESCING | MQC.MQSO_DURABLE | MQC.MQSO_RESUME;\n MQQueue destQueue = mqQueueManager.AccessQueue(queueName, QueueOpenOptionsForGet);\n MQTopic destForGet = mqQueueManager.AccessTopic(destQueue, topicString, null, openOptionsForGet, null, subscriptionName);This results in the a API subscription being created linking the topic string to the queue you provide as the destination.Just like with the MQ Administrative subscription, you could then treat this going forward as just a queue to get from or you can RESUME the subscription.Resuming a Unmanaged durable subscription without the need to know the queue nameYou need to still call the AccessTopic overload that has destination as the first parameter but you pass in NULL instead of a MQDestination, the program will resume the already created unmanaged subscription without the need to know the queue name. I was able to compile and test the following is working:using IBM.WMQ;\nusing System;\nusing System.Collections;\n\n\nnamespace HelloSubscribe\n{\n class Program\n {\n static void Main(string[] args)\n {\n string qmName = \"QM\";\n string hostName = \"localhost\";\n string strPort = \"1420\";\n string channelName = \"SYSTEM.DEF.SVRCONN\";\n string transport = MQC.TRANSPORT_MQSERIES_CLIENT;\n\n Hashtable connectionProperties = new Hashtable();\n connectionProperties.Add(MQC.HOST_NAME_PROPERTY, hostName);\n connectionProperties.Add(MQC.PORT_PROPERTY, strPort);\n connectionProperties.Add(MQC.CHANNEL_PROPERTY, channelName);\n\n MQQueueManager mqQueueManager = new MQQueueManager(qmName, connectionProperties);\n\n string topicString = \"NEWS/SPORTS/CRICKET\";\n string subscriptionName = \"NEWS.SPORTS.CRICKET\";\n int openOptionsForGet = MQC.MQSO_FAIL_IF_QUIESCING | MQC.MQSO_DURABLE | MQC.MQSO_RESUME;\n MQTopic destForGet = mqQueueManager.AccessTopic(null, topicString, null, openOptionsForGet, null, subscriptionName);\n\n MQMessage messageForGet = new MQMessage();\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.Options |= MQC.MQGMO_WAIT | MQC.MQGMO_FAIL_IF_QUIESCING;\n gmo.WaitInterval = 60000; // wait 60 seconds\n destForGet.Get(messageForGet, gmo);\n string msg = messageForGet.ReadLine();\n System.Console.WriteLine(\"Received message data : \" + msg);\n\n destForGet.Close();\n mqQueueManager.Disconnect();\n mqQueueManager.Close();\n }\n }\n}Also note that you do not even need the topicString, this can be null as well, the subscriptionName is all that is required to resume it:MQTopic destForGet = mqQueueManager.AccessTopic(null, null, null, openOptionsForGet, null, subscriptionName);Some other notes, the examples in the tutorial provided mixed case queue names, this is not recommended because in many places IBM MQ will fold things to UPPER CASE if you are not careful. The recommended best practice is to use UPPER CASE for IBM MQ object names (queues, etc).WaitInterval is in milliseconds so setting it to 1000 will wait 1 second not 60 seconds.\n"} +{"text": "### Human: I have a query with Websphere MQ. I want to list all the queue where the queue depth is greater is zero.something like :\nrunmqsc queue_manager_nameDISPLAY QLOCAL(*) WHERE(CURDEPTH) GT 0not sure about the syntax. Can someone please help### Assistant: DISPLAY QLOCAL(*) WHERE(CURDEPTH GT 0)\n"} +{"text": "### Human: Public and private-key pair will be generated during the creation of CSR on our server. We will send the CSR and public key to CA by holding private key with us. CA will validate our public key before signing it with private key of CA's root certificate. We are having our own CA team to certify the CSR requests. My queries are as follows:Will CSR itself includes public key or do we need to provide public key separately to CA ?Will CSR be signed by our public key before sending it to CA (or) CSR hold public key besides it?Will CA sign over only over CSR (or) on the combined set of CSR + public key.?Should we install CA's root and intermediate certs in our trust store both on the client and server side? since we are using our own CA instead of Global CA.When we are presenting server certificate to client, will that cert includes public key of server.?Should we install the server's public key in the truststore of clients for encryption purpose?Thanks for the help, in advance.### Assistant: Will CSR itself includes public key or do we need to provide public key separately to CA ?The public key is inside the CSRWill CSR be signed by our public key before sending it to CA (or) CSR hold public key besides it?The CSR is signed by your key. The public key is not enough but the private is needed for signing.Will CA sign over only over CSR (or) on the combined set of CSR + public key.?The CA will extract the information from the CSR including the public key and sign it. It will not sign the CSR itself.Should we install CA's root and intermediate certs in our trust store both on the client and server side? since we are using our own CA instead of Global CA.Only the root needs to be stored at the client as trust anchor. The intermediate certs should be send by the server together with the servers certificate inside the SSL handshake.When we are presenting server certificate to client, will that cert includes public key of server.?Yes, a certificate is the public key and additional information like subject (hostname).Should we install the server's public key in the truststore of clients for encryption purpose?No. The client will get the certificate during the SSL handshake. You only want to know about the servers certificate or public key before doing the handshake if you usecertificate pinning.\n"} +{"text": "### Human: What I would like is to run a Message Driven Bean that listens onto a (Websphere MQ7) topic. I would like to deploy my application on a Websphere 8.5.5 Cluster containing two cluster members.If a message for the topic arrives I would expect that only one of my two MDBs gets the message and process it.IBM states that I should set identically ClientIds and Subscription Names to ensure that only one instance is able to process a message on a Topic:http://www-01.ibm.com/support/docview.wss?uid=swg21442559Will the second MDB receive the mentioned MQRC_SUBSCRIPTION_IN_USE Exception, or will the cluster take care that one and only one MDB in the cluster will consume the topic-message?Maybe someone can point me to the IBM Documentation where this behaviour is defined.### Assistant: To allow multiple concurrent instances of an MDB to access the same subscription on an MQ queue manager you can enable \"Allow cloned durable subscriptions\" in the activation spec for the MDB.https://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.doc/ae/umj_pasm.htmlRunning like this means both instances of the MDB will start (no IN_USE errors) and each message for that single subscription will be processed by one instance of the MDB. You would use this to workload balance messages across the multiple WAS servers.This is only true for durable subscriptions. And only when the MDB instances are connected to the same queue manager.\n"} +{"text": "### Human: I'm trying to send message withreplyToproperty to WebSphere MQ.@SpringBootApplication\npublic class WmqSenderApplication {\n\n public static void main(String[] args) {\n ConfigurableApplicationContext ctx = SpringApplication.run(WmqSenderApplication.class, args);\n JmsTemplate jmsTemplate = ctx.getBean(JmsTemplate.class);\n jmsTemplate.send(\"TEST_QUEUE\",new MessageCreator() {\n\n @Override\n public Message createMessage(Session session) throws JMSException {\n TextMessage message = session.createTextMessage();\n message.setJMSReplyTo(new MQDestination(\"REPLY_QUEUE\"));//com.ibm.mq.jms.MQDestination\n return message;\n }\n });\n\n }\n\n @Bean\n public MQQueueConnectionFactory connFac() throws JMSException {\n MQQueueConnectionFactory cf = new MQQueueConnectionFactory();\n cf.setTransportType(1);\n cf.setHostName(\"localhost\");\n cf.setPort(1417);\n cf.setQueueManager(\"TEST\");\n cf.setChannel(\"CHANNEL\");\n return cf;\n }\n @Bean\n public JmsTemplate jmsTemplate() throws JMSException {\n return new JmsTemplate(connFac());\n }\n}But I got:com.ibm.msg.client.jms.DetailedInvalidDestinationException: \nJMSCMQ0005: The destination name '://REPLY_QUEUE' was not valid. The destination name specified does not conform to published destination syntax. Correct the specified destination name and try again.I got bothREPLY_QUEUEandTEST_QUEUEcreated in the broker.### Assistant: ThesetJMSReplyTomethod takes an object of typejavax.jms.Destination. You will need to create an instance of ajavax.jms.Destinationclass. You can create either a temporary queue or a permanent queue.Destination replyToQ = session.createQueue(\"REPLYQ\");\n TextMessage message = session.createTextMessage();\n message.setJMSReplyTo(replyToQ);\n return message;\n"} +{"text": "### Human: We are using Websphere MQ 7.5 as a messaging solution, using Spring JMS (v4.0.1) we have written a sender class to send some sample messages to this MQ, Now when the spring context is getting initialized it is throwing belowClassNotFoundExceptionexceptionSEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener\norg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jmsConnectionFactory' defined in class path resource [applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.ibm.mq.jms.MQQueueConnectionFactory]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError\n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1076)\n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1021)\n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)\n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)\n at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)\n at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)\n at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)\n at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)\n at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)\n at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)\n at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)\n at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)\n at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)\n at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)\n at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4726)\n at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5162)\n at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)\n at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)\n at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399)\n at java.util.concurrent.FutureTask.run(FutureTask.java:262)\n at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)\n at java.lang.Thread.run(Thread.java:745)\nCaused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.ibm.mq.jms.MQQueueConnectionFactory]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError\n at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:164)\n at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:89)\n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1069)\n ... 22 more\nCaused by: java.lang.NoClassDefFoundError\n at com.ibm.msg.client.wmq.factories.WMQFactoryFactory.class$(WMQFactoryFactory.java:132)\n at com.ibm.msg.client.wmq.factories.WMQFactoryFactory.setupDistHubTracing(WMQFactoryFactory.java:360)\n at com.ibm.msg.client.wmq.factories.WMQFactoryFactory.(WMQFactoryFactory.java:330)\n at com.ibm.msg.client.wmq.factories.WMQFactoryFactory.getInstance(WMQFactoryFactory.java:182)\n at com.ibm.msg.client.wmq.factories.WMQComponent.getFactoryInstance(WMQComponent.java:138)\n at com.ibm.msg.client.jms.internal.JmsFactoryFactoryImpl.getInstance(JmsFactoryFactoryImpl.java:152)\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.setProviderFactory(JmsConnectionFactoryImpl.java:176)\n at com.ibm.mq.jms.MQConnectionFactory.(MQConnectionFactory.java:285)\n at com.ibm.mq.jms.MQQueueConnectionFactory.(MQQueueConnectionFactory.java:76)\n at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\n at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)\n at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\n at java.lang.reflect.Constructor.newInstance(Constructor.java:526)\n at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148)\n ... 24 more\nCaused by: java.lang.ClassNotFoundException: com.ibm.disthub2.impl.client.SessionConfig\n at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1305)\n at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1157)\n at java.lang.Class.forName0(Native Method)\n at java.lang.Class.forName(Class.java:191)\n ... 38 moreBelow is my entry in spring xml\n \n \n \n \n \n\n\n\n \n \n\n\n \n \n \n \n \n \n \n \n \n \n\n\nMy Maven entriesNote: This mq jars have been downloaded to our internal maven repo, and we are accessing from there\n \n com.ibm.mq\n com.ibm.mq\n 7.0.1.3\n \n \n com.ibm.mqjms\n com.ibm.mqjms\n 7.0.1.3\n \n \n com.ibm.mq.jmqi\n com.ibm.mq.jmqi\n 7.0.1.3\n \n \n javax.jms\n javax.jms-api\n 2.0.1\n I tried searching on google but did not find any pointers as to from where and which jar needs to be added to eliminate this error.### Assistant: This is because you are missing below jar that contains sessionconfig\n com.ibm\n com.ibm.disthub2.dhbcore\n 7.1.0.0\n\n"} +{"text": "### Human: I am in a bit of a bind. I am trying to read a message of a WMQ via jms and then convert it to a pcf message for processing. I have only been able to find one resource on this and it hasn't been very helpful [bottom ofhttp://www-01.ibm.com/support/docview.wss?uid=swg21395682]I have tried to implement the technique in the above doc but every time I get to linePCFMessage response = new PCFMessage(dataInput);I throw MQRC 3013 - MQRCCF_STRUCTURE_TYPE_ERRORThis is the way my code looks, maybe you can see something I don't.BytesMessage message = null;\n do {\n // The consumer will wait 10 seconds (10,000 milliseconds)\n message = (BytesMessage) myConsumer.receive(10000);\n\n // get the size of the bytes message & read into an array\n int bodySize = (int) message.getBodyLength();\n byte[] data = new byte[bodySize];\n message.readBytes(data, bodySize);\n\n // Read into Stream and DataInput Stream\n ByteArrayInputStream bais = new ByteArrayInputStream(data);\n DataInput dataInput = new DataInputStream(bais);\n\n // Pass to PCF Message to process\n //MQException.logExclude(new Integer(2079));\n PCFMessage qStatsPcf = new PCFMessage(dataInput);\n\n session.commit();\n if (message != null) {\n processMessage(qStatsPcf);\n }\n } while (message != null);\n myConsumer.close();A couple updates in response to T.Rob's answer.\nI am currently running MQ 7.0. This is a what it is type thing, I can't currently upgrade.As to what I am trying to do, I am pulling messages from SYSTEM.ADMIN.STATISTICS.QUEUE and I want to parse that information for auditing purposes. The reasoning behind converting to a PCF message is that I am looking to pull some PCF parameters from these messages - for example .getParameter(PCFConstants.MQIAMO_PUTS)I am not attempting to send messages to MQ in anyway, just pull messages off and process them.### Assistant: A couple problems with this question:There is no mention of the version of the version of MQ jms client that is in use. Since IBM has repackaged the Java/JMS classes several times, it is necessary to mention which version you are working with to get a better answer.It is unclear what it is you are trying to do. An MQ PCF message is processed by the MQ Command Server. The messages are a binary format consisting of a linked list of name/type/value tuples. If your message body is not already in PCF name/type/value format, then casting it as a PCF message is expected to fail.Since it is not possible to respond to the question as worded with a solution, I'll provide some recommendations based on wild guesses as to what it is you might be trying to do.Use a modern MQ client. The Technote you linked to is for out-of-support versions of MQ client. You want one that is at least MQ v7.1, but preferably v8.0. since any version of MQ client works with any version of MQ, use the version that is most current. Just remember, the functionality you get is based on the oldest version of MQ used at the client or server. A v8.0 client doesn't get you v8.0 function on a v7.0 QMgr. Go to theSupportPacspage and look for entries with names likeMQC**. The MQ v8.0 client is current and it is SupportPac MQC8.If you really are trying to submit PCF messages to MQ's command processor, instantiate aPCF Agentto do it. Then construct the PCF message using one of thePCF message constructorsthat lets you specify the selectors and their values.What happened when you tried using the PCF Java samples? Did they also fail? Did they work? If so, how does your code differ? Youdidlook at IBM's PCF samples, right? Please seeInstallation directories for samplesfor the location for the sample programs, including the PCF samples.If you arenotattempting to send messages to the MQ Command Processor, please update the question to let us know what it is you are trying to do and why you believe you need PCF messages to do it.\n"} +{"text": "### Human: I am currently working with IBM MQ 7.0 and we have never used exits and I need to know in which scenario it can be best used. Needed some real time example where it will be used ?### Assistant: Exits are simply points in the processing of the QMgr or channel that can call out to user-defined code. Some common examples include:Use a client/server exit pair to provide client credentials which are validated by the server-side.Use a Message Exit to set message options (like turn off report options).Use a connection exit to perform workload balancing of clients.Use a workload balancing exit to choose destinations for messages in a cluster.Use an API exit to capture and log message content moving through the QMgr.Use an OAM exit to change the behavior of OAM (for example authorize against LDAP instead of SYSTEM.AUTH.DATA.QUEUE).In general, WMQ does what you need it to do without the need for exits. However, if you do need some functionality WMQ does not provide, an exit can often help. Just be aware that WMQ exits on the server side are system-level C code that must be re-entrant, relocatable and thread safe because they share memory with the QMgr.\n"} +{"text": "### Human: I am using 7.5.0.0 amqmdnet.dll and building my .net app using MQ.NET classes, however after deployment, if the target machine has 7.1.0.0 MQ client installed, the app throws can't find assembly\n7.5.0.0 dll information, is IBM's MQ client version not backward client compatible?System.IO.FileNotFoundException: Could not load file or assembly\n 'amqmdnet, Version=7.5.0.0, Culture=neutral,\n or one of its dependencies. The\n system cannot find the file specified.I can't find any information related to this at the official page.IBM 7.5 linkDoes that need to be always the build version in the target computer? I assume if i use 7.1 dll, it will work with 7.1 greater versions too. When i referenced 7.1.0.0, i get this in the project file.\n\nFalse \n ..\\..\\..\\..\\..\\..\\..\\..\\IBM\\7.1.0.0\\amqmdnet.dll\n Why is it having 7.5.0.0? any idea (although the version i have referenced is 7.1.0.0)?### Assistant: The backward compatibility \"issue\" is not just limited to MQ, it's with all .NET assemblies. Compiling an application with one version of a .NET assembly and running it with a lower version of that .NET assembly is not supported, not just MQ but every .NET assembly. You have to use the same version of the assembly that the application was built with. If you have higher version of that assembly then you would require policy files to redirect the .NET CLR to load the higher version of that .NET assembly.\n"} +{"text": "### Human: I need to know if the character \u00a7 is supported by CCSID 1208. In general, How do we find the list of characters supported by a particular CCSID.Thanks### Assistant: As nitgeek said, yes, it's supported and 1208 is UTF-8 (level 3).Here is alist of IBM's CCSID's. You can drill down to see the code pages - for instance here's the code page for37 (US/Canada).\n"} +{"text": "### Human: I have the following code :MQQueueManager mqm = null;\n MQQueue mqQueue = null;\n try\n {\n mqm = new MQQueueManager(\"SWIFTQM\", \"SWIFTCHANNEL\", \"localhost\");\n mqQueue = mqm.AccessQueue(\"SWIFTQ\", MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_FAIL_IF_QUIESCING);\n MQMessage mqMsg = new MQMessage();\n MQGetMessageOptions mqGetMsgOpts = new MQGetMessageOptions();\n mqGetMsgOpts.Options |= MQC.MQGMO_SYNCPOINT;\n mqQueue.Get(mqMsg, mqGetMsgOpts);\n string s1 = \"\";\n if (mqMsg.Format.CompareTo(MQC.MQFMT_STRING) == 0)\n s1 = mqMsg.ReadString(mqMsg.MessageLength);\n string s2 = \"\";\n mqQueue.Get(mqMsg, mqGetMsgOpts);\n if (mqMsg.Format.CompareTo(MQC.MQFMT_STRING) == 0)\n s2 = mqMsg.ReadString(mqMsg.MessageLength);\n }\n finally\n {\n if (mqQueue != null)\n mqQueue.Close();\n if (mqm != null)\n mqm.Disconnect();\n if (mqm != null)\n mqm.Close();\n }Though the queue has many messages, the second mqQueue.Get gets the \"MQRC_NO_MSG_AVAILABLE\" exception. Is there an option I am missing?### Assistant: Yes, you have to do amqMsg = new MQMessage();before making the secondGetcall. The reason for this isMQMessageobject gets initialized with the incoming message (headers and message body) during theGetcall. For example theMessageIdof the incoming message will be set to MQMessage.MessageId property.As you can notice the secondGetis being called withMQMessageobject initialized in the firstGetcall. What this effectively means is that the second Get call is looking for a message with a message id that you have already received in the first get call. But that message hadalreadybeen received in the first get call itself. Hence the second call fails withMQRC_NO_MSG_AVAILABLEreason code.Also you are usingMQGMO_SYNCPOINToption. But there is nocommitbeing called in your code. This option is for receiving messages in a local transaction. If you don't intend to receive message under transaction, then you have to remove this option else do amqm.Commit. If a Commit is not called messages will be redelivered when a connection is made again.\n"} +{"text": "### Human: I have a single 'point to point' IBM MQ queue receiving messages from multiple producers. My application consumes the messages from the queue. I am using spring 'jmstemplate\" and \"DefaultMessageListenerContainer\" to consume the messages asynchronously.My application is running on 2 jvms, meaning there are 2 listeners active on each jvm listening to the same queue.Coming to my questions, If a message arrives...1) How does the listeners know that the message arrived in the queue?2) Out of the two listeners, which one will receive the message ? What is the approach followed to distribute the messages to the listeners?3) Can i scale to 'N' count of listeners for a singe queue? If i grow to 10 listeners, how does the scaling work? how are the messages distributed to listeners?4) How does the MQ server make sure that the same message is not sent to multiple listeners?May be these are simple questions, but not able to drill down on how the above scenarios works. Please share your thoughts...### Assistant: That's a function of the IBM client library; the listener container simply polls the JMS API waiting for a message; by default, it uses a 1 second receive timeout; with TRACE level logging, you will see log messages showing this activity. The timeout can be modified by setting receiveTimeout on the container.That is indeterminate from the client's perspective; the IBM broker knows how many consumers are registered and picks one. Some brokers allow configuration of a pre-fetch; this can help performance under high volume but can hurt performance under low volume.Yes; the Spring Listener Container can dynamically scale the listeners based on load; you can configure min/max consumers and Spring will adjust within those bounds as necessary. Each listener is a separate consumer, as far as the broker is concerned so the work is distributed according to the broker's algorithms.That's a function of the IBM broker (and part of the JMS contract).If using transactions and a message is rolled back onto the queue; there is no guarantee that the same listener will get the re-delivered message.\n"} +{"text": "### Human: i see one recommendation from MQ security presentation that is making command server down if you don't need it. my question is how i can determine if i really require it or not.\n From the point of my view, if no administrative program for target QMGR runs such as MQ Explorer or other ones which send command message to QMGR, we can stop that command server, am i right\u3001Thanks### Assistant: The command server is used by desktop tools such as WebSphere MQ Explorer and SupportPac MO71 and central productivity/admin tools such as IR-360, AppWatch, QPasa! and others. It is also used by monitoring agents such as Tivoli Omegamon XE for Messaging and other instrumentation such as custom scripts you might write. If you do not use any of these tools, you can shut off the command server.As a rule, I recommend people shut off the command server in cases where it will never be used. The alternative of shutting it off most of the time and then turning it on during approved change windows is a bit more complex. In that case what you really get is a reduced window of opportunity for an attacker but you trade that for additional complexity. For example, when it is time to turn on the command server, you first need to make sure the queue is clear or else an attacker can just pre-load the command queue with commands. Also, if an attacker with access to the QMgr is able to leave a background process running on the server it can poll the command queue and watch for an input handle before putting commands to the queue.You may think that the pre-conditions of having access to the QMgr and the ability to run daemon programs is a high bar to set but consider that most shops run WebSphere App Server and WebSphere Message Broker with full MQ admin rights. In those cases, every program or workflow is a potential attacker. Although there has not yet been a publicly reported external breach involving MQ, I have worked on many assignments where WMQ was breached by well-meaning employees who were just trying to get their jobs done and took a shortcut by using their application's administrative privileges to the QMgr to \"fix\" something.The exception I usually make is for B2B gateway QMgrs. I typically put a lot of security on these and don't mind the added complexity. In fact one of the reasons for using a gateway QMgr for B2B is so that you can limit that complexity to one host rather than allowing external connections to terminate on many QMgrs and having to put added security on all of them. So I use a gateway and secure it to an extent that would be impractical to do across the entire network.So to sum up, if you do not use any remote productivity or admin tools, go ahead and shut off the command server. If you do need to run it occasionally, automate the startup so that the command queue is cleared (including a subsequent check to make sure depth is zero) before starting the command server. This should be considered a secondary security control because it will have only limited effectiveness if the channels allow administrative access. So get to V7.1 or higher as soon as you can and then use the CHLAUTH rules andSET AUTHRECcommands to lock down the channels before worrying too much about the command server.\n"} +{"text": "### Human: Using WebSphere MQ I want to setup up a topic that uses queues, so that when an application or inbound cluster connection attempts to put a message to a \u201cqueue\u201d, it \nactually uses a topic, and publishes it to 2 subscriptions, which are \nthemselves 2 separate queues. In essence, I want to go from an inbound \nqueue by name, but map it to 2 separate queues, likeAF_TO_DAAS is the inbound topic/which today is an actual \ncluster queue alias=>Goes to AF_TO_APP1 and=>Goes to AF_TO_APP2Sort of like if these were queues on a distribution list I suppose.Those two things are local queues.I\u2019m getting lost in the /topic/node business mapping it to subscriptions \nand model queues and what not \u2026### Assistant: WebSphere MQ allows an alias to point to a queue or a topic. It also provides a means to create a durable subscription administratively. To accomplish this setup, you connect the dots by replacing the existing alias with one that points to a topic. Then use two administrative subscriptions to route publications to the two (or more) queues.* First, define the topic\nDEFINE TOPIC('AF_TO_DAAS.TOPIC') +\n TOPICSTR('AF_TO_DAAS') +\n REPLACE\n\n* Now, create an alias over the topic.\n* Sending apps think this is a queue.\nDEFINE QALIAS('AF_TO_DAAS') +\n TARGET('AF_TO_DAAS.TOPIC') +\n TARGTYPE(TOPIC) +\n REPLACE\n\n* Queues for the two recvr apps\nDEFINE QLOCAL('AF_TO_APP1') +\n REPLACE\n\nDEFINE QLOCAL('AF_TO_APP2') +\n REPLACE\n\n* Now set up adminsitrative subs to route\n* messages to the two app queues.\nDEFINE SUB('AF_TO_DAAS.SUB') +\n TOPICSTR('') +\n TOPICOBJ('AF_TO_DAAS.TOPIC') +\n DEST('AF_TO_APP1') +\n PSPROP(NONE) +\n REPLACE\n\nDEFINE SUB('AF_TO_APP2.SUB') +\n TOPICSTR('') +\n TOPICOBJ('AF_TO_DAAS.TOPIC') +\n DEST('AF_TO_APP2') +\n PSPROP(NONE) +\n REPLACEBecause this is a publication, the messages will contain a propertyTopwhich contains the topic string. ThePSPROP(NONE)in the subscription entries causes this to be suppressed so the messages look like the original publication.Note also that theMQMD.MsgIDon the publications isdifferentthan it is on the original message.\n"} +{"text": "### Human: Can you tell me how to identify the version bit of installed IBM WebSphere MQ, 32 or 64? On Windows, Linux and UNIX respectively.Thanks very much### Assistant: Usedspmqver -alike so:bash-3.2$ dspmqver -a\nName: WebSphere MQ\nVersion: 7.0.1.4\nCMVC level: p701-104-110114\nBuildType: IKAP - (Production)\nPlatform: WebSphere MQ for Linux (x86-64 platform)\nMode: 64-bit\nO/S: Linux 2.6.18-194.17.4.el5\nbash-3.2$Or on Windows:C:\\>dspmqver\nName: WebSphere MQ\nVersion: 7.5.0.0\nLevel: p000-L120604\nBuildType: IKAP - (Production)\nPlatform: WebSphere MQ for Windows\nMode: 32-bit\nO/S: Windows 7 Ultimate x64 Edition, Build 7601: SP1\nInstName: WMQ75\nInstDesc:\nInstPath: C:\\Program Files (x86)\\IBM\\WebSphere MQ\nDataPath: C:\\Program Files (x86)\\IBM\\WebSphere MQ\nPrimary: Yes\nMaxCmdLevel: 750\n\nC:\\>Here is thedspmqverInfocenter page forV7.1andV7.5.\n"} +{"text": "### Human: I have to create a client to listen to messages on a queue. SSL is being used and I am developing in dot net. I have trawled through hundreds of pages of documentation and forums to find something clear and concise and it looks like it just isn't like that!I have a jks, and I am able to telnet to the server where the queue is being published. Below is the code I have so far...var factoryfactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\nvar connectionfactory = factoryfactory.CreateConnectionFactory();\nconnectionfactory.SetIntProperty(XMSC.WMQ_CONNECTION_MODE,XMSC.WMQ_CM_CLIENT_UNMANAGED);\n\nconnectionfactory.SetStringProperty(XMSC.WMQ_SSL_KEY_REPOSITORY, @\"C:\\...\\spindev1.key\");\nconnectionfactory.SetStringProperty(XMSC.WMQ_SSL_CIPHER_SPEC, \"SHA_WITH_RSA\");\nconnectionfactory.SetStringProperty(XMSC.WMQ_CHANNEL, \"SPINDEV1\");\n\nvar connection = connectionfactory.CreateConnection();I assume there must be a password somewhere but I cannot figure out how. My current error is 2538.EDITSo I just added IP and Port and now I'm getting error code 2393.connectionfactory.SetStringProperty(XMSC.WMQ_HOST_NAME, \"**.***.***.***\");\nconnectionfactory.SetIntProperty(XMSC.WMQ_PORT, 1431);EDIT 2Okay so now I have managed to start using the code provided by the people who are providing the queue data, however he says that in order to use the SSL keys the application must be run as spindev1 - surely that would mean creating a whole new account?### Assistant: For XMS .NET, the key store must be of CMS type, not JKS. JKS is for Java clients. CMS key store will have \".kdb\" as the file extension. So specify a CMS key store file name (without the .kdb extension) forXMSC.WMQ_SSL_KEY_REPOSITORY.On the CipherSpec you are using, I could not findSHA_WITH_RSAin MQ. Can you verify if the name is correct or you can try with a different cipher.HTH\n"} +{"text": "### Human: I need to write a simple MQSeries client in Java.The client just has to connect to the queue and pull off the next message.I have done this before a number of years ago and have all the sample code etc.All I remember needing are the three jar files:com.ibm.mq.iiop.jarcom.ibm.mq.jarconnector.jarI have been doing some reading and a lot of people talk about a properties file, but I have no recollection of this from my past experience.And so on to my question:What is theabsolute minimumI need on my system to develop, test and ultimately deploy a simple MQSeries client?And where can I find (download) these things?NOTE: This question is related to but not the same asthisone.### Assistant: The answer to the question depends on whether you want to put the resulting code into Production. You can grab a few jar files and include them on the CLASSPATH and get it to work. In fact with the repackaging done in v7, the number of jars has been reduced. However, it is not supported by IBM without the full client install.Why is that? The full install includes diagnostic facilities, supporting code, NLS support and the ability to collect all the Must Gather information to open a trouble ticket. If all you grab is a few jar files, you do not get the additional functionality and therefore no vendor support if something goes wrong.The WMQ v7 client install provided asSupportPac MQC7which is a free download.The jar files and CLASSPATH settings for both base Java and JMS are provided in theUsing Javamanual.Use the v7 client, even on a v6 server. It's backward compatible. In v7.0 the Java/JMS has all been rewritten and you just need the jars listed in the manual.Also, someone mentioned the etclient jar. That's the Extended Transactional Client and please be aware that it incurs the full license cost of a QMgr. You only need it if you are doing 2-phase commit (XA with WMQ and another resource manager in the same unit of work) and not using WebSphere App Server or Message Broker. For example, you want to do TPC using JBoss, MQ and a database, you need etclient jar file and pay for a full WMQ license. If you are not doing XA transactions you don't need it.\n"} +{"text": "### Human: I am encountering some issues when using IBM MQ along with Spring JMS. I am usingCachingConnectionFactoryto improve performance, but I noticed something which is \"strange\" either in MQ explorer app connection table and in netstat result.The cached session size is configured to5forCachingConnectionFactory.Create one or multiple connections in a single thread, I see 1 row in both MQ explorer and netstat.(OK, no problem)Create one connection and then 5 sessions in a single thread, I see 1 row in netstat result but 6 rows in MQ explorer.Now I want to test in a concurrent scenario with 5 producer threads, create one connection in each thread, I can see 1 row in netstat and 1 row in MQ explorer.In the same context as 3, create one connection and then create one session in each thread, I can see 5 rows in netstat result and (5 + 1) rows in MQ explorer. If doing connection.close() in each thread => rows count are not changed. If doing session.close() in each thread => rows count are not changed.Confused by case 4/.I would like to show same analysis result when usingMQConnectionFactoryCreate one or multiple connections in a single thread, I see 1 row in both MQ explorer and netstat.(OK, no problem)Create one connection and then 5 sessions in a single thread, I see 1 row in netstat result but 6 rows in MQ explorer.Now I want to test in a concurrent scenario with 5 producer threads, create one connection in each thread, I can see 5 rows in netstat and 5 rows in MQ explorer.In the same context as 3, create one connection and then create one session in each thread, I can see 5 rows in netstat result and 10 rows in MQ explorer. If doing connection.close() in each thread => rows count are now 0 in both of them. If doing session.close() in each thread => rows count are not changed in netstat, but decreased to 5 in MQ IE.Hope have your explanation, thank you### Assistant: IBM MQ level detailsnetstatwill show you network level TCP connections to the MQ queue manager's listener port, these will match 1 for 1 with the number of channel instances running.IBM MQ v7.0 and later support multiplexing multiple conversations per MQ channel instance. The setting on aSVRCONNchannel that controls the number of conversations per channel isSHARECNVand defaults to the value of10, this is negotiated based both on the server and client side settings to the smallest value, in the case of JMS generally this will match the server side setting unless CCDTs are used in which case it will negotiate based on theCLNTCONN'sSHARECNVvalue.If you run the following command inrunmqscyou can see both the negotiatedSHARECNVvalue (MAXSHCNV) and the current number of conversations (CURSHCNV).DIS CHS(CHL.NAME) CURSHCNV MAXSHCNV`When you look at connections related to TCP clients in MQ using either the following command inrunmqscor the application connection table in MQ Explorer, you will see one connection per conversation.DIS CONN(*) TYPE(ALL)JMS detailsAt the JMS layer each connection to the queue manager is a conversation.At the JMS layer each session is another conversation.What you likely see is that if you open enough sessions to go over theSHARCNVlimit and another channel instance will start, thus you will see another \"row\" in thenetstatoutput.Notes on your observations:You observed:Now I want to test in a concurrent scenario with 5 producer threads, create one connection in each thread, I can see 5 rows in netstat and 5 rows in MQ explorer.In the same context as 3, create one connection and then create one session in each thread, I can see 5 rows in netstat result and 10 rows in MQ explorer. If doing connection.close() in each thread => rows count are now 0 in both of them. If doing session.close() in each thread => rows count are not changed in netstat, but decreased to 5 in MQ IE.Comments below are based on the assumption that theSVRCONNchannel hasSHARECNV(10)and that you are not using a CCDT withCLNTCONNchannels withSHARECNVlower than 10.Connection created: From what I have read (your observations agree) each connection is a new channel instance no matter the SHARECNV setting.Session created for each connection: Each session will be an additional conversation in the same channel instance that was created by the connection it is associated with. If SHARECNV(1) you would also see a new channel instance for each session.connection.close(): By closing the 5 connections you close the sessions that were created on top of each connection, so seeing no more channels running or connections listed in Explorer is normal.session.close(): This is also normal, since you closed the 5 sessions then 5 connections you observe in Explorer will go away, but the connection will still keep the 5 channels running.Additional detailsNote also that other channel level improvements were added in MQ v7.0, bidirectional heart beats being one of those. If a MQ client v6.0 or lower connects to a MQ v7.0 or later queue manager the channel does not turn on the new features (multiplexing and bidirectional HBs). If a MQ v7.0 or later client connects to a MQ v7.0 or later queue manater, the v6.0 behavior can be forced by settingSHARECNV(0).SettingSHARECNV(1)keeps the new channel features but turns off multiplexing.IfSHARECNVis set either to0or1then the number of channels and netstat \"rows\" will increase for each JMS connection and session.Non-default performance enhancing settingIf you are at IBM MQ v8.0 or higher, IBM recommends usingSHARECNV(1)for a 15% performance increase. You can read about it here:IBM MQ 9.1.x Knowledge Center>Monitoring and performance>Tuning your IBM MQ network>Tuning client and server connection channelsThe default settings for client and server connection channels changed in Version 7.0 to use shared conversations. Performance enhancements for distributed severs were then introduced in Version 8.0. To benefit from the new features that were introduced alongside shared conversations, without the performance impact on the distributed server, set SHARECNV to 1 on your Version 8.0 or later server connection channels.From Version 7.0, each channel is defined by default to run up to 10 client conversations per channel instance. Before Version 7.0, each conversation was allocated to a different channel instance. The enhancements added in Version 7.0 also include the following features:Bi-directional heartbeatsAdministrator stop-quiesceRead-aheadAsynchronous-consume by client applicationsFor some configurations, using shared conversations brings significant benefits. However, for distributed servers,processing messages on channels that use the default configuration of 10 shared conversations is on average 15% slower than on channels that do not use shared conversations.On an MQI channel instance that is sharing conversations, all of the conversations on a socket are received by the same thread. If the conversations sharing a socket are all busy, the conversational threads contend with one another to use the receiving thread. The contention causes delays, and in this situation using a smaller number of shared conversations is better.You use the SHARECNV parameter to specify the maximum number of conversations to be shared over a particular TCP/IP client channel instance. For details of all possible values, and of the new features added in Version 7.0, see MQI client: Default behavior of client-connection and server-connection. If you do not need shared conversations, there are two settings that give best performance in Version 8.0 or later:SHARECNV(1). Use this setting whenever possible. It eliminates contention to use the receiving thread, and your client applications can take advantage of the new features added in Version 7.0.For this setting, distributed server performance is significantly improved in Version 8.0 or later. The performance improvements apply to Version 8.0 or later client applications that issue non read ahead synchronous get wait calls; for example C client MQGET wait calls. When these client applications are connected, the distributed server uses less threads and less memory and the throughput is increased.\n"} +{"text": "### Human: I am trying to create a poc application to use the IBM Mq connector in mule 4.\nI have created a queue manager on IBM Cloud and have the necessary details for connection.I have also created an application for which I have a username and an API-KEY.In the MQ config in mulesoft I am passing application username and API-KEY and it gives meJMSWMQ2013error which is for auth issue and the username and password are incorrect.I have usedCLOUD.APP.SVRCONNandCLOUD.ADMIN.SVRCONNbut nothing seems to be working.Just an FYI I am new to IBM cloud and don't have a full understanding of how things work in IBM cloud### Assistant: The usual problem with JMS authentication in cloud setups is that the password (apikey) is longer than 12 characters. To force the MQ JMS client to permit longer passwords you need to set a system property. Don't know how you do that with the Mule config but from the command line for Java programs it's-Dcom.ibm.mq.cfg.jmqi.useMQCSPauthentication=Y(and carefully note the case of that property).\n"} +{"text": "### Human: We have a legacy app using MQSeries C routine calls to send messages to an MQ Server. We don't have an MQ server in-house anymore, and we need to test a change that has been made to this legacy app before we release it to our client, who has their own (production) MQSeries server.Is there a way we can simulate an MQSeries server which will emulate an MQSeries Queue Manager with channels and queues, and can receive messages sent to a particular queue. We don't need it to actually do anything with the messages, we just want it to 'look' like a standard MQSeries server, and communicate appropriately with the client.If there is a way to do this in Java, that would be preferable, as that is the main source of knowledge in-house.### Assistant: I do not know of anyway to simulate or emulate a IBM MQ queue manager, but you can do better and just download and install IBM MQ Advanced for Developers which is a full MQ queue manager installed that is licensed for no cost for development work.The Tag Wiki for theibm-mqtag has a link to this download page along with many other useful links.You can just click the tag and then click on \"Learn More...\" or click thislinkto go directory to the Tag Wiki.Just install this and configure the needed channels and queues that you require.\n"} +{"text": "### Human: I am setting the Correlation ID while sending the message to MQ. And I need to use the CorrelationID from the COA of the message I pushed for the further processing.I am setting the correlation ID and sending the message to queue using the below code.MQMessage message = createMQMessage(\"12345\");\nmessage.write(\"Some message to push\".getBytes());\nqueue.put(message);\n\nprivate MQMessage createMQMessage(String corrID){\n\n MQMessage message = new MQMessage();\n message.messageFlags = MQConstants.MQMF_SEGMENTATION_ALLOWED;\n\n if (ackQueueName != null) {\n\n message.messageType = MQConstants.MQMT_REQUEST;\n message.replyToQueueManagerName = ackQueueManagerName;\n message.replyToQueueName = ackQueueName;\n message.report = MQConstants.MQRO_COA | MQConstants.MQRO_COD;\n message.correlationId = corrID.getBytes();\n\n\n\n }\n return message;\n }I am reading the replyQueue from another application to get the COA and extract the correlation ID for further processing.But the correlation ID is inbyte[]format and I used the below methodgetHexStringto get the string. But all I got is 48 digit Hex format of my correlation ID like414d5120514d41444556202020202020b5ca0d5b13b3bb20public static String getHexString(byte[] b) throws Exception {\n String result = \"\";\n for (int i=0; i < b.length; i++) {\n result += Integer.toString( ( b[i] & 0xff ) + 0x100, 16).substring( 1 );\n }\n\n\n return result;\n\n }All I need is the approach to convert the48digit HexStringto the Original Correlation ID I set. I tried using the below method to convert, but its giving me the junk data.public static String hexStringToByteArray(String hex) {\n int l = hex.length();\n byte[] data = new byte[l/2];\n for (int i = 0; i < l; i += 2) {\n data[i/2] = (byte) ((Character.digit(hex.charAt(i), 16) << 4)\n + Character.digit(hex.charAt(i+1), 16));\n }\n return new String(data);\n }### Assistant: Your report options are not explicitly set.MQRO_COPY_MSG_ID_TO_CORREL_IDThis is the default action, and\n indicates that if a report or reply is generated as a result of this\n message, the MsgId of this message is copied to the CorrelId of the\n report or reply message.Because of the default action, you will never receive the initial Correlation ID of your message. As Roger mentioned in his answer, it is bad practice to set theMsgIDprogrammatically. Simply use the following option to have theCorrelIDcopied to the report message:MQRO_PASS_CORREL_IDIf a report or reply is generated as a result of\n this message, the CorrelId of this message is copied to the CorrelId\n of the report or reply message.message.report = MQConstants.MQRO_COA \n | MQConstants.MQRO_COD \n | MQConstants.MQRO_PASS_CORREL_ID;\n"} +{"text": "### Human: \u200bI am sending messages to IBM MQ using Nifi PublishJMS processor. The Messages have Persistence = Persistent in MQ. I want to change it to Non-Persistent. Is there a property in Nifi PublishJms processor to correct this? Or is it done from the MQ side. I don't have access to MQ servers, I can only check the messages being delivered to the queue.### Assistant: At a low level a MQ client applications can specify the following persistence values:MQPER_PERSISTENCE_AS_PARENT(Use the value of the next topic above this one)MQPER_NOT_PERSISTENT(self-explanatory)MQPER_PERSISTENT(self-explanatory)MQPER_PERSISTENCE_AS_TOPIC_DEF(Use the value of this topic, the default on a topic is ASPARENT so this works likeMQPER_PERSISTENCE_AS_PARENTwhere defaults are in use)If nothing is specified thenMQPER_PERSISTENCE_AS_TOPIC_DEFis the default.Within the JMS API you can override this using a URI property as follows:queue:///theQueueName?persistence=1Propertypersistenceand all URI properties are documented in the IBM MQ v8 Knowledge center page \"Creating destinations in a JMS application\".Property name:persistence-2- As specified on the send() call or, if not specified on the send() call, the default persistence of the message producer.-1- As specified by the DefPersistence attribute of the IBM MQ queue or topic.1- Nonpersistent.2- Persistent.3- Equivalent to the value HIGH for the PERSISTENCE property as used in the IBM MQ JMS administration tool. For an explanation of this\n value, seeJMS persistent\n messages.\n"} +{"text": "### Human: I'm trying to Display IBM MQ channels usinghttps://www.ibm.com/support/knowledgecenter/en/SSFKSJ_7.5.0/com.ibm.mq.ref.adm.doc/q086040_.htmI defined a channel namedMYMQ.SVRCONN, however, this gives me a syntax error:runmqsc\nDISPLAY CHANNEL MYMQ.SVRCONN\n 5 : DISPLAY CHANNEL MYMQ.SVRCONNAMQ8405: Syntax error detected at or near end of command segment below:-\nDISPLAY CHANNELI get the same problem with:DISPLAY CHANNEL *Any suggestions why?I'm struggling to understand this syntax:>>-DISPLAY CHANNEL--(--generic-channel-name--)------------------>so bonus points if you can explain how syntax works.### Assistant: The(and)are part of the required syntax.In the examples you give the commands should be:DISPLAY CHANNEL(MYMQ.SVRCONN)orDISPLAY CHANNEL(*)Most MQSC command have a similar syntax of: () [optional parameters]A few examples:DEFINE CHL(MYMQ.SVRCONN) CHLTYPE(SVRCONN) MCAUSER('xyzuser')ALTER CHL(MYMQ.SVRCONN) CHLTYPE(SVRCONN) DESCR('Test channel')DISPLAY CHL(MYMQ.SVRCONN) MCAUSERTheQMGRobject is one of the exceptions where the object type does not need to be followed by a object name since when you run these commands you are connected to a specific queue manager:DIS QMGR CHLAUTH CONNAUTHALTER QMGR CHLAUTH(ENABLED)A few things to note:IBM MQ will always fold to UPPER case anything that is not surrounded in single quote'characters.SomeDISPLAYcommands by default display only a subset of all parameters on an object. You can use the special parameterALLto have it display all of them or you can indicate specific parameters you would like to display.DISPLAYcommands can also use aWHEREclause, for example:DIS CHL(*) WHERE(MCAUSER eq 'xyzuser') DESCR\n"} +{"text": "### Human: We have some code to send messages to a queue. It's using the amqmdnet dll version 8.0.0.6.The queue manager (Queuemanager) is instantiated once at the start of the application and used throughout. As messages are sent, a queue object is created and then closed. Should we create a queue object for each message or is it better to use just one instance? We are writing messages only, no reads.Here's some code:public QueueResult Enqueue(string message)\n {\n QueueResult result;\n using (var queue = _queueManager.AccessQueue(_queueName, MQC.MQOO_OUTPUT + MQC.MQOO_INPUT_SHARED + MQC.MQOO_FAIL_IF_QUIESCING))\n {\n var mqMessage = new MQMessage\n {\n Format = \"MQSTR\",\n Encoding = 546,\n CharacterSet = 437\n };\n\n mqMessage.WriteString(message);\n\n var options = CreateOptions();\n\n queue.Put(mqMessage, options);\n\n result = new QueueResult\n {\n CompletionCode = options.CompletionCode,\n ReasonCode = options.ReasonCode\n };\n\n queue.Close();\n }\n\n return result;\n }\n\npublic IQueue AccessQueue(string queueName, int openOptions)\n{\n return new Queue(mqQueueManager.AccessQueue(queueName, openOptions));\n}### Assistant: An older IBM MQ developerWorks article has some very good recommendations in general is \"The top 15 WebSphere MQ best practices\". Specific to your question it states the following:Build with performance in mindAlthough MQ was built for high transaction volumes, poor architecture and application design can compromise its ability to process messages as fast and effectively as possible. To mitigate potential performance issues, here are several recommendations:Keep connections and queues open if you are going to reuse them instead of repeatedly opening and closing, connecting and disconnecting.From a IBM MQ Client standpoint each queue open and close is a round trip on the network, depending on the latency between the MQ Client and the MQ Queue manager this can cause delay on top of the processing MQ needs to do when you open and close a queue, for example checking if you have permission to open the queue and opening the underlying q file on the disk.If you are putting persistent messages outside of a unit of work, this can cause locking contention on the queue manager with the application that is reading the messages (the reading application could be a channel agent if the queue you put to is a QREMOTE).Putting multiple messages under the same unit of work will also increase performance, how much would depend on the underlying storage.\n"} +{"text": "### Human: We have an application that was fully working in staging but when we deploy it on production we are getting MQ error 2495. We are running the application in a Tomcat 8.5 and we are using the same MQ libraries (8.0.0.6). The server OS is Windows.The code for reading the message from the MQ looks like:MQEnvironment.hostname = queueSettings.getServer();\n MQEnvironment.channel = queueSettings.getChannel();\n MQEnvironment.port = queueSettings.getPort();\n\n MQQueueManager queueManager = new MQQueueManager(queueSettings.getQueueManager());\n\n int openOptions = CMQC.MQCBDO_FAIL_IF_QUIESCING | CMQC.MQOO_INPUT_SHARED | CMQC.MQOO_BROWSE;\n\n MQQueue queue = queueManager.accessQueue(queueSettings.getQueue(), openOptions);De full stacktrace of the error looks like:com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2495'.\nat com.ibm.mq.MQSESSION.(MQSESSION.java:2063)\nat com.ibm.mq.MQSESSION.getSession(MQSESSION.java:2103)\nat com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:207)\nat com.ibm.mq.MQBindingsManagedConnectionFactoryJ11._createManagedConnection(MQBindingsManagedConnectionFactoryJ11.java:185)\nat com.ibm.mq.MQBindingsManagedConnectionFactoryJ11.createManagedConnection(MQBindingsManagedConnectionFactoryJ11.java:230)\nat com.ibm.mq.StoredManagedConnection.(StoredManagedConnection.java:96)\nat com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:194)\nat com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:758)\nat com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:706)\nat com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:670)\nat com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:145)\nat com.ibm.mq.MQQueueManager.(MQQueueManager.java:675)\nat com.atlascopco.cpq.connections.MQConnection.readMessagesFromQueue(MQConnection.java:92)\nat com.atlascopco.cpq.tasks.ResponseHandlerTask.run(ResponseHandlerTask.java:43)\nat java.util.TimerThread.mainLoop(Unknown Source)\nat java.util.TimerThread.run(Unknown Source)\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2495;AMQ8568: The native JNI library 'mqjbnd64' was not found. For a client installation this is expected. [3=mqjbnd64]\nat com.ibm.mq.jmqi.local.LocalMQ.loadLib(LocalMQ.java:1202)\nat com.ibm.mq.jmqi.local.LocalMQ$1.run(LocalMQ.java:272)\nat java.security.AccessController.doPrivileged(Native Method)\nat com.ibm.mq.jmqi.local.LocalMQ.initialise_inner(LocalMQ.java:260)\nat com.ibm.mq.jmqi.local.LocalMQ.initialise(LocalMQ.java:223)\nat com.ibm.mq.jmqi.local.LocalMQ.(LocalMQ.java:1255)\nat com.ibm.mq.jmqi.local.LocalServer.(LocalServer.java:219)\nat sun.reflect.GeneratedConstructorAccessor10933.newInstance(Unknown Source)\nat sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)\nat java.lang.reflect.Constructor.newInstance(Unknown Source)\nat com.ibm.mq.jmqi.JmqiEnvironment.getInstance(JmqiEnvironment.java:656)\nat com.ibm.mq.jmqi.JmqiEnvironment.getMQI(JmqiEnvironment.java:590)\nat com.ibm.mq.MQSESSION.(MQSESSION.java:2056)\n... 15 common frames omitted\nCaused by: java.lang.UnsatisfiedLinkError: no mqjbnd64 in java.library.path\nat java.lang.ClassLoader.loadLibrary(Unknown Source)\nat java.lang.Runtime.loadLibrary0(Unknown Source)\nat java.lang.System.loadLibrary(Unknown Source)\nat com.ibm.mq.jmqi.local.LocalMQ.loadLib(LocalMQ.java:1146)\n... 27 common frames omittedHow can I find the issue?### Assistant: The issue is in your stack trace:Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2495;AMQ8568: The native JNI library 'mqjbnd64' was not found. For a client installation this is expected. [3=mqjbnd64]\nCaused by: java.lang.UnsatisfiedLinkError: no mqjbnd64 in java.library.pathThis is documented on the IBM MQ Knowledge center page \"Configuring the Java Native Interface (JNI) libraries\"On windows the default location for the libraries are below:MQ_INSTALLATION_PATH\\java\\lib (32-bit libraries)\nMQ_INSTALLATION_PATH\\java\\lib64 (64-bit libraries)You can specify the location of this library one of two ways (both examples below would be for a 64bit JRE if MQ is installed in the default location, if you are running a 32bit JRE use thelibdirectory instead of thelib64directory):With a JVM argument, for example:-Djava.library.path=C:\\Program Files\\IBM\\MQ\\java\\lib64Via an OS environment variable. In your case on Windows use:set PATH=C:\\Program Files\\IBM\\MQ\\java\\lib64;%PATH%\n"} +{"text": "### Human: Is there anyway to bridge between Azure Service Bus queue and a WebSphere queue?Preferably \"something\" hosted in Azure, rather than an on-premise product### Assistant: There is a wiki pageHow to Send message from an on premise IBM MQ to Azure Service Bus queuewhich introduce for the needs. You can follow it to create a program, either as a continous web job on Azure if using Azure App Service, or running on Azure VM if you want.If the WebSphere MQ works on network within public IP, I think it's simple without any other additional work for network configuration. If not, you can try to create anAzure VPN Gatewayto establish secure & cross-premises connectivity between them for message transfering.\n"} +{"text": "### Human: I am trying to list all the queue names on a queue manager using Java. I am not allowed to use PCF messages. I would like to know if there is another way to do this. Can someone help me on this?### Assistant: The MQ API is focused on things a business application needs to do. For security and other reasons, business apps are expected to know which queues they need so there's no \"inquire queue names\" function as part of the API.Instrumentation and admin apps are expected to have the need to do things like query the configuration of the queue manager. The PCF and command line messages are provided for this purpose.If the application in question is a business application, it would break the expected security model to grant it both business privileges and admin/instrumentation privileges. The MQ Admin would be correct to question why a business app needs to query the list of defined queue.If the application in question is intended to perform instrumentation or admin tasks, then itmustbe granted appropriate privileges, including access to put messages onto the Command Queue.If the app's ID is properly permissioned, access to the Command Queue can be granted without also giving away full MQ Admin access. In fact, MQ Explorer has a set of roles that grant read-only access to Explorer users and those work great for instrumentation apps.\n"} +{"text": "### Human: When setting up aMQQueueConnectionFactorywe initialize it as follows:MQQueueConnectionFactory factory = new MQQueueConnectionFactory();\n\nfactory.setQueueManager(queueManager);\n\nfactory.setTransportType(CommonConstants.WMQ_CM_CLIENT);\nfactory.setHostName(host);\nfactory.setPort(port);\nfactory.setChannel(channel);Especially we set the name of the queue manager. From this pattern it seems that the queue manager name is necessary to fully identify the queue manager. One might concluded that on the same host and port a different queue manager might listen. Is this possible?However, when setting thethe connection name listto specify reconnect targets there is no queue manager name necessary:public void setConnectionNameList(java.lang.String hosts) throws javax.jms.JMSExceptionSpecifies the hosts to which the client will attempt to reconnect to after its connection is broken. The connection name list is a comma seperated list of host/ip port pairs. eg. 127.0.0.1(1414),host2.example.com(1400) The default setting of this property is 'localhost(1414)' A null, or empty string is taken to mean localhost(1414)When setting theclient reconnect optionstwo options seems to be important in this context:WMQ_CLIENT_RECONNECT - Reconnect to the any of the queue managers specified in the connection name listWMQ_CLIENT_RECONNECT_Q_MGR - Reconnect to the same queue manager we were originally connected to. This will throw MQRC_RECONNECT_QMID_MISMATCH if the queue manager it tries to connect to (specified in the connection name list) has a different QMID to the queue manager originally connected to.These documentations make not clear if multiple queue managers behind the same host/port are possible. Compare this to Oracle where multiple services can be served by the same listener.We have two queue managers listening on different hosts/ports which have different names. We want to use one of these queue managers as failover manager in the connection name list. The question is: is the queue manager uniquely identified by host and port only?### Assistant: There's a lot to unwind in this question so let's take it one item at a time.There can be only one listener bound to a particular port and interface. So if the listener is promiscuous (listens on all interfaces) there's only one per port. If the host has multiple interfaces separate listeners can be bound on the same port on each of the interfaces. Since a listener is a child process of the queue manager, the implication is only one QMgr can listen on a givenaddress(port)combination.The QMgr name need not be present in the connection request received by the QMgr. If the QMgr name is blank, the connection succeeds with any QMgr to which the connection request is addressed, provided that QMgr does not reject it for bad password, certificate validation or other errors. However, if a QMgr nameisin the connection request itmustmatch the name of the QMgr to which the connection is attempted.Connection Namelist (more properlyCONNAME)is a comma-separated list ofaddress(port)combinations that are eligible to receive the connection being requested.Multi-Instance QMgrs have two addresses and one port. They are only ever active on one address and a channel pointing to them must have both addresses to be able to connect reliably. However, it need not have the QMgr name.But there is another type of HA in which there are multiple equivalent QMgrs, each with different names, to which a client can connect. This is especially true when the client is requesting information from a system of record but is not itself a system of record. Such a client has no need to listen on a well known queue. Instead it connects to any one of a tier of client-connection QMgrs, creates a dynamic Reply-To queue, and sends requests out to the system of record listening on a clustered queue out in the MQ network somewhere. In this scenario, the client doesn't specify a QMgr name and thus takes advantage of MQ's behavior of accepting whatever QMgr it connects to.Finally, MQ has long had Client Channel Definition Table or CCDT files. Before we had multi-instanceCONNAMEthe CCDT provided the capability of connecting to any of several QMgrs. Rather than putting a QMgr name in the CCDT the MQ Admin put symbolic names. For example if there were 3 QMgrs for Payroll processing, the QMgr names in their CCDT entries might be PAY01, PAY02, and PAY03, none of which match the actual QMgr names. Each of these has anaddress(port)pointing to one of the three QMgrs. The developer then specifies a QMgr name of*PAYand the MQ client would pick among all CCDT entries with the first 3 characters matching 'PAY'. With this and a few other options it was possible to have the MQ client drive reconnects but have the MQ client stub encapsulate the logic of whether to round-robin among destinations, retry the last connected address, or whatever.From this pattern it seems that the queue manager name is necessary to\n fully identify the queue manager. One might concluded that on the same\n host and port a different queue manager might listen. Is this\n possible?No.We have two queue managers listening on different hosts/ports which\n have different names. We want to use one of these queue managers as\n failover manager in the connection name list. The question is: is the\n queue manager uniquely identified by host and port only?Make sure the QMgr name is blank on the request and specify bothaddress(port)combinations in theCONNAMEand you should be good to go.Please see:Role of the client channel definition table, and in particular in that sectionQueue manager groups in the CCDT. The section onExamples of channel weighting and affinityis also helpful here.Finally, be sure that you are using a modern client. Since MQ clients can connect to any forward- or back-level QMgr it is possible to develop on a v9.0 client and connect to a v7.1 QMgr. Of course the functionality provided is based on the lowest version of client or QMgr so you don't get JMS 1.2 features with a v9.0 client and an ancient QMgr. However, youdoget all the performance improvements and bug fixes in the later client versions. If you are not at the latest client (or the latest one supported by your JEE server) then go download one at:SupportPac MQC75SupportPac MQC8SupportPac MQC9\n"} +{"text": "### Human: I configured SSL security for my IBM MQ. I disabled user identification usingALTER AUTHINFO(SYSTEM.DEFAULT.AUTHINFO.IDPWOS) AUTHTYPE(IDPWOS) CHCKCLNT(OPTIONAL)\n\nREFRESH SECURITY TYPE(CONNAUTH)I set up an MCA user id on the respective channel, so after the connection is established this user is used for any further actions. I checked out IBM MQ documentation and found that there exist two ways of user identification (using system user or LDAP). Now I want to turn on user identification, but instead of system user or LDAP I want to use SSL certificate only. I don't want either to hand on user or password nor to configure LDAP.My question is, is it possible to use SSL security not only for connection establishing (authentication), but also for user identification.### Assistant: Yes it is possible to use the certificate Distinguished Name details to map a user into the MCAUSER that the running channel uses. To do this you would use the CHLAUTH feature.Make sure it is enabled:-DISPLAY QMGR CHLAUTHand if it isn't, enable it with the following command:-ALTER QMGR CHLAUTH(ENABLED)To map from an SSL certificate to an MCAUSER, you would create a CHLAUTH rule something like this:-SET CHLAUTH(APP1.SSL.SVRCONN) TYPE(SSLPEERMAP) SSLPEER('CN=Morag,O=MQGem') MCAUSER('hughson')where APP1.SSL.SVRCONN was my channel name, the string in the SSLPEER field was the Subject's DN from my certificate, and 'hughson' is the value I want to see the running channel use in its MCAUSER when a connection from this certificate comes into this channel.This sort of rule is often combined with abackstop rule, and/or a rubbish user id in the MCAUSER. Thus if you don't match a CHLAUTH rule that fills in a suitable MCAUSER then the channel won't run.\n"} +{"text": "### Human: I have the following task, that involves ibm message queue:Exists an application(JMS client) that gets messages from input queue Q1 and puts messages to Q2. There are several application clients that put messages to Q1. Clients specify correlation id for each message. Application retrieve id from the message received from Q1, creates new output message, adds retrieved id and put the message into Q2. Then each client retrieves only its own message, based on correlation id.My questions is:If client doesn't specify any id, he reads all the messages from queue. I want a restriction, that forbids from reading the queue when no correlation id is specified.Is this possible to accomplish using ibm message queue only?\nIf not any other suggestions.### Assistant: Have you considered using a temporary queue for the reply queue (Q2)? In this pattern each application creates a temporary queue for its own use. All applications put to Q1 and set the ReplyToQ in the MQMD to the name of their temporary queue.The application processing messages on Q1 puts the response to the specified ReplyToQ instead of putting them all to Q2 with a given correlation ID.This scenario ought to avoid errant applications accidentally consuming messages from the queue not intended for them.\n"} +{"text": "### Human: First of all, let me admit that I am completely new to MQ, so my question might be trivial.We are using MQs configured on Websphere and I am trying to use MQExplorer 8 to monitor the same. After connecting using the Queue Managers, I can see the Current Queue Depth, Open Input Count, etc. But I don't get any option to see the actual messages lying in a queue.\nI tried googling it, but did not find anything useful.Here is what I see:Can some enlighten me how can I see the actual messages from a queue?### Assistant: The context menu is your friend. Right-click on the queue name and select Browse.\n"} +{"text": "### Human: Is there a way to write a PCF program to get channel status for Cluster Sender/Receiver channels which are in \"Running\" status?I have something like this which gives me channel status of only one channel!// send the request and collect the responses \n String checkStatus=\"\";\n String channelName =\"\";\n // build a request \n request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_CHANNEL_STATUS); \n // add a parameter designating the name of the channel for which status is requested \n request.addParameter(CMQCFC.MQCACH_CHANNEL_NAME, \"TO.*\"); \n // add a parameter designating the instance type (current) desired \n request.addParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_TYPE, CMQC.MQOT_CURRENT_CHANNEL); \n\n responses = agent.send(request); \n for (int j = 0; j < responses.length; j++) { \n // get the channel name and trim the spaces \n String temp =\"\";\n temp = responses[j].getStringParameterValue(CMQCFC.MQCACH_CHANNEL_NAME); \n channelName = temp.trim(); \n\n int chlStatus = responses[j].getIntParameterValue(CMQCFC.MQIACH_CHANNEL_STATUS); \n //System.out.println(\"channel status: \" + chlStatus); \n String[] chStatusText = { \n \"\", \"MQCHS_BINDING\", \"MQCHS_STARTING\", \"MQCHS_RUNNING\", \n \"MQCHS_STOPPING\", \"MQCHS_RETRYING\", \"MQCHS_STOPPED\", \n \"MQCHS_REQUESTING\", \"MQCHS_PAUSED\", \n \"\", \"\", \"\", \"\", \"MQCHS_INITIALIZING\" \n }; \n checkStatus = chStatusText[chlStatus]; \n //System.out.println(\"channel status: \" + checkStatus); \n } \n System.out.println(\"chl: \" + channelName + \" STATUS: \" + checkStatus + \")\");The above code gives channel status for only one channel and not all the channels. What is wrong here?### Assistant: The PCF part of your code looks fine, but the printing out of the result is the code in error.responses = agent.send(request); \nfor (int j = 0; j < responses.length; j++) { \n :\n :\n checkStatus = chStatusText[chlStatus];\n} \nSystem.out.println(\"chl: \" + channelName + \" STATUS: \" + checkStatus + \")\");You have a for loop going round all the responses, but then theprintlnis outside the for loop and thus is only printing out the result for the final response.\n"} +{"text": "### Human: We have a Spring Integration flow which consumes messages off a Websphere MQ Manager queue. These messages are put through a simple process and afterwards are put into another queue (in the same MQ Manager).When we try to write the messages to the final destination queue, we are getting the following error:Caused by: javax.jms.JMSException: MQJMS1006: invalid value for 'JMS_IBM_Character_Set': 'IBM850'.\n at com.ibm.msg.client.wmq.v6.jms.internal.ConfigEnvironment.newException(ConfigEnvironment.java:431) ~[com.ibm.mqjms-7.0.1.3.jar:7.0.1.3 - k701-103-100812]\n at com.ibm.msg.client.wmq.v6.jms.internal.MQMessageProducer.sendInternal(MQMessageProducer.java:1153) ~[com.ibm.mqjms-7.0.1.3.jar:7.0.1.3 - k701-103-100812]\n at com.ibm.msg.client.wmq.v6.jms.internal.MQMessageProducer.send(MQMessageProducer.java:779) ~[com.ibm.mqjms-7.0.1.3.jar:7.0.1.3 - k701-103-100812]\n at com.ibm.msg.client.wmq.v6.jms.internal.MQMessageProducer.send(MQMessageProducer.java:2718) ~[com.ibm.mqjms-7.0.1.3.jar:7.0.1.3 - k701-103-100812]\n at com.ibm.msg.client.jms.internal.JmsMessageProducerImpl.sendMessage(JmsMessageProducerImpl.java:907) ~[com.ibm.mqjms-7.0.1.3.jar:7.0.1.3 - k701-103-100812]\n at com.ibm.msg.client.jms.internal.JmsMessageProducerImpl.send_(JmsMessageProducerImpl.java:762) ~[com.ibm.mqjms-7.0.1.3.jar:7.0.1.3 - k701-103-100812]\n at com.ibm.msg.client.jms.internal.JmsMessageProducerImpl.send(JmsMessageProducerImpl.java:393) ~[com.ibm.mqjms-7.0.1.3.jar:7.0.1.3 - k701-103-100812]\n at com.ibm.mq.jms.MQMessageProducer.send(MQMessageProducer.java:333) ~[com.ibm.mqjms-7.0.1.3.jar:7.0.1.3 - k701-103-100812]\n at org.springframework.jms.connection.CachedMessageProducer.send(CachedMessageProducer.java:181) ~[spring-jms-4.2.1.RELEASE.jar:4.2.1.RELEASE]\n at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:636) ~[spring-jms-4.2.1.RELEASE.jar:4.2.1.RELEASE]\n at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:607) ~[spring-jms-4.2.1.RELEASE.jar:4.2.1.RELEASE]\n at org.springframework.jms.core.JmsTemplate$4.doInJms(JmsTemplate.java:584) ~[spring-jms-4.2.1.RELEASE.jar:4.2.1.RELEASE]\n at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:494) ~[spring-jms-4.2.1.RELEASE.jar:4.2.1.RELEASE]\n at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:580) ~[spring-jms-4.2.1.RELEASE.jar:4.2.1.RELEASE]\n at org.springframework.jms.core.JmsTemplate.convertAndSend(JmsTemplate.java:706) ~[spring-jms-4.2.1.RELEASE.jar:4.2.1.RELEASE]\n at org.springframework.integration.jms.JmsSendingMessageHandler.send(JmsSendingMessageHandler.java:145) ~[spring-integration-jms-4.2.0.RELEASE.jar:?]\n at org.springframework.integration.jms.JmsSendingMessageHandler.handleMessageInternal(JmsSendingMessageHandler.java:115) ~[spring-integration-jms-4.2.0.RELEASE.jar:?]\n at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:127) ~[spring-integration-core-4.2.0.RELEASE.jar:?]The messages we pick up from the initial queue have the following IBM-Specific headers:JMS_IBM_Character_Set=IBM850,\nJMS_IBM_MQMD_CodedCharSetId=850,\nJMS_IBM_Encoding=17,\nJMS_IBM_PutApplType=11,\nJMS_IBM_Format= ,\nJMSXDeliveryCount=1,\nJMS_IBM_PutTime=12534150,\nJMS_IBM_MsgType=8and they are still there when we try and write the processed message into the final Websphere MQ Queue.The project is using the following IBM MQ dependency jars:compile 'com.ibm:com.ibm.mq:7.0.1.3'\ncompile 'com.ibm:com.ibm.mqjms:7.0.1.3'\ncompile 'com.ibm:com.ibm.mq.jmqi:7.0.1.3'\ncompile 'com.ibm:com.ibm.mq.headers:7.0.1.3'What is the correct way of resolving this exception? Should we:Strip anyJMS_IBM_XXXheaders from the message before writing\nto the final Websphere MQ Queue?Use different version jars?Do something else entirely?We don't seem to experience this issue in any other flows that pick up messages from a Websphere MQ queue and finally writes them to another Websphere MQ queue.### Assistant: QuotingWebSphere MQ 7.5 - MS_IBM_Character_Set:Prior to WebSphere\u00ae MQ V7.5, applications using WebSphere MQ messaging provider migration mode could set the JMS_IBM_Character_Set property of a message to a numerical Coded Character Set Identifier.When the message was sent, the Coded Character Set Identifier stored in the JMS_IBM_Character_Set property was mapped to the MQMD field CodedCharacterSetID.When using the WebSphere MQ V7.5 classes for JMS, a JMSException containing the message:MQJMS1006: invalid value for 'JMS_IBM_Character_Set': ''is thrown if an application tries to send a message that has the JMS_IBM_Character_Set property set to a numerical Coded Character Set Identifier.The JMS_IBM_Character_Set property must be set to the Java character set string that maps to the Coded Character Set Identifier that the application wants to use. For more information, seeMapping JMS fields onto WebSphere MQ fields (outgoing messages)Since you are using version 7.0.1.3, not 7.5 or later, the value must be a\"numericalCoded Character Set Identifier\", meaning it should be850(numerical), notIBM850.In version 7.5 it should beIBM850.\n"} +{"text": "### Human: I have the following code to get queue information, which throws a2232error when done as part of a transaction:Dim specificQMConnProperties As Hashtable = CType(queueManagerConnectionProperties.Clone(), Hashtable)\nspecificQMConnProperties.Add(MQC.HOST_NAME_PROPERTY, qmgrHostNameOrIP)\nspecificQMConnProperties.Add(MQC.PORT_PROPERTY, qmgrPort)\nspecificQMConnProperties.Add(MQC.CHANNEL_PROPERTY, qmgrChannel)\nDim qmgr As MQQueueManager = Nothing\nTry\n qmgr = New MQQueueManager(qmgrName, specificQMConnProperties)\nCatch ex As MQException\n Select Case ex.ReasonCode\n Case 2059, 2538\n ' qmgr or host not available\n Return nothing\n Case Else\n ' continue\n End Select\nEnd Try\n\nIf qmgr IsNot Nothing Then\nTry\n ' use PCF to get queue information.\n Dim agent As New PCFMessageAgent(qmgr)\n Dim request As New PCFMessage(CMQCFC.MQCMD_INQUIRE_Q)\n request.AddParameter(MQC.MQCA_Q_NAME, queueName)\n\n Dim responses As PCFMessage() = Nothing\n\n Try\n ' connected\n responses = agent.Send(request)\n Catch pcfex As PCFException\n LogException(pcfex, {queue}, \"Exception checking queue availability via PCF. Assuming false\")\n Return Nothing\n End Try\n\n If responses IsNot Nothing AndAlso responses.Any() Then\n LogDebug(\"Checking queue availability for \" & queue.ToString() & \" returned a PCF result.\")\n return responses\n Else\n LogError(\"No result returned from PCF Message request on \" & queue.ToString())\n Return Nothing\n End If\nCatch ex As MQException\n LogException(ex, {queue})\n Return False\nEnd Try\nEnd IfThe error occurs on the lineresponses = agent.Send(request), as follows:Completion Code: 2, Reason Code:\n 2232(2232=MQRC_UNIT_OF_WORK_NOT_STARTED) at\n IBM.WMQ.MQDestination.Put(MQMessage message, MQPutMessageOptions pmo)\n at IBM.WMQ.PCF.PCFAgent.Send(Int32 command, PCFParameter[] parameters)\n at IBM.WMQ.PCF.PCFMessageAgent.Send(PCFMessage request, Boolean check)\n at IBM.WMQ.PCF.PCFMessageAgent.Send(PCFMessage request) at MyMethodThe rest of my transaction connection options (e.g. for message get or put) haveOr MQC.MQGMO_SYNCPOINTappended - but I can't see how to set the connection options for a PCF message. Can anyone assist?To be clear, I don't really care if itissent as part of the transaction, but because a Transactionscope is open, I get this error.--Edit--I've added the code for the queue manager connection at the top.### Assistant: The fact that you are getting this error, suggests that either you are reusing the connection to the queue manager that you are using for your other puts and gets and so it is tripping over the transactional scope used for that connection, or that even a new connection that is made is picking up the transactional scope of your environment.PCFAgent can have it's own connectionThe PCFAgent and PCFMessageAgent will maintain its own connection to the queue manager and thus avoid the transactional scope on your existing connection.I suspect theqmgrin your code is anMQQueueManagerinstance although we can't see the code in your question that created it? If you instead usePCFMessageAgentto make a new connection to the queue manager, it will have its own connection and thus its own transactional scope.Seeclass PCFMessageAgentfor more details, but in short there are three constructors you should be aware of, and I believe you are using the first.PCFMessageAgent(MQQueueManager qmanager)Initializes a new PCFMessageAgent with an existing queue manager\nconnection.PCFMessageAgent(java.lang.String qmanager)Initializes a new PCFMessageAgent with a bindings connection to a queue manager.PCFMessageAgent(java.lang.String host, int port, java.lang.String channel)Initializes a new PCFMessageAgent with a client connection to a queue manager.Ignoring Transactional ScopeAlternatively, you can wrap your call to PCFMessageAgent in a new transactional scope using an option to suppress the transactional scope of the environment as detailed in another StackOverflow question:Ignore TransactionScope for specific queryusing (var scope = new TransactionScope(TransactionScopeOption.Suppress))\n{\n /* Your PCFMessageAgent code in here */\n\n}This is, unfortunately, the problem with using wrappers such asPCFAgent, you only get access to some of the things you could configure if you wrote it all yourself.\n"} +{"text": "### Human: Hey so i'm using spring integration'sjms:outbound-channel-adapterand need to set a priority on a message before i push it through to the messaging system.Now in plain JMS i had two ways of doing it.Either set the priority on theMessageProducer:this.producer.setPriority(i);Or on the send method itself:channel.send(message, DeliveryMode.PERSISTENT, 5, 1000);Neither of these options are available for me anymore since the channel adapter abstracts me away from these details.Setting the priority on the message itself works only in the in memorychannels of spring integration and loses effect soon as i put it into an actual queue. And turns out setting the priority on the message isn't an option at all:JMS message priority not working on MessageThere's an attribute on the channel adapter where i can set the priority, but this is static.The max i can do i read it from a property file. (Or so i think. I'm not sure). I can use thedestination-expressionattribute to inspect the incoming message and dynamically route it to different destinations, but there's nopriority-expressioncounter part for me to do the same with the priority.I have a work around of sorts, but it's not a very good one:\n\n I just route the messages to the appropriate outbound adapter once i determine what the priority needs to be. But if the number of priorities increases i'll be in trouble. Even if it doesn't, having two outbound adapters instead of one just coz i couldn't dynamically assign a priority is kinda clumsy i thought.Appreciate the help :-)Oh and i'm using Websphere MQ as my message broker. I don't know if this has anything to do with the message broker though.### Assistant: Simply set the priority header in the message...\n \nThe priority in the adapter configuration is a default which is used when there's no priority header (you can use a property placeholder to set it from a properties file).Or, use an expression...\n \n\n\n\n \n\n\n\n \n\n"} +{"text": "### Human: I'm using XMS 7.5 client to access the IBM MQ and wanted to know one thing about MessageListener.\nWhen there are multiple messages are present on the queue,will the associated MessageListener method (i.e, ProcessNewMessage in the below code)called concurrently? ORThe messages will be dispatched to the MessageListener(i.e, ProcessNewMessage in the below code) method only at a time?The code is something like below:private XMSFactoryFactory xMSFactoryFactory;\nprivate IConnectionFactory connectionFactory;\nprivate IConnection connectionWMQ;\nprivate ISession sessionWMQ;\nprivate IDestination destination;\nprivate IMessageConsumer messageConsumer;\n\nxMSFactoryFactory= XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\nconnectionFactory = _xMSFactoryFactory.CreateConnectionFactory();\n// Set queue manager name, set server names, channel, use\n// XMSC.WMQ_CM_CLIENT as WMQ_CONNECTION_MODE\n\nconnectionWMQ = _connectionFactory.CreateConnection();\nsessionWMQ = _connectionWMQ.CreateSession(true, AcknowledgeMode.SessionTransacted);\ndestination = sessionWMQ.CreateQueue(_queueSettings.QueueName);\nmessageConsumer = sessionWMQ.CreateConsumer(_destination);\n\n\nmessageConsumer.MessageListener = new MessageListener(ProcessNewMessage)### Assistant: Messages are delivered one at a time to consumer, it does not matter whether the consumer is callingreceive()or has setup a message listener to receive messages.In case of a message listener, MQ will wait for theOnMessage(in your caseProcessNewMessage) method to return before delivering the next suitable message.\n"} +{"text": "### Human: Do we have functionality in IBM.XMS toRe-connection Attempt Count,Re-connection Attempt Delay,Re-connection Attempt Timeoutsettings, just like we have in Tibco ?I am going to use IBM.XMS in a .NET application to send/receive messages to/from IBM MQ. If for some reason IBM MQ goes down, I believe these settings will allow the .NET application to attempt re-connection and thereby avoid any crash in the application.UPDATEI got some info athttp://www-01.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.msc.doc/xms_automatic_client_reconnection.htm. Using this I am using following:oConFactory.SetIntProperty(XMSC.WMQ_CLIENT_RECONNECT_OPTIONS, XMSC.WMQ_CLIENT_RECONNECT_Q_MGR);\noConFactory.SetStringProperty(XMSC.WMQ_CONNECTION_NAME_LIST, String.Format(\"{0}({1})\", con.Host, con.Port));\noConFactory.SetIntProperty(XMSC.WMQ_CLIENT_RECONNECT_TIMEOUT, ((con.ReconnectTimeout.HasValue && con.ReconnectTimeout.Value != 0) ? con.ReconnectTimeout.Value : XMSC.WMQ_CLIENT_RECONNECT_TIMEOUT_DEFAULT));But this is not working. The code is breaking the moment I stop the Queue Manager. Any suggestions ?### Assistant: Yes! Please use a modern version of MQ client and QMgr though. The functionality and stability are greatly improved, including the ability to use the client reconnect features. Please see:Automatic client reconnection in .NETRelated and important topics include:Connection Options- The different ways of connecting to MQ nativelyConnection differences- Describes MQ's use of .Net's managed and unmanaged connections and their differences.The preceding links were from the v7.5 documentation. If you need the v8.0 documentation (highly recommended to use the v8.0 QMgr and client which are current as of this writing) gohere.IBM has released a full-function, non-expiring product calledWebSphere MQ Advanced for Developersif you need a QMgr to test with on your personal workstation.That comes with the client libraries but if all you need is the client libs, just download the stand-alone client. Go to theSupportPacs landing pageand look for names like MC[vr]. The naming should be intuitive after that.SupportPac MQC8is the V8.0 client,MQC75is the v7.5 client, etc.If you need the WMQ Explorer download, pick that up asSupportPac MS0T. In that case, I highly recommend also gettingMS0Pand unzipping it to the Explorer Dropins folder.\n"} +{"text": "### Human: this is code of my class javapackage com.ibm.point_A_point;\n\nimport javax.jms.Connection;\nimport javax.jms.Destination;\nimport javax.jms.JMSException;\nimport javax.jms.Message;\nimport javax.jms.MessageConsumer;\nimport javax.jms.MessageProducer;\nimport javax.jms.Session;\nimport javax.jms.TextMessage;\n\nimport com.ibm.msg.client.jms.JmsConnectionFactory;\nimport com.ibm.msg.client.jms.JmsFactoryFactory;\nimport com.ibm.msg.client.wmq.WMQConstants;\n\n/**\n * A minimal and simple application for Point-to-point messaging.\n * \n * Application makes use of fixed literals, any customisations will require re-compilation of this\n * source file. Application assumes that the named queue is empty prior to a run.\n * \n * Notes:\n * \n * API type: JMS API (v1.1, unified domain)\n * \n * Messaging domain: Point-to-point\n * \n * Provider type: WebSphere MQ\n * \n * Connection mode: Client connection\n * \n * JNDI in use: No\n * \n */\npublic class SimplePTP {\n\n // System exit status value (assume unset value to be 1)\n private static int status = 1;\n\n /**\n * Main method\n * \n * @param args\n */\n public static void main(String[] args) {\n\n // Variables\n Connection connection = null;\n Session session = null;\n Destination destination = null;\n MessageProducer producer = null;\n MessageConsumer consumer = null;\n\n try {\n // Create a connection factory\n JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\n JmsConnectionFactory cf = ff.createConnectionFactory();\n\n // Set the properties\n cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, \"localhost\");\n cf.setIntProperty(WMQConstants.WMQ_PORT, 1414);\n cf.setStringProperty(WMQConstants.WMQ_CHANNEL, \"SYSTEM.DEF.SVRCONN\");\n cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\n cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, \"QM1\");\n cf.setStringProperty(WMQConstants.WMQ_APPLICATIONNAME, \"SimplePTP (JMS)\");\n\n // Create JMS objects\n connection = cf.createConnection();\n session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);\n destination = session.createQueue(\"queue:///Q1\");\n producer = session.createProducer(destination);\n consumer = session.createConsumer(destination);\n\n long uniqueNumber = System.currentTimeMillis() % 1000;\n TextMessage message = session.createTextMessage(\"SimplePTP: Your lucky number today is \"\n + uniqueNumber);\n\n // Start the connection\n connection.start();\n\n // And, send the message\n producer.send(message);\n System.out.println(\"Sent message:\\n\" + message);\n\n Message receivedMessage = consumer.receive(15000); // in ms or 15 seconds\n System.out.println(\"\\nReceived message:\\n\" + receivedMessage);\n\n recordSuccess();\n }\n catch (JMSException jmsex) {\n recordFailure(jmsex);\n }\n finally {\n if (producer != null) {\n try {\n producer.close();\n }\n catch (JMSException jmsex) {\n System.out.println(\"Producer could not be closed.\");\n recordFailure(jmsex);\n }\n }\n if (consumer != null) {\n try {\n consumer.close();\n }\n catch (JMSException jmsex) {\n System.out.println(\"Consumer could not be closed.\");\n recordFailure(jmsex);\n }\n }\n\n if (session != null) {\n try {\n session.close();\n }\n catch (JMSException jmsex) {\n System.out.println(\"Session could not be closed.\");\n recordFailure(jmsex);\n }\n }\n\n if (connection != null) {\n try {\n connection.close();\n }\n catch (JMSException jmsex) {\n System.out.println(\"Connection could not be closed.\");\n recordFailure(jmsex);\n }\n }\n }\n System.exit(status);\n return;\n } // end main()\n\n /**\n * Process a JMSException and any associated inner exceptions.\n * \n * @param jmsex\n */\n private static void processJMSException(JMSException jmsex) {\n System.out.println(jmsex);\n Throwable innerException = jmsex.getLinkedException();\n if (innerException != null) {\n System.out.println(\"Inner exception(s):\");\n }\n while (innerException != null) {\n System.out.println(innerException);\n innerException = innerException.getCause();\n }\n return;\n }\n\n /**\n * Record this run as successful.\n */\n private static void recordSuccess() {\n System.out.println(\"SUCCESS\");\n status = 0;\n return;\n }\n\n /**\n * Record this run as failure.\n * \n * @param ex\n */\n private static void recordFailure(Exception ex) {\n if (ex != null) {\n if (ex instanceof JMSException) {\n processJMSException((JMSException) ex);\n }\n else {\n System.out.println(ex);\n }\n }\n System.out.println(\"FAILURE\");\n status = -1;\n return;\n }\n\n}I have always this error(exception)\ncom.ibm.msg.client.jms.DetailedJMSSecurityException: JMSWMQ2013: Authentication security provided to the queue manager 'QM1' with the connection mode 'Client' and the hostname 'localhost (1414) 'was invalid.\nCheck if the user name and password provided are correct in the waiting queue manager to which you connect.\nThe WebSphere MQ call failed with the completion code '2' ('MQCC_FAILED'); pattern '2035' ('MQRC_NOT_AUTHORIZED').### Assistant: You need user id and password (depending on version of MQ) to connect to queue manager. This user id would typically exist on the machine where the queue manager is running.You will need to pass the user id and password as below in your code. Replace with your user and password.cf.setStringProperty(WMQConstants.USERID,\"userid\"); \ncf.setStringProperty(WMQConstants.PASSWORD, \"password\");Apart from this the user must be given authority to connect to queue manager, put/get on the queue your application is using.I suggest you speak to your MQ administrator to provide the user id/password information as well as required authorities.\n"} +{"text": "### Human: I want toconnect a single queue to multiple queue managers(atleast 2 qmgrs). Lets say I haveqmgrA and qmgrBas queue managers and it is connected toqueueName. I will put a message\"Hello\"to queueName connected to qmgrA as well as another message\"World\"on qmgrB. So suppose to be the queueName contains\"Hello\"and\"World\".The question is how can I get those messages simultaneously? Can you give me an example code fragment/snippet for me to atleast have an overview of how can I start coding with that design.Note:*I am asking for this because for example theqmgrAgot disconnected/down for unknown reason, atleastqmgrBis still active\n and will get messages onqueueNameeven thoughqmgrAis disconnected.By the way, I'm using Websphere MQ v7 C++.Thanks in advance! :)### Assistant: The question appears to be asking how to do something that IBM MQ does not do. QMgrs do not \"connect\" to queues, they host them. Applications do not \"connect\" to queues except in the abstract JMS sense. They connect to QMgrs and then open queues. However, the requirement that is described of keeping MQ highly available can be met with MQ Clusters, hardware clusters, Multi-Instance QMgrs, shared queues (on z/OS only), or some combination of these.The two queue managers in your example each host a local copy ofqueueName. Here are several scenarios as to how messages are distributed in this situation.PUTting messagesA message put toqueueNameby an application connected toqmgrAwill by default result in the message landing in the local instance of that queue.When there is a local instance and an MQ cluster with at least one other instance, the QMgr can be configured to allow messages to go to non-local instances.WhenqmgrA,qmgrB, andqmgrCare in a cluster, andqmgrCdoes not host a local instance of the queue, messages put to that queue name will round-robin between the instances onqmgrAandqmgrB.GETting messagesA message landing inqueueNameonqmgrAcan only be retrieved from that queue by an application connected toqmgrA.A message landing inqueueNameonqmgrBcan only be retrieved from that queue by an application connected toqmgrB.An application connected toqmgrCcannot retrieved messages from the queues hosted onqmgrAorqmgrB.MQ HAThe requirement to make a queue highly available can be achieved in several ways. Some of these provide recoverability of the service provided by MQ. Some of them provide recoverability of messages that would be stranded in-flight. In addition to readingtopology design sectionin the manuals, please see theMQ HA presentationfrom IBM Interconnect 2015.\n"} +{"text": "### Human: My purpose is to list down the correlation ids of the messages in a set of MQ Queues in my Java application.This is the code snippetpublic void populateCorrelationIds() throws MQException{\n int openOptions = MQConstants.MQOO_INPUT_AS_Q_DEF | MQConstants.MQOO_OUTPUT | MQConstants.MQOO_INQUIRE | MQConstants.MQOO_BROWSE;\n String qNames[0] = BAY10.CISCHGX.DFDA;\n String qNames[1] = BAYSF11.MSFCHGX.DFDA;\n MQMessage messageGet = new MQMessage();\n for(String q : qNames){\n MQQueue dfdaQ = qMgr.accessQueue(q, openOptions);\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.options = MQConstants.MQGMO_BROWSE_FIRST| MQConstants.MQGMO_WAIT;\n gmo.waitInterval = 4000;\n int j = dfdaQ.getCurrentDepth();\n for(int i=0;iFrom your screen shots I can see that your certificate label isibmwebspheremqclientbut from the screen shot of the command prompt it appears your logged on user ID might actually beherath, in which case the MQ code will be looking for a certificate labelibmwebspheremqherath, not finding it and so going anonymous.Rename the label of your client side certificate to the appropriate label and see if it now picks it up.\n"} +{"text": "### Human: In TIBCO EMS, which I am familiar with, there is a feature called \"destination bridges\".Queues and Topic can be bridged (linked) so that the 2nd destination can become client of the the first. (Queue to queue, Topic to queue, Queue to topic, topic to topic)\nFor instance, a topic can be bridged to a queue, which in essence will become a durable subscriber of the messages submitted to the topic. Clients can subscribe to the topic OR read from the queue. This example is a way to load balance the reading of a pub/sub for multiple clients (readers of the queue).\nThis \"bridge\" feature can also involve message selectors and destination name wilcards.So, a QUEUE X can be the client of TOPIC.* with condition CUST_ID(a JMS attribute)>30.\nIn that case, all message submitted to TOPIC.A OR TOPIC.B fitting the criteria would end up in QUEUE X. All this does not involve anything but simple EMS configuration.I don't know enough about Websphere MQ, and I need a similar behavior. Will I have to develop a processing program outside of MQ, or can the feature within the product sufice ?Note: I have already gone through MQ documentation and found about the \"Alias queues\" feature. Since the feature should really be called \"Shortcut queue\" and does not involve 2 destinations... I don't think it could help me...Thanks!Edit : For reference, the command (DEF SUB) enabling this in MQ is documentedhereEdit 2 : The selected answer cover the \"Topic -> Queue\" pattern from TIBCO EMS \"Destination bridge\" featuire. Please note that the \"Q->Q\", T->T and Q->T\" patterns are not covered here.### Assistant: Easy! Define your queue to receive the subscription and then define a durable administrative subscription.DEF QL(MY.SUSCRIBER.QUEUE)\nDEF SUB('MY.SUBSCRIPTION') +\n TOPICSTR('SOME/TOPIC/#') +\n DEST('MY.SUSCRIBER.QUEUE') +\n SELECTOR('JMSType = 'car' AND color = 'blue' AND weight > 2500') +\n REPLACEThe Infocenter has a section onSelector Syntaxand a page for theDEFINE SUBcommand.\n"} +{"text": "### Human: I'm new to MQ programming with java.\nFor my Integration tests, I would like to clean up the destination queue before posting any messages to it. Is there any option in MQ-Java to delete all messages in a queue in one go?### Assistant: You can use a WMQ PCF program to clear messages in queue in one go. PCF classes provide an interface to administer WMQ programatically. There is a sample, PCF_ClearQueue.java that demonstrates clearing messages from a queue.The sample is located (on Windows platforms) \\tools\\pcf\\samples directory. More information on clear queue can be foundhere.\n"} +{"text": "### Human: I am running IBM Websphere MQ on a Windows Server 2008 machine. \nNow I would like to know how you can view the content of messages in a specific queue, for example:There are 2 messages in the SYSTEM.DEAD.LETTER.QUEUE. How do I view those messages so that I can see what is wrong with them?I read up on IBM's website that you can do it like this:C:\\Program Files (x86)\\IBM\\WebSphere MQ\\tools\\c\\Samples\\Bin>amqsbcg SYSTEM.DEAD.LETTER.QUEUE\nTLINKTT.QMANBut when I run this, I get the following error:AMQSBCG0 - starts here\n**********************\n\n MQOPEN - 'SYSTEM.DEAD.LETTER.QUEUE'\n\n MQGET 1, failed with CompCode:2 Reason:2016\n MQCLOSE\n MQDISCIs this because the queue is in use? How else do I view messages in a Queue when a queue is in use?Thanks### Assistant: A good tip for most MQ return codes is to run them through mqrc, e.g. run \"mqrc 2016\"2016 0x000007e0 MQRC_GET_INHIBITEDSo 2016 means the queue has been configured to prevent messages being got off the queue (gets are inhibited). A browse (amqsbcg for example) is just an open for MQOO_BROWSE, and then get with browse (eg. MQGMO_BROWSE_NEXT). So the issue here isnt that the queue is in use, more that the systems admin has prevented people from getting messages which end up at that queue.To run e.g. amqsbcg against it you will need to enable gets first... runmqsc ALTER queue, get ENABLED to enable gets, or use the explorer GUI to do the same. It might make sense to put it back to disabled once done, so you leave it as you found it.\n"} +{"text": "### Human: i've a question about the DEADQ in MQ. I know that DEADQ has been used when the msg cannot be delived into the target queue, for example queue full or put inhibited like this. But if the client applicatoin connects to QMGR throughSVRCONNchannel and that target queue is full right now, will the msg sent by client application go to DEADQ or just that put operation would return with failure saying queue full?if it works as the latter, does it mean the DEADQ not being used for client-server mode, like through SVRCONN channel?Thanks### Assistant: The DLQ is used by QMgr-to-QMgr channels because at that point the message has been entrusted to WMQ to deliver and/or persist as necessary. There is no option to directly notify the sending application in the API call that something went wrong. Best the QMgr can do is to send back a report message, if the app has requested it, and if the app specified a reply-to queue.When an application is connected over a client channel the QMgr can tell the application during the PUT API call \"hey, the destination queue is full,\" and let the application decide the appropriate course of action. Usually that \"correct action\" does NOT include putting the message onto the DLQ. In fact, routing this type of message to a secondary queue is VERY unusual. Conventional wisdom says it's better for the app to raise an alert than to provision overflow queues.The one exception to this is when using JMS classes. These will move a poison message (one where the backout count exceeds the BOTHRESH value on the queue) to a backout queue. If the backout queue is not specified or the app is not authorized to it or if it is full, the app will then try to use the DLQ. Again, allowing an app to directly put messages to the DLQ is very unusual and not considered good practice, but it can be done.\n"} +{"text": "### Human: I am using IBM Websphere and MQ in my application and now I wanted to know how I can configure (or) make Websphere understand that there is a dead letter queue say DEAD.QUEUE created in MQ and it should use this queue in case of any failure while processing the messages from Request/ Response queue.I am trying to do this because there is a failed message in the queue which is trying to republish it to the queue again and again. If there is a dead letter queue configured then I guess this might get stopped. Correct me if I am wrong.### Assistant: You can set it either by using MQExplorer or MQSC command shell.In MQExplorer right click (on the queue manager for which you want to set dead letter queue) and select Properties menu. Queue manager properties panel pops up. Click on \"Extended\" node on the left pane. On the right pane you can specify a queue name in \"Dead Letter queue\" edit box.You can also set a DLQ using MQSC shell. Just run the following command which sets SYSTEM.DEAD.LETTER.QUEUE as the DLQ.alter qmgr deadq(SYSTEM.DEAD.LETTER.QUEUE)What MQ client are you using? JMS client or XMS .NET client? These clients have the capability to move messages to a backout or dead letter queue if a message is delivered repeatedly. The process of moving a message to a backout queue or DLQ depends on the BOTHRESH setting on a queue. To enable backout processing, set a value higher than 0.\n"} +{"text": "### Human: Hello I have queue manager with name QM_1. Here I have taken backup of QM_1 like following.\nafter that I created queue manager(QM_1) with same name in other system and I need to restore the save qmgr properties. Pls provide how to restore the queuemanager properties?saveqmgr -m QM_1 -f### Assistant: Some of the options are are on theSupportPac MS03landing page. (MS03 is the SupportPac that contains thesaveqmgrprogram.) Detailed instructions are in the download documentation. The following instructions are copied from the SupportPac MS03 page:You can run the followingsaveqmgrcommand (see below) to create 2 output files. Both output files are text and they can be edited.one with the object definitions (using option -f) - the file name in this example is: qmgr_data.mqscthe other with the authority records (using option -z which generates entries for setmqaut)the file name in this example is: qmgr_auth.bat (in Windows) or qmgr_auth.sh (in UNIX)The following command saves both the objects and the authority records:UNIX:saveqmgr -m QMGR -f /tmp/mq/qmgr_data.mqsc -z /tmp/mq/qmgr_auth.shWindows:saveqmgr.exe -m QMGR -f C:\\temp\\mq\\qmgr_data.mqsc -z C:\\temp\\mq\\qmgr_auth.batThe fileqmgr_data.mqsccan be run as follows when trying to restore the contents into a new queue manager:runmqsc TEST < qmgr_data.mqscThe file qmgr_auth.bat (in Windows) or qmgr_auth.sh (in UNIX) has stand-alone entries that invoke the setmqaut command with the proper parameter for each authority record. This batch/script file will need to be executed in order to restore the authority records.UNIX:chmod u+x qmgr_auth.sh\n./qmgr_auth.shWindows:qmgr_auth.batTo find this and all the other SupportPacs, go to the SupportPac landing pagehere.Update 6 November 2014:Although OP askedhow to restorefrom asaveqmgrbackup, it is worth noting that IBM has provided thedmpmqcfgcommand beginning with version 7.1. You can back up the QMgr inMQSCformat using this syntax:dmpmqcfg -m [QUEUE_MANAGER] > BACKUP_FILE.mqscThis captures the object deinifionsandthe authorizations in a single file. The authorizations are captured asSET AUTHRECentries rather than assetmqautcommands by default.Please note that the initial versions ofdmpmqcfgdid not capture all of the authorization settings that you might have defined. It is necessary for all versions to apply the latest Fix Pack to get a reliable backup usingdmpmqcfg. This behavior may regress in later Fix Packs so it is advisable to reconcile your backup against your auths creation script when switching to this command and after applying a Fix Pack.Restore a QMGgr from thedmpmqcfgfile the same as you would from thesaveqmgrfile:runmqsc [QMNAME] < output_of_dmpmqcfg_or_saveqmgr.mqsc > logfile.txt 2>&1This runs theMQSCfile definitions into the QMgr (includingSET AUTHRECcommands) and saves the output ofSTDOUTandSTDERRto a log file.\n"} +{"text": "### Human: Is it possible to lookup remote JNDI in IBM MQ. My scenario is I have an MQ installation on machine A, with JNDI resources(JMS Administered objects in MQ Explorer).Now if I want to connect to MQ via JMS from standalone JAVA class, I can lookup from \"file://JNDI_FACTORY\". All examples only mention this. But is it possible if I want that standalone JAVA class on machine B. That is machine B has JAVA Class which has to connect to remote JNDI(on machine A) and look up for Connection Factory. Can I use some thing like \"hostname of A:port\" for property ContextProviderUrl in java class in machine B, to access remote objects from machine A?Also suggest me on remote JNDI lookup.Please help!THANKS CHAKRI### Assistant: For simplicity all MQ JMS samples use a File JNDI to demonstrate usage of initial context. You can modify the samples to look up a LDAP server for connection factory and destination information.First in MQExplorer you need to chooseLDAP Serveroption to save the connection factory and destination information to a LDAP server. Then in your application you need to have code that looks like this:String initialContextUrl = \"ldap://myhost:991/c=uk,o=ACME\"\n String contextFactory = \"com.sun.jndi.ldap.LdapCtxFactory\";\n Hashtable environment = new Hashtable();\n environment.put(Context.INITIAL_CONTEXT_FACTORY, contextFactory);\n environment.put(Context.PROVIDER_URL, initialContextUrl);\n Context context = new InitialDirContext(environment);Please see the Infocenter topicUsing JNDI to retrieve administered objects in a JMS applicationfor details and additional code samples.\n"} +{"text": "### Human: I have an SSIS Script task (written in C#) that is trying to write to a WebSphere MQ Queue. Obviously we have to reference a specific dll to help make this connection, however I am getting an error involving a separate dll. When the program attempts to open a connection to the queue, the following error appears:{\"Unable to find an entry point named 'zstMQGET' in DLL\n'C:\\\\Program Files (x86)\\\\IBM\\\\WebSphere MQ\\\\bin\\\\mqic.dll'.\":\"\"}\nSystem.Exception {System.EntryPointNotFoundException}I found the dll in the folder and tried to add it as a reference, however VS2010 will not allow this. I get an error saying \"Please make sure that the file is accessible, and that it is a valid assembly or COM component.\"I should also add that I've downloaded Dependency Walker to inspect the mqic.dll and ran into the following error messages:\"Warning: At least one delay-load dependency module was not found.\" \n\"Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.\"EDIT\nThe part of the code that is causing an error is an MQQueue object's get() call. Both of these queue types are local, and the Dts.Variables are set accordingly### Assistant: I am sorry (comment not possible) but what exactly have you changed to get it to run? I have the exact same problem when migrating from 5.3 to 7.1 and cannot find a solutionTo make this post more an answer: I was able to suppress this error by using the 3-parameter-call of the GET Function (the one with message size) then the EntryPoint-Error does not occur, but I do not know the exact for itMore Clear: The exact same function call does work later (without any modification) in my program without changing anything, so this is not a permanent linking error\n"} +{"text": "### Human: I'm able to send messages fromJavatoWebsphere MQonAS400. If I send messages fromWinXP, there is no difference if I use any accessibleLocale, including full Language Localization; nor is there a problem with EnglishLocale. Important for correct encoding is only this code line:msgId.characterSet = 1208;Infortunately, it's not valid. There are differences in the case that I want to take the message fromMQ Queue.In the case that I get message fromMQ Queuefrom Windows OS (English without any of Language Pack), I'm able to take message fromMQ QueueinStringform.In the case that Windows OS is Full Localized with some of Language Pack, I am receiving an exceptionException occured while to message buffer :\n java.io.UnsupportedEncodingException: Cp870from code (removed balast from try - catch - finally block)try {\n Class.forName(\"com.ibm.mq.MQEnvironment\");\n MQEnvironment.hostname = hostname;\n MQEnvironment.port = port1;\n MQEnvironment.channel = channel;\n MQEnvironment.userID = userID;\n MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES);\n try {\n qmgr1 = new MQQueueManager(qmanager);\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n int openOptions2 = MQC.MQOO_INPUT_SHARED;\n gmo.options = MQC.MQGMO_NO_SYNCPOINT; //Set no sync point\n gmo.options = MQC.MQGMO_CONVERT; //Handles ASCII/EBCDIC\n gmo.options = MQC.MQGMO_WAIT; //Wait until message arrives\n gmo.waitInterval = 3000;\n getq = qmgr1.accessQueue(responseQueue, openOptions2);\n while (true) {\n try {\n responseFromQUEUE = \"\";\n MQMessage msgId = new MQMessage();\n //putmsg.characterSet = 437;// Set code page to ASCII\n //putmsg.characterSet = 1200;// Set code page to UNICODE\n msgId.characterSet = 1208;\n getq.get(msgId, gmo);\n String str = msgId.readLine();\n //responseFromQUEUE = CpConv.tf870to1250(msgId.readLine());\n //own EncodePage doesn't works too\n if (responseFromQUEUE.length() == 0) {\n break;\n }\n } catch (MQException mqx) {\n if (mqx.reasonCode == EMPTY_QUEUE) {\n } else {\n }\n }\n }\n } catch (MQException mqx) {\n } finally {\n }\n} catch (IOException ex) {\n} catch (ClassNotFoundException e) {\n}pleaseis there some parameter(s), something that I miss there for takeStringfromMQMessage#readLine()my question here is only aboutStringconversion,I haven't any issue withEncodefromMQMessage#getBytes### Assistant: CP870 is EBCDIC host code page. To what locale are you changing the Windows to when the exception occurs? Do you still usemsgId.characterSet = 1208;after the local is changed? It looks like Java libraries are unable to convert the incoming message that is in CP870 to your current locale.Check what is the Windows code page when you change the locale and see if 1208 is correct formsgId.characterSet.\n"} +{"text": "### Human: I am wondering how we can ensure message durability when using websphere MQ and WCF. I want to be able to have my WCF process pick messages off of the queue and if there is an issue that the applciation encounters (power outage, etc) I don't lose the messages. I also would like to not have to use a transaction if at all possible because I want to eliminate distributed transactions.Thanks,S### Assistant: Well, there's transactions and there's distributed transactions. The \"right\" answer is to use the WMQ 1-phase commit here. That doesn't have the complexity of XA transactions but it does give you the ability to roll back a message without losing it. In fact, when using clients you really should be using at least 1-phase commit just to prevent loss of messages.Short of that there is always the \"browse-with-lock, delete-message-under-cursor\" method. I'm pretty sure everything you need to do the browseing, locking and deleting is exposed under .NET but perhaps Shashi will comment and confirm.\n"} +{"text": "### Human: I am implementing a component that reads all the messages off a specific queue as they are available but should only remove messages from the queue asynchronously, after the message contents has been processed and persisted. We read messages off faster than we acknowledge them (e.g. we could read have read 10 messages off before we are ready to Ack the first). The current implementation uses the XMS API, but we can switch to MQI if XMS is inappropriate for these purposes.We have tried two approaches to try solve this problem, but both have drawbacks that make them unacceptable. I was hoping that someone could suggest a better way.The first implementation uses anIMessageConsumerin a dedicated thread to read all messages and publish their content as they are available. When the message has been processed, themessage.Acknowledge()method is called. The Session is created withAcknowledgeMode.ClientAcknowledge. The problem with this approach is that, as per the documentation, this acknowledges (and deletes) ALL unacknowledged messages that have been received. With the example above, that would mean that all 10 read messages would be acked with the first call. So this does not really solve the problem. Because of the reading throughput we need, we cannot really modify this solution to wait for the first message's ack before reading the second, etc.The second implementation uses anIQueueBrowserin a decided thread to read all messages and publish their content. This does not delete the messages off the queue as it reads. A separate dedicated thread then waits (on a BlockingQueue) for JMS Message IDs of messages that have been processed. For each of these, it then constructs a dedicatedIMessageConsumer(using a message selector with JMSMessageID) to read off the message and ack it. (This pairing of anIQueueBrowserwith dedicatedIMessageConsumeris recommend by the XMS documentation's section onQueue browsers.) This method does work as expected but, as one would imagine, it is too CPU-intensive on the MQ Server.### Assistant: Both of the methods proposed in the question appear to rely on a single instance of the app. What's wrong with using multiple app instances, transacted sessions and COMMIT? The performance reports (these are theSupportPacswith names like MP**) all show that throughput is maximized with multiple app instances, and horizontal scaling is one of the most used approaches in your scenario.The design for this would be either multiple application instances or multiple threads within the same application. The key to making it work correctly is to keep in mind that transactions are scoped to a connection handle. The implication is that a multi-threaded app must dispatch a separate thread for each connection instance and the messages are read in the same thread.The process flow is that, using a transacted session, the app performs a normalMQGetagainst the queue, processes the message contents as required and then issues anMQCommit. (I'll use the MQ native API names in my examples because this isn't language dependent.) If this is an XA transaction the app would callMQBeginto start the transaction but for single-phase commit the transaction is assumed. In both cases,MQCommitends the transaction which removes the messages from the queue. While messages are under syncpoint, no other app instance can retrieve them; MQ just delivers the next available message. If a transaction is rolled back, the nextMQGetfrom any thread retrieves it, assuming FIFO delivery.There are some samples in:[WMQ install home]\\tools\\dotnet\\samples\\cs\\xms\\simple\\wmq\\...andSimpleXAConsumer.csis one example that shows the XA version of this. The non-XA version is simpler since you don't need the external coordinator, theMQBeginverbs and so forth. If you start with one of these, make sure that they do not specify exclusive use of the queue and you can fire up several instances using the same configuration. Alternatively, take the portion of the sample that includes creation of the connection, message handling, connection close and destroy, and wrap all that in a thread spawner class.[Insert usual advice about using the latest version of the classes here.]\n"} +{"text": "### Human: I have some strange problem. I think I followed documentation correctly but my code doesn't work. I have this very simple hard coded test (NUnit):[TestFixture]\npublic class MQQueueTests {\n\n public const string MessageContent = \"This is test message\";\n\n public static void Main(string[] args) {\n var tests = new MQQueueTests();\n tests.PutAndGetMessage();\n }\n\n [Test]\n public void PutAndGetMessage() {\n var properties = new Hashtable\n {\n {MQC.HOST_NAME_PROPERTY, \"TestServer\"},\n {MQC.CHANNEL_PROPERTY, \"Test.Channel\"},\n {MQC.PORT_PROPERTY, 1415},\n // Is this correct? It looks like it is not \n // enough because adding this line didn't solve \n // the problem.\n {MQC.CCSID_PROPERTY, 437} \n };\n\n using (var manager = new MQQueueManager(\"Test.Queue.Manager\", properties)) {\n using (MQQueue queue = manager.AccessQueue(\"Test.Queue\", \n MQC.MQOO_OUTPUT | MQC.MQOO_INPUT_AS_Q_DEF)) {\n\n MQMessage message = new MQMessage();\n message.WriteUTF(MessageContent);\n queue.Put(message);\n\n MQMessage readMessage = new MQMessage();\n queue.Get(readMessage);\n\n Assert.AreEqual(MessageContent, readMessage.ReadUTF());\n\n queue.Close();\n }\n manager.Disconnect();\n }\n }\n}I'm running the test application either from console or through Resharper 6 test runner. If I run the application in test runner I always get following exception:IBM.WMQ.MQException : MQRC_CHANNEL_CONFIG_ERROR (reason code is 2539)The exception is thrown byMQQueueManager.Connect(called by its constructor).If I check MQ logs I see:AMQ9541: CCSID supplied for data conversion not supported.EXPLANATION: The program ended because, either the source CCSID '437'\n or the target CCSID '852' is not valid, or is not currently supported.ACTION: Correct the CCSID that is not valid, or ensure that the\n requested CCSID can be supported.If I run the application from the console I got the same error but if I change the code page for console by callingchcp 437My test application works. How can I configure code page from code?### Assistant: Well I found a workaround - it can probably solve my problem but I'm not very satisfied with it. I can set upMQCCSIDenvironment variable either globally or by calling:Environment.SetEnvironmentVariable(\"MQCCSID\", \"437\");That will configure code page. Still I would like to use properties of a newMQQueueManagerinstance to setup code page.\n"} +{"text": "### Human: I'm working on the existing application that uses transport layer with point-to-point MQ communication.For each of the given list of accounts we need to retrieve some information.Currently we have something like this to communicate with MQ:responseObject getInfo(requestObject){\n code to send message to MQ\n code to retrieve message from MQ\n}As you can see we wait until it finishes completely before proceeding to the next account.\nDue to performance issues we need to rework it.There are 2 possible scenarios that I can think off at the moment.1) Within an application to create a bunch of threads that would execute transport adapter for each account. Then get data from each task. I prefer this method, but some of the team members argue that transport layer is a better place for such change and we should place extra load on MQ instead of our application.2) Rework transport layer to use publish/subscribe model.\nIdeally I want something like this:void send (requestObject){\n code to send message to MQ\n}\n\nresponseObject receive()\n{\n code to retrieve message from MQ\n}Then I will just send requests in the loop, and later retrieve data in the loop. The idea is that while first request is being processed by the back end system we don't have to wait for the response, but instead send next request.My question, is it going to be a lot faster than current sequential retrieval?### Assistant: The question title frames this as a choice between P2P and pub/sub but the question body frames it as a choice between threaded and pipelined processing. These are two completely different things.Either code snippet provided could just as easily use P2P or pub/sub to put and get messages. The decision should not be based on speed but rather whether the interface in question requires a single message to be delivered to multiple receivers. If the answer is no then you probably want to stick with point-to-point, regardless of your application's threading model.And, incidentally, the answer to the question posed in the title is \"no.\" When you use the point-to-point model your messages resolve immediately to a destination or transmit queue and WebSphere MQ routes them from there. With pub/sub your message is handed off to an internal broker process that resolves zero to many possible destinations. Only after this step does the published message get put on a queue where, for the remainder of it's journey, it then is handled like any other point-to-point message. Although pub/sub is not normally noticeably slower than point-to-point the code path is longer and therefore, all other things being equal, it will add a bit more latency.The other part of the question is about parallelism. You proposed either spinning up many threads or breaking the app up so that requests and replies are handled separately. A third option is to have multiple application instances running. You can combine any or all of these in your design. For example, you can spin up multiple request threads and multiple reply threads and then have application instances processing against multiple queue managers.The key to this question is whether the messages have affinity to each other, to order dependencies or to the application instance or thread which created them. For example, if I am responding to an HTTP request with a request/reply then the thread attached to the HTTP session probably needs to be the one to receive the reply. But if the reply is truly asynchronous and all I need to do is update a database with the response data then having separate request and reply threads is helpful.In either case, the ability to dynamically spin up or down the number of instances is helpful in managing peak workloads. If this is accomplished with threading alone then your performance scalability is bound to the upper limit of a single server. If this is accomplished by spinning up new application instances on the same or different server/QMgr then you get both scalability and workload balancing.Please see the following article for more thoughts on these subjects:Mission:Messaging: Migration, failover, and scaling in a WebSphere MQ clusterAlso, go to theWebSphere MQ SupportPacspage and look for the Performance SupportPac for your platform and WMQ version. These are the ones with names beginning with MP**. These will show you the performance characteristics as the number of connected application instances varies.\n"} +{"text": "### Human: I have this strange issue with a JMS binding on a MQ queue with a MDBThe Message-Driven EJB:CrbEventMessageAsynchronousServiceis unable to connect to the JMS destination:queue.contratto.crb.input.publicQueue. The Error was:javax.jms.JMSException:MQJMS1017: non-local MQ queue not valid for receiving or browsing>I checked on theQueueManagerand the mq queue is defined as local and not as remote as said by the exception.### Assistant: It may be that the top-most queue that the application is opening for reading is defined locally. However, the queue that WMQ is resolving to is not. For example, if you define a local alias over a remote clustered queue, the resolved queue is non-local. Another possible cause is that a queue you intend to open for output is actually being opened for input as well. This is actually quite common.Finally, it is also somewhat common that the WMQ client is connected to a different queue manager than expected. For example, the connection is to QMGRA and the queue object specifies a fully-qualified name like QUEUE@QMGRB. Even though the queue lives on QMGRB and the JNDI object specifies that queue manager by name, the connection on QMGRA resolves it to a transmit queue and therefore sees it as non-local.One of the best ways to nail this kind of error down in Dev is to useSupportPac MA0W. This SupportPac runs as an API exit or as a channel exit and lists in human-readable language all of the API calls and all of the options selected for the call. This will unequivocally show exactly what object name was opened, what it resolved to and the options used.Alternatively, you can turn on trace usingstrmqtrc. Don't forget to disable it withendmqtrcwhen you are done! These traces are enabled and disabled on the QMgr server and trace WMQ API calls. There are equivalent traces to run on the client side but these may not show the level of detail that you require.Finally, it would be advisable to print any exceptions linked to the JMS exceptions. The JMS Exception is a multi-level data structure where the linked exception holds provider-specific values. For example, a JMS Security exception might be a WMQ authorization error. But then again, it might be an error in the keystore or filesystem. If the linked exception does not show a WMQ 2035 reason code, it's not a WMQ security error. The Infocenter describes how to print the linked exception data in the section namedExceptions in WebSphere MQ classes for JMS.Note that I've provided links to the v7.0 WMQ docs. If you are coding in v6 these may not be completely accurate and you would want to look in thev6.0 Infocenterinstead. Since v6.0 of WMQ is end-of-life as of September 2011 it is highly recommended to do all new development on v7.0. If you need the v7.0 client it is downloadable asSupportPac MQC7and is backward compatible with v6.0 WMQ servers.\n"} +{"text": "### Human: Is there a (Linux) command to move all messages from one queue in Websphere MQ 6 to another queue?I have a queue that has a defined backout queue, but I want to know how to transfer all the messages back to the original queue once the error preventing the messages from being processed has been corrected.Is there a GUI tool that can do this? IBM Websphere MQ Explorer 6 does not seem to have an option for this...### Assistant: For a GUI trySupportPac MO71.For a command-line tool, trySupportPac MA01.Both of these can move messages between queues, from queue to file, file to queue and so forth. The main SupportPac landing pageis here.\n"} +{"text": "### Human: I tried connecting jms client with 5.3 / 6.0 MQseries client jars to 7.0+ server, but it threw follwoing exceptioncom.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2423\nat com.ibm.mq.MQQueueManager.sequentialConstruct(MQQueueManager.java:904)\nat com.ibm.mq.MQQueueManager.(MQQueueManager.java:865)\nat com.ibm.mq.MQSPIQueueManager.(MQSPIQueueManager.java:83)\nat com.ibm.mq.jms.MQConnection.createQM(MQConnection.java:2009)\nat com.ibm.mq.jms.MQConnection.createQMNonXA(MQConnection.java:1496)\nat com.ibm.mq.jms.MQQueueAgentThread.setup(MQQueueAgentThread.java:306)\nat com.ibm.mq.jms.MQQueueAgentThread.run(MQQueueAgentThread.java:1672)\nat java.lang.Thread.run(Thread.java:570)I do understand fromhttp://www.ibm.com/developerworks/websphere/library/techarticles/0704_xu/0704_xu.htmlthat it's not possible to use previous version client libs. But my question is are these latest client libs backward compatible with 5.3 / 6.0 servers ?### Assistant: V6.0 Yes. V5.3, not so much. The problem here is the 5.3 libs and servers. They were never tested nor intended to be compatible with v7 components because v5.3 was end-of-life well before v7 was released.The v6 clients are compatible with the v7 server and vice-versa and you would be able to open a PMR if you found issues. The manual for v7 clients states that they are compatible withsupportedlevels of WMQ server, which includes only v6 and v7 (seethis linkfor details).Word to the wise, do your development on v7 because v6 is end-of-life as of September 2011. This will save you from having to upgrade again in a year. The v5.3 QMgrs should be updated to v7 as soon as time allows. Among other issues are that there are security vulns that were discovered after v5.3 went EOL so no patches were ever produced to address them at v5.3. If security is an issue for your app, you need to be at 6.0.2.9 or 7.0.1.1.You can download the fix packs and clients here if you need them:Recommended Fixes for WebSphere MQSupportPac MQC7: WebSphere MQ V7 ClientsWMQ v7.1 trial downloadUPDATE March 13, 2011- IBM recentlypublished a Technoteclarifying their support statement. According to the Technote:WebSphere MQ V7.0 queue managers and\n clients interoperate with queue\n managers and clients from any previous\n level of the WebSphere MQ or MQSeries\n products.\n"} +{"text": "### Human: How do i specify which queue manager to connect to in my system properties.\nHere is the code:Properties properties = new Properties(); \nproperties.setProperty(\"java.naming.factory.initial\", \"com.ibm.mq.jms.context.WMQInitialContextFactory\");\nproperties.setProperty(\"java.naming.provider.url\", \"localhost:1414/SYSTEM.DEF.SVRCONN\"); \n\nContext context = new InitialContext(properties); \nfactory= (QueueConnectionFactory)context.lookup(\"TESTOUT\");context always gets TEST que only not able to connect to TESTOUT queue### Assistant: Here's an example from the IBM website about how to setup Websphere Application Server (WAS) to use MQ as the mechanism for JMS.http://www.ibm.com/developerworks/websphere/techjournal/0505_woolf/0505_woolf.htmlAlso IBM has a good redbook that outlines examples for how to do this if you are the message producer at:http://www.redbooks.ibm.com/redbooks/pdfs/sg247128.pdfThere is also some good Java code examples at:http://www.capitalware.biz/mq_code_java.htmlSorry....I don't have access to the code I did for this anymore or I'd give you some of my examples.\n"} +{"text": "### Human: I'm porting a C++ 32 bit application to 64 bit on windows. The application is a client of IBM WebSphere MQ. It uses the MQ client API.Now, as the port progresses, I'm trying to find a 64 bit client. So far, no luck.Does anyone here happen to know if where I can find one or confirm that there isn't one?### Assistant: Websphere MQ 7 for Windows supports x86 and x64, but not Itanium 64-bit. It onlyofficiallysupports Visual C++ 2005 for development at the moment but IBM usually issues PTFs for toleration on a regular basis so it shouldn't be too long before C++ 2008 support is there.The statements of support and requirements are hosted on IBM web pages athttp://www-01.ibm.com/support/docview.wss?rs=171&uid=swg27011920if you're interested in further details.\n"} +{"text": "### Human: A requester is sending messages over a normal queue to a responder, indicating a dynamic queue it created as a reply queue. The responder puts these same messages on the reply queue. The responder retrieves all messages correctly.For each message sent the requester obtains a message from the reply queue, but its body is filled with zeroes. Both programs are written in Java, using com.ibm.mq.allclient-9.2.2.0.jar. When I wrote the same in JavaScript with Node.js and ibmmq for node, everything worked fine.Requester.java:package com.hellerim.imq.comm.requester;\n\nimport static com.ibm.mq.constants.CMQC.MQENC_INTEGER_NORMAL;\nimport static com.ibm.mq.constants.CMQC.MQFMT_STRING;\nimport static com.ibm.mq.constants.CMQC.MQGMO_FAIL_IF_QUIESCING;\nimport static com.ibm.mq.constants.CMQC.MQGMO_NO_SYNCPOINT;\nimport static com.ibm.mq.constants.CMQC.MQGMO_NO_WAIT;\nimport static com.ibm.mq.constants.CMQC.MQGMO_WAIT;\nimport static com.ibm.mq.constants.CMQC.MQMT_REQUEST;\nimport static com.ibm.mq.constants.CMQC.MQOO_FAIL_IF_QUIESCING;\nimport static com.ibm.mq.constants.CMQC.MQOO_INPUT_EXCLUSIVE;\nimport static com.ibm.mq.constants.CMQC.MQOO_OUTPUT;\nimport static com.ibm.mq.constants.CMQC.MQPMO_NO_SYNCPOINT;\nimport static com.ibm.mq.constants.CMQC.MQRC_NO_MSG_AVAILABLE;\n\nimport java.io.IOException;\nimport java.nio.charset.Charset;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Random;\nimport java.util.concurrent.Executors;\nimport java.util.function.Consumer;\nimport java.util.stream.Collectors;\n\nimport com.ibm.mq.MQException;\nimport com.ibm.mq.MQGetMessageOptions;\nimport com.ibm.mq.MQMessage;\nimport com.ibm.mq.MQPutMessageOptions;\nimport com.ibm.mq.MQQueue;\nimport com.ibm.mq.MQQueueManager;\n\nimport io.netty.util.CharsetUtil;\nimport net.jcip.annotations.GuardedBy;\n\npublic class Requester \n{\n private static final int WAIT_WHILE_EMPTY = 100; // ms\n private static int MAX_MILLIS_BETWEEN_REQUESTS = 100;\n private static int LONG_WIDTH_IN_HEX_CHARS = 16;\n private static final Charset charset = CharsetUtil.ISO_8859_1;\n private MQQueueManager qMgr;\n private final MQQueue requestQueue;\n private final String queueNamePattern = \"TEST.SESSION.*\";\n private String replyQueueName;\n private final MQQueue replyQueue;\n private final MQGetMessageOptions getOptions = new MQGetMessageOptions(); \n\n private static final String MQ_MANAGER = \"MY_QM\";\n private static final String REQUEST_QUEUE = \"TEST.REQUESTS\";\n private static final String MODEL_QUEUE = \"TEST.SESSION.MODEL\";\n \n final private Object locker = new Object();\n @GuardedBy(\"this\")\n boolean stopped = false;\n \n int rcvd = 0;\n \n public static void main(String[] args) {\n try {\n Requester rq = new Requester(MQ_MANAGER, REQUEST_QUEUE, MODEL_QUEUE);\n \n List poem = writePoem();\n Random requestIds = new Random();\n Random delays = new Random(1000);\n \n int cnt = 0;\n int position = 0;\n for (int i = 0; i < 50; ++i) {\n if (i == poem.size()) {\n int requestId = requestIds.nextInt(99999) + 1;\n String text = poem.stream().collect(Collectors.joining(\"\\n\"));\n String request = appRequestFrom(text, requestId);\n rq.write(request);\n System.out.println(\"Requester: sent request no \" + (++cnt) + \" - \" + requestId);\n }\n position %= poem.size();\n String line = poem.get(position);\n int requestId = requestIds.nextInt(99999) + 1;\n String request = appRequestFrom(line, requestId);\n rq.write(request);\n System.out.println(\"Requester: sent request no \" + (++cnt) + \" - \" + requestId);\n position++;\n try {\n Thread.sleep((long) Math.ceil((Math.pow(\n delays.nextDouble(), 4) * MAX_MILLIS_BETWEEN_REQUESTS) + 1));\n } catch (InterruptedException e) {\n // ignore\n }\n\n }\n try {\n Thread.sleep(2000);\n } catch (InterruptedException e) {\n // ignore\n }\n rq.close();\n } catch (MQException e) {\n e.printStackTrace();\n }\n }\n\n public Requester(String mqManagerName, String requestQueueName, String modelQueueName) throws MQException {\n super();\n System.out.println(\"Requester: establishing mq session (mq manager: \" + mqManagerName +\n \"/ request queue: \" + requestQueueName + \" / model queue: \" + modelQueueName +\")\");\n qMgr = new MQQueueManager(mqManagerName);\n // get request queue\n int openOptions = MQOO_OUTPUT + MQOO_FAIL_IF_QUIESCING;\n requestQueue = qMgr.accessQueue(requestQueueName, openOptions);\n // get dynamic reply queue\n int inputOptions = MQOO_INPUT_EXCLUSIVE + MQOO_FAIL_IF_QUIESCING;\n replyQueue = new MQQueue(qMgr,\n modelQueueName,\n inputOptions,\n \"\",\n queueNamePattern,\n \"\");\n replyQueueName = replyQueue.getName();\n System.out.println(\"Requester: created temporary reply queue \" + replyQueueName);\n getOptions.options = MQGMO_NO_SYNCPOINT +\n MQGMO_NO_WAIT +\n MQGMO_FAIL_IF_QUIESCING;\n \n // catch-up (for those replies not retrieved after a request was put)\n Executors.newSingleThreadExecutor().execute(new Runnable() {\n\n @Override\n public void run() {\n // read options\n MQGetMessageOptions getOptions = new MQGetMessageOptions();\n getOptions.options = MQGMO_NO_SYNCPOINT +\n MQGMO_WAIT +\n MQGMO_FAIL_IF_QUIESCING;\n getOptions.waitInterval = WAIT_WHILE_EMPTY;\n while(proceed()) {\n try {\n if (!retrieveMessage(getOptions)) {\n try {\n Thread.sleep(getOptions.waitInterval);\n } catch (InterruptedException e1) {}\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n } \n });\n }\n \n private boolean retrieveMessage(MQGetMessageOptions getOptions) throws IOException {\n MQMessage msg = new MQMessage();\n try {\n msg.clearMessage();\n msg.seek(0);\n replyQueue.get(msg, getOptions);\n System.out.println(\"Requester: reply no \" + ++rcvd + \" received - id: \" +\n Long.parseLong(new String(msg.messageId, Charset.forName(\"ISO_8859_1\")), 16));\n byte[] buf = new byte[msg.getDataLength()];\n String message = new String(buf, charset);\n System.out.println(\"Requester: message received:\\n\" + message);\n } catch (MQException e) {\n if (e.reasonCode == MQRC_NO_MSG_AVAILABLE) {\n return false;\n }\n }\n return true;\n }\n \n public byte[] write(String message) {\n int positionRequestId = 24;\n int endIndex = positionRequestId + 16;\n CharSequence requestId = message.substring(positionRequestId, endIndex);\n StringBuffer sb = new StringBuffer(\"00000000\");\n sb.append(requestId);\n byte[] id = sb.toString().getBytes(charset);\n MQMessage mqMsg = new MQMessage();\n mqMsg.characterSet = 819;\n mqMsg.encoding = MQENC_INTEGER_NORMAL;\n mqMsg.format = MQFMT_STRING;\n mqMsg.messageType = MQMT_REQUEST;\n mqMsg.messageId = id;\n mqMsg.correlationId = id;\n mqMsg.replyToQueueName = replyQueueName;\n try {\n mqMsg.writeString(message);\n mqMsg.seek(0);\n MQPutMessageOptions pmo = new MQPutMessageOptions();\n pmo.options = MQPMO_NO_SYNCPOINT;\n requestQueue.put(mqMsg, pmo);\n \n } catch (IOException e) {\n e.printStackTrace();\n } catch (MQException e) {\n e.printStackTrace();\n }\n // try to read from reply queue fail immediately\n try {\n retrieveMessage(getOptions);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return id;\n }\n \n public void close() {\n stop();\n try {\n Thread.sleep(2 * WAIT_WHILE_EMPTY);\n } catch (InterruptedException e1) {\n // ignore\n }\n try {\n if (requestQueue != null) {\n requestQueue.close();\n }\n if (qMgr != null) {\n qMgr.disconnect();\n }\n } catch (MQException e) {\n // ignore\n }\n }\n \n public boolean proceed() {\n synchronized(locker) {\n return !stopped;\n }\n }\n \n public void stop() {\n synchronized(locker) {\n stopped = true;\n }\n }\n \n private static List writePoem() {\n List poem = new ArrayList<>();\n poem.add(\"Das Nasobem\");\n poem.add(\"von Joachim Ringelnatz\");\n poem.add(\"\");\n poem.add(\"Auf seiner Nase schreitet\");\n poem.add(\"einher das Nasobem,\");\n poem.add(\"von seineme Kind begleitet -\");\n poem.add(\"es steht noch nicht im Brehm.\");\n poem.add(\"\");\n poem.add(\"Es steht noch nicht im Meyer\");\n poem.add(\"und auch im Brockhaus nicht -\");\n poem.add(\"es tritt aus meiner Leier\");\n poem.add(\"zum ersten Mal ans Licht.\");\n poem.add(\"\");\n poem.add(\"Auf seiner Nase schreitet\");\n poem.add(\"- wie schon gesagt - seitdem\");\n poem.add(\"von seinem Kind begleitet\");\n poem.add(\"einher das Nasobem.\");\n poem.add(\"\");\n poem.add(\"\");\n return poem;\n }\n\n private static String iToHex(int num, int places) {\n StringBuilder sb = new StringBuilder();\n char[] digits = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };\n for (int i = 0; i < places; ++i) {\n sb.append(digits[num % places]);\n num /= places;\n }\n return sb.reverse().toString();\n }\n \n private static String iToHex(int num) {\n return iToHex(num, LONG_WIDTH_IN_HEX_CHARS);\n }\n \n\n private static String appRequestFrom(String msgBody, int requestId) {\n int headerLength = 72;\n // includes message body length field here!\n int bodyLength = msgBody.length();\n StringBuilder sb = new StringBuilder();\n sb.append(\"GHI \"); // magic\n sb.append(\"1\"); // version major\n sb.append(\"0\"); // version minor\n sb.append(\"0\"); // flags\n sb.append(\"1\"); // app message type SYNCHRONOUS REQUEST\n sb.append(iToHex(headerLength + bodyLength)); // message length\n sb.append(iToHex(requestId)); // request id\n sb.append(iToHex(0)); // timeout\n sb.append(iToHex(bodyLength)); // message body length\n sb.append(msgBody); // message body\n return sb.toString();\n }\n \n\n}Responder.java:package com.hellerim.imq.comm.responder;\n\nimport static com.ibm.mq.constants.CMQC.*;\n\nimport java.io.EOFException;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport com.ibm.mq.MQException;\nimport com.ibm.mq.MQGetMessageOptions;\nimport com.ibm.mq.MQMessage;\nimport com.ibm.mq.MQPutMessageOptions;\nimport com.ibm.mq.MQQueue;\nimport com.ibm.mq.MQQueueManager;\n\nimport io.netty.util.CharsetUtil;\nimport net.jcip.annotations.GuardedBy;\n\npublic class Responder\n{\n \n private MQQueueManager qMgr;\n private MQQueue requestQueue;\n private Map replyQueues = new HashMap<>();\n private final Object locker = new Object();\n static final private int WAIT_WHILE_EMPTY = 100; // ms\n @GuardedBy(\"locker\")\n private boolean stopped = false;\n Thread fetcherThread = null;\n private final static byte MESSAGE_TYPE_REPLY = 52; // '4'\n \n public final static String MQ_MANAGER = \"MY_QM\";\n public final static String REQUEST_QUEUE = \"TEST.REQUESTS\";\n \n public static void main( String[] args ) throws MQException, IOException\n {\n System.out.println( \"running reponder application\" );\n try {\n new Responder(MQ_MANAGER, REQUEST_QUEUE).start();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }\n \n public Responder(String mqManagerName, String requestQueueName) throws MQException {\n System.out.println(\"establishing mq session (mq manager: \" + mqManagerName +\n \" / request queue: \" + requestQueueName + \")\");\n qMgr = new MQQueueManager(mqManagerName);\n int openOptions = MQOO_INPUT_SHARED + MQOO_FAIL_IF_QUIESCING;\n requestQueue = qMgr.accessQueue(requestQueueName, openOptions);\n }\n \n public MQQueue getReplyQueue(String replyQueueName) throws MQException {\n \n if (replyQueues.containsKey(replyQueueName)) {\n return replyQueues.get(replyQueueName);\n }\n int openOptions = MQOO_OUTPUT + MQOO_FAIL_IF_QUIESCING;\n MQQueue replyQueue = qMgr.accessQueue(replyQueueName, openOptions);\n \n replyQueues.put(replyQueueName, replyQueue);\n System.out.println(\"Responder: opened dynamic reply queue\");\n return replyQueue;\n }\n \n private void start() throws IOException {\n \n Runnable fetcher = new Runnable() {\n\n @Override\n public void run() {\n int cnt = 0;\n while(proceed()) {\n MQMessage msg = new MQMessage();\n try {\n //msg.clearMessage();\n MQGetMessageOptions getOptions = new MQGetMessageOptions();\n \n getOptions.options = MQGMO_NO_SYNCPOINT +\n MQGMO_WAIT +\n MQGMO_FAIL_IF_QUIESCING;\n getOptions.waitInterval = WAIT_WHILE_EMPTY;\n requestQueue.get(msg, getOptions);\n System.out.println(\"Responder: message no \" + ++cnt + \" received\");\n \n MQQueue replyQueue = null;\n try {\n replyQueue = getReplyQueue(msg.replyToQueueName);\n } catch(MQException e) {\n if (e.completionCode == MQCC_FAILED && e.reasonCode == MQRC_UNKNOWN_OBJECT_NAME) {\n // dynamic reply queue does not exist any more => message out of date\n continue;\n }\n throw e;\n }\n // set message type for reply\n if (msg.getDataLength() < 56) {\n System.out.println(\"invalid message:\");\n System.out.println(Msg2Text(msg));\n continue;\n }\n System.out.println(Msg2Text(msg));\n int typePosition = 7;\n msg.seek(typePosition);\n msg.writeByte(MESSAGE_TYPE_REPLY);\n msg.seek(0);\n \n String text = Msg2Text(msg);\n MQMessage msgOut = new MQMessage();\n msgOut.characterSet = 819;\n msgOut.encoding = MQENC_INTEGER_NORMAL;\n msgOut.format = MQFMT_STRING;\n msgOut.messageType = MQMT_REPLY;\n msgOut.messageId = msg.messageId;\n msgOut.correlationId = msg.correlationId;\n msgOut.seek(0);\n msgOut.writeString(text);\n msgOut.seek(0);\n System.out.println(text);\n \n// System.out.println(\"Responder: message received\");\n MQPutMessageOptions pmo = new MQPutMessageOptions(); // accept the defaults, same\n pmo.options = MQPMO_NO_SYNCPOINT;\n replyQueue.put(msgOut, pmo);\n System.out.println(\"Responder: message no \" + cnt + \" returned\");\n } catch (MQException e) {\n if (e.reasonCode == MQRC_NO_MSG_AVAILABLE) {\n ; // NOOP\n } else {\n try {\n msg.seek(0);\n System.out.println(msg);\n } catch (EOFException e2) {\n // TODO Auto-generated catch block\n e2.printStackTrace();\n }\n e.printStackTrace();\n try {\n Thread.sleep(1000);\n } catch (InterruptedException e1) {}\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n shutdown();\n }\n\n };\n \n Thread task = new Thread(fetcher);\n task.run();\n System.out.print(\"press to terminate \");\n System.in.read();\n System.out.println();\n synchronized(locker) {\n stopped = true;\n }\n try {\n task.join();\n } catch (InterruptedException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n \n private static String Msg2Text(MQMessage msg) {\n \n int length;\n String text = \"\";\n try {\n length = msg.getDataLength();\n byte[] buf = new byte[length];\n msg.seek(0);\n msg.readFully(buf);\n text = new String(buf, CharsetUtil.ISO_8859_1);\n msg.seek(0);\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n return text;\n }\n \n private boolean proceed() {\n synchronized(locker) {\n return !stopped;\n }\n \n }\n \n private void shutdown() {\n \n System.out.print(\"\\nshutting down responder... \");\n \n for (MQQueue queue : replyQueues.values()) {\n try {\n queue.close();\n } catch (MQException e) { }\n }\n replyQueues.clear();\n try {\n qMgr.close();\n } catch (MQException e) { }\n \n System.out.println(\"done.\");\n }\n\n}Is there any idea what might be wrong?### Assistant: It looks like you have created a buffer the right size for the message data and printed that, without moving the data into it.In retrieveMessage:byte[] buf = new byte[msg.getDataLength()];\nString message = new String(buf, charset);\nSystem.out.println(\"Requester: message received:\\n\" + message);You might need to call the readFully (or similar) method to get the data.\n"} +{"text": "### Human: Hi everyone i am completely new to queues and especialy to IBMMQDotnet cleint library. Currently my application trying to send DTO object to the queue and sometimes it could faailed for various reasons like exception occuring or network issue. Is there any retrie mechanism ?i would like to implement retry mechansim, i tried to google it but could not found any example. Bellow is the current codeif (!TryConnectToQueueManager())\n {\n return;\n }\n using var destination = GetMqObjectForWrite(message.Destination, message.DestinationType);\n\n var mqMessage = new MQMessage\n {\n Format = MQC.MQFMT_STRING,\n CharacterSet = 1208\n };\n\n if (message.Headers?.Count > 0)\n {\n foreach (var (key, value) in message.Headers)\n {\n mqMessage.SetStringProperty(key, value);\n }\n }\n\n mqMessage.WriteString(JsonSerializer.Serialize(message.Data));\n\n destination.Put(mqMessage);\n\n destination.Close();### Assistant: IBM MQ provides a feature called as Client Auto Reconnect.You could refer the following KC pageClient Auto ReconnectIf there is a connection failure because of the network issue, the IBM MQ client will try to re-establish a connection to the Queue Manager for a specific time period(which is configurable) before throwing an exception to the applicationYou could refer to the sample \"SimpleClientAutoReconnectPut\" & \"SimpleClientAutoReconnectGet\" which are available as part of the client installation.\n"} +{"text": "### Human: I have written a code to connect to IBM MQ, and i am using ConnectionNameList which automatically reconnects to ibm mq.I want to customize the reconnection which is happening implicitly. I have referred many articles on the internet but i am not able to figure it out.This is my Queue Manager Config:@Configuration\npublic class QM1Config{\n \n\n public String queueManager;\n public String queue;\n public String channel;\n public String connName;\n public String user;\n public String password;\n private static final int RECONNECT_TIMEOUT = 10;\n \n @Autowired\n MQService config;\n \n\n@Bean\npublic MQConnectionFactory mqQueueConnectionFactory() {\n this.channel = config.getHosts().get(0).getChannel();\n this.user = config.getHosts().get(0).getUser();\n this.password = config.getHosts().get(0).getPassword();\n this.queueManager = config.getHosts().get(0).getQueueManager();\n this.queue = config.getHosts().get(0).getQueue();\n this.connName = config.getHosts().get(0).getConnName();\n System.out.println(channel+\" \"+connName+\" \"+queueManager+\" \"+user);\n MQConnectionFactory mqQueueConnectionFactory = new MQConnectionFactory();\n try {\n mqQueueConnectionFactory.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n mqQueueConnectionFactory.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, false);\n mqQueueConnectionFactory.setCCSID(1208);\n mqQueueConnectionFactory.setChannel(channel);\n mqQueueConnectionFactory.setStringProperty(WMQConstants.USERID, user);\n mqQueueConnectionFactory.setStringProperty(WMQConstants.PASSWORD, password);\n mqQueueConnectionFactory.setQueueManager(queueManager);\n mqQueueConnectionFactory.setConnectionNameList(connName);\n } catch (Exception e) {\n e.printStackTrace();\n \n \n }\n return mqQueueConnectionFactory;\n \n}\n\n\n@Bean\npublic JmsListenerContainerFactory qm1JmsListenerContainerFactory(@Qualifier(\"mqQueueConnectionFactory\") MQConnectionFactory mqQueueConnectionFactory, DefaultJmsListenerContainerFactoryConfigurer configurer) throws InterruptedException {\n DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();\n this.queue = config.getHosts().get(0).getQueue();\n configurer.configure(factory, mqQueueConnectionFactory);\n return factory;\n}\n\n@Bean(\"jmsTemplate1\")\npublic JmsTemplate jmsTemplate(@Qualifier(\"mqQueueConnectionFactory\") MQConnectionFactory mqQueueConnectionFactory) {\n JmsTemplate jmsTemplate1 = new JmsTemplate(mqQueueConnectionFactory);\n return jmsTemplate1;\n}\n\n\n}When i stop the queue manager, i get the following exceptions every 5 seconds:2022-04-24 01:17:43.194 WARN 6644 --- [enerContainer-1] o.s.j.l.DefaultMessageListenerContainer : Setup of JMS message listener invoker failed for destination 'Q5' - trying to recover. Cause: JMSWMQ2002: Failed to get a message from destination 'Q5'.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2009' ('MQRC_CONNECTION_BROKEN').\n2022-04-24 01:17:43.232 ERROR 6644 --- [enerContainer-1] o.s.j.l.DefaultMessageListenerContainer : Could not refresh JMS Connection for destination 'Q5' - retrying using FixedBackOff{interval=5000, currentAttempts=0, maxAttempts=unlimited}. Cause: JMSWMQ0018: Failed to connect to queue manager 'QM5' with connection mode 'Client' and host name 'Client'.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2059' ('MQRC_Q_MGR_NOT_AVAILABLE').\n2022-04-24 01:17:48.243 ERROR 6644 --- [enerContainer-1] o.s.j.l.DefaultMessageListenerContainer : Could not refresh JMS Connection for destination 'Q5' - retrying using FixedBackOff{interval=5000, currentAttempts=1, maxAttempts=unlimited}. Cause: JMSWMQ0018: Failed to connect to queue manager 'QM5' with connection mode 'Client' and host name 'Client'.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2538' ('MQRC_HOST_NOT_AVAILABLE').\n2022-04-24 01:17:53.245 ERROR 6644 --- [enerContainer-1] o.s.j.l.DefaultMessageListenerContainer : Could not refresh JMS Connection for destination 'Q5' - retrying using FixedBackOff{interval=5000, currentAttempts=2, maxAttempts=unlimited}. Cause: JMSWMQ0018: Failed to connect to queue manager 'QM5' with connection mode 'Client' and host name 'Client'.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2538' ('MQRC_HOST_NOT_AVAILABLE').\n2022-04-24 01:17:58.250 ERROR 6644 --- [enerContainer-1] o.s.j.l.DefaultMessageListenerContainer : Could not refresh JMS Connection for destination 'Q5' - retrying using FixedBackOff{interval=5000, currentAttempts=3, maxAttempts=unlimited}. Cause: JMSWMQ0018: Failed to connect to queue manager 'QM5' with connection mode 'Client' and host name 'Client'.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2538' ('MQRC_HOST_NOT_AVAILABLE').So i want that first 3 reconnection attempts should be a warn messages instead of error message as shown in above logs and 4th attempt onwards i want it to be an error message. and reconnection attempt to be every 10/15 seconds.How do i configure these re-connection settings ?Any help would be greatly appreciated ! Thanks !EDIT: I have added an exception listener as follows:public class MQExceptionListener implements ExceptionListener {\n private static final Logger LOGGER = LoggerFactory.getLogger(MQExceptionListener.class);\n\n int count = -1;\n \n\n @Override\n public void onException(JMSException ex) {\n \n if(count > 2) {\n System.out.println(\"COUNT - \"+ count);\n count++;\n LOGGER.error(\"***********************************************\");\n LOGGER.error(ex.toString()+\" THIS IS EX TO STRING\");\n if (ex.getLinkedException() != null) {\n LOGGER.error(ex.getLinkedException().toString()+\" THIS IS getLinkedException TO STRING\");\n }\n LOGGER.error(\"================================================\");\n\n }else {\n System.out.println(\"COUNT - \"+ count);\n count++;\n LOGGER.warn(\"***********************************************\");\n LOGGER.warn(ex.toString()+\" THIS IS EX TO STRING\");\n if (ex.getLinkedException() != null) {\n LOGGER.warn(ex.getLinkedException().toString()+\" THIS IS getLinkedException TO STRING\");\n }\n LOGGER.warn(\"================================================\");\n \n }\n \n }\n}Now My logs are as follows:COUNT - 1\n2022-04-24 14:41:04.905 WARN 9268 --- [enerContainer-1] com.mq.sslMQ.MQExceptionListener : ***********************************************\n2022-04-24 14:41:04.905 WARN 9268 --- [enerContainer-1] com.mq.sslMQ.MQExceptionListener : com.ibm.msg.client.jms.DetailedIllegalStateException: JMSWMQ0018: Failed to connect to queue manager 'QM5' with connection mode 'Client' and host name 'Client'.\nCheck the queue manager is started and if running in client mode, check there is a listener running. Please see the linked exception for more information. THIS IS EX TO STRING\n2022-04-24 14:41:04.905 WARN 9268 --- [enerContainer-1] com.mq.sslMQ.MQExceptionListener : com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2538' ('MQRC_HOST_NOT_AVAILABLE'). THIS IS getLinkedException TO STRING\n2022-04-24 14:41:04.905 WARN 9268 --- [enerContainer-1] com.mq.sslMQ.MQExceptionListener : ================================================\n2022-04-24 14:41:04.905 ERROR 9268 --- [enerContainer-1] o.s.j.l.DefaultMessageListenerContainer : Could not refresh JMS Connection for destination 'Q5' - retrying using FixedBackOff{interval=5000, currentAttempts=1, maxAttempts=unlimited}. Cause: JMSWMQ0018: Failed to connect to queue manager 'QM5' with connection mode 'Client' and host name 'Client'.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2538' ('MQRC_HOST_NOT_AVAILABLE').I dont want the default message listener container log to be printed onto console. how do we achieve that ?### Assistant: It says inIBM Docs:-By default, the reconnection attempts happen at the following intervals:The first attempt is made after an initial delay of 1 second, plus a random element up to 250 milliseconds.The second attempt is made 2 seconds, plus a random interval of up to 500 milliseconds, after the first attempt fails.The third attempt is made 4 seconds, plus a random interval of up to 1 second, after the second attempt fails.The fourth attempt is made 8 seconds, plus a random interval of up to 2 seconds, after the third attempt fails.The fifth attempt is made 16 seconds, plus a random interval of up to 4 seconds, after the fourth attempt fails.The sixth attempt, and all subsequent attempts are made 25 seconds, plus a random interval of up to 6 seconds and 250 milliseconds after the previous attempt fails.The reconnection attempts are delayed by intervals that are partly fixed and partly random. This is to prevent all of the IBM MQ classes for JMS applications that were connected to a queue manager that is no longer available from reconnecting simultaneously.If you need to increase the default values, to more accurately reflect the amount of time that is required for a queue manager to recover, or a standby queue manager to become active, modify the ReconDelay attribute in the Channel stanza of the client configuration file.You can read more about this attributehere.Sounds like you need to put the following into yourmqclient.inifile.CHANNELS:\n ReconDelay=(10000,5000)That is requesting a delay of 10 seconds plus a random element up to 5 seconds, which is my interpretation of your request for 10/15 seconds. You haven't asked for any of the reconnection attempts to be different in timing, although you can do this if you need to.Note, it is not possible to change the WARN/ERROR status of the messages.Remember that you can always turn off automatic reconnect and implement whatever you need yourself by catching the connection failures in your application. Automatic reconnect was designed for applications that were unable (or unwilling) to catch the connection failures.\n"} +{"text": "### Human: I have a web application that publishes messages to a topic then several Windows services that subscribe to those topics, some with multiple instances. If the services are running when the messages are published everything works correctly but if they are not then the messages are retained on the queue(s) subscribing to that topic but aren't read when the services start back up.The desired behavior-When a message is published to the topic string MyTopic, it is read\nfrom the MyTopicQueue only once. I use some wildcard topics so each message is sent to multiple queues, but multiple instances of a services subscribe to the same topic string and each message should be read by only of those instancesIf the subscribers to the MyTopic topic aren't online when the message is published then the messages are retained on MyTopicQueue.When the Windows services subscribing\nto a particularly topic come back on line each retained message is\nread from MyTopicQueue by only a single subscriber.I've found some [typically for IBM] spotty documentation about the MQSUBRQ and MQSO_PUBLICATIONS_ON_REQUEST options but I'm not sure how I should set them. Can someone please help figure out what I need to do to get my desired behavior? [Other than switching back to RabbitMQ which I can't do though I'd prefer it.]My options:private readonly int _openOptions = MQC.MQSO_CREATE | MQC.MQSO_FAIL_IF_QUIESCING | MQC.MQSO_MANAGED;\nprivate readonly MQGetMessageOptions _messageOptions = new MQGetMessageOptions()Code to open the Topic:_topic = _queueManager.AccessTopic(_settings.TopicString, null, \n MQC.MQTOPIC_OPEN_AS_SUBSCRIPTION, _openOptions);The line of code that reads from the topic (taken from a loop):_topic.Get(mqMessage, _messageOptions);### Assistant: If you want the messages to accumulate while you are not connected you need to make the subscription durable by addingMQC.MQSO_DURABLE. In order to be able to resume an existing subscription addMQC.MQSO_RESUMEin addition toMQC.MQSO_CREATE.Be careful with terminology, what you are describing as retained messages is a durable subscription.Retained publications are something else were MQ can retain one most recently published message on each topic and this message will be retrieved by new subscribers by default unless they useMQSO_NEW_PUBLICATIONS_ONLYto skip receiving the retained publication.MQSO_PUBLICATIONS_ON_REQUESTallows a subscriber to only receive retained publications on request, it will not receive non-retained publications.If you want multiple consumers to work together on a single subscription you have two options:Look at shared subscribers in XMS.NET, look at theCLONESUPPproperty.Create a one time durable subscription to a queue on the topics you want consumed, then have your consumers directly consume from the queue not a topic.\n"} +{"text": "### Human: I have a requirement to establish a point to point communication with publisher and consumer in my application. What I'm given is a topic. So I should make sure the message in the topic will be consumed only once and only one instance should consume it. (There are multiple instances of the consumer.)I understand message queue is the solution for the above requirement. But I will have to work with the topic given instead.I tried one sample application and my all my consumer instances consumed the message in the topic. I planned to use a table to keep a track of message processing but it does not seem like a good solution. We use IBM MQ with spring boot JMS. Is this something doable?### Assistant: JMS topics, generally speaking, provide publish-subscribe semantics in which every consumer/subscriber gets every message sent to the topic. However, there is a way to get point-to-point semantics with multiple consumers on a JMS topic - shared subscriptions.Shared subscriptions are available from JMS 2 onward. When using this feature multiple consumers/subscribers can share thesamesubscription and only one of those consumers will receive a given message.The simplest way to create a shared subscription is by usingjavax.jms.Session.createSharedConsumer(). This will create a shared, non-durable subscription and unlike when creating a durable subscription setting the client ID on the connection isoptional. There are other related methods for creating shared, durable subscriptions, using selectors, etc.In short, as long as all the consumers are creating a shared subscription using the same subscription name then you can get the point-to-point semantics you need.\n"} +{"text": "### Human: Closed. This question needs to be morefocused. It is not currently accepting answers.Want to improve this question?Update the question so it focuses on one problem only byediting this post.Closed2 years ago.Improve this questionStep 1:\nConsuming Message from IBM MQ and processing it.Step 2: If some message gets failed to process then it will be retried for certain times using spring Retry, but if still issue persists then want to move those messages to Backout Queue.Note: Spring Retry Part has been done, I want help in pushing Poison Message to Backout Queue after those retries.Can anyone help me here?### Assistant: You can use BOTHRESH and BOQNAME attributes of MQ Queue. Once the message backout count reaches the value set on BOTHRESH, the message is moved to backout queue by MQ JMS. More details on poison message handling arehere.I don't know much about Spring Retry. But if you use MQ JMS Backout mechanism, I wonder if Spring Retry is still required.\n"} +{"text": "### Human: I'm facing some strange RDQM behavior.\nWe have 3 servers (node1: primary, node2, and node3: secondary). 4 QMs of 1G each, are created on the primary with a preferred location node1 and node2.\nDue to some problems (connection problems, I think), 1 QM is switched to primary on node3. The pacemaker indicates that node3 is its master and the other nodes are Slaves. I tried to restart node3 but as soon as it is accessible, the QM switches back to node3.I tried with difficulty to reproduce the problem with other QM but it's impossible.\nWhat do you think is the origin of the problem?### Assistant: There are a number of possible causes for a high availability queue manager to not run on the node you may expect it to, a common cause is failed resource actions. If you run thecrm statuscommand, you may see a \"Failed Resource Actions\" section which may detail a failed resource action preventing the queue manager from running on its preferred node.The rest of my answer assumes that you did have a failed resource action (i.e. you see a \"Failed Resource Actions\" section).Reading the text surrounding it sometimes gives you a hint that you have an underlying issue that you need to fix. Sometimes you can find more clues about underlying issues from the syslog ordmesgat the time of the failed action. If the failed resource action has an \"exitreason\", try searching for parts of the text in the syslog anddmesg.Once you have resolved any outstanding issues (if there were any), clear the failed resource action(s) by runningcrm resource cleanup RESOURCE, replacing \"RESOURCE\" with the name of the resource that failed (e.g. 'p_fs_haqm1' or 'haqm1'. N.b. the failed resource action's name will be prefixed by the name of the resource). There may be multiple failed resources, so you will need to issue the command for each of them. Note, if the underlying issues weren't fixed, then the action may fail again, which will be seen by reissuingcrm status.For more information visithttps://www.ibm.com/support/knowledgecenter/SSFKSJ_latest/com.ibm.mq.tro.doc/q133450_.htm(remember to \"Change version or product\" to your MQ version) where you will find a section titled \"Pacemaker scenario 2: An RDQM HA queue manager is not running where it should be\", which goes into a lot more detail than my answer.\n"} +{"text": "### Human: We have been facing an issue where message rate of a xmitq is very slow comparing with what should be a normal performance.\nWe have many other Qmgrs with bigger MQ flows that don't have the same issue.Our HUB qmgr connects to business line in the same company HUB qmgr, and even the destination queues on their side being empty the flow is really slow.At OS and Network level they say nothing can be done. At MQ we have changed the Buffersizes so it matches the OS level and uses the system tcp windows.Now at MQ level we have the channel SDR setup with BATCHSZ to 100, but seems the receiver is configured with 30.\nWe noticed that because we see messages flow in batches fof 30 messages. Also not sure if that is related but we see the XMITQ havs always 30 uncommited messages.Our questiong for advice.Would increase the BATCHSZ parameter on SDR/RCVR help the perfomance?\nIs there any other parameter at MQ level that could help it?DIS CHS(NAME) ALL\n\nAMQ8417: Display Channel Status details.\n CHANNEL(QMGRA.QMGRB.T7) CHLTYPE(SDR)\n BATCHES(234) BATCHSZ(30)\n BUFSRCVD(235) BUFSSENT(6391)\n BYTSRCVD(6996) BYTSSENT(14396692)\n CHSTADA(2020-04-16) CHSTATI(14.38.17)\n COMPHDR(NONE,NONE) COMPMSG(NONE,NONE)\n COMPRATE(0,0) COMPTIME(0,0)\n CONNAME(159.50.69.38(48702)) CURLUWID(398F3E5EEA43381C)\n CURMSGS(30) CURRENT\n CURSEQNO(43488865) EXITTIME(0,0)\n HBINT(300) INDOUBT(YES)\n JOBNAME(000051FC00000001) LOCLADDR(10.185.8.122(54908))\n LONGRTS(999999999) LSTLUWID(398F3E5EE943381C)\n LSTMSGDA(2020-04-16) LSTMSGTI(14.49.46)\n LSTSEQNO(43488835) MCASTAT(RUNNING)\n MONCHL(HIGH) MSGS(6386)\n NETTIME(2789746,3087573) NPMSPEED(NORMAL)\n RQMNAME(QMGRB) SHORTRTS(10)\n SSLCERTI(*******************)\n SSLKEYDA( ) SSLKEYTI( )\n SSLPEER(*******************)\n SSLRKEYS(0) STATUS(RUNNING)\n STOPREQ(NO) SUBSTATE(RECEIVE)\n XBATCHSZ(23,7) XMITQ(QMGRB.X7)\n XQTIME(215757414,214033427) RVERSION(08000008)\n RPRODUCT(MQMM)qm.ini:Log:\n LogPrimaryFiles=10\n LogSecondaryFiles=10\n LogFilePages=16384\n LogType=LINEAR\n LogBufferPages=4096\n LogPath=/apps/wmq/QMGR/log/QMGR/\n LogWriteIntegrity=SingleWrite\nService:\n Name=AuthorizationService\n EntryPoints=13\nTCP:\n SvrSndBuffSize=0\n SvrRcvBuffSize=0 \n ServiceComponent:\n Service=AuthorizationService\n Name=MQSeries.UNIX.auth.service\n Module=/opt/mqm75/lib64/amqzfu\n ComponentDataSize=0\nChannels:\n MaxChannels=500UPDATED: 15:41 GMTJust to update the information, both sides are now with BATCHSZ 100 and seems slightly.AMQ8417: Display Channel Status details.\n CHANNEL(QMGRA.QMGRB.T7) CHLTYPE(SDR)\n BATCHES(403) BATCHSZ(100)\n BUFSRCVD(405) BUFSSENT(23525)\n BYTSRCVD(11756) BYTSSENT(53751066)\n CHSTADA(2020-04-17) CHSTATI(15.13.51)\n COMPHDR(NONE,NONE) COMPMSG(NONE,NONE)\n COMPRATE(0,0) COMPTIME(0,0)\n CONNAME(159.50.69.38(48702)) CURLUWID(6D66985E94343410)\n CURMSGS(0) CURRENT\n CURSEQNO(44115897) EXITTIME(0,0)\n HBINT(300) INDOUBT(NO)\n JOBNAME(0000172A00000001) LOCLADDR(10.185.8.122(2223))\n LONGRTS(999999999) LSTLUWID(6D66985E93343410)\n LSTMSGDA(2020-04-17) LSTMSGTI(15.30.06)\n LSTSEQNO(44115897) MCASTAT(RUNNING)\n MONCHL(HIGH) MSGS(23505)\n NETTIME(101563,480206) NPMSPEED(NORMAL)\n RQMNAME(QMGRB) SHORTRTS(10)\n SSLCERTI(*************************************)\n SSLKEYDA( ) SSLKEYTI( )\n SSLPEER(****************************)\n SSLRKEYS(0) STATUS(RUNNING)\n STOPREQ(NO) SUBSTATE(MQGET)\n XBATCHSZ(1,1) XMITQ(QMGRB.X7)\n XQTIME(191225,794134) RVERSION(08000008)\n RPRODUCT(MQMM)\n\nAMQ8450: Display queue status details.\n QUEUE(QMGRB.X7) TYPE(QUEUE)\n CURDEPTH(0) IPPROCS(1)\n LGETDATE(2020-04-17) LGETTIME(15.30.06)\n LPUTDATE(2020-04-17) LPUTTIME(15.30.06)\n MEDIALOG(S2488154.LOG) MONQ(LOW)\n MSGAGE(0) OPPROCS(9)\n QTIME(794134, 191225) UNCOM(NO)### Assistant: I'll put a few observations in this answer, but based on any further feedback I may add more.You are running a very old version of the software on the sender side, MQ 7.5 went out of support almost two years ago (April 30 2018). IBM for a cost will provide extended support for an additional three years, so maybe you fall in that group. The 7.5.0.2 maintenance release itself came out in July 11th 2013, so it is almost seven years old at this point. I would strongly suggest you move to a newer version.Note that MQ v8.0 goes out of support April 30 2020, and IBM just announced a few days ago that MQ v9.0 goes out of support September 30 2021. When you do migrate you should go with either 9.1 which has no announced end of support (they give five years minimum so it could be 2023) or go with the next version of MQ that should be out some time this year.You mention setting the following:TCP:\n SvrSndBuffSize=0\n SvrRcvBuffSize=0The above setting apply to theSVRCONNend of a client connection. You can see this in the MQ v7.5 Knowledge Center pageWebSphere MQ>Configuring>Changing configuration information>Changing queue manager configuration information>TCP, LU62, NETBIOS, and SPX:SvrSndBuffSize=32768|numberThe size in bytes of the TCP/IP send buffer used by theserver end of a client-connection\n server-connection channel.SvrRcvBuffSize=32768|numberThe size in bytes of the TCP/IP receive buffer used by theserver end of a client-connection\n server-connection channel.At IBM MQ v7.5.0.2 APAR IV58073 introduced the concept of setting various buffer settings to a value to 0 which means that it will allow the operating system defaults to be used. Unfortunately like many things in the Knowledge Center it does not look like IBM documented this correctly for 7.5.You can however review the IBM MQ v8.0 Knowledge Center to get the full picture regarding these settings at the pageConfiguring>Changing configuration information>Changing queue manager configuration information>TCP, LU62, and NETBIOS, specifically you would want to set these two settings to have any impact on your Sender Channel:SndBuffSize=number| 0The size in bytes of the TCP/IP send buffer used by thesending end of\n channels.This stanza value can be overridden by a stanza more\n specific to the channel type, for example RcvSndBuffSize. If the\n value is set as zero, the operating system defaults are used. If no\n value is set, then the IBM MQ default, 32768, is used.RcvSndBuffSize=number| 0The size in bytes of the TCP/IP send buffer used by thesender end of\n a receiver channel.If the value is set as zero, the operating system\n defaults are used. If no value is set, then the IBM MQ default, 32768,\n is used.Starting at IBM MQ v8.0 any newly created queue manager will have all of the following in theqm.ini:TCP:\n SndBuffSize=0\n RcvBuffSize=0\n RcvSndBuffSize=0\n RcvRcvBuffSize=0\n ClntSndBuffSize=0\n ClntRcvBuffSize=0\n SvrSndBuffSize=0\n SvrRcvBuffSize=0However, any queue manager that is upgraded will not by default get those settings, meaning if those are not present they will not be added, if they are present they will remain the same. If the setting is not present then as it says above \"the IBM MQ default, 32768, is used.\"I had extensive discussions with IBM support on this topic and came to the conclusion that they did not see any reason to not set it to 0, they only saw benefit in doing so, but with an abundance of caution they do not change it to 0 for you.I would recommend you add all of those to yourqm.ini, but at minimum add the two I highlighted above.These are good setting to implement but may not solve your problem if nothing changed recently on either end. If however something did change, for example a network difference, or MQ was upgraded to 8.0.0.8 on the remote side, then this setting just might solve your problem.In the channel status output two values are interesting:NETTIME(2789746,3087573)XQTIME(215757414,214033427)NETTIME means that based on recent activity it took 2.7 seconds to receive a response from the RCVR channel, over a longer period of time it took 3.1 seconds to receive a response from the RCVR channel. Can you compare this to a TCP ping from the sender channel server to the receive channel server, 2.7 seconds for a response over the network seems excessive. In the presentationKeeping MQ Channels Up and Running given at Capitalware's MQ Technical Conference v2.0.1.4, Paul Clarke who used to work for IBM states \"NETTIME only measures network time, and does not include\nthe MQCMIT for example\".XQTIME means that based on recent activity and over a longer period of time it took ~215 seconds for a message on the XMITQ to be picked up by the SDR channel to be sent.See below for how IBM documents these:NETTIMEAmount of time, displayed in microseconds, to send a request to the remote end of the channel and receive a response. This time only measures the network time for such an operation. Two values are displayed:A value based on recent activity over a short period.A value based on activity over a longer period.XQTIMEThe time, in microseconds, that messages remained on the transmission queue before being retrieved. The time is measured from when the message is put onto the transmission queue until it is retrieved to be sent on the channel and, therefore, includes any interval caused by a delay in the putting application.Two values are displayed:A value based on recent activity over a short period.A value based on activity over a longer period.Information on theBATCHSZchannel parameter can be found in the IBM MQ v8.0 Knowledge Center pageReference>Configuration reference>Channel attributes>Channel attributes in alphabetical order>Batch size (BATCHSZ). I have quoted it and highlighted a few areas inbold.This attribute is the maximum number of messages to be sent before a sync point is taken.The batch size does not affect the way the channel transfers messages; messages are always transferred individually, but are committed or backed out as a batch.To improve performance, you can set a batch size to define the maximum number of messages to be transferred between two sync points.The batch size to be used is negotiated when a channel starts, and the lower of the two channel definitions is taken.On some implementations, the batch size is calculated from the lowest of the two channel definitions and the two queue manager MAXUMSGS values. The actual size of a batch can be less; for example, a batch completes when there are no messages left on the transmission queue or the batch interval expires.A large value for the batch size increases throughput, but recovery times are increased because there are more messages to back out and send again.The default BATCHSZ is 50, and you are advised to try that value first. You might choose a lower value for BATCHSZ if your communications are unreliable, making the need to recover more likely.This attribute is valid for channel types of:SenderServerReceiverRequesterCluster senderCluster receiverFollow up questions:Are the messages that are PUT to this XMITQ persistent?Answer: Yes, in our PROD env all messages are pesistent.Have you had a recent increase in volume going to this XMITQ?Answer: No, we use a monitoring tools, we extracted a report that show very similar message rate during the period. The same rate over the last 2 weeks.Do the putting applications setMQPMO_SYNCPOINTand then commit after 1 or more messages are PUT to the queue?Answer: I will check with the application team.\n"} +{"text": "### Human: I want to use acknowledge mode in delivering messages from ibm queue via JMS.So, I configure context in this way:private JMSContext createJmsContext() throws JMSException {\n JmsConnectionFactory cf;\n JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\n cf = ff.createConnectionFactory();\n cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, props.getProperty(Q_HOST));\n cf.setIntProperty(WMQConstants.WMQ_PORT, Integer.valueOf(props.getProperty(Q_PORT)));\n cf.setStringProperty(WMQConstants.WMQ_CHANNEL, props.getProperty(Q_CHANNEL));\n cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\n cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, props.getProperty(Q_MANAGER));\n cf.setStringProperty(WMQConstants.WMQ_APPLICATIONNAME, \"JmsPutGet (JMS)\");\n cf.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, true);\n cf.setIntProperty(WMQConstants.ACKNOWLEDGE_MODE, WMQConstants.CLIENT_ACKNOWLEDGE);\n return cf.createContext();\n }Here is special parameter:cf.setIntProperty(WMQConstants.ACKNOWLEDGE_MODE, WMQConstants.CLIENT_ACKNOWLEDGE);In code logic I use message listener which processes messages:consumer.setMessageListener(message -> {\n\n try {\n // business logic\n message.acknowledge();\n } catch (Throwable e) {\n\n try {\n // saving unsuccessful message to special database\n } catch (Throwable e) {\n // if database does not work, we want message to return back to queue and try process it again when database will work\n sleep(60_000); // to prevent too many process requests, there is only one working thread, so we can pause it\n }\n\n }\n\n });Now this code does not work: if database fails, message will be lost. We can not find it via JMS browsing. Why?### Assistant: You are not using sessionMode parameter when creating context. As far as I know a context created without specifyingsessionModeis same asAUTO_ACKNOWLEDGEwhere JMS client will automatically acknowledge message after it is delivered to application. So for your case you will need to use:cf.createContext(JMSContext.CLIENT_ACKNOWLEDGE);I tried and it works for me, meaning ifmessage.acknowlege()is not called, the same message is delivered again.\n"} +{"text": "### Human: I'm looking for solution to integrate Quarkus (only CDI without EJB) with IBM MQ.\nAnybody hat such problem? or have any idea.Parameters which I'm using to connect:hostportchannelqueue managerqueue nameI know I can create my own connection factory as bean like in stand alone app and then pool of consumers. Which is actually my alternative solution. But maybe there is better or \"prettier\" solution.\nMaybe library like camel allow for such configuration? I couldn't find such configuration example### Assistant: Currently, the standard Java programming interface for MQ is JMS. You can pull in the MQ JMS client as a dependency to your project by addding the following to your maven pom.xml:\n \n javax.jms\n javax.jms-api\n 2.0.1\n \n\n \n \n com.ibm.mq\n com.ibm.mq.allclient\n ${mq.version}\n \nThat will enable you to create a JMS ConnectionFactory programmatically within your app using the JMSFactoryFactory class, as described in:https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.dev.doc/q032180_.htmThis doesn't allow you to use injection, you need to declare and create your ConnectionFactory within the application itself.Within Quarkus, in order to be able to inject a ConnectionFactory object into your application, you could write your own extension.\nThere are more details about writing an extension at:https://quarkus.io/guides/writing-extensionsThe central requirement for that would be to write a Producer class in the runtime part of your extension that produces a JMSConnectionFactory object using properties defined in a config object (which also needs to be defined to contain the properties you want to set in the ConnectionFactory).\nThe producer would need a method similar to:@Produces\n@ApplicationScoped\n@DefaultBean\npublic ConnectionFactory connectionFactory() throws JMSException {\n JmsFactoryFactory ff;\n JmsConnectionFactory factory;\n try {\n // Get a new JMSConnectionFactory\n ff = JmsFactoryFactory.getInstance(JmsConstants.WMQ_PROVIDER);\n factory = ff.createConnectionFactory();\n // Always work in TCP/IP client mode\n factory.setIntProperty(CommonConstants.WMQ_CONNECTION_MODE, CommonConstants.WMQ_CM_CLIENT);\n // Now set the properties in this ConnectionFactory from the config.\n if (config.hostname.isPresent())\n factory.setStringProperty(CommonConstants.WMQ_HOST_NAME, config.hostname.get());\n if (config.port.isPresent())\n factory.setIntProperty(CommonConstants.WMQ_PORT, config.port.get());\n if (config.channel.isPresent())\n factory.setStringProperty(CommonConstants.WMQ_CHANNEL, config.channel.get());\n if (config.queuemanager.isPresent())\n factory.setStringProperty(CommonConstants.WMQ_QUEUE_MANAGER, config.queuemanager.get());\n }\n catch (JMSException je) {\n // Something went wrong. Either handle it here or throw it on.\n throw je;\n }\n return factory;\n}\n"} +{"text": "### Human: My client connection is working withMQC.TRANSPORT_PROPERTY = MQC.TRANSPORT_MQSERIES_MANAGEDbut doesn't work with:MQC.TRANSPORT_PROPERTY = MQC.TRANSPORT_MQSERIES_CLIENTas I get this error:return MQRC_FUNCTION_NOT_SUPPORTED for MQC.TRANSPORT_MQSERIES_CLIENTI want to control commit and rollback so I decided to change the transport type, but it doesnt support it. Why would this be?I am using dll => amqmdnetstd.dll 9.1.2 at .netcore projectCode summaryHashtable connectionProperties = new Hashtable();\nconnectionProperties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);\nconnectionProperties.Add(MQC.PORT_PROPERTY, \"5577\");\nconnectionProperties.Add(MQC.HOST_NAME_PROPERTY, hostName);\nconnectionProperties.Add(MQC.CHANNEL_PROPERTY, channel);\n\nMQQueueManager qMgr = new MQQueueManager(qManager, connectionProperties);### Assistant: The IBM MQ classes for .NET Standard supportTRANSPORT_MQSERIES_MANAGEDMode only.See the IBM MQ Knowledge Center pageIBM MQ 9.1.x>IBM MQ>Developing applications>Developing .NET applications>Getting started with IBM MQ classes for .NET>Installing IBM MQ classes for .NET StandardIBM MQ classes for .NET Framework and IBM MQ classes for .NET Standard featuresThe following table lists the features applicable from IBM MQ Version 9.1.1 for IBM MQ classes for .NET Framework and IBM MQ classes for .NET Standard.Table 1. Differences between IBM MQ classes for .NET Framework and IBM MQ classes for .NET Standard featuresFeature | IBM MQ classes for .NET Framework | IBM MQ classes for .NET Standard\n----------------+-----------------------------------+----------------------------------\nTransport Modes | Managed, Unmanaged, and Bindings | ManagedIf you want to useTRANSPORT_MQSERIES_CLIENTMode you would need to switch toamqmdnet.dllwhich only works with .NET Framework and has been stabilized by IBM, see IBM MQ Knowledge Center pageIBM MQ 9.1.x>IBM MQ>Developing applications>Developing .NET applications>Writing and deploying IBM MQ .NET programs>Using the stand-alone IBM MQ .NET clientFrom IBM MQ Version 9.1.1, the amqmdnetstd.dll library is available for .NET Standard support on Windows (see Installing IBM MQ classes for .NET Standard.The amqmdnet.dll library is still supplied, but this library is stabilized; that is, no new features will be introduced into it.For any of the latest features you must migrate to the amqmdnetstd.dll library. However, you can continue to use the amqmdnet.dll library on IBM MQ Version 9.1 Long Term Support or Continuous Delivery releases.\n"} +{"text": "### Human: We have a IBM MQ Server 7.5 running on a Windows server machine. Till now we had an IBM MQ JMS client (written in groovy) on Windows for reading messages on a TCP channel.My problem now is we have to move the Client to a Debian machine.\nI have downloaded the IBM MQ Client 7 for Debian.I am writting a sample code to connect to the Server to read the messages.\nI am using theJmsPutGet.javaexample from the IBM site.The environment is as follows:Java 8com.ibm.mq.allclient-9.0.4.0.jarjavax.jms-api-2.0.1The error I get isThe value specified for the property is not supported.\nModify the value to be within the range of accepted values.\nFAILUREI tried using connection modeClientas well, it gives a different error as below:com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0018: Failed to connect to queue manager 'VIMSRRI10' with connection mode 'Client' and host name '172.18.21.5(1415)'.\nCheck the queue manager is started and if running in client mode, check there is a listener running. Please see the linked exception for more information.\nInner exception(s):\ncom.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2539' ('MQRC_CHANNEL_CONFIG_ERROR').\ncom.ibm.mq.jmqi.JmqiException: CC=2;RC=2539;AMQ9204: Connection to host '172.18.21.5(1415)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2539;AMQ9547: Type of remote channel not suitable for action requested. [3=IRRICI10.VIMSRRI10]],3=172.18.21.5(1415),5=RemoteConnection.analyseErrorSegment]\ncom.ibm.mq.jmqi.JmqiException: CC=2;RC=2539;AMQ9547: Type of remote channel not suitable for action requested. [3=IRRICI10.VIMSRRI10]\nFAILURESample java code is:JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\nJmsConnectionFactory cf = ff.createConnectionFactory();\n\n// Set the properties\ncf.setStringProperty(WMQConstants.WMQ_HOST_NAME, HOST);\ncf.setIntProperty(WMQConstants.WMQ_PORT, PORT);\ncf.setStringProperty(WMQConstants.WMQ_CHANNEL, CHANNEL);\ncf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_DIRECT_TCPIP);\ncf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, QMGR);\ncf.setStringProperty(WMQConstants.WMQ_APPLICATIONNAME, \"JmsPutGet (JMS)\");\n//cf.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, true);\n//cf.setStringProperty(WMQConstants.USERID, APP_USER);\n//cf.setStringProperty(WMQConstants.PASSWORD, APP_PASSWORD);\n\n// Create JMS objects\ncontext = cf.createContext();\nSystem.out.println(\"After Context\\n\");\ndestination = context.createQueue(\"queue:///\" + QUEUE_NAME);\nSystem.out.println(\"After Queue\\n\");\nlong uniqueNumber = System.currentTimeMillis() % 1000;\nTextMessage message = context.createTextMessage(\"Your lucky number today is \" + uniqueNumber);\n\nproducer = context.createProducer();\nproducer.send(destination, message);\nSystem.out.println(\"Sent message:\\n\" + message);\n\nconsumer = context.createConsumer(destination); // autoclosable\nString receivedMessage = consumer.receiveBody(String.class, 15000); // in ms or 15 seconds\n\nSystem.out.println(\"\\nReceived message:\\n\" + receivedMessage);### Assistant: The channel you connect to must be aSVRCONN.The errorreason '2539' ('MQRC_CHANNEL_CONFIG_ERROR')indicates that the channel you are connecting to is not aSVRCONN.This is spelled out clearer in the next line of the error which also provides the the name of the channel you are attempting to connect toIRRICI10.VIMSRRI10:AMQ9547: Type of remote channel not suitable for action requested. [3=IRRICI10.VIMSRRI10]The name of the channel itself is in a format common for aSDRorRCVRchannels which are used between two queue managers, not for a MQ client app to connect to.\n"} +{"text": "### Human: I'm trying to connect to a WebsphereMQ queue using .Net Core 2.2.\nI'm really confused on how to do this. I would like some clarification before showing what I'm trying (and failing):Which lib should I use and how to get it? (NMS? AMQP? WebsphereClient?)I have seen some examples that aparentlly use some DLL that comes when you install WebsphereMQ (???). Is that correct? Do I need to install WebsphereMQ? (right now I have it in a remote server which I can connect to the queue I need).What I have tried so far was installing theWebSphereMQClientand trying to connect to the queue with the following code:public void StartListener()\n {\n try\n {\n var xff = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\n var cf = xff.CreateConnectionFactory();\n cf.SetStringProperty(XMSC.WMQ_HOST_NAME, WebsphereMqHost);\n cf.SetIntProperty(XMSC.WMQ_PORT, WebsphereMqPort);\n cf.SetStringProperty(XMSC.WMQ_CHANNEL, WebsphereMqChannel);\n cf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, WebsphereMqQueueManager);\n cf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);\n\n var conn = cf.CreateConnection();\n var sess = conn.CreateSession(false, AcknowledgeMode.AutoAcknowledge);\n var queue = sess.CreateQueue(QueueName);\n var consumer = sess.CreateConsumer(queue);\n\n consumer.MessageListener = OnWebsphereMsg;\n\n conn.Start();\n }\n catch (Exception e)\n {\n _logger.LogError(e);\n }\n }But I get an exception on the first line:System.Exception: Fatal error. Failed to initialize XMSFactoryFactory ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'IBM.XMS.Client.Impl.XmsFactoryFactoryImpl' threw an exception. ---> System.TypeInitializationException: The type initializer for 'IBM.XMS.Util.Tr' threw an exception. ---> System.TypeInitializationException: The type initializer for 'IBM.XMS.Util.ConfigMgr' threw an exception. ---> System.MissingMethodException: Method not found: 'System.AppDomainSetup System.AppDomain.get_SetupInformation()'.\n at IBM.XMS.Util.ConfigMgr..cctor()\n --- End of inner exception stack trace ---\n at IBM.XMS.Util.Tr.ResolveTraceSpec()\n at IBM.XMS.Util.Tr.LoadTraceConfig()\n at IBM.XMS.Util.Tr..cctor()\n --- End of inner exception stack trace ---\n at IBM.XMS.Util.Tr.Register(Type aClass, String group, String resourceBundleName)\n at IBM.XMS.Client.Impl.XmsFactoryFactoryImpl..cctor()\n --- End of inner exception stack trace ---\n at IBM.XMS.Client.Impl.XmsFactoryFactoryImpl.GetClientFactory(Int32 connectionType)\n --- End of inner exception stack trace ---\n at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)\n at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\n at IBM.XMS.XMSFactoryFactory.GetXmsFactory(Int32 connectionType)\n --- End of inner exception stack trace ---\n at IBM.XMS.XMSFactoryFactory.GetXmsFactory(Int32 connectionType)\n at IBM.XMS.XMSFactoryFactory.GetInstance(Int32 connectionType)\n at MyApp.Integrations.Configurations.WebsphereMqIntegrationsManager.StartListener(ListenersEnum listener, Dictionary`2 parameters).I have notice that the WebsphereMqClient is not compliant with .NET Standard. Is this error caused because of it? How can I connect to Websphere with my .NET Core app?Thanks,### Assistant: amqmxmsstd.dll is the library that has to be used and it is available from MQ v9.1.1. Following is the infocenter link which talks about using XMS with Microsoft .NET Core.Using XMS with Microsoft .NET CoreYou would need both amqmdnetstd.dll and amqmxmsstd.dll for developing XMS .NET applications and both these dll's are built using .NET Standard.Following infocenter link talks about the framework used to build these libraries.Installing IBM MQ classes for .NET StandardAs Josh pointed out,you can use MQ Redist client to get libraries. \nDownload \"9.1.1.0-IBM-MQC-Redist-Win64\" fromIBM MQ Redist clients\n"} +{"text": "### Human: I want to access queue manager via mq explorer but getting an error:Could not establish a connection to the queue manager - reason 2538. (AMQ4059)\nCould not establish a connection to the queue manager - reason 2538. (AMQ4059)Severity: 10 (Warning)Explanation: The attempt to connect to the queue manager failed. This could be because the queue manager is incorrectly configured to allow a connection from this system, or the connection has been broken.Response: Try the operation again. If the error persists, examine the problem determination information to see if any information has been recorded.I followed all the instructions inhttps://www-01.ibm.com/support/docview.wss?uid=swg21623113in order to allow mq explorer to be able to access mq server but still no luck.IBM MQ Server details:Version: 8OS: CentosRunning in a docker containerUsing port 1417 since my 1414 port is not available for another MQ serverListener is up an running and pointing port 1417Channel is defined as it is described in the link that I shared (I disabled all security features as it is described)I have a sample Java App that I can put/get messages and it is working fineMQ Explorer details:Also running in another docker container thanks tohttps://github.com/ibm-messaging/mq-container/tree/master/incubating/mq-explorerI can telnet MQ Server from xterm so there is no issue about the connectivityAlthough I disabled all security features, I also tried to create the same username on server as well as my xterm but it did not work either.I was expecting to get an error message in my MQ Server to understand the issue but surprisingly there is no error message at all ...Screenshot### Assistant: You've stated that your queue manager(s) are running in a container and your MQ Explorer is running in another container. I've noticed you've supplied 0.0.0.0 as your hostname but the container where MQ Explorer is running has no queue managers running on it!If you run the following command (replacing with the ID of the container running your queue managers) you should get the IP address of the container on the docker subnet. Try using that IP address in MQ Explorer instead of 0.0.0.0:docker inspect --format \"{{ .NetworkSettings.IPAddress }}\" If your container is on a different docker network then you will need to run the following replacing with the name you gave the docker network:docker inspect --format \"{{ .NetworkSettings.Networks..IPAddress }}\" Additionally, when you created your queue manager container did you remember to expose the 1417 port you are trying to use? By default themq-containersample only exposes the following ports: 1414, 9157 & 9443. When you ran the container you would of needed to expose the ports but supplying--publish-all --publish 1417when you ran the container. For example:docker run -d -e LICENSE=accept --publish-all --publish 1417 ibmcom/mq\n"} +{"text": "### Human: Is it possible to setup an IBM MQ receiver channel to receive messages from two different queue managers with the sender channels named identically. I am looking at a situation where a client wishes to have two queue managers (A and B) able to send messages to the same destination queue manager (C). A and B are setup up in an active / passive cluster setup without shared storage.### Assistant: It is not only possible to set up IBM MQ Receiver channels to receive messages from two different queue managers, it is recommended to do so.For example, on QM3 (the receiving queue manager) make the following definition:DEFINE CHANNEL(TO.QM3) CHLTYPE(RCVR) TRPTYPE(TCP)Then on both QM1 and QM2 make the following definitions:DEFINE CHANNEL(TO.QM3) CHLTYPE(SDR) TRPTYPE(TCP) CONNAME('qm3-host-name(qm3-port)') XMITQ(QM3)\nDEFINE QLOCAL(QM3) USAGE(XMITQ)Doing this will NOT cause sequence number issues as the state for each running receiver channel instance is keyed off the channel name plus the partner queue manager name, so there will be state for:-Channel:TO.QM3 from Partner QMgr QM1Channel:TO.QM3 from Partner QMgr QM2Both channel instances can be running at the same time quite happily without interfering with each other.You can see this state by issuing the following command on the receiving queue manager, QM3:-DISPLAY CHSTATUS(TO.QM3)\n"} +{"text": "### Human: I have a C client to connect to IBM MQ, and I fillin the userid and password in MQCSP as following:MQCNO Connect_options = {MQCNO_DEFAULT};\n MQCSP csp = {MQCSP_DEFAULT};\n Connect_options.SecurityParmsPtr = &csp;\n Connect_options.Version = MQCNO_VERSION_5;\n\n csp.AuthenticationType = MQCSP_AUTH_USER_ID_AND_PWD;\n csp.CSPUserIdPtr = \"user2\";\n csp.CSPUserIdLength = strlen(\"user2\");\n csp.CSPPasswordPtr = \"password\";\n csp.CSPPasswordLength = strlen((char*)\"password\");and then call MQCONNX() to connect the MQ server, run the client with the user \"user1\", but the server always authenticate the user that running the application \"user1\".I setup the MQ server as following:ALTER QMGR CONNAUTH(SYSTEM.DEFAULT.AUTHINFO.IDPWOS)\nDEFINE AUTHINFO(SYSTEM.DEFAULT.AUTHINFO.IDPWOS) +\n AUTHTYPE(IDPWOS) +\n FAILDLAY(10) +\n CHCKLOCL(OPTIONAL) +\n CHCKCLNT(REQUIRED) +\n ADOPTCTX(YES) \nREFRESH SECURITY TYPE(CONNAUTH)\n\ndefine qlocal(HDPARLOCALQUEUE01) replace\n\ndefine channel(HDPARCHANNEL) +\n chltype(SVRCONN) +\n trptype(TCP) +\n MCAUSER(' ')\nalter channel(HDPARCHANNEL) +\n chltype(SVRCONN) +\n MCAUSER(' ')\nALTER QMGR CHLAUTH(DISABLED)How can I have the MQ server authenticate the user that provided in the MQCSP?I have add \"ChlauthEarlyAdopt=Y\" in qm.iniRegards,### Assistant: In order for the IBM MQ queue manager to use the ID you pass in the MQCSP structure for authorization purposes you need to have theQMGR CONNAUTH'sAUTHINFOobject configured withADOPTCTX(YES). In your example you are attempting to do this, but it would fail because the objectSYSTEM.DEFAULT.AUTHINFO.IDPWOSexists by default.If you want to update an existing object you can not useDEFINEto change it unless you accompany this with theREPLACEkeyword, or you can use theALTERcommand to accomplish this.I would also recommended to define your ownAUTHINFOobject with the parameters you want, this will prevent future upgrades from overwriting any non-default settings.For example:DEFINE AUTHINFO(MY.AUTHINFO.IDPWOS) AUTHTYPE(IDPWOS) CHCKLOCL(OPTIONAL) CHCKCLNT(REQUIRED) ADOPTCTX(YES) LIKE(SYSTEM.DEFAULT.AUTHINFO.IDPWOS)\nALTER QMGR CONNAUTH(MY.AUTHINFO.IDPWOS)\nREFRESH SECURITY TYPE(CONNAUTH)I also see you disabledCHLAUTH, normally the defaultCHLAUTHrules will not cause any problem, the would only prevent two things:You can not connect to any channel that begins withSYSTEM, you are not doing this.You can not connect as a MQ Admin user such asmqmor equivalent. I see your example showsuser2, if this is a user in themqmgroup then you would be blocked.@MoragHughson has written a nice IBM developerWorks MQdev Blog titled \"Getting going without turning off MQ Security\" that explains how to keep this security enabled and would be a good starting point.\n"} +{"text": "### Human: I need to produce queue message in WebSphere MQ message format. By default spring produced the message in JMS format. I have googled and came to know that WebSphere MQ Message format contains MQMD and RFH2 header. No idea how to generate these two from Spring.### Assistant: Where Tomcatcontext.xmlis theJNDI provider for MQ, I did it like this:Notice theTC=\"1\". And in Spring JMS I referenced the queue like this:destination-name=\"jms/myreqqueue\"\n"} +{"text": "### Human: i am trying to write a script that will - when passed an MQ queue name - indicate either 'end' of the queue i.e. who puts messages on and who takes them off.To establish the manual method of doing this (before I automate it) I picked a QLOCAL at random and using CA-Sysview, I used the MQROBJ screen to see that one of our CICS regions PUTs messages on the queue and our MQ CHIN started task GETs messages off the queue.But I can't see where the messages go. As this is a QLOCAL but it's the CHIN job taking messages off it, then I assume that some remote queue manager has this queue defined as a QREMOTE and is issuing GETs against the queue.We have access to normal z/OS MQ commands and CA-SysviewCan I establish the remote queue manager taking messages off the queue?### Assistant: In order to determine either end of the queue usage diagram, try the following command on your QLOCAL.DISPLAY CONN(*) TYPE(ALL) ALL WHERE(OBJNAME EQ local-q-name)and look for the following fields;APPLTYPE,APPLTAG,OPENOPTS,CHANNEL,CONNAMEYou can tell whether the application is a putter or a getter by looking at theOPENOPTSfield in the output. If it saysMQOO_OUTPUTthen it is a putter, and if it saysMQOO_INPUT_*then it is a getter.If the application has aCHANNELname filled in, then the connection that is using that queue came down a channel. You must go to the machine described by theCONNAMEand investigate further from there. You should be able to tell the difference between a client application and a sender/receiver channel by using the channel name.If you are tracking a path across a sender/receiver channel, then on the remote machine you must take a look at QREMOTE definitions. Try a command like the following:-DISPLAY QREMOTE(*) ALL WHERE(RNAME EQ local-q-name)\n"} +{"text": "### Human: I have my Java code compiled in jdk 1.6.I am using MQ jar files (From MQ version 8.0) in my project build path.My application server runs with jdk 1.6.MQ version 8.0 installed in the server.Now when I have deployed my application in the server, I am getting errors like :java.lang.UnsupportedClassVersionError\" and errors related to major\n version 50, 51 etc.I understand the concepts of the version here, but I am little confused as why in the runtime there is a version mismatch happening as in the classpath it is referring to the same JAR files as during the project build. Is it due to the fact that MQ jars has been compiled in 51 which is of a higher version than 50 ? Please advise what can be done here.### Assistant: To use the jar files that come with IBM MQ v8 and later you must be at Java 7 or later. IBM Documents that from MQ v8 and later that the IBM MQ classes for Java and JMS are built with Java 7. Oracle documents that classes built with Java 7 cannot be used with Java 6. See below for references:In the MQ v8.0 KC page:IBM MQ 8.0.0>IBM MQ>Product overview>What's changed in IBM MQ Version 8.0.0>Java: changes for Java 7The IBM MQ classes for Java and IBM MQ classes for JMS are now built\n with Java 7.The Java 7 runtime environment supports running earlier class file\n versions.In the MQ v9.0 KC page:IBM MQ 9.0.x>IBM MQ>Technical overview>IBM MQ Java language interfacesFrom IBM MQ Version 8.0, the IBM MQ classes for Java and IBM MQ classes for \n JMS are built with Java 7.The Java 7 runtime\n environment supports running earlier class file versions.Oracle documents that Java 7 class files cannot be used with Java 6 in the following page:Oracle Java SE 7 and JDK 7 Compatibility -> Binary Compatibilitystates the following:The class file version for Java SE 7 is 51, as per the JVM\n Specification, because of the invokedynamic byte code introduced by\n JSR 292.Version 51 class files produced by the Java SE 7 compiler\n cannot be used in Java SE 6.\n"} +{"text": "### Human: I am trying to deploy IBM MQ to my local MAC machine using an image hosted on docker hub repository. I am using docker edge version with Kubernetes support on it.I am able to deploy the image successfully using kubernetes and also have the Queue Manager running fine inside the container. I am also able to ssh into the container and make sure all the MQ processes are running as expected.But when I use port forwarding using the following kubectl command, it opens the port, but does not let me telnet to it using \"IP or hostname\" (even from the local machine). But when I use \"localhost\" to telnet it works fine.While troubleshooting, I deployed the same image using docker commands instead of kubernetes and with docker deployment, the port forwarding works as expected. It lets me telnet using IP, hostname and localhost.So, definitely its some issue with Kubernetes port forwarding. Can some one please let me know if I am missing anything here? Let me know if there is some additional information needed from my end.I am new to kubernetes and docker, but pretty familiar with IBM MQ.Commands being used:To create port forwarding rule using kubectl, checking netstat and connecting with telnet:HOSTNAME:Test2 an0s5v4$ sudo kubectl port-forward private-reg 1414:1414 &\n\n[1] 3001\n\n\nHOSTNAME:Test2 an0s5v4$ Forwarding from 127.0.0.1:1414 -> 1414\nForwarding from [::1]:1414 -> 1414\n\nHOSTNAME:Test2 an0s5v4$ netstat -an |grep 1414\ntcp6 0 0 ::1.1414 *.* LISTEN \ntcp4 0 0 127.0.0.1.1414 *.* LISTEN \n\nHOSTNAME:Test2 an0s5v4$ ps -ef|grep 1414\n 0 3001 920 0 10:27AM ttys006 0:00.03 sudo kubectl port-forward private-reg 1414:1414\n\n 0 3002 3001 0 10:27AM ttys006 0:00.18 kubectl port-forward private-reg 1414:1414\n 502 3007 920 0 10:28AM ttys006 0:00.00 grep 1414HOSTNAME:Test2 an0s5v4$ telnet IP 1414\n\nTrying IP...\n\ntelnet: Unable to connect to remote host: Connection refusedHOSTNAME:Test2 an0s5v4$ telnet localhost 1414\n\nTrying ::1...\n\nConnected to localhost.\n\nEscape character is '^]'.\n\nHandling connection for 1414L-RCC9048942:Test2 an0s5v4$ telnet HOSTNAME 1414\n\nTrying IP ...\n\ntelnet: Unable to connect to remote host: Connection refusedHOSTNAME:Test2 an0s5v4$ nslookup HOSTNAME\n\n;; Truncated, retrying in TCP mode.\n\nName: HOSTNAME\nAddress: IPKubernetes pod YAML file contentsapiVersion: v1\n\nkind: Pod\n\nmetadata: \n\n name: private-reg\n\n labels:\n\n app: ibmmq\n\nspec: \n\n containers: \n\n - \n\n env: \n\n - \n\n name: LICENSE\n\n value: accept\n\n - \n\n name: MQ_QMGR_NAME\n\n value: QM4\n\n image: \"image path in docker hub\"\n\n name: private-reg-container\n\n ports: \n\n - \n\n containerPort: 1414\n\n hostPort: 1414EDIT: ADDED K8S Service to the postKubernetes service YAML file contentsapiVersion: v1\nkind: Service\nmetadata:\n name: myservice-nodeport\n labels:\n app: ibmmq\nspec:\n ports:\n - port: 3000 \n targetPort: 1414\n nodePort: 31414\n selector:\n app: ibmmq\n type: NodePort### Assistant: If you need port forwarding to bind to all the network interfaces, you can give this option. This will be useful when working with servers in OpenShift etc where there are different local and floating IPs--address 0.0.0.0Examplekubectl port-forward minio-64b7c649f9-9xf5x --address 0.0.0.0 7000:9000 --namespace minio\n"} +{"text": "### Human: I have a string that is in the form of XML or any string for that matter and I am getting the BOM when it is written to MQ. I was trying to convert the string to ASCII in the C# application but it still showed in the message in MQ.\nI thought i could use the Encoding method in the MQMessage()MQQueueManager queueManager = new MQQueueManager();\nqueue = queueManager.AccessQueue(QueueName,\n MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING);\nmessage = strInputMsg;\nqueueMessage = new MQMessage();\nqueueMessage.WriteString(message);\nqueueMessage.Format = MQC.MQFMT_STRING;\nqueueMessage.Encoding = MQC.MQENC_NATIVE;\n\nqueuePutMessageOptions = new MQPutMessageOptions();\n\nqueue.Put(queueMessage, queuePutMessageOptions);I am not sure what the value for the queueMessage.Encoding line should be.another question will the Encoding to ASCII remove the Bit Object Mark(BOM)?### Assistant: If you look here:https://www.ibm.com/support/knowledgecenter/SSFKSJ_9.0.0/com.ibm.mq.ref.dev.doc/q111220_.htmReadString, ReadLine and WriteString methods convert between Unicode\n and the character set of the message; see CharacterSetandThe WriteString method converts from Unicode to the character set\n encoded in CharacterSet. If CharacterSet is set to its default value,\n MQC.MQCCSI_Q_MGR, which is 0, no conversion takes place and\n CharacterSet is set to 1200. If you set CharacterSet to some other\n value, WriteString converts from Unicode to the alternate value.So in effect before you call WriteString, you have a unicode string in .NET. The WriteString method converts from that unicode into the CCSID indicated by the CharacterSet property, which defaults to unicode and gives you the funny 2 byte prefix of the byte order mark (BOM). If you set this to e.g. 850, then it will convert from unicode to a single byte ASCII output as you want.\n"} +{"text": "### Human: I am using IBM WebSphere MQ 8.0 version.I have configured one of my channels with \"TLS_RSA_WITH_AES_256_CBC_SHA256\" Cipher Spec encryption along with valid certificates installed and mapped to key store path correctly.My .NET client code is not able to connect with this secured channel. It gives 2538 error continuously.\nI have another channel configured without encryption (unsecured). The client code can connect to this channel without any errors.This is my .NET client code:Hashtable queueProperties = new Hashtable();\n queueProperties[MQC.HOST_NAME_PROPERTY] = host; // IP address\n queueProperties[MQC.PORT_PROPERTY] = 1541\n queueProperties[MQC.CHANNEL_PROPERTY] = channel; // channel name\n queueProperties[MQC.TRANSPORT_PROPERTY] = MQC.TRANSPORT_MQSERIES_MANAGED;\n queueProperties[MQC.SSL_CERT_STORE_PROPERTY] = \"*USER\";\n queueProperties[MQC.SSL_CIPHER_SPEC_PROPERTY] = \"TLS_RSA_WITH_AES_256_CBC_SHA256\";\n queueProperties[MQC.SSL_PEER_NAME_PROPERTY] = \"CN=FXCMTST1,O=IBM,C=US\";\n queueProperties[\"CertificateLabel\"] = \"ibmwebspheremqfxcmtst1\";\n queueProperties[MQC.KEY_RESET_COUNT] = 0;\n MQEnvironment.SSLCertRevocationCheck = true;\n queueProperties[MQC.USER_ID_PROPERTY] = user; // variable\n queueProperties[MQC.PASSWORD_PROPERTY] = pwd; // variable\n try\n {\n // Attempt the connection\n queueManager = new MQQueueManager(qmgr, queueProperties);\n strReturn = \"Connected Successfully\";\n }I have also set the MCA User to the valid user with all required access rights.The above code works fine for the unsecured channel when I remove these lines and replace the channel name with that of unsecured one.queueProperties[MQC.TRANSPORT_PROPERTY] = MQC.TRANSPORT_MQSERIES_MANAGED;\n queueProperties[MQC.SSL_CERT_STORE_PROPERTY] = \"*USER\";\n queueProperties[MQC.SSL_CIPHER_SPEC_PROPERTY] = \"TLS_RSA_WITH_AES_256_CBC_SHA256\";\n queueProperties[MQC.SSL_PEER_NAME_PROPERTY] = \"CN=FXCMTST1,O=IBM,C=US\";\n queueProperties[\"CertificateLabel\"] = \"ibmwebspheremqfxcmtst1\";\n queueProperties[MQC.KEY_RESET_COUNT] = 0;\n MQEnvironment.SSLCertRevocationCheck = true;Am I missing anything in the code or MQ configuration?UPDATE 1:\nI found that the error was due to incorrect path to key database. I had mentioned the path till folder name where the certificates were placed. However it was expected to be the folder name followed by the name of kdb file without extention.After doing this change, the 2538 error is gone. But now I am getting 2059 error with below error message in log.\"The CipherSpec negotiated during the SSL handshake does not match the required CipherSpec for channel...\"My Channel is configured to have\"TLS_RSA_WITH_AES_256_CBC_SHA256\" as I have set in the MQ Explorer. The client code is also sending the same cipher spec. Still it gives 2059 error.UPDATE 2: As suggested by @JoshMc, I set the group policy and it resolved above error. Then I started getting error \"Channel is lacking certificate\".UPDATE 3: This error is gone after I changed the SSLCAUTH to OPTIONAL. Earlier it was set to REQUIRED. Thanks to @JoshMc for pointing out.### Assistant: Originally in your question you had the following line of code:queueProperties[MQC.SSL_PEER_NAME_PROPERTY] = \"ibmwebspheremqtestqueue\";I advised: TheSSL_PEER_NAME_PROPERTYis meant to validate a portion or all of the DN value of the queue manager cert, so it would be in a format likeCN=x.domain.com,OU=Y,O=Company Inc, what you have looks like a cert label.Can you see what errors are generated if any on the queue managers AMQERR01.LOG? What about in the local client AMQERR01.LOG?You responded with an error from the queue manager:AMQ9660: SSL key repository: password stash file absent or unusable.And you found the error per your update:UPDATE: I found that the error was due to incorrect path to key database. I had mentioned the path till folder name where the certificates were placed. However it was expected to be the folder name followed by the name of kdb file without extention.Now you moved on to getting the following error:The CipherSpec negotiated during the SSL handshake does not match the required CipherSpec for channel...I advised: Managed .net does not use the cipher you specify it is picked up from a Windows policy. This question and answer should help \"IBM MQ.Net CertificateLabel, CipherSpec\".You advised you fixed the group policy and then moved on to getting the following error when you setSSLCAUTH(REQUIRED)on theSVRCONNchannel:channel is lacking a certificateSSLCAUTH(REQUIRED)tells the queue manager that you are requiring the client to have a certificate. The client will always require the queue manager to have a certificate no matter whatSSLCAUTHis set to.Assuming you have the queue manager configured to performCONNAUTHto validate the user and password you are sending and you have setADOPTCTX(YES)on theCONNAUTH'sAUTHINFOobject, then havingSSLCAUTH(OPTIONAL)is a reasonable setting as this means all the data between the client and queue manager will be encrypted and the connection is authenticated by the id/pw. Even if you haveSSLCAUTH(REQUIRED), unless you also configure theSVRCONNto match on a specificDNvalue via either the channel'sSSLPEERproperty or aCHLAUTH TYPE(SSLPEERMAP)rule'sSSLPEERproperty it is not providing any form of authentication.\n"} +{"text": "### Human: I have used following method to create a durable subscription as mentionedhere,public MQTopic accessTopic(java.lang.String topicName,\n java.lang.String topicObject,\n int options,\n java.lang.String altUserId,\n java.lang.String subscriptionName)\n throws MQExceptionThe documentation states thatsubscriptionName - This field is only required if the options parameter specified CMQC.MQSO_DURABLE, but if provided will be used by the queue manager for CMQC.MQSO_NON_DURABLE as well.So I created the topic as follows.qmanager.accessTopic(\"TOPICSTR\",\n \"TOPICNAME\",\n CMQC.MQSO_DURABLE,\n null,\n \"subscription\")But this raise the exception 2046(07FE)(RC2046): MQRC_OPTIONS_ERROR.Any idea on how to solve this and initialize the topic for a durable subscription using IBM MQ java classes?### Assistant: First, a word of warning about IBM MQ documentation:public MQTopic accessTopic(java.lang.String topicName,\n java.lang.String topicObject,\n int options,\n java.lang.String altUserId,\n java.lang.String subscriptionName)\n throws MQExceptionI have been trying to get IBM to update their MQ documentation but they are slow as molasses. The problem is that whoever wrote the Java code for the MQTopic used the wrong field names for the variables. Hence, when they generate the Java Docs from the Java code, the error is peculated.The CORRECT definition is:public MQTopic accessTopic(java.lang.String topicString,\n java.lang.String topicObject, /* aka topic name */\n int options,\n java.lang.String altUserId,\n java.lang.String subscriptionName)\n throws MQExceptionThe first field is 'topic string' not 'topic name'. See David Ware of IBM blog posting describing 'topic string', 'topic name' and 'topic object'.https://www.ibm.com/developerworks/community/blogs/messaging/entry/mq_topics_but_which_type?lang=enNext, you should be including the fail if quiescing flag: CMQC.MQSO_FAIL_IF_QUIESCINGI typically open a topic with non-durable:int openOptions = CMQC.MQSO_CREATE | CMQC.MQSO_FAIL_IF_QUIESCING | CMQC.MQSO_MANAGED | CMQC.MQSO_NON_DURABLE;\n\nMQTopic subscriber = qMgr.accessTopic( topicString,\n null,\n CMQC.MQTOPIC_OPEN_AS_SUBSCRIPTION,\n openOptions);\n"} +{"text": "### Human: Given the following local setup:IBM WebSphere MQ Advanced for Developers V8.0Payara 4.1.2.172I'd like to connect to the local queue manager via JMS on other than the default port (1414).In spite I added several properties to the connection factory to configure port 1415, it seems that the server is still trying to connect via port 1414, as Payara constantly throwsjava.net.ConnectException.The relevant part of my domain.xml:\n \n \n \n \n \n \n \n \n \n However the exception inserver.logsuggests that the resource adapter still wants to connect via port 1414:[2017-08-20T12:41:47.366+0200] [Payara 4.1] [SEVERE] [] [javax.enterprise.system.core] [tid: _ThreadID=63 _ThreadName=AutoDeployer] [timeMillis: 1503225707366] [levelValue: 1000] [[\n Exception while loading the app : EJB Container initialization error\n java.lang.Exception\n at com.sun.enterprise.connectors.inbound.ConnectorMessageBeanClient.setup(ConnectorMessageBeanClient.java:215)\n at org.glassfish.ejb.mdb.MessageBeanContainer.(MessageBeanContainer.java:244)\n at org.glassfish.ejb.mdb.MessageBeanContainerFactory.createContainer(MessageBeanContainerFactory.java:63)\n at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:224)\n at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:290)\n at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:100)\n at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:206)\n at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:314)\n at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)\n at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:220)\n at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:487)\n at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:539)\n at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535)\n at java.security.AccessController.doPrivileged(Native Method)\n at javax.security.auth.Subject.doAs(Subject.java:360)\n at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:534)\n at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565)\n at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557)\n at java.security.AccessController.doPrivileged(Native Method)\n at javax.security.auth.Subject.doAs(Subject.java:360)\n at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556)\n at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464)\n at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109)\n at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846)\n at org.glassfish.deployment.autodeploy.AutoOperation.run(AutoOperation.java:164)\n at org.glassfish.deployment.autodeploy.AutoDeployer.deploy(AutoDeployer.java:597)\n at org.glassfish.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer.java:484)\n at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:412)\n at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:403)\n at org.glassfish.deployment.autodeploy.AutoDeployService$1.run(AutoDeployService.java:233)\n at java.util.TimerThread.mainLoop(Timer.java:555)\n at java.util.TimerThread.run(Timer.java:505)\n Caused by: com.ibm.mq.connector.DetailedResourceAdapterInternalException: MQJCA1011: Failed to allocate a JMS connection., error code: MQJCA1011 An internal error caused an attempt to allocate a connection to fail. See the linked exception for details of the failure.\n at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:174)\n at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:135)\n at com.ibm.mq.connector.inbound.ConnectionHandler.allocateConnection(ConnectionHandler.java:393)\n at com.ibm.mq.connector.inbound.MessageEndpointDeployment.acquireConnection(MessageEndpointDeployment.java:288)\n at com.ibm.mq.connector.inbound.MessageEndpointDeployment.(MessageEndpointDeployment.java:228)\n at com.ibm.mq.connector.ResourceAdapterImpl.endpointActivation(ResourceAdapterImpl.java:531)\n at com.sun.enterprise.connectors.inbound.ConnectorMessageBeanClient.setup(ConnectorMessageBeanClient.java:207)\n ... 31 more\n Caused by: com.ibm.msg.client.jms.DetailedIllegalStateException: JMSWMQ0018: Failed to connect to queue manager '' with connection mode 'Client' and host name 'localhost(1414)'.\n Check the queue manager is started and if running in client mode, check there is a listener running. Please see the linked exception for more information.\n at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:489)\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:215)\n at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:413)\n at com.ibm.msg.client.wmq.internal.WMQXAConnection.(WMQXAConnection.java:67)\n at com.ibm.msg.client.wmq.factories.WMQXAConnectionFactory.createV7ProviderConnection(WMQXAConnectionFactory.java:188)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:7814)\n at com.ibm.msg.client.wmq.factories.WMQXAConnectionFactory.createProviderXAConnection(WMQXAConnectionFactory.java:98)\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createXAConnectionInternal(JmsConnectionFactoryImpl.java:347)\n at com.ibm.mq.jms.MQXAConnectionFactory.createXAConnection(MQXAConnectionFactory.java:131)\n at com.ibm.mq.connector.inbound.ConnectionHandler.allocateConnection(ConnectionHandler.java:268)\n ... 35 more\n Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2538' ('MQRC_HOST_NOT_AVAILABLE').\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:203)\n ... 43 more\n Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2538;AMQ9204: Connection to host 'localhost(1414)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2538;AMQ9213: A communications error for 'TCP' occurred. [1=java.net.ConnectException[Connection refused (Connection refused)],3=connnectUsingLocalAddress,4=TCP,5=Socket.connect]],3=localhost(1414),5=RemoteTCPConnection.connnectUsingLocalAddress]\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:2282)\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1294)\n at com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.jmqiConnect(InterceptedJmqiImpl.java:376)\n at com.ibm.mq.ese.jmqi.ESEJMQI.jmqiConnect(ESEJMQI.java:560)\n at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:346)\n ... 42 more\n Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2538;AMQ9213: A communications error for 'TCP' occurred. [1=java.net.ConnectException[Connection refused (Connection refused)],3=connnectUsingLocalAddress,4=TCP,5=Socket.connect]\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.connnectUsingLocalAddress(RemoteTCPConnection.java:838)\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:1277)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnection.connect(RemoteConnection.java:863)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSessionFromNewConnection(RemoteConnectionSpecification.java:409)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSession(RemoteConnectionSpecification.java:305)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionPool.getSession(RemoteConnectionPool.java:146)\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1730)\n ... 46 more\n Caused by: java.net.ConnectException: Connection refused (Connection refused)\n at java.net.PlainSocketImpl.socketConnect(Native Method)\n at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)\n at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)\n at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)\n at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)\n at java.net.Socket.connect(Socket.java:589)\n at java.net.Socket.connect(Socket.java:538)\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection$5.run(RemoteTCPConnection.java:823)\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection$5.run(RemoteTCPConnection.java:814)\n at java.security.AccessController.doPrivileged(Native Method)\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.connnectUsingLocalAddress(RemoteTCPConnection.java:814)\n ... 52 more\n ]]I'm out of ideas why the exception says:JMSWMQ0018: Failed to connect to queue manager '' with connection mode 'Client' and host name 'localhost(1414)'.Question 1: Why is queue manager '' (empty)?Question 2: Why is host name 'localhost(1414)'?Any help would be very much appreciated!### Assistant: In reviewing the IBM MQ v8 Knowledge Center page \"Installing and testing the resource adapter in GlassFish Server\" it appears you have the wrong property name for the host name and queue manager. Try the following config. Checkout the documentation link above to make sure you have installed the RA and the other steps.\n\n \n \n \n \n \n\n"} +{"text": "### Human: In a spring JMS project, I try to connect to an IBM MQ QUEUE placed in the same place where the spring client is.\nWhen the application tries to connect to the MQ server I got the following error:INFO - Could not refresh JMS Connection for destination 'TI.UNIT1.TRAN.IN' - retrying in 5000 ms. Cause: JMSWMQ2013: L'authentification de la s\u00e9curit\u00e9 fournie pour le gestionnaire de files d'attente 'QM_TEST' \u00e0 l'aide du mode de connexion 'Client' et du nom d'h\u00f4te 'localhost' n'\u00e9tait pas valide.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: L'appel WebSphere MQ a \u00e9chou\u00e9 avec le code ach\u00e8vement '2' ('MQCC_FAILED') ; motif '2035' ('MQRC_NOT_AUTHORIZED').\ncom.ibm.msg.client.jms.DetailedJMSSecurityException: JMSWMQ2013: L'authentification de la s\u00e9curit\u00e9 fournie pour le gestionnaire de files d'attente 'QM_TEST' \u00e0 l'aide du mode de connexion 'Client' et du nom d'h\u00f4te 'localhost' n'\u00e9tait pas valide. V\u00e9rifiez si le nom dutilisateur et le mot de passe fournis sont corrects dans le gestionnaire de files dattente auquel vous vous connectez\n at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:531)\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:219)\n at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:410)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:7855)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:7441)\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:276)\n at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6055)\n at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:115)\n at org.springframework.jms.listener.DefaultMessageListenerContainer102.createConnection(DefaultMessageListenerContainer102.java:71)\n at org.springframework.jms.listener.AbstractJmsListeningContainer.createSharedConnection(AbstractJmsListeningContainer.java:378)\n at org.springframework.jms.listener.AbstractJmsListeningContainer.refreshSharedConnection(AbstractJmsListeningContainer.java:363)\n at org.springframework.jms.listener.DefaultMessageListenerContainer.refreshConnectionUntilSuccessful(DefaultMessageListenerContainer.java:785)\n at org.springframework.jms.listener.DefaultMessageListenerContainer.recoverAfterListenerSetupFailure(DefaultMessageListenerContainer.java:767)\n at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:898)\n at java.lang.Thread.run(Thread.java:744)\nCaused by: com.ibm.mq.MQException: JMSCMQ0001: L'appel WebSphere MQ a \u00e9chou\u00e9 avec le code ach\u00e8vement '2' ('MQCC_FAILED') ; motif '2035' ('MQRC_NOT_AUTHORIZED').\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:206)IBM MQ Server (Windows 64bits) version = 8.0.0.4Spring JMS application(jars) version = 7.0Log file (AMQERR01.LOG) content :----- cmqxrsrv.c : 2321 -------------------------------------------------------\n17/02/2017 01:40:20 - Process(6472.10) User(John) Program(amqzlaa0.exe)\n Host(MyMachine) Installation(Installation1)\n VRMF(8.0.0.4) QMgr(QM_TEST)\n\nAMQ5540: L'application 'WebSphere MQ Client for Java' n'a pas fourni d'ID\nutilisateur et de mot de passe\n\nEXPLICATION :\nLe gestionnaire de files d'attente est configur\u00e9 pour n\u00e9cessiter un ID\nutilisateur et un mot de passe, mais ni l'un ni l'autre n'a \u00e9t\u00e9 fourni.\nACTION :\nAssurez-vous que l'application fournit un ID utilisateur et un mot de passe\nvalides ou sp\u00e9cifiez FACULTATIF pour la configuration du gestionnaire de files\nd'attente afin de permettre aux applications n'ayant pas fourni d'ID\nutilisateur et de mot de passe de se connecter. \n----- amqzfuca.c : 4287 -------------------------------------------------------\n17/02/2017 01:40:20 - Process(6472.10) User(John) Program(amqzlaa0.exe)\n Host(MyMachine) Installation(Installation1)\n VRMF(8.0.0.4) QMgr(QM_TEST)\n\nAMQ5541: L'\u00e9chec de la v\u00e9rification de l'authentification a \u00e9t\u00e9 provoqu\u00e9 par la\nconfiguration CONNAUTH CHCKCLNT(REQDADM) du gestionnaire de files d'attente.\n\nEXPLICATION :\nL'ID utilisateur 'john' et son mot de passe ont \u00e9t\u00e9 v\u00e9rifi\u00e9s car l'ID\nutilisateur est privil\u00e9gi\u00e9 et la configuration de l'autorit\u00e9 de connexion du\ngestionnaire de files d'attente (CONNAUTH) fait r\u00e9f\u00e9rence \u00e0 un objet\nd'informations d'authentification (AUTHINFO) nomm\u00e9\n'SYSTEM.DEFAULT.AUTHINFO.IDPWOS' avec CHCKCLNT(REQDADM). \n\nCe message accompagne une erreur pr\u00e9c\u00e9dente pour expliquer la raison de la\nv\u00e9rification de l'ID utilisateur et du mot de passe.\nACTION :\nPour plus d'informations, reportez-vous \u00e0 l'erreur pr\u00e9c\u00e9dente. \n\nV\u00e9rifiez que l'application client sp\u00e9cifie un mot de passe et que le mot de\npasse est correct pour l'ID utilisateur. La configuration de l'authentification\nde la connexion du gestionnaire de files d'attente d\u00e9termine le r\u00e9f\u00e9rentiel\nd'ID utilisateur. Par exemple, la base de donn\u00e9es utilisateur du syst\u00e8me\nd'exploitation local ou un serveur LDAP. \n\nPour \u00e9viter la v\u00e9rification de l'authentification, vous pouvez utiliser un ID\nutilisateur non privil\u00e9gi\u00e9 ou changer la configuration d'authentification du\ngestionnaire de files d'attente. Vous pouvez modifier l'attribut CHCKCLNT dans\nl'enregistrement CHLAUTH, mais vous devez \u00e9viter d'autoriser l'acc\u00e8s distant\nnon authentifi\u00e9. \n-------------------------------------------------------------------------------\n17/02/2017 01:40:21 - Process(11528.7) User(John) Program(amqrmppa.exe)\n Host(MyMachine) Installation(Installation1)\n VRMF(8.0.0.4) QMgr(QM_TEST)\n\nAMQ9557: Echec de l'initialisation de l'ID utilisateur du gestionnaire de files\nd'attente pour 'John'.\n\nEXPLICATION :\nL'appel d'initialisation de l'ID utilisateur 'John' a \u00e9chou\u00e9 avec le code\nach\u00e8vement 2 et le code anomalie 2035.\nACTION :\nCorrigez l'erreur et relancez l'op\u00e9ration. \n----- cmqxrsrv.c : 2321 -------------------------------------------------------\n17/02/2017 01:40:21 - Process(11528.7) User(John) Program(amqrmppa.exe)\n Host(MyMachine) Installation(Installation1)\n VRMF(8.0.0.4) QMgr(QM_TEST)\n\nAMQ9206: Erreur lors de l'envoi de donn\u00e9es \u00e0 l'h\u00f4te MyMachine (127.0.0.1).\n\nEXPLICATION :\nUne erreur s'est produite lors de l'envoi de donn\u00e9es \u00e0 'MyMachine (127.0.0.1)'\nvia TCP/IP. Un incident de communications en est peut-\u00eatre la cause.\nACTION :\nLe code retour provenant de l'appel TCP/IP(send) \u00e9tait 10054 X('2746'). Notez\nces valeurs et informez-en votre administrateur syst\u00e8me. \n----- amqccita.c : 3169 -------------------------------------------------------\n17/02/2017 01:40:21 - Process(11528.7) User(John) Program(amqrmppa.exe)\n Host(MyMachine) Installation(Installation1)\n VRMF(8.0.0.4) QMgr(QM_TEST)\n\nAMQ9999: Le canal 'SYSTEM.ADMIN.SVRCONN' vers l'h\u00f4te '127.0.0.1' s'est termin\u00e9\nanormalement.\n\nEXPLICATION :\nLe programme du canl s'ex\u00e9cutant sous l'ID processus 11528(876) pour le canal\n'SYSTEM.ADMIN.SVRCONN' a pris fin anormalement. Le canal est '127.0.0.1'. Dans\ncertains cas, son nom ne peut pas \u00eatre d\u00e9termin\u00e9 et il est repr\u00e9sent\u00e9 par\n'????'.\nACTION :\nExaminez les messages d'erreur pr\u00e9c\u00e9dents du programme de canal dans les\njournaux des erreurs afin de d\u00e9terminer la cause de l'incident. Notez que ce\nmessage peut \u00eatre totalement exclus ou supprim\u00e9 en r\u00e9glant les attributs\n\"ExcludeMessage\" ou \"SuppressMessage\" sous la strophe \"QMErrorLog\" dans le\nfichier qm.ini. D'autres informations figurent dans le guide d'administration\ndu syst\u00e8me. \n----- amqrmrsa.c : 930 --------------------------------------------------------### Assistant: In MQ v8.0 IBM introducedCONNAUTHwhich by default points to aAUTHINFOobjectSYSTEM.DEFAULT.AUTHINFO.IDPWOS. This object by default has theCHCKCLNTattribute set toREQDADM.REQDADMmeans that any user connecting to aSVRCONNchannel that has MQ administrative authority must provide a valid password. This would be a user that for example is in the mqm group.Below is what the error you received in theAMQERR01.LOGlooks like in english:AMQ5541: The failed authentication check was caused by the queue manager\nCONNAUTH CHCKCLNT(REQDADM) configuration.\nEXPLANATION: The user ID 'john' and its password were checked because the\nuser ID is privileged and the queue manager connection authority (CONNAUTH)\nconfiguration refers to an authentication information (AUTHINFO) object\nnamed 'SYSTEM.DEFAULT.AUTHINFO.IDPWOS' with CHCKCLNT(REQDADM). This message\naccompanies a previous error to clarify the reason for the user ID and\npassword check.With your spring config you should be able to pass a username and password to MQ to authenticate. By default theSYSTEM.DEFAULT.AUTHINFO.IDPWOSobject will be set to check the password against the operating system.If your application does not require MQ administrative authority it would be advised to use a userid that does not have MQ administrative authority and grant that user the specific OAM permissions that it needs to access the queue manager and queues required.MQ v7.0 JMS jar files can send a username and password but they are limited to 12 characters each, the password is also sent in the clear over the network between the client and queue manager. MQ v8.0 and later can send username and password that are longer than 12 characters and also take advantage of password protection which encrypts the password with 3DES while being sent over the network if you turn off MQ compatibility mode. Also note that MQ v7.0 has been out of support from IBM since September 30th 2015.@MoragHughson has written a nice IBM developerWorks MQdev Blog titled \"Getting going without turning off MQ Security\" that explains how to keep this security enabled and would be a good starting point. I would suggest that if you have any further specific questions about CONNAUTH, OAM, or Spring configurations to send username and password that you post additional specific questions and tag them with [ibm-mq] along with any other tags that are appropriate like [spring], etc.\n"} +{"text": "### Human: I have wriiten startMQ method to process message from websphere message queue. Below is my code snippet.void startMQ(){\n\n try { \n // getting connection\n // getting session\n // getting queue\n\n for(; ;){\n // Processing every messages from queue\n }\n } catch (Exception e){\n\n } finally {\n // closing queue\n // closing session\n // closing connection\n }\n}\n\npublic static void main(String arg[]){\n Listener l = new Listener();\n l.startMQ(); \n}From bat file i will call main method to start message queue.if i want to stop this. How to acheive this. i thought in many ways but cannot able to implement it. Please help.### Assistant: After the queue is empty, the program will get an exception withRC=2033which means \"No Message Available.\" As it falls out of theCatchblock and into theFinallyblock it should hit the close queue, close session, close connection. That should do it, yeah? You may be over-thinking this one.\n"} +{"text": "### Human: Can you please help me, I am trying to find the ibm mq depth with PCFAgent over SSL channel.Security.setProperty(\"ssl.SocketFactory.provider\", \"com.ibm.jsse2.SSLSocketFactoryImpl\");\n Security.setProperty(\"ssl.ServerSocketFactory.provider\", \"com.ibm.jsse2.SSLServerSocketFactoryImpl\");\n System.setProperty(\"javax.net.ssl.trustStore\",\"abc-dev.jks\");\n System.setProperty(\"javax.net.ssl.trustStorePassword\",\"abcdabcd\");\n\n System.setProperty(\"javax.net.ssl.keyStore\", \"abc-dev.jks\");\n System.setProperty(\"javax.net.ssl.keyStorePassword\", \"abcdabcd\");\n\n MQEnvironment.sslCipherSuite = \"TLS_RSA_WITH_AES_128_CBC_SHA\";\n\n\n\n int attrs[] = { 2016, 3 };\n System.out.println(\"parameter creation\");\n PCFParameter parameters[] = { new MQCFST(2016, \"*\"), new MQCFIN(20, 1),\n new MQCFIL(1002, attrs) };\n String name = null;\n Integer depth = null;\n System.out.println(\"parameter creation end\");\n\n\n\n try {\n PCFAgent agent;\n if (args.length == 1) {\n System.out.print(\"Connecting to local queue manager \" + args[0]\n + \"... \");\n agent = new PCFAgent(args[0]);\n } else {\n System.out.print(\"Connecting to queue manager at \" + args[0]\n + \":\" + args[1] + \" over channel \" + args[2] + \"... \");\n agent = new PCFAgent(args[0], Integer.parseInt(args[1]),\n args[2]);\n }\n System.out.println(\"Connected.\");\n System.out.print(\"Sending PCF request... \");\n com.ibm.mq.MQMessage responses[] = agent.send(13, parameters);\n System.out.println(\"Received reply.\");\n for (int i = 0; i < responses.length; i++) {\n MQCFH cfh = new MQCFH(responses[i]);\n if (cfh.reason == 0) {\n for (int j = 0; j < cfh.parameterCount; j++) {\n PCFParameter p = PCFParameter\n .nextParameter(responses[i]);\n switch (p.getParameter()) {\n case 2016:\n name = (String) p.getValue();\n break;\n\n case 3: // '\\003'\n depth = (Integer) p.getValue();\n break;\n }\n }\n\n System.out.println(\"Queue \" + name + \" curdepth \" + depth);\n } else {\n System.out.println(\"PCF error:\\n\" + cfh);\n for (int j = 0; j < cfh.parameterCount; j++)\n System.out.println(PCFParameter\n .nextParameter(responses[0]));\n\n }\n }\n\n System.out.print(\"Disconnecting... \");\n agent.disconnect();\n System.out.println(\"Done.\");\n } catch (ArrayIndexOutOfBoundsException abe) {\n System.out\n .println(\"Usage: \\n\\tjava ListQueueDepth queue-manager\\n\\tjava ListQueueDepth host port channel\");\n } catch (NumberFormatException nfe) {\n System.out.println(\"Invalid port: \" + args[1]);\n System.out\n .println(\"Usage: \\n\\tjava ListQueueDepth queue-manager\\n\\tjava ListQueueDepth host port channel\");\n } catch (MQException mqe) {\n System.err.println(mqe);\n } catch (IOException ioe) {\n System.err.println(ioe);\n }When I try run this program remotely, I am getting the following exception:com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2035EDIT to add additional clarifying details from the comments:The MQ Admin found an error in theAMQERR01.LOGrelated to the SYSTEM.DEFAULT.MODEL.QUEUE at the same time the application receives the 2035.The same program works for a non-SSL channel when I take off the security settings and ciphersuite.### Assistant: Well, I don't see where you set a UserID in the code. Therefore, you are sending a blank UserID which if the channel's MCAUSER is blank means, it becomes 'mqm' UserID because of an old security hole.For MQ v7.1 or higher, the default CHLAUTH rule will block the connection if you are on a 'SYSTEM' channel. Or for MQ v8.0 or higher, the channel may require a UserID and Password. You need to look at either the event queue or queue manager logs for the reason for the RC of 2035 (not authorized).int attrs[] = { 2016, 3 };\nPCFParameter parameters[] = { new MQCFST(2016, \"*\"),\n new MQCFIN(20, 1),\n new MQCFIL(1002, attrs) };Also, what is with the hard-coded values? Did you decompile someone else's program?Why aren't you using the IBM MQ supplied defines? Here's what it should look like:int[] attrs = {\n CMQC.MQCA_Q_NAME,\n CMQC.MQIA_CURRENT_Q_DEPTH\n };\nPCFParameter[] parameters = {\n new MQCFST (CMQC.MQCA_Q_NAME, \"*\"),\n new MQCFIN (CMQC.MQIA_Q_TYPE, CMQC.MQQT_LOCAL),\n new MQCFIL (CMQCFC.MQIACF_Q_ATTRS, attrs)\n };\n"} +{"text": "### Human: When I try to send the JMS message to the external queue \nIt is failing with below errorerror occured while sending the message :JMSWMQ2008: Failed to open MQ queue 'TESTQUEUE'.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2082' ('MQRC_UNKNOWN_ALIAS_BASE_Q').Jms Template declaration\n \n \n \n \n\n\n \n \n \n\nthis.jmsTemplate.convertAndSend(getDestinationBean(\"testQueue\"),\n message.getJson());but if I use dynamic destination resolver with jmsTemplate, I could send the messagethis.jmsTemplate.convertAndSend(\"TESTQUEUE\",\n message.getJson());### Assistant: In this situation when one program works and one does not the difference is that the two programs have resolved to different queue names. To figure out what's wrong requires understanding of how the names are resolved. There are two possibilities for which2082: MQRC_UNKNOWN_ALIAS_BASE_Qresults:The alias queue'sTARGQattribute points to a non-existent queue.The alias queue refers to a non-local clustered queue.In the first case an alias queue is defined over a local queue but the definition is defective in some way. Often it is because the local queue name is misspelled. The result is thatTARGQhas nothing local to which it can resolve. This is easy enough to diagnose by simple inspection or by usingamqsputor any other sample which puts a message onto the queue.The only way this can work in one instance and not the other as described is that one app resolves to the alias queue and one does not. For instance, one of the two apps specifies a non-local QMgr name and the message is put directly to a transmission queue whereas the other one hits a dead-end by resolving to the broken alias.The second case is when the alias resolves to a non-local clustered queue but the calling program has specified the local QMgr name as part of the destination. The key to understanding this case is that, unlike a QRemote which can re-map the QMgr name, a QAlias does not change the QMgr name specified by the calling app. Since the QMgr name should not be provided to resove a clustered queue, supplying a non-blank string here breaks resolution.Here's why...When opening a clustered queue an app specifies no QMgr name and MQ decides which instance to send to. The name resolution mechanism looks locally first and if it finds a clustered queue it uses theCLWLUSEQattribute to decide whether to prefer the local instance over clustered instances. But if what it finds is an alias over a clustered queue it re-drives resolution using theTARGQname. If the local QMgr name has been specified as part of a fully-qualified destination address and there is no local queue instance that matchesTARGQ, there is no way to resolve it at that point and resolution fails. To successfully use an alias over a clustered queue therefore requires the calling program tonotspecify a QMgr name.So both programs are resolving to different queue names. That you believe they are resolving to the same name when the behavior indicates they cannot possibly be needs to be dealt with to diagnose this further.The best thing to do is to use a known-good piece of code for which resolution is unambiguous. Theamqsputsample is good but what you really need to test this is a program that allows you to specify both the QMgr name to connect to and the QMgr name for the destination address, such as the Q program fromSupportPac MA01. Recreate the error by variously specifying the local QMgr name in the destination or leaving it blank and you will be able to discern the case in which it fails and then modify the code accordingly.\n"} +{"text": "### Human: I've issue with SSL handshake reported on client side as:main, handling exception: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake\n...\n Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2397;AMQ9771: SSL handshake failed. [1=javax.net.ssl.SSLHandshakeException[Remote host closed connection during handshake],3=localhost/127.0.0.1:1414 (localhost),4=SSLSocket.startHandshake,5=default]\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:1187)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnection.connect(RemoteConnection.java:724)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSessionFromNewConnection(RemoteConnectionSpecification.java:400)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSession(RemoteConnectionSpecification.java:299)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionPool.getSession(RemoteConnectionPool.java:164)\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1598)\n ... 15 more\n Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake\n at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:953)\n at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1332)\n at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1359)\n at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1343)\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection$6.run(RemoteTCPConnection.java:1156)\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection$6.run(RemoteTCPConnection.java:1151)\n at java.security.AccessController.doPrivileged(Native Method)\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:1149)\n ... 20 more\n Caused by: java.io.EOFException: SSL peer shut down incorrectly\n at sun.security.ssl.InputRecord.read(InputRecord.java:482)\n at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:934)\n ... 27 moreand on MQ server as:AMQ9637: Channel is lacking a certificate.is obvious that server do not obtain (or accept?)client certificate. That was bad premise, problem was theserver certificate.I use:JAVA 7 (1.7.0_75) \nMQ 7.5 client libs (7.5.0.2)\nMQ 8.0 server (8.0.0.5)Here isclient Java class. I try to accept all server certificates, and send the client certificate to MQ server side and same certificate is imported in MQ trust store. Not sure if problem is any restriction for certificate name as is noticed here:http://www-01.ibm.com/support/docview.wss?rs=0&uid=swg21245474or if the certificate is really not send to server side.---Edit:---Here is my QMGR and CNL configuration's screens for SSL:### Assistant: First I create certificate with own label but different than defaultgenerated in:MQMGR->Properties->SSL->Certificate Labelwhich isibmwebspheremq, when I recreate certificate with same name specified:runmqakm -cert -create -label ibmwebspheremqqm_qmname -stashed -dn \"CN=corp.com,OU=DEV,OU=QMGR,O=CORP,L=member,ST=NC,C=US,EMAIL=name.surname@corp.com\" -fips -db key.kdb -ca falseit start to communicate with server.EDIT: See alsothis.\n"} +{"text": "### Human: System Configuration:Windows 7 professional SP1 (64 bit)Uninstalled MQ Client 7.5Later tried installing MQ Client 9.0, downloaded fromhere. \nBut installation after running for 2 minutes, failed in the end with the below error. I had choose default setup components.Blockquote\n Error 1713. IBM MQ (Installation1) cannot install one of its required products. Contact your technical support group.Looked into temp folder installation log files. The installation has failed @ CustomAction \"iwiInstall32bitRuntime\".MSI (s) (2C:A0) [17:36:55:139]: Note: 1: 2203 2: C:\\PATH \\IBM\n MQ\\9.0.0.0-IBM-MQC-Win64\\Windows\\msi\\IBM MQ 32bitSupport.msi 3:\n -2147287038CustomAction iwiInstall32bitRuntime returned actual error code 2 (note\n this may not be 100% accurate if translation happened inside sandbox)MSI (s) (2C:1C) [17:36:55:139]: Note: 1: 1713 2: IBM MQ\n (Installation1) 3: 1631Info 2835.The control ErrorIcon was not found on dialog SetupError.Error 1713.IBM MQ (Installation1) cannot install one of its required\n products. Contact your technical support group. System Error: 1631.MSI (s) (2C:1C) [17:37:54:336]: Product: IBM MQ (Installation1) --\n Error 1713.IBM MQ (Installation1) cannot install one of its required\n products. Contact your technical support group. System Error: 1631.Action ended 17:37:54: iwiInstall32bitRuntime. Return value 3.Any RESOLUTION for this error?### Assistant: I found the solution herehttps://developer.ibm.com/answers/questions/275503/mq-install-on-windows-fails-with-rc1713.htmlThe 9.0.0.0-IBM-MQC-Win64.zip file has the 32-bit and 64-bit compiler runtime MSI files in the wrong location relative to where Setup (IBM MQ.msi) is looking for them.To workaround this issue, copy \"%mq_install_media_path%\\Windows\\MSI\\x86\\IBM MQ 32bitSupport.msi\" to \"%mq_install_media_path%\\Windows\\MSI\\\", and copy \"%mq_install_media_path%\\Windows\\MSI\\x64\\IBM MQ 64bitSupport.msi\" to \"%mq_install_media_path%\\Windows\\MSI\\\".(where %mq_install_media_path% contains the unzipped 9.0.0.0-IBM-MQC-Win64.zip files).\n"} +{"text": "### Human: I was reading example1 in the following webpage:http://www.programcreek.com/java-api-examples/index.php?api=javax.jms.QueueBrowserIn the line:QueueBrowser browser = session.createBrowser(queue1);where isqueue1defined?This is my example of me opening and closing a connection:public static void main(String[] args) throws Exception {\n Logger logger = LoggerFactory.getLogger(Connection.class);\n String hostname = \"xxxxxx\";\n int port = 1442;\n String queueManager = \"xxxxxxxx\";\n String channel = \"xxxxxxxxxx\";\n String queueName = \"xxxxxxxxxx\";\n String keystore = \"xxxxxxxxx/xxxxxxx/ssclient_test.ks\";\n String truststore = \"cxxxxxx/xxxxxxxx/client_test.ts\";\n String suiteName = \"xxx_xxx_xxxx_xxx_xxx_xxx\";\n String keyStorePassKey = \"xxx_KEYSTORE\";\n SSLSocketFactory sslSocketFactory = createSslSocketFactory(new File(keystore), new File(truststore), \n keyStorePassKey);\n MQXAQueueConnectionFactory mqConnFactory = new MQXAQueueConnectionFactory();\n mqConnFactory.setHostName(hostname);\n mqConnFactory.setPort(port);\n mqConnFactory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);\n mqConnFactory.setQueueManager(queueManager);\n mqConnFactory.setChannel(channel);\n mqConnFactory.setUseConnectionPooling(true);\n mqConnFactory.setSSLSocketFactory(sslSocketFactory);\n mqConnFactory.setSSLCipherSuite(suiteName);\n QueueConnection queueConnection = mqConnFactory.createQueueConnection();\n QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\n queueSession.close();\n queueConnection.close();\n}How would I define a queue in this case?### Assistant: The createBrowser method expects a queue to be put in. \nFor that you'll need to create a new suitable queue instance.E.g.ActiveMQQueue myQueue = new ActiveMQQueue(\"My queue\");\nQueueBrowser browser = session.createBrowser(myQueue);Take a look at this guide if interested:https://examples.javacodegeeks.com/enterprise-java/jms/jms-queuebrowser-example/\n"} +{"text": "### Human: Looking for some examples for integration between Apache Camel and IBM MQ.Apache camel acting as middleware router between MQ and our java based socket application.### Assistant: You should define a JmsComponent bean in your component scan package and give it all the connection factory properties and use the bean in your route.\nExample:@Bean\npublic JmsComponent ibmmq(){\n JmsComponent ibmmq = new JmsComponent();\n MQTopicConnectionFactory factory = new MQTopicConnectionFactory();\n factory.setQueueManager(\"yyy\"); //yyy is you QueueManager\n factory.setHostName(\"zzz\"); //zzz is your host\n factory.setPort(111);\n factory.setTransportType(1);\n ibmmq.setConnectionFactory(factory);\n return ibmmq; \n}And in your routes add the followingcamelContext.addRoutes(\n new RouteBuilder()\n {\n @Override\n public void configure() throws Exception\n {\n from(\"ibmmq:topic:YY.ZZZ\").to(\"stream:out\"); //YY.ZZZ is your topic name. If Queue use ibmmq:queue:YY.ZZZ.\n }\n });Please have camel-jms and IBM MQ libraries in your dependencies and camel-stream if you are using \"stream:out\" to test.\n"} +{"text": "### Human: Can you please let me know when to use .bindings file and when to use jndi properties file?### Assistant: The .bindings file is created by the JNDI FileSystem context (com.sun.jndi.fscontext.RefFSContextFactory) when data is stored by the MQ JMSAdmin tool or other JNDI tool. It contains a representation of the JNDI data, for example your Connection Factory settings such as hostname, port, etc.In the case of MQ, the .bindings file is not used directly by MQ code, it is used by the JNDI code to create the MQ JMS objects which are then returned to the application.The JNDI properties file (or the JMSAdmin.config file if you're using JMSAdmin) stores the connection settings to allow the JNDI code to connect to the JNDI repository (for example, the FileSystem context, LDAP server etc.). It does not contain data such as Connection Factory settings.\n"} +{"text": "### Human: I am trying to use IBM MQ adaptor in JBoss first time (even using JBoss for the first time). We are migrating our application from WebSphere7 to JBoss 6.3. And for that i need to configure same MQ's which we used to use on IBM WebSphere. Hence I have started configuring IBM Resource adaptor. Below is the standalone.xml file configuration.\nBelow config works fine however I am not able to getQueueConnectionFactorywith code(QueueConnectionFactory) context.lookup(\"java:/comp/env/serviceQCF\")as it throws class cast exception (com.ibm.mq.connector.outbound.ConnectionFactoryImplcannot be cast to javax.jms.QueueConnectionFactory).And when I useconnection-definition class-name=\"javax.jms.QueueConnectionFactory\" jndi-name=\"java:/comp/env/serviceQCF\" enabled=\"true\" pool-name=\"ConnectionClass\", *JBoss is throwing exceptionjavax.naming.NameNotFoundException: comp/env/serviceQCF-- service jboss.naming.context.java.comp.env.serviceQCF*I have tried usingConnectionFactoryhowever same result (Name not found exception)\n \n \n \n wmq.jmsra.rar\n \n LocalTransaction\n \n \n \n 1414\n \n \n MQ.CLT.STH.CHL\n \n \n 127.0.0.127\n \n \n MQ.CLIENT\n \n \n MQSYKHT0\n \n \n \n \n \n false\n \n \n Do I need to configure something Else? Do i need to add/modify any classpath? If yes where and how?Currently Not setting any property while getting Context:context = new InitialContext();But tried using below ones:final Properties env = new Properties(); \n env.put(Context.INITIAL_CONTEXT_FACTORY, \"org.jnp.interfaces.NamingContextFactory\"); \n env.put(Context.PROVIDER_URL, \"remote://localhost:4447\");but no luck.Please help me.### Assistant: As Doug pointed out you have to use the ManageQueueConnectionFactoryImpl, but for me that wasn't enough. I also had to add the below to standalone.xml. Without it I could not cast the IBM QueueConnectFactoryImpl class to a JMS QueueConnectionFactory, even though that class implemented that interface.\n"} +{"text": "### Human: Just started learning puppet and gone through some modules in forge,puppetlabs.com. Is there a module available to install IBM Websphere MQ.Here are the steps I followed to install IBM Websphere MQ using Puppet.Prerequisite:Install steps\n1. gunzip the file\n2. untar the file to temp directory\n3. ensure rpm package is installed\n4. Accept license \n5. Run the RPMs \n6. Set up installation as primary.Step1:exec { 'gunzip_ibmmq': \n unless => \"test -f ${ibmwebspheremq::ibmmq_install_temp}/${ibmwebspheremq::ibmmq_archive_tar}\", \n cwd => \"${ibmwebspheremq::ibmmq_install_temp}\", \n path => [ \"/usr/bin\", \"/bin\", \"/usr/sbin\", \"/usr/local/bin\", \"/sbin\" ] , \n command => \"gunzip ${ibmwebspheremq::ibmmq_install_temp}/${ibmwebspheremq::ibmmq_archive_gz}\", \n logoutput => true, \n }Step2:exec { 'untar_ibmmq': \n cwd => \"${ibmwebspheremq::ibmmq_install_temp}\", \n path => [ \"/usr/bin\", \"/bin\", \"/usr/sbin\", \"/usr/local/bin\", \"/sbin\" ] , \n command => \"tar -xvf ${ibmwebspheremq::ibmmq_install_temp}/${ibmwebspheremq::ibmmq_archive_tar}\", \n logoutput => true, \n }Step3:$admin_packages = ['rpm']\n# Ensure required Package is installed\npackage { $admin_packages:\n ensure => 'installed',\n}Step4:\nAccept licenseexec { 'acceptlicense_ibmmq':\n cwd => \"${ibmwebspheremq::ibmmq_install_temp}/server\",\n path => [ \"/usr/bin\", \"/bin\", \"/usr/sbin\", \"/usr/local/bin\", \"/sbin\" ] ,\n command => \"${ibmwebspheremq::ibmmq_install_temp}/server/mqlicense.sh -accept\",\n #creates => \"${ibmwebspheremq::ibmmq_install_rpm}\",\n logoutput => true,\n }Step5:exec { 'install_ibmmq':\n cwd => \"${ibmwebspheremq::ibmmq_install_temp}/server\",\n path => [ \"/usr/bin\", \"/bin\", \"/usr/sbin\", \"/usr/local/bin\", \"/sbin\" ] ,\n command => \"rpm --prefix ${ibmwebspheremq::ibmmq_install_root} -ivh ${ibmwebspheremq::ibmmq_install_temp}/server/MQSeries*.rpm\",\n #command => \"rpm -ivh MQSeries*.rpm\",\n logoutput => true,\n }Questions I have now since I figured out the process.Accept license steps from IBM is interactive, it forces you to enter 1 , how to you handle this in puppet so install can continue. Could not progress to next step bypassing this unless we manually accept the license. Is there a workaround to continue installing without this step and automate.Is there a puppet module to install IBM JDK.Step5: The way I installed RPMs is by running everything in a single command. (MQSeries*.rpm). Is it required to run one module at a time and in a particular order. Can this run in any order.Thank you### Assistant: I know it is a pretty old question, but you can now use themq_installmodule for installation. and themq_configwhen configuring you MQ environment with puppet.\n"} +{"text": "### Human: We had issues with lot of Applications connecting to MQ server without properly doing a disconnect. Hence we introduced DISCINT on our server connection channels with a value 1800 sec which we found ideal for our transactions. But our Keep Alive interval is pretty high with 900 sec. We would like to reduce that less than 300 as suggested by mqconfig util. But before doing that I would like to know if this is going to affect our disconnect interval value and whether it is going to override our disconnect interval value and make more frequent disconnects which will be a performance hit for us.How does both these values work and how they are related?Thanks### Assistant: TCP KeepAlive works below the application layer in the protocol stack, so it does not affect the disconnecting of the channel configured by the DISCINT.\nHowever lowering the value can result in more frequent disconnects, if your network is unreliable, for example has intermittent very short (shorter then the current KeepAlive, but longer then the new) periods when packets are not flowing.I think the main difference is, that DISCINT is for disconnecting a technically working channel, which is not used for a given period, while KeepAlive is for detecting a not working TCP connection.\nAnd MQ provides means to detect not working connections in the application layer too, configured by the heartbeat interval.These may help:http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.con.doc/q015650_.htmhttp://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.ref.con.doc/q081900_.htmhttp://tldp.org/HOWTO/TCP-Keepalive-HOWTO/overview.htmlhttp://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.ref.con.doc/q081860_.htm\n"} +{"text": "### Human: We are using the below code to and settings to connect to the IBM Websphere Message Queue (version IBM(R) WebSphere(R)MQ V6.0.1) on an iSeries.We use the same uid and pwd for three different applications against the same MQWe getMQRC_NOT_AUTHORIZEDandMQRC_Q_MGR_NOT_AVAILABLEerrors intermittently throughout the day, butalwayson theGetmessages method.Settings:A HashTable for theconnection propertiesis created with the below settings:MQC.TRANSPORT_PROPERTY = MQC.TRANSPORT_MQSERIES_MANAGED \nMQC.CHANNEL_PROPERTY = SYSTEM.DEF.SVRCONN\nMQC.HOST_NAME_PROPERTY = IP AddressWe use the belowOpen Options:MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_INQUIRE\n\nclass WebSphereMQ\n{\n public bool impStatus { get; set; }\n\n public MQQueueManager gMQQueueManager;\n public MQQueue gMQQueue;\n private MQMessage queueGetMessage { get; set; }\n private MQGetMessageOptions queueGetMessageOptions { get; set; }\n\n public MQQueueManager pMQQueueManager;\n public MQQueue pMQQueue;\n private MQMessage queuePutMessage { get; set; }\n private MQPutMessageOptions queuePutMessageOptions { get; set; }\n\n public WebSphereMQ()\n {\n impStatus = impersonation.impersonateValidUser(Common.impNme, \"\", Common.impPwd);\n\n gMQQueueManager = null;\n gMQQueue = null;\n\n if (gMQQueue != null && gMQQueue.IsOpen)\n {\n // Just incase\n gMQQueue.Close();\n gMQQueueManager.Disconnect();\n }\n }\n\n public bool connectMQGet(string QMgr, string QName, Hashtable connectionProperties, bool BrowseOnly, string QType)\n {\n try\n {\n gMQQueueManager = new MQQueueManager(QMgr, connectionProperties);\n if (gMQQueueManager != null && QType == \"OUT\")\n {\n if (BrowseOnly)\n gMQQueue = gMQQueueManager.AccessQueue(QName, MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_BROWSE + MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_INQUIRE);\n else\n gMQQueue = gMQQueueManager.AccessQueue(QName, MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_INQUIRE);\n }\n }\n catch (MQException mqe)\n {\n if (impStatus) impersonation.undoImpersonation();\n /* Write to log */\n Common.logBuilder(\"WebSphereMQ --> connectMQGet <--\", \"MQException\", Common.ActiveMQ, mqe.Message, \"Exception\");\n /* Send email to support */\n emailer.exceptionEmail(mqe);\n return false;\n }\n return true;\n }Here is an example of the error and stack trace:An MQException has happened on 30 June 2015 at 08:52A\nMessage ---\nMQRC_NOT_AUTHORIZED\nHelpLink ---\nSource ---\namqmdnet\nStackTrace ---\n at IBM.WMQ.MQBase.throwNewMQException() at IBM.WMQ.MQQueueManager.Connect(String queueManagerName) at IBM.WMQ.MQQueueManager..ctor(String queueManagerName, Hashtable properties) at EvryCardManagement.WebSphereMQ.connectMQGet(String QMgr, String QName, Hashtable connectionProperties, Boolean BrowseOnly, String QType)So is there some setting I can change on the client side to prevent us getting these exceptions, or is this something that needs to be modified on the iSeries/MQ?Should we try using different uid's for the three different applications hitting the MQ?### Assistant: MQ V6 went out of service long back. You will need to upgrade your queue manager to a supported version.As far as the 2035 exception is concerned there are multiple ways to solve it:1) The user id under which your MQ .NET application must exist on iSeries and has authority to connect to queue manager.2) Set MCAUSER on SYSTEM.DEF.SVRCONN on iSeries queue manager.There are many posts on 2035 reason code. Look at the following posts from T.Rob and links in these posts.Authorization with Websphere MQ 6WebSphere 7, configuring JMS Q connection factory without user id: MQRC_NOT_AUTHORIZED\n"} +{"text": "### Human: I have two queue manager servers running on two boxes. QM1 has a sender channel defined , and QM2 has a receiver channel with the same name.\nI have created self signed certificate for each QM , extracted and added the public part of each certificate to the other QM's key db. Altered each channel to use CipherSpec TRIPLE_DES_SHA_US.This setup works perfectly fine, if QM names don't contain any special character. If name of the sender QM is A_QM and the other one is B_QM , the sender channel never comes up and is in RETRYING state.while creating self-signed certificate I am using label ibmwebspheremqa_qmin case of A_QM and ibmwebspheremqqm1when the queue manager is QM1. Similarly when adding the public part of the certificate I am preserving the other QM's label. This is the only difference in the whole setup.Is there any restriction in defining QM names if I want to configure SSL or TLS ?### Assistant: I had no trouble creating a pair of QMgrs and channels as described and getting them to run:[mqm@rhel6base scripts]$ runmqsc A_QM\n5724-H72 (C) Copyright IBM Corp. 1994, 2014.\nStarting MQSC for queue manager A_QM.\n\n\ndis chs(*) all\n 1 : dis chs(*) all\nAMQ8417: Display Channel Status details.\n CHANNEL(A_QM.B_QM) CHLTYPE(SDR)\n BATCHES(0) BATCHSZ(50)\n BUFSRCVD(1) BUFSSENT(1)\n BYTSRCVD(268) BYTSSENT(268)\n CHSTADA(2015-04-01) CHSTATI(10.57.43)\n COMPHDR(NONE,NONE) COMPMSG(NONE,NONE)\n COMPRATE(0,0) COMPTIME(0,0)\n CONNAME(127.0.0.1(3115)) CURLUWID(0C031C5501020010)\n CURMSGS(0) CURRENT\n CURSEQNO(0) EXITTIME(0,0)\n HBINT(300) INDOUBT(NO)\n JOBNAME(0000130700000001) LOCLADDR(127.0.0.1(53145))\n LONGRTS(999999999) LSTLUWID(0000000000000000)\n LSTMSGDA( ) LSTMSGTI( )\n LSTSEQNO(0) MCASTAT(RUNNING)\n MONCHL(OFF) MSGS(0)\n NETTIME(0,0) NPMSPEED(FAST)\n RQMNAME(B_QM) SHORTRTS(10)\n SSLCERTI(CN=rhel6base.ioptconsulting.com)\n SSLKEYDA( ) SSLKEYTI( )\n SSLPEER(SERIALNUMBER=55:1C:06:B2,CN=rhel6base.ioptconsulting.com)\n SSLRKEYS(0) STATUS(RUNNING)\n STOPREQ(NO) SUBSTATE(MQGET)\n XBATCHSZ(0,0) XMITQ(B_QM)\n XQTIME(0,0) RVERSION(08000001)\n RPRODUCT(MQMM) \n\n[mqm@rhel6base ssl]$ runmqakm -cert -list -db key.kdb -stashed\nCertificates found\n* default, - personal, ! trusted, # secret key\n! ibmwebspheremqb_qm\n*- ibmwebspheremqa_qm\n[mqm@rhel6base ssl]$ runmqakm -cert -list -db ../../B_QM/ssl/key.kdb -stashed\nCertificates found\n* default, - personal, ! trusted, # secret key\n! ibmwebspheremq_a_qm\n*- ibmwebspheremqb_qm\n[mqm@rhel6base ssl]$REFRESH SECURITY TYPE(SSL)The most likely cause for the behavior you are seeing is not issuing refresh security or restarting the QMgrs after updating their keystores. For example:echo \"REFRESH SECURITY TYPE(SSL)\" | runmqsc A_QM\necho \"REFRESH SECURITY TYPE(SSL)\" | runmqsc B_QMorendmqm -i A_QM; strmqm A_QM\nendmqm -i B_QM; strmqm B_QMOne aspect of security for the keystore is that there is only ever one version of it in memory at a time. If it were possible for one channel to have one version and another channel to have another version, it would become impossible to determine which was the \"right\" one in order to detect tampering. So when the KDB is updated, the refresh security command causes the QMgr to stop all running TLS channels, dump the KDB from memory, and reload the KDB when one of the channels starts.(MQ doesn't use SSL, by the way, never has. It uses TLS with SSL ciphers and now that SSL itself is broken, best to get used to saying TLS because that will help to remember to use TLS ciphers exclusively going forward.)So after updating the KDB if you did not run the refresh, it is likely that the refresh was not done and the QMgr doesn't yet know about the newly added certificate for the remote QMgr.When SSLCAUTH(OPTIONAL) isnotoptionalAnother common problem with TLS is a misunderstanding ofSSLCAUTH(OPTIONAL). Many people believe that thisalwaysresults in one-way authentication so they setSSLCAUTH(OPTIONAL)and then exchange certs in only one direction. For example, QM1 has TLS channels to QM2 so obviously has its own personal certificate. Then we try to connect A_QM to it. We import A_QM's personal cert to QM1's KDB, refresh security everywhere,DEF CHL(A_QM.QM1) ... SSLCAUTH(OPTIONAL)on both sides and try to start the channel.The misunderstanding is that if the thing initiating the channel has a personal cert itwillsend it in all cases. To test withSSLCAUTH(OPTIONAL)requires removing any personal cert from the keystore on the side initiating the connection. Often people do not realize this and spend many hours (in some cases weeks) struggling to understand why this fails.For your purposes always exchange the personal certs inbothdirections.Incomplete cert exchangeThe other common problem working with self-signed certs is when a cert is generated multiple times with the same label and/or CN value and there's a mismatch between the personal cert on one end versus the public portion on the other. This is easily checked by viewing the cert details and checking that the fingerprint and other details match like so:[mqm@rhel6base ssl]$ runmqakm -cert -details -label ibmwebspheremqb_qm -db key.kdb -stashed\nLabel : ibmwebspheremqb_qm\nKey Size : 1024\nVersion : X509 V3\nSerial : 551c06b2\nIssuer : CN=rhel6base.ioptconsulting.com\nSubject : CN=rhel6base.ioptconsulting.com\nNot Before : April 1, 2015 10:54:42 AM EDT\nNot After : March 31, 2016 10:54:42 AM EDT\nPublic Key\n 30 81 9F 30 0D 06 09 2A 86 48 86 F7 0D 01 01 01\n 05 00 03 81 8D 00 30 81 89 02 81 81 00 DF 0F 90\n 8C C2 CA D1 ED 16 E2 A8 DA E3 26 63 45 4B B2 29\n 37 04 65 A1 D3 30 23 2A 67 AB 61 06 75 E1 8B 87\n D2 9A CD 38 4C 63 D6 CC AD 25 55 B3 8B BE 34 4E\n 32 CB EB FE E2 5D E0 49 2F 57 AC EC 5E 79 A2 52\n F6 21 5A 5F 95 AB C4 70 C8 00 68 0B 22 32 8C 1F\n 4C DB 0C D9 85 B8 06 5A 7C DA 3A 3A BE 12 C8 C1\n C0 92 5E FE 09 46 F7 E1 1F 3D 4A AA 63 F0 80 09\n 3D FE E7 A4 49 5D 86 09 4C B5 0E 1E 97 02 03 01\n 00 01\nPublic Key Type : RSA (1.2.840.113549.1.1.1)\nFingerprint : SHA1 : \n 55 FC 2C 7C 00 8E A7 27 78 0D 99 AD FF 84 58 57\n BF 16 1C 62\nFingerprint : MD5 : \n 90 66 AD 5D 71 AF 75 E8 9A 4A A3 5A DB 15 CD 21\nFingerprint : SHA256 : \n 7E 43 75 25 31 ED E7 76 FA 40 87 37 F3 B2 9E 6F\n 2D 55 2D 3C CB 52 60 9C 85 B2 53 F3 1C C0 D2 3C\nExtensions\n AuthorityKeyIdentifier\n keyIdentifier: 8D BC 64 AF D9 12 02 34\n authorityIdentifier:\n authorityCertSerialNumber:\n SubjectKeyIdentifier\n keyIdentifier: 8D BC 64 AF D9 12 02 34\nSignature Algorithm : SHA1WithRSASignature (1.2.840.113549.1.1.5)\nValue\n 46 D4 8A D9 62 04 CF C4 0E 23 DB 4C F9 AD 25 9B\n 89 3B FD B9 4F 52 4C DE 36 96 15 92 0E 7B 03 05\n E8 85 12 AD E7 40 DB E9 4D 77 8F B7 4B CC 43 1B\n AD 6D 13 B1 2F 26 12 C8 1C 17 FE 51 A7 B7 7B EE\n 80 CA 82 37 98 E1 B4 17 3A B4 CC 20 E7 4E 53 42\n C6 E1 C3 1C 54 BD DC 9A 14 86 9A 25 66 AC 11 2C\n 78 A0 B5 DC 22 FE 52 62 59 27 02 DA 82 07 64 42\n 38 99 8A A7 52 53 20 C3 B2 FF 8F 6D A6 A3 8F 72\nTrust Status : Enabled\n[mqm@rhel6base ssl]$ runmqakm -cert -details -label ibmwebspheremqb_qm -db ../../B_QM/ssl/key.kdb -stashed\nLabel : ibmwebspheremqb_qm\nKey Size : 1024\nVersion : X509 V3\nSerial : 551c06b2\nIssuer : CN=rhel6base.ioptconsulting.com\nSubject : CN=rhel6base.ioptconsulting.com\nNot Before : April 1, 2015 10:54:42 AM EDT\nNot After : March 31, 2016 10:54:42 AM EDT\nPublic Key\n 30 81 9F 30 0D 06 09 2A 86 48 86 F7 0D 01 01 01\n 05 00 03 81 8D 00 30 81 89 02 81 81 00 DF 0F 90\n 8C C2 CA D1 ED 16 E2 A8 DA E3 26 63 45 4B B2 29\n 37 04 65 A1 D3 30 23 2A 67 AB 61 06 75 E1 8B 87\n D2 9A CD 38 4C 63 D6 CC AD 25 55 B3 8B BE 34 4E\n 32 CB EB FE E2 5D E0 49 2F 57 AC EC 5E 79 A2 52\n F6 21 5A 5F 95 AB C4 70 C8 00 68 0B 22 32 8C 1F\n 4C DB 0C D9 85 B8 06 5A 7C DA 3A 3A BE 12 C8 C1\n C0 92 5E FE 09 46 F7 E1 1F 3D 4A AA 63 F0 80 09\n 3D FE E7 A4 49 5D 86 09 4C B5 0E 1E 97 02 03 01\n 00 01\nPublic Key Type : RSA (1.2.840.113549.1.1.1)\nFingerprint : SHA1 : \n 55 FC 2C 7C 00 8E A7 27 78 0D 99 AD FF 84 58 57\n BF 16 1C 62\nFingerprint : MD5 : \n 90 66 AD 5D 71 AF 75 E8 9A 4A A3 5A DB 15 CD 21\nFingerprint : SHA256 : \n 7E 43 75 25 31 ED E7 76 FA 40 87 37 F3 B2 9E 6F\n 2D 55 2D 3C CB 52 60 9C 85 B2 53 F3 1C C0 D2 3C\nExtensions\n AuthorityKeyIdentifier\n keyIdentifier: 8D BC 64 AF D9 12 02 34\n authorityIdentifier:\n authorityCertSerialNumber:\n SubjectKeyIdentifier\n keyIdentifier: 8D BC 64 AF D9 12 02 34\nSignature Algorithm : SHA1WithRSASignature (1.2.840.113549.1.1.5)\nValue\n 46 D4 8A D9 62 04 CF C4 0E 23 DB 4C F9 AD 25 9B\n 89 3B FD B9 4F 52 4C DE 36 96 15 92 0E 7B 03 05\n E8 85 12 AD E7 40 DB E9 4D 77 8F B7 4B CC 43 1B\n AD 6D 13 B1 2F 26 12 C8 1C 17 FE 51 A7 B7 7B EE\n 80 CA 82 37 98 E1 B4 17 3A B4 CC 20 E7 4E 53 42\n C6 E1 C3 1C 54 BD DC 9A 14 86 9A 25 66 AC 11 2C\n 78 A0 B5 DC 22 FE 52 62 59 27 02 DA 82 07 64 42\n 38 99 8A A7 52 53 20 C3 B2 FF 8F 6D A6 A3 8F 72\nTrust Status : EnabledDebuggingCheck the error logs. In particular, it is good security design to give an attacker as little information as possible to always check the logs of the QMgr that is receiving the connection first. If it has detected the error it will have detailed logs and the sending side will have sparse logs like \"the remote QMgr disconnected\" which doesn't reveal much to an attacker.If the error is actually on the sending side, then it will have most detailed error messages and the receiving side will have little or none. For example, if the sending side can't find its stash file the connection isn't ever attempted and the receiving side will have no record of the event.Finally, there is always the possibility that you may discover a bug working with GSKit and MQ, or that you are trying to use features not relevant to version of MQ that you are working on. For this reason, it is always best to include adspmqver -ain your question. If after all of this, you still can't get it to work, please update the question with thedspmqver -aoutput and the results of your further testing.In summaryTo sum up:QMgr names like A_QM are perfectly valid.First make sure that the QMgrs have picked up their new KDB files after changes by restarting the QMgrs or runningREFRESH SECURITY TYPE(SSL).Make sure to exchange certs in both directions every time.Check the error logs on both sides starting with the side receiving the connection request.Always include output fromdspmqver -awhen requesting help with GSKit, certs or TLS since the behavior varies by version and fix pack.\n"} +{"text": "### Human: I have installed MQ server on HP Nonstop and client version 8 on windows server. When i am trying to access MQ server via websphere MQ explorer on windows i am getting Access not permitted,You are not authorized to perform this operation (AMQ4036) error. Can you guys help me here?### Assistant: If you look in the AMQERR01.LOG on the queue manager it will tell you the reason you were rejected access. There are several different possibilities for security failures, but the exact nature of your failure willalwaysbe found in the error log. If you are not sure of the meaning of what you find in the error log, update your question with more information and I will update this answer with more information too.\n"} +{"text": "### Human: Im trying to put a message in a MQ Queue. Here is my source code:QueueConnection queueConn;\n QueueSession queueSession;\n QueueSender queueSender;\n\n queueConn = connectionFactory.getConnection();\n queueSession = queueConn.createQueueSession(false,\n Session.AUTO_ACKNOWLEDGE);\n queueSender = queueSession.createSender(queueSession\n .createQueue(KEY_CONFIG_QUEUE_NAME));\n queueSender.setDeliveryMode(DeliveryMode.NON_PERSISTENT);\n\n TextMessage message = queueSession.createTextMessage(logBase);\n\n queueSender.send(message);I don't have the source code from the queue consumer, that is the one who sends the messages to SPLUNK. But at SPLUNK console, I could realize that the message is composed by JMS HEADER + my text message (logBase).Id like the messages without JMS Header. Could someone help me to understand where the problem is? Could be at consumer? Maybe a wrong or missing SPLUNK config??### Assistant: Assuming that you cannot change the source code at the consumer, there is a way to administratively do this. You can change the queue definition so that these message properties are not given to the getting application.ALTER QLOCAL(q-name) PROPCTL(NONE)Related LinksPROPCTL queue options\n"} +{"text": "### Human: I have QmgrA (WMQ 7.5 Solaris) and QmgrB( Aix, WMQ older than 7.5).QmgrA --sdr channel-> QmgrB \nQmgrA <--recv channel-- QmgrBSender channel from QmgrA to QmgrB starts up in a few seconds after I issuestart chl. (Substate(MQGET))However the recv channel starts up like more than 30minutes later (substate(RECEIVE)). Both sdr and recv channels are configured with SSL. I have disabled OCSP on QmgrA. However problem still persist.Do you have an troubleshooting tips for such situation? Any channel tuning parameters to configure? or Solaris resources to fine tune? thanks### Assistant: There are quite a number of steps in the process of getting a channel to start that can take some time. Often these sorts of delays only exist in one direction, just as your problem shows. OCSP is one of many such possibilities, and you already tried ruling that one out. However, rather than just guessing at what they might be, we should try to discover what it is from looking at the channel status SUBSTATE value. I see that you are already familiar with it. SUBSTATE(RECEIVE) is a good state for a receiver channel to be in. What we want to know is what SUBSTATE do you see at the sender (on QMgr B) and the receiver (on QMgr A) during the 30 minute delay. There is a SUBSTATE for each of the possible delaying issues, so seeing what value is shown will point at what the problem is.Related ReadingChannel states and substatesChannel Sub Status Blog Post\n"} +{"text": "### Human: I'm using a java application that connects to Websphere MQ. I tried enabling Logging by setting the log level to DEBUG for the packagecom.ibm.mq. However, it does not log anything. Am I missing something here?### Assistant: Could you give a little more background to the issue that you have please?General approach to debug ishttp://www-01.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.dev.doc/q031850_.htm?lang=enandhttp://www-01.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.dev.doc/q031310_.htm\n"} +{"text": "### Human: I am looking for some guidance regarding how to set up an application that listens to clustered queues on multiple queue managers. Below is our current setup:Physical Box \"Alpha\":\nTCP listener defined for port: 1111\nQueue Manager Name: QM1\nChannel Name: \"MyChannel\"\nQueue Name: Q1Physical Box \"Beta\":\nTCP Listener defined for port 1112\nQueue Manager Name: QM2\nChannel Name: \"MyChannel\"\nQueue Name: Q1An external client application has a connection to QM1 on physical box Alpha on port 1111.When I PUT messages onto Q1, because of the clustered setup, every second message is placed on either Q1 on QM1 or Q1 on QM2.When another application is connected to QM2 on physical box Beta on port 1112, it receives only half the messages that have been sent to Q1 because it is not monitoring both queue managers.Is there a way to connect to both queue managers so that my second application receives all messages that are placed on Q1 regardless of the Queue Manager that it is monitoring?We are connecting via JMS using the following code:public static ConnectionFactory createConnectionFactory(final ConnectionString connectionString) throws JMSException {\n MQConnectionFactory cf = new MQConnectionFactory();\n cf.setHostName(connectionString.getHost());\n cf.setPort(connectionString.getPort());\n cf.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n cf.setClientReconnectOptions(WMQConstants.WMQ_CLIENT_RECONNECT_Q_MGR);\n cf.setQueueManager(connectionString.getQueueManager());\n cf.setChannel(connectionString.getChannel());\n\n return cf;\n }### Assistant: Applications must be locally connected to GET messages. Thelocallyhere means 'application can get messages from queues that are hosted in the queue manager to which the application is directly connected'. As the second application runningBetabox is connected to queue manager QM2 where Q1 is hosted, it is getting messages.Your can run another instance of your second application onAlphabox where the application connects to QM1 to get messages from Q1.UpdatePlease note MQ cluster is for work loading balancing messages among multiple cluster queue instances in queue managers in a cluster. MQ cluster is not same as High Availability cluster. In MQ cluster messages will be distributed to all instances of a queue in a round robin basis( round robin distribution is the default. It can be changed to by developing cluster work load exit).Since the job is to load balance messages, one application per cluster queue instance must be setup to process messages. If such a setup is not made, then messages will remain in cluster queue instances.\n"} +{"text": "### Human: I have win service that work with MQ.But i want that it works using ssl channel and database with public/private keys(for that)May you explain me how to do it.P.S. I'm not very good at MQnow i connect to MQ using this codeMQEnvironment.Hostname = ConfigurationManager.AppSettings[\"HostnameIN\"];\n MQEnvironment.Channel = ConfigurationManager.AppSettings[\"ChannelIN\"];\n MQEnvironment.Port = int.Parse(ConfigurationManager.AppSettings[\"PortIN\"]);\n Environment.SetEnvironmentVariable(\"MQCCSID\", ConfigurationManager.AppSettings[\"MQCCSID\"]);\n var mqQueueManagerName = ConfigurationManager.AppSettings[\"QueueManagerNameIN\"];\n var mqQueueName = ConfigurationManager.AppSettings[\"QueueNameIN\"];\n const int openOptions = MQC.MQOO_BROWSE | MQC.MQOO_INPUT_AS_Q_DEF;\n var qMgr = new MQQueueManager(mqQueueManagerName);\n var getOptions = new MQGetMessageOptions();and get all messages using thisusing (var mqQueue = qMgr.AccessQueue(mqQueueName, openOptions))\n {\n try\n {\n //while (mqQueue.CurrentDepth>0)\n while (true)\n {\n var message = new MQMessage();\n //message.Version = 2;\n getOptions.Options = MQC.MQGMO_WAIT | MQC.MQGMO_BROWSE_NEXT;\n mqQueue.Get(message, getOptions);\n mqMessages.Add(message);\n }\n }### Assistant: In order to set up MQ to use SSL on the channel you're using, you don't need to make any application changes at all - you simply need to configure the channel you're using on the queue manager to require SSL. The libraries within the client, JVM, and the queue manager will handle establishing that secure connection for you. So in theory all you need to do is make the MQSC/MQ Explorer changes which will configure SSL on the channel.Recommend you read the following page in the IBM knowledge center. It provides a number of scenarios for various methods of connecting a client securely to the queue manager:http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.sce.doc/q014220_.htm\n"} +{"text": "### Human: If the JMS client application requirements is such that no messages can be lost and no duplicates sent for processing and each message is unrelated to other messages (no batch processing), then which combination fulfills these requirements:\n- persistence + auto-acknowledge session mode (asynchronous consumer)\n- persistence + client-acknowledge session mode\n- persistence + transacted sessions\n- any other?\nI have read up about transacted sessions and ack modes (for example herehttp://docs.oracle.com/javaee/1.4/tutorial/doc/JMS6.htmland herehttp://wso2.com/library/articles/2013/01/jms-message-delivery-reliability-acknowledgement-patterns/) and it seems to me that all three possibilities are acceptable. Do you agree? What would be the advantage of using transacted sessions or more advanced concepts of reliability?Thanks in advance!### Assistant: If you are talking to any JMS transport provider over the network, use transacted sessions and make sure the app detects and gracefully deals with dupe messages. Why? Have a look at theJMS 1.1 specificationin section4.4.13 Duplicate Production of Messageswhich states:If a failure occurs between the time a client commits its work on a\n Session and the commit method returns, the client cannot determine if\n the transaction was committed or rolled back. The same ambiguity\n exists when a failure occurs between the non-transactional send of a\n PERSISTENT message and the return from the sending method.It is up to a JMS application to deal with this ambiguity. In some\n cases, this may cause a client to produce functionally duplicate\n messages.A message that is redelivered due to session recovery is not\n considered a duplicate message.Consider an application that issues aCOMMITover the network. If the app receives an error indicating the connection has been broken, how does it know whether that happened before or after the API call reached the transport provider? If the app was sending a message, the only safe thing to do is to assume theCOMMITfailed and resend the message. The thing receiving the message will see it again.Similarly, an app receiving messages that gets an error on theCOMMITwill see that message again if in fact it was rolled back. However, the app cannot assume that it was rolled back and discard the message it has just received because that may result in lost messages.So WMQ or any other JMS transport provider must not deliver a dupe but because of an ambiguity introduced by the network, the application might receive a dupe. This is best case assuming a transacted session and the app gracefully handles dupes. Worst case is that outside of a transacted session, the ambiguity might result in the app dropping messages.\n"} +{"text": "### Human: I want to create a Java standalone application for connecting via JMS to an MQ Queue Manager (not to be confused with a client). I want to create the JNDI resources independently and put everything in a JAR a run it to make some tests.Is there any example that I can take to build this?### Assistant: Little old but explains the steps:\nIBM WebSphere Developer Technical Journal: Developing a standalone Java application for WebSphere MQhttp://www.ibm.com/developerworks/websphere/techjournal/0502_woolf/0502_woolf.htmlThen to access the JNDI you need the thin clienthttp://pic.dhe.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=%2Fcom.ibm.websphere.express.doc%2Finfo%2Fexp%2Fae%2Ftcli_developthin.htmlThere is also a sample in the client download JmsJndiProducer.java\n"} +{"text": "### Human: Are messages received on a Websphere MQtopicthat you are subscribed tostrictly ordered?In other words, in similar fashion to aqueue, given that your connection is maintained are you guaranteed to receive thetopicmessages in the same order as they were sent?### Assistant: As per JMS specsJMS defines that messages sent by a session to a destination must be received\nin the order in which they were sent. This defines a partial ordering\nconstraint on a session\u2019s input message stream.\n\nJMS does not define order of message receipt across destinations or across\na destination\u2019s messages sent from multiple sessions. This aspect of a\nsession\u2019s input message stream order is timing-dependent. It is not under \napplication control.AlsoAlthough clients loosely view the messages they produce within a session\nas forming a serial stream of sent messages, the total ordering of this stream\nis not significant. The only ordering that is visible to receiving clients is\nthe order of messages a session sends to a particular destination.\nSeveral things can affect this order like message priority, \npersistent/non persistent etc.So to answer your question it isnot really JMS provider specificwhat order messages are received. They will be received in the same order they were sent with above information. The order in which messages are delivered to the server however will be constrained by limitations like message priority, persistent/non persistent etc.\n"} +{"text": "### Human: I see a scenario when an applications puts a message to a topic on the same server, messages get stuck in the transmit queue until i start the channel or drop a test messages (using \"amqsput\" ) to the queue manager where this messages has to go. After this channels are started or in running state, messages put to the topic are flowing properly. After few hours or a day when no channels are running , when the application drops a message to topic it again stuck in transmit queue until i execute the above drill.This is in a clustered environment. MQv7.0.1.6Why messages has to stuck in trasnmit queue even though the remote MQ's are running fine ? This scenario is occurring only when the application publish messages to topic.### Assistant: Updated 23 Jan 2014IBM has replied to my PMR as a match forIV21703: A WMQ V7 CLUSSDR CHANNEL IS NOT STARTED WHEN PERSISTENT PUB/SUB MESSAGES ARE PUT TO CLUSTERED TOPICS.Error descriptionWhen messages are put to cluster queues in syncpoint the cluster\nchannels are not started until the application calls MQCMIT;\nthe CLUSSDR channels to all the queue managers which are\ndestinations for messages put in the Unit of Work are started\nduring commit processing.\n\nThis operation does not appear to be carried out when\npublications are put to remote cluster subscriber queues at the\ncommit of the internal Unit of Work, that is, the cluster\nchannels associated with the put of the subscriber messages are\nnot started at that time. The channels are held in the queue\nmanager's memory associated with the connection, and are\nstarted when the application is disconnected and the connection\nis closed.Local fixThere are 4-\n1. Change PMSGDLV to ALLAVAIL\n2. Change the messages to non-persistent\n3. Change the CLUSRCVR channels to DISCINT(0)\n4. Call MQDISC after putting msgs to a clustered topicThe fix was in 7.0.1.10 and 7.1.0.2 but 7.5 is not mentioned in the APAR. A temporary fix is available for 7.5.0.0 and above. It is targeted for inclusion in FP7.5.0.3 which is due in 1Q14.The previous answer based on cluster name resolution turned out to be completely wrong. It was a workable theory, but wrong nonetheless. I've deleted it.\n"} +{"text": "### Human: I have 2 queues say Q1 and Q2. When I insert messages using MQPUT into Q1, is there any way that this message be replicated into Q2?\nDoes WMQ have support for queue copy?\nNote : The queues reside on different queue managers.Thanks,\nHudson### Assistant: If you have multiple consumers(Queues), which needs the same message, thenPublish-Subscribeis made exactly for this purpose.You can referherefor details about pub-sub.If you are using Websphere MQ 7.XX, then you can use anAlias queue to publishthe message.You can follow below steps:Create a new Topic(Lets say \"MyTopic\" is your topic).Create an Alias queue(Lets call it as \"MyPublisher\"), with Base Type asTopicand give Base Object as \"MyTopic\"(Name of your topic).Now say Q1, Q2, Q3 have to get the message. Create subscriptions for these queues for Topic \"MyTopic\".Now, the messages posted in queue \"MyPublisher\", will reach to all queues subscribing to the topic \"MyTopic\"(Q1,Q2,Q3).Even remote queues can be given in destination while creating subscriptions. So, different queue managers will not be a problem as far as you have connectivity between them.\n"} +{"text": "### Human: I have a generic 'datapump' that is running is part of a Windows service; an instance of it exists for each queue that I'm monitoring for new incoming messages from an MQSeries queue. \nIf the Get method fails, I want to be able to show the name of the queue, so I'm trying to build a debug variable that can be used in the catch handler. I'm getting a 2068 MQRC_SELECTOR_NOT_FOR_TYPE on the line that sets debugQueueInfo below.debugLocation = \"queueGetName\";\n debugQueueInfo = \"Queue:\" + queueIn.RemoteQueueManagerName + \":\"\n + queueIn.RemoteQueueName;\n\n debugLocation = \"queueGetMessage\";\n queueIn.Get(mqMessage, mqGetMessageOptions);How can I get the current queue manager name, and queue name? The variable queueIn is of type IMB.WMQ.MQQueue, and I'm using the .NET API.When the queue was object was built, I used the following:queueOptions = MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_INQUIRE + MQC.MQOO_BROWSE; \nMQQueue mqQueue = qmgr.AccessQueue(mqCloneSpecs.queueName, queueOptions);Based on the doc of the error code for 2068, I thought maybe adding the MQC.MQOO_BROWSE would fix the issue, but it did not.### Assistant: RemoteQueueManagerName and RemoteQueueName are valid for remote queues only. I think that's the reason why you are getting 2068. MQOO_BROWSE otpion is for getting a message without removing it from the queue.You can useNameproperty to get the queue name, likedebugQueueInfo = \"Queue:\" + queueIn.Name;MQQueueclass does not have a property to get the queue manager name. You will have to get it from MQQueueManager instance.\n"} +{"text": "### Human: I am fairly new to MQMessage broker. In my project, I want to send an xml message. Every thing is ok but when message get larger than 500 bytes, My code send broken message to the Queue. what I am doing is//queueManager has been initialized in the class constructor and connected to a channel.\n public MQResponse WriteMsg(string QueueName, string strInputMsg)\n {\n MQResponse response = new MQResponse();\n try\n {\n queue = queueManager.AccessQueue(QueueName,\n MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING );\n\n queueMessage = new MQMessage();\n queueMessage.DataOffset = 0;\n //queueMessage.MessageLength = 2000000;\n queueMessage.ResizeBuffer(6 * strInputMsg.Length);\n queueMessage.WriteString(strInputMsg);\n queueMessage.Format = MQC.MQFMT_STRING;\n\n queuePutMessageOptions = new MQPutMessageOptions();\n queue.Put(queueMessage, queuePutMessageOptions);\n response.Message = \"Message sent to the queue successfully\";\n response.Status=MQResponseStatus.WriteSuccessful;\n }\n catch (MQException MQexp)\n {\n response.Message = \"Exception: \" + MQexp.Message;\n response.Status=MQResponseStatus.WriteFail;\n response.CatchedException=MQexp;\n }\n catch (Exception exp)\n {\n response.Message = \"Exception: \" + exp.Message;\n response.Status=MQResponseStatus.WriteFail;\n response.CatchedException=exp;\n }\n return response;\n }I guess queueMessage should be initialized correctly so that we able to send whole message.### Assistant: First of all how did you determine that the message is broken? Did you try to receive the sent message and compared with the original message or you viewed the message using MQExplorer or some other means. MQExplorer by default displays first 1000 bytes of the message. To view more you need to change theMax data bytes displayedsetting inWindow/Preferences/Messagespanel.WebSphere MQ can handle messages of size as large as 100 MB.Regarding your code snippet above: The few lines of code is enough to build and send a message.queueMessage = new MQMessage();\n queueMessage.Format = MQC.MQFMT_STRING; \n queueMessage.WriteString(strInputMsg);\n queuePutMessageOptions = new MQPutMessageOptions();\n queue.Put(queueMessage, queuePutMessageOptions);\n"} +{"text": "### Human: I'm unable to connect remotely from WebSphere Application Server with Queue Manager at WebSphere MQ. Anyhow it get connected to Queue Manager from WAS that is installed on same machine. I'm using version 7.5 of WebSphere MQ and version 7.0 of WebSphere Application Server.While attempting to connect WAS remotely to Queue Manager following error messages were logged.Error Message from WebSphere MQ:1/30/2013 21:12:09 - Process(3624.6) User(MUSR_MQADMIN)\n Program(amqrmppa.exe)\n Host(KHILT-269) Installation(Installation1)\n VRMF(7.5.0.0) QMgr(QM.TEST)\n AMQ9504: A protocol error was detected for channel 'TEST_CHANNEL'. EXPLANATION: During communications with the\n remote queue manager, the channel program detected a protocol error.\n The failure type was 11 with associated data of 0. ACTION: Contact the\n systems administrator who should examine the error logs to determine\n the cause of the failure.Error Message at WebSphere Application Server:A connection could not be made to WebSphere MQ for the following\n reason: CC=2;RC=2009As it can be seen from logs, I have created Queue Manager as QM.TEST and channel as TEST_CHANNEL. The listener port defined for the Queue Manager is 1417 along with protocol TCP.I did lot of google but didn't find any appropriate solution. I appreciate any help in this regard.Thanks in adv, KAmeer### Assistant: I had a similar issue where I have WAS 7 and WMQ 7.5. I was able to make a connection to my existing WMQ 7.0 QM but not my new WMQ 7.5 QM. Apparently there was a change to the WMQ components bundled with WAS 7 after the initial release 7.0.0.0. After updating the resource adapter I was able to make a successfull connection to both queue managers.\n"} +{"text": "### Human: How do i check whether IBM MQ client is installed in the client computer via vb.net winform application?I have added amqmdnet.dll to my project and imported IBM.WMQ namespace.However i don't know how to check IBM MQ client installed in the target computer? (like for example, if you want to check a windows service, you can loop through all the available services, then check for that particular windows service)Any inputs will be highly helpful?### Assistant: Thedspmqvercommand will let you know what is installed.From theMicrosoft KB:CAUTION:Do not use these APIs in your application to perform assembly\n binds or to test for the presence of assemblies or other run time,\n development, or design-time operations. Only administrative tools and\n setup programs must use these APIs. If you use the GAC, this directly\n exposes your application to assembly binding fragility or may cause\n your application to work improperly on future versions of the .NET\n Framework.There is no native MQ API to check the GAC. (Shashi, please correct me if I've overlooked something here. I know you are watching. :-) )\n"} +{"text": "### Human: I have the following code:int openOptions = MQC.MQOO_INQUIRE \n + MQC.MQOO_FAIL_IF_QUIESCING\n + MQC.MQOO_INPUT_SHARED;Which when executed, I am getting an error:com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2042\n MQJE001: Completion Code 2, Reason 2042This happens while connecting my Java program with WebSphere MQ. Please note that the queue property is set as input shared. All help appreciated.### Assistant: Although the queue may be set toDEFSOPT(SHARED), this is only a default. It does not prevent a program from opening it with exclusive use. In particular, transmission queues for non-cluster channels, the command queue and other queues used by MQ system components are opened with exclusive use, regardless of the queue's default setting. Similarly, monitoring programs often open the event queues for exclusive use to ensure that other programs do not compete for messages and result in missed critical events.Is it one of the event or XMit queues? If so, you may not be able to remove the error without stopping the channel or monitoring agent. If it is a user-defined queue, use theDISPLAY QSTATUScommand to see which process has it open for exclusive input, then disconnect that process.Here is an example:C:\\Users\\T.Rob>runmqsc QM75\n5724-H72 (C) Copyright IBM Corp. 1994, 2011. ALL RIGHTS RESERVED.\nStarting MQSC for queue manager QM75.\n\n\ndis qs(system.admin.command.queue) all\n 1 : dis qs(system.admin.command.queue) type(handle) all\nAMQ8450: Display queue status details.\n QUEUE(SYSTEM.ADMIN.COMMAND.QUEUE) TYPE(HANDLE)\n APPLDESC(WebSphere MQ Command Server)\n APPLTAG(here MQ 7.5\\bin\\amqpcsea.exe)\n APPLTYPE(SYSTEM) BROWSE(NO)\n CHANNEL( ) CONNAME( )\n ASTATE(NONE) HSTATE(ACTIVE)\n INPUT(EXCL) INQUIRE(YES)\n OUTPUT(NO) PID(5220)\n QMURID(0.0) SET(NO)\n TID(1)\n URID(XA_FORMATID[] XA_GTRID[] XA_BQUAL[])\n URTYPE(QMGR)The output of the command will repeat for each process attached to the queue. It shows the executable name (in this caseamqpcseawhich is the command server), the type of open, the process ID and the thread ID. Note that here it showsINPUT(EXCL)indicating that nothing else can open the command queue for browsing or getting of messages.\n"} +{"text": "### Human: I am setting a Long property on a TextMessagemsg.setLongProperty(\"publishSequence\", pubSeq);, and sending it to a local IBM WebSphere MQ Queue manager for sending to a remote queue. The message is sending fine, but MQ is removing the Long property when it puts the MQ properties in the message header.Has anyone else encountered this problem before? And if so, how did you work around it?### Assistant: The following link was able to answer my question. I have tested and it works.I usedqueue.setMessageBodyStyle(WMQConstants.WMQ_MESSAGE_BODY_JMS);on the MQQueue object to set the body style to JMS so it would retain the property.\n"} +{"text": "### Human: I'm using WebSphere MQ v7 Server and WebSphere MQ Client v7.5 with amqmdnet.dll 7.5.0.0 as .NET library for communicating over WebSphere MQ. Sometimes when I try to readMQMessagefrom the queue I getMQExceptionwithMQRC_RFH_FORMAT_ERRORreason.var message = new MQMessage();\nqueue.Get(message);This behavior seems dependent on the sender of the message and on its content. It usually doesn't work with systems on different platform sending messages with float or double properties.### Assistant: This is a globalization bug in IBM's amqmdnet.dll. After turning on MQ tracing on the client (strmqtrc.exe) I tried to receive message again and I found this in one of trace files:00001F21 11:48:00.351013 7104.1 : Exception received\nSystem.FormatException\nMessage: Input string was not in a correct format.\nStackTrace:\n at System.Number.ParseSingle(String value, NumberStyles options, NumberFormatInfo numfmt)\n at System.Convert.ToSingle(String value)\n at IBM.WMQ.MQMarshalMessageForGet.GetValueAsObject(String dt, String propValue)\n at IBM.WMQ.MQMarshalMessageForGet.ProcessAllAvailableRFHs()\n00001F22 11:48:00.351115 7104.1 : We are not sucessful in parsing one of theRFH2Header.Raise the RFH_FORMAT exception and breakfurther processing in loop\n00001F23 11:48:00.351825 7104.1 : MQException CompCode: 2 Reason: 2421DecompilingMQMarshalMessageForGetwith.NET Reflectorshowed this:private object GetValueAsObject(string dt, string propValue)\n{\n ...\n\n switch (dt)\n {\n ...\n\n case \"r4\":\n return Convert.ToSingle(propValue);\n\n case \"r8\":\n return Convert.ToDouble(propValue);\n\n ...\n }\n\n ...\n}The messages are read in the current system's culture not in transport expected culture (which should be same on all platforms)! Simple test to reproduce the issue:[Test]\npublic void PutAndGetMessageWithFloatProperty() {\n using (MQQueue queue = _queueManager.AccessQueue(TestQueue, MQC.MQOO_OUTPUT | MQC.MQOO_INPUT_AS_Q_DEF))\n {\n Thread.CurrentThread.CurrentCulture = new CultureInfo(\"en-US\");\n\n MQMessage message = new MQMessage();\n message.SetFloatProperty(\"TEST_SINGLE\", 14.879f);\n message.WriteString(\"some string\");\n message.Format = MQC.MQFMT_STRING;\n\n queue.Put(message); // Writes property value as 14.879\n\n Thread.CurrentThread.CurrentCulture = new CultureInfo(\"cs-CZ\");\n\n MQMessage readMessage = new MQMessage();\n queue.Get(readMessage); // Throws MQException because 14,879 is correct format\n\n queue.Close();\n }\n}WorkaroundI'm using this simple scope class:public class CultureForThreadScope : IDisposable {\n private readonly CultureInfo oldCulture;\n\n public CultureForThreadScope(CultureInfo culture) {\n oldCulture = Thread.CurrentThread.CurrentCulture;\n Thread.CurrentThread.CurrentCulture = culture;\n }\n\n public void Dispose() {\n Thread.CurrentThread.CurrentCulture = oldCulture;\n }\n}And I'm wrapping everyGetcall to the scope.using (new CultureForThreadScope(CultureInfo.InvariantCulture)) {\n destination.Get(message, getOptions);\n}\n"} +{"text": "### Human: How to clean jms queue from spring jms? Like \"clean\" command from MQ Explorer? Or I should recieve messages until them end?### Assistant: You cannot issue a clean command easily from JMS, since that requires the full MQI api. As you say, a good way is to read all messages one by one and discard them. You even get the choice to do this when clearing a queue in MQ explorer as well\n"} +{"text": "### Human: I have WebSphere MQ Client v7.1 on a 64-bit Linux box. I see setmqenv and setmqinst scripts on /opt/mqm/bin directory. I do not see setjmsenv64 or setjmsenv there. What else do I need to install to get these. I want to include this in the .profile to set the environment paths and then to set the classpaths. Thank you.### Assistant: Look in/opt/mqm/java/bininstead. I just downloaded and installed the current version fromSupportPac MQC71onto a Linux x64 VM and verified it has the required files.SLESS11X64:/tmp/wmq # ll\ntotal 351112\n-r--r--r-- 1 226 12201 261 2011-10-14 16:36 copyright\n-rwxr-xr-x 1 226 12201 4590 2011-10-14 16:36 crtmqpkg\ndrwxr-sr-x 4 226 12201 4096 2011-10-14 16:36 lap\ndrwxr-sr-x 2 226 12201 4096 2011-10-14 16:36 licenses\n-rwxr-xr-x 1 root root 216757299 2012-03-29 14:11 mqc71_7.1.0.0_linuxx86-64.tar.gz\n-rwxr-xr-x 1 226 12201 5228 2011-10-14 16:36 mqlicense.sh\n-rw-r--r-- 1 226 12201 4144935 2011-10-14 16:35 MQSeriesClient-7.1.0-0.x86_64.rpm\n-rw-r--r-- 1 226 12201 22345729 2011-10-14 16:36 MQSeriesGSKit-7.1.0-0.x86_64.rpm\n-rw-r--r-- 1 226 12201 23640155 2011-10-14 16:35 MQSeriesJava-7.1.0-0.x86_64.rpm\n-rw-r--r-- 1 226 12201 70922394 2011-10-14 16:35 MQSeriesJRE-7.1.0-0.x86_64.rpm\n-rw-r--r-- 1 226 12201 293337 2011-10-14 16:36 MQSeriesMan-7.1.0-0.x86_64.rpm\n-rw-r--r-- 1 226 12201 18887546 2011-10-14 16:35 MQSeriesRuntime-7.1.0-0.x86_64.rpm\n-rw-r--r-- 1 226 12201 831749 2011-10-14 16:35 MQSeriesSamples-7.1.0-0.x86_64.rpm\n-rw-r--r-- 1 226 12201 244406 2011-10-14 16:35 MQSeriesSDK-7.1.0-0.x86_64.rpm\n-rw-r--r-- 1 226 12201 1015568 2011-10-14 16:36 MQSeriesXRClients-7.1.0-0.x86_64.rpm\ndrwxr-sr-x 3 226 12201 4096 2011-10-14 16:36 PreReqs\ndrwxr-sr-x 18 226 12201 4096 2011-10-14 16:42 READMEs\ndrwxr-sr-x 2 226 12201 4096 2011-10-14 16:36 repackage\nSLESS11X64:/tmp/wmq # ./mqlicense.sh -accept\n\nLicensed Materials - Property of IBM \n\n 5724-H72 \n\n (C) Copyright IBM Corporation 1994, 2011 All rights reserved.\n\nUS Government Users Restricted Rights - Use, duplication or disclosure\nrestricted by GSA ADP Schedule Contract with IBM Corp.\n\n\n\nAgreement accepted: Proceed with install.\n\nSLESS11X64:/tmp/wmq # ll\ntotal 351112\n-r--r--r-- 1 226 12201 261 2011-10-14 16:36 copyright\n-rwxr-xr-x 1 226 12201 4590 2011-10-14 16:36 crtmqpkg\ndrwxr-sr-x 4 226 12201 4096 2011-10-14 16:36 lap\ndrwxr-sr-x 2 226 12201 4096 2011-10-14 16:36 licenses\n-rwxr-xr-x 1 root root 216757299 2012-03-29 14:11 mqc71_7.1.0.0_linuxx86-64.tar.gz\n-rwxr-xr-x 1 226 12201 5228 2011-10-14 16:36 mqlicense.sh\n-rw-r--r-- 1 226 12201 4144935 2011-10-14 16:35 MQSeriesClient-7.1.0-0.x86_64.rpm\n-rw-r--r-- 1 226 12201 22345729 2011-10-14 16:36 MQSeriesGSKit-7.1.0-0.x86_64.rpm\n-rw-r--r-- 1 226 12201 23640155 2011-10-14 16:35 MQSeriesJava-7.1.0-0.x86_64.rpm\n-rw-r--r-- 1 226 12201 70922394 2011-10-14 16:35 MQSeriesJRE-7.1.0-0.x86_64.rpm\n-rw-r--r-- 1 226 12201 293337 2011-10-14 16:36 MQSeriesMan-7.1.0-0.x86_64.rpm\n-rw-r--r-- 1 226 12201 18887546 2011-10-14 16:35 MQSeriesRuntime-7.1.0-0.x86_64.rpm\n-rw-r--r-- 1 226 12201 831749 2011-10-14 16:35 MQSeriesSamples-7.1.0-0.x86_64.rpm\n-rw-r--r-- 1 226 12201 244406 2011-10-14 16:35 MQSeriesSDK-7.1.0-0.x86_64.rpm\n-rw-r--r-- 1 226 12201 1015568 2011-10-14 16:36 MQSeriesXRClients-7.1.0-0.x86_64.rpm\ndrwxr-sr-x 3 226 12201 4096 2011-10-14 16:36 PreReqs\ndrwxr-sr-x 18 226 12201 4096 2011-10-14 16:42 READMEs\ndrwxr-sr-x 2 226 12201 4096 2011-10-14 16:36 repackage\nSLESS11X64:/tmp/wmq # rpm -ivh *rpm\nPreparing... ########################################### [100%]\nCreating group mqm\nCreating user mqm\n 1:MQSeriesRuntime ########################################### [ 11%]\n 2:MQSeriesJRE ########################################### [ 22%]\n 3:MQSeriesClient ########################################### [ 33%]\n 4:MQSeriesGSKit ########################################### [ 44%]\n 5:MQSeriesJava ########################################### [ 56%]\n 6:MQSeriesMan ########################################### [ 67%]\n 7:MQSeriesSamples ########################################### [ 78%]\n 8:MQSeriesSDK ########################################### [ 89%]\n 9:MQSeriesXRClients ########################################### [100%]\n\nSLESS11X64:/opt/mqm/java # ll /opt/mqm/java/bin\ntotal 72\n-r-xr-xr-x 1 mqm mqm 750 2011-10-14 16:32 Cleanup\n-r-xr-xr-x 1 mqm mqm 315 2011-10-14 16:32 formatLog\n-r-xr-xr-x 1 mqm mqm 804 2011-10-14 16:32 IVTRun\n-r-xr-xr-x 1 mqm mqm 1045 2011-10-14 16:32 IVTSetup\n-r-xr-xr-x 1 mqm mqm 1478 2011-10-14 16:32 IVTTidy\n-r-xr-xr-x 1 mqm mqm 952 2011-10-14 16:32 JMSAdmin\n-r--r--r-- 1 mqm mqm 3375 2011-10-14 16:32 JMSAdmin.config\n-r--r--r-- 1 mqm mqm 15354 2011-10-14 16:32 jms.config\n-r--r--r-- 1 mqm mqm 7389 2011-10-14 16:32 MQJMS_PSQ.mqsc\n-r-xr-xr-x 1 mqm mqm 827 2011-10-14 16:32 PSIVTRun\n-r--r--r-- 1 mqm mqm 236 2011-10-14 16:32 PSReportDump.class\n-r-xr-xr-x 1 mqm mqm 1041 2011-10-14 16:32 runjms\n-r-xr-xr-x 1 mqm mqm 1356 2011-10-14 16:32 setjmsenv\n-r-xr-xr-x 1 mqm mqm 1372 2011-10-14 16:32 setjmsenv64\nSLESS11X64:/opt/mqm/java #\n"} +{"text": "### Human: I have got a Spring MDP implemented using SpringDefaultMessageListenderContainerlistening to an input queue on WebSphere MQ v7.1. If there is a bad message coming in (that causesRuntimeException), what currently happens is that, the transaction is rolled back, and the message is put back into the queue. However the MDP goes into an infinite loop.Question 1: For my requirements I would like to be able to shut down the processing the moment it sees a bad message. No retries needed. Is it possible to shutdown the message listener gracefully in case it sees a bad message (as opposed to crudeSystem.exit()or methods of that sort)? I definitely don't like it to go into an infinite loop.Edit:Question 2: Is there a way to stop or suspend the listener container to stop further processing of messages?### Assistant: The usual way to process this is to have an error queue and when you see a bad message to put it into the error queue.Some systems handle this for you such as IBM MQ Series. You just need to configure the error queue and how many retries you want ant it will put it there.An administrator will then look through these queues and take proper action on the messages that are in the queue (i.e. fix and resubmit them)\n"} +{"text": "### Human: Executing the below code which attempts to connect WebSphere MQ QueueManager using client mode I gotMQJMS2005exceptionMQQueueConnectionFactory cf = new MQQueueConnectionFactory();\ncf.setPort(port);\ncf.setHostName(host);\ncf.setChannel(channel);\ncf.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);\ncf.setQueueManager(queuemanager);\n\nconn = (MQQueueConnection)cf.createQueueConnection();I use com.ibm.mq.jar , com.ibm.mqjms.jar, dhbcore.jar, jmscommon.jar and j2ee.jar.I assume this might be something related to permission, because the same code can work fine on another machine when connecting to another host/port/channel/queue manager/queueThe stack trace is as follows:javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for 'host:queuemanager'\nat com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:644)\nat com.ibm.mq.jms.MQConnection.createQM(MQConnection.java:2591)\nat com.ibm.mq.jms.MQConnection.createQMNonXA(MQConnection.java:1936)\nat com.ibm.mq.jms.MQQueueConnection.(MQQueueConnection.java:161)\nat com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:206)\nat com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:126)\nat MQTest.init(MQTest.java:51)How can I troubleshoot this so that I can make run the code sucessfully?### Assistant: This is the exception comming we have issue with .binding file or in the DEV-WEST file , where we are configuring the MQ client information like \nSSP-FLOW.VERICHECK_HOST_NAME = 113.130.234.174 i.e \ncheck all these area , these are the flaw area due to which exception if comming .\n"} +{"text": "### Human: I use JMS (Java Message Service API) in my java application to work with queues/topics residing on websphere MQ. I am looking for a tool/support pac which can show me all MQ Messages being called e.g. when I do queueConnectionFactory.createConnection(), it would have resulted into MQCONN/MQCONNX call, so I need to see what excatly is being passed. So basically during my entire JMS based interaction, I want to see all MQ messages which are being passed to. Is it possible?### Assistant: if you are using websphere, you can turn on tracing by going to WAS console and tracing service to enable jms logging.\n"} +{"text": "### Human: I've been running JProfiler for a day or so and keep seeing new threads being created for the JMS Listener to a topic in WMQ. It seems to go through phases of dropping out every few minutes for half hour and then works fine for hours. I'm struggling to track down the reason why, there seems to be nothing in the logs on the server hosting WMQ so my next step it to turn on the logging client side in java but can't figure out how to do this. I was hoping it would be as straightforward as adding a line in the log4j file settinglog4j.logger.com.ibm=TRACEbut that didn't work. Does anyone have any ideas of how I can achieve this?### Assistant: The Infocenter has some documentation as to all the classes that can be enabled and their include/exclude options.For example, the class you want to set on the client side iscom.ibm.msg.client.commonservices.trace.leveland it takes integer values. There is no JMS tracing on the QMgr itself but there is extensive QMgr trace available using thestrmqtrccommand.The V7 client has a lot more trace functionality and it is recommended to use it instead of the V6 client. It is permissible to use the V7 client with the V6 QMgr. Of course in that case the API functionality is limited to what the V6 QMgr provides. However, the V7 client-side functionality (such as trace) is not limited by the QMgr version.V7 Infocenter JMS TraceV6 Infocenter JMS TraceV7 WMQ Client\n"} +{"text": "### Human: I would like to use the Websphere MQ Java API to create channels, listeners, queues, etc. Is there a way of checking if a object of a given type, e.g. channel already exists on the queue manager?### Assistant: If you are using the Java API then you will want to send Programmable Command Format (PCF) messages to the command server. Look forcom.ibm.mq.pcfin theMQ Javadocfor the API. In order to use these, you will need to refer often to the nativePCF documentation.To check existence of an object using PCF you would issue an inquire command against it. There are extensive PCF samples provided if you have performed a full install of the WMQ client or server. On Windows these live atC:\\Program Files\\IBM\\WebSphere MQ\\tools\\pcf\\samples. Nearly all of the samples use a PCF inquire function of one type or another butPCF_ClearQueue.javais probably the closest to what you are after.Of course, if all you need is to check the existence of an object, just open it for inquire. If you get back a 2085 return code, the object does not exist.If you have just copied the classes and need the full install to get the samples, it is freely downloadable asSupportPac MQC7. Youdefinitelywant to be using the v7 classes, even if the QMgr is at v6. WMQ v6 is end-of-life as of September 2011 and you get better integration of the PCF classes in v7 anyway..\n"} +{"text": "### Human: In other queue managers it is possible to setup a bridge between a queue to a topic so that publishers and subscribers does not need to know that they are using a topic:Example inTIBCO EMScreate Bridge source=queue:QName\n target=topic:TNamecreate Bridge\n source=topic:TName target=queue:QNameHow do I do this in WMQ?### Assistant: See WebSphereMQ V7.0 Features and Enhancementspage 47, it mentions the use of Alias queues and administrative subscriptionsWebSphere MQ V7.0 introduces an\n extension to the alias queue object\n that allows it to be resolved to the\n new topic object. This is useful for\n migrating point-to-point messaging\n applications to the Publish/Subscribe\n model. A traditional point-to-point\n application that puts messages into\n WebSphere MQ can operate as a\n publisher without any code changes by\n utilizing an alias queue that resolves\n to a topic object. This is implemented\n administratively by defining a topic\n object that maps to an appropriate\n topic string on which the messages are\n to be published. The original local\n queue is deleted and replaced by an\n alias queue of the same name that\n resolves to the topic object. Also\n note that a point-to-point application\n that gets messages from WebSphere MQ\n can operate as a subscriber without\n any code changes by defining an\n administrative subscription to a\n topic.Example 9.3 on page 220 shows how to setup a administrative subscription from a Topic to a destination queueDEFINE SUB(SUB.RETAIL.CAT) TOPICOBJ(MATT.RETAIL.CAT) DESTCLAS(MANAGED)\nDEFINE SUB(SUB.MATTRETCAT) TOPICSTR(\u2018matt/retail/cat\u2019) DESTCLAS(MANAGED)\nDEFINE SUB(SUB.PROVCAT) TOPICSTR(\u2018matt/retail/cat\u2019) DEST(SUB.PROVCAT.DESTQ)\n"} +{"text": "### Human: I'm really newbie with WebSphere MQ, but I have one question regarding the MQMessage API.\nIt seems that a receiver of MQMessage should know in advance:The message type that was written (if WriteInt then ReadInt etc..)The properties names and types (if SetBooleanProperty(Name) then GetBooleanProperty(Name))It make no sense to me. Since If i'm not familiar with the message structure should I explore all options until I retrieve the data in it?Help will be appreciated,\nGuy### Assistant: Yes, you are absolutely correct that if the message is structured data such as a fixed-length record format, you must know in advance the format of the message in order to parse it. On the other hand, if the message payload is tagged data structure (such as valid XML) then you would use normal parsing to access it. For example, you might use XPath to access an XML payload without first knowing the exact structure.The methods that you mention (WriteInt, ReadInt, etc.) would ordinarily be used to extract data from a known format and advance the buffer pointer to the next field. However, there are also methods to read and write UTF strings. If for some reason your application must process a variety of message types, then you can inquire on the message format and message type by querying the message descriptor. The method for doing this is documented inMessage descriptor fields as properties. In this way you can distinguish between different types and formats of message and parse them appropriately.Note that the docs I have linked above are to the v7 .Net classes. Since v6 end-of-life is September 2011, it is hoped that new development is all with the v7 classes, and preferably connecting to a v7 QMgr.Edit - Response to commentsExample of checking the message format:As per the page linked above, check the C header file cmqc.h for the fields in the MQMD. This will tell you the field name as well as the field type. In a default Windows installation, this file lives atC:\\Program Files\\IBM\\WebSphere MQ\\tools\\c\\include\\cmqc.hSo for example,message.getStringProperty('Root.MQMD.Format')returns the message format. Near the top of cmqc.h you will find a list of macros named MQFMT_ with the possible values for the MQMD Format field. As of v7.01 they look like this:/* Formats */\n #define MQFMT_NONE \" \"\n #define MQFMT_ADMIN \"MQADMIN \"\n #define MQFMT_CHANNEL_COMPLETED \"MQCHCOM \"\n #define MQFMT_CICS \"MQCICS \"\n #define MQFMT_COMMAND_1 \"MQCMD1 \"\n #define MQFMT_COMMAND_2 \"MQCMD2 \"\n #define MQFMT_DEAD_LETTER_HEADER \"MQDEAD \"\n #define MQFMT_DIST_HEADER \"MQHDIST \"\n #define MQFMT_EMBEDDED_PCF \"MQHEPCF \"\n #define MQFMT_EVENT \"MQEVENT \"\n #define MQFMT_IMS \"MQIMS \"\n #define MQFMT_IMS_VAR_STRING \"MQIMSVS \"\n #define MQFMT_MD_EXTENSION \"MQHMDE \"\n #define MQFMT_PCF \"MQPCF \"\n #define MQFMT_REF_MSG_HEADER \"MQHREF \"\n #define MQFMT_RF_HEADER \"MQHRF \"\n #define MQFMT_RF_HEADER_1 \"MQHRF \"\n #define MQFMT_RF_HEADER_2 \"MQHRF2 \"\n #define MQFMT_STRING \"MQSTR \"\n #define MQFMT_TRIGGER \"MQTRIG \"\n #define MQFMT_WORK_INFO_HEADER \"MQHWIH \"\n #define MQFMT_XMIT_Q_HEADER \"MQXMIT \"The actual MQMD structure is defined near the bottom of cmqc.h. As of v7.0.1 it looks like this:/****************************************************************/\n /* MQMD2 Structure -- Version-2 Message Descriptor */\n /****************************************************************/\n\n\n typedef struct tagMQMD2 MQMD2;\n typedef MQMD2 MQPOINTER PMQMD2;\n\n struct tagMQMD2 {\n MQCHAR4 StrucId; /* Structure identifier */\n MQLONG Version; /* Structure version number */\n MQLONG Report; /* Report options */\n MQLONG MsgType; /* Message type */\n MQLONG Expiry; /* Expiry time */\n MQLONG Feedback; /* Feedback or reason code */\n MQLONG Encoding; /* Numeric encoding of message data */\n MQLONG CodedCharSetId; /* Character set identifier of message\n data */\n MQCHAR8 Format; /* Format name of message data */\n MQLONG Priority; /* Message priority */\n MQLONG Persistence; /* Message persistence */\n MQBYTE24 MsgId; /* Message identifier */\n MQBYTE24 CorrelId; /* Correlation identifier */\n MQLONG BackoutCount; /* Backout counter */\n MQCHAR48 ReplyToQ; /* Name of reply-to queue */\n MQCHAR48 ReplyToQMgr; /* Name of reply queue manager */\n MQCHAR12 UserIdentifier; /* User identifier */\n MQBYTE32 AccountingToken; /* Accounting token */\n MQCHAR32 ApplIdentityData; /* Application data relating to\n identity */\n MQLONG PutApplType; /* Type of application that put the\n message */\n MQCHAR28 PutApplName; /* Name of application that put the\n message */\n MQCHAR8 PutDate; /* Date when message was put */\n MQCHAR8 PutTime; /* Time when message was put */\n MQCHAR4 ApplOriginData; /* Application data relating to\n origin */\n MQBYTE24 GroupId; /* Group identifier */\n MQLONG MsgSeqNumber; /* Sequence number of logical message\n within group */\n MQLONG Offset; /* Offset of data in physical message\n from start of logical message */\n MQLONG MsgFlags; /* Message flags */\n MQLONG OriginalLength; /* Length of original message */\n };The cmqc.h file defines macros for each of the fields shown and these will contain the possible values. These macros are also defined in the .Net classes as the MQC object. MQCis described herebut since it has no methods, the page just refers you to the list of WMQ constants which it defines. That pageis here.\n"} +{"text": "### Human: I can't reconnect to MQQueueManager after a while as an exception (reason code2059- MQRC_Q_MGR_NOT_AVAILABLE) is thrown when I'm constructing new object of MQQueueManager. My client app is written in .NET/C# and I'm running it on Win2003.However I can connect to QM after I have restarted my client app. This would indicate that some state is incorrect in QM libraries? How can I reset the state in code so that I could reconnect to QM? Is there a way to reset/disconnect all active TCP connections to QM from client app code?My connection code:Hashtable properties = new Hashtable();\n properties.Add( MQC.HOST_NAME_PROPERTY, Host );\n properties.Add( MQC.PORT_PROPERTY, Port );\n properties.Add( MQC.USER_ID_PROPERTY, UserId );\n properties.Add( MQC.PASSWORD_PROPERTY, Password );\n properties.Add( MQC.CHANNEL_PROPERTY, ChannelName );\n properties.Add( MQC.TRANSPORT_PROPERTY, TransportType );\n // Following line throws an exception randomly\n MQQueueManager queueManager = new MQQueueManager( qmName, properties );Stack trace:Source: amqmdnet\n CompletionCode: 2\n ReasonCode: 2059\n Reason: 2059\n Stack Trace:\n at IBM.WMQ.MQBase.throwNewMQException()\n at IBM.WMQ.MQQueueManager.Connect(String queueManagerName)\n at IBM.WMQ.MQQueueManager..ctor(String qmName, Hashtable properties)\n at WebSphereMQOutboundAdapter.WebSphereMQOutbound.ConnectToWebSphereMQ()### Assistant: Connections are per-thread so if you are attempting to create a new connection while the previous QMgr object is still instantiated, you would get this. If you close the previous connection and destroy the object before creating a new object you should be OK. Since queues and other WMQ objects depend on a connection handle these will also need to be destroyed and then reinstantiated after the new connection is made.There are of course a few other explanations for this behavior but these are much less likely. For example, it is possible that a channel exit or (in WMQ v7) configuration could be limiting the number of simultaneous connections from a given IP address. When a connection is severed rather than closed, the channel agent holding the connection on the QMgr side has to time out before the QMgr sees the connection as closed. If connection limiting is in place, these \"ghost\" connections reduce the available pool. But as I said, this is far less common than programs not cleaning up old objects prior to a reconnect attempt.There is also the possibility that this is a bug. To reduce that possibility, and for a variety of other reasons such as WMQ v6 going end of life next year, I'd recommend use of WMQ v7.0.1.2 for this project, at both the client and server side. In general, you can use v7.0.1.2 client with a v6.0.x server as long as you stick to v6 functionality. Among other things, .Net code is better integrated in v7 and the Cat-3 SupportPacs are now included in the base install media rather than a separate download.\n"} +{"text": "### Human: Does someone know how to integrate MSMQ to an IBM WebSphere MQ? I guess one can always use BizTalk 2009 (Biztalk host integration server)but that seems to be quite an overkill just to be able to exchange messages between MSMQ and WMQ. Please give me some advice! Someone must have done this before!If it helps your recommendation the WMQ is running in a main frame environment, and one under zLinux (SLES 11).Br.\nAusgar### Assistant: There is a MSMQ-MQSeries Bridge available through Host Integration serverSearch for \"Using the MSMQ-MQSeries Bridge\" under HIS 2009, cause I can't post links....\n"} +{"text": "### Human: On a SOA project we start to employ IBM WebSphere Message Broker to orchestrate .NET-based web services. We have distinct DEV, QA and PROD environments for the system being developed.WebSphere Message Broker Toolkit would be used to develop message flows in DEV. And with DEV everything is more or less clear.For QA and PROD we aim to have repeatable and as automated and possible deployment procedure. With .NET portion it almost a no-brainer, but deployment to Message Broker seem to require substantial manual effort, which is not good.What are recommendations for deployment to WebSphere Message Broker? What is the best way to package Message Broker components?### Assistant: You components (flows and so forth) will be packaged up as Broker Archive (.bar) files. You can use Ant to script the deployment of these components between environments, for example.\n"} +{"text": "### Human: I have a fresh install of Wesphere 6.1 Fixpack 23. I have an app deployed that requires an MQSeries JMS Queue. I set up an MQSeries provider-based request and reply queue and an MQSeries provider-based queue connection factory. When the deployed app tries to access the queue, I receive the following error.Any assistance would be appreciated. Thanks![5/28/09 10:33:42:538 EDT] 00000033 ServletWrappe E SRVE0068E: Uncaught exception thrown in one of the service methods of the servlet: espaapp. Exception thrown : org.springframework.web.util.NestedServletException: Handler processing failed; nestedexception is java.lang.UnsatisfiedLinkError:mqjbnd05 (Not found in java.library.path)Caused by: java.lang.UnsatisfiedLinkError: mqjbnd05 (Not found in java.library.path)at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:953)\n at java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:922)\n at java.lang.System.loadLibrary(System.java:451)\n at com.ibm.mq.MQSESSION.loadLib(MQSESSION.java:1028)\n at com.ibm.mq.server.MQSESSION$1.run(MQSESSION.java:246)\n at java.security.AccessController.doPrivileged(AccessController.java:192)\n at com.ibm.mq.server.MQSESSION.(MQSESSION.java:243)\n at java.lang.J9VMInternals.initializeImpl(Native Method)\n at java.lang.J9VMInternals.initialize(J9VMInternals.java:177)\n at com.ibm.mq.MQSESSIONServer.getMQSESSION(MQSESSIONServer.java:68)\n at com.ibm.mq.MQSESSION.getSession(MQSESSION.java:508)\n at com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:213)\n at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11._createManagedConnection(MQBindingsManagedConnectionFactoryJ11.java:186)\n at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11.createManagedConnection(MQBindingsManagedConnectionFactoryJ11.java:225)\n at com.ibm.mq.StoredManagedConnection.(StoredManagedConnection.java:84)\n at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:173)\n at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:795)\n at com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:709)\n at com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:664)\n at com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:160)\n at com.ibm.mq.MQQueueManager.(MQQueueManager.java:550)\n at com.ibm.mq.MQSPIQueueManager.(MQSPIQueueManager.java:62)\n at com.ibm.mq.jms.MQConnection.createQM(MQConnection.java:2427)\n at com.ibm.mq.jms.MQConnection.createQMXA(MQConnection.java:1806)\n at com.ibm.mq.jms.MQQueueConnection.(MQQueueConnection.java:105)\n at com.ibm.mq.jms.MQQueueConnection.(MQQueueConnection.java:66)\n at com.ibm.mq.jms.MQXAQueueConnection.(MQXAQueueConnection.java:59)\n at com.ibm.mq.jms.MQXAQueueConnectionFactory.createXAQueueConnection(MQXAQueueConnectionFactory.java:82)\n at com.ibm.ejs.jms.JMSManagedQueueConnection.createConnection(JMSManagedQueueConnection.java:123)\n at com.ibm.ejs.jms.JMSManagedConnection.(JMSManagedConnection.java:315)\n at com.ibm.ejs.jms.JMSManagedQueueConnection.(JMSManagedQueueConnection.java:71)\n... More### Assistant: Does this help?java.lang.UnsatisfiedLinkError occurs when connecting to a queue managerAlso, within the JMS -> Queue Connection Factories section, select your Queue Connection Factory and check if your \"Transport Type\" is set to 'BINDINGS' or 'CLIENT'I swapped mine to CLIENT and that seemed to help a lot.\n"} +{"text": "### Human: I'm brand new to WebSphere MQ. I'm using IBM's .NET classes (IBM.WMQ) to put a request message and then get a response message. The MQMessage object has a number of Writexxx methods for various data types. I need to write a variety of different data elements to the request message. My question is, should I call the appropriate Write method for each individual data element, or should I build the whole thing with a StringBuilder and then call the MQMessage WriteString method once?### Assistant: The write APIs are to try an help you write clearer code, but whoever converted the WMQ API to .Net is an idiot.They wrote 20 different APIs instead of a \"write\" function with overloads. The write call has a few usable overloads.They created one enum which has 100's if not thousands of options called MQC (MQ Constants). Have fun, but beware of transactions on WMQ, as there is a *cough small cost involved in using that functionality.Now that I'm done with my rant, beware of the APIs that most of the apis have a limitation of an signed int in terms of size, only the write(byte[] array) and the writestring(string s) function take a large message. Also the .net api writes all strings UTF-16 as per .net's implementation which may affect you.\n"} +{"text": "### Human: I'm using the JMS API to send messages to a Websphere MQ server.\nThe application that pulls the messages I create want me to set up the ApplicationID field\nin the MQMD structure to constant value.\nI could not find a way in the JMS API to access the MQMD structureThe question: Is there a way doing this? if yes then how? If no, then is my only option\nis to use the MQ java API, instead of JMS API?### Assistant: As of v7.0, you can read all the MQMD fields as JMS message properties and can set many of them the same way.See:http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzaw.doc/jm41030_.htmBoth the client and the WMQ server must be at v7.0 or higher to use this feature, though.\n"} +{"text": "### Human: Trying to change CipherSpec fromTLS_RSA_WITH_AES_256_CBC_SHA256toTLS_AES_256_GCM_SHA384.\nFor TLS_RSA_WITH_AES_256_CBC_SHA256 I was able to connect to IBMMQ queues.\nAfter changing to TLS_AES_256_GCM_SHA384 I get error:Interop+OpenSsl+SslException: SSL Handshake failed with OpenSSL error - SSL_ERROR_SSL.\n---> Interop+Crypto+OpenSslCryptographicException: error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate\n --- End of inner exception stack trace ---\n at Interop.OpenSsl.DoSslHandshake(SafeSslHandle context, ReadOnlySpan 1 input, Byte[]& sendBuf, Int32& sendCount)\n at System.Net.Security.SslStreamPal.HandshakeInternal(SafeFreeCredentials credential, SafeDeleteSslContext& context, ReadOnlySpan 1 inputBuffer, Byte[]& outputBuffer, SslAuthenticationOptions sslAuthenticationOptions)\n --- End of inner exception stack trace ---\n at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthenticationData, Boolean isApm)\n at System.Net.Security.SslStream.AuthenticateAsClient(SslClientAuthenticationOptions sslClientAuthenticationOptions)\n at System.Net.Security.SslStream.AuthenticateAsClient(String targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation)\n at IBM.WMQ.Nmqi.MQEncryptedSocket.MakeSecuredConnection()Should I configure anything else?\nI will add that the app is on Linux, the connection that establishes from the .Net client is managed.Openssl config:CipherString = @SECLEVEL=1:kEECDH:kRSA:kEDH:kPSK:kDHEPSK:kECDHEPSK:-aDSS:-3DES:!DES:!RC4:!RC2:!IDEA:-SEED:!eNULL:!aNULL:!MD5:-SHA384:-CAMELLIA:-ARIA:-AESCCM8:AES256-SHA256:!ECDHE-RSA-AES256-GCM-SHA384:!AES256-GCM-SHA384:!AES128-SHA256\n\nCiphersuites = TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:TLS_AES_128_CCM_SHA256\n\nTLS.MinProtocol = TLSv1.2\nTLS.MaxProtocol = TLSv1.3\n\nDTLS.MinProtocol = DTLSv1.2\nDTLS.MaxProtocol = DTLSv1.2\n\nSignatureAlgorithms = ECDSA+SHA256:ECDSA+SHA384:ECDSA+SHA512:ed25519:ed448:rsa_pss_pss_sha256:rsa_pss_rsae_sha256:rsa_pss_pss_sha384:rsa_pss_rsae_sha384:rsa_pss_pss_sha512:rsa_pss_rsae_sha512:RSA+SHA256:RSA+SHA384:RSA+SHA512:ECDSA+SHA224:RSA+SHA224:ECDSA+SHA1:RSA+SHA1sh-4I am usingIBMXMSDotnetClient version 9.3.2.The error I get after changing the cipher is :2059 (080B) (RC2059): MQRC_Q_MGR_NOT_AVAILABLE.When I use the old one on the server side, a cipher mismatch error is returned (without ssl error), i.e. it shows that I used TLS_RSA_WITH_AES_256_CBC_SHA256 when I should have used TLS_AES_256_GCM_SHA384.### Assistant: According to theIANA siteTLS_AES_256_GCM_SHA384is HEX0x13,0x02, commonly written1302.You do not mention the version of MQ running on the server but do state it did not support TLS1.3, v9.2 is when MQ started to support TLS1.3 so I'll assume 9.1 or lower.According to the IBM MQEnabling CipherSpecs page1302 is not supported.I suspect you really want the TLS1.2 cipherTLS_RSA_WITH_AES_256_GCM_SHA384which is supported and is 009D.According to thistestssl.sh openssl mapping site1302=openssl cipherTLS_AES_256_GCM_SHA384which matches the IANA nameTLS_AES_256_GCM_SHA384and is what you specified.009D=openssl cipherAES256-GCM-SHA384which has the IANA nameTLS_RSA_WITH_AES_256_GCM_SHA384which matches what the IBM MQ queue manger would call it and supports as a TLS1.2 cipher.I suggest you update your openssl to specify the TLS1.2 cipherAES256-GCM-SHA384instead of the TLS1.3 cipherTLS_AES_256_GCM_SHA384.\n"} +{"text": "### Human: Can someone help me to send a JMS message to IBM-MQ with IIH (MQIIH) headers?I am using the Spring Boot application withmq-jms-spring-boot-starterversion2.4.5.When I send a message it always goes with the RFH2 header although it setsStrucIdasIIHin the message header.public void send(Request mqRequest) throws JMSException {\n log.info(\"sending with message [{}] to queue [{}].\", mqRequest.getMessage(), QUEUE_NAME);\n MQQueue destinationQueue = new MQQueue(QUEUE_NAME);\n jmsTemplate.convertAndSend(destinationQueue, mqRequest.getMessage(), message -> {\n log.info(\"setting standard JMS headers before sending\");\n message.setJMSCorrelationID(UUID.randomUUID().toString());\n message.setJMSDestination(new MQQueue(QUEUE_NAME));\n message.setJMSTimestamp(System.nanoTime());\n message.setJMSType(\"MQIIH\");\n message.setStringProperty(\"Authenticator\", \"********\");\n message.setStringProperty(\"Format\", \"********\");\n message.setStringProperty(\"ReplyToFormat\", \"********\");\n message.setIntProperty(\"CommitMode\", '0');\n message.setStringProperty(\"LTermOverride\", \"********\");\n message.setStringProperty(\"MFSMapName\", \"********\");\n message.setIntProperty(\"SecurityScope\", 'C');\n message.setStringProperty(\"StrucId\", \"IIH \");\n message.setIntProperty(\"StrucLength\", 84);\n message.setIntProperty(\"Version\", 1);\n return message;\n });\n}### Assistant: You can not do this with pure JMS, you have to use theMQIIHhelper class:import java.io.ByteArrayOutputStream;\nimport java.io.DataOutputStream;\nimport javax.jms.BytesMessage;\nimport com.ibm.mq.headers.MQIIH;\nimport com.ibm.msg.client.jms.JmsConstants;\n...\n\npublic void send(Request mqRequest) throws JMSException {\n log.info(\"sending with message [{}] to queue [{}].\", mqRequest.getMessage(), QUEUE_NAME);\n MQIIH mqiih = new MQIIH();\n mqiih.setAuthenticator(\"***\");\n // set other MQIIH header values\n ByteArrayOutputStream mqiihBytes = new ByteArrayOutputStream();\n mqiih.write(new DataOutputStream(mqiihBytes));\n String destinationQueue = \"queue:///\" + QUEUE_NAME + \"?targetClient=1\";\n jmsTemplate.send(destinationQueue, (MessageCreator) session -> {\n BytesMessage message = session.createBytesMessage();\n message.setStringProperty(JmsConstants.JMS_IBM_FORMAT, \"MQIMS\");\n message.writeBytes(mqiihBytes.toByteArray());\n message.writeBytes(\"This Is The Body\".getBytes());\n return message;\n\n });\n}With the queue optiontargetClient=1the usual RFH2 header with JMS meta information gets stripped. The message will look like this:5724-H72 (C) Copyright IBM Corp. 1994, 2022.\nIBM MQ Queue Load/Unload Utility\n* DMPMQMSG Version:9.3.1.0 Created:Wed Jan 11 08:41:37 2023\n* Qmgr = QM1\n* Queue = Q1\n\nA VER 2\nA RPT 0\nA MST 8\nA EXP -1\nA FDB 0\nA ENC 273\nA CCS 819\nA FMT MQIMS \nA PRI 4\nA PER 1\nA MSI 414D5120514D312020202020202020204337BB6301ED0140\nA COI 000000000000000000000000000000000000000000000000\nA BOC 0\nA RTQ \nA RTM QM1 \nA USR mqm \nA ACC 0000000000000000000000000000000000000000000000000000000000000000\nA AIX 2020202020202020202020202020202020202020202020202020202020202020\nA PAT 28\nA PAN runner.RemoteTestRunner \nA PTD 20230111\nA PTT 08413426\nA AOX 20202020\nA GRP 000000000000000000000000000000000000000000000000\nA MSQ 1\nA OFF 0\nA MSF 0\nA ORL -1\nT IIH \nX 00000001000000\nT T\nX 0000011100000000\nT \nX 00000000\nT *** \nX 00000000000000000000000000000000\nT This Is The Body\n\nRead - Files: 0 Messages:1 Bytes:100\nWritten - Files: 0 Messages:1 Bytes:100\n"} +{"text": "### Human: After upgrading to JDK 11 from JDK 8 and MQ 9.2.0.5 (from 9.2.0.4), i'm getting the below error when trying to open JMS connection.I'm running on WLS 14.I also upgraded allclient.jar to 9.2.0.5.I tried running it with previous MQ (9.2.0.4) which worked fine with java 8, i get the same issue.\nSame code works fine with MQ 9.2.0.4, JDK 8 and WLS 12.I verified that method exists in jar and verified no other versions of allclient jars exists.com.ibm.mq.jmqi.JmqiException: CC=2;RC=2195;AMQ9546: Error return code\nreceived.\n[1=java.lang.NoSuchMethodException[com.ibm.mq.jmqi.remote.api.RemoteFAP.(com.ibm.mq.jmqi.JmqiEnvironment,\nint)],3=Class.getConstructor0]\nat com.ibm.mq.jmqi.JmqiEnvironment.getInstance(JmqiEnvironment.java:857)\nat com.ibm.mq.jmqi.JmqiEnvironment.getMQI(JmqiEnvironment.java:702)\nat com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:8437)\nat com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:7815)\nat com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl._createConnection(JmsConnectionFactoryImpl.java:322)\nat com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:242)\nat com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6026)\nat com.ibm.mq.jms.MQConnectionFactory.createConnection(MQConnectionFactory.java:6086)\nat org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter.doCreateConnection(UserCredentialsConnectionFactoryAdapter.java:188)\nat . Caused by:java.lang.NoSuchMethodException: com.ibm.mq.jmqi.remote.api.RemoteFAP.(com.ibm.mq.jmqi.JmqiEnvironment,\nint)at java.base/java.lang.Class.getConstructor0(Class.java:3349)\nat java.base/java.lang.Class.getConstructor(Class.java:2151)\nat com.ibm.mq.jmqi.JmqiEnvironment.getInstance(JmqiEnvironment.java:764)### Assistant: Remove if you have com.ibm.* related packages in prefer-application-packages section in weblogic.xml.\n"} +{"text": "### Human: I'm using IBM MQ with Spring Boot and I'm trying to delay messages with the setDeliveryDelay(time) method.\nThis function is only supported in JMS 2.0 and I'm having problems with this, as I am running with JMS 1.1 and I cannot figure out how to upgrade to 2.0I'm using this dependencyimplementation(group: 'com.ibm.mq', name: 'mq-jms-spring-boot-starter', version: '2.6.2')and creating this bean:@Bean(\"mqTemplate\")\npublic JmsTemplate jmsClient(ConnectionFactory connectionFactory) throws JMSException {\n System.out.println(connectionFactory.createConnection().getMetaData().toString());\n JmsTemplate temp = new JmsTemplate(connectionFactory);\n return temp;\n}Then I simply set the delay and send the message:jmsTemplate.setDeliveryDelay(101010);\njmsTemplate.convertAndSend(queue, message);At startup I can see this:| com.ibm.msg.client.jms.internal.JmsConnectionMetaDataImpl@71f29d91 :- \n| | XMSC_JMS_MAJOR_VERSION :- 1\n| | XMSC_JMS_MINOR_VERSION :- 1\n| | XMSC_JMS_VERSION :- 1.1\n| | XMSC_MAJOR_VERSION :- 6\n| | XMSC_MINOR_VERSION :- 0\n| | XMSC_OBJECT_IDENTITY :- 1911725457\n| | XMSC_PROVIDER_NAME :- IBM MQ\n| | XMSC_VERSION :- 6.0\n| | XMSC_WMQ_COMMAND_LEVEL :- 910\n| | XMSC_WMQ_PROVIDER_VERSION :- 6.0.0.0And as you can see theXMSC_JMS_VERSIONis1.1and when I try to send to the queue I get the following error:JMSCC5008: Use of the JMS2.0 Function 'Delayed Delivery' is not supported with this instance of this connectionThis makes sense since I'm not using JMS 2.0, but can I change the JMS version from 1.1 to 2.0?### Assistant: Make sure theSVRCONNyou connect to has aSHARECNVvalue of1or higher, if it is set to0the client will treat the queue manager being connected to as a v6 queue manager which didn't support JMS 2.0 features including delayed delivery, shared subscriptions. It also does not support IBM MQ auto reconnect logic and bidirectional heart beat messages.\n"} +{"text": "### Human: I would like to understand why a variable of type com.ibm.jms.JMSTextMessage is printed with truncated content and ellipses (...) when converted to string.I have this code in a JSR223 Sampler in JMeter:import com.ibm.msg.client.jms.JmsConnectionFactory\nimport com.ibm.msg.client.jms.JmsFactoryFactory\nimport com.ibm.msg.client.wmq.WMQConstants\nimport javax.jms.Session\nimport javax.jms.TextMessage\n\ndef hostName = \"127.0.0.1\"\ndef hostPort = 1414\ndef channelName = \"DEV.APP.SVRCONN\"\ndef queueManagerName = \"QM1\"\ndef queueName = \"DEV.QUEUE.1\"\n\ndef ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER)\ndef cf = ff.createConnectionFactory()\n\ncf.setStringProperty(WMQConstants.WMQ_HOST_NAME, hostName)\ncf.setIntProperty(WMQConstants.WMQ_PORT, hostPort)\ncf.setStringProperty(WMQConstants.WMQ_CHANNEL, channelName)\ncf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT)\n\ndef connInboundQueue = cf.createConnection(\"user\", \"password\")\n\ndef sessInboundQueue = connInboundQueue.createSession(false, Session.AUTO_ACKNOWLEDGE)\n\n\ndef payload = \"AAA:+.? '\\n\" +\n \"ABC+ABCD:1+ABCDEFG:ZZ+ABCDEF:ZZ+123456:2042+12345678901++ABCD'\\n\" +\n \"DEF+ABCD+LH+FVKJUB+20000:2042+Y1234567+UN+D:21B'\\n\" +\n \"GHI+1+ABCD:D:11A:AA:ABCD+ABCD12345678901123ABC123456'\\n\" +\n \"JKL+745'\\n\" +\n \"HHH+TN:IIAA891011213531235BNM422244:::001'\\n\" +\n \"CCC+NT+++ABCDEFGHIJKLMNOPQRS'\\n\" +\n \"STU+00123456789012:UF+0000000000:GY'\\n\" +\n \"VXY+50+MI1234+++MI'\\n\" +\n \"AAA+235+ABC'\\n\" +\n \"BBB+200:3202062000:301'\\n\" +\n \"FFF+90+USA'\\n\" +\n \"BBB+232:2101051135:201'\\n\" +\n \"CCC+FF+++AaBaBa001:TEST1'\\n\" +\n \"DDD+3++G'\\n\" +\n \"EEE+329:711013'\\n\" +\n \"FFF+178+XXX'\\n\" +\n \"FFF+179+YYY'\\n\" +\n \"GGG+2+ZZZ'\\n\" +\n \"HHH+BXG:ABCDEF'\\n\" +\n \"HHH+ABC:12AB3E01234E8UD8'\\n\" +\n \"III+P:110:111+100000001'\\n\" +\n \"EEE+36:281105'\\n\" +\n \"FFF+91+ASD'\\n\" +\n \"VVV+50:2'\\n\" +\n \"XXX+0011+1'\\n\" +\n \"YYY+1+U0123456'\\n\" +\n \"ZZZ+1+U1234560002'\\n\"\n\nTextMessage msg = sessInboundQueue.createTextMessage()\nmsg.setText(payload)\n\nlog.info(msg.toString())\nlog.info(msg.getClass().toString())\nlog.info(msg.getText())I would like to understand whylog.info(msg.toString())does not print the whole text content and show ellipses after somepoint (...)If I dolog.info(msg.getText()), I can see the whole text message.Here is the print outcome in jmeter's console:2021-10-31 22:05:25,491 INFO o.a.j.p.j.s.J.JSR223 Sampler - Producer - Inbound Queue: \n JMSMessage class: jms_text\n JMSType: null\n JMSDeliveryMode: 2\n JMSDeliveryDelay: 0\n JMSDeliveryTime: 1635710725481\n JMSExpiration: 0\n JMSPriority: 4\n JMSMessageID: ID:414d5120514d312020202020202020201f537d6101c31040\n JMSTimestamp: 1635710725481\n JMSCorrelationID: 1757416553\n JMSDestination: queue:///DEV.QUEUE.1\n JMSReplyTo: null\n JMSRedelivered: false\n JMSXAppID: 4.1\\bin\\ApacheJMeter.jar \n JMSXDeliveryCount: 0\n JMSXUserID: mquser1 \n JMS_IBM_PutApplType: 28\n JMS_IBM_PutDate: 20211031\n JMS_IBM_PutTime: 20052548\nAAA:+.? '\nABC+ABCD:1+ABCDEFG:ZZ+ABCDEF:ZZ+123456:2042+12345678901++ABCD'\nDEF+ABCD+LH+FVKJUB+20000:20 ...\n2021-10-31 22:05:25,491 INFO o.a.j.p.j.s.J.JSR223 Sampler - Producer - Inbound Queue: class com.ibm.jms.JMSTextMessage\n2021-10-31 22:05:25,491 INFO o.a.j.p.j.s.J.JSR223 Sampler - Producer - Inbound Queue: AAA:+.? '\nABC+ABCD:1+ABCDEFG:ZZ+ABCDEF:ZZ+123456:2042+12345678901++ABCD'\nDEF+ABCD+LH+FVKJUB+20000:2042+Y1234567+UN+D:21B'\nGHI+1+ABCD:D:11A:AA:ABCD+ABCD12345678901123ABC123456'\nJKL+745'\nHHH+TN:IIAA891011213531235BNM422244:::001'\nCCC+NT+++ABCDEFGHIJKLMNOPQRS'\nSTU+00123456789012:UF+0000000000:GY'\nVXY+50+MI1234+++MI'\nAAA+235+ABC'\nBBB+200:3202062000:301'\nFFF+90+USA'\nBBB+232:2101051135:201'\nCCC+FF+++AaBaBa001:TEST1'\nDDD+3++G'\nEEE+329:711013'\nFFF+178+XXX'\nFFF+179+YYY'\nGGG+2+ZZZ'\nHHH+BXG:ABCDEF'\nHHH+ABC:12AB3E01234E8UD8'\nIII+P:110:111+100000001'\nEEE+36:281105'\nFFF+91+ASD'\nVVV+50:2'\nXXX+0011+1'\nYYY+1+U0123456'\nZZZ+1+U1234560002'### Assistant: According to theIBM documentationcom.ibm.jms.JMSTextMessageinherits thetoString()implementation fromcom.ibm.jms.JMSMessageandthe JavaDoc for that methodsays:Gets a String containing a formatted version of the message header.My guess is that the body is cut off simply becausetoString()is really just meant to give you the header. However, only IBM would know for sure why it works that way. To be clear, there is no guarantee thattoString()will (or should) return the entire body of the message.If you really want to inspect the body of the text message you should invokegetText(). This method is required to return the body of the text-message according tothe JMS JavaDocas well asIBM's own JavaDoc. Both state:Gets the String containing this message's data. The default value is null.\n"} +{"text": "### Human: I'm using ibm mq java libraries to connect to remote mq server.Is it possible to know with version I'm using to connect from the java code?I mean, given a MQQueueConnection, how can I get both, client libraries version and server side version?I've been looking throught queueConnection.getMetaData(), but there are some data I don't understand.### Assistant: First, you should be using thecom.ibm.mq.allclient.jarandjms.jarfiles with your project.Note: The followingONLYworks for MQ JAR files starting with IBM MQ V8.0 and later. Otherwise, you will need to check the MQ JAR file'sMETA-INF/MANIFEST.MFas JoshMc suggested. And you really shouldn't be using old MQ JAR files. SeeIBM MQ End of Service Dates.Hence, to find out what version of the MQ JAR files you are using, simply do the following command (go to the directory that contains the JAR files):java -jar com.ibm.mq.allclient.jarAnd the output will look something like:No options specified. Displaying all version information. Use java -jar com.ibm.mq.allclient.jar -help for usage information.\nName: IBM MQ classes for Java Message Service\nVersion: 9.2.0.0\nLevel: p920-L200709\nBuild Type: Production [Built on IBM Corporation 8.0.5.37 - pwa6480sr5fp37-20190618_01(SR5 FP37) Windows Server 2016]\nLocation: file:/F:/java/mq9.2.0.0_jars/com.ibm.mq.allclient.jar\n\nName: Common Services for Java Platform, Standard Edition\nVersion: 9.2.0.0\nLevel: p920-L200709\nBuild Type: Production\nLocation: file:/F:/java/mq9.2.0.0_jars/com.ibm.mq.allclient.jar\n\nName: Java Message Service Client\nVersion: 9.2.0.0\nLevel: p920-L200709\nBuild Type: Production\nLocation: file:/F:/java/mq9.2.0.0_jars/com.ibm.mq.allclient.jar\n\nName: IBM MQ JMS Provider\nVersion: 9.2.0.0\nLevel: p920-L200709 mqjbnd=p920-L200709\nBuild Type: Production\nLocation: file:/F:/java/mq9.2.0.0_jars/com.ibm.mq.allclient.jar\n\nName: IBM MQ classes for Java\nVersion: 9.2.0.0\nLevel: p920-L200709\nBuild Type: Production\nLocation: file:/F:/java/mq9.2.0.0_jars/com.ibm.mq.allclient.jarIf you are using the individual MQ JAR files then you can issue the following command to get the MQ JAR version:java -jar com.ibm.mq.jarAnd the output will look like:Name: IBM MQ classes for Java\nVersion: 9.2.0.0\nLevel: p920-L200709\nBuild Type: Production\nLocation: file:/F:/java/mq9.2.0.0_jars/com.ibm.mq.jar\n"} +{"text": "### Human: As per the firm's policy we are required to encrypt communication channels b/w our client processes with MQ server. In our distributed system, we have a few Java processes required to establish connection with MQ. Let me say, process A and B.A and B run on different virtual machines. They have EXACTLY the same environment including JRE of same version(1.8.0_151-b12), same dependencies, same JCE extension files. We added ssl related JVM parameters to the launching scripts of each process, such as-Djavax.net.ssl.trustStore\n-Djavax.net.ssl.trustStorePassword\n-Djavax.net.ssl.keyStore\n-Djavax.net.ssl.keyStorePasswordthe corresponding trustStore and keyStore files are in place and properly referred to.A works fine and we observed the SSL handshake and encrypted messages. However, process B failed with messages such as:ignoring unavailable cipher TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA\n...\nCaused by: java.lang.IllegalArgumentException: Cannot support \nTLS_ECDHE_RSA_WITH_AES_128_CBC_SHA with currently installed providersI did spend time checking online and one relevant post is fromhere: it suggested downloading and upgrading JCE files - the thing is that I already have JCE files (unlimited) installed and those are the same for both processes. I don't think JCE files is the root of the problem.My question is, does the MQ team also have to install JCE files as well, in order for the client to establish SSL connection? Is the configuration on my end completed, anything I might have missed?Update:problem solved. See my comments below.### Assistant: Unlimited Strength Jurisdiction Policy Files were not included and enabled (crypto.policy set to unlimited) by default until 1.8.0_162. At 1.8.0_151 Unlimited Strength Jurisdiction Policy Files were included but not enabled.Please check that you in fact running Java 1.8.0_151-b12 on both VMs, if you are then make sure the java security file crypto.policy setting on the working VM is identical to the non-working VM.\n"} +{"text": "### Human: Does anyone know this feature is actually available for the amqmdnetstd Library?I couldn't find any concrete examples or info that suggests this. I am able to setup regular subscriptions which are able to read new messages as they are placed in the topic but I am looking to have multiple subscribers sharing the same subscription to where any of them could receive the message as it arrives.Thanks in advance for any help you can provide.### Assistant: Shared subscriptions is a concept of JMS 2.0. IBM MQ JMS supports Shared subscriptions. IBM MQ .NET which is the native API for MQ does not support it. However IBM XMS .NET which is a JMS API implementation in .NET supports \"Cloned Subscription\" which is quite similar to Shared Subscription. More details here:https://www.ibm.com/support/knowledgecenter/SSFKSJ_9.1.0/com.ibm.mq.dev.doc/q119140_.htmYou will need to use the latest version of XMS .NET to make use of Cloned Subscription. Here is more details of the APARhttps://www.ibm.com/support/pages/apar/IV96489You will need to set connection factory property \"CLONESUPP\"and the value to XMSC.WMQ_CLONE_ENABLED.\n"} +{"text": "### Human: In viewhttps://cloud.ibm.com/resourcesI m having two elementsCloud Foundry services -> App ConnectServices -> MQWithin App Connect I would like to use MQ.\nHow do I tell cloud.ibm.com that the two shall work with each other?In appconnect.ibm.com/create I would like to work with that MQ - but don't know how.In appconnect.ibm.com/catalog/apps -> MQ I also do not see a smart way to connect to MQ.### Assistant: I just deployed IBM MQ and IBM App Connect to test this. In this example, I connect to MQ from App Connect and deploy a flow that is triggered when a message arrives onDEV.QUEUE.1. The flow then puts a new message, copying the payload from the first, on toDEV.QUEUE.2. It looks like you already have IBM App Connect and IBM MQ services deployed, so I will dive straight into the configuration of MQ and the App Connect flow. Here's the steps I took:On the MQ cloud deployment I followed the guided tutorial, created a Queue ManagerQM1and then created, and downloaded anAPI key. I made a note of the username shown on the Application Credentials page.I also made a note of theConnection Informationshown for my Queue Manager on the Queue Managers page. This information can also be downloaded by clicking theConnection Informationbutton at the top right corner of the page.In the IBM App ConnectCatalogview, I added IBM MQ as an application and created a new accountAccount 1.I then populated the account configuration with the Queue Manager details collected in Step 2.In the App Connect Dashboard view, I created a newEvent-driven flow, SelectedMQfrom the applications list,Account 1andNew message on a queueI entered the inbound queue nameDEV.QUEUE.1I completed the flow by again selecting MQ from theApplicationslist, thenPut message to a queueand this time I entered the queue nameDEV.QUEUE.2.I then started the flow using the menu in the top right corner.To open the IBM MQ Console for testing, I selectedAdministerfor my Queue Manager in the resource list view.Finally, I logged into the IBM MQ Console, selectedManage, clicked onDEV.QUEUE.1and thenCreateto put a simple test message. Returning back to theManageview, I could see my message had been processed by IBM App Connect and was now onDEV.QUEUE.2.\n"} +{"text": "### Human: I want to configure IIB 10 and MQ 8 so that the published monitoring-event messages are persisted in a persistent MQ queue.The manual at :https://www.ibm.com/support/knowledgecenter/SSMKHH_10.0.0/com.ibm.etools.mft.doc/ac37850_.htmhas a Note to say:Publications resolve to be nonpersistent by default, but you can change a publication to be persistent by configuring named topics in WebSphere\u00ae MQ. For more information, see the Subscriptions and message persistence topic in theWebSphere MQ Version 7.5 product documentation online.Unfortunately, this weird ref to an old version of MQ leads nowhere.I went through the MQ manual that defines the fields in the Topic definition in Explorer and that doesn't help, since the 'Default persistence' requires the publisher to useMQPER_PERSISTENCE_AS_Q_DEF. As IIB's default is 'not persistent', I have to assume it doesn't use this.I'd be really grateful if someone could tell me how to override this and have persisitent messages written to a persistent queue.FWIW\nI originally assumed that defining the queue to receive the event messages as persistent would do the trick - it doesn't.\nNext, I tried defining a topicXXXwith topic string$SYS/Broker/int-sver/monitoring/+/+with 'Default persistence' set to 'Persistent' - that doesn't work, either.### Assistant: You mentioned the docs state \"Publications resolve to be nonpersistent by default\", this does not mean that they useMQPER_NOT_PERSISTENT, likely they useMQPER_PERSISTENCE_AS_Q_DEFor specify nothing at all in which case it defaults to the same as ifMQPER_PERSISTENCE_AS_Q_DEFwas specified.The problem is with your topic string. A TOPIC object is a anchor to a leaf in the tree. It applies to anything below that leaf unless a more specific TOPIC object applies. So in your case the string should be$SYS/Broker/int-sver/monitoringwith out the/+/+at the end.+is a wildcard and wildcards only come into play on subscriptions not on topics.You can find more information in the IBM MQ v8.0 Knowledge Center pageIBM MQ>Technical overview>IBM MQ objects>Object types>Topic objects:Atopic objectis an IBM\u00ae MQ object that allows you to assign\nspecific, non-default attributes to topics.Atopicis defined by an application publishing or subscribing to a\nparticulartopic string. A topic string can specify a hierarchy of\ntopics by separating them with a forward slash character (/). This can\nbe visualized by atopic tree. For example, if an application\npublishes to the topic strings /Sport/American Football and\n/Sport/Soccer, a topic tree will be created that has a parent node\nSport with two children, American Football, and Soccer.Topics inherit their attributes from the first parent administrative\nnode found in their topic tree. If there are no administrative topic\nnodes in a particular topic tree, then all topics will inherit their\nattributes from the base topic object, SYSTEM.BASE.TOPIC.You can create a topic object at any node in a topic tree by\nspecifying that node's topic string in the TOPICSTR attribute of the\ntopic object. You can also define other attributes for the\nadministrative topic node. For more information about these\nattributes, see theThe MQSC\ncommands,\nor theAutomating administration\ntasks.\nEach topic object will, by default, inherit its attributes from its\nclosest parent administrative topic node.topic objects can also be used to hide the full topic tree from\napplication developers. If a topic object named FOOTBALL.US is created\nfor the topic /Sport/American Football, an application can publish or\nsubscribe to the object named FOOTBALL.US instead of the string\n/Sport/American Football with the same result.If you enter a #, +, /, or * character within a topic string on a\ntopic object, the character is treated as a normal character within\nthe string, and is considered to be part of the topic string\nassociated with a topic object.For more information about topic objects, seePublish/subscribe\nmessaging.The closest page I could find to the link in the IIB KC on MQ v8.0 is the IBM MQ Knowledge Center pageIBM MQ>Developing applications>Developing MQI applications with IBM MQ>Writing a procedural application for queuing>Writing publish/subscribe applications>Subscription options:Message persistence\n--Queue managers maintain the persistence of the publications they\nforward to subscribers as set by the publisher. The publisher sets the\npersistence to be one of the following options:0Nonpersistent1Persistent2Persistence as queue/topic definitionFor publish/subscribe, the publisher resolves the topic object and\ntopicString to a resolved topic object. If the publisher specifies\nPersistence as queue/topic definition, then the default persistence\nfrom the resolved topic object is set for the publication.\n"} +{"text": "### Human: I am using Camel JMS component for request-reply for communication with MQ. For some of my requests I can receivenmessages in reply. How can I aggregate these reply messages?I thought of using aggregator pattern with aggregation strategy, but can't use it as I am not sure on number of messages which can come in reply.Can community help me understand what's the right way to do it? I did some google search but couldn't find something useful. Below is my sample route codefrom(\"direct:\"+routeName).routeId(routeName)\n .setHeader(\"JMSCorrelationID\", constant(UUID.randomUUID().toString()))\n .circuitBreaker()\n .resilience4jConfiguration()\n .minimumNumberOfCalls(3)\n .end()\n .to(mqComponentBeanName+\"://CAMELDEMO?exchangePattern=InOut&requestTimeout=10000&replyTo=CAMELDEMOREPLY\")\n .log(\"${body}\")\n .unmarshal(customerDetailsOutBound)\n .process(new Processor() {\n @Override\n public void process(Exchange exchange) throws Exception {\n System.out.println(exchange.getIn().getBody().toString());\n }\n })\n .onFallback().process(new Processor() {\n @Override\n public void process(Exchange exchange) throws Exception {\n System.out.println(\"Store this message to backup\");\n }\n })\n .end();Looking forward to get some good insights from community. Thank you.### Assistant: Message flowyour first route sends a message toCAMELDEMOqueue and start waiting for a single aggreagted message on a new queueCAMELDEMO_AGGREGATED_REPLYcomponent that received the message onCAMELDEMO, start sending responses to CAMELDEMOREPLY queue and also indicates how many responses will be sentSecond route below starts listening onCAMELDEMOREPLY, aggregates the message and send the aggregated message toCAMELDEMO_AGGREGATED_REPLY.Your first route that was waiting for the reply onCAMELDEMO_AGGREGATED_REPLYgets the aggregated reply, receives single message and sends it backOriginal route updated to await for reply onCAMELDEMO_AGGREGATED_REPLY...\n.to(mqComponentBeanName+\"://CAMELDEMO?exchangePattern=InOut&requestTimeout=10000&\n replyTo=CAMELDEMO_AGGREGATED_REPLY\")\n.log(\"${body}\")\n.unmarshal(customerDetailsOutBound)\n.process(new Processor() {\n @Override\n public void process(Exchange exchange) throws Exception {\n System.out.println(exchange.getIn().getBody().toString());\n }\n})\n....Second route to aggregate the messagesfrom(mqComponentBeanName+\"://CAMELDEMOREPLY?\n exchangePattern=In&requestTimeout=10000)\n.aggregate(header(\"JMSCorrelationID\"), new MyAggregationStrategy())\n.to(mqComponentBeanName+\"://CAMELDEMO_AGGREGATED_REPLY?\n exchangePattern=Out&requestTimeout=10000)public final class MyCompletionStrategy implements AggregationStrategy {\n @Override\n public Exchange aggregate(Exchange oldExch, Exchange newExchange) \n {\n ...\n //Here you check your flag regarding the number of responses\n // you were supposed to receive, and if it is met\n // complete the aggregation by setting it to true\n oldExch.setProperty(Exchange.AGGREGATION_COMPLETE_CURRENT_GROUP, true);\n ...\n return oldExchange;\n }\n}\n"} +{"text": "### Human: We have a service to send messages to an IBM MQ queue.I'm trying to get this to work in Liberty, but when the service class is in postConstruct I get a NullPointerException looking up the queue by its JNDI name.Here is the relevant portion of the server.xml configuration:\n\n\n\n \n\n\n\n\n \n \n \n\n \n \n This is the error I get:J2CA8500E: An error occurred while attempting to configure a property queueName of configuration element com.ibm.ws.jca.adminObject.supertype[jms/incomingResponseQueue] on the class com.ibm.mq.connector.outbound.MQQueueProxy: java.lang.NullPointerException\n at com.ibm.ws.jca.internal.BootstrapContextImpl.configure(BootstrapContextImpl.java:471)Which makes me think that maybe there is something missing in the server.xml, but I cannot figure out what it is.### Assistant: According to theMQ resource adapter documentation, thequeueNameattribute should actually bebaseQueueName. Additionally, you might need to specify thequeueManageron the connection factory or thebaseQueueManagerNameon thejmsQueueproperties if the default qmgr value of an empty string isn't valid for your connection.\n"} +{"text": "### Human: I have a set of IBM MQ queue managers and would like to know when one of them was restarted or when it automatically failed over to the standby instance.The queue managers are seated on AIXRegards,### Assistant: You can find this information from theAMQERR01.LOGof the queue manager or by runningDIS QMSTATUS ALL.\n"} +{"text": "### Human: Is it possible to do content-based filter with JMS?IBM MQ publish/subscribe seem to allow content-base filteringhttps://www.ibm.com/support/knowledgecenter/en/SSKM8N_8.0.0/com.ibm.etools.mft.doc/bq13460_.htmhttps://www.ibm.com/support/knowledgecenter/en/SSKM8N_8.0.0/com.ibm.etools.mft.doc/bq13360_.htmI've tried to find a way with my JMSListener to filter on a Body elment but I couldn't manage to make it work..### Assistant: IBM MQ can not directly filter based on the body, only based on message properties. IBM states that a extended message selection provider can do message selection based on the message payload, but as far as I know the only extended message selection provider available is ACE/IIB/WMB.Please review IBM Knowledge Center pageIBM MQ 9.1.x>IBM MQ>Developing applications>Developing JMS and Java applications>Using IBM MQ classes for JMS>Writing IBM MQ classes for JMS applications>JMS messages>Message selectors in JMS:A property value might duplicate a value in a message body. JMS does not define a policy for what might be made into a property. However, application developers must be aware that JMS providers probably handle data in a message body more efficiently than data in message properties. For best performance, applications must use message properties only when they need to customize a message header. The primary reason for doing this is to support customized message selection.A JMS message selector allows a client to specify the messages that it is interested in by using the message header. Only messages with headers that match the selector are delivered.Message selectors cannot refer to message body values.A message selector matches a message when the selector evaluates to true when the message header field and property values are substituted for their corresponding identifiers in the selector.A message selector is a String, with syntax that is based on a subset of the SQL92 conditional expression syntax. The order in which a message selector is evaluated is from left to right within a precedence level. You can use parentheses to change this order. Predefined selector literals and operator names are written here in uppercase; however, they are not case-sensitive.Please also review IBM Knowledge Center pageIBM MQ 9.0.x>IBM MQ>Developing applications>Application development concepts>IBM MQ messages>Selecting messages from queues>Selecting on the content of a messageIt is possible to subscribe based on a selection of message payload content (also known as content filtering),but the decision about which messages should be delivered to such a subscription cannot be performed directly by IBM\u00ae MQ; instead an extended message selection provider, for example IBM Integration Bus, is required to process the messages.\n"} +{"text": "### Human: I have been struggling with this for a long time now. I have an IBM Websphere MQ, which uses EJB and MDBThe following is where the ejb mdb is configured.\n\n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \nThis is configured in ear, which is deployed in IBM WAS. The destination-binding-name will pick the corresponding queue details from the IBM WAS.And later, my configuring the MDB in my java class like below, the listening is achieved on all the queues simultaneously and the messages are picked up:@Resource(name = \"jms/QueueContractConnectionFactory\")\nprivate ConnectionFactory connectionFactory;\n\n@Resource(name = \"jms/FailedResponseQueue\")\nprivate Queue errorQueue;\n\n@Resource(name = \"jms/SuccessfulResponseQueue\")\nprivate Queue responseQueue;I now have to remove the ejb and modify the mdb configurations to make it deploy-able in tomcat.The xml is something, which I literally have no idea on how to map it without the ejb parameters.Can someone help or share a document on how to achieve this? I would like to have a example of IBM MQ to Spring JMS with Activation Spec.Thanks in advance.### Assistant: As has been commented, it's not simply a matter of replacing WAS with Tomcat, as they are not the same kind of container. So you can not directly deploy your WAS artifacts (the MDBs, notably) directly in to Tomcat. In order to get these in to Tomcat, they will have to be rewritten.By being an MDB, the container manages for you: connecting to the JMS server, routing of messages from the queue/topic to your logic, multi-threaded message processing (handling more than one queued message at once) and, most notably, transaction management.Now, message processing against JMS is pretty straightforward. You can make a connection to JMS readily. You can copy an example off the net and get that working. Running processing in the background is straightforward, there are examples of that as well. JMS 2.0 is easier to use than JMS 1.x. No reason not to port to that (unless MQ doesn't support JMS 2.0).Running multiple instances of the logic, transactionally, is not so straightforward, but maybe that's not a keen aspect of your processing.However, even if you were able to get all of that working, there's no guarantee at this juncture that your logic will work directly. We don't know if you logic calls other EJBs or leverages any of the other Java EE infrastructure. Were it to do so, them you have to port that aspect of your logic as well, not just the MDB connectivity.So, this is a deeper problem. It's easy to say \"just deploy it in Tomcat\", but there could be details that derail that and need to be accounted for.Another take is to convert the logic to Spring, as that can deploy in Tomcat readily. But that's not necessarily simpler than anything else -- all of the caveats remain.Finally, \"deploying in Tomcat\" is almost a non-sequitur in this case because MDBs are not Web Apps, and Tomcat deploys Web Apps. You can create a shell of a Web App that does nothing but house your message driven logic. It's easy to do, I and many others have abused the Web App life cycles to our own nefarious ends for things like this.So, in the end, I think you need more clarity as to what \"deploy in Tomcat\" really means, what the expectations are in the end, and whether your message logic relies on other Java EE infrastructure etc. Is the goal to run in Tomcat or to not run in WAS (in that case, as noted in the comments, there are other app servers you could possibly use that would be much easier to transition to).\n"} +{"text": "### Human: IBM MQ has anautomatic client renonnectfunctionality, and it has a default timeout of 30 minutes. After 30 minutes it stops trying to reconnect (source - p35).I want to change the timeout so it lasts a longer time retrying (for example 2 hours). I suppose I can use the propertyXMSC.WMQ_CLIENT_RECONNECT_TIMEOUTfor this because it's available in the XMSC class.TestingI can simulate a connection failure by blocking the port 1414 where the client application makes connection to IBM MQ. And for testing purposes, I lower the timeout value to 5 minutes (instead of 30 minutes).What I can see in the logging is that the client application receivesXMSExceptionwith reason code 2544 (reconnecting):IBM.XMS.XMSException: MQ delivered an asynchronous event with completion code 1, and reason 2544.\nXMSWMQ2014.explanation\nXMSWMQ2014.useraction\n\nLinked Exception : CompCode: 1, Reason: 2544This occurs for 30 minutes, and after that, I get anXMSExceptionwith reason code 2009 (connection broken). And auto reconnect fails.XMSException occurred: IBM.XMS.XMSException: MQ delivered an asynchronous event with completion code 2, and reason 2009.\nXMSWMQ2014.explanation\nXMSWMQ2014.useraction\n\nLinked Exception : CompCode: 2, Reason: 2009I can conclude that changing the timeout value has no effect... Am I configuring the reconnect timeout in a wrong way?Below, there is a code snippet:XMSFactoryFactory factory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\nIConnectionFactory connectionFactory = factory.CreateConnectionFactory();\nconnectionFactory.SetStringProperty(XMSC.WMQ_HOST_NAME, \"hostname\");\nconnectionFactory.SetIntProperty(XMSC.WMQ_PORT, 1414);\nconnectionFactory.SetStringProperty(XMSC.WMQ_CHANNEL, \"channel_name\");\nconnectionFactory.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT_UNMANAGED);\nconnectionFactory.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, \"*\");\nconnectionFactory.SetIntProperty(XMSC.WMQ_CLIENT_RECONNECT_OPTIONS, XMSC.WMQ_CLIENT_RECONNECT_Q_MGR);\nconnectionFactory.SetIntProperty(XMSC.WMQ_CLIENT_RECONNECT_TIMEOUT, 300); //300 seconds = 5 minutes\n\nIConnection conn = connectionFactory.CreateConnection();\nconn.Start();IBM MQ Client version: 8.0.0.5NotesIf I unblock the port in time, it can successfully reconnect.Official IBM documentation:https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_8.0.0/com.ibm.mq.msc.doc/xms_automatic_client_reconnection.htm### Assistant: I've found a way to accomplish this, but unfortunately not by code...The reconnect timeout can be set inmqclient.ini.Example:CHANNELS:\nMQReconnectTimeout = 14400With this configuration applied, the client application should keep retrying for 4 hours.\n"} +{"text": "### Human: Hi I use webpshere mq client 8.0.0.8 and I set my listener at once and start to listen mq,but something went wrong and and myconnection is closed but it throws no error and mylistener hang out and cant listen message.If its throws error I have a mechanism to catch and restart it but that time I failed.Is there any property set to avoid this issue?I have exceptionlistener and reconnect options in my connectionproperties.But this is not directly work,I have a autoresetevent (receiveCompleteEvent)mechanism,only solution I can find set signal in exceptionlistener,and kill connection.In exception listener I can log connection error notifications but no automatic connection set,connectionfactory.SetIntProperty(IBM.XMS.XMSC.WMQ_CLIENT_RECONNECT_OPTIONS, IBM.XMS.XMSC.WMQ_CLIENT_RECONNECT);\n connectionfactory.SetIntProperty(IBM.XMS.XMSC.WMQ_CLIENT_RECONNECT_TIMEOUT, 150);\n\nprivate void OnException(Exception ex)\n {\n QueueStatuslog.Error(String.Format(\"Unexpected error occured to connection:{0}\", ex.ToString()));\n try\n {\n if (receiveCompleteEvent != null)\n {\n QueueStatuslog.Error(String.Format(\"Due to connection error send stop signal:{0}\", ex.ToString()));\n receiveCompleteEvent.Set();\n }### Assistant: Exception, like connection related, will be thrown to application when application makes synchronous MQ API call, like consumer.receive or producer.send. If you are using message listener to receive messages, the message delivery is an asynchronous operation and messages are delivered on the message listener thread. So XMS can not throw exceptions on that thread. Hence it requires another thread, i.e. ExceptionListener to let the application know about any connection related issues.You will need to setup ExceptionListener on connection and catch any exception thrown. When an exception is thrown, issue Connection.Stop, clean up and reinitialize message receive.You can also look at using automatic clientreconnectionandthis.\n"} +{"text": "### Human: I want to read messages from IBM MQ and just print them.//my main classimport javax.jms.JMSException;\nimport javax.jms.MessageConsumer;\nimport javax.jms.Queue;\nimport javax.jms.Session;\n\nimport com.ibm.mq.jms.MQQueue;\nimport com.ibm.mq.jms.MQQueueConnection;\nimport com.ibm.mq.jms.MQQueueConnectionFactory;\nimport com.ibm.mq.jms.MQQueueSession;\nimport com.ibm.msg.client.wmq.WMQConstants;\n\npublic class QueueConnector {\n public static void main(String[] args) throws JMSException {\n MQQueueConnectionFactory qcf = new MQQueueConnectionFactory();\n MQQueueConnection qc;\n Queue queue;\n MQQueueSession queueSession;\n MessageConsumer consumer;\n qcf.setHostName (\"XYZ\");\n qcf.setPort (Integer.parseInt(\"abc\"));\n qcf.setQueueManager (\"ABC\");\n qcf.setChannel (\"IJK\");\n qcf.setTransportType (WMQConstants.WMQ_CM_CLIENT);\n qc = (MQQueueConnection) qcf.createQueueConnection ();\n queue = new MQQueue(\"QUEUE_NAME\");\n queueSession = (MQQueueSession) qc.createQueueSession (false,Session.AUTO_ACKNOWLEDGE);\n consumer = queueSession.createConsumer(queue);\n Listener listener = new Listener();\n consumer.setMessageListener(listener);\n qc.start();\n }\n}// listener classimport javax.jms.JMSException;\nimport javax.jms.Message;\nimport javax.jms.MessageListener;\nimport javax.jms.TextMessage;\n\npublic class Listener implements MessageListener {\n\n @Override\n public void onMessage(Message message) {\n // TODO Auto-generated method stub\n try {\n System.out.println(((TextMessage)message).getText());\n } catch (JMSException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n System.out.println(\"From Listener!\");\n\n }\n}The main class is getting terminated without calling onMessage, even if there are messages in queue. Can anyone help me with this.### Assistant: You need to keep your program running. When you reach the end of main - the program will exit and hence your listener won't fire.Try placingnew Scanner(System.in).nextLine();at the end of your method to verify that it works. Of course, you may want to change this exit condition to something more appropriate (or actually close the scanner).\n"} +{"text": "### Human: We're struggling to get IBM MQ to work across SSL.We've been provided with the certificate chain for the remote host and installed into the Windows Certificate Store (Local Machine). These all look valid.We're using the following connection properties:connectionProperties.Add(MQC.SSL_PEER_NAME_PROPERTY, \"other-server.com\"); \n connectionProperties.Add(MQC.SSL_CIPHER_SUITE_PROPERTY, \"TLS_RSA_WITH_AES_256_CBC_SHA256\"); connectionProperties.Add(MQC.SSL_CIPHER_SPEC_PROPERTY, \"TLS_RSA_WITH_AES_256_CBC_SHA256\"); \n connectionProperties.Add(MQC.SSL_CERT_STORE_PROPERTY, \"*SYSTEM\"); \n connectionProperties.Add(\"CertificateLabel\", \"ibmwebspheremqmywindowsusernamewithoutdomain\"); \n MQEnvironment.SSLCertRevocationCheck = true;We've established that the \"CertificateLabel\" is the \"Friendly name\" in Windows parlance.We've proven unencrypted communication and network-level configuration.We're using 8.0.0.7 client.These are the issues we've come across:All secure communications fail with a 2538 error. (MQRC_HOST_NOT_AVAILABLE,https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_7.5.0/com.ibm.mq.tro.doc/q045380_.htm)No success setting the Friendly Name toibmwebspheremqandibmwebspheremqmywindowsusername@domainandibmwebspheremqmywindowsusernamewithoutdomainGeneral questions:Are we correct in assuming that we can install generated certificates exclusively in the Windows Certificate Store?Is the 2538 error even related to SSL communications? Itfeelslike a network error, though there is that final point in the referenced error documentation.Is there anywhere we can look for more informative error information? eg. relating to the SSL trust chain to see if there is an issue there?### Assistant: The issue was the following line:connectionProperties.Add(MQC.SSL_PEER_NAME_PROPERTY, \"otherserver.com\");Turns out that:It needs it in a canonical format, soDN=, etc.You don't even need that lineThough we did learn a few things along the way:The line:connectionProperties.Add(\"CertificateLabel\", \"ibmwebspheremqmyusername\");Is the stringibmwebspheremqplus yourWindowsusername (without your domain)andthe label should be set on theFriendly nameof your client machine's outgoing certificate NOT including the username.The various folders inside your Windows certificate store are significant. The intermediate CAs should be correctly filed.\n"} +{"text": "### Human: I was using Flume to send messages from HDFS to IBM MQ Queue. But now we are trying Nifi to do so. Everything is working fine except the message format is different. The message format I am getting on the Queue end is in MQHRF2. I need to change it to MQSRT format. Is there a way to do that in PublishJMS or should I use some other processor in Nifi before PublishJMS to make it happen?PublishJMS is sending the XML headers with message attributes and at the end \"the-message\". I only need message to be sent to the queue not the headers. I think this is somewhat related to the message formats mentioned above or am I wrong?### Assistant: Changing the Destination Name in Nifi PublishJMS to snippet below worked for mequeue:///theQueueName?targetClient=1Thanks @JoshMC for guiding me in the correct direction.\n"} +{"text": "### Human: We are implementing an MQ/IIB architecture where we will have one QM and one Broker each on 2 RHEL servers load-balanced with each other to divide incoming traffic.\nWe have consumer applications which connect our servers through JMS bindings file. We also have IIB applications running on both of them.Now, since one bindings file could have only one QMGR name while creating a connection factory, it's not recommended to keep different QM/Broker names on each servers. Since this bindings file would be shared with consumers, it has to be with unique QM name.\nBut if we have same QM/Broker names on each server, all logs on IIB record and replay tool will have one Broker name (from both servers) which is again difficult to identify which server actually served the incoming request.Could you please suggest best possible approach in such scenario?\nOr else suggest if above approach can be modified to achieve our goal.### Assistant: In general it is not a good practice to have two queue managers with the same name. The same would be true for IIB brokers for the reasons you stated.In the Binding file you can leaveQMANAGERblank (null). This will allow the application to connect to any queue manager listening on theHOSTNAMEandPORTthat you specify.If the queue managers on the 2 RHEL servers use the same port you could even set hostname to localhost and use the same binding file on both servers.Example is below if both queue managers listened on the same port:DEFINE CF(CF_NAME) QMANAGER() TRANSPORT(CLIENT) CHANNEL(MY.SVRCONN) HOSTNAME(localhost) PORT(1414)\n"} +{"text": "### Human: As I can see in JMS specification connection.stop() can't be called from onMessage() for asynchronous MessageListener.Could you please advise the right place to call connection.stop() to suspend delivery of incoming messagesand don't get exception:\"JMSCC0012: The method 'stop()' may not be called from a message Listener.\"and automatically resume the connection after some event?What the best practices of using connection.stop()?From JMS 2.0 spec:6.1.5. Pausing delivery of incoming messages If any message listeners are running when stop is invoked, stop must wait until all of them\n have returned before it may return. While these message listeners are\n completing, they must have the full services of the connection\n available to them. A message listener must not attempt to stop its own\n connection as this would lead to deadlock. The JMS provider must\n detect this and throw a javax.jms.IllegalStateException.From jms 1.1:4.3.4 Pausing Delivery of Incoming Messages If MessageListeners are running when stop is invoked, stop must wait until all of them have\n returned before it may return. While these MessageListeners are\n completing, they must have the full services of the connection\n available to them.### Assistant: The solution in my case was to setupvolatile booleanvariablesuspendConnectionfromonMessage(). And check this variable from other thread which parsing messages. When variablesuspendConnectionwas setup insideonMessage()I callconnection.stop()from parser thread.\n"} +{"text": "### Human: I am trying to connect MQ from mule as a client mode. Able to connect, no issues.But when I enabled SSL with Cipher suite \"TLS_RSA_WITH_AES_128_CBC_SHA\", facing error as UNSUPPORTED_CIPHER_SUITE, hence enabled the MQ tracer as per IBM technote, now I am getting no mqjbnd in java.library.path error.Code snippet:-\n \n \n \n \n \n \n\n\nError -org.mule.module.launcher.DeploymentStartException: MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2400' ('MQRC_UNSUPPORTED_CIPHER_SUITE').\n at org.mule.module.launcher.application.DefaultMuleApplication.start(DefaultMuleApplication.java:178) ~[mule-module-launcher-3.9.0.jar:3.9.0]\n at org.mule.module.launcher.artifact.ArtifactWrapper$4.execute(ArtifactWrapper.java:106) ~[mule-module-launcher-3.9.0.jar:3.9.0]\n at org.mule.module.launcher.artifact.ArtifactWrapper.executeWithinArtifactClassLoader(ArtifactWrapper.java:137) ~[mule-module-launcher-3.9.0.jar:3.9.0]\n at org.mule.module.launcher.artifact.ArtifactWrapper.start(ArtifactWrapper.java:101) ~[mule-module-launcher-3.9.0.jar:3.9.0]\n at org.mule.module.launcher.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:73) ~[mule-module-launcher-3.9.0.jar:3.9.0]\n at org.mule.module.launcher.DefaultArchiveDeployer.deployArtifact(DefaultArchiveDeployer.java:536) [mule-module-launcher-3.9.0.jar:3.9.0]\n at org.mule.module.launcher.DefaultArchiveDeployer.deployArtifact(DefaultArchiveDeployer.java:333) [mule-module-launcher-3.9.0.jar:3.9.0]\n at org.mule.module.launcher.DefaultArchiveDeployer.deployExplodedApp(DefaultArchiveDeployer.java:325) [mule-module-launcher-3.9.0.jar:3.9.0]\n at org.mule.module.launcher.DefaultArchiveDeployer.deployExplodedArtifact(DefaultArchiveDeployer.java:100) [mule-module-launcher-3.9.0.jar:3.9.0]\n at org.mule.module.launcher.DeploymentDirectoryWatcher.deployExplodedApps(DeploymentDirectoryWatcher.java:298) [mule-module-launcher-3.9.0.jar:3.9.0]\n at org.mule.module.launcher.DeploymentDirectoryWatcher.start(DeploymentDirectoryWatcher.java:156) [mule-module-launcher-3.9.0.jar:3.9.0]\n at org.mule.module.launcher.MuleDeploymentService.start(MuleDeploymentService.java:139) [mule-module-launcher-3.9.0.jar:3.9.0]\n at org.mule.module.launcher.MuleContainer.start(MuleContainer.java:172) [mule-module-launcher-3.9.0.jar:3.9.0]\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]\n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_161]\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_161]\n at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_161]\n at org.mule.module.reboot.MuleContainerWrapper.start(MuleContainerWrapper.java:52) [mule-module-reboot-3.9.0.jar:3.9.0]\n at org.tanukisoftware.wrapper.WrapperManager$12.run(WrapperManager.java:2788) [wrapper-3.2.3.jar:3.2.3]\nCaused by: org.mule.retry.RetryPolicyExhaustedException: JMSWMQ0018: Failed to connect to queue manager 'XXXX' with connection mode 'Client' and host name 'null'.\n at org.mule.retry.policies.AbstractPolicyTemplate.execute(AbstractPolicyTemplate.java:111) ~[mule-core-3.9.0.jar:3.9.0]\n at org.mule.transport.AbstractConnector.connect(AbstractConnector.java:1658) ~[mule-core-3.9.0.jar:3.9.0]\n at org.mule.transport.jms.JmsConnector.connect(JmsConnector.java:483) ~[mule-transport-jms-3.9.0.jar:3.9.0]\n at org.mule.transport.AbstractConnector.start(AbstractConnector.java:449) ~[mule-core-3.9.0.jar:3.9.0]\n at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source) ~[?:?]\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_161]\n at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_161]\n at org.mule.lifecycle.phases.DefaultLifecyclePhase.applyLifecycle(DefaultLifecyclePhase.java:230) ~[mule-core-3.9.0.jar:3.9.0]\n at org.mule.lifecycle.RegistryLifecycleCallback.doApplyLifecycle(RegistryLifecycleCallback.java:108) ~[mule-core-3.9.0.jar:3.9.0]\n at org.mule.lifecycle.RegistryLifecycleCallback.onTransition(RegistryLifecycleCallback.java:78) ~[mule-core-3.9.0.jar:3.9.0]\n at org.mule.lifecycle.AbstractLifecycleManager.invokePhase(AbstractLifecycleManager.java:146) ~[mule-core-3.9.0.jar:3.9.0]\n at org.mule.lifecycle.RegistryLifecycleManager.fireLifecycle(RegistryLifecycleManager.java:134) ~[mule-core-3.9.0.jar:3.9.0]\n at org.mule.registry.AbstractRegistryBroker.fireLifecycle(AbstractRegistryBroker.java:88) ~[mule-core-3.9.0.jar:3.9.0]\n at org.mule.registry.MuleRegistryHelper.fireLifecycle(MuleRegistryHelper.java:141) ~[mule-core-3.9.0.jar:3.9.0]\n at org.mule.lifecycle.MuleContextLifecycleManager$MuleContextLifecycleCallback.onTransition(MuleContextLifecycleManager.java:74) ~[mule-core-3.9.0.jar:3.9.0]\n at org.mule.lifecycle.MuleContextLifecycleManager$MuleContextLifecycleCallback.onTransition(MuleContextLifecycleManager.java:70) ~[mule-core-3.9.0.jar:3.9.0]\n at org.mule.lifecycle.AbstractLifecycleManager.invokePhase(AbstractLifecycleManager.java:146) ~[mule-core-3.9.0.jar:3.9.0]\n at org.mule.lifecycle.MuleContextLifecycleManager.fireLifecycle(MuleContextLifecycleManager.java:62) ~[mule-core-3.9.0.jar:3.9.0]\n at org.mule.DefaultMuleContext.start(DefaultMuleContext.java:320) ~[mule-core-3.9.0.jar:3.9.0]Few notes -1) No clue why I am getting Cipher suite error since I am able to successfully connect to the same MQ from other java program with same Cipher.2) Also I am trying to connect as Client [TransportType=1] as per MQ client tracer log it is trying to connect as Binding rather than client.3) I am using OpenJDK-1.8, MQ-8.0.0.2 server and tried with MQ-java client as 7.5.0.04) I have specified-Dcom.ibm.mq.cfg.useIBMCipherMappings=falseCan anyone guide me what I am missing here.### Assistant: You can ignore themqjbnderror.mqjbndis used only in a binding mode connection to a local queue manager on the same server. When you turn on tracing the java client will look for this file to log information about it to the trace file. In client mode it is not used so is a harmless error.APAR IC89380describes whymqjbndis used:| The native library 'mqjbnd' is used by the WebSphere MQ\n| classes for Java and WebSphere MQ classes for JMS when\n| creating a connection to the queue manager using a 'bindings'\n| mode connection. A bindings mode connection is a connection\n| which uses the system's memory to communicate with the queue\n| manager, as opposed to a 'client' mode connection which uses\n| a TCP/IP socket.APAR IV66840, that added the ability to use non-IBM JRE (ie Oracle/OpenJDK) CipherSuite names with the addition of theuseIBMCipherMappingssetting, was not present until 7.5.0.5. Because you are using 7.5.0.0 this setting will have no affect.Prior to 7.5.0.5 you would be unable to use any CipherSuite with a Oracle/OpenJDK JRE unless it had the same name as the IBM JRE. All TLSv1.2 CipherSpecs that are supported by IBM MQ v8.0.0.3 and higher queue managers have CipherSuites that are prefixed withTLSin a Oracle JRE andSSLin a IBM JRE. At MQ v8.0.0.2 a queue manager will still allow CipherSpecTLS_RSA_WITH_RC4_128_SHA256which has a CipherSuite name ofSSL_RSA_WITH_RC4_128_SHAin both IBM and Oracle/OpenJDK JREs, but since this is deprecated in the next maintenance level it would not be recommended to use this.Solution, upgrade your IBM MQ jar files to a minimum of one of the following levels:Version Maintenance Level\nv7.5 7.5.0.5\nv8.0 8.0.0.2\nv9.0LTS 9.0.0.0\nv9.0CD 9.0.1Note that MQ v7.5 goes End of Service from IBM on April 30 2018, so it would be recommended to go with v8.0 or higher.\n"} +{"text": "### Human: I am using@JmsListenerannotation to receive all message from queue@JmsListener(destination = MyQueue, selector = \"MAINST = '\" + instanceName + \"'\")\n public void receivMsg(Message message) {But another system doesn't work with message properties. It responds with correlation id. How I can filter messages by correlationIDs, when there are inLinkedList### Assistant: Use a property placeholder forinstanceName. Here's an example with two listeners on the same queue...@SpringBootApplication\npublic class So48377178Application {\n\n public static void main(String[] args) {\n SpringApplication.run(So48377178Application.class, args);\n }\n\n @Bean\n public ApplicationRunner runner(JmsTemplate template) {\n return args -> {\n template.convertAndSend(\"foo\", \"This one's for A\", m -> {\n m.setJMSCorrelationID(\"A\");\n return m;\n });\n template.convertAndSend(\"foo\", \"This one's for B\", m -> {\n m.setJMSCorrelationID(\"B\");\n return m;\n });\n };\n }\n\n @JmsListener(destination = \"foo\", selector = \"JMSCorrelationID='${a.instance}'\")\n public void listenA(Message message) {\n System.out.println(\"A: \" + message);\n }\n\n @JmsListener(destination = \"foo\", selector = \"JMSCorrelationID='${b.instance}'\")\n public void listenB(Message message) {\n System.out.println(\"B: \" + message);\n }\n\n}witha.instance=A\nb.instance=BandB: ActiveMQTextMessage {commandId = 5, responseRequired = true, messageId = ID:gollum.local-56240-1516631774140-4:4:1:1:1, originalDestination = null, originalTransactionId = null, producerId = ID:gollum.local-56240-1516631774140-4:4:1:1, destination = queue://foo, transactionId = null, expiration = 0, timestamp = 1516631774348, arrival = 0, brokerInTime = 1516631774348, brokerOutTime = 1516631774349, correlationId = B, replyTo = null, persistent = true, type = null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = null, marshalledProperties = null, dataStructure = null, redeliveryCounter = 0, size = 1056, properties = null, readOnlyProperties = true, readOnlyBody = true, droppable = false, jmsXGroupFirstForConsumer = false, text = This one's for B}\nA: ActiveMQTextMessage {commandId = 5, responseRequired = true, messageId = ID:gollum.local-56240-1516631774140-4:3:1:1:1, originalDestination = null, originalTransactionId = null, producerId = ID:gollum.local-56240-1516631774140-4:3:1:1, destination = queue://foo, transactionId = null, expiration = 0, timestamp = 1516631774341, arrival = 0, brokerInTime = 1516631774341, brokerOutTime = 1516631774345, correlationId = A, replyTo = null, persistent = true, type = null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = null, marshalledProperties = null, dataStructure = null, redeliveryCounter = 0, size = 1056, properties = null, readOnlyProperties = true, readOnlyBody = true, droppable = false, jmsXGroupFirstForConsumer = false, text = This one's for A}\n"} +{"text": "### Human: I have two machines - Machine 1 and Machine 2. Machine 1 has one queue manager QM1 and a broker(integration server) BR1 and Machine 2 has one queue manager QM2 and a broker(integration server) BR2 . I want to make a cluster between QM1 AND QM2. I had created a remote cluster queue named INVENTQ in QM2 .The problem is that I am able to successfully post any message on any queue manager and I am able to see the corresponding message on INVENTQ in QM2 . But I want the architecture to be in such a way that I am able to receive the message from the queue from any of the queue managers in addition to the queue manager in which the queue INVENTQ is created i.e QM2 . Can anybody guide me in this ?### Assistant: MQ does not have a 'remote get' capability - ie you cannot use local bindings to a queue manager and get a message from another queue manager. If you want to do this, you need to use client bindings to go to the queue manger where the message resides directly.At MQPUT time, a decision has to be made (on the putting queue manager), where to forward the message to (e.g. which local queue, or which transmission queue to pass it to another queue manager).In a cluster setup, if you have a queue defined on one queue manager and put it the cluster, anyone from any of the clustered queue managers can put to it as though it was a local queue. However their MQPUTs result in the message arriving (via the cluster channels), onto the one particular instance. Therefore from a different queue manager whilst you can put the message to the queue, you cannot get it.You could have a queue with the same name defined on multiple queue managers and clustered, as per @JoshMc's suggestion, but this means that at MQPUT time, the message is routed to one, and only one, instance of that queue - if it was routed to the remote queue manager clustered definition you still would not be able to get it from the local queue manager. Imagine you had a cluster of 3 qmgrs. You can create a clustered queue called 'FRED' in 2 of them. All of them can put to FRED - but 2 of them will default to put to their local queue only (unless you set CLWLUSEQ=ANY), the other will (usually) alternate between the 2 remote instances. Each queue will definitely have different messages on.https://www.ibm.com/developerworks/community/blogs/messaging/entry/Undestanding_on_MQ_Cluster_Work_Load_Management_Algorithm_and_Attributes?lang=en\n"} +{"text": "### Human: Any help will be greatly appreciated. I am trying to create a replacement for MDB with spring JMSListener. I wanted the destination name to be passed as a annotation, but i noticed thatorg.springframework.jms.listener.DefaultMessageListenerContainercontainer config hasdestinationNameordestinationas mandatory. Am i missing something ? How to make use of destination resolver to use queue name from@JmsListenerannotation?@Component \npublic class InitStRspnLstnr {\n\n@JmsListener(destination = \"${xyz.company.MQ.INITST.RSPN.FADS.Q}\")\npublic void onMessage(Message msg) throws JMSException {\n System.out.println(\"**********************************************\"+msg);\n}}Below is my Xml pasted, I commented the container for now, since spring was trying to connect to dummy queue instead of the one in annotation..\n \n\n \n\n \n \n\n \n \n ${xyz.company.MQ.HOST.NM}\n ${xyz.company.MQ.PORT}\n ${xyz.company.MQ.QMNGR}\n ${xyz.company.MQ.CHANNEL}\n 819\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n false\n \n \n 20000\n \n \n\n \n\n \n ### Assistant: Added working version below. defaultDestinationName is not needed in xml , if its set up in code via annotation..${company.project.MQ.module.Q}and other values are loaded from properties file, it can be hard coded too.@Component \npublic class SampleLstner{ \n@JmsListener(concurrency = \"1\", destination = \"${company.project.MQ.module.Q}\", containerFactory = \"jmsListenerContainerFactory\")\n public void onMessage(Message msg) throws JMSException {}\n }XML\n\n\n\n\n\n\n\n\n ${company.project.MQ.HOST.NM}\n ${company.project.MQ.PORT}\n ${company.project.MQ.QMNGR}\n ${company.project.MQ.CHANNEL}\n 819\n 1\n\n\n \n \n \n\n\n\n\n \n \n \n \n \n \n \n false\n \n \n 20000\n \n\n\n\n \n \n \n \n \n \n \n \n\n"} +{"text": "### Human: I have a local MQ which my IIB connects to in client mode (i.e. not as a trusted application). I've set check client connection security on in the QM and now the IIB can't connect because it doesn't send a password and it's sending the wrong username (by default it uses the user that the process starts with). I've seen lots of documentation around setting dbparms mq::*. I could be wrong that but that only seems to affect the MQ Input and Output nodes ? Not the actual broker and it's config manager connections to MQ?However, I've tried setting those values so that all client connection to my QMGR get a user/passwd but it still comes across as failing and I can see in the MQ logs that it's trying to connect using the userid that the IIB process was started with (and presumably without a password).\nSo, how do I get IIB to ALWAYS send a user/passwd to MQ when connecting the node/config mgr to the QM using client connections??Clarification: \nI have set mq::MQ -u -p and still the node attempts to connect to the QMGR using the ID that the MQSI process is started with and not the -u param. I have no execution groups and (of course) no flows in my broker so this can only be a core IIB component that's attempting the connection.### Assistant: According to the IBM Integration Bus v10.0.0.10 Knowledge Center page \"Connecting to a secured WebSphere MQ queue manager\" you can set this in three ways:On each MQ Node by specifying aSecurity identityproperty.For all MQ connections to a named queue managerFor all MQ connections.The order of which ID will be used is the same as above, so if you have a ID setup for all queue managers, you can override it for a specific queue manager or a specific MQ Node.If you have a queue manager you are already connecting to called for exampleIIBQM, you could specify the following command so that all connections to that queue manager would use the specifiedusernameandpassword.mqsisetdbparms integrationNodeName -n mq::QMGR::IIBQM -u username -p passwordThe KC page tells how to set it all three ways. If you have any specific questions please update your question by clicking edit and add more details and I can update my answer.\n"} +{"text": "### Human: I managed to send a message from an MQ Client to a MQ Server. In the MQ Client Iamqsputc [queue_local] [name_qmgr]and after typing the message it returnSample AMQSPUT0 endwhich means it was sent properly. But when I try to see the message in the MQ Server withamqsbcg [queue_local] [name_qmgr]it throws me an error message:Sample AMQSGET0 start\nMQCONNX ended with reason code 2058This error appears when the queue manager doesn't exist or when the name is misspelled, but this is not the case.When I verify the local queue it showsCURDEPTH(1), this means that there is one message on the queue(it was delivered). But I don't know why it doesn't allow me to get the message. In the queue manager error file it only shows something like:the channel AMQ.... connection endedI checked the channel I configured for this test:AMQ8414: Display Channel details.\nCHANNEL(A03ZCIWAS) CHLTYPE(SVRCONN)\nALTDATE(2017-09-07) ALTTIME(00.35.17)\nCERTLABL( ) COMPHDR(NONE)\nCOMPMSG(NONE) \nDESCR(Server-connection to ...)\nDISCINT(0) HBINT(300)\nKAINT(AUTO) MAXINST(100)\nMAXINSTC(90) MAXMSGL(4194304)\nMCAUSER(nobody) MONCHL(QMGR)\nRCVDATA( ) RCVEXIT( )\nSCYDATA( ) SCYEXIT( )\nSENDDATA( ) SENDEXIT( )\nSHARECNV(10) SSLCAUTH(REQUIRED)\nSSLCIPH( ) SSLPEER( )\nTRPTYPE(TCP) \nAMQ8414: Display Channel details.\nCHANNEL(A03ZCIWAS) CHLTYPE(CLNTCONN)\nAFFINITY(PREFERRED) ALTDATE(2017-09-07)\nALTTIME(02.40.42) CERTLABL( )\nCLNTWGHT(0) COMPHDR(NONE)\nCOMPMSG(NONE) CONNAME(XX.XX.XX.XX)\nDEFRECON(NO) \nDESCR(Client connection to ....)\nHBINT(300) KAINT(AUTO)\nLOCLADDR( ) MAXMSGL(4194304)\nMODENAME( ) PASSWORD( )\nQMNAME(AEDMQ03A) RCVDATA( )\nRCVEXIT( ) SCYDATA( )\nSCYEXIT( ) SENDDATA( )\nSENDEXIT( ) SHARECNV(10)\nSSLCIPH( ) SSLPEER( )\nTPNAME( ) TRPTYPE(TCP)\nUSERID( )TheCONNAME(xx.xx.xx.xx)is the right IP adress for the MQServer and the variable MQSERVER is set like:MQSERVER=[channel_svrconn]/tcp/'ip_adress_MQServer(1414)'The port is also fine.### Assistant: The output you provide indicates you are executingamqsgetnotamqsbcgc.I note that your question mentionsamqsbcgnotamqsbcgc. Thecat the end of the sample name indicates it is theclientversion of the program.amqsbcg = Server Binding version\namqsbcgc = Client versionIf you execute eitheramqsgetoramqsbcgand specify a queue manager that is not local on the same server you will receive a2058.Solution is to useamqsgetcoramqsbcgcinstead ofamqsgetoramqsbcg\n"} +{"text": "### Human: TID: [-1] [] [2017-08-09 12:07:00,546] INFO {org.apache.axis2.engine.AxisEngine} - [MessageContext: logID=4cc6574b7acd53b2510b0e78661a4db2bff0d346d5081397] null {org.apache.axis2.engine.AxisEngine}\nTID: [-1] [] [2017-08-09 12:07:00,546] ERROR {org.apache.synapse.core.axis2.AsyncCallback} - {org.apache.synapse.core.axis2.AsyncCallback}\njava.lang.NullPointerException\n at org.apache.axis2.transport.jms.JMSSender.sendOverJMS(JMSSender.java:224)\n at org.apache.axis2.transport.jms.JMSSender.sendMessage(JMSSender.java:200)\n at org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:112)\n at org.apache.axis2.engine.AxisEngine$TransportNonBlockingInvocationWorker.run(AxisEngine.java:626)\n at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n at java.lang.Thread.run(Thread.java:748)\nTID: [-1] [] [2017-08-09 12:07:00,546] WARN {org.apache.synapse.core.axis2.AsyncCallback} - Executing fault handler due to exception encountered {org.apache.synapse.core.axis2.AsyncCallback}followed this link \"http://nandikajayawardana.blogspot.in/2015/03/configuring-ibm-mq-with-wso2-esb.html\"Note: able to receive messages from queue but not able to send to queue, giving Null Pointer Exception### Assistant: added following propertys before send mediator it started wortking\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n"} +{"text": "### Human: We are using IBM MQ 8.0.0.4 in our application and so we are planning on hosting the jars in our maven repository manager (Nexus OSS 2 in this case).What is the convention for the GAV for IBM MQ specifically?The jars that are required are:commonservices.jar\ndhbcore.jar\nheaders.jar\njmqi.jar\nmqjms.jar\npcf.jar\nmq.jar\nNojndi.jar\njndi.jar\nfscontext.jar\nproviderutil.jar\njms.jar\nconnector.jarAll of them up tomq.jarare IBM jars.Should I use thecom.ibmgroup id?Or thecom.ibm.mqgroup id?Or a mix - for instance the manifest for dhbcore.jar sayscom.ibm.disthub2What is the convention for the version number? Should I use8.0.0.4for all the ibm jars or should I take the version from the manifest?The version in the manifest is8.0.0.4in most of them butcommonervices.jarandmqjms.jarsayp800-004-151017. This still looks like8.0.0.4to me but looks like some non-maven snapshot convention.What are the conventions in this case? (I'm not looking for the general maven conventions but how they apply specifically to this use case).### Assistant: UPDATE:As of v9.0.4.0IBM have pushed copies of the MQ Java client interfaces to the Central Repository under thecom.ibm.mqGroupId. e.g.\n com.ibm.mq\n com.ibm.mq.allclient\n 9.0.4.0\nORIGINAL:At IBM MQ v8.0.0.3 and higher you can download a Java only client which includes a fewer number of jar files. This is packaged as a self extracting jar file. The latest v8 package can be downloaded on Fix Central using this link:IBM MQ JMS and Java 'All Client'Most of the previously separate jars are now included in thecom.ibm.mq.allclient.jar.ForIBM MQ Classes for Javayou can find the list of files required on the Knowledge Center page \"What is installed for IBM MQ classes for Java\":Relocatable JAR filesWithin an enterprise, the following files can be moved to systems that need to run IBM MQ classes for Java\n applications:com.ibm.mq.allclient.jarcom.ibm.mq.traceControl.jarForIBM MQ Classes for JMSyou can find the list of files required on the Knowledge Center page \"What is installed for IBM MQ classes for JMS\":Relocatable JAR filesWithin an enterprise, the following files can be moved to systems that need to run IBM MQ classes for JMS:com.ibm.mq.allclient.jarcom.ibm.mq.traceControl.jarjms.jarfscontext.jarproviderutil.jarFor version numbers I suggest you use the version number of the package they came from, in your example 8.0.0.4.\n"} +{"text": "### Human: Can you please tell how theenvironment variableofMQcan be checked in LINUX, AIX or SunOS.\nFor example how to check MQSNOAUT variable. Thank You.### Assistant: If theMQSNOAUTvariable is set toanyvalue when the queue manager is created, OAM is turned off. If theMQSNOAUTvariable is set any other time besides queue manager creation it has no effect. This is documented on the IBM MQ v7.1 Knowledge Center page \"MQSNOAUT\":When you set this variable it disables the object authority manager\n (OAM) and prevents any security checking.The MQSNOAUT variable only takes effect when a queue manager is\n created.If you want to check if theMQSNOAUTvariable is set before you run thecrtmqmcommand to create a new queue manager, on Unix you can as provided by @buzyjess just run the following:echo $MQSNOAUTIf you want to check if OAM is turned off on a running queue manager run the following command:DIS QL(SYSTEM.AUTH.DATA.QUEUE) IPPROCSIf theIPPROCShas a value of 0 the OAM is turned off on the queue manager.Turning off OAM is not a good solution even on Test/Dev queue managers and is not something I would recommend you do. By leaving OAMturned onyou are able to set things up properly as you would in a production environment, this will leave no surprises when you are ready to move to production.\n"} +{"text": "### Human: An application needs to clear a local queue using PCF commands. The application is getting reason code 2035 MQRC_NOT_AUTHORIZED. Channel authentication records are disabled.What are the minimum required permissions needs to assign to the application users.\nA blank MCAUSER in the server connection channel.\nor Connect authority to the queue manager object and Clear authority to the queue.### Assistant: If you view the AMQERR01.LOG it should show you what object and permission is missing, these errors are enabled by default on any supported version of MQ, in older now unsupported versions you would need to set a ENV variable to see these errors in the AMQERR01.LOG.In general you would need the following permissions:+connect +dsp on the qmgr.+put +inq on the SYSTEM.ADMIN.COMMAND.QUEUE+get +dsp on the SYSTEM.DEFAULT.MODEL.QUEUE+dsp +inq +clr on any local queue you want clearReference two other answers I provided related permissions required for PCF commands:IBM MQ - Permissions - Read perspectiveHow to monitor MQ within ITRS Geneos\n"} +{"text": "### Human: Is there any way of pushing the messages send to one local queue to another remote queue in same qmanager?Local Host machineMsg->Local Q1->Remote Q2(this is connected to another queue in remote host)Can this be done with MQ configurations? Can we avoid coding any utility project? As this is for transferring messages from one to another queue in same qmanager.### Assistant: IBM MQ supports QALIAS objects.If you start out with the following existing queues:QLOCAl(Q1)\nQREMOTE(Q2)To accomplish what you are asking for you can do the following:DELETE QL(Q1)\nDEFINE QA(Q1) TARGET(Q2) TARGTYPE(QUEUE)At that point any message put to Q1 will actually be put to Q2.\n"} +{"text": "### Human: In order to give read permission toall objectsof a queue manager (queues, channels, etc) for monitoring perspective, what command/permission is required. My monitoring client uses java api.WillMQZAO_ALL_ADMINpermission do for this purpose. Cansetmqautbe used to set this permission but this command has options like +put , +get, etc not MQZAO_ALL_ADMIN. Currently I am usingsetmqautfor each queue, etc. with version 8.0.0.4.### Assistant: For read only you do not want to useMQZAO_ALL_ADMINsince this would give administrative authority. In terms ofsetmqautthat is+alladmand provides+chg +clr +dlt +dspon queues.In general for read only you would provide+connect +inq +dspagainst theqmgrobject, and+dspfor any objects that you want to monitor.+dspallows you to see the name of the object and in some cases details of the object. For some objects (queue, process, namelist) you also need to add+inqto see details of the object. You also need to provide+putto theSYSTEM.ADMIN.COMMAND.QUEUEand+getto either a model queue if you are going to use dynamic queues, or to a normal local queue.You can use wildcards as well if you want to provide permission to multiple queues.The example below would provide read only permission to all objects for all types:setmqaut -m -t qmgr -g group -all +connect +inq +dsp\nsetmqaut -m -n SYSTEM.ADMIN.COMMAND.QUEUE -t queue -g group -all +inq +put +dsp\nsetmqaut -m -n SYSTEM.DEFAULT.MODEL.QUEUE -t queue -g group -all +inq +get +dsp\nsetmqaut -m -n '**' -t namelist -g group -all +dsp +inq\nsetmqaut -m -n '**' -t process -g group -all +dsp +inq\nsetmqaut -m -n '**' -t queue -g group -all +dsp +inq\nsetmqaut -m -n '**' -t channel -g group -all +dsp\nsetmqaut -m -n '**' -t clntconn -g group -all +dsp\nsetmqaut -m -n '**' -t listener -g group -all +dsp\nsetmqaut -m -n '**' -t service -g group -all +dsp\nsetmqaut -m -n '**' -t topic -g group -all +dsp*Note that I always prefix permissions with a-allso that you know the permissions you are granting will be the only permissions. If you did not have-alland the group above already had other permissions for example+puton a queue that permission would stay and you would be adding+dsp +inqand end up with+put +dsp +inq.If the queue manager is on Windows you can use-pand a username instead to grant the permission directly to that user. On Unix prior to v8 if you used -p it would actually grant the permission to the users primary group, in v8 and later if you addSecurityPolicy=userto theService:stanza of the qm.ini it will behave like Windows always had and grant permission only to the user specified with the-p. In a large organization this can be preferred since you know you have provided permission only to a single user, were if you provide it at a group level it is possible someone can just get a second user added to that group and the second user now has the same permission.Note that an alternative to thesetmqautcommand, in MQ v7.1 and later you can grant permissions usingSET AUTHRECMQSC commands. The commands below will provide the same permissions that the above setmqaut commands provide:SET AUTHREC PROFILE('self') GROUP('group') OBJTYPE(QMGR) AUTHRMV(ALL) AUTHADD(CONNECT,DSP,INQ)\nSET AUTHREC PROFILE('SYSTEM.ADMIN.COMMAND.QUEUE') GROUP('group') OBJTYPE(QUEUE) AUTHRMV(ALL) AUTHADD(DSP,INQ,PUT)\nSET AUTHREC PROFILE('SYSTEM.DEFAULT.MODEL.QUEUE') GROUP('group') OBJTYPE(QUEUE) AUTHRMV(ALL) AUTHADD(DSP,INQ,GET)\nSET AUTHREC PROFILE('**') GROUP('group') OBJTYPE(NAMELIST) AUTHRMV(ALL) AUTHADD(DSP,INQ)\nSET AUTHREC PROFILE('**') GROUP('group') OBJTYPE(PROCESS) AUTHRMV(ALL) AUTHADD(DSP,INQ)\nSET AUTHREC PROFILE('**') GROUP('group') OBJTYPE(QUEUE) AUTHRMV(ALL) AUTHADD(DSP,INQ)\nSET AUTHREC PROFILE('**') GROUP('group') OBJTYPE(CHANNEL) AUTHRMV(ALL) AUTHADD(DSP)\nSET AUTHREC PROFILE('**') GROUP('group') OBJTYPE(CLNTCONN) AUTHRMV(ALL) AUTHADD(DSP)\nSET AUTHREC PROFILE('**') GROUP('group') OBJTYPE(LISTENER) AUTHRMV(ALL) AUTHADD(DSP)\nSET AUTHREC PROFILE('**') GROUP('group') OBJTYPE(SERVICE) AUTHRMV(ALL) AUTHADD(DSP)\nSET AUTHREC PROFILE('**') GROUP('group') OBJTYPE(TOPIC) AUTHRMV(ALL) AUTHADD(DSP)\n"} +{"text": "### Human: I am using WebSphere MQ and I created a JMS listener by annotation to read incoming messages:@JmsListener(destination = \"${queues.input}\", containerFactory = \"listenerFactory\")The incoming messages have a MQMD field calledAccounting Tokenset and I would like to read it. From reading IBM doc, I need to set theWMQ_MQMD_READ_ENABLEDproperty of the destination totrue. But the way I configured JmsListener is just a String name in the annotation. How do I set this property?### Assistant: Add a suitably configured@Beanfor the destination (MQQueuewith the required properties set).Then configure theDefaultJmsListenerContainerFactoryto use aBeanFactoryDestinationResolverin itsdestinationResolverproperty.The resolver should be a@Beantoo, so it gets a reference to the bean factory.Then,${queues.input}should resolve to the queue's bean name and the listener container will use that destination rather than the default destination resolver, which creates a destination from theSession.EDITJust to clarify...Thedestinationproperty of the annotation is actually a destination name that gets resolved to aDestinationobject using the configuredDestinationResolver.The default resolver (DynamicDestinationResolver) simply callssession.createQueue()orsession.createTopic()- so you get whatever default destination the JMS provider's client library gives you.With theBeanFactoryDestinationResolverwe resolve the destination name to a bean in the application context, which can be a fully configured destination object, tailored to your provider's library.So, you simply configure the DMLC to use the BF resolver, either directly (as you tried) or via the container factory - which is used to create a DMLC for each@JmsListenerfound and passes the resolver into each. So the destination name is resolved to a fully configuredDestinationinstance.\n"} +{"text": "### Human: I am using WMQ (IBM Websphere Message Queue) and am facing the below error:Root Exception was: MQJE001: An MQException occurred: Completion Code 2, Reason 2059\nMQJE011: Socket connection attempt refused. Type: class com.ibm.mqservices.MQInternalException\nERROR 2017-04-21 11:36:52,212 [main] org.mule.module.launcher.application.DefaultMuleApplication: \n********************************************************************************\nMessage : MQJMS2005: failed to create MQQueueManager for '172.17.65.24:RQACBRKB'\nJMS Code : MQJMS2005\nElement : /WMQ2 @ app:config.xml:14 (WMQ)\n--------------------------------------------------------------------------------\nRoot Exception stack trace:\ncom.ibm.mqservices.MQInternalException: MQJE001: An MQException occurred: Completion Code 2, Reason 2059\nMQJE011: Socket connection attempt refused\n at com.ibm.mq.MQInternalCommunications.createSocketConnection(MQInternalCommunications.java:2316)\n at com.ibm.mq.MQv6InternalCommunications$1.run(MQv6InternalCommunications.java:157)\n at java.security.AccessController.doPrivileged(Native Method)\n at com.ibm.mq.MQv6InternalCommunications.initialize(MQv6InternalCommunications.java:154)I have imported below jars. I came to know some modifications need to be done on anypoint studio.com.ibm.mq.jar\ncom.ibm.mqetclient.jar (if using Transactions)\ncom.ibm.mq.jmqi.jar \ncom.ibm.mqjms.jar\ndhbcore.jar\ncom.ibm.mq.headers.jar### Assistant: It appears based on the error messages that you are using IBM MQ classes from MQ v6.0 which was released June 24th 2005 and has been out of support since September 30th 2012 (almost 5 years). The version may not have anything to do with your issue but I would strongly suggest that you move to a supported version of the MQ client. Newer MQ client versions can connect to older MQ queue managers. You can download a java only install of MQ 8.0 or MQ 9.0 jar files at the links below:IBM MQ v8.0 ClientIBM MQ v9.0 ClientThe error indicates you are unable to connect to the IP and port that you have specified. Try a simple telnet to that IP and port to ensure you are able to connect, if you are not then verify the IP and port. MQ will default to port 1414 if no port is specified.For a good write up on common causes of Reason 2059 please review the answer posted by @T.Rob to the question \"Can't connect Websphere MQ Queue Manager\"\n"} +{"text": "### Human: I am using instructions in thisIBM support pageto set up tracing. No trace files are being output. I tried this on a machine that has IBM MQ client installed and on a machine with no IBM MQ client. Is there anything I can do to debug or investigate?I am on v9.0.1 of IBM MQ.### Assistant: the tracing described on the support page reference in the question only works if no installation of IBM MQ exists on the machine. We discovered that the machine we thought was clean actually had IBM Websphere 7.5 installed. Once we took it out tracing started working as expected. I assume that tracing must be done through the installed client if it exists on the machine.\n"} +{"text": "### Human: When I try to get the queue names from a queue manager, I am getting this error which I couldn't understand whyPCFMessage reqeuestMessage = new PCFMessage(MQC.MQCMD_INQUIRE_Q);\nreqeuestMessage.AddParameter(MQC.MQIA_Q_TYPE, MQC.MQQT_LOCAL);\nPCFMessage[] pcfResponse = messageAgent.Send(reqeuestMessage);### Assistant: IBM has stated that the PCF support that is included in the MQ Classes for .NET not documented or maintained. For reference look at Page 16 of the MQ Technical Conference v2.0.1.5 presentation \"PCF Programming\" by Mark Taylor of IBM MQ Development:Some use .Net classes:that interface is notdocumentedormaintainedAn historic accidentMissing newer function such as z/OS and byte string supportI verified that the PCF interface for the MQ classes for .NET is still not documented in the IBM MQ Knowledge center, but of interest is that they have take a few APARs in this area recently and resolved them:IT02687: DOTNET APPLICATION SENDING PCF MESSAGES GET NO RESPONSE WHEN REQUESTS ARE SENT TO A Z/OS QUEUE MANAGER- August 2014 - Fixed in 7.5.0.5IT12297: THE MQ .NET CLASSES FAIL TO INITIALIZE AN MQCFSL STRUCTURE WHEN PROCESSING A PCF RESPONSE- May 2016 - Fixed in 7.5.0.7/8.0.0.5Microsoft Developer All About Interop blog post \"PCF with IBM\u2019s MQ Classes for .NET\" has some examples, you probably need to useMQCMD_INQUIRE_Q_NAMESinstead ofMQC.MQCMD_INQUIRE_Q. From the blog:PCFMessageAgent agent = new PCFMessageAgent(c.MQ_QueueManager);\nPCFMessage request= new PCFMessage(CMQCFC.MQCMD_INQUIRE_Q_NAMES);\nrequest.AddParameter (MQC.MQCA_Q_NAME, queuename);\nrequest.AddParameter (MQC.MQIA_Q_TYPE, MQC.MQQT_LOCAL);\nPCFMessage[] responses = agent.Send(request);Another example is in @Sashi's answer to Stack Overflow question \"MQ Statistics Monitoring from C#/.NET\".\n"} +{"text": "### Human: I need to connect from a web application running on aWebSphere AS 6.1application server to a remoteWebSphere MQ on z/OSqueue. On WebSphere AS, I configured both QueueConnectionFactory and Queue (an object containing a part of the remote queue data), with most of the settings set to their default values - I just needed to set queue name, channel, host, port, and transport type which is CLIENT. I inject them in the followingSpring 3.2configuration using JNDI lookup:\n\n \n\n \n\n \n\n \n \n \n \n \n \n \n \n\n \n \n JmsTemplate sends and receives (synchronously) messages correctly. DefaultMessageListenerContainer, an asynchronous message receiver, reads some (previously sent) messages off the MQ queue during WebSphere AS start, but chokes soon afterwards, and begins to throw repeatedly \"connection closed\" exception. On each such occasion it notifies me thatDefaultMessag W org.springframework.jms.listener.DefaultMessageListenerContainer handleListenerSetupFailure Setup of JMS message listener invoker failed for destination 'queue://myqueue' - trying to recover. Cause: Connection closed\nDefaultMessag I org.springframework.jms.listener.DefaultMessageListenerContainer refreshConnectionUntilSuccessful Successfully refreshed JMS Connectionbut stops taking messages off the queue.Digging a bit into Spring code, I found that setting on DefaultMessageListenerContainersolves the problem, in the sense that the messages are now being read off the queue every time I send them. However, looking at the TCP traffic to WebSphere MQ I find that MQCLOSE/MQOPEN commands are sent to it repeatedly as in:Wireshark captured trafficwhich probably means that the connection gets continuously closed and reopened.Can anybody suggest what might be the cause for caching not working properly, and whether there is perhaps a relatively simple way to modify Spring code (extending DefaultMessageListenerContainer, for example), or perhaps set some property on MQ queue connection factory/queue, to get it working?EDIT:Searching further the internet, I have found the following linkhttp://forum.spring.io/forum/spring-projects/integration/jms/89532-defaultmessagelistenercontainer-cachingconnectionfactory-tomcat-and-websphere-mqwhich seems to describe a similar problem occurring on Tomcat. The solution there is to set a certain exceptionListener on DefaultMessageListenerContainer. However, trying to do this on WebSphere throws the exception \"javax.jms.IllegalStateException: Method setExceptionListener not permitted\". The underlying cause seems to be that J2EE 1.4 spec forbids calling setExceptionListener on JMS connections.https://www.ibm.com/developerworks/library/j-getmess/j-getmess-pdf.pdf### Assistant: It seems that settingon DefaultMessageListenerContainer is actually the correct solution.I mislead myself by interpreting MQCLOSE/MQOPEN I saw on Wireshark captured TCP traffic in this case, as the heavyweight connection opening.First, the newly created Connection Factory on the administrative console WebSphere AS 6.1 has by default a JMS connection pool (max size 10). By debugging the base class of DefaultMessageListenerContainer, AbstractPollingMessageListenerContainer, (specifically the methodprotected boolean doReceiveAndExecute(\n Object invoker, Session session, MessageConsumer consumer, TransactionStatus status))one sees that neither the call to create a connection, neither the call to create a session from connection generate TCP traffic, and TCP traffic is generated only by creating a consumer (considered to be a \"lightweight operation\" if I understand correctly), trying to receive a message from the queue, and closing the consumer.So it seems that the connection is taken from the respective pool, and also the session is somehow \"cached\".So instead of caching by Spring, the caching appears to be done here by the application server.\n"} +{"text": "### Human: We have upgraded to IBM MQ8 and have following dependencies in our project. The following dependencies existscom.ibm.disthub2.dhbcore\ncom.ibm.mq.jmqi\ncom.ibm.mqjms\nibm-jaxrpc-client\ncom.ibm.mq\ncom.ibm.mq.headers\ncom.ibm.mq.pcf\ncom.ibm.mq.commonservicesHowever while running the main program, it is givingNoDefFoundError, despite of providing the jars in the classpath.Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.ibm.mq.headers.internal.HeaderType\n at com.ibm.mq.headers.pcf.PCFMessage.(PCFMessage.java:77) ~[com.ibm.mq.headers-7.5.0.6.jar:7.5.0.6 - p750-006-160226]\n at com.ibm.mq.headers.pcf.PCFMessage.(PCFMessage.java:132) ~[com.ibm.mq.headers-7.5.0.6.jar:7.5.0.6 - p750-006-160226]\n at com.ibm.mq.ese.service.PolicyServiceImpl.policyFromPcf(PolicyServiceImpl.java:575) ~[com.ibm.mq.jmqi-7.5.0.6.jar:7.5.0.6 - p750-006-160226]\n at com.ibm.mq.ese.intercept.JmqiOpenInterceptorImpl.storeSecurityInfoInSmqiObject(JmqiOpenInterceptorImpl.java:359) ~[com.ibm.mq.jmqi-7.5.0.6.jar:7.5.0.6 - p750-006-160226]\n at com.ibm.mq.ese.intercept.JmqiOpenInterceptorImpl.readPolicyIfAvailable(JmqiOpenInterceptorImpl.java:321) ~[com.ibm.mq.jmqi-7.5.0.6.jar:7.5.0.6 - p750-006-160226]\n at com.ibm.mq.ese.intercept.JmqiOpenInterceptorImpl.afterSpiOpen(JmqiOpenInterceptorImpl.java:203) ~[com.ibm.mq.jmqi-7.5.0.6.jar:7.5.0.6 - p750-006-160226]\n at com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.spiOpen(InterceptedJmqiImpl.java:411) ~[com.ibm.mq.jmqi-7.5.0.6.jar:7.5.0.6 - p750-006-160226]\n at com.ibm.mq.ese.jmqi.ESEJMQI.spiOpen(ESEJMQI.java:513) ~[com.ibm.mq.jmqi-7.5.0.6.jar:7.5.0.6 - p750-006-160226]\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer$SpiIdentifiedProducerShadow.initialise(WMQMessageProducer.java:762) ~[com.ibm.mqjms-7.5.0.6.jar:7.5.0.6 - p750-006-160226]\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer.(WMQMessageProducer.java:995) ~[com.ibm.mqjms-7.5.0.6.jar:7.5.0.6 - p750-006-160226]\n at com.ibm.msg.client.wmq.internal.WMQSession.createProducer(WMQSession.java:889) ~[com.ibm.mqjms-7.5.0.6.jar:7.5.0.6 - p750-006-160226]\n at com.ibm.msg.client.jms.internal.JmsSessionImpl.createProducer(JmsSessionImpl.java:1232) ~[com.ibm.mqjms-7.5.0.6.jar:7.5.0.6 - p750-006-160226]\n at com.ibm.msg.client.jms.internal.JmsQueueSessionImpl.createSender(JmsQueueSessionImpl.java:136) ~[com.ibm.mqjms-7.5.0.6.jar:7.5.0.6 - p750-006-160226]\n at com.ibm.mq.jms.MQQueueSession.createSender(MQQueueSession.java:153) ~[com.ibm.mqjms-7.5.0.6.jar:7.5.0.6 - p750-006-160226]\n at com.ibm.mq.jms.MQQueueSession.createProducer(MQQueueSession.java:254) ~[com.ibm.mqjms-7.5.0.6.jar:7.5.0.6 - p750-006-160226]\n at org.springframework.jms.core.JmsTemplate.doCreateProducer(JmsTemplate.java:1114) ~[spring-jms-4.3.4.RELEASE.jar:4.3.4.RELEASE]\n at org.springframework.jms.core.JmsTemplate.createProducer(JmsTemplate.java:1095) ~[spring-jms-4.3.4.RELEASE.jar:4.3.4.RELEASE]\n at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.doSendToDestination(JmsConfiguration.java:482) ~[camel-jms-2.17.0.jar:2.17.0]\n at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.access$100(JmsConfiguration.java:428) ~[camel-jms-2.17.0.jar:2.17.0]\n at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate$1.doInJms(JmsConfiguration.java:442) ~[camel-jms-2.17.0.jar:2.17.0]\n at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:484) ~[spring-jms-4.3.4.RELEASE.jar:4.3.4.RELEASE]### Assistant: Did you upgrade the MQ server to v8 or the MQ client to v8 or both?Do they run on the same machine?The stack trace shows all of the jar files have been renamed to include the string7.5.0.6which would indicate that they are from a MQ v7.5.0.6 MQ client install. IBM does not support moving the jar files from the standard installation location prior to v8.0.At MQ v8.0 and later IBM provides a java only install that can be located anywhere.At MQ v8.0 and later IBM also allows relocation of the filescom.ibm.mq.allclient.jarandcom.ibm.mq.traceControl.jarfrom a full client or server install to other servers and locations in the same enterprise, the above files contain all of the classes that were previously in separate jar files.It would be recommended to remove all the jar files with 7.5.0.6 from the name and stick with the two jar files provided by IBM with MQ v8.0.Per OP @IMahajan, the following components were upgraded: Spring, Camel, Java and all related jars including JMS.\n"} +{"text": "### Human: I have an application which uses MDB, activation specifications and Queue Connection Factories to get/put Messages from WMQ. The application expects a max load of 80 tps. Both Websphere Application Server and WMQ are clustered and each application server connects to seperate host and channel. The application onMessage method is implemented in way so that both session and connection gets closed after message is consumed and response is sent.As per our configuration, we have WAS version is 8.5, IBM MQ queue manager version 7, max server sessions for act spec set to 40 for each node. max connection count in Connection Factory to 40 for each node and max session in session pool of connection factory to 10.\nNow on peak load we expect to make max 80 MQ Channel Instance but as per the investigation we can see it goes above 200 which is causing an issue as max instance limit is reached.Is this happening because max session in session pool of connection factory is set to 10?Is it possible that even though we are closing the session and connection in onMessage, still one connection can have more than one session. If that is the case, is it wise to set this property to 1?\nAlso can there be some property set at WMQ which could cause this increase in MQ Channel Instances.### Assistant: You don't mention specific versions of WAS or MQ, and there could be known problems at a specific version that would change the behavior, but in general it should work as described below.IBM has a nice Technote \"TCP/IP Connection usage between WebSphere Application Server V7 and V8, and WebSphere MQ V7 (and later) explained\" which goes into detail on this subject.You do not mention what you have the SVRCONN channel'sSHARECNVset to, as per below this will impact the number of channel instances observed, I'll assume the default of 10 for the calculations.Note that block quotes below are from the Technotewe have setmax server sessionsfor act spec to40for each nodeThe link above states:Maximum number of conversations = Maximum server sessions + 1Maximum number of conversations =40 + 1=41The link also states:Maximum number of TCP/IPchannel instances= Maximum number of conversations / SHARECNV for the channel being usedMaximum number of TCP/IPchannel instances=41 / 10=5(rounded up to nearest connection)max connection countin Connection Factory to40for each nodemax session in session poolof connection factory to10.Maximum number of conversations = Connection Pool Maximum Connections + (Connection Pool Maximum Connections * Session Pool Maximum Connections)Maximum number of conversations =40 + (40 * 10)=440Maximum number of TCP/IP channel instances = Maximum number of conversations /SHARECNVfor the channel being usedMaximum number of TCP/IP channel instances =440 / 10=44If your MQ SVRCONN channel'sSHARECNVwas set to10, then you should have no more than 49 channel instances for each channel based on each node connecting to a separate channel.If you are hitting 200 channel instances I would suspect yourSHARECNVis less than 10. If it was 1 the the maximum number of channel instances WAS would try to create would go up to481which would be limited by theMAXINSTof the the channel to200.After an application has finished with a JMS Connection and closed it off, it is moved from the Active Pool to the Free Pool, where it is available for reuse. The Connection Pool property Unused timeout defines how long a JMS Connection will stay in the Free Pool before it is disconnected. This property has the default value of 1800 seconds, which is 30 minutes.Every JMS Connection that is created from a WebSphere MQ messaging provider Connection Factory has an associated JMS Session Pool, which work in the same way as Connection Pools. The maximum number of JMS Sessions that can be created from a single JMS Connection is determined by the Connection Factory Session Pool property Maximum connections. The default value of this property is 10.A conversation is started when a JMS Session is first created, and will remain active until the JMS Session is closed because it has remained in the Free Pool for longer than the value of the Session Pool's Unused timeout property.When your app closes the session and connection in onMessage, the connection is moved to the free pool for reuse and the session is moved to the free pool for reuse, the MQ Channel instance will not be closed until the respective timeout is hit.If you want to keep your maximum channel count less than 200 then you could tune yourSession Pool Maximum Connections)to 1 which combined with your Activation Specifications and a SHARECNV(1) would max out at 121 channel instances.You can also increase the SHARECNV value of the channel which will result in dividing the channel instances by that number.It is possible that your connections or sessions are not getting closed properly and you have a \"leak\".\n"} +{"text": "### Human: I am trying to track down an issue where a client can not read messages as fast as they should. Persistent messages are written to a queue. At times, the GET rate is slower than the PUT rate and we see messages backing up.Using tcpdump, I see the following:MQGET: Convert, Fail_If_Quiescing, Accept_Truncated_Msg, Syncpoint, Wait\nMessage is sent\nNotification\nMQCMIT\nMQCMIT_REPLYIn analyzing the dump, sometimes I see the delta between the MQCMIT and MQCMIT_REPLY be in the 0.001 second timeframe and I also see it in the 0.1 second timeframe. It seems like the 0.1 sec delay is slowing the message transfer down. Is there anything I can do to decrease the delta between the MQCMIT and MQCMIT_REPLY? Should the client be reading multiple messages before the MQCMIT is sent?This is MQ 8.0.0.3 on AIX 7.1.### Assistant: The most straightforward way to increase message throughput on the receiving side is to batch MQGET operations. That is, do not issue MQCMIT for every MQGET, but rather after a number of MQGET operations. MQCMIT is the most expensive operation for persistent messages since it involves forcing log writes on the queue manager, and therefore suffers disk I/O latency. Experiment with the batch size - I often use 100, but some applications can go even higher. Too many outstanding MQGET operations can be problematic since they keep the transaction running for much longer time and prevent the log switching.And of course you can check if your system overall tuning is satisfactory. You might have too long a latency between your client and queue manager, or your logs may reside on a slow device, or the logs may share the device with the queue files or an otherwise busy filesystem.\n"} +{"text": "### Human: I need to identify the clustered queues in the queue manager. I need the output as queue name and clustername.Add queues to cluster which queues are not in cluster\nremove queues from cluster which queues are in cluster### Assistant: To display all queues which have theCLUSTERorCLUSNLattribute set on the local queue manager you can use theWHEREparameter to search for queues with aCLUSTERorCLUSNLattribute that isNE(NOT EQUAL) to''(blank).printf \"DISPLAY Q(*) WHERE(CLUSTER NE '')\\nDISPLAY Q(*) WHERE(CLUSNL NE '')\" | runmqsc | grep \"QUEUE(\" | awk -F'[()]' '{print $2}'The variation of below will print a CSV output with \"QUEUE,CLUSTER,CLUSNL\". The printValues syntax is from @mike.dld answer to this post \"Print part of an array or a file and sort in shell\"printf \"DISPLAY Q(*) WHERE(CLUSTER NE '')\\nDISPLAY Q(*) WHERE(CLUSNL NE '')\" | runmqsc | grep -o '^\\w\\+:\\|\\w\\+[(][^)]\\+[)]' | awk -F '[()]' -v OFS=\",\" 'function printValues() { if (\"QUEUE\" in p) { print p[\"QUEUE\"], p[\"CLUSTER\"], p[\"CLUSNL\"] } } /^\\w+:/ { printValues(); delete p; next } { p[$1] = $2 } END { printValues() }'To display all queues which do not have theCLUSTERandCLUSNLattribute set on the local queue manager you can use theWHEREparameter to search for queues with aCLUSTERandCLUSNLattribute that isEQ(EQUAL) to''(blank). sort, uniq, and awk help show only those where both are blank.printf \"DISPLAY Q(*) WHERE(CLUSTER EQ '')\\nDISPLAY Q(*) WHERE(CLUSNL EQ '')\" | runmqsc | grep \"QUEUE(\" | awk -F'[()]' '{print $2}' | sort | uniq -c | awk '{ if ($1 ~ /2/) {print $2}}'To add a queue to a cluster you need toALTERit to set theCLUSTERattribute to the name of a valid cluster. You can also use theCLUSNLattribute to specify aNAMELIST, theNAMELISTmust contain at least one cluster name but can contain more than one cluster name allowing the queue to be in multiple clusters.echo \"ALTER QL(TEST.Q) CLUSTER(RAJCLUS)\" | runmqsc To remove a queue from the cluster you need to blank out theCLUSTERandCLUSNLattributes.echo \"ALTER QL(TEST.Q) CLUSTER('') CLUSNL('')\" | runmqsc \n"} +{"text": "### Human: I'm looking at writing a collector to read log messages off an MQ queue. I could have someone write Java or C# code, or I can write it in Powershell. Big question is can I actually? I haven't seen anything that talks about using MQ as an input source to Powershell. It seems like it would fit the model from a \"pipeline\" perspective...### Assistant: SupportPac MO74is a Powershell interface and it's been updated to at least v8.0.0.2.\n"} +{"text": "### Human: I'm using ccdt for connection factory in WAS. I can't see the host, port and etc. in WAS console. May be I can install some plugin for possibility to see parameters in .tab file?### Assistant: Yes! The plugin is called IBM MQ Client. Just use therunmqsccommand with the -n option as described in the Knowledge Center'srunmqscpage. You can download the IBM MQ Client from theSupportPacs page. Look for SupportPacs named MQC*. MQC8 is the v8 client, MQC9 is the v9 client, etc. Also, hover over theibm-mqtag and click \"info\" for an extensive compilation of \"getting started\" material, including the Knowledge Centers and links to the SupportPacs.\n"} +{"text": "### Human: I am attempting to read / write from Websphere Multiple Queue Managers QM1, QM2 and so on. Each queue manager have own channel id and multiple queues under each QM.Is it possible to write java code for these conditions.I wrote java code for multiple queues under one QM by looping queues one by one and process them. but even i cannot think to code for multiple QM. If anybody have idea please share me.### Assistant: If you have that sort of requirement then you may want to do this:Run multiple instances of your consumer application where each instance connects to a dedicated queue manager and process messages. Run multiple threads with each thread processing messages from their dedicated queue.This way the message processing load is distributed across multiple instances and failure in one application does not affect others.\n"} +{"text": "### Human: \u0130 tried the following command but it did not work.alter authinfo(system.default.authinfo.idpwos) authtype(idpwos) chckclnt(required)Anyone worked on this subject before?### Assistant: When you make changes to the connauth authinfo objects you need to runREFRESH SECURITY TYPE(CONNAUTH)for the changes to take effect. A restart of the queue manager would also have the same effect.This is documented in theKnowledge Center - Turning on connection authentication on a queue managerTo check local connections, use the AUTHINFO attribute CHCKLOCL (check local connections). To check client connections, use the AUTHINFO attribute CHCKCLNT (check client connections).The configuration must be refreshed before the queue manager recognizes the changes.ALTER QMGR CONNAUTH(USE.PW)\nDEFINE AUTHINFO(USE.PW) +\nAUTHTYPE(IDPWOS) +\nFAILDLAY(10) +\nCHCKLOCL(OPTIONAL) +\nCHCKCLNT(REQUIRED)\n\nREFRESH SECURITY TYPE(CONNAUTH)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^I would also suggest that you set the AUTHINFO object parameter ADOPTCTX(YES) as well as set ChlauthEarlyAdopt=E in your qm.ini channels stanza. See @T.Rob's excellent presentation\"CONNAUTH Doesn't work like you think it does\"for more details on why.\n"} +{"text": "### Human: I have got the MQ Client running successfully and the messages are available using it.WE have set up the necessary Environment variables:\nMQCHLLIB and MQCHLTAB and MQSSLKEYR.The .TAB file is in the right folder.\nHowever when I execute the following code:private static bool ConnectMq()\n {\n try\n {\n queueManager = new MQQueueManager(\"ECG_MBTST_QM\", Init(false));\n queueManager.Connect();\n if (queueManager.IsConnected)\n {\n Console.WriteLine(\"Connected...\");\n }\n return true;\n }\n catch (MQException exp)\n {\n Console.WriteLine(\"Exception Message: \" + exp.Message); \n }\n catch (Exception exp)\n {\n Console.WriteLine(\"Exception: \" + exp.Message);\n }\n return false;\n }\n private static Hashtable Init()\n {\n Hashtable properties;\n properties = new Hashtable\n {\n {MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT}\n };\n\n return properties;\n }I get the error message as described.\nI have no choice but to use a CCDT file as that is what the server host has specified.\nI believe the server is v7 and I am referencing the v8 WMQ libraries.\nIn theory this should work.I have tried with using the standard set of properties as well (values have been altered for security purposes):properties = new Hashtable\n {\n {MQC.TRANSPORT_PROPERTY, \"TCP\"},\n {MQC.CHANNEL_PROPERTY, \"Channel\"},\n {MQC.CONNECTION_NAME_PROPERTY, \"IBM_MQ_Conn\"},\n {MQC.PORT_PROPERTY, \"1414\"},\n {MQC.HOST_NAME_PROPERTY, \"IP Address\"},\n {MQC.SSL_CIPHER_SPEC_PROPERTY, \"TLS_RSA_WITH_AES_128_CBC_SHA\"}\n };But when i use the above properties I get a 2538 error - Host not available.\nIs there something I am missing with regards to how to use the CCDT file and C# together?Thanks in advance.edit - as requested by JoshMCThis is the latest entry from the AMQERR01.LOG file:1/18/2017 1:51:05 AM - Process(3272.1) User(andrewhuntley) Program( MQ app.exe)\nAMQ9202: Remote host '192.168.150.102' not available, retry later.\n\nEXPLANATION:\nThe attempt to allocate a conversation using TCP/IP to host '192.168.150.102'\nfor channel (Exception) was not successful. However the error may be a\ntransitory one and it may be possible to successfully allocate a TCP/IP\nconversation later. \n\n In some cases the remote host cannot be determined and so is shown as '????'.\nACTION:\nTry the connection again later. If the failure persists, record the error\nvalues and contact your systems administrator. The return code from TCP/IP is 0\n(X'0'). The reason for the failure may be that this host cannot reach the\ndestination host. It may also be possible that the listening program at host\n'192.168.150.102' was not running. If this is the case, perform the relevant\noperations to start the TCP/IP listening program, and try again.\n----- MQTCPConnection.cs : 357 ------------------------------------------------Please note that the server is up and running and accessible as I can connect to it using the installed IBM client.### Assistant: TheNuGet Managed IBM WebSphere MQ Client for .NETuses the IBM MQ 8.0.0.5 MQ libraries.I found this APARIT14222from IBM which seems to be a match for the exact error message you received.This is supposed to be fixed in the next fixpack 8.0.0.6 which should be out by the end of March 2017. If you have a IBM support contract you can also open a PMR and request that they provide you a copy of the impacted dll that has a fix for this APAR included against 8.0.0.5.\n"} +{"text": "### Human: We are trying to retrieve the JMS Headers we populate in the message using the Websphere MQ APIs.Right now i am using mq-all-client jars to establish the connection to the queueManagers.getOptions.options = CMQC.MQGMO_NO_WAIT + CMQC.MQGMO_FAIL_IF_QUIESCING + CMQC.MQGMO_CONVERT;I tried retrieving the JMS Property by :MQMessage message = new MQMessage();\nqueue.get(message, getOptions);\nlogger.info(message.getStringProperty(\"My_PROPERTY\"));I am getting anull.\nIs there a way where you establish a connection through MQ-allclients jar and still retrieve the JMS property set on the message ?\nI can retrieve the properties through a JMS Consumer but i want to get it through the MQ APIs.### Assistant: logger.info(message.getStringProperty(\"My_PROPERTY\"));Well, that 'particular' named property does not exist. Don't forget, property keywords are case sensitive.Why don't you dump all of the named properties of the message and see exactly which ones are in the message?String propName;\nEnumeration props = msg.getPropertyNames(\"%\");\nif (props != null)\n{\n while (props.hasMoreElements())\n {\n propName = props.nextElement();\n System.out.println(\"---> propName=\"+propName+\" : \" + \"value=\"+msg.getObjectProperty(propName));\n }\n}\n"} +{"text": "### Human: I have a client in NodeJS using the MQTT module (mqtt.js) to communicate with a topic of WebSphere MQ, redirected to a queue : I need the result to be on a queue so I use a topic between the source and the destination (since MQTT protocol communicate only with topics).So we have :NodeJS (source) -> Topic of Websphere MQ (intermediate) -> Queue of Websphere MQ (destination)The problem is that the received messages on the queue of WebsphereMQ are MQHRF2 format but I need MQSTR.I did not find any property in mqtt.js side to specify the format.I supposed we can force it with IBM Websphere MQ, but how ? Can I create a channel or anything for this use, that's to say convert the receiving format?Thanks in advance for your help !Configuration :MQTT.js v3WebSphere MQ v7.5Constrains :WebSphere MQ must be v7.5 (so I can't upgrade to v8 to use mqlight)Better stay with the module MQTT.jsIt works correctly when I publish directly on a topic via the WebSphere MQ explorer. However, it fails when I publish from the NodeJS application.I tried both methods listing in the comments but I found a weird thing : The result is different according to if I use MQExplorer (what I always used) or the MQ console :On the MQ Explorer :On the MQ Console, with the command : amqsbcg QUEUE_MQTT_VERIF MQTTVerification :As you can see, in the console, the format field is empty, whereas on the MQExplorer it is MQHRF2. The messages are also different.So the result on the MQConsole is right whereas the MQExplorer still shows a wrong result after the changes.\nNote that the result is right only if changes has been done on both :Subscription : ALTER SUB(APPLE.PRICES) PSPROP(NONE)Queue : ALTER QLOCAL(PRICES) PROPCTL(NONE)Maybe the source of the problem is just the display on MQExplorer software ?EDIT:The difference between MQExplorer and MQConsole was due to the parameter in MQ Explorer : Window -> Preferences -> WebSphereMQ Explorer -> Message properties -> Uncheck \"Display message properties\".### Assistant: When redirecting publications made on a topic to a queue you probably have some definitions like this:-DEFINE QLOCAL(PRICES)\nDEFINE TOPIC(APPLES) TOPICSTR('Price/Fruit/Apples')\nDEFINE SUB(APPLE.PRICES) TOPICOBJ(APPLES) DESTCLAS(PROVIDED) DEST(PRICES)which redirects publications made on the topic string 'Price/Fruit/Apples' to the queue PRICES.What you will find with such a set up however, is that the topic string is added to the message by the queue manager and thus adds an MQRFH2 header onto the front of your published message.Message Descriptor (MQMD)\nReport :00000000\nMessage Type :8 (Datagram)\nFormat :'MQHRF2 '\nPriority :0\nPersistence :0 (Not Persistent)\nMessage Id :414D51204D51473120202020202020202D77835720003702\n 'AMQ MQG1 -w.W .7.'\nReplyToQ :' '\nReplyToQMgr :'MQG1 '\n[ 102 bytes] Message Content\n\n \n Price/Fruit/Apples\n \n\nApples are $2/kiloTo remove this without changing the application reading from the queue, make this alteration to the subscription.ALTER SUB(APPLE.PRICES) PSPROP(NONE)This stops the queue manager even putting the topic string into the message in the first place.From your MQ Explorer screenshot, it can be seen that the MQRFH2 is still present after the SUB is changed to PSPROP(NONE) because there is another property present - mqtt.clientid. Since there are other items in the MQRFH2 as well as the topic string, then the SUB change will not remove those - only the topic string added by the queue manager. In that case, you should try the following.If alternatively you want to have the topic string there sometimes and only remove it for applications that don't want to see it, you can make a similar change to the queue, which can be over-ridden in application code to force the properties to be delivered to the application, but otherwise they won't be. This would also allow you to read any existing messages that had already been published (the change to the SUB isn't retrospectively applied to messages that are already on the queue).ALTER QLOCAL(PRICES) PROPCTL(NONE)This will mean that applications that don't specifically request MQGMO_FORCE_RFH2 will see the message without the MQRFH2. The amqsbcg sample is one such application.If an application codes MQGMO_FORCE_RFH2 it will still be able to see the properties in an MQRFH2 header because it has explicitly asked for that. You cannot stop that by changing the queue.Your problem is only now with the way MQ Explorer chooses to display the message. There is a parameter in MQ Explorer : Window -> Preferences -> WebSphereMQ Explorer -> Message properties -> Uncheck \"Display message properties\" which will stop it forcing them to be an MQRFH2, and then you'll be all good.\n"} +{"text": "### Human: I'm trying to setup ssl for IBM MQ server and when I executed the commandrunmqckm -keydb -create -db keydb.kdb -pw password -type cms -expire 1500 -stashas one of the steps, it fails with the following exception.Exception in thread \"main\" java.lang.ExceptionInInitializerError\n at java.lang.J9VMInternals.ensureError(J9VMInternals.java:186)\n at java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:175)\n at javax.crypto.Mac.getInstance(Unknown Source)\n at com.ibm.security.cmskeystore.FileHeaderHashGeneratorFactory$FileHeaderHashGeneratorV4Impl.generateHash(FileHeaderHashGeneratorFactory.java:145)\n at com.ibm.security.cmskeystore.CMSKeyStoreSpi.engineLoad(CMSKeyStoreSpi.java:1206)\n at java.security.KeyStore.load(KeyStore.java:1226)\n at com.ibm.gsk.ikeyman.keystore.KeyStoreProxyCreatorFactory$FileKeyStoreProxy.performLoad(KeyStoreProxyCreatorFactory.java:304)\n at com.ibm.gsk.ikeyman.keystore.KeyStoreProxyCreatorFactory$CMSKeyStoreProxy.performLoad(KeyStoreProxyCreatorFactory.java:437)\n at com.ibm.gsk.ikeyman.keystore.KeyStoreProxyCreatorFactory$FileKeyStoreProxy.load(KeyStoreProxyCreatorFactory.java:253)\n at com.ibm.gsk.ikeyman.keystore.KeyStoreProxyCreatorFactory$AbstractKeyStoreProxy.getKeyStore(KeyStoreProxyCreatorFactory.java:193)\n at com.ibm.gsk.ikeyman.keystore.KeyStoreItemFactory.getCMSKeyStoreItem(KeyStoreItemFactory.java:323)\n at com.ibm.gsk.ikeyman.keystore.KeyStoreItemFactory.newCMSKeyStoreItem(KeyStoreItemFactory.java:294)\n at com.ibm.gsk.ikeyman.keystore.KeyStoreItemFactory.createKeyStore(KeyStoreItemFactory.java:115)\n at com.ibm.gsk.ikeyman.command.CommandFactory$CreateDbCommand.run(CommandFactory.java:402)\n at com.ibm.gsk.ikeyman.command.Command.invoke(Command.java:203)\n at com.ibm.gsk.ikeyman.ikeycmd.main(ikeycmd.java:62)\nCaused by: java.lang.SecurityException: Cannot set up certs for trusted CAs\n at javax.crypto.b.(Unknown Source)\n ... 14 more\nCaused by: java.lang.SecurityException: Jurisdiction policy files are not signed by trusted signers!\n at javax.crypto.b.a(Unknown Source)\n at javax.crypto.b.c(Unknown Source)\n at javax.crypto.b.access$600(Unknown Source)\n at javax.crypto.b$0.run(Unknown Source)\n at java.security.AccessController.doPrivileged(AccessController.java:333)\n ... 15 moreMy Websphere and Java version information are as belowWebsphereName: WebSphere MQ\nVersion: 8.0.0.2\nLevel: p800-002-150519.TRIAL\nBuildType: IKAP - (Production)\nPlatform: WebSphere MQ for Linux (x86-64 platform)\nMode: 64-bit\nO/S: Linux 2.6.32-504.el6.x86_64\nInstName: Installation1\nInstDesc: \nPrimary: Yes\nInstPath: /opt/mqm\nDataPath: /var/mqm\nMaxCmdLevel: 801\nLicenseType: ProductionJavajava version \"1.7.0_80\"\nJava(TM) SE Runtime Environment (build 1.7.0_80-b15)\nJava HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)Can anyone please help me to resolve this issue?### Assistant: I figured the solution myself and posting it below for the future reference of other.DownloadIBM Unrestricted SDK JCE policy filesfromhttps://www-01.ibm.com/marketing/iwm/iwm/web/preLogin.do?source=jcesdk.Copy bothlocal_policy.jarandUS_export_policy.jarfiles to/java/jre64/jre/lib/securityfolder.Give ownership and executable permission of both files tomqmuser.\n"} +{"text": "### Human: I writed some JAR which has a wrap communication with IBM MQ.\nWhen I try use that JAR in other app it works only when I run it in IDE or in console as maven:\"C:\\Program Files\\Apache\\maven\\bin\\mvn.bat\" -Dexec.args=\"-classpath %classpath xx.xxx.xxx.Application\" -Dexec.executable=\"C:\\Program Files\\Java\\jdk1.7.0_71\\bin\\java.exe\" -Dmaven.ext.class.path=C:\\Users\\myUser\\AppData\\Roaming\\NetBeans\\8.0.1\\maven-nblib\\netbeans-eventspy.jar;C:\\Users\\myUser\\AppData\\Roaming\\NetBeans\\8.0.1\\maven-nblib\\netbeans-cos.jar -Dfile.encoding=UTF-8 org.codehaus.mojo:exec-maven-plugin:1.2.1:execWhen I try to run it in that way:java -jar MyJar.jarI got error:FFDC called in uninitialized Trace module\n\n\n\n FDCTitle\n\n\nProduct :- ProductName\nDate/Time :- Mon Apr 25 21:27:53 CEST 2016\nSystem time :- 1461612473559\nOperating System :- Windows 7\nUserID :- myUser\nJava Vendor :- Oracle Corporation\nJava Version :- 24.71-b01\n\nSource Class :- com.ibm.mq.jmqi.JmqiDefaultThreadPool\nSource Method :- enqueue(Runnable)\nProbeID :- XN009001\nThread :- name=main priority=5 group=main ccl=sun.misc.Launcher$AppClassLoader@4bcd2d49\n\n Data\n ----\n\n| CompCode :- 2\n| Reason :- 2195\n| exception :- ExceptionDepth is 2\n| exception :-\n| | Cause:1 :- com.ibm.msg.client.commonservices.CSIException: JMSCS0002\n| | Message:1 :- JMSCS0002\n| | StackTrace:1 :- com.ibm.msg.client.commonservices.CSIException: JMSCS0002\n| | at com.ibm.msg.client.commonservices.workqueue.PIWorkQueueManager.enqueueItem(PIWorkQueueManager.java:54)\n| | at com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.enqueue(WorkQueueManager.java:232)\n| | at com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.enqueue(WorkQueueManager.java:200)\n| | at com.ibm.mq.jmqi.JmqiDefaultThreadPool.enqueue(JmqiDefaultThreadPool.java:78)\n| | at com.ibm.mq.jmqi.remote.impl.RemoteConnection.setUpAsyncMode(RemoteConnection.java:1900)\n| | at com.ibm.mq.jmqi.remote.impl.RemoteConnection.initSess(RemoteConnection.java:1664)\n| | at com.ibm.mq.jmqi.remote.impl.RemoteConnection.connect(RemoteConnection.java:838)\n| | at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSessionFromNewConnection(RemoteConnectionSpecification.java:409)\n| | at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSession(RemoteConnectionSpecification.java:305)\n| | at com.ibm.mq.jmqi.remote.impl.RemoteConnectionPool.getSession(RemoteConnectionPool.java:146)\n| | at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1868)\n| | at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1396)\n| | at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:342)\n| | at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:6865)\n| | at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6221)\n| | at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl._createConnection(JmsConnectionFactoryImpl.java:285)\n| | at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:233)\n| | at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6016)\n| | at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:111)\n| | at xx.xxx.xxx.cepapi.CEPSessionImpl.creteConnection(CEPSessionImpl.java:84)\n| | at xx.xxx.xxx.cepapi.CEPSessionImpl.connect(CEPSessionImpl.java:44)\n| | at xx.xxx.xxxxxx.cep.CEPManager.connect(CEPManager.java:45)\n| | at xx.xxx.xxxxxx.ApplicationManager.initialiceCEP(ApplicationManager.java:33)\n| | at xx.xxx.xxxxxx.ApplicationManager.initializeApplication(ApplicationManager.java:23)\n| | at xx.xxx.xxxxxx.console.ConsoleAdapter.startAction(ConsoleAdapter.java:93)\n| | at xx.xxx.xxxxxx.console.ConsoleAdapter.runConsole(ConsoleAdapter.java:42)\n| | at xx.xxx.xxxxxx.Application.main(Application.java:22)\n| |\n| job :- com.ibm.mq.jmqi.remote.impl.RemoteRcvThread@b7918cf\n\n Version information\n -------------------\n\nJava Message Service Client\n8.0.0.0\np000-L140506\nProduction\nComponent Name: com.ibm.msg.client.jms\nCMVC: p000-L140506\nClass Name: class com.ibm.msg.client.jms.internal.JMSComponent\nFactory Class: null\nVersion: 8.0.0.0\nComponent Title: Java Message Service Client\nJar location: file:/D:/Project/XXXXX/target/xxxxx-2.0.0-jar-with-dependencies.jar\n\nWebSphere MQ classes for Java Message Service\n8.0.0.0\np000-L140506\nProduction\nComponent Name: com.ibm.mq.jms\nCMVC: p000-L140506\nClass Name: class com.ibm.mq.jms.MQJMSComponent\nFactory Class: null\nVersion: 8.0.0.0\nComponent Title: WebSphere MQ classes for Java Message Service\nJar location: file:/D:/Project/XXXXX/target/xxxxx-2.0.0-jar-with-dependencies.jar\n\nIBM WebSphere MQ JMS Provider\n8.0.0.0\np000-L140506\nProduction\nComponent Name: com.ibm.msg.client.wmq\nCMVC: p000-L140506\nClass Name: class com.ibm.msg.client.wmq.factories.WMQComponent\nFactory Class: class com.ibm.msg.client.wmq.factories.WMQFactoryFactory\nVersion: 8.0.0.0\nComponent Title: IBM WebSphere MQ JMS Provider\nJar location: file:/D:/Project/XXXXX/target/xxxxx-2.0.0-jar-with-dependencies.jar\n\n\n\n Stack trace\n -----------\n\nStack trace to show the location of the FFST call\n| FFST Location :- java.lang.Exception\n| at com.ibm.msg.client.commonservices.trace.Trace.getCurrentPosition(Trace.java:2049)\n| at com.ibm.msg.client.commonservices.trace.Trace.createFFSTString(Trace.java:1960)\n| at com.ibm.msg.client.commonservices.trace.Trace.ffstInternal(Trace.java:1847)\n| at com.ibm.msg.client.commonservices.trace.Trace.ffst(Trace.java:1657)\n| at com.ibm.mq.jmqi.JmqiDefaultThreadPool.enqueue(JmqiDefaultThreadPool.java:92)\n| at com.ibm.mq.jmqi.remote.impl.RemoteConnection.setUpAsyncMode(RemoteConnection.java:1900)\n| at com.ibm.mq.jmqi.remote.impl.RemoteConnection.initSess(RemoteConnection.java:1664)\n| at com.ibm.mq.jmqi.remote.impl.RemoteConnection.connect(RemoteConnection.java:838)\n| at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSessionFromNewConnection(RemoteConnectionSpecification.java:409)\n| at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSession(RemoteConnectionSpecification.java:305)\n| at com.ibm.mq.jmqi.remote.impl.RemoteConnectionPool.getSession(RemoteConnectionPool.java:146)\n| at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1868)\n| at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1396)\n| at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:342)\n| at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:6865)\n| at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6221)\n| at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl._createConnection(JmsConnectionFactoryImpl.java:285)\n| at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:233)\n| at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6016)\n| at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:111)\n| at xx.xxx.xxx.cepapi.CEPSessionImpl.creteConnection(CEPSessionImpl.java:84)\n| at xx.xxx.xxx.cepapi.CEPSessionImpl.connect(CEPSessionImpl.java:44)\n| at xx.xxx.xxxxxx.cep.CEPManager.connect(CEPManager.java:45)\n| at xx.xxx.xxxxxx.ApplicationManager.initialiceCEP(ApplicationManager.java:33)\n| at xx.xxx.xxxxxx.ApplicationManager.initializeApplication(ApplicationManager.java:23)\n| at xx.xxx.xxxxxx.console.ConsoleAdapter.startAction(ConsoleAdapter.java:93)\n| at xx.xxx.xxxxxx.console.ConsoleAdapter.runConsole(ConsoleAdapter.java:42)\n| at xx.xxx.xxxxxx.Application.main(Application.java:22)\n|\n\n Property Store Contents\n -----------------------\n\nAll currently set properties\n| MQJMS_TRACE_DIR :-\n| MQJMS_TRACE_LEVEL :-\n| awt.toolkit :- sun.awt.windows.WToolkit\n| com.ibm.mq.cfg.Channels.DefRecon :- \n| com.ibm.mq.cfg.MQCCSID :- \n| com.ibm.mq.cfg.MQCLNTCF :- \n| com.ibm.mq.cfg.MQIPADDRV :- \n| com.ibm.mq.cfg.MQSSLPOLLTIMEOUT :- \n| com.ibm.mq.cfg.MQ_LCLADDR :- \n| com.ibm.mq.cfg.TCP.ClntRcvBuffSize :- \n| com.ibm.mq.cfg.TCP.ClntSndBuffSize :- \n| com.ibm.mq.cfg.TCP.Connect_Timeout :- \n| com.ibm.mq.cfg.TCP.EndPort :- \n| com.ibm.mq.cfg.TCP.StrPort :- \n| com.ibm.mq.cfg.jmqi.AmqRandomNumberType :- \n| com.ibm.mq.cfg.jmqi.PasswordProtection :- \n| com.ibm.mq.cfg.jmqi.libpath :- \n| com.ibm.mq.cfg.jmqi.useMQCSPauthentication :- \n| com.ibm.mq.connector.JCARuntimeHelper :- \n| com.ibm.mq.jmqi.ignoreCCDTCertificateLabel :- \n| com.ibm.mq.jms.replyToStyle :- \n| com.ibm.mq.jms.tuning.usePersistenceFromMD :- \n| com.ibm.mq.localAddress :-\n| com.ibm.msg.client.commonservices.ffst.suppress :- 0\n| com.ibm.msg.client.wmq.forceAllowClientConnection :- false\n| com.ibm.msg.client.wmq.internal.forceDontUseJmqiWorkerThread :- false\n| com.ibm.msg.client.wmq.internal.forceDontUseSharedHconn :- false\n| com.ibm.msg.client.wmq.internal.forceUseJmqiWorkerThread :- false\n| com.ibm.msg.client.wmq.overrideInheritRRSContext :- false\n| com.ibm.msg.client.wmq.overrideProviderVersion :- \n| com.ibm.vm.bitmode :- \n| file.encoding :- Cp1250\n| file.encoding.pkg :- sun.io\n| file.separator :- \\\n| java.awt.graphicsenv :- sun.awt.Win32GraphicsEnvironment\n| java.awt.printerjob :- sun.awt.windows.WPrinterJob\n| java.class.path :- target\\xxxxx-2.0.0-jar-with-dependencies.jar\n| java.class.version :- 51.0\n| java.endorsed.dirs :- C:\\Program Files\\Java\\jre7\\lib\\endorsed\n| java.ext.dirs :- C:\\Program Files\\Java\\jre7\\lib\\ext;C:\\WINDOWS\\Sun\\Java\\lib\\ext\n| java.home :- C:\\Program Files\\Java\\jre7\n| java.io.tmpdir :- c:\\temp\\\n| java.library.path :- C:\\WINDOWS\\system32;C:\\WINDOWS\\Sun\\Java\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\Program Files\\IBM\\WebSphere MQ_1\n\\java\\lib;C:\\Program Files\\IBM\\WebSphere MQ_1\\java\\lib64;C:\\Program Files\\IBM\\WebSphere MQ\\java\\lib;C:\\Program Files\\IBM\\WebSphere MQ\\java\\lib64;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\W\nINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\Git\\cmd;C:\\Program Files (x86)\\Git\\bin;D:\\Program Files\\Apache\\maven\\bin;C:\\Program Files\\IB\nM\\WebSphere MQ\\bin64;C:\\Program Files\\IBM\\WebSphere MQ\\bin;C:\\Program Files\\IBM\\WebSphere MQ\\tools\\c\\samples\\bin;C:\\Program Files\\IBM\\WebSphere MQ_1\\bin64;C:\\Program Files\\IBM\\WebS\nphere MQ_1\\bin;C:\\Program Files\\IBM\\WebSphere MQ_1\\tools\\c\\samples\\bin;C:\\Program Files (x86)\\EasyFrom Trial\\;C:\\Program Files\\Java\\jdk1.7.0_71\\bin\\;C:\\Program Files\\TortoiseSVN\\bi\nn;C:\\Program Files\\nodejs\\;C:\\Users\\myUser\\AppData\\Roaming\\npm;.\n| java.runtime.name :- Java(TM) SE Runtime Environment\n| java.runtime.version :- 1.7.0_71-b14\n| java.specification.name :- Java Platform API Specification\n| java.specification.vendor :- Oracle Corporation\n| java.specification.version :- 1.7\n| java.vendor :- Oracle Corporation\n| java.vendor.url :- http://java.oracle.com/\n| java.vendor.url.bug :- http://bugreport.sun.com/bugreport/\n| java.version :- 1.7.0_71\n| java.vm.info :- mixed mode\n| java.vm.name :- Java HotSpot(TM) 64-Bit Server VM\n| java.vm.specification.name :- Java Virtual Machine Specification\n| java.vm.specification.vendor :- Oracle Corporation\n| java.vm.specification.version :- 1.7\n| java.vm.vendor :- Oracle Corporation\n| java.vm.version :- 24.71-b01\n| line.separator :-\n\n| os.arch :- amd64\n| os.name :- \n| os.version :- 6.1\n| path.separator :- ;\n| sun.arch.data.model :- \n| sun.boot.class.path :- C:\\Program Files\\Java\\jre7\\lib\\resources.jar;C:\\Program Files\\Java\\jre7\\lib\\rt.jar;C:\\Program Files\\Java\\jre7\\\nlib\\sunrsasign.jar;C:\\Program Files\\Java\\jre7\\lib\\jsse.jar;C:\\Program Files\\Java\\jre7\\lib\\jce.jar;C:\\Program Files\\Java\\jre7\\lib\\charsets.jar;C:\\Program Files\\Java\\jre7\\lib\\jfr.jar\n;C:\\Program Files\\Java\\jre7\\classes\n| sun.boot.library.path :- C:\\Program Files\\Java\\jre7\\bin\n| sun.cpu.endian :- little\n| sun.cpu.isalist :- amd64\n| sun.desktop :- windows\n| sun.io.unicode.encoding :- UnicodeLittle\n| sun.java.command :- target\\xxxxx-2.0.0-jar-with-dependencies.jar\n| sun.java.launcher :- SUN_STANDARD\n| sun.jnu.encoding :- Cp1250\n| sun.management.compiler :- HotSpot 64-Bit Tiered Compilers\n| sun.os.patch.level :- Service Pack 1\n| user.country :- US\n| user.country.format :- PL\n| user.dir :- D:\\Project\\XXXXX\n| user.home :- C:\\Users\\myUser\n| user.language :- en\n| user.language.format :- pl\n| user.name :- myUser\n| user.script :-\n| user.timezone :- Europe/Belgrade\n| user.variant :-\n\n WorkQueueMananger Contents\n --------------------------\n\n| Maintain ThreadPool size :- false\n| Maximum ThreadPool size :- -1\n| ThreadPool inactive timeout :- 0\n| unavailable - :- com.ibm.msg.client.commonservices.CSIException: JMSCS0002\n\n Runtime properties\n ------------------\n\n| Available processors :- 8\n| Free memory in bytes (now) :- 87386128\n| Max memory in bytes :- 1888485376\n| Total memory in bytes (now) :- 127401984\n\n Component Manager Contents\n --------------------------\n\nCommon Services Components:\nMessaging Provider Components:\n| CMVC :- p000-L140506\n| Class Name :- class com.ibm.msg.client.wmq.factories.WMQComponent\n| Component Name :- com.ibm.msg.client.wmq\n| Component Title :- IBM WebSphere MQ JMS Provider\n| Factory Class :- class com.ibm.msg.client.wmq.factories.WMQFactoryFactory\n| Jar location :- file:/D:/Project/XXXXX/target/xxxxx-2.0.0-jar-with-dependencies.jar\n| Version :- 8.0.0.0\n\n\n\n\n Provider Specific Information\n -----------------------------\n\nOverview of JMS System\nNum. Connections : 0\nNum. Sessions : 0\nNum. Consumers : 0\nNum. Producers : 0\n\nDetailed JMS System Information\nConnections :\nSessions :\nConsumers :\nProducers :\n\n\nFFDC called in uninitialized Trace module\n\n\n\n FDCTitle\n\n\nProduct :- ProductName\nDate/Time :- Mon Apr 25 21:27:53 CEST 2016\nSystem time :- 1461612473705\nOperating System :- Windows 7\nUserID :- myUser\nJava Vendor :- Oracle Corporation\nJava Version :- 24.71-b01\n\nSource Class :- com.ibm.msg.client.commonservices.nls.PINLSServices\nSource Method :- getMessage(String,HashMap)\nProbeID :- XC003002\nThread :- name=main priority=5 group=main ccl=sun.misc.Launcher$AppClassLoader@4bcd2d49\n\n Data\n ----\n\nData :- none\n\n Version information\n -------------------\n\nJava Message Service Client\n8.0.0.0\np000-L140506\nProduction\nComponent Name: com.ibm.msg.client.jms\nCMVC: p000-L140506\nClass Name: class com.ibm.msg.client.jms.internal.JMSComponent\nFactory Class: null\nVersion: 8.0.0.0\nComponent Title: Java Message Service Client\nJar location: file:/D:/Project/XXXXX/target/xxxxx-2.0.0-jar-with-dependencies.jar\n\nWebSphere MQ classes for Java Message Service\n8.0.0.0\np000-L140506\nProduction\nComponent Name: com.ibm.mq.jms\nCMVC: p000-L140506\nClass Name: class com.ibm.mq.jms.MQJMSComponent\nFactory Class: null\nVersion: 8.0.0.0\nComponent Title: WebSphere MQ classes for Java Message Service\nJar location: file:/D:/Project/XXXXX/target/xxxxx-2.0.0-jar-with-dependencies.jar\n\nIBM WebSphere MQ JMS Provider\n8.0.0.0\np000-L140506\nProduction\nComponent Name: com.ibm.msg.client.wmq\nCMVC: p000-L140506\nClass Name: class com.ibm.msg.client.wmq.factories.WMQComponent\nFactory Class: class com.ibm.msg.client.wmq.factories.WMQFactoryFactory\nVersion: 8.0.0.0\nComponent Title: IBM WebSphere MQ JMS Provider\nJar location: file:/D:/Project/XXXXX/target/xxxxx-2.0.0-jar-with-dependencies.jar\n\n\n\n Stack trace\n -----------\n\nStack trace to show the location of the FFST call\n| FFST Location :- java.lang.Exception\n| at com.ibm.msg.client.commonservices.trace.Trace.getCurrentPosition(Trace.java:2049)\n| at com.ibm.msg.client.commonservices.trace.Trace.createFFSTString(Trace.java:1960)\n| at com.ibm.msg.client.commonservices.trace.Trace.ffstInternal(Trace.java:1847)\n| at com.ibm.msg.client.commonservices.trace.Trace.ffst(Trace.java:1657)\n| at com.ibm.msg.client.commonservices.nls.PINLSServices.getMessage(PINLSServices.java:132)\n| at com.ibm.msg.client.commonservices.nls.NLSServices.getMessage(NLSServices.java:238)\n| at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:210)\n| at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:406)\n| at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:6865)\n| at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6221)\n| at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl._createConnection(JmsConnectionFactoryImpl.java:285)\n| at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:233)\n| at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6016)\n| at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:111)\n| at xx.xxx.xxx.cepapi.CEPSessionImpl.creteConnection(CEPSessionImpl.java:84)\n| at xx.xxx.xxx.cepapi.CEPSessionImpl.connect(CEPSessionImpl.java:44)\n| at xx.xxx.xxxxxx.cep.CEPManager.connect(CEPManager.java:45)\n| at xx.xxx.xxxxxx.ApplicationManager.initialiceCEP(ApplicationManager.java:33)\n| at xx.xxx.xxxxxx.ApplicationManager.initializeApplication(ApplicationManager.java:23)\n| at xx.xxx.xxxxxx.console.ConsoleAdapter.startAction(ConsoleAdapter.java:93)\n| at xx.xxx.xxxxxx.console.ConsoleAdapter.runConsole(ConsoleAdapter.java:42)\n| at xx.xxx.xxxxxx.Application.main(Application.java:22)\n|...Any idea what that can be?### Assistant: Solution is load IBM classes from outside of JAR.\n"} +{"text": "### Human: First of all I would like to apologize for a little unorganized write up here. I am writing a spring boot application to read a message from the MQ queue.But I am getting an exception while trying to create an instance of theMQXAConnectionFactoryobject. And I have realized that it is being caused because theMQXAConnectionFactory extends com.ibm.msg.client.jms.admin.JmsJndiConnectionFactoryImpl.code snippet@Value(\"${ems.mq.cf.hostName}\")\n String mqHostName;\n @Value(\"${ems.mq.cf.port}\")\n int mqPort;\n @Value(\"${ems.mq.cf.queueManager}\")\n String mqQueueManager;\n @Value(\"${ems.mq.cf.channel}\")\n String mqChannel;\n\n private ConnectionFactory mqJmsConnectionFactory() throws JMSException{\n\n try {\n\n MQXAConnectionFactory factory=new MQXAConnectionFactory();\n factory.setHostName(mqHostName);\n factory.setPort(mqPort);\n factory.setQueueManager(mqQueueManager);\n factory.setChannel(mqChannel);\n factory.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n return factory;\n }\n catch (JMSException e){\n throw new RuntimeException(e);\n }\n\n}The problem is thatcom.ibm.msg.client.jms.adminpackage does not exist on any of the jar's that I have set on my class path. The solution suggested in the IBM website which reads as follows does not help either.The type com.ibm.msg.client.jms.admin.JmsJndiDestinationImpl\ncannot be resolved. It is indirectly referenced from required .class files.Local fixImport the com.ibm.msg.client.jms.internal from\n wmq.jmsra.rar and add it to the build path.\n You can find the rar file under \\lib\\WMQ\\raBut this is not an option for me because I am using a local tomcat server and having that file on my class path is not an option for me.Following ibm jars are on my class path1. mqjms-7.0.1.0.jar, \n2. ibm-mq-7.0.1.0.jar\n3. client.osgi.jms.jarAny help regarding this would be highly appreciated. Namaste### Assistant: I have finally figured out the problem.\nuse version 6 or older com.ibm.mq.jar & com.ibm.mqims.jar.and then addconnector.jarWhich seems to be of utmost importance. I got this solution from mqseries.net to add the connector jarhttp://www.mqseries.net/phpBB2/viewtopic.php?t=40546posted by gaya3Please add, connector.jar ,jta.jar in the build path (connector.jar is there) (looks like the connector.jar might have corrupted or does not have all access privileges)check the access privileges are there to do soFollowing jar files has to be there on classpathcom.ibm.mq.jarcom.ibm.mqims.jarconnector.jar (important)jms.jar\n"} +{"text": "### Human: I am using spring integration to connect with the IBM MQ. My spring integration application is connecting successfully with IBM MQ. Now the MQ team made the MQ manager as the clustered manager i.e. queue manager is containing 2 host one active and one passive because if one host is down the passive one will up and running.\nBelow is my spring integration configuration for MQ and I can pass only one host.\n \n \n \n \n \n Is there any way by which we can pass both the active and passive host's from the configuration. I tried with the comma in host but that is not supported .Please suggest### Assistant: You should specify the hosts under the property connectionNameList, don't use hostName and port.http://www-01.ibm.com/support/docview.wss?uid=swg21397867Multi Instance MQ set up\n"} +{"text": "### Human: Suppose I have one connectioncand many session objectss1,s2..sn, each working in different threadst1,t2...tn.c\n |\n -------------------------------------------------\n | | | |\n (t1,s1) (t2,s2) (t3,s3) ...... (tn,sn)Now suppose one of the threadt3wants to send a message to a particular queueq3and then listen to the reply asynchronously. So it does the following:1: c.stop();\n\n 2: auto producer = s3.createProducer(s3.createQueue(q3));\n 3: auto text = s3.createTextMessage(message);\n 4: auto replyQueue = s3.createTemporaryQueue();\n 5: text.setJMSReplyTo(replyQueue);\n 6: producer.send(text);\n\n 7: auto consumer = s3.createConsumer(replyQueue);\n 8: consumer.setMessageListener(myListener);\n\n 9: c.start();The reason why I calledc.stop()in the beginning and thenc.start()in the end, because I'mnotsure if any of the other threads has calledstarton the connection (makingallthe sessions asynchronous \u2014 is that right?) and as perthe documentation:\"If synchronous calls, such as creation of a consumer or producer, must be made on an asynchronous session, theConnection.Stopmust be called. A session can be resumed by calling theConnection.Startmethod to start delivery of messages.\"So callingstopin the beginning of the steps and thenstartin the end seems reasonable and thus the code seems correct (at least to me). However, when I thought about it more, I think the code is buggy, as it doesn't make sure no other threads callstartbeforet3finishes all the steps.So my questions are:Do I need to use mutex to ensure it? Or the XMS handles it automatically (which means my reasoning is wrong)?How to design my application so that I dont have to callstopandstarteverytime I want to send a messages and listen reply asynchronously?As per the quoted text above, I cannot callcreateProducer()andcreateConsumer()if the connection is in asynchronous mode. What are other methods I cannot call? The documentation doesn't categorise the methods in this way:Also, the documentation doesn't say clearly what makes a session asynchronous. It saysthis:\"A session is not made asynchronous by assigning a message listener to a consumer. A session becomes asynchronous only when the Connection.Start method is called.\"I see two problems here:Callingc.start()makesallsessions asynchronous, not just one.If I callc.start()but doesn't assign any message listener to a consumer, are the session(s) still asynchronous?It seems I've lots of questions, so it'd be great if anyone could provide me with links to the parts or sections of the documentation which explains XMS objects with such minute details.Thissays,\"According to the specification, calling stop(), close() on a Connection, setMessageListener() on a Session etc. must wait till all message processing finishes, that is till all onMessage() calls which have already been entered exit. So if anyone attempts to do that operation inside onMessage() there will be a deadlock by design.\"But I'm not sure if that information is authentic, as I didn't find this info on IBM documentation.### Assistant: I prefer the KIS rule. Why don't you use 1 connection per thread? Hence, the code would not have to worry about conflicts between threads.\n"} +{"text": "### Human: I'm looking for a clean way of posting an XML message over a queue. Currently we have to inspect the XMLencodingdeclaration and make sure to set theMQMD.ccsidaccordingly (utf-8 = 1208). We also set theMQMD.formattoMQFMT_NONE.This appears to be fine, however some consumers are doing MQGET withMQGMO_CONVERTand that destroys the UTF-8 encoding.They shouldnotbe calling the convert option when consuming non-text messages. But they are dealing with mixed text+non-text on the same queue.I would like to use the special CCSIDMQCCSI_EMBEDDEDwhich states that the encoding information is found inside the message, exactly what XML does.Unfortunately, setting the CCSID on MQPUT to that value defaults to the QMGR's ccsid.See:CCSID documentation### Assistant: If you set the MD.Format to MQFMT_NONE when your application puts a message to a queue then the \"get with convert\" by the receiving application does NOT perform a convert.Either you set MD.Format to MQFMT_STRING or the receiving application messed up.Also, you do know that if you read a message into a String buffer in Java that the JVM will convert it to the encoding that the JVM is running under.\n"} +{"text": "### Human: I have set the KeyStore to *User to get the certificate from the windows certificate store.The Mq Client application is trying to find the certificate using the label name as shown in the log from the client Trace. I tried setting the CertificateLabel from the client.ini and code but it is not overriding the value.How should i change that? Even if i can override how can i change the label of the certificate which i directly imported into my certificate store?Please Help000001B6 12:23:39.868134 4236.8 Created store object to access certificates \n000001B7 12:23:39.868134 4236.8 Opened store \n000001B8 12:23:39.868134 4236.8 Accessing certificate - **ibmwebspheremq(username)** \n\n\nHow should i change the lable in the certificate store for the existing certificate \n\nAnd then it throws the below exception \n\n000001B9 12:23:39.868134 4236.8 TLS12 supported - True \n000001BA 12:23:39.868134 4236.8 Setting SslProtol as Tls \n000001BB 12:23:39.868134 4236.8 Starting SSL Authentication \n000001BC 12:23:39.868134 4236.8 ------------{ MQEncryptedSocket.FixClientCertificate(Object,String,X509CertificateCollection,X509Certificate,String[]) \n000001BD 12:23:39.868134 4236.8 Client callback has been invoked to find client certificate \n000001BE 12:23:39.868134 4236.8 ------------} MQEncryptedSocket.FixClientCertificate(Object,String,X509CertificateCollection,X509Certificate,String[]) rc=OK \n000001BF 12:23:40.507601 4236.8 System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> System.ComponentModel.Win32Exception: The client and server cannot communicate, because they do not possess a common algorithm### Assistant: I've just finished battling this exact same problem, with MQ v.8, over the last 2 days and found Shashi's link to be helpful, but it didn't completely solve my problem. In addition to the instructions on that link, you need to make sure that the \"Friendly name\" of the certificate in the store is compliant with the MQ certificate label naming convention i.e.ibmwebspheremqlogonuserID.For example, let's say you're currently logged in and your logon ID is jdoe. When you run your MQ client, the MQ client libraries will look for a certificate with a friendly name matchingibmwebspheremqjdoe. Finally, I only needed to add the following two properties to connect successfully:properties.Add(MQC.SSL_CERT_STORE_PROPERTY, \"*SYSTEM\");\nproperties.Add(MQC.SSL_CIPHER_SPEC_PROPERTY, \"TLS_RSA_WITH_AES_128_CBC_SHA\");Bear in mind that I installed the CA-signed certificate into the \"Local computer\" key store and not the user keystore. That's why I specified *SYSTEM in the SSL_CERT_STORE_PROPERTY.Here are all of the properties I used:properties = new Hashtable();\nproperties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\nproperties.Add(MQC.HOST_NAME_PROPERTY, hostName);\nproperties.Add(MQC.PORT_PROPERTY, port);\nproperties.Add(MQC.CHANNEL_PROPERTY, channelName);\nproperties.Add(MQC.SSL_CERT_STORE_PROPERTY, \"*SYSTEM\");\nproperties.Add(MQC.SSL_CIPHER_SPEC_PROPERTY, \"TLS_RSA_WITH_AES_128_CBC_SHA\");\n"} +{"text": "### Human: I have following code to send request and receive response from IBM MQ. I know the code is IBM Implementation specific, but I am trying to get some result. Later I will do changes in the code to make it more generic.MQQueueConnectionFactory cf = new MQQueueConnectionFactory();\n cf.setHostName(\"xx.xxx.xx.xxx\");\n cf.setPort(xxxx);\n\n\n cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\n\n cf.setQueueManager(\"Q_MANAGER\");\n cf.setChannel(\"CHANNEL\");\n\n\n MQQueueConnection connection = (MQQueueConnection) cf.createQueueConnection();\n\n MQQueueSession session = (MQQueueSession) connection.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);\n MQQueue queue = (MQQueue) session.createQueue(\"queue:///REQ_Q\");\n MQQueue respQueue = (MQQueue) session.createQueue(\"queue:///RESP_Q\");\n\n MQQueueSender sender = (MQQueueSender) session.createSender(queue);\n\n // set message properties\n TextMessage message = (TextMessage) session.createTextMessage(\"message to send\"); \n message.setJMSReplyTo(respQueue);\n\n // Start the connection\n connection.start();\n sender.send(message);\n session.commit();\n\n String selecter = \"JMSCorrelationID = '\"+message.getJMSCorrelationID()+\"'\";\n MQQueueReceiver receiver = (MQQueueReceiver)session.createReceiver(respQueue, selecter);\n\n Message messageText;\n messageText = receiver.receive(5000);The message is sent successfully. But I get null as the response, where actually there should be some response. What am I missing?### Assistant: How do you know that the other application sent you a response? Did you check the response queue?String selecter = \"JMSCorrelationID = '\"+message.getJMSCorrelationID()+\"'\";What in the world is that? Did the other application team tell you that the response message's CorrelID would have the original message's MessageID? If so, you are using the wrong value.Hence, you need to be using the MessageID value from the message you sent the other application. i.e.String selecter = \"JMSCorrelationID = '\"+message.getJMSMessageID()+\"'\";\n"} +{"text": "### Human: I am reading an MQMessage in like soqueue.Get(message, gmo);\n\n string message1 = message.ReadString(message.MessageLength);I can see there is amessage.UserId on MQMessage, but that is not enoughI want the users to get additional information in the message header of an MQMessage.How can I set and then retrieve the following from a header of an MQMessageusername \npassword\nmySpecialID### Assistant: This can be done like thismsg.SetStringProperty(\"NicksProp\", \"blahblah\");\n"} +{"text": "### Human: I'm building a java application that connects to a MQQueueManager and extracts information about queues. I'm able to get data likeQueueType,MaximumMessageLengthand more. However, I also want the name of the cluster the queue might be in. There is no function that comes with the MQQueue that gives me this information. After searching the internet I found several things pointing in this direction, but no examples.A part of my function that gives me theMaximumDepthis:queueManager = makeConnection(host, portNo, qMgr, channelName);\n queue = queueManager.accessQueue(queueName, CMQC.MQOO_INQUIRE);\n maxQueueDepth = queue.getMaximumDepth();(makeConnectionis not shown here, it is the function that makes the actual connection to the QueueManager; I also left out the try/catch/finally for less clutter)How do I getClusterNameand perhaps other data, that doesn't have a function likequeue.getMaximumDepth()?### Assistant: There are two ways to get information about a queue.The API Inquire call gets operational status of a queue. This includes things like the name theMQOpencall resolved to or the depth if the queue is local. Much of theq.inquirefunctionality has been superseded with getter and setter functions on the queue. If you are not using thev8.0 clientwith the latest functionality, you are highly advised to upgrade. It can access all versions of QMgr.The following code is fromGetting and setting attribute values in WebSphere MQ classes for Java// inquire on a queue\nfinal static int MQIA_DEF_PRIORITY = 6;\nfinal static int MQCA_Q_DESC = 2013;\nfinal static int MQ_Q_DESC_LENGTH = 64;\n\nint[] selectors = new int[2];\nint[] intAttrs = new int[1];\nbyte[] charAttrs = new byte[MQ_Q_DESC_LENGTH]\n\nselectors[0] = MQIA_DEF_PRIORITY;\nselectors[1] = MQCA_Q_DESC;\n\nqueue.inquire(selectors,intAttrs,charAttrs);\n\nSystem.out.println(\"Default Priority = \" + intAttrs[0]);\nSystem.out.println(\"Description : \" + new String(charAttrs,0));For things that are not part of the API Inquire call, a PCF command is needed. Programmable Command Format, commonly abbreviated as PCF, is a message format used to pass messages to the command queue and for reading messages from the command queue, event queues and others.To use a PCF command the calling application must be authorized with+putonSYSTEM.ADMIN.COMMAND.QUEUEand for+dspon the object being inquired upon.IBM provides sample code.On Windows, please see:%MQ_FILE_PATH%\\Tools\\pcf\\samplesIn UNIX flavors, please see:/opt/mqm/samp/pcf/samplesThe locations may vary depending on where MQ was installed.Please see:Handling PCF messages with IBM MQ classes for Java. The following snippet is from thePCF_DisplayActiveLocalQueues.javasample program.public static void DisplayActiveLocalQueues(PCF_CommonMethods pcfCM) throws PCFException,\n MQDataException, IOException {\n // Create the PCF message type for the inquire.\n PCFMessage pcfCmd = new PCFMessage(MQConstants.MQCMD_INQUIRE_Q);\n\n // Add the inquire rules.\n // Queue name = wildcard.\n pcfCmd.addParameter(MQConstants.MQCA_Q_NAME, \"*\");\n\n // Queue type = LOCAL.\n pcfCmd.addParameter(MQConstants.MQIA_Q_TYPE, MQConstants.MQQT_LOCAL);\n\n // Queue depth filter = \"WHERE depth > 0\".\n pcfCmd.addFilterParameter(MQConstants.MQIA_CURRENT_Q_DEPTH, MQConstants.MQCFOP_GREATER, 0);\n\n // Execute the command. The returned object is an array of PCF messages.\n PCFMessage[] pcfResponse = pcfCM.agent.send(pcfCmd);\n\n // For each returned message, extract the message from the array and display the\n // required information.\n System.out.println(\"+-----+------------------------------------------------+-----+\");\n System.out.println(\"|Index| Queue Name |Depth|\");\n System.out.println(\"+-----+------------------------------------------------+-----+\");\n\n for (int index = 0; index < pcfResponse.length; index++) {\n PCFMessage response = pcfResponse[index];\n\n System.out.println(\"|\"\n + (index + pcfCM.padding).substring(0, 5)\n + \"|\"\n + (response.getParameterValue(MQConstants.MQCA_Q_NAME) + pcfCM.padding).substring(0, 48)\n + \"|\"\n + (response.getParameterValue(MQConstants.MQIA_CURRENT_Q_DEPTH) + pcfCM.padding)\n .substring(0, 5) + \"|\");\n }\n\n System.out.println(\"+-----+------------------------------------------------+-----+\");\n return;\n }\n}\n"} +{"text": "### Human: I want to send a message to a queue in WebSphere MQ. For this I must create a server-connection channel definition as it is written inConfiguring your queue manager so that IBM MQ classes for JMS applicationsBut I don't know where I should input this command for creating channel:CRTMQMCHL CHLNAME(JAVA.CHANNEL) CHLTYPE(*SVRCN)\nTRPTYPE(*TCP)\nMQMNAME( QMGRNAME )Help me please in this question. And tell me please about the difference between client mode and binding mode.### Assistant: TheCRTMQMCHLis a CL command. This is specific to the IBM i platform (aka iSeries, aka OS/400). You can issue MQM CL commands from the Message Queue Manager Commands menu. To display this menu, typeGO CMDMQMon the command line and press the Enter key.If you wish to do this on a platform other than the IBM i platform (or from within theRUNMQSCCL command on IBM i) you can issue this command from inside arunmqsccommand prompt.To get a runmqsc command prompt, on an O/S command prompt type:-runmqsc QMGRNAMEreplacingQMGRNAMEwith the name of your queue manager. Then inside the runmqsc prompt that you now have, type:-DEFINE CHANNEL(JAVA.CHANNEL) CHLTYPE(SVRCONN) TRPTYPE(TCP)Client mode versus binding modeClient mode means you are connecting to the queue manager over the network, using a TCP socket.Bindings mode means your application is running on the same machine as the queue manager, and the connection is made using a memory based inter-process communication (IPC) method, the JNI in th case of a Java application. You cannot use bindings mode if your application is running on a different machine than your queue manager.Further ReadingCreating IBM MQ for IBM i objectsConnection modes for IBM MQ classes for JMS\n"} +{"text": "### Human: I'm writing an IIB flow that amongst other things generates Event messages (Monitoring functionality). In order to be able to handle all of these events, I need to do a durable subscription. But if I do that, and if the consuming application doesn't come back online for some reason, the QM may fill up and eventually stop. \nIs there any way to avoid that? Any way to create a managed durable subscription with \"forced message expiration\"?### Assistant: This turns out to be a fairly common use case but one that can be challenging. Of the many approaches possible, here are a few common ones:Use a circular queue\"Circular queue\" is not an official IBM term but something I coined in my articleMission:Messaging: Easing administration and debugging with circular queues. Circular queues are implemented using the Q program from SupportPac MA01 (now on GitHub!) and MQ's native instrumentation to keep the queue trimmed to 80% ofMAXDEPTH. This was published in 2011 and based on feedback I've received, I'd guess at least 100 shops are using this automation successfully.Use MQ v8.0.0.4As of MQ v8.0 Fix Pack 4, IBM has introduced theCAPEXPIRYattribute on queues and topics. (See:Enforcing lower expiration times) Just set it and forget it.Automate queue cleanupUse the Q or QLoad programs to search for messages older than a specified time and remove them. Schedule this using your favorite job scheduler or use MQ instrumentation to look for things like the queue filling up or really long queue service intervalsDon't do thisDurable subscriptions are for things that aresupposedto always be present or at least reliably come back. In those cases provision the subscription on deployment and make deletion of the queue part of the decommission process. If there is no decommission process because the subscriber is ad-hoc, don't use a durable subscription. Easier said than done, I know.NotesI can't be sure about this since I no longer work as part of the MQ product team, but I suspect that the newCAPEXPIRYfeature was provided to address this issue. When IBM introduced MQ MFT (the product formerly known as FTE) the Explorer module used permanent dynamic subscriptions to collect file transfer job statuses. However, there were many cases i which the Explorer instance forgot it's subscription, people changed computers or jobs, or a thousand other reasons leading to abandoned subscriptions.This is not an easily soluble problem for the MFT set of requirements. Favor user experience or favor efficient system usage, but not both. Now that we haveCAPEXPIRYthose subscription queues will eventually empty out on their own. I predict soon where will be a queue expiry for emptyPERMDYNqueues so we won't have a zillion abandoned empty queues lying around.\n"} +{"text": "### Human: I need some help to fetch all the messages for a particular queue which has a particular property on it.The problem here is I need to match the JMS header propertyprocesswithprocessName.As the message can have the value for process as upper or lowercase but processName always has a value which is uppercase.I canNOTuse equalsIgnorecase here like :\nStringJMSCriteriaBuilder(\"process\").equalIgnorecase(processName);As there is no such method in IJMSSelectorCriteriaBuilder interface.Below is the code I have currently:private String createJMSSelectorMessage(QueueFilter queueFilter) throws Exception {\n StringBuffer selectorMessage = new StringBuffer();\n String processName=Service.getProcess(Long.valueOf(queueFilter.getProcess())).getProcessName();\n\n\n IJMSSelectorCriteriaBuilder processNameSelectorCriteriaBuilder = new StringJMSCriteriaBuilder(\"process\").eq(processName);\n selectorMessage.append(processNameSelectorCriteriaBuilder.getJMSSelectorCriteriaValue());\n return selectorMessage;\n }### Assistant: The JMS specificationstipulatesthat selectors are case sensitive.Two strings are equal if and only if they contain the same sequence of characters.Solutions I have seen used include:Pre-processing all messages to normalize caseUse Message BrokerBrowse, evaluate in code and selectHave the program putting the message normalize case firstSorry, there's no good receiver-side solution that doesn't involve parsing every message.\n"} +{"text": "### Human: While trying to configure JMS Queue connection factories/Activation specification on Websphere Application Sever 8.5 and RAD 8.5.1 I get following error:A connection could not be made to WebSphere MQ for the following reason: JMSCMQ0001: WebSphere MQ call failed with compcode '2'\n('MQCC_FAILED') reason '2538' ('MQRC_HOST_NOT_AVAILABLE').Can anybody please suggest this could be because of what reason?### Assistant: The host your queue manager is running on is not reachable. In the connection factory have you provided the correct host name, does the queue manager have a running listener for the provided port, is the host and port allowed in the firewall?You should try the host and port with telnet to check.\n"} +{"text": "### Human: I am trying to connect to an existing JMS queue with a .NET client.\nI know the queue is working, I already browsed it using IBM MQ Explorer.In the following code, the call to factory.CreateConnection keeps hanging - it does not jump to the next line, in does not show any error message. It even doesnt consume any CPU.Are there any options that I should try to get it working (or at least make it show me an error message of any kind)?private static IConnectionFactory GetConnectionFactory()\n {\n var factoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\n var cf = factoryFactory.CreateConnectionFactory();\n\n cf.SetStringProperty(XMSC.WMQ_HOST_NAME, \"server address\");\n cf.SetIntProperty(XMSC.WMQ_PORT, portnumber);\n cf.SetStringProperty(XMSC.WMQ_CHANNEL, \"channelname\");\n cf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);\n cf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, \"queuemanager\");\n cf.SetIntProperty(XMSC.WMQ_BROKER_VERSION, XMSC.WMQ_BROKER_UNSPECIFIED);\n\n return (cf);\n }The main method has the following:var factory = GetConnectionFactory();\nvar connection = factory.CreateConnection(\"username\", null);### Assistant: I don't see any problem with your code, tested it with MQ v8 and works fine. I would suggest you to do:1) XMS can run in unmanaged mode also. So changecf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);tocf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT_UNMANAGED)and see if that helps.2) When the call hangs, break into debug and see the call stack to determine the point of hang. It could be waiting on some system event if no CPU is being consumed.3) Open a PMR with IBM.\n"} +{"text": "### Human: alter listener(QM) TRPTYPE(TCP) PORT(1718)This is the command am using. Please suggest if it is correct.### Assistant: Yes, I would expect that command to work as long as you have a listener named 'QM' which you want to alter to listen on TCP port 1718.DISPLAY LISTENER(*) ALLWill give you all the information on all the listener objects you currently have defined.\n"} +{"text": "### Human: I've been searching on internet and ESQL/WebSphere MessageBroker documentations, to find a way of printing a variable's value so that i can trace it in Broker Logs. Like System.out.println() in java.I can't debug the messageflow because of some technical issues, so could you please suggest me how to do it or any workarounds.### Assistant: UserTrace is supposed to fulfil this role for ESQL but if UserTrace isn't helping then I see a lot of people use static calls out from ESQL to java whcih are then logged.The java code could be as simple as writing to stdout (which will go in /var/mqsi/components//stdout) but more commonly I see this pattern used with existing java logging frameworks like log4J.The advantage of this approach is that you unify logging between your JCN's and ESQL compute nodes.\n"} +{"text": "### Human: I have configured websphere as aForeign Server in weblogic but now I am getting error while connecting to Foreign Connectionfactory as follows:The Message-Driven EJB is transactional but JMS connection factory referenced by the JNDI name: jms/WASQCF is not a JMS XA connection factory.I am not sure How to make Websphere connection factory XA complient?I am using Websphere 8.5 andusing Queue Connection Factory, I am not using MQ series### Assistant: The answer differs based on the version of MQ client you are dealing with. Since the client version isn't mentioned, I'll provide a generic answer.Until a couple of years ago, IBM packaged the free client without XA transaction capabilities enabled. If you have not downloaded the MQ client recently, it simply isn't able to participate in an XA transaction. If you have an older non-XA MQ client, download a newer one.Of course, IBM did provide an XA-capable client at that time. Unfortunately, the cost for the transactional client was the same as for a full MQ server. If you have the older transactional client itiscapable of participating in an XA transaction but it is out of service. In that case, download a newer client.If you have downloaded a new MQ client that is capable of doing XA transactions, then please see theDetailed System Requirementspage for your version of MQ client, then drill down to the \"Supported Software\" tab. once there, scroll down to the \"Transaction Servers and Gateways\" section.For example, this section in the V8.0 Requirements page says:The WebSphere MQ classes for JMS can only participate in global\n transactions when accessed through the Java EE Connector Architecture\n (JCA) resource adapter, which can only be used with a suitable\n application server environment.For more detailed information on the use of the resource adapter with\n application servers, see the Application Server section above, and the\n WebSphere MQ resource adapter statement of support document.This then links toWebSphere MQ resource adapter v7.1 and later statement of supportwhich lists the JEE servers with which the JCA Adapter has been tested and additional information.Assuming all the pre-reqs are in place and you have an MQ client that is transaction-capable, be sure to define anXAConnectionFactoryfor MQ.\n"} +{"text": "### Human: i wrote a WS-Application in Spring which support to create Messages into a JMS Queue.\n I developed it using an Apache Tomcat with ActiveMQ. Everthing works fine here, I have my JNDI resource can derive the Connection factory and send the message into the queue:\n \n\n\n\n\n \n \n\nNow we tried to move the web-application to the Websphere. The JNDI lookup works, the application can create the Factory, the Queue is found, but when my Code tries to create the producer via createProducer() the code throws this exception:java.lang.ClassCastException: com.sun.proxy.$Proxy28 cannot be cast to com.ibm.mq.jms.MQDestinationI tried to replace \"javax.jms.Queue\" with \"javax.jms.Destination\" but not worked.when I remove proxy-interface it is working but I need that queue not to fetched when context is launching.### Assistant: When using Spring it wraps the looked up Destination in a Spring dynamic proxy. The WebSphere MQ JMS provider requires an implementation of its Destination and it doesn't receive one hence the exception. You might be able to get round this calling toString on the looked up destination and then calling createDestination with the result on the Session object.\n"} +{"text": "### Human: I am trying to configure test automation project in UFT 12.02 for IBM Websphere MQ 6.0I am facing the following error while connecting to MQ Queue Manager\n(To run tests with IBM\u2019s MQ client, make sure to install the MQ client on all machines running these tests.)as per the above error description I need to install MQ client on my machine, but I cannot install it because IBM has been stopped supporting MQ 6.0 accordingly I didn't find it anywhere.I have configured the same but in IBM RIT (Rational Integration Tester) and it was only required to configure the JAR files (com.ibm.mq.jar & connector.jar)My question is; Is it applicable in UFT to configure only above two JAR files (just like IBM RIT) or it is necessary to install the MQ 6.0 Client?And can I test the MQ 6.0 through UFT along with installing MQ 7.0 Client instead of 6.0, taking in consideration that the AUT is IBM Websphere MQ 6.0?Also if applicable, can anyone provide the MQ Client download URL rather than IBM website?### Assistant: Prior to V8.0 it was required to install the full client to receive support. Just grabbing the jar files worked but you risked IBM not supporting it if you wanted to open a PMR.As of v8.0, IBM offers an all-Java client. Ijustprovided the download instructions in another answer so instead of copying them, I'll link to that answer:WMQ V8 Connection Factory setup on Tomcat using JNDIOne of the reasons this was not previously supported was that the old Java jars didn't have as much diagnostic function built in. IBM relied on the full client install for binary cient-side tracing, test programs, etc. The v8.0 stand-alone jars are really the way to go if you need an all-Java solution.Note that support is based on the QMgr's license, not the client license (because that's free). If you are running a v6.0 QMgr other than the Linux Itanium version, then either you are paying a LOT of money for IBM Support or are running unsupported. If it is the latter, then you can't open a PMR anyway.An unpatched v6.0 QMgr is effectively not secure. Even if you have applied the recommended security configurations, enough security-relevant APARS have now been discovered that you should consider an unpatched QMgr as being wide open.As Tim notes in the comments, any version of MQ Client is supported with any version of MQ QMgr. Head over to theSupportPacs pageand look for ones with names likeMQC**. Pro tip - If you download a new client, it comes with XA transactionality enabled. No need to go grab the transactional client jar file (which put you out of license compliance anyway).\n"} +{"text": "### Human: On my channel display i have a paramter RESETSEQ(1217) so each time the channel stop and start the sequence is set to 1217 causing all sorts of sequence errors.\nReview of documentation indicates that the RESETSEQ is for a pending sequence reset. A value of 0 (zero) indicates that there is no pending sequence reset. So far so good...BUT I have not been able to find anything that indicates how to set this parm to 0(zero) so that the display channel shows resetseq(no) so i am stuck reseting this RCVR channel each day.### Assistant: When a reset command is issued from a sender channel, it tells the receiver what message number to set as the sequence number. When you reset from the receiver, it doesn't have the same effect of making a change to the sender. It seems your sender at some point was trying to send messages as seqno (1217) and that command is still considered outstanding. Since that time, the sender time may have recycled and that number appears to no longer be valid (explaining why you now need to set it to zero).Do you have access to the sender channel? If a new command were sent from the sender to reset the channel, I would expect this outstanding request to be overriden. You may have to do a stop on both channel ends to clear up the problem. Refer tothis Technoteshould you encounter an in-doubt situation:\n"} +{"text": "### Human: I am new to MQ programmimg. As per my requirement I am trying to put a sample XML message in a queue and expecting a response back from the response queue. \nI can see that the associated channel is opening for a short duration, for a few seconds and then getting closed. Please find below the code I am using to put the message in queue. Request your valuable inputs in getting this issue resolved.Error:Process(12908.13579) User(abc) Program(amqrmppa)\n Host(hostname)\nAMQ9208: Error on receive from host 10 (10.0.0.1). \nEXPLANATION:\nAn error occurred receiving data from 10 (10.0.0.1) over TCP/IP. This may\nbe due to a communications failure.Code Used:package com.company.mq;\n\n\nimport java.io.DataInputStream;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\n\nimport com.ibm.mq.MQC;\nimport com.ibm.mq.MQEnvironment;\nimport com.ibm.mq.MQException;\nimport com.ibm.mq.MQGetMessageOptions;\nimport com.ibm.mq.MQMessage;\nimport com.ibm.mq.MQPutMessageOptions;\nimport com.ibm.mq.MQQueue;\nimport com.ibm.mq.MQQueueManager;\n\npublic class MQConnection {\n\n private static final String CORR_ID = \"CORRELID\";\n String qMgrStr = \"\";\n String hostName = \"hostname\";\n String password =\"xxxx\"; \n String userName =\"username\"; \n String putqueueName = \"putqueuename\";\n String getqueuename = \"getqueuename \";\n String channel = \"channel\";\n String replyToQueue = \"replyToQueue\";\n String replyToQueueManager = \"\";\n\n static String content = \"\"; \n\n\n int port =10000;\n\n MQQueue readQueue = null;\n MQQueue writeQueue = null;\n MQQueueManager qManager;\n\n\n @SuppressWarnings(\"unchecked\")\n public void init(){ \n MQEnvironment.hostname =hostName;\n MQEnvironment.channel = channel;\n MQEnvironment.port = port;\n MQEnvironment.userID = userName;\n MQEnvironment.password = password;\n MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);\n\n try {\n qManager = new MQQueueManager(\"\");\n System.out.println(\"qManager====>\"+qManager);\n }catch(Exception e){\n e.printStackTrace();\n }\n try {\n System.out.println(\"qManager==> hhh\"+qManager);\n } catch (Exception e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n\n public String putAndGetMessage() throws InterruptedException, IOException{\n\n int openOptions = MQC.MQOO_OUTPUT | MQC.MQPMO_SET_ALL_CONTEXT | MQC.MQOO_FAIL_IF_QUIESCING;\n String msgString = content.toString();\n System.out.println(\"msgString==\"+msgString);\n int expiryTime =60000;\n MQMessage getmessage = null;\n int waitInterval =4000;\n try {\n System.out.println(\"qManager Desc==>\"+qManager.getDescription());\n writeQueue =openWriteQueue(qManager,putqueueName);\n\n MQMessage message = myPut(writeQueue,msgString,expiryTime,getqueuename);\n\n// qManager.accessQueue(putqueueName, openOptions,null,null,null);\n\n readQueue =openReadQueue(qManager,getqueuename);\n\n getmessage =mqGet(readQueue,waitInterval,message.messageId);\n\n\n /*MQMessage msg = new MQMessage();\n msg.messageType = MQC.MQMT_REQUEST;\n msg.format = \"MQSTR\";\n // msg.characterSet = 500;\n msg.persistence = MQC.MQPER_NOT_PERSISTENT;\n msg.correlationId = CORR_ID.getBytes();\n // msg.messageId = CORR_ID.getBytes();\n msg.expiry= 10000;*/\n\n /*System.out.println(\"before\");\n Thread.sleep(10000);\n System.out.println(\"after\");*/\n\n /*MQGetMessageOptions gmo = new MQGetMessageOptions();\n int openOptions1 = MQC.MQGMO_WAIT| MQC.MQGMO_CONVERT| MQC.MQGMO_FAIL_IF_QUIESCING;\n System.out.println(\"in getqManager==>\"+qManager);\n readQueue = qManager.accessQueue(getqueuename, openOptions1);\n System.out.println(\"deafaultQueue======>\"+readQueue);\n readQueue.get(getmessage,gmo);\n System.out.println(getmessage.readInt());\n\n String retriveMsg = getmessage.readUTF();\n System.out.println(\"read===>\"+retriveMsg);*/\n\n } catch(MQException e){\n e.printStackTrace();\n }\n return getmessage.readString(getmessage.getMessageLength());\n\n\n }\n\n\n private MQMessage mqGet(MQQueue readQueue2, int waitInterval,\n byte[] corrID) throws MQException {\n MQMessage responseMessage = new MQMessage();\n responseMessage.correlationId =corrID;\n\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.options =MQC.MQGMO_WAIT| MQC.MQGMO_CONVERT| MQC.MQGMO_FAIL_IF_QUIESCING;\n gmo.matchOptions = MQC.MQMO_MATCH_CORREL_ID;\n gmo.waitInterval = waitInterval;\n // TODO Auto-generated method stub\n readQueue2.get(responseMessage,gmo);\n return responseMessage;\n }\n\n private MQQueue openReadQueue(MQQueueManager manager, String getqueuename2) throws MQException {\n // TODO Auto-generated method stub\n return openQueue(manager,getqueuename2,MQC.MQOO_INPUT_SHARED | MQC.MQOO_INQUIRE |MQC.MQOO_FAIL_IF_QUIESCING);\n }\n\n private MQMessage myPut(MQQueue writeQueue2, String msgString,\n int expiryTime, String getqueuename2) {\n // TODO Auto-generated method stub\n\n MQPutMessageOptions mpo =new MQPutMessageOptions();\n mpo.options = MQC.MQPMO_NEW_MSG_ID | MQC.MQMO_MATCH_CORREL_ID;\n\n MQMessage putmessage = new MQMessage();\n putmessage.format = MQC.MQFMT_STRING;\n putmessage.messageFlags = MQC.MQMT_REQUEST;\n putmessage.replyToQueueName =replyToQueue;\n putmessage.replyToQueueManagerName = qMgrStr;\n putmessage.userId=\"userId\";\n putmessage.expiry =expiryTime;\n try {\n putmessage.write(msgString.getBytes());\n try {\n writeQueue2.put(putmessage,mpo);\n } catch (MQException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n return putmessage;\n }\n\n private MQQueue openWriteQueue(MQQueueManager manager, String queueName) throws MQException{\n // TODO Auto-generated method stub\n return openQueue(manager,queueName,MQC.MQOO_OUTPUT | MQC.MQPMO_SET_ALL_CONTEXT | MQC.MQOO_FAIL_IF_QUIESCING);\n }\n\n private MQQueue openQueue(MQQueueManager manager, String queueName, int options) throws MQException{\n // TODO Auto-generated method stub\n return manager.accessQueue(queueName, options,null,null,null);\n }\n\n /**\n * @param args\n * @throws IOException \n * @throws InterruptedException \n */\n public static void main(String[] args) throws IOException, InterruptedException {\n // TODO Auto-generated method stub\n\n MQConnection conn = new MQConnection();\n\n DataInputStream dis = new DataInputStream ( new FileInputStream (\"c://request//Request.xml\"));\n\n byte[] datainBytes = new byte[dis.available()];\n dis.readFully(datainBytes);\n dis.close();\n\n content = new String(datainBytes, 0, datainBytes.length);\n //System.out.println(\"content===>\"+content);\n\n conn.init();\n System.out.println(\"connected\");\n conn.putAndGetMessage();\n\n }\n\n}### Assistant: The application appears to be a class which encapsulates the MQ I/O. On instantiation, theinitroutine constructs the class and attempts to connect to the queue manager. There are a few problems with the code that I can see. Also, and I suspect I know why the code fails but there is no diagnostic information provided in the question so I can only guess. I'll describe the problems first, then which diagnostic info I'd normally expect.Code issuesThe code provides a user ID and password. Unless this is a v8.0 client talking to a v8.0 queue manager, or a client that uses an exit to talk to MQ over a TLS channel, the password is not being checked and not needed. Even worse, if the channel is not TLS and encrypted, the ID and password are being transmitted in the clear over the network. Take the password out. Use the ID only if the ID presented by the app needs to be overridden in the connection request.The code is not printing the linked exception. A JMS exception is a multi-level data structure in which the top level is the exception as JMS understands it and the lower level exception is the one the transport provider understands. Many transport providers, especially those written in pure Java, use only the top level of the data structure and do not supply a linked exception. However, as a developer you must not assume that this will never be the case.There is no valid reason for a JMS developer to ever fail to print the linked exception.When I was managing the MQ Admin team at a large bank, my policy was that nothing went to Production if it did not follow these rules:When encountering a JMS exception, the codemustprint the linked exception.If there is no exception linked to a JMS Exception, the codemustprint the string \"No linked exception found\" so that we know that it has at least looked for one.The code opens the queue with theMQC.MQPMO_SET_ALL_CONTEXToption. This level of privilege is not normally granted to non-admin users. The code explicitly specifies an ID which suggests it is not running with admin privileges. For these reasons, I suspect that you are getting a 2035 error, which of course you do not see because the code fails to print the linked exception.Missing diagnosticsMQ behaves differently from version to version. Over the years the Java/JMS classes have been repackaged, refactored, and upgraded to JMS 1.1, then to JMS 2.0. Diagnostic questions, whether posted here or sent to your MQ Admin tean for a Production outage, should indicate the versions of MQ client and MQ server in use. The output ofdspmqver -aon the client node and the server node are always helpful.As mentioned previously, the linked exception is not being printed. Without it the stack trace is probably worthless, so for once I'm notthatdisappointed no stack trace was provided. However, update the code to print the linked exception and include a stack trace in the future.Both the client and the server produce error logs. In addition to the queue manager's error log, there are global error logs on the server for things that happen before the queue manager has been identified or for commands which operate on the global MQ configuration. No error log information from any of these sources was provided in this case. Why not?The server also produces event messages. These are normally consumed by a monitoring agent but may be enabled by administrators and reviewed to determine the problem. In the absence of error log messages, event messages can be very helpful. I would not expect them in this case but mention it here for completeness.FDC files are produced by the queue manager and stored in the same directory as the global error logs. These provide much more detailed information than the error log entries but are not always produced. Usually a problem diagnosis request would mention either that there were no FDC files produced, or else that they were and provide the header block from them.ResourcesPlease see:TheMQ Knowledge Center, if you have not already found it.In particular, the section ontroubleshooting,and the section onlinked exceptions. (Although these are not specific to MQ, IBM has at least provided some sample code you can copy and paste. Be sure to paste as plain text and correct any curly quotes.)TheMQ SupportPacspage,...and in particularMS0Tis the latest MQ Explorer (which works with back-level QMgrs) andMS0Pis a set of plug-ins that allow Explorer to parse the event messages, among many other things.IBM's MQDev community. Though this is great for finding articles and reference materials, the forums are mediocre.For a community, I much prefer theVienna MQ list serveror the forum atMQSeries.net. Both are thriving communities of developers, admins and IBMers.Keep posting here in thewebsphere-mqtag, of course. Neither of the communities above has a well-developed FAQ for MQ and Stack Overflow provides that function. There are several MQ old-timers and IBMers curating the Stack Overflow MQ tag.If you can manage the funding and travel, attend theMQ Tech Conference. IBM used to have the Transaction and Messaging conference but combined those with the rest of WebSphere to form IMPACT. Last year it combined several conferences, including IMPACT, into Interconnect. The MQ Tech conference is all MQ, all week, and insanely inexpensive. Since IBM outsourced their MQ curriculum and training, classroom training is a less viable option, and the conferences cover material not available in the classroom training.Stick with it and good luck!Full disclosure: I am one of the founders, and my MQ consulting firm is a sponsor, of the MQ Tech conference. However, it had almost as many MQ sessions on it's first day last year as Interconnect hadall weekso I do not see a conflict of interest in recommending it.\n"} +{"text": "### Human: Why some people prefer to useAs400Textobject to handle EBCDIC/ASCII conversion (Java code with IBM MQ jars) if we already haveMQC.MQGMO_CONVERToption to handle this?My requirement is to convert ASCII->EBCDIC during thePUToperation which I am doing by setting the character set to 37 and the write format to \"STRING\" and usingMQC.MQGMO_CONVERToption to automatically convert EBCDIC ->ASCII during theGEToperation.Is there any downfall of using convert option? Could anyone please let me know if this is not 100 percent safe option?### Assistant: Best practice is to write the MQ message in your local code page (where the CCSID and Encoding will normally be filled in automatically as the correct values) and to set the Format field. Then the getter will should use MQGMO_CONVERT to request the message in the CCSID and Encoding they need it in.Get with Convert is safe, and will be correct so long as you provide the correct CCSID a and Encoding that describes the message, when you put it.In the description of what you are doing in your question you convert from ASCII->EBCDIC before putting the message, and then getter is converting from EBCDIC->ASCII on the MQGET. This means you have paid for two data conversion operations, when you could have done none (or if two different ASCIIs, only one).\n"} +{"text": "### Human: I'm looking for the \"correct\" way to implement the message segmentation with MQI.Primary I need to implement the receiving part, but for testing purpose I also want to implement the sending side.Maybe I'm to dumb to search correctly, but I haven't found much documentation/examples for this topic.\nBest explanation so far:http://www.tek-tips.com/viewthread.cfm?qid=33458(i think this is taken from an ibm developer pdf). It's a general explanation with some pseudo code/no java code.There are so much flags and possibilites for the mqget call and also the simple access to the mqueue.Code examples I tried will follow, but maybe someone has some experience with this?### Assistant: Does this sample help? Here I am allowing the queue manager to segment a message if the message length exceeds maximum message length of queue.MQQueue mqQueue = queueManager.accessQueue(\"SEG.Q\", CMQC.MQOO_OUTPUT | CMQC.MQOO_INPUT_AS_Q_DEF | CMQC.MQOO_FAIL_IF_QUIESCING | CMQC.MQOO_PASS_ALL_CONTEXT);\n\n /**\n * Put a message and allow it to segmented if the length of each\n * the message we are putting exceeds the maximum message length.\n * For test purpose, the maximum message length has been set to\n * 500 bytes on queue. \n */\n MQMessage msgPut = new MQMessage();\n byte [] largeBuffer = new byte[2000];\n\n for(int i = 0; i< 2000; i++){\n largeBuffer[i] = 'A';\n }\n\n msgPut.write(largeBuffer);\n msgPut.messageFlags = MQConstants.MQMF_SEGMENTATION_ALLOWED;\n MQPutMessageOptions pmo = new MQPutMessageOptions();\n mqQueue.put(msgPut,pmo); \n System.out.println(\"Message put successful\");\n\n /* Now receive the same message but as a complete message\n * instead of segments\n */\n MQMessage msgGet = new MQMessage();\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.options = CMQC.MQGMO_COMPLETE_MSG;\n mqQueue.get(msgGet,gmo);\n"} +{"text": "### Human: i have some problem to boost my jms browser.\nI need to browse and display ONLY header information of te messages, but when i browsing on a Q with a lot of large text\\xml messages the browser run very slow, i think it's depend by the size of the messages body but i dont need the body.QUESTION: is there a way to get only the header information from the message enumerator?Ty.CODE:browser = session.createBrowser(q);\n @SuppressWarnings(\"unchecked\")\n Enumeration msgs = browser.getEnumeration();\n if (!msgs.hasMoreElements()) {\n } else {\n reading = true;\n while (msgs.hasMoreElements()) {\n Message tempMsg = msgs.nextElement();\n FrontMessage result = new FrontMessage();\n result.setFormat(tempMsg.getStringProperty(\"JMS_IBM_Format\"));\n result.setApplication(tempMsg.getStringProperty(\"JMSXAppID\"));\n result.setDate(tempMsg.getStringProperty(\"JMS_IBM_PutDate\"));\n result.setTime(tempMsg.getStringProperty(\"JMS_IBM_PutTime\"));\n result.setEncoding(tempMsg.getStringProperty(\"JMS_IBM_Encoding\"));\n result.setMessageId(tempMsg.getJMSMessageID());\n result.setCorrelationId(tempMsg.getJMSCorrelationID());\n result.setCharSet(tempMsg.getStringProperty(\"JMS_IBM_Character_Set\"));\n messages.add(result);\n }\n }### Assistant: When you use QueueBrowse you browse as many as the client and or provider allow you to at once. There is no option to browse parts of a message. A message is all or nothing. While you can \"zero out\" the body, the slow part is most likely in the retrieval of the messages.Based off the headers/properties you are looking for, I'm assuming you are using WebSphere MQ. If so, you can gain a little more control over the browsing if you use the native WMQ API (WMQ Client for Java vs WMQ Client for JMS) to browse, but you still browse the full message.\n"} +{"text": "### Human: I'm trying to achieve following scenario \nWhen a new message arrives to queue manager it should automatically trigger my console application. Then it will fetch that message and write the message in to a file. I already completed this part. But I'm having problem with triggering message queueHere is how I configured my message queueI created two queues one is called LocalQueue and other one is InitQueue which is SYSTEM.DEFAULT.INITIATION.QUEUE.and set \"Trigger\" properties in my LocalQueueThen Created trigger monitorIn process definition object I set my console application pathSo my problem is, It doesn't work as it expect and I checked my client machine \nC:\\Program Files (x86)\\IBM\\WebSphere MQ\\errors\\AMQERR01.LOG and server machine C:\\Program Files (x86)\\IBM\\WebSphere MQ\\errors log files. I couldn't find anything on themUpdateBased on Morag answer I changed my process name### Assistant: You appear to have named yourTriggerMonitorService object in the queue attribute where you should put the process object nameFetchMessages.\n"} +{"text": "### Human: Let's take this code snippet as a starting point:import com.ibm.mq.MQEnvironment;\nimport com.ibm.mq.MQException;\nimport com.ibm.mq.MQGetMessageOptions;\nimport com.ibm.mq.MQMessage;\n...\nint openOptions = MQConstants.MQOO_INPUT_AS_Q_DEF;\nMQQueue queue = qMgr.accessQueue(qName, openOptions);\n...\nMQMessage rcvMessage = new MQMessage();\nMQGetMessageOptions gmo = new MQGetMessageOptions();\nqueue.get(rcvMessage, gmo);Now I want to get the message type and the reply to queue manager for example. It can't be too hard but I did not find anything on how to do that.### Assistant: If you look at the JavaDoc for the MQMessage class (http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.javadoc.doc/WMQJavaClasses/com/ibm/mq/MQMessage.html)it extends the MQMD class (http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.javadoc.doc/WMQJavaClasses/com/ibm/mq/MQMD.html)and this has all the MQMD values on it.. so this code for example will show you the replyTo & type valuesSystem.out.println(\"MsgType=\"+ rcvMessage.messageType);\n System.out.println(\"ReplyToQ=\"+ rcvMessage.replyToQueueName);\n System.out.println(\"ReplyToQmgr=\"+ rcvMessage.replyToQueueManagerName);\n"} +{"text": "### Human: I am using apache camel (Fuse 2.10.x) with soap over http and soap over jms. JMS message gets converted from Object message to Byte message format which causes the problem in reading the message.I am using JNDI connection for websphere MQ in JBOSS 5.0 GA environment.MQConnFactory\n wmq.jmsra.rar\n javax.jms.ConnectionFactory<\n xxxxxxxxxxxxxxxxxxxxxxxxxxxxCLIENTJmsXARealm1\n 60\n 10\n 5000\n We faced someother problem with IBM attributes which were resolved by removing the attributes. Also we have camel header attribute to set the message${body[0]}${body.reqVO} != null Objectjava.lang.ExceptionThis works fine with soap over http. RequestQ get messages as JMS object message. But same RequestQ get message by JMS Byte Message in soap over JMS. \nSuggest me approach which I can ensure that message recieved as Object message in all scenario.\nNote: Same scenario works fine with activeMQ as JMS provider.\nOther Tech Stack: Spring 3.x, hibernate, apache cxf and etc.16:33:17,134 INFO [STDOUT] 16:33:17.133 [Camel (csCamelConfig) thread #8 - JmsConsumer[reqQueue]] DEBUG o.a.c.component.jms.JmsConfiguration - Sending JMS message to: queue://XXXXXXXXXX/REQ.QUEUE2?CCSID=819&encoding=1&targetClient=1 with message:JMSMessage class: jms_objectJMSType: nullJMSDeliveryMode: 1JMSExpiration: 0JMSPriority: 0JMSMessageID: nullJMSTimestamp: 0JMSCorrelationID: nullJMSDestination: nullJMSReplyTo: nullJMSRedelivered: falseCamelJmsDeliveryMode: 1CamelJmsMessageType: ObjectJMS_IBM_Character_Set: IBM437JMS_IBM_Encoding: 273JMS_IBM_Format:JMS_IBM_MsgType: 8JMS_IBM_PutApplType: 28JMS_IBM_PutDate: 20140910JMS_IBM_PutTime: 15475401breadcrumbId: ID-INN58JT4BS-53364-1410346638012-2-8operationName: payoperationNamespace: http:/www.xxx.com/xxxxx/xxxxx/class com.xxx.xxxx.xxx.vo.PayloadDTO16:33:19,465 INFO [STDOUT] 16:33:19.465 [Camel (csCamelConfig) thread #8 - JmsConsumer[paymJmsReqQueue]] DEBUG o.a.camel.processor.SendProcessor - >>>> Endpoint[direct://responseHandler] Exchange[Message: com.xxx.xxxx.base.vo.PayloadDTO@e486e6]16:33:19,466 INFO [STDOUT] 16:33:19.466 [Camel (csCamelConfig) thread #8 - JmsConsumer[paymJmsReqQueue]] INFO o.a.c.processor.interceptor.Tracer - ID-INN58JT4BS-53364-1410346638012-2-10 >>> (responseHandler) direct://responseHandler --> bean://responseProcessor?method=process <<< Pattern:InOut, Headers:{CamelCxfMessage={javax.xml.ws.wsdl.port={http:/impl.xxxx.xxxx.xxx.com/}ServiceImplPort, JMSCorrelationID=null, JMSMessageID=ID:414d5120484b49424b31533120202020318cf553bd565320, org.apache.cxf.service.model.MessageInfo=[MessageInfo INPUT: {http:/www.xxx.com/xxxxx/xxxx/}xxxx], JMSDeliveryMode=1, org.apache.cxf.message.Message.PROTOCOL_HEADERS={JMS_IBM_Character_Set=[IBM437], JMS_IBM_Encoding=[273], JMS_IBM_Format=[ ], JMS_IBM_MsgType=[8], JMS_IBM_PutApplType=[28], JMS_IBM_PutDate=[20140910], JMS_IBM_PutTime=[15475401], JMSDeliveryMode=[1], JMSExpiration=[0], JMSMessageID=[ID:414d5120484b49424b31533120202020318cf553bd565320], JMSPriority=[0], JMSRedelivered=[false], JMSTimestamp=[1410364074010], JMSXAppID=[Websphere MQ Client for Java], JMSXDeliveryCount=[1], JMSXUserID=[root ]}, JMSXUserID=root , org.apache.cxf.interceptor.LoggingMessage.ID=2, JMS_IBM_MsgType=8, JMSReplyTo=null, JMSTimestamp=1410364074010, JMSDestination=null, JMSType=null, JMSXDeliveryCount=1, JMSRedelivered=false, javax.xml.ws.wsdl.interface={http:/www.xxx.xxx/xxxxx/xxxx/}xxxx, org.apache.cxf.request.uri=null, HTTP.REQUEST=null, Accept=/, org.apache.cxf.headers.Header.list=[], org.apache.cxf.message.Message.BASE_PATH=cwmq://queue:jmsReqQueue?jmsMessageType=Bytes&replyTo=msRespQueue, org.apache.cxf.message.Message.PATH_INFO=null, JMS_IBM_Format= , org.apache.camel.exchange=Exchange[JmsMessage[JmsMessageID: ID:414d5120484b49424b31533120202020318cf553bd565320]], JMSExpiration=0, JMSPriority=0, javax.xml.ws.wsdl.service={http:/impl.xxx.xxx.xxx.xx/}ServiceImplService, JMS_IBM_PutApplType=28, JMS_IBM_PutDate=20140910, org.apache.cxf.binding.soap.SoapVersion=org.apache.cxf.binding.soap.Soap11@ab8a96, JMS_IBM_PutTime=15475401, org.apache.cxf.message.Message.ENCODING=null, org.apache.cxf.message.Message.QUERY_STRING=null, JMSXGroupID=null, JMS_IBM_Character_Set=IBM437, HTTP.RESPONSE=null, org.apache.cxf.request.method=null, javax.xml.ws.wsdl.operation={http:/www.xxx.xxx/xxxx/xxxxx/}xxxxx, org.apache.cxf.transport.Destination=org.apache.camel.component.cxf.transport.CamelDestination@17a840, javax.xml.ws.wsdl.description=camel://cwmq:queue:jmsReqQueue?jmsMessageType=Bytes&replyTo=jmsRespQueue?wsdl, JMS_IBM_Encoding=273, Content-Type=/, JMSXAppID=Websphere MQ Client for Java}, JMSXUserID=root , breadcrumbId=ID-INN58JT4BS-53364-1410346638012-2-8, JMS_IBM_Character_Set=IBM437, JMSExpiration=0, JMSXDeliveryCount=1, JMSXAppID=Websphere MQ Client for Java, JMS_IBM_Format= , prequest=com.xxx.xxxx.xxxxx.PRequest@93899f, JMSTimestamp=1410364074010, JMS_IBM_PutApplType=28, org.apache.cxf.headers.Header.list=[], JMSDeliveryMode=1, JMS_IBM_PutDate=20140910, JMSPriority=0, JMSRedelivered=false, JMS_IBM_Encoding=273, operationNamespace=http://www.xxx.xxx/xxx/xxx=xxxx, CamelJmsMessageType=Object, JMS_IBM_PutTime=15475401, JMSMessageID=ID:414d5120484b49424b31533120202020318cf553bd565320, JMS_IBM_MsgType=8}, BodyType:com.xxx.xxxxx.base.vo.PayloadDTO, Body:com.xxx.xxxx.base.vo.PayloadDTO@e486e6\n16:33:19,466 INFO [STDOUT] 16:33:19.466 [Camel (csCamelConfig) thread #8 - JmsConsumer[paymJmsReqQueue]] DEBUG o.a.camel.processor.SendProcessor - >>>> Endpoint[bean://responseProcessor?method=process] Exchange[Message: com.scb.channels.base.vo.PayloadDTO@e486e6]\nJmsConsumer[reqQueue]] DEBUG o.a.c.c.jms.EndpointMessageListener - Endpoint[pwmq://queue:reqQueue?concurrentConsumers=2&exchangePattern=InOnly&jmsMessageType=Object&maxConcurrentConsumers=10&maxMessagesPerTask=2] consumer received JMS message:JMSMessage class: jms_bytesJMSType: nullJMSDeliveryMode: 2JMSExpiration: 0JMSPriority: 4JMSMessageID: ID:414d5120484b49424b31533120202020318cf553051a5420JMSTimestamp: 1410364124990JMSCorrelationID: nullJMSDestination: nullJMSReplyTo: nullJMSRedelivered: falseJMSXAppID: WebSphere MQ Client for JavaJMSXDeliveryCount: 1JMSXUserID: ibnkmqJMS_IBM_Character_Set: IBM437JMS_IBM_Encoding: 273JMS_IBM_Format:JMS_IBM_MsgType: 8JMS_IBM_PutApplType: 28JMS_IBM_PutDate: 20140910JMS_IBM_PutTime: 15484499aced000573720023636f6d2e7363622e6368616e6e656c732e626173652e766f2e5061796c6f616444544f163e357ea7d7ff690200044c000c63757272656e7453746174657400124c6a6176612f6c616e672f537472696e673b4c000972657175657374564f7400214c636f6d2f7363622f6368616e6e656c732f626173652f766f2f42617365564f3b4c000a726573706f6e7365564f71007e00024c00097472616365506174687400104c6a6176612f7574696c2f4c6973743b7870707372002b636f6d2e7363622e6368616e6e656c732e626173652e766f2e42696c6c657250617952657175657374564f6aa29232aa1e2e1f0200034c00106163636f756e74496e7175697279564f74002b4c636f6d2f7363622f6368616e6e656c732f626173652f766f2f4163636f756e74496e7175697279564f3b4c001562696c6c506179526567697374726174696f6e564f7400304c636f6d2f7363622f6368616e6e656c732f626173652f766f2f42696c6c506179526567697374726174696f6e564f3b4c001262696c6c6572506179...### Assistant: So by setting targetClient=1 it means the code is asking the underlying JMS client to send the message as a 'raw' MQ message. It won't have any JMS properties... just a MQ header and payload. Any application getting the message won't see a JMS message. Therefore the JMS client if it sees the message will only be able to create a bytes message.Whereabouts was this targetclient configured? I don't see in the config above.\n"} +{"text": "### Human: I have the following vb.net code:Imports IBM.WMQ\n[...]\nMQEnvironment.Hostname = hostName\nMQEnvironment.Port = portNumber\nMQEnvironment.Channel = channelName\nqueueManager = New MQQueueManager(queueManagerName) ' error herewhich is throwing the following error:System.IO.FileNotFoundException occurred\nFileName=C:\\Users\\User\\Documents\\Visual Studio 2012\\Projects\\[...]\\bin\\Debug\\mqclient.ini\nHResult=-2147024894\nMessage=Could not find file 'C:\\Users\\User\\Documents\\Visual Studio 2012\\Projects\\[...]\\bin\\Debug\\mqclient.ini'.\nSource=mscorlib\nStackTrace:\n at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)I am not using any ini files in the construction of my queue manager, so does anyone have any idea what's going on - why is it even looking for one, and why in the same directory as the program? I have installed the MQ client, and afaik I have all the environmental variables, etc. set up properly.Thanks for any help you can give### Assistant: Is that an unhandled or a first chance exception? Internally, the MQ .net layer will try to read a MQClient.ini but should function quite happily without it. It reads the file for compatibility with the C client, and can handle some of the MQClient.ini stanzas. I would not have expected an absence of such a file to cause problems, but it will try to open it internally. Was that the full callstack, as I'd have expected some MQ libraries on the stack otherwise.\n"} +{"text": "### Human: I need to deploy EJB3 MDB on JBOSS 5.1 and listen to the Topic deployed on IBM MQ. One way is to configure the RemoteJMSProvider inside of $JBOSS_HOME/server/default/deploy/messaging/jms-ds.xml. The second way is to use the MQ Resource adapter and deploy it in JBOSS. \nWhat are the advantages of one approach to another? Are there any other ways?### Assistant: The RemoteJMSProvider is a generic JMS JCA adapter and so can be used by lots of JMS Providers. Essentially it is a JCA wrapper around a standard MQ JMS client that then talks to the MQ QueueManager. This does mean it is not optimised for any specific JMS Provider, and is also likely to not be tested by the vendor of JMS Provider being used.The MQ Resource Adapter is built by IBM and so will be tested and fully supported by IBM when used in a Java EE application server. It will also mean it is optimised for MQ.\n"} +{"text": "### Human: currently I am working with Apache Camel and IBM Websphere MQ. In my project, I would like to write xml message into IBM WMQ and to do so I need to change the MQGet CodedCharSetID from 1208 into 819.Anyone has an idea about how to do so in apache camel?For your information:I have tried to use the convertbodyto tag, but it did not worked.I have also tried to add CCSID property in WMQ Connection Factory Bean, and it also did not worked.Your help is so much appreciated. Thanks in advance.### Assistant: Try setting the destination name as queue:///FOO.BAR?CCSID=819 instead of simply FOO.BARIf that does not work out, there is a workaround to set the option onCamel JMS docs.\n"} +{"text": "### Human: What channel attributes can be utilized to provide barriers at different points in WebSphere MQ Inbound channel processing as an alternative to just simply disabling it?### Assistant: From a security perspective, the approach of using multiple controls on a channel definition provides some redundancy. For example, many years ago researchers found a bug (which IBM quickly fixed) in the channel protocol that allowed the channel to start despite anMCAUSERthat should have prevented the connection. If the MQ admin had relied entirely on theMCAUSERvalue, the channels would have been vulnerable until the fix was applied.For that reason I generally advise to set multiple controls in the channels that you wish to be disabled. The idea is that if one control fails, the channel fails to a safe state. You could, for example, useCHLAUTHto disable a channel but if you then use the Broker's New Broker Configuration Wizard, the first thing it does (last time I checked) is to disableCHLAUTH. Whoops.Here are a few of the attributes that can be used to disable a channel. Remember that if you apply these to aSYSTEM.DEF.*orSYSTEM.AUTO.*channel, youmustoverride the attribute on creating a new legitimate channel so do not go overboard and use all of them. Or, more precisely, use one control for every layer of tin foil present in your favorite hat. ;-)SetMCAUSER('*NOBODY')because the asterisk is not a valid character in a user ID.Set the max message length to something shorter than theMQMDlength.SetSSLCIPH,SSLCAUTH(REQUIRED)and make sureSSLPEERhas an impossible value.UseCHLAUTHrules but make sure that when you create the rules that allow access on legitimate channels that they are not so broad as to authorize access to channels you did not intend.Specify exits that do not exist.Note that these address the issue of an attacker who does not already have access to the QMgr. Any attacker with admin access will keep templates on hand from asaveqmgrfrom each MQ version. This allows the attacker to submitDEFINEcommands that contain all the required attributes and thus will not be reliant on theSYSTEM.*objects. The legitimate administrator, however, must use the same approach or at least be cognizant of which attributes must be overridden to define a new channel.In short, this approach provides perimeter controls and the trade off is in administrative overhead. To be effective, use two or more unrelated controls (CHLAUTH,MCAUSERand invalid exit spec, for example), incorporate the setting into the training for administrators, and do not be tempted to use every possible control because the cost of doing so rises faster than the benefit.\n"} +{"text": "### Human: I am writing a monitoring tool for a system which uses MQ websphere.\nI want to check the queues depth by using the getCurrentDepth() method.\nTo be able to do so, I first need to access the queue using the function:public MQQueue accessQueue(String queueName, int openOptions, \n String queueManagerName, \n String dynamicQueueName, \n String alternateUserId) \n throws MQException;My concern is that the call to getCurrentDepth() willlock the specific queuefor some period of time, which is very bad for the monitored system.\nMy guess is that theopenOptionsare the solution but I haven't found any helpful information regarding these options accept for theIBM WebSphere MQ APIAny assistance will be much appreciated.\nThanks.### Assistant: In order to inquire the current depth you will have to use the MQOO_INQUIRE open option.However, that said, most monitoring tools would use PCF not MQINQ as the MQINQ verb is limited to things a business application, not a monitoring application would need. If all you want is the current depth, then fine, but if you intend to monitor anything else, you'll need to change tack.\n"} +{"text": "### Human: I'm new in WAS MQ. I have a qmgr called QM1 and a local queue which called Q1. There is a SVRCONN channel with MCA set to mqm.I want to prevent incoming message through this channel to PUT message to Q1.\nI'm using setmqaut but it's not working as I want.### Assistant: The reason you haven't been able to prevent specific API calls over that channel is that theMCAUSER('mqm')setting ensures that anything connecting over that channelalwaysconnects with full administrative authority. There is no way to usesetmqautor any other native WMQ feature to prevent an administrator from accessing the queue. The QMgr always allows access by the admin, regardless of anysetmqautsettings.It is a bit unclear as to what to recommend because there's no such thing as \"WAS MQ\". There is WebSphere Application Server (WAS) and there's WebSphere MQ (WMQ). WAS used to come bundled with WMQ but the two are not a single product.Assuming that you mean WebSphere MQ and not WebSphere App Server talking to WMQ, I'd strongly recommend moving to a modern version. End-of-Life has been announced for WMQ v7.0 and it lacks authentication features of versions v7.1 and higher. As of v8.0, WMQ can even authenticate a user ID and password.In order to authenticate and apply granular authorization in WMQ, you will need to use some valueotherthan 'mqm' in theMCAUSERof the channel. The standard advice is to set theMCAUSERof all channels of typeRCVR,RQSTR,CLUSRCVRandSVRCONNto*NOBODYand then arrange to authenticate your channels based on something useful such as the Distinguished Name of a certificate. Other less useful ways to validate a connection (because these can hardly be called \"authentication\") include looking at the IP address of the inbound connection or the identity that is claimed on aSVRCONN.In v7.0, these require an exit andBlockIP2is the standard used throughout the WMQ install base world-wide. In v7.1 and v7.5 you can achieve the same thing simply through configuration ofCHLAUTHrules using standardMQSCscripting.There are several conference presentations discussing how to do this att-rob.neton theLinkspage. I wouldstronglyrecommend moving to v7.5 of WMQ, especially sinceyou can do so for freeas a developer, regardless of the status of the licensing that the company running the QMgr has purchased. However, the QMgr in Production can also be upgraded to v7.5 for free if it is under maintenance. If you wait until June you can have v8.0, although the availability of a free developer version has not been announced as yet, to my knowledge.\n"} +{"text": "### Human: WebSphere MQ Explorer has a feature called Activity Viewer that can monitor queue status, catching values it calls \"Put\", \"Got\" and \"High depth\" in defined intervals.My question is: how to do the same by usingmqsccommand on server locally?\nI know that you can request that \"High Depth\" withdis qs(queue.name) curdepthcommand, but I can't seem to find what will get me those \"Put\" and \"Got\" values Activity Viewer shows.### Assistant: WMQ Explorer uses a command calledReset Queue Statistics(MQCMD_RESET_Q_STATS) that is not available as an MQSC command. It is provided only as a PCF command. Part of the reason for this is that this command follows Quantum Physics rules, leading to the Heisenberg Uncertainty of Queue Stats problem. Allow me to explain.IssuingMQCMD_RESET_Q_STATSreturns the stats since the last time the command was issued, resetting them at the same time. I describe this as being like Quantum Physics because mere observation of the stats affects them. Now imagine you are running a performance test and multiple people are interested in the outcome, and both are using WMQ Explorer to view the stats. Each will see some value approximating 1/2 the activity. Now try it with three people. Four people. You get the idea. You can get some results back but if there's a chance someone else is doing the same thing you can never be certain of the quality of those results. (Hence the reference to Heisenberg.)I believe that IBM does not make this an MQSC command because typically you would want some central monitor such as Tivloi to be theonlything using this command. If they made it an MQSC command, everyone would want to use it.\n"} +{"text": "### Human: I installed IBM MQ Version 5.3 on 64bits Windows7 computer, then i tried to create a Queue Manager using Web Sphere MQ Explorer. It is always popping up the the below error message when i create queue manager. \nCan anyone please tell me the reason? Is IBM MQ 5.3 is not supported with Windows7?Unable to create queue manager qm.### Assistant: No ... MQ 5.3 not supported on Windows 7 as perhttp://www-01.ibm.com/support/docview.wss?uid=swg27006285\n"} +{"text": "### Human: Hopefully someone can help with this as I can't seem to find the answer elsewhere.I'm writing a COBOL routine toPUTandGETmessages to an MQ queue.The messages in question are all contained in a single file and I would like to know if the syntax ofMQPUTcan be used to justPUTthe file or do I have to read the file and do aPUTof each individual message?### Assistant: The syntax of MQPUT API says that the message to be put is passed as buffer. The application must fill the buffer with data to be put. So you can either read the entire file to a sufficiently sized buffer and send it or read one record at a time from the file and send it. It depends on how your receiving application wants the message format to be. Can it process the whole file as one message or one record at a time.\n"} +{"text": "### Human: I have a question on how the MCA user id we add while creating a WebSphere MQ Server Connection channel actually authorizes a client user id configured in an MQ client Application.\nFor e.g I have a domain user account servicemq01@domain added as MCA user id for a Server connection channel APP1.SVRCONN.01. I have created a user group mqi_App1@server and added the servicemq01@domain user id into it. The mqi_App1 group is given required authorities to connect to the queue manager. Also the required authorities are added at the queue level for mqi_App1 group.Now the client Application App1 has a userid clientapp01@domain with which it runs. The client Application is trying to connect to MQ server using channel APP1.SVRCONN.01. My question is does both the clientapp01@domain and servicemq01@domain needs to match for the MQ Server connection channel to work??### Assistant: No. By putting a UserId in the channel's MCAUSER field, you are overriding the UserId that the application is using. Any and ALL applications that connect on channel 'APP1.SVRCONN.01' will be using UserId 'servicemq01@domain'.Very trusting of you and not very secure.\n"} +{"text": "### Human: I've installed the Websphere MQ 7.5 and written a Java-client to connect to the queue. To perform the task, I'ev created a custom connect-to-server channel that is based on theSYSTEM.DEF.SVRCONNchannel.Firstly, to block all users with administrator privileges and all anauthorized users for all channels I've types such a command (runmqsc TEST_MANAGER):SET CHLAUTH(*) TYPE(BLOCKUSER) USERLIST('nobody', *MQADMIN). Now I see this restriction in the MQ Explorer (TEST_MANAGER -> Channels -> Channel Identification Records).After that, to provide my test user (Java-client) with an access, I've typed such a command:SET CHLAUTH(TEST_CHANNEL) TYPE(ADDRESSMAP) ADDRESS('*') MCAUSER('TestUser') .Lastly, I've set the username/password pair in the Spring's UserCredentialsConnectionFactoryAdapter where the username is TestUser.The problem is I can't connect with the2035MQRC_NOT_AUTHORIZEDexception. If I remove the 'nobody'/*MQADMIN blocking rule, everything works fine (only the rule for the TestUser client rule presents).### Assistant: SET CHLAUTH(TEST_CHANNEL) TYPE(ADDRESSMAP) ADDRESS('*')\n MCAUSER('TestUser')I do not think you understand this command. This command says that ALL applications connecting on channel 'TEST_CHANNEL' will use UserID of 'TestUser'.I've set the username/password pair in the Spring's\n UserCredentialsConnectionFactoryAdapter where the username is\n TestUser.Setting a Password is pointless, as MQ does NOT perform authentication. You need to purchase a 3rd party product (i.e. MQAUSX) to handle the authentication. Also, your CHLAUTH command is actually overriding whatever UserID you set in your Spring application.The problem is I can't connect with the 2035 MQRC_NOT_AUTHORIZED exception. If I remove the 'nobody'/*MQADMIN blocking rule, everything works fine (only the rule for the TestUser client rule presents).Did you use the setmqaut command to give the UserID 'TestUser' the appropriate access to the queue manager and queue?Turn on the queue manager's Authority Event and to see exactly why MQ is returning 2035.\n"} +{"text": "### Human: We are using IBM WebSphere MQ as JMS provider with Spring MDP (Message Driven POJO).Is there any way in JMS where we can configure time related properties in message so that message can be consumed at particular defined time only?For example, if I am sending three messages into queue M1, M2 and M3. Where, I can configure M2 message property let say 3 AM. And consumer side, consumer can only pick this message @ 3 AM only. If time is not defined, messages should be consumed in a way that JMS Receiver does.### Assistant: JMS 2.0 specification has definesDelivery Delay. With this feature a message producer can specify that a message must not be delivered until after a specified timeinterval. The message will be available for delivery after the specified time. But this may not help you as you want to a message to be consumed at a specified time. Typically messaging applications are designed to consume messages as soon as they are made available by the messaging provider.\n"} +{"text": "### Human: I have a java program to browse a message from queue.When i run the application it shows the \"java.lang.NoClassDefFoundError:\" error \n Also i have jar com.ibm.mq which contains class MQQueueManager. but i am getting error message like \"This element neither has attached source nor attached Javadoc and hence no Javadoc could be found.\"2nd question\n It is a program to browse message. after browsing the message how to get only the messageID from the message.Please give me the solution.### Assistant: Usually the error you are seeing is caused when people grab the jar files rather than installing the client from the vendor distribution media. If you did not install the IBM MQ client from the media, you can download it for free asSupportPac MQC75. This will provide the complete client, the Initial Verification Program (IVP) that tests the installation, as well as a number of other diagnostics.As for the message ID...MQMessage myMessage = new MQMessage();\n byte myMessageID = myMessage.messageId;...as per the docshereandhere.\n"} +{"text": "### Human: I am trying to get the resolved queue name (i.e. the base queue name of an alias queue) in open_after and put1_before API exit by looking at ResolvedQName field of Object descriptor(MQOD). But it does not seem to contain the base queue name (i.e. is either blank or is some unexpected value like.. '1.59.15') within these exits. I can however see that the ObjectName has been properly set with the alias queue name. For clarity my alias queue and the base queue both are with the same local QM.So I am wondering if there is anyway to get the resolved queue name within MQ API exit when making (open + put) or put1 call with alias queue. Any help would be appreciated.### Assistant: I am guessing that you are using theMQPMO_SYNCPOINToption? Are you also using theMQPMO_SYNC_RESPONSEoption? Please see the last note on theMQPUT1topic which states:When an MQPUT1 call is issued with MQPMO_SYNCPOINT, the default\n behavior changes, so that the put operation is completed\n asynchronously. This might cause a change in the behavior of some\n applications that rely on certain fields in the MQOD and MQMD\n structures being returned, but which now contain undefined values. An\n application can specify MQPMO_SYNC_RESPONSE to ensure that the put\n operation is performed synchronously and that all the appropriate\n field values are completed.In other words, thePUT1is handed off to WMQ and control returned to the program before the name resolution has occurred.In any case, thePUT1_BEFOREexit point will not have resolved the name. Assuming thatMQPMO_SYNC_RESPONSEwas specified, you should be able to find it in thePUT1_AFTERexit point.If you install the API exit fromSupportPac MA0W, it parses all the control blocks and flags into English and formats a listing. If you look at the output of that exit, you should be able to see exactly which exit points and fields contain the resolved names and when.So, be sure to specifyMQPMO_SYNC_RESPONSEand consider using the MA0W API exit as a reference and study aid.\n"} +{"text": "### Human: We have set upBOTHRESH(5),BOQNAME(USER.ERR)in WebSphere MQ v7.0.1.9 queue manager.When TX is rolled back by the MDB in a container managed TX in WebSphere application server v7, the messages are getting placed in DLQ instead of placing in original queue.I checked the logs which stated that TX got rolled back successfully .Can some one help me?### Assistant: ...the message are getting placed in DLQ instead of placing in original queue.SettingBOQNAMEandBOTHRESHresults in the QMgr attempting to put the message in somethingother thanthe original queue. OnceBOTHRESHis exceeded, the QMgr will first try to put the message into the queue named byBOQNAME, then into the DLQ if putting toBOQNAMEis not possible. Only if both of these fail does the QMgr put the message back on the original queue or discard it if the message is non-persistent.Some reasons that backing out to the queue named inBOQNAMEor to the DLQ fail are:The target queue does not exist.The target queue is full.The message size exceeds the target queue's MAXMSGL attribute.The user is not authorized to put messages onto the target queue.The target queue is of the wrong type (i.e. XMitQ or model queue).When putting to the DLQ, the QMgr'sDEADQattribute is empty.BOTHRESHis set butBOQNAMEis not. In this case, the DLQ is the only queue tried.\n"} +{"text": "### Human: I am running WebSphere MQ v7.1.0.1 under Linux. Is it normal to see too many amqrmppa processes for the same Queue Manager?mqm 3504 1745 2 Nov01 ? 03:40:23 /opt/mqm/bin/amqrmppa -m TEST\nmqm 4804 1745 0 08:56 ? 00:01:21 /opt/mqm/bin/amqrmppa -m TEST\nmqm 5022 1745 27 08:56 ? 01:17:32 /opt/mqm/bin/amqrmppa -m TEST\nmqm 5944 1745 27 09:30 ? 01:07:45 /opt/mqm/bin/amqrmppa -m TESTThanks.### Assistant: This is normal.amqrrmpais the channel pooling process. When WMQ usedinetdyou would see one process per channel instance. Then it was changed to stand-alone listeners and there were only so many child processes you could run per listener. The new model usesamqrrmpato pool channels and it will dynamically spawn or kill processes as needed, depending on load. Do not expect it to kill them quickly if you shut down all your channels, though. It will kill unusedamqrrmpainstances if resources get low, otherwise it assumes 'you needed this many before, you'll probably need this many again' and lets them hang around a while.\n"} +{"text": "### Human: I was wondering ( i am not sure on the architecture i need here ) if it would be possible to have glassfish running on an ubuntu install on my desktop at home using jms, then using a combination of a basic java application(using spring/jms) and basic android application have a messaging service running. for example the java application could publish the messages and the android device consume them? This might be a ridiculous question and I might be missing the point of how this all works but I wanted to try it out tomorrow if it is possible although id rather not try if it wont work!thanks### Assistant: Have a look atUsing MQ Telemetry Transport Protocol in IBM Worklight Mobile applications. This combination of MQTT in the device connected to WebSphere MQ allows seamless exchange of pub/sub between devices and JMS applications (or any other of the WMQ API platforms such as C, C#, Java, XMS, REXX, Perl, COBOL, etc.).Somebenchmarking done on Androidshowed MQTT to be up to 93x higher throughput and 10x lower battery use than HTTPS. That is probably whyFacebook Messenger uses it.To learn more about MQTT please visithttp://mqtt.org. For an open-source MQTT broker, have a look athttp://mosquitto.org. There are several publicly available and free MQTT brokers that you can point your client device at and you can test the JMS interoperability using atrial of WebSphere MQ.\n"} +{"text": "### Human: What is the impact on existing code to migrate from WebSphere MQ V6 to V7?Can we make simply the change?### Assistant: Like all good questions, the answer here is \"it depends.\"First of all, don't go to v7.0, go to V7.1 at least, better yet to V7.5.Using client or bindings mode connections? You can upgrade the QMgr without touching a client-based app in most cases. Any version of WMQ client can talk to any version of WMQ server, however its best not to leave apps on an unsupported version of WMQ client. Of course, the app running on the old client won't get the new function such as automatic reconnect or performance improvements, even though the QMgr is at V7.5.Using SSL? The SSLPEER element order changed and the commands to manage certificates changed. Good news, cert management is now performed withrunmq*kmcommands living in the{mq install}/bindirectory so you don't need to hunt down the GSKit directory and figure out whether to usegsk6*,gsk7*orgsk8*commands.If you go from 32 to 64 bit, you may need to recompile programs or exits.Correct settings forPATH,CLASSPATHandLIBPATHchange across versions.There's much more and it's well covered in the Infoceenter. Each Infocenter has a section on migration. Within that section, there's subsections by version and within those there are subsections by platform. Pick the target version of WMQ (that's V7.5, right? Say yes!) and and drill down. Start here:Migration from V6.0 to V7.5Migration from V6.0 to V7.1Migration from V6.0 to V7.0\n"} +{"text": "### Human: My question is about one to many message flow using a single queue in IBM MQ. I am new to MQ.Scenario - Suppose there are multiple processes reading from a single queue, when they read a message from the queue , do all of them get the same message.ie - Lets say there are no messages on the queues and two readers are blocked on it (executed the MQGET on it).1 messages come on the queue (logically meant for process 1). Will both of them get the message as both were waiting (executed the MQGET on it) or only to one process randomly.once the message is read is it removed from the queue.If messages are removed from queue after reading ,suppose process 1 is processing and a new message comes for it and instead process 2 gets it and is deleted. When process 1 tries to get it wont get any message. Is this possible.basically i want to know how to manage multiple processes on a single queue so that the messages go to right process and no message is missed.### Assistant: Multiple apps reading on a queue compete for messages if no selectors are used. Straight FIFO reads deliver messages to competing apps such that any one message is delivered once to one of the app instances. Assuming the app gets the message outside of syncpoint or issues aCOMMITthen no other app will see the message and it will be permanently removed.Things that change the behavior include:Message selectors. If the apps get messages byMsgIDor other selection criteria the QMgr makes only messages that meet the selection available to the app. If multiple app instances use the same selection criteria, they compete for messages within the subset defined by the selector.Rollbacks. If an app rolls back a message it becomes available again and may go to the same or different application instance.Priority delivery. Behaves as for FIFO except that messages are ordered by priority with the highest priority ones being delivered first.Message groups. It is possible to select messages by group ID and to specify that the GET does not succeed until all messages in the group are present. If a partial group lands on the queue it is possible to see depth on the queue but no messages delivered to the application.Looking at your questions one at a time:messages come on the queue (logically meant for process 1). Will both of them get the message as both were waiting (executed the MQGET on it) or only to one process randomly.Queues are cheap. Don't put messages destined for App1 and App2 on the same queue if the apps are reading FIFO. The only way to share a queue across different apps (or different instances of the same app) is if all things reading from the queue use selectors and that the selectors effectively segregate the messages so they go to the right app. If even one instance is running FIFO then it doesn't work.once the message is read is it removed from the queue.Yes, provided the app issues aGETfollowed byCOMMITor aGEToutside of syncpoint. If the app browses the queue, then the message remains and becomes available to other apps once the browse cursor moves off of it.If messages are removed from queue after reading ,suppose process 1 is processing and a new message comes for it and instead process 2 gets it and is deleted. When process 1 tries to get it wont get any message. Is this possible.Absolutely. As noted earlier, apps or app instances reading the queue in a FIFO mode will compete for messages. If indeed a message arrives \"for process 1\" then either use selectors that prevent other processes from reading the message or use different queues for each instance.\n"} +{"text": "### Human: I have an application that uses WebSphere MQ to send data through WebSphere to a datacentre in the Cloud. Part of the functionality is that if the server-side subscriber detects that a message has not been received for 30 minutes, the thread is paused for 5 minutes, and the connection is removed. When it restarts, it reconnects.In practice, I've found that disconnecting has not removed the subscription. When attempting to reconnect, I see this error:\"There may have been a problem creating the subscription due to it being used by another message consumer.\nMake sure any message consumers using this subscription are closed before trying to create a new subscription under the same name. Please see the linked exception for more information.\"This shows the message handler is still connected, meaning disconnect has failed. Disconnect code for the XmsClient object (part of the library, although one of my colleagues might have changed it) is:public override void Disconnect()\n {\n _producer.Close();\n _producer.Dispose();\n _producer = null;\n _consumer.MessageListener = null;\n _consumer.Close();\n _consumer.Dispose();\n _consumer = null;\n _sessionRead.Close();\n _sessionRead.Dispose();\n _sessionRead = null;\n _sessionWrite.Close();\n _sessionWrite.Dispose();\n _sessionWrite = null;\n _connection.Stop();\n _connection.Close();\n _connection.Dispose();\n _connection = null;\n\n //GC.Collect();\n\n\n\n IsConnected = false;\n }Anyone have any thoughts as to why the connection still exists?### Assistant: From the error description it looks like server subscriber is creating a durable subscription. Durable subscription continues to receive messages even when subscribing application is not running. To remove a durable subscription you must call Session.Unsubscribe(). Simply closing the consumer does not remove subscription.If your intention was to close a subscriber without removing the subscription, then issue Connection.Stop() first followed by deregister message listener and then close consumer. Calling connection.Stop method stops message delivery.\n"} +{"text": "### Human: I'm using running a Websphere 8.5 installation. I'd like to deploy an MDB using WebsphereMQ JMS Provider. I can see from the Admin Web console that Websphere MQ is enlisted as JMS Provider, however when I try to create a new JMS Connection Factory using WebsphereMQ and use \"Test Connection\" it fails.So I just wonder, does WebsphereMQ ships out of the box with the release 8.5 of the application server ? or should I install it separately ?\nThanks a lot\nLouis### Assistant: When you create the connection factory, queues and topics in the WAS admin console, this generates the administered objects in the JNDI repository but does not create a queue manager or the corresponding objects in the queue manager. Those are administered independently using WebSphere MQ's native admin tools.If you have not installed WebSphere MQ on the target server, do that. To tell if it is installed, execute thedspmqvercommand or look in/opt/mqmor the Windows equivalent which is usuallyC:\\Program Files (x86)\\IBM\\WebSphere MQ.Make sure that there is a SVRCONN channel defined on the QMgr for the app server. Do not use SYSTEM.DEF.SVRCONN or any of the other default SYSTEM.* channels, despite this practice being documented in the Infocenter.Make sure the QMgr has a listener defined and running. Note the port it is running on.Make sure that the security is set up to allow the connection. If you want to eliminate security to test the CF then you cantemporarilyalter the channel withMCAUSER('mqm')(or use the platform equivalent administrative ID if on Windows, iSeries, etc.Now you can define the CF, taking care to use the host, channel and port as defined in the previous steps.WebSphere MQ does NOT ship with WAS. The WAS Infocenter discusses this in the topicInstalling WebSphere MQ to interoperate with WebSphere Application Server. Note in the same section are several topics on administering JMS resources to talk to MQ and that they make a distinction between managing the administered objects in WAS versus managing the actual objects in the queue manager.\n"} +{"text": "### Human: I need to share a QM and its listener between multiple clients in order to utilize system resources.my concern is security - access control.\nas all clients will have access to the listener port i can't use firewall to manage access rights.how can i make sure a client can only access his specific queues under the shared QM?\ni know i can assign MCAUSER to client level channels, but still, what makes a client being able to only connect to a specific channel?i have assigned an MCAUSER to a channel and set permissions.\nnow, from the client java JMS API, how do I connect to that specific channel, and what forbids other clients from connecting to this specific channel?### Assistant: You are on the right track. I would recommend reading the security presentations from the IBM conference as background. Go tothis pageand scroll down a bit.Remember that the client can specify any channel nameotherthan the one you provisioned for them so in addition to setting MCAUSER on the one channel, you need to have set it onallchannels. Channels namedSYSTEM.DEF.*andSYSTEM.AUTO.*should be disabled with an MCAUSER that cannot be used as a valis user ID. We are currently recommendingMCAUSER('*NOACCESS')since*NOACCESSis a reserved word in WMQ V7.1 and later.Now that you've blocked the unused channels, you need to arrange to map the client connections to their respective user IDs. The way you do this is different depending on which version of WMQ QMgr that you have. In V7.0 and earlier it requires an exit. The BlockIP2 exit atMrMQ.dkis one that the community has contributed to over the years and is owned and maintained by an IBMer. In V7.1 and later the functions in BlockIP2 have been implemented natively in WMQ as CHLAUTH rules.Specifically, the exit or in V7.1 the CHLAUTH rules allow you to map the connecting client's asserted ID, IP address or SSL Distinguished Name to a user ID to place into MCAUSER when the channel connection is made.If you need to validate user ID and password, then you would need to write or purchase an exit to do that. Neither WMQ nor BlockIP2 validate ID and password at this time. However, business partners such as Capitalware sell exits which do just that. If you wished to write such an exit, the BlockIP2 source code is a good place to start.\n"} +{"text": "### Human: What would be the recommended values for AUTHRECS for the following,of course this needs to be tweaked per one's requirements.QUEUE MANAGERQUEUE (local, remote, dlq)CHANNEL (server connection, sender, receiver etc.)### Assistant: I usually tell people to consider three different groups for security:QMgr-to-QMgr connections which boil down to \"what auths do I grant theMCAUSERof a RCVR/RQSTR/CLUSRCVR channel?\" The roles in this category depend on how granular you want network security to be. In general though, the adjacent QMgrs should NOT have access to the local QMgr's command queues. The channel's MCAUSER gets to connect to the QMgr and inquire, then put and setall on the queues it actually needs. That's it.Application-to-QMgr. By \"application\" here I mean a business application residing in a locked data center. These applications generally need to connect and inquire on the QMgr and then put, get, browse, publish, subscribe on queues and topics. Sometimes they need more elevated auths like the ability to set the context info for a message, but that is rare and limited to specific queues.Interactive users. Among this group there are various roles such as administrator, anonymous user and everything in between. These may need access to display or even manage objects other than queues and topics.Each of these hasverydifferent authentication and authorization requirements. They also have different characteristics such as the volume of messages and stability of the accounts and authorizations they require.They do all have a few things in common, though.Granting set on the QMgr to anyone with access to the command queue makes them a full administrator.Granting the ability to create queues (other than dynamic ones) makes the user a full administrator.Anything that connects or opens an object needs inquire on the QMgr and objects it is authorized to.Business applications need read/write access to their queues and topics but not other types of objects.Instrumentation generally needs access to many object types butnotto read or update the messages on the business queues.Human users need at least display access to all objectsifyou are monitoring security. This is because the only way to enumerate objects (for example to paint a queues screen) is to do the PCF equivalent ofDIS objType(*). If the user doesn't have display access to all objects ofobjTypethen the QMgr emits authorization errors when the display is issued.\n"} +{"text": "### Human: I am trying to publish a message to a remote JMS queue by a pretty standard mechanism:TopicConnection tc = null;\nTopicSession ts = null;\nTopicPublisher tp = null;\nProperties p = new Properties();\nString providerUrl = \"iiop://servername:9810\";\nString contextFactory = \"com.ibm.websphere.naming.WsnInitialContextFactory\".trim();\np.put(javax.naming.Context.PROVIDER_URL, providerUrl );\np.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, contextFactory );\nInitialContext ct = new InitialContext(p);\n\n{ \nTopic topic = (Topic)ct.lookup( \"jms/customer_event\" );\nTopicConnectionFactory tcf = (TopicConnectionFactory)ct.lookup( \"jms/TopicFactory2\" );\ntc = tcf.createTopicConnection();\n....\n..\n..\n}Now, the Topic and TopicConnectionFactory lookups are fine but when it comes totcf.createTopicConnection(), it throws:javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for 'servername:QMGR1'\nInner exception(s):\ncom.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2059\njava.net.ConnectException: Connection refused: connectI opened up MQ explorer, and the topic is existing on the remote Queue manager. IS the TopicCoonectionFactoryTopicFactory2also supposed to reside on the queue manager? Because it does not. \nWhat can be the cause of error?### Assistant: When connecting, the details of host, port and channel must be correct. If the host or port are wrong, then the TCP socket is refused. If the channel name is wrong, then the queue manager will refuse the connection and close the socket. It is possible that you have all the details correct but that the listener on the queue manager is not running.If the connection is getting as far as the queue manager then you will have an error in the[WMQ Install dir]/qmgrs/[QMgr name]/errors/AMQERR01.LOGfile. If the connection gets to WMQ but cannot resolve the queue manager's name or specifies the wrong QMgr then the error will be in[WMQ Install dir]/errors/AMQERR01.LOG. If there is no entry in either of these then the connection isn't making it to WMQ and you need to check the listener or the network.\n"} +{"text": "### Human: What is the best approach to connect to websphere mq v7.1 and clear all the messages of one or more specified queues using Java and JMS? Do I need to use Websphere MQ specific java API? Thanks.### Assistant: Like all good questions, \"it depends.\"The queue can be cleared with a command only if there are no open handles on the queue. In that case sending a PCF command to clear the queue is quite effective, but if there are open handles you get back an error. PCF commands are of course a Java feature and not JMS because they are proprietary to WebSphere MQ.On the other hand, any program authorized to perform destructive gets off a queue can clear the queue. In this case, just loop over a get until you get the 2033 return code indicating the queue is empty. This can be performed using JMS or Java but both of these manage the input buffer for you. If the queue is REALLY deep then you end up moving all that data and if the app is client connected, you are moving it at network speed instead of in memory.To get around this, you need to specify a minimal amount of buffer and as one of the GET options also specifyMQGMO.TRUNCATED_MSG_ACCEPTED. This moves only the message header during the get calls and can be significantly faster.Finally, if you are doing this programamtically and regardless of which method you use, spin off several threads and don't use syncpoint. You actually have to go out of your way to get exclusive input on a queue so once you get a session, just spawn many threads off of it. Close each thread gracefully and shut down the the session once all the threads are closed.\n"} +{"text": "### Human: I am trying to figure out how we would configure / setup the authentication, Queues, and Queue managers for connecting an MQ Client that is on a server / domain completely separate from the MQ Server it will be forwarding messages to.I would assume that in a normally organizational environment you could just use Active Directory (if hosted on windows servers) for the authentication / AD lookup. However, in this scenario because they are different orgs you couldn't do that?Can you simply apply SSL certs to both client / server and use that as your authentication? If so is that just applied to the Channel used in the connections?Not sure how to proceed forward with this.Any suggestions would be greatly appreciated.Thanks,S### Assistant: Take a look at theHardening WebSphere MQpresentation for v7.0 and earlier. The thing to remember is that WMQ does not authenticate anything. It authorizes based on OS identities and groups but there is no password checking being done.For situations where QMgrs and clients live on Windows networks, the connection uses the SID and so it appears that some useful authentication was performed. BUT if a connection from a non-Windows platform is attempted, the Windows QMgr uses the string representation of the ID. So for example, if someone has a Linux VM on their desktop they can easily create a user ID called MUSR_MQADMIN and the Windows QMgr will accept the connection. There is a setting that causes the Windows QMgr to only accept connections with SIDS that it can resolve but even there its just a matter of knowing what the SID values are to spoof them on a connection.The lesson here is thatanyQMgr, even one on Windows, must be configured to authenticate remote connections. With WMQ v7.1 and later, the QMgr has functionality to map X.509 certificate DNs to user IDs, or to perform IP filtering. Prior to v7.1 these functions required an exit such asBlockIP2. Capitalware sellsMQAUSXwhich has the functions of BlockIP2, plus will perform ID and password authentication and is supported.The first recommendation is to use a v7.1 QMgr so that you get theCHLAUTHrules for mapping and filtering. Even if you don't use certificates v7.1 limits administrative connections so it is harder for an attacker to gain full admin rights. Then if you need password validation, use SSL channels (to encrypt the password and prevent simply replay attacks) in combination with an exit that you can write yourself or purchase.Just be aware that allowing a connection from outside your domain doesn't present any new challenges. The pre-v7.1 Windows QMgr that does not have MCAUSER set in the channel definition or by an exit allows remote administrative access, even from connections originating in the local Windows domain. There wasalwaysa need to harden that QMgr, even though honest users will have received authorization errors if the administrator did not set up auths for them.Summary:For clients originating outside your administrative domain, I'd recommend mutually authenticated TLS/SSL channels. The same page I linked to above also contains the WMQ Security Lab guide and scripts which show how to script the creation and exchange of WMQ certs and configure WMQ Explorer with them.Whatever else you do, theMCAUSERon any legitimate channel must be set either in the configuration or by an exit. If the client is allowed to specify the ID, there is nothing to prevent it from specifying an administrative ID. For channels that are NOT being used such asSYSTEM.DEF.*andSYSTEM.AUTO.*, set the MCAUSER to a value that cannot be a local ID such asno!bodyor on v7.1 and later*NOACCESS.\n"} +{"text": "### Human: I am using the PCF API (for WMQ 7) with Java. When I list the queues, I can seenqueues named something like this:SYSTEM.MANAGED.DURABLE.4F32A40D034A0020and then for my specific topic, I can see that there arensubscriptions that I printed to look like this:MQCACF_SUB_NAME:JMS:NJW_QM:STREAMHUB:STREAMHUB-EVENTBUS-SUB\nnull:[65, 77, 81, 67, 78, 74, 87, 95, 81, 77, 32, 32, 32, 32, 32, 32, -83, -12, 96, 79, 32, 0, -16, 1]\nMQCACF_SUB_USER_ID:MUSR_MQADMIN\nMQCA_RESUME_DATE:2012-03-20\nMQCA_RESUME_TIME:11:15:14\nMQCACF_LAST_MSG_DATE:2012-03-23\nMQCACF_LAST_MSG_TIME:09:00:00\nMQIACF_DURABLE_SUBSCRIPTION:1\nMQIACF_MESSAGE_COUNT:45\nMQIACF_SUB_TYPE:1I know there must be an association somewhere, but I cannot figure out what it is.Thanks in advance for any assistance.//Nicholas### Assistant: Inquire on the subscriptions. Two of the attributes of the subscription are the destination and the destination QMgr.One of the issues is that any given queue might be the target of multiple subscriptions. So given a subscription you can look up the one and only one queue it sends messages to. But given a queue, there is no way to work backward to a specific subscription.A \"shotgun\" approach is to simply inquire on all subscriptions and then see which of them contain the target queue as the destination.\n"} +{"text": "### Human: We are attempting to consolidate the DLQs across the board in our enterprise, into a single Q (an Enterprise_DLQ if you will...). We have a mix of QMs on various platforms - Mainframe, various Unix flavours - Linux,AIX,Solaris etc., Windows, AS/400....\nThe idea was to configure the DLQ on the QM (set the DEADQ attribute on the QM) to that of the ENTERPRISE_DLQ which is a Cluster Q. All the QMs in the Enterprise are members of the Cluster. This approach, however does not seem to work when we tested it. \nI have tested this by setting up a simple Cluster with 4 QMs. On one of the QM, defined a QRemote to a non-existent QM and non-existent Q, but a valid xmitq and configure the requsite SDR chl between the QMs as follows:QM_FR - Full_Repos\nQM1, QM2, QM3 - members of the ClusterQM_FR hosts ENTERPRISE_DLQ which is advertised to the ClusterOn QM3 setup the following:\nQM3.QM1 - sdr to QM1, ql(QM1) with usage xmitq, qr(qr.not_exist) rqmname(not_exist) rname(not_exist) xmitq(qm1), setup QM1 to trigger-start QM3.QM1 when a msg arrives on QM1On QM1:\nQM3.QM1 - rcvr chl, ql(local_dlq), ql(qa.enterise_dlq), qr(qr.enterprise.dlq)Test 1:\nSet deadq on QM1 to ENTERPRISE_DLQ, write a msg to QR.NOT_EXIST on QM3\nResult: Msg stays put on QM1, QM3.QM1 is RETRYING, QM1 error logs complain about not being able to MQOPEN the Q - ENTERPRISE_DLQ!!ql(qm1) curdepth(1)Test 2:\nSet deadq on QM1 to qr.enterprise.dlq, write a msg to QR.NOT_EXIST on QM3\nResult: Msg stays put on QM1, QM3.QM1 is RETRYING, QM1 error logs complain about not being able to MQOPEN the Q - qr.enterprise.dlq (all caps)!!ql(qm1) curdepth(2)Test 3:\nSet deadq on QM1 to qa.enterise_dlq, write a msg to QR.NOT_EXIST on QM3\nResult: Msg stays put on QM1, QM3.QM1 is RETRYING, QM1 error logs complain about not being able to MQOPEN the Q - qa.enterise_dlq (all caps)!!ql(qm1) curdepth(3)Test 4:\nSet deadq on QM1 to local_dlq, write a msg to QR.NOT_EXIST on QM3\nResult: Msg stays put on QM1, QM3.QM1 is RUNNING, all msgs on QM3 ql(QM1) make it to local_dlq on QM3.ql(qm1) curdepth(0)Now the question: Looks like the DLQ on a QMmustbe a local queue. Is this a correct conclusion? If not, how can I make all the DLQs msg go to a single Q - Enterprise_DLQ above?One obvious solution is to define a trigger on local_dlq on QM3 (and do the same on others QMs) which will read the msg and write it to the Cluster Q - ENTERPRISE_DLQ. But this involves additional moving parts - trigger, trigger monitor on each QM. It is most desirable to be able to configure a Cluster Q/QRemote/QAlias to be a DLQ on the QM. Thoughts/ideas???Thanks\n-Ravi### Assistant: Per the documentationhere:A dead-letter queue has no special requirements except that:It must be a local queueIts MAXMSGL (maximum message length) attribute must enable the queue to accommodate the largest messages that the queue manager hasto handle plus the size of the dead-letter header (MQDLH)The DLQ provides a means for a QMgr to handle messages that a channel was unable to deliver. If the DLQ were not local then the error handling for channels would itself be dependent on channels. This would present something of an architectural design flaw.The prescribed way to do what you require is to trigger a job to forward the messages to the remote queue. This way whenever a message hits the DLQ, the triggered job fires up and forwards the messages. If you didn't want to write such a program, you could easily use a bit of shell or Perl code and the Q program fromSupportPac MA01. It would be advisable that the channels used to send such messages off the QMgr would be set to not use the DLQ. Ideally, these would exist in a dedicated cluster so that DLQ traffic did not mix with application traffic.Also, be aware that one of the functions of the DLQ is to move messages out of the XMitQ if a conversion error prevents them from being sent. Forwarding them to a central location would have the effect of putting them back onto the cluster XMitQ. Similarly, if the destination filled up, these messages would also sit on the sending qMgr's cluster XMitQ. If they built up there in sufficient numbers, a full cluster XMitQ would prevent all cluster channels from working. In that event you'd need some kind of tooling to let you selectively delete or move messages out of the cluster XMitQ which would be a bit challenging.With all that in mind, the requirement would seem to present more challenges than it solves. Recommendation:error handling for channels is best handled without further use of channels - i.e. locally.\n"} +{"text": "### Human: Any ideas how (if I) can I test WebSphere MQ locally using the IBM.XMS library without installing a MQ server (i.e. with just the MQ Client) whether it's via a simulator, mocks or local message queue?### Assistant: Two options. You can use a WebSphere MQ queue manager to test applications written using IBM.XMS or any other MQ client. You can download a trial copy from developerWorkshere. The trial version is fully enabled and good for 90 days.IBM.XMS can also be used for messaging with Default Messaging Provider of WebSphere Application Server. You can download a WAS trialhere.\n"} +{"text": "### Human: We have a machine with multiple MQ clusters and listeners defined. Is there any script which can be used to create an exact replica on another machine. Are there any commands/tools available?Our platform is Windows.### Assistant: Backing up a QMgr to restore else where entails the following:Back up object definitions. WMQ v7.1 has thedmpmqcfgcommand for this. Prior versions useSupportPac MS03, a.k.asaveqmgr.Back up authorizations. Same options as previous bullet.Back up the .ini filesBack up any exits and their parameter filesNote that the best practice is to restore these objects into a QMgr with adifferentname. There are issues in trying to keep the QMgr name identical, especially if you have clusters or use a commercial certificate authority to sign SSL certs.The index of SupportPacsis here. There are many which can help with scripting and deployment but MS03 is my personal favorite for this task.\n"} +{"text": "### Human: I am using IBM Websphere MQ v6 and I am connecting to it using a Java EE program. \nI want to know how to set the MQ Get Options so that no conversion is done.Can I use the field MQFMT_NONE for this?### Assistant: This is not supported. Depending on the client and QMgr versions, WMQ messages may carry properties and JMS header data in the RFH2 message header. Because this header is part of the message payload and not part of the MQMD or other message metadata, WMQ JMS classes willalwaysuseMQGMO_CONVERTwhen retrieving messages to insure that it can read the RFH2 headers. If WMQ did not do this then the message properties and other metadata in the RFH2 header would often not be readable by the client app's JMS classes.For more on this topic, please see the Infocenter'sMessage Conversionsection in the Using Java manual. Also, please see the TechnoteMQGMO_CONVERT switching functionality for Java Message Service applicationsfor some behavior differences across versions.\n"} +{"text": "### Human: In WebSphere MQ 6, I want to script the creation of new queues. However the queues may already exist, and I need the script to be idempotent.I can create queues using the commandsdocumented here. For example:DEFINE QREMOTE(%s) RNAME(%s) RQMNAME(%s) XMITQ(%s) DEFPSIST(YES) REPLACEorDEFINE QLOCAL(%s) DESCR(%s) DEFPSIST(YES) REPLACETheREPLACEkeyword ensures that creation does not fail if the queue already exists.I've tested this with an existing, non-empty queue and it seems that no messages were lost. However this is not proof enough. I need to be certain that no messages will ever be lost or corrupted if I run aDEFINE Q... REPLACEcommand against an existing queue. The existing queue might even be participating in transactions at the time.Can anyone confirm or deny this behaviour?### Assistant: ADEFINEcommand withREPLACEfails if the object is open. Therefore you cannot redefine a queue with pending transactions. Themanual statesthat all messages in the queue are retained during aDEFINEwithREPLACE, and this implies no loss of message integrity. You canALTERa queue withFORCEoption to change a queue that is currently open as describedhere. That too retains messages in the queue without loss of integrity.TheDEFINEcommand will not affect the messages in a queue. The only effects you might notice are, for example, if you change the queue fromFIFOtoPRIORITYor vice versa. This only changes the indexing and ordering fornewmessages in the queue and does not affect existing messages. Similarly, changing attributes of the queue that affect handles only take effect the next time the queue is opened. An example of that is changingBIND(ONOPEN)toBIND(NOTFIXED).One of the things that I have beenrecommending for a whilefor WMQ clusters is to split the queue definition up into build-time and run-time attributes. For example:DEFINE QLOCAL (APP.FUNCTION.SUBFUNCTION.QA) +\n GET(DISABLED) +\n PUT(DISABLED) +\n NOTRIGGER +\n NOREPLACE\nALTER QLOCAL (APP.FUNCTION.SUBFUNCTION.QA) +\n DESCR('APP service queue for QA') +\n DEFPSIST(NO) +\n BOTHRESH(5) +\n BOQNAME('APP.FUNCTION.BACKOUT.QA') +\n CLUSTER('DIV_QA') +\n CLUSNL(' ') +\n DEFBIND(NOTFIXED)In this case theGET,PUTandTRIGGERattributes are considered run-time and are only set when the queue is first defined. This allows you to define a new queue in the cluster and have it be disabled until you are ready to turn on the app. In subsequent runs of the script, these attributes are never changed because the statement usesNOREPLACE. So once you enableGETandPUTon the queue these attributes (and the function of the app) are never disturbed by subsequent script runs.TheALTERthen handles all the attributes that are considered build-time. For example, if you change the description, you want it picked up in the next script run. Because we defined the queue in the previous step (or that step failed because the queue exists), we know the ALTER will work.Whether any attribute such as the cluster membership is build-time or run-time is up to you to decide. This is just an example born from many cases where administrators inadvertently broke something by re-running the MQSC script.But to answer your question a bit more on point, the things that break are because someone reset a run-time attribute such asGET(DISABLED)(which can cause an in-flight transaction to be backed out if the app tries to perform a GET on that queue after gets are disabled)and not because the change caused an integrity failure of the queue, a message or a transaction.\n"} +{"text": "### Human: For testing purpose I want to generate about one million messages to MQ. But after 200-300 messages inserting becomes very slow, near 30 seconds for 100 messages. And after 3700 messages I have got MQException (Reason 2010).My code in groovyimport com.ibm.mq.*\n\nMQEnvironment.@hostname = \"srv-cci2\"\nMQEnvironment.@port = 1414\nMQEnvironment.@channel = \"SYSTEM.ADMIN.SVRCONN\"\nMQEnvironment.disableTracing();\nMQException.log = null;\n\ndef queueManager = new MQQueueManager(\"QM_srv_cci2\")\n\nint putOpenOpts = MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING;\n\ndef putMsg = new MQMessage();\nputMsg.setVersion(MQC.MQMD_VERSION_2);\nputMsg.format = MQC.MQFMT_STRING;\nputMsg.characterSet = 1250;\n\n\ndef xml = \"\"\"\n\n\"\"\"\n\nfor (int i = 1; i < 1000000; i++) {\n def putQ = queueManager.accessQueue(\"SOA_EVENT.IN\", putOpenOpts);\n putMsg.writeString(xml);\n def pmo = new MQPutMessageOptions();\n putQ.put(putMsg, pmo);\n putQ.close()\n\n if (i % 100 == 0) {\n println (\"\" + new Date() + \" \" + i)\n }\n}\n\nqueueManager.disconnect()So main question - do this possible - quickly insert 1 million messages to Webspere MQ? And how to do this?### Assistant: The 2010 reason code is defined in the following constant name: MQRC_DATA_LENGTH_ERRORIn each itereation you call:putMsg.writeString(xml);But it is never reset. Looks to me that you keep adding more content to the message and posting it (each message is larger than the previous one).\n"} +{"text": "### Human: I am using websphere mq and JMS API to connect to MQ.I am using message selector for connecting and grouping the messages.Actually my problem is that there are some cases where JMS client can connect with same Message Selector(CO-relation ID), so whenever any client tries to connect to MQ then i want a way to check whether that Is there any other client with same message selector is already connected or not, and If present then I need to stop him from connecting an I will abort his connection.Is there any way to intercept the Websphere MQ connections before connecting?Regards,\nPravin### Assistant: You can't do this directly at connect time, as in JMS a message selector is undefined at the time you create the connection: i.e. you first doConnection c = myConnectionFactory.createConnection();and then later on doMessageConsumer con = mySession.createConsumer(myDestination, mySelector);so when you connect the queue manager has no way of knowing what selector you will subsequently use (or even if you will specify one at all)One possibility might be to use durable subscriptions, seehttp://download.oracle.com/javaee/1.3/api/javax/jms/TopicSession.html#createDurableSubscriber(or the cross-domain JMS 1.1 equivalent). These are uniquely identified by a combination of clientId, subscriber name, and Topic, and the JMS specification requires thatIf another connection with the same clientID is already running ... the JMS provider should detect the duplicate ID and throw an InvalidClientIDException.the client ID is specified on the ConnectionFactory, so is closer to what you want, although switching to durable Pub/Sub is not necessarily a simple option. Before even considering that, you should probably look at whether or not there is an application level fix for the \"cases where JMS client can connect with same Message Selector\"\n"} +{"text": "### Human: I am trying to use the .NET MQ Extended Transaction Client to talk to an existing Queue Manager in our enterprise. I am running on a clean install of Windows 2008 R2 with the Extended Client from the MQ 7.0.1 trial.My program writes to the queue when I comment out the TransactionScope and the MQC.MQPMO_SYNCPOINT options. With the transaction code I get the following exception on the q.Put() call:MQRC_UOW_ENLISTMENT_ERROR ReasonCode 2354Here is my complete program:using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing IBM.WMQ;\nusing System.Transactions;\n\nnamespace MQSeries\n{\nclass Program\n{\n static void Main(string[] args)\n {\n var transOptions = new TransactionOptions();\n transOptions.IsolationLevel = IsolationLevel.Serializable;\n\n string queueManagerName = \"MYQUEUEMANAGER\";\n string queueName = \"MYQUEUE\";\n string channelName = \"MYCHANNEL\";\n string channelInfo = \"myserver.com(1418)\";\n\n MQQueueManager qm;\n\n using (var trans = new TransactionScope(TransactionScopeOption.Required, transOptions, EnterpriseServicesInteropOption.Full))\n {\n qm = new MQQueueManager(queueManagerName, channelName, channelInfo);\n\n // Set up the options on the queue we wish to open\n int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT;\n\n var q = qm.AccessQueue(queueName, openOptions);\n\n // Define a WebSphere MQ message, writing some text in UTF format\n MQMessage hello_world = new MQMessage();\n hello_world.WriteUTF(\"Hello World!\");\n\n // Specify the message options\n MQPutMessageOptions pmo = new MQPutMessageOptions(); // accept the defaults,\n pmo.Options = MQC.MQPMO_SYNCPOINT;\n\n // Put the message on the queue\n q.Put(hello_world, pmo);\n }\n\n qm.Disconnect();\n }\n}\n}Note that this program does not have a trans.Complete() call. So, barring the current exception, I would expect the message on the queue to be rolled back with the transaction.### Assistant: It turned out to be an open issue in the v7 client. My v7 XA client was talking to a v6 Queue Manager:IC74808: MQ V7 XA CLIENT APPLICATION FAILS WHILE CONNECTING TO MQ V6 QUEUE MANAGER.A WebSphere MQ v7 XA client\n application issues an MQCONN to a\n WebSphere MQ v6 queue manager. The\n MQCONN fails during a xa_open with\n reason code 2046, MQRC_OPTIONS_ERROR.\n This failure in the MSDTC process\n causes a UOW_ENLISTMENT_ERROR, which\n is MQRC = 2354. This also results in\n the xa_open call failing with a -3\n (XAER_RMERR).\n"} +{"text": "### Human: In cluster environment I have deleted a remote queue say \"REMOTEtoTNSERVER\". But i could see the same queue exists as type \"cluster\" with several instance. How can i delete them? I checked on repository the queue manager entry for that remote queue is no longer exists.Please suggest your answers.Thanks,\nVignesh### Assistant: Assume QMgrs A, B, C, and REPOS1 and REPOS2 in the cluster. If you are working on A and deleteREMOTEtoTNSERVERand still see it as a cluster queue, then it is defined somewhere else in the cluster, probably on B and C.If you go to the repository QMgrs, they too will show the queues that are on B & C and advertised to the cluster. The only way to get rid of these is to sign onto the B & C QMgrs and delete the queues or remove them from the cluster.To determine which QMgrs in the cluster host the clustered instances of these queues, use theDIS QCLUSTER()command from the A QMgr or either of the repositories. This will tell you which QMgrs host an instance of a clustered queue so that you can go there and delete them.\n"} +{"text": "### Human: I have a WebSphere MQ Queue Manager with transmission queue defined and I'm using API to get some information about the queue. When trying to inquire the queue (using .NET interface, but I believe this is not important here), I always receive an exception with reason2042: MQRC_OBJECT_IN_USE- according tothe documentation, this means that there's an exclusive lock at the queue. By some further investigation I can see that the process holding the lock isrunmqchl- part of MQ Server.Is the exclusive lock typical for transmission queues?Or this means that there's something wrong with the queue or the transmission?Even better, maybe there is a way to do some inquiries (read-only) to that locked queue (i.e. to get its depth or browse the messages) using API?### Assistant: The SDR or SVR channel will always open the transmission queue for exclusive use. If the .Net client is getting an error because of this then it is asking for input rights as well as inquire. You can verify this by using WMQ Explorer to inquire on the queue and you will see that it has no problem getting queue attributes, depths, etc. So open for inquire but not browse or get and you should be fine.\n"} +{"text": "### Human: We have a WMQ - WAS/JMS client setup through server connection channels where we are trying to put in security through user Ids.Now, we set up a local user id on the MQ box,mquserid, and left the channel's MCAUSER blank.We thought: the id running the MQ client (WAS in our case)wasuserid, when passed to MQ will fail as it is not setup on MQ box. So we shall then set up JAAS alias (with User Id: mquserid) for the Queue connection factory on WAS which will then be passed to MQ and will allow connections.But, weare ableto connect and put messages without the JAAS alias :(I wrote a standalone Java program to connect to QMs and it is behaving correctly depending on the user Id I pass when obtaining connection.Does WMQ treat WAS in a special way allowing connections without checking against its local user registry?### Assistant: No, WAS is treated like any other connection.In version 6 and earlier of WAS it will send a blank ID if the user ID on the WMQ connection is not specified. You can tell if this is the case by looking at the channel status while WAS is connected. The MCAUSER of the running channel will contain the ID that was used to connect. If the running channel status shows no MCAUSER value then WAS did not present an ID.The other possibility is that the SVRCONN channeldefinition(not status) has a value such asmqmin the MCAUSER. In this case, the ID presented during the connection request is ignored. Again, check the channel status to see what ID is being used at run time or just check the SVRCONN channel definition to look for an MCAUSER value.Now here's the kicker - if the channel's MCAUSER is blank then WMQ will accept whatever ID is presented. If no ID is presented, then the connected app or user runs as an administrator. If an app or user can be a WMQ administrator then they can do anything on the QMgr and can also remotely execute arbitrary OS commands on the server under the QMgr. Not good.The correct answer is to set the MCAUSER on the channel to whatever value the app is supposed to connect as. At this point, the app cannot use any other ID because the channel will override it. However, anyone can connect to that channel so the next step is to authenticate the connection request. You can use an exit likeBlockIP2which is free orMQAUSXwhich is a commercial vendor product. BlockIP2 will filter incoming requests by IP address which may be sufficient for connections arriving from a static IP in a locked datacenter. MQAUSX will actually check the UserID and password sent during the connection request from WAS (or any client, for that matter). You can also use SSL and the channel's SSLPEER attribute to authenticate requests using X.509 certs. Note that if you use MQAUSX to validate a user ID and password either use SSL encryption with it or use both the client-side and server-side versions of the exit. Otherwise your credentials are flowed in cleartext over the wire which defeats the purpose.Of course, if you secure the app's channel it's necessary to secure the other channels on the host such as SYSTEM.DEF.* and SYSTEM.AUTO.* or else an attacker will simply bypass the app channel.Note that if the RCVR, RQSTR and CLUSRCVR channels do not authenticate requests or contain an MCAUSER value they also expose admin access. For example, if I want to control your QMgr and you locked the SVRCONN channels, I'd create a QMgr on my desktop, delete my SYSTEM.DEF.RECEIVER, create a newSDRchannel called SYSTEM.DEF.RCVR and point it at yout QMgr. If your SYSTEM.DEF.RCVR (or S.D.RQSTR or S.D.CLUSRCVR) or any other of these channel types that you have defined lack SSL or an exit then I can connect and if they lcak an MCAUER then I can administer the QMgr anonymously and execute OS commands.Any channel definition without an MCAUSER value allows administrative access.Any channel without SSL/SSLPEER and/or an exit allows anonymous connections.For more on this, please see the WMQ Hardening presentation and WMQ Security Lab documents athttps://t-rob.net/links. Also, please see the articles on SSL and other WMQ security topics in theMission:Messagingcolumn on IBM developerWorks Tech Journal.\n"} +{"text": "### Human: I am facing two issues when i try to connect to MQ which is deployed on a Remote Server from Weblogic Server(WLS) by creating a Foreign Server.\n1. When I try to connect to MQ Queuemanager in Bindings mode(after importing the .Bindings file) i keep getting the below error in WLS console:java.lang.UnsatisfiedLinkError: no mqjbnd05 in java.library.pathIf i Switch the Transport to Client i keep getting:JMSWMQ0018: Failed to connect to queue manager '' with connection mode 'Client' and host name 'localhost'. Check the queue manager is started and if running in client mode, check there is a listener running. Please see the linked exception for more information.Has anyone seen this, and are there any performance implications which dictate the use of client over bindings and vice versa?TIA### Assistant: Finally i was able to resolve this, i had to recreate the .bindings file in the client mode, with changes to the IVTsetup.bat which is most likely present in \nC:\\Program Files\\IBM\\WebSphere MQ\\java\\bin, I had to run this\ndef qcf(psQCF) TRANSPORT(CLIENT) HOST(SMEKA) PORT(1415) CHANNEL(ps_SRV_CHANNEL) QMGR(psQM)\nto generate the .bindings file.Refer to this link for more details:http://publib.boulder.ibm.com/infocenter/wbihelp/v6rxmx/index.jsp?topic=/com.ibm.wbia_adapters.doc/doc/peoplesoft/peopleso103.htm\n"} +{"text": "### Human: We have IBM websphere mq set up that accepts message from outside world and transmits message to another internal queue manager. I want to trace time taken for this activity per message. Is anyone aware of any tool or MQ feature?Thanks!### Assistant: The native WMQ statistics tell you how many messages per second go through a queue or a channel but do not correlate messages in with messages out.TheSupportPac MA0Wprovides an API trace that gives you very detailed information per queue, per thread, per process, etc. It does not correlate either but does provide extremely fine grained control and tracing.If you need something less powerful, theMA0Z SupportPacwill log messages through the channel. If you run it on both channels you can correlate the times with a script by comparing MsgID in with CorrelID out (assuming these are honored as per WMQ programming recommendations).There are some 3rd party apps which collect the message headers and times and log these into a DB that you can report on. The main example of such a utility isthe program formerly known as StatWatch. This correlates message sin against messages out.Finally, there are a number of Tivoli tools that collect statistics for WMQ at the queue and channel level or at the business service level. Once configured, these also can correlate messages in with messages out.\n"} +{"text": "### Human: I'm unclear as to whether there should be a 1-1 or a 1-* relationship between:Server-Connection Channel and JMS TopicServer-Connection Channel and ListenerListener and TopicRegards the design of our application layer, there is a single MDB that in response to a message, does some work, then publishes messages onto a variety of output topics. The service layer is listening on these output topics.Currently I have a 1-1-1 between Channel-Listener-Topic, and therefore an instance of JmsConnectionFactory for each publisher (on the app side) and listener (on the service side).### Assistant: There are a couple of different ways to look at this. From the point of view of your application one connection factory can have many sessions. Each session may have many consumers but units of work are scoped per session, not per consumer. So more than likely you want one connection factory with multiple sessions where each session has a listener on a particular topic. If you have a listener assigned to multiple consumers on a single session, any acknowledge (or COMMIT in a transacted session) commits all messages got or put in that session.From the WMQ server's point of view, one channel definition can have many running instances. So you only need the one SVRCONN channel defined per app, regardless of how many channel instances it needs to start. Try not to put different apps on the same SVRCONN though because you often want to administer or authorize the apps separately. For example, with apps on separate channels you could easily figure out which app was misbehaving if you suddenly found yourself with 3000 running channels.For purposes of administration and debugging, I'd probably have one CF for the app side and one CF for the service side. Each would point to a different SVRCONN channel as described above. Inside the app server I'd stick with one topic per session unless it is valid for your app to consume off multiple topics in a single unit of work. In the subscription you can specify a wildcard topic to get all topics below a certain point in the topic tree with a single subscriber.Just for best practices, I'd also set the CF to use FAILIFQUIESCE to make sure the QMgr can be stopped in an orderly fashion and I'd use SYNCPOINTALLGETS (or a transacted session with explicit commit calls) in order to improve reliability as per the JMS 1.1 spec, sestion 4.4.13 which states:If a failure occurs between the time a client commits its work on a Session and the commit method returns, the client cannot determine if the transaction was committed or rolled back. The same ambiguity exists when a failure occurs between the non-transactional send of a PERSISTENT message and the return from the sending method. It is up to a JMS application to deal with this ambiguity. In some cases, this may cause a client to produce functionally duplicate messages.A message that is redelivered due to session recovery is not considered a duplicate message.The SYNCPOINTALLGETS (a.k.a. SPAG) insures that messages retrieved from the queue are delivered to your app before being committed and permanently removed from the queue. Otherwise if you lose your connection while the QMgr is trying to return a message, it's gone for good. With SPAG set you might see the same message twice as described in the JMS spec, but you'll never drop one.For more details of the options available to the CF, queue and topic objects, see:Properties of objectsin the WebSphere MQ Using Java manual.WMQ v6.0 is end-of-life as of September 2012 so please be sure to develop using the v7 clients, even if the server is at v6. This will reduce your migration effort next year. Download v7 clienthereand the WMQ v7.1 clienthere.\n"} +{"text": "### Human: I am trying to execute the following command:MQConnectionFactory connFactory = new MQConnectionFactory();I get a null pointer exception that I can't seem to track down. I have attached the stack trace below.java.lang.NullPointerException\n at com.ibm.msg.client.jms.internal.JmsFactoryFactoryImpl.getInstance(JmsFactoryFactoryImpl.java:169)\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.setProviderFactory(JmsConnectionFactoryImpl.java:165)\n at com.ibm.mq.jms.MQConnectionFactory.(MQConnectionFactory.java:271)\n at com.foundation.agent.plugin.JMSClient.createConnection(JMSClient.java:154)\n at com.foundation.agent.plugin.JMSClient.launch(JMSClient.java:108)\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n at java.lang.reflect.Method.invoke(Method.java:597)I am loading the class that calls thenew MQConectionFactory()using a class loader so I suspect that some JBoss JMS library is possibly causing this.More info:com.ibm.mq.runtime_7.0.1.0\\libJars:com.ibm.mq.headers.jarcom.ibm.mqjms.jarjms.jarcom.ibm.mq.jarconnector.jarjta.jarcom.ibm.mq.jmqi.jardhbcore.jarproviderutil.jarcom.ibm.mq.pcf.jarfscontext.jar### Assistant: You appear to be using v7.0.1.0 of WMQ. Have you configured your CLASSPATH as described in thev7 WMQ Using Java manual? Assuming a standard install, the only jar you need in the CLASSPATH at runtime is com.ibm.mqjms.jar. There's about 10 jars in the standard install I don't see in your list so I'm not sure if you listed what's in your CLASSPATH variable or what's in the java/lib but it's not the list I'd expect in either case. If you grabbed the jar files from somewhere, try using thefull client install\n"} +{"text": "### Human: Is is possable to create and delete queues using the amqdnet wrapper, or some other API from c# code?I'ld like to be able to create some queues as part of an automated test suite if required.Thanks.### Assistant: I ended up imlementing this by starting a new process and running MQSC with si and so rederection, not as clean as I would have liked but it works.Originaly I used the MO74 SupportPac that adds powershell access to MQ, This worked realy well and looked nice in code. However our target machines don't have powershell installed and I was unable to get it added as a pre-req for a minor feature.\n"} +{"text": "### Human: I am trying to write a java application connecting to server connection channel with SSL enabled.So far, I have been successfully connected to the channel by setting authentication to 'optional'. However, when I set it to be 'required', the connection fails.Here is what I did:Create key db for queue manager and keystore for the java client user.Create key/self-signed certificates for the queue manager and the client user, with names prefixed ibmwebspheremq.Export, exchange and import certificates for the queue manager and the client. (I did answered 'yes' when being asked whether I trust the queue manager cert).The location and password to the truststore and keystore are set to point to the same keystore at the client side, where the orgininal created client user key and the imported queue manager key are.With other settings being the same, if I switch back to 'optional' authentication, the connection works.I think there is something I understand incorrectly about this ssl authenticaion but cannot figure out what.Could someone kindly help me?### Assistant: I beat my head against that wall for a couple of weeks. IBM L2 Support eventually clued me in. My issue here was that keytool will use DSA algorithm unless you specify RSA. This results in keys of length 1022 instead of 1024, which WMQ doesn't like. The fix was to specify -sigalg RSA when generating the certificate and everything works.I've asked the IBM WMQ team and WMQ FTE team to add this to their Infocenter documentation.\n"} +{"text": "### Human: I'm using Weblogic 9.2 with a lot of MDBs. These MDBs access JDBC DataSources and write to both locally and externally managed JMS Destinations using local and foreign XAConnectionFactorys, respectively. Each MDB demarcates a container-managed JTA transaction that should be distributed amongst all of these resources.Below is an excerpt from my ejb-jar.xml for an MDB that consumes from a local Queue called \"MyDestination\" and produces to an IBM Websphere MQ Queue called \"MyOtherDestination\". These logical names are linked to physical objects in my weblogic-ejb-jar.xml file.Is it required to use the and tags to expose the ConnectionFactory and Queue to the MDB?If so, is it required by Weblogic or is it required by the J2EE spec? And for what purpose? For example, is it required to support XA transactionality?I'm already aware of the benefit of decoupling the administered objects from my MDB using names exposed to the naming context of the MDB. Is this the only value added when specifying these tags? In other words,is it acceptable to just reference these objects from my MDB using the InitialContext and the objects' fully-qualified names?\n \n MyMDB\n com.mycompany.MyMessageDrivenBean\n Container\n javax.jms.Queue\n MyDestination\n \n jms/myQCF\n javax.jms.XAConnectionFactory\n Container\n \n \n jms/myOtherDestination\n javax.jms.Queue\n Produces\n MyOtherDestination\n \n \n### Assistant: I poured over Weblogic/J2EE documentation for a day, posted the above question, then as expected I immediately came across the documentation I was looking for.At a minimumI need to declare a for the remote ConnectionFactory (in my case, IBM Websphere MQ) in order to enlist its connections in the JTA transaction.The corresponding for the remote Destination is added for consistency and there is no real value-add here from the Weblogic perspective. In addition there is no value-add when specifying references to locally administered Destinations, ConnectionFactorys, and Datasources.From Weblogic'sFAQs: Integrating Remote JMS Providers:Q. What advantages do JMS resource\n references provide?A. JMS resource references provide the\n following advantages:They ensure portability of servlet and EJB applications: they can be used\n to change an application's JMS\n resource without recompiling the\n application's source code.They provideautomatic pooling of JMS Connection, Session, and\n MessageProducer objects.They provideautomatic transaction enlistment for non-WebLogic JMS\n providers. This requires XA support in\n the JMS provider. If resource\n references aren't used, then enlisting\n a non-WebLogic JMS provider with the\n current transaction requires extra\n programmatic steps.The details of this functionality are described atEnhanced J2EE Support for Using WebLogic JMS With EJBs and Servlets.\n"} +{"text": "### Human: I am trying to deploy a ear file, which was originally written for Jboss 4.0.3 SP1.The \"upgrade\" involved:use of javax.annotation.PostConstructchange activateConfig to activationConfigmake sure the bean implements import javax.jms.MessageListenerI believe the following stack trace is triggered by a MDB (one and only) within a ejb file.10:42:37,350 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/C:/opt/jboss-5.1.0.GA/server/default/deploy/my-service.ear/ state=PreReal mode=Manual requiredState=Real\norg.jboss.deployers.spi.DeploymentException: Error deploying my-service-ejb.jar: failed to initialize bean container\n at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:196)\n at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:99)\n at org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer.internalDeploy(AbstractVFSRealDeployer.java:45)\n at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)\n at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)\n at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)\n at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)\n at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)\n at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)\n at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)\n at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)\n at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)\n at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)\n at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)\n at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)\n at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)\n at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)\n at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)\n at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)\n at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)\n at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)\n at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)\n at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)\n at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)\n at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)\n at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)\n at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)\n at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)\n at java.lang.Thread.run(Thread.java:619)\nCaused by: java.lang.RuntimeException: failed to initialize bean container\n at org.jboss.ejb3.EJBContainer.(EJBContainer.java:253)\n at org.jboss.ejb3.mdb.MessagingContainer.(MessagingContainer.java:87)\n at org.jboss.ejb3.mdb.MDB.(MDB.java:63)\n at org.jboss.ejb3.Ejb3AnnotationHandler.getMDB(Ejb3AnnotationHandler.java:336)\n at org.jboss.ejb3.Ejb3AnnotationHandler.getContainers(Ejb3AnnotationHandler.java:215)\n at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:718)\n at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:669)\n at org.jboss.ejb3.Ejb3Deployment.deployUrl(Ejb3Deployment.java:651)\n at org.jboss.ejb3.Ejb3Deployment.deploy(Ejb3Deployment.java:614)\n at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:491)\n at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:182)\n ... 29 more\nCaused by: java.lang.IllegalStateException: Null beannMetaData\n at org.jboss.ejb3.interceptors.metadata.BeanInterceptorMetaDataBridge.setupMetaDataLists(BeanInterceptorMetaDataBridge.java:315)\n at org.jboss.ejb3.interceptors.metadata.BeanInterceptorMetaDataBridge.initialise(BeanInterceptorMetaDataBridge.java:235)\n at org.jboss.ejb3.interceptors.metadata.BeanInterceptorMetaDataBridge.(BeanInterceptorMetaDataBridge.java:138)\n at org.jboss.ejb3.interceptors.metadata.AdditiveBeanInterceptorMetaDataBridge.(AdditiveBeanInterceptorMetaDataBridge.java:48)\n at org.jboss.ejb3.aop.BeanContainer.initialize(BeanContainer.java:194)\n at org.jboss.ejb3.EJBContainer.(EJBContainer.java:249)\n ... 39 more\nCaused by: java.lang.NullPointerException\n at org.jboss.ejb3.interceptors.metadata.BeanInterceptorMetaDataBridge.setupMetaDataLists(BeanInterceptorMetaDataBridge.java:268)\n ... 44 moreJust wonder if anyone can suggest what to look at.### Assistant: Should be strange, but try to see if there are some libs missing for your project.I was doing the same here, I tried to find some answer at google and nothing helps me.Then when I try to look again my project and see that there are some libs missing. When I add its, it works.\n"} +{"text": "### Human: I have a queueAIS.CICSUD1.BROKER.DATAaccessed by different process IDs such as BO01, BO02, BO03.Can I create the same Queue for diferent process Id's? I tried it on WebSphere MQ Explorer but it's giving me duplicate Queue error.My queue manager is on my local machine and I need to access the queues only from my local machine.Please let me know### Assistant: Queues must be unique on a given queue manager. All of the different types of queue (QLocal, QRemote, QAlias, QModel) share the same namespace. Typically in your situation some identifier would be added to the queue name. In this case, adding the process ID seems to be the easiest approach.\n"} +{"text": "### Human: How to start default listener (likeSYSTEM.DEFAULT.LISTENER.TCP) from MQ Explorer?\nShould be possible, right? - Just like you can start a queue manager in Explorer.\nIf there is, can someone tell me how explicitly?I know how to do it outside of Explorer using the MQSC command:START LISTENER('SYSTEM.DEFAULT.LISTENER.TCP')### Assistant: Make sure that your MQ Explorer list of listeners is showing system objects (one of the icons in the top right), then right click on the listener object that you want to start and choose Start from the context menu.\n"} +{"text": "### Human: I have IBM MQ running in one docker container and in another container I have IBM Websphere running. From Websphere I am trying to create QCF using CCDT connection method. I have copied CCDT file inside /tmp folder of Websphere container, when I test the connection I get the error:A connection could not be made to IBM MQ for the following reason: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2278' ('MQRC_CLIENT_CONN_ERROR').*I am able to connect from MQ Explorer using the same CCDT file.CCDT JSON sample used:{\n \"channel\":\n [\n {\n \"connectionManagement\":\n {\n \"sharingConversations\": 10,\n \"defaultReconnect\": \"no\",\n \"heartbeatInterval\": 10,\n \"keepAliveInterval\": -1\n },\n \"general\":\n {\n \"description\": \"Client Channel Definition\",\n \"maximumMessageLength\": 104857600\n },\n \"name\": \"CHANNEL1\",\n \"clientConnection\":\n {\n \"connection\":\n [\n {\n \"host\": \"IP\",\n \"port\": port\n }\n ],\n \"queueManager\": \"QMNAME\"\n },\n \"type\": \"clientConnection\"\n }\n ]\n}### Assistant: JSON CCDT support was not added to IBM MQ until 9.2 LTS. You won't be able to use it with a 9.1.0.7 RA.Your only options are to use a binary CCDT or add/installed the 9.2 RA (rar) for WAS to use instead of the builtin 9.1.0.7 RA.9.2.0.4 is the latest and you can download the java-all package to obtain the rar file.\n"} +{"text": "### Human: I've one application in which I'm trying to process a file which contains 500k transactions, the processing of file completes in 3 minutes and the timeout is set to 15 minutes, still getting timeout exception during commit.Getting Below Exception in Websphere System Logs while committing the transaction from my code in spring, due to which all the transactions are rolledback;XATransaction E J2CA0027E: An exception occurred while invoking end on an XA Resource Adapter from DataSource JMS$FundtechQConFactory$JMSManagedConnection@75, within transaction ID {\u200b\u200b\u200bXidImpl: formatId(57415344), gtrid_length(36), bqual_length(54),\ndata(0000017bdaabecde0000000b6a6fc584d5dba62aea917f1902693232b82dd8a4ff309f370000017bdaabecde0000000b6a6fc584d5dba62aea917f1902693232b82dd8a4ff309f37000000010000000000000000000000000097)}\u200b\u200b\u200b : javax.transaction.xa.XAException: The method 'xa_end' has failed with errorCode '106'.\nat com.ibm.mq.jmqi.JmqiXAResource.end(JmqiXAResource.java:559)\nat com.ibm.ejs.jms.JMSManagedSession$JMSXAResource.end(JMSManagedSession.java:1410)\nat com.ibm.ejs.j2c.XATransactionWrapper.end(XATransactionWrapper.java:623)\nat com.ibm.ws.Transaction.JTA.JTAResourceBase.end(JTAResourceBase.java:254)\nat com.ibm.tx.jta.impl.RegisteredResources.sendEnd(RegisteredResources.java:1154)\nat com.ibm.tx.jta.impl.RegisteredResources.distributeEnd(RegisteredResources.java:1130)\nat com.ibm.tx.jta.impl.TransactionImpl.distributeEnd(TransactionImpl.java:1748)\nat com.ibm.tx.jta.impl.TransactionImpl.prepareResources(TransactionImpl.java:1478)\nat com.ibm.ws.tx.jta.TransactionImpl.stage1CommitProcessing(TransactionImpl.java:630)\nat com.ibm.tx.jta.impl.TransactionImpl.processCommit(TransactionImpl.java:1040)\nat com.ibm.tx.jta.impl.TransactionImpl.commit(TransactionImpl.java:974)\nat com.ibm.ws.tx.jta.TranManagerImpl.commit(TranManagerImpl.java:439)\nat com.ibm.tx.jta.impl.TranManagerSet.commit(TranManagerSet.java:191)\nat com.ibm.ws.tx.jta.UserTransactionImpl.commit(UserTransactionImpl.java:307)\nat org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1035)\nat org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:743)\nat org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:711)\n\n\n\n\nXATransaction E J2CA0027E: An exception occurred while invoking rollback on an XA Resource Adapter from DataSource JMS$FundtechQConFactory$JMSManagedConnection@206, within transaction ID {\u200b\u200b\u200bXidImpl: formatId(57415344), gtrid_length(36), bqual_length(54),\ndata(0000017bdaabecde0000000b6a6fc584d5dba62aea917f1902693232b82dd8a4ff309f370000017bdaabecde0000000b6a6fc584d5dba62aea917f1902693232b82dd8a4ff309f37000000010000000000000000000000000003)}\u200b\u200b\u200b : javax.transaction.xa.XAException: The method 'xa_rollback' has failed with errorCode '-4'.\nat com.ibm.mq.jmqi.JmqiXAResource.rollback(JmqiXAResource.java:874)\nat com.ibm.ejs.jms.JMSManagedSession$JMSXAResource.rollback(JMSManagedSession.java:1201)\nat com.ibm.ejs.j2c.XATransactionWrapper.rollback(XATransactionWrapper.java:1328)\nat com.ibm.tx.jta.impl.JTAXAResourceImpl.rollback(JTAXAResourceImpl.java:381)\nat com.ibm.tx.jta.impl.RegisteredResources.deliverOutcome(RegisteredResources.java:1718)\nat com.ibm.tx.jta.impl.RegisteredResources.distributeOutcome(RegisteredResources.java:2004)\nat com.ibm.tx.jta.impl.RegisteredResources.distributeRollback(RegisteredResources.java:2657)\nat com.ibm.tx.jta.impl.TransactionImpl.internalRollback(TransactionImpl.java:1973)\nat com.ibm.tx.jta.impl.TransactionImpl.internalRollback(TransactionImpl.java:1936)\nat com.ibm.tx.jta.impl.TransactionImpl.coreStage2CommitProcessing(TransactionImpl.java:1156)\nat com.ibm.tx.jta.impl.TransactionImpl.stage2CommitProcessing(TransactionImpl.java:1183)\nat com.ibm.tx.jta.impl.TransactionImpl.processCommit(TransactionImpl.java:1044)\nat com.ibm.tx.jta.impl.TransactionImpl.commit(TransactionImpl.java:974)\nat com.ibm.ws.tx.jta.TranManagerImpl.commit(TranManagerImpl.java:439)\nat com.ibm.tx.jta.impl.TranManagerSet.commit(TranManagerSet.java:191)\nat com.ibm.ws.tx.jta.UserTransactionImpl.commit(UserTransactionImpl.java:307)\nat org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1035)\nat org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:743)\nat org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:711)### Assistant: Error code106that you get on xa.end isXA_RBTIMEOUT.\nThis means that the resource manager has rolled back the transaction due to exceeding a timeout.Error code-4that you get on xa.commit isXAER_NOTA.\nThis means that the transaction xid isn't valid anymore, which makes sense given the previous error - because transaction branch was already rolled back due to the timeout.It is important to be aware that transaction timeouts can be set at various levels. WebSphere Application Server has aglobal transaction lifetime timeout. Various resource providers will often have their own timeout settings (I'd recommend checking if MQ does) which can cause them to time out their transaction branches prior to the overall transaction. Applications can specify a transaction timeout onUserTransaction, although it appears in this case you are going through Spring, which might be specifying that value, so also look into Springs settings for transaction timeout.\n"} +{"text": "### Human: We have requirement, as per design, third party systems will push XML\\CSV messages to IBM MQ queues, and we using Azure logic app need to consume those messages and send to Event hub.My question isAs we dont have MQ available yet, and I am not able to give details in Azure and using Azure queues. Is there anyway we can mock like we are using MQ.Logic app once receive messages XML can it store to Data lake instead of pushing through Eventhub(as Event hub storing message in AVRO format)Any suggestions please.Thanks### Assistant: As suggested by Roger, you can installthe developer version of IBM MQto mock for Logic App testing.Once the IBM MQ Queue is available, you canSend message from an on premise IBM MQ to Azure Service Bus queueand also able to Transform and Validate XML for workflows in Logic Apps.You can refer toConnect to an IBM MQ server from a workflow in Azure Logic Apps,Transform XML for workflows in Azure Logic AppsandValidate XML for workflows in Azure Logic Apps\n"} +{"text": "### Human: I have a container with IBM MQ (Docker imageibmcom/mq/9.2.2.0-r1) exposing two ports (9443 - admin, 1414 - application).All required setup in OpenShift is done (Pod, Service, Routes).There are two routes, one for each port.https://route-admin.my.domainhttps://route-app.my.domainpointing to the ports accordingly (external ports are default http=80, https=443).Admin console is accessible through the first route, hence, MQ is up and running.I tried to connect as a client (JMS 2.0,com.ibm.mq.allclient:9.2.2.0) using standard approach:var fctFactory = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\n var conFactory = fctFactory.createConnectionFactory();\n\n // ... other props\n\n conFactory.setObjectProperty(WMQConstants.WMQ_HOST_NAME, \"route-app.my.domain\");\n conFactory.setObjectProperty(WMQConstants.WMQ_PORT, 443);and failed to connect. Also tried to redefine route as HTTP and use port 80, and again without success.If it helps let's assume we use the latest version of MQ Explorer as a client.Each time the same connection error appears:...\nCaused by: com.ibm.mq.MQException: JMSCMQ0001: \n IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2009' ('MQRC_CONNECTION_BROKEN').\n... \nCaused by: com.ibm.mq.jmqi.JmqiException: \n CC=2;RC=2009;AMQ9204: Connection to host 'route-app.my.domain(443)' rejected.\n [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2009;AMQ9208: \n Error on receive from host 'route-app.my.domain/10.227.248.2:443 (route-app.my.domain)'.\n [1=-1,2=ffffffff,3=route-app.my.domain/10.227.248.2:443 (route-app.my.domain),4=TCP]],\n 3=route-app.my.domain(443),5=RemoteConnection.receiveTSH]\n...\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2009;AMQ9208: \n Error on receive from host 'route-app.my.domain/10.227.248.2:443Maybe, thisarticlecould give some hints about error code 2009, but still not sure what exactly affects connection errors from the OpenShift side.Previously, I always connected to IBM MQ specifying a port value explicitly, but here is a bit different situation.How to connect to IBM MQ in OpenShift cluster through TCP?Configurations in OpenShift are as follows:kind: Pod\napiVersion: v1\nmetadata:\n name: ibm-mq\n labels:\n app: ibm-mq\nspec:\n containers:\n - resources:\n limits:\n cpu: '1'\n memory: 600Mi\n requests:\n cpu: '1'\n memory: 600Mi\n name: ibm-mq\n ports:\n - containerPort: 1414\n protocol: TCP\n - containerPort: 9443\n protocol: TCP\n containerStatuses:\n image: 'nexus-ci/docker-lib/ibm_mq:latest'\n\n---\n \nkind: Service\napiVersion: v1\nmetadata:\n name: ibm-mq\nspec:\n ports:\n - name: admin\n protocol: TCP\n port: 9443\n targetPort: 9443\n - name: application\n protocol: TCP\n port: 1414\n targetPort: 1414\n selector:\n app: ibm-mq\n\n---\n\nkind: Route\napiVersion: route.openshift.io/v1\nmetadata:\n name: ibm-mq-admin\nspec:\n host: ibm-mq-admin.my-domain.com\n to:\n kind: Service\n name: ibm-mq\n weight: 100\n port:\n targetPort: admin\n tls:\n termination: passthrough\n insecureEdgeTerminationPolicy: None\n wildcardPolicy: None\n\n---\n\nkind: Route\napiVersion: route.openshift.io/v1\nmetadata:\n name: ibm-mq-app\nspec:\n host: ibm-mq-app.my-domain.com\n to:\n kind: Service\n name: ibm-mq\n weight: 100\n port:\n targetPort: application\n tls:\n termination: passthrough\n insecureEdgeTerminationPolicy: None\n wildcardPolicy: None\n\n---UPDATE:Ended up with creating and deploying to OpenShift a small web-application receiving HTTP requests and interacting with MQ via JMS (put/get text messages), like:POST /queue/{queueName}/send + ;GET /queue/{queueName}/receive.It interacts with MQ inside the OpenShift cluster using TCP, and accepts external HTTP connections as a regular web application.Other solutions seem to take too much efforts, but I accepted one of them as it is theoretically correct and straightforward.### Assistant: I'm not sure to fully understand your setup, but\"Routes\"only route HTTP traffic (On ports 80 or 443 onyl), not TCP traffic.If you want to access your MQ server from outside the cluster, there are a few solutions, one is to create a service of type:\"NodePort\"Doc:https://docs.openshift.com/container-platform/4.7/networking/configuring_ingress_cluster_traffic/configuring-ingress-cluster-traffic-nodeport.htmlYour Service is not a NodePort Service. In your case, it should be something likekind: Service\napiVersion: v1\nmetadata:\n name: ibm-mq\nspec:\n type: NodePort\n ports:\n - port: 1414\n targetPort: 1414\n nodePort: 30001\n selector:\n app: ibm-mqThen access from outside with anyname.:30001And delete the useless corresponding route. As said before, I assumed you read in the doc I pointed to you that says that route only route HTTP traffic on port 80 or 443.Doc:https://kubernetes.io/docs/concepts/services-networking/service/#nodeport\n"} +{"text": "### Human: I am fetching messages from an IBM MQ using .Net C# IBM.XMS library. I can receive the messages (IMessage) and I am able to get the message and save the file when its sent as text. I use the .Text property. However I don't know how to save get the message if its sent in say zip. I try to see if I can get the byte[] body and save it as a file. Any suggestions on how to do it?message = consumer.Receive(TIMEOUTTIME);\n if (message != null)\n {\n _log.LogInformation(\"Message received.\");\n var fileName = _fileUtil.GenerateFileName(_queueName);\n\n int receivedBytes = 0;\n if (message is ITextMessage)\n {\n var msg = (ITextMessage)message;\n var result = msg.Text;\n\n }\n else if (message is IBytesMessage)\n {\n var msg = (IBytesMessage)message; \n byte[] result = msg...\n (how to get the bodys byte array)\n ...\n File.WriteAllBytes(filepath, result); \n \n }### Assistant: You can useReadBytesmethod to read message payload.Int32 ReadBytes(Byte[] array, Int32 length);Read an array of bytes from the bytes message stream starting from the current position of the cursor. The method returns the number of bytes read into the buffer you pass.\n"} +{"text": "### Human: Using IBM's sample code, I am able to connect to a single instance queue manager, and I am able to connect to a single instance of a multi-instance queue manager, but I cannot connect to the multi-instance queue manager.I am using version 9.2 of ibm-mq-client.When I use a single server as the host name everything works, but if I change it to a list (\"iib-mq1.it.wd.com,iib-mq2.it.wd.com\") it fails at the line:MQQueueManager qMgr = new MQQueueManager(qManager, connectionProperties);with the error:2298 MQRC_FUNCTION_NOT_SUPPORTEDMy code:using IBM.WMQ;\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Windows.Forms;\n\nnamespace QueueInterface\n{\nclass MQSample\n{\n // The type of connection to use, this can be:-\n // MQC.TRANSPORT_MQSERIES_BINDINGS for a server connection.\n // MQC.TRANSPORT_MQSERIES_CLIENT for a non-XA client connection\n // MQC.TRANSPORT_MQSERIES_XACLIENT for an XA client connection\n // MQC.TRANSPORT_MQSERIES_MANAGED for a managed client connection\n\n const String connectionType = MQC.TRANSPORT_MQSERIES_MANAGED;\n\n // Define the name of the queue manager to use (applies to all connections)\n const String qManager = \"TST_MQMI_QM\";\n\n // Define the name of your host connection (applies to client connections only)\n //const String hostName = \"iib-mq1.it.wd.com\";\n const String hostName = \"iib-mq1.it.wd.com,iib-mq2.it.wd.com\";\n\n // Define the name of the channel to use (applies to client connections only)\n const String channel = \"FHS.IIB.TS\";\n\n const String userName = \"iib-tst-usr\";\n const String password = \"randomPassword\";\n const String port = \"1212\";\n const String queue = \"TEST.ADD.FULL\";\n\n\n /// \n /// Initialise the connection properties for the connection type requested\n /// \n /// One of the MQC.TRANSPORT_MQSERIES_ values\n static Hashtable init(String connectionType)\n {\n Hashtable connectionProperties = new Hashtable();\n\n // Add the connection type\n connectionProperties.Add(MQC.TRANSPORT_PROPERTY, connectionType);\n\n // Set up the rest of the connection properties, based on the\n // connection type requested\n switch (connectionType)\n {\n case MQC.TRANSPORT_MQSERIES_BINDINGS:\n break;\n case MQC.TRANSPORT_MQSERIES_CLIENT:\n case MQC.TRANSPORT_MQSERIES_XACLIENT:\n case MQC.TRANSPORT_MQSERIES_MANAGED:\n connectionProperties.Add(MQC.HOST_NAME_PROPERTY, hostName);\n connectionProperties.Add(MQC.PORT_PROPERTY, port);\n connectionProperties.Add(MQC.CHANNEL_PROPERTY, channel);\n connectionProperties.Add(MQC.USER_ID_PROPERTY, userName);\n connectionProperties.Add(MQC.PASSWORD_PROPERTY, password);\n connectionProperties.Add(MQC.USE_MQCSP_AUTHENTICATION_PROPERTY, true);\n break;\n }\n\n return connectionProperties;\n }\n /// \n /// The main entry point for the application.\n /// \n [STAThread]\n static int Main(string[] args)\n {\n try\n {\n Hashtable connectionProperties = init(connectionType);\n\n // Create a connection to the queue manager using the connection\n // properties just defined\n MQQueueManager qMgr = new MQQueueManager(qManager, connectionProperties);\n\n // Set up the options on the queue we want to open\n int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT;\n\n // Now specify the queue that we want to open,and the open options\n MQQueue system_default_local_queue = qMgr.AccessQueue(queue, openOptions);\n\n // Define an IBM MQ message, writing some text in UTF format\n MQMessage hello_world = new MQMessage();\n \n hello_world.WriteUTF(\"Sample Message\");\n \n // Specify the message options\n MQPutMessageOptions pmo = new MQPutMessageOptions(); // accept the defaults,\n // same as MQPMO_DEFAULT\n\n // Put the message on the queue\n system_default_local_queue.Put(hello_world, pmo);\n\n // Close the queue\n system_default_local_queue.Close();\n\n // Disconnect from the queue manager\n qMgr.Disconnect();\n }\n\n //If an error has occurred,try to identify what went wrong.\n\n //Was it an IBM MQ error?\n catch (MQException ex)\n {\n Console.WriteLine(\"An IBM MQ error occurred: {0}\", ex.ToString());\n }\n\n catch (System.Exception ex)\n {\n Console.WriteLine(\"A System error occurred: {0}\", ex.ToString());\n }\n\n return 0;\n }//end of start\n}//end of sample\n}### Assistant: Instead of specifying a host and port you need to specify a connection name list. In below example I removed the variables to keep it simple.Change:connectionProperties.Add(MQC.HOST_NAME_PROPERTY, \"iib-mq1.it.wd.com,iib-mq2.it.wd.com\");\nconnectionProperties.Add(MQC.PORT_PROPERTY, 1212);To:connectionProperties.Add(MQC.CONNECTION_NAME_PROPERTY,\"iib-mq1.it.wd.com(1212),iib-mq2.it.wd.com(1212)\")\n"} +{"text": "### Human: Its known that the queue manager properties give the location for the ssl keystore files that the queue manager is currently using.\nHowever is there a way to get the certificate details like cert serial, expiry etc that is been CURRENTLY used by the queue manager.openssl and gsk comands query and give only the certificate details in the ssl keystore. However,Am asking this because, suppose if there is a certificate renewal happenned and suppose if there is NOT a refresh (refresh security type(ssl)) done at MQ, then it would only have the old certificate details in it.So I need a command or script where I can get the output as the currently used certificate details by the queue manager. Please assist.### Assistant: I don't think there is functionality exactly what you are asking for.You could determine what certificate your queue manager should be using by looking at the certificate label set in the QMGR CERTLABL setting and then using that in openssl/gsk commands to query the keystore. For example:In MQSC:DISPLAY QMGR CERTLABLon the command line:runmqakm -cert -details -db -stashed -label I added the jar file com.ibm.mq.allclient.jar into the lib folder of ActiveMQ. When running the program, I am getting this exception:\njava.lang.ClassNotFoundException: javax.jms.JMSRuntimeExceptionIt sounds like I am missing the websphere jar file? Is this correct?### Assistant: I use both IBM MQ and ActiveMQ on a regular basis. This example below will show you some sample configuration options. Please make sure you configure these to your own use cases.//ActiveMQ connection factory\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n//IBM MQ connection factory\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n"} +{"text": "### Human: I was looking to see if there are ways to collect MQ object details other than names using PCF commands. For E.g. If I would like see where a QAlias is pointing to or the Target base object, how do I generate a PCF command to accomplish this??### Assistant: Use the information in the link that Morag gave you and then you need to do something like:agent = new PCFMessageAgent(qMgrName);\nrequest = new PCFMessage(MQConstants.MQCMD_INQUIRE_Q);\nrequest.addParameter(MQConstants.MQCA_Q_NAME, \"*\");\nrequest.addParameter(MQConstants.MQIA_Q_TYPE, MQConstants.MQQT_ALIAS);\nrequest.addParameter(MQConstants.MQIACF_Q_ATTRS,\n new int [] { MQConstants.MQCA_Q_NAME, MQConstants.MQCA_BASE_NAME });\nresponses = agent.send (request);\n"} +{"text": "### Human: While testing my application, I tried with a string taking space of some 200KB. Butamqsputdivided my request in multiple chunks. I am not sure why it's happening. If I reduce the size to some 100KB then it works fine.I am using following command to push data into the message queue:amqsput MESSAGE_QUEUE MQM < /home/usr/sampleRequest.xmlThissampleRequest.xmlcontains an XML formatted as one line. I don't know much about MQ admins/configuration and want an idea what's wrong.Why it's dividing my data and push it to queue when file size is greater than a certain value.### Assistant: amqsput & amqsget are simple applications for putting and getting small messages to and from a queue. If you look at the code for amqsput (i.e. amqsput0.c), you will see that the buffer size used is 65535 (64KB).There are lots of programs that are better suited for your type of testing. There is a long list of C sample MQ applicationshere. The 2 that you might want to use are file2msg and msg2file. There is also Paul Clarke'sQLoadprogram (it used to be SupportPac).\n"} +{"text": "### Human: I have a Java program which is publishing new Topics (Orders) as they are created. When the order is updated the changed Order object is re-published. Sample code below;Topic topic = topicSes.createTopic(\"/DepartmentA/ProjectB/Orders/\"+ order.getOrderId());\nTopicPublisher topicPub = topicSes.createPublisher(topic); \nObjectMessage om = topicSes.createObjectMessage(order); \nom.setIntProperty(JmsConstants.JMS_IBM_RETAIN, JmsConstants.RETAIN_PUBLICATION); \ntopicPub.send(om);I publish a poison message (Message object with a parameter of 'DEAD') so that existing subscribers know that we are done. However, what I don't understand, is how to dispose of the topic once it is finished, so that new \nsubscribers don't pick it up?On my MQ Explorer session (MQ Manager 7.5), my Topics list is empty. I assume this is because the topics are dynamic. Only when I right click on[Topics]and choose[Status...]do I see my Topic Strings. If I right click on a Topic String and choose[Clear Local Retained Publication...]the Topic does finally disappear. I say finally, in that it is not immediate, it takes around 30 minutes disappear.Ideally I would like to dispose of the Topic String programmatically in JMS, or MQ Java libraries or MQ PCF. How do I do this? (I cannot use TemporaryTopics as the publishing process could go down/up during the lifecycle of the Order).I also tried querying and clearing the Topics via \"runmqsc\". What I don't understand is;ForDISPLAY TOPIC; what is the syntax to display a Topic String - The syntax states it should beDISPLAY TOPIC (topic) TOPICSTR(string), but for the given string \"/DepartmentA/ProjectB/Orders/123\", I have tried all sorts of combinations but nothing works for me. I can only seem get it to work for managerd Topics.ForCLEAR TOPICSTR, I can put anything as the Topic String parameter and \"runmqsc\" never complains, but even if the string is correct, it still does nothing. What should the correct syntax be for CLEAR TOPICSTR?Should I have made \"/DepartmentA\" a Managed Topic?### Assistant: The default TREELIFE is 30 mins and you can change the TREELIFE interval. Check the following MQ infocenter URL for details.http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.pla.doc/q005060_.htm?lang=en\n"} +{"text": "### Human: I'm trying to figure out how to check what mode one of my IBM WebSphere MQ installations is running in.In particular, I need to find out if this particular installation is running in Native Mode or JMS Mode.I thought maybe I could find an answer using one of the provided IBM MQ CLI commands foundHERE, but none of them seem to tell you what mode the installation is running in, or even how to change the mode.Does anyone have any advice or guidance on how to detect what mode my installation is running in?### Assistant: The client may use the JMS client OR the native client to connect to WMQ.The server always runs in the same mode - and can handle both native and JMS.\n"} +{"text": "### Human: I am using following command to push some data into a Message Queue.amqsput QUEUE_NAME QUEUE_MANAGER_NAMEThen after console available I push my required data. (just shown in the screenshot, I will copy my data now).Since there is a wait involved, Like I first I need to make sure that it connected with the queue through that queue manger then I push my data. Which successfully works.How can I do it through a shell script?Update:In shell script I can try following#!/bin/ksh \n /opt/mqm/samp/bin/amqsput QUEUE_NAME QUEUE_MANAGER_NAME < /filepath/data.txtBut I can't push string. After < it expects a file.Any help?### Assistant: Theamqsputis a sample IBM MQ application. Source code,amqsput0.c, for this sample application is shipped with product. You can modify this sample per your requirement.\n"} +{"text": "### Human: We're building a system that will be sending messages from one application to another via JMS (Using Websphere MQ if that matters). These messages are of the form \"Create x\" or \"Delete x\". (The end result of this is that a third-party system needs to be informed of the Create and Delete messages, so the Read end of the JMS queue is going to talk to the third-party system, whilst the Write end of the JMS queue is just broadcasting messages out to be handled)The problem that we're worried about here is if one of the messages fails. The initial thought here was simply to roll the failures back onto the JMS queue and let the normal retry mechanism handle it. That works until you get a Delete followed by a Create for the same identifier, e.g.Delete 123 - Fails, gets rolled back on to the queueCreate 123 - SucceedsDelete 123 - Retry from earlier failureThe end result of this is that the third party was told to Create 123 and then immediately to Delete 123, instead of the other way around.Whilst not ideal, from what I've been reading up on it seems that Message Affinity would help here, so that we can guarantee that the messages are processed in the correct order. However, I'm not sure how message affinity will work when messages are processed and failed back onto the queue? (Message Affinity is generally considered a bad idea, but the load here isn't going to be great, and the risk of poison messages is very low. It's simply the risk that the third-party that we're interacting with has a brief outage that we're concerned with)Failing that, are there any better thoughts on how to do this?Edit - Further complications. The system we're building to integrate with the third-party is to replace a system they used from a different supplier until recently. As such, there's a bunch of data that is already in the third-party, but it turns out to be very difficult to actually get this out. (The third-party doesn't even send success/failure messages back, merely an acknowledgement of receipt!), so we don't actually know the initial state of the system.### Assistant: The definitive way to address this is to include in the message a sequence such that the earlier message can't overwrite the later one.Once upon a time, your transactions at the bank were processed in the order they arrived. However, it was this exact problem that caused that to change. People became aware that their account balance could be positively or negatively affected depending on the order in which the transactions were processed. When it was left to chance it was occasionally a problem for people but in general no malice was perceived.Later, banks started to memo-post transactions during the day, then sort them into the order most favorable to the bank prior to processing them. For example, if the largest checks cleared first and the account ran out of money, several smaller checks might bounce, generating multiple bounce fees for the bank. Once this was discovered to have become widespread practice, it was changed to always apply the transactions in the order most favorable to the account holder. (At least here in the US.)This is a common problem and it's been solved many times, the first being decades ago. There really is no excuse anymore for an Enterprise-grade application to bothUse asynchronous messaging in which delivery order by design cannot be guaranteed, andContain an inherent dependency on delivery order to assure the integrity of the transactions and data.The mention of message affinities hints at the solution to this when approached as a transport problem. To guarantee message order delivery requires the following:One and only one sender of messagesOne and only one node from which messages are sent.One and only one path between sender and receiver of messages.One and only one queue at which messages are received.All messages processed under syncpoint.The ability to pend processing of any messages whilst an orphaned transaction exists (connection exception handling).No backout queue on the input queue.No DLQ if the messages traverse a channel.No use of Priority delivery on any queue along the path.One and only one receiver of messages.No ability to scale the application other than by adding CPU and memory to the node(s) hosting the QMgr(s).Or the problem could be addressed in the application design using memo posting, compensating transactions, or any of the other techniques commonly used to eliminate sequence dependencies.(Side note: If the application in question is an off-the-shelf vendor package this would seem to me to create a credibility issue. No application can claim to be robust if something so commonplace as a backed out message can mess with data integrity.)\n"} +{"text": "### Human: I have a requirement, where I need to use IBM websphere message queue pub sub functionality.\nBasically I have to write the subscriber part.\nI need to know what all programming languages I can use to write the API other than java.\nCan I write it using perl/shell/python?### Assistant: There isPyMQIavailable for Python lovers. But note this offering isNOTfrom IBM.\n"} +{"text": "### Human: I have been tasked with writing a custom application in C#.NET to move messages from one queue to another, while keeping all of the context and identity information the same as the original message.I have tried to decipher the online docs, and have tried every combination ofMQC.MQOO_PASS_ALL_CONTEXTandMQOO_SAVE_ALL_CONTEXTin opening queues, andMQC.MQPMO_PASS_ALL_CONTEXTin put calls, to no avail. I have tried setting theMQPutMessageOptions.ContextReferenceto both the source and the \ndestination queues, but I continue to get exceptions, eitherMQRC_CONTEXT_HANDLE_ERRORorMQRC_OPTIONS_ERROR, and I cannot find enough information in the online docs to determine the problem.I am using runtime version v2.0.50727, Version 7.5.0.1 of the amqmdnet.dll. If anyone knows the correct open and/or put message option settings I need to use, I would appreciate the leg up. Thanks.***** SECOND UPDATE *****Here is a very simple gui program to test the classes, and I get the same results:public partial class frmMain : Form\n{\n // Simple test - all data hard-coded\n\n string sourceQStr = \"PETE.TQ1\";\n string targetQStr = \"PETE.TQ2\";\n string targetMsgIdStr = \"414D5120514D4942584330352020202028ED0155202EB302\";\n string connName = \"localhost\";\n string connPort = \"1414\";\n\n\n MQQueueManager sourceManager;\n MQQueueManager targetManager;\n MQQueue sourceQueue;\n MQQueue targetQueue;\n\n MQMessage msg = new MQMessage();\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n MQPutMessageOptions pmo = new MQPutMessageOptions();\n\n\n public frmMain()\n {\n InitializeComponent();\n }\n\n private void Form1_Load(object sender, EventArgs e)\n {\n\n }\n\n private void txtPassword_Validating(object sender, CancelEventArgs e)\n {\n\n if (txtPassword.Text.Trim() != string.Empty)\n {\n if (LoginUser())\n btnTest.Focus();\n else\n txtUserId.Focus();\n }\n }\n\n public void LogoutUser()\n {\n txtUserId.Text = \"\";\n txtPassword.Text = \"\";\n btnTest.Enabled = false;\n\n }\n\n public bool LoginUser()\n {\n bool OK = ValidateUserAndPassword();\n if (OK)\n {\n btnTest.Enabled = true;\n }\n else LogoutUser();\n return OK;\n }\n\n private bool ValidateUserAndPassword()\n {\n if ((txtUserId.Text.Trim() == string.Empty) || (txtPassword.Text.Trim() == string.Empty))\n return false;\n try\n {\n bool _passwordValid = false;\n ContextOptions options = ContextOptions.SimpleBind | ContextOptions.SecureSocketLayer;\n using (PrincipalContext pc = new PrincipalContext(ContextType.Domain, \"UP\"))\n {\n _passwordValid = pc.ValidateCredentials\n (txtUserId.Text.Trim(), txtPassword.Text.Trim(), options);\n }\n if (!_passwordValid)\n MessageBox.Show(\"Invalid username / password\", \"Invalid\", \n MessageBoxButtons.OK, MessageBoxIcon.Error);\n return _passwordValid;\n }\n catch (PrincipalServerDownException pex)\n {\n string msg = pex.Message.Insert(pex.Message.IndexOf(\"server\"), \"Authentication \");\n MessageBox.Show(msg, \"Error\", MessageBoxButtons.OK, MessageBoxIcon.Error);\n return false;\n }\n catch (Exception ex)\n {\n MessageBox.Show(ex.Message, \"Error\", MessageBoxButtons.OK, MessageBoxIcon.Error);\n return false;\n }\n }\n\n private void btnTest_Click(object sender, EventArgs e)\n {\n try\n {\n SetupObjects();\n sourceQueue.Get(msg, gmo);\n targetQueue.Put(msg, pmo);\n sourceManager.Commit();\n targetManager.Commit();\n MessageBox.Show(\"Test appears successful - verify with MQ Explorer\",\"OK\", \n MessageBoxButtons.OK, MessageBoxIcon.Exclamation);\n }\n catch (Exception ex) // MQRC_CONTEXT_HANDLE_ERROR is always thrown\n {\n MessageBox.Show(\"Error: \" + ex.Message, \"Error\", MessageBoxButtons.OK, MessageBoxIcon.Error);\n sourceManager.Backout();\n targetManager.Backout();\n }\n }\n\n private void btnClose_Click(object sender, EventArgs e)\n {\n this.Close();\n }\n\n /************************************** Utiility methods *****************************************/\n\n private void SetupObjects()\n {\n // set up objects\n string connectName = connName + \"(\" + connPort + \")\";\n int ConnOptions = MQC.MQCNO_HANDLE_SHARE_BLOCK;\n\n sourceManager = new MQQueueManager(\"\", ConnOptions, \"CHANNEL1\", connectName);\n targetManager = new MQQueueManager(\"\", ConnOptions, \"CHANNEL1\", connectName);\n\n MQEnvironment.UserId = txtUserId.Text.Trim();\n MQEnvironment.Password = txtPassword.Text.Trim();\n\n int options = \n MQC.MQOO_INPUT_SHARED + MQC.MQOO_FAIL_IF_QUIESCING + \n MQC.MQOO_SAVE_ALL_CONTEXT + MQC.MQOO_INQUIRE;\n sourceQueue = sourceManager.AccessQueue\n (sourceQStr, options, sourceManager.Name, null, txtUserId.Text.Trim());\n options = \n MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING + \n MQC.MQOO_PASS_ALL_CONTEXT + MQC.MQOO_INQUIRE;\n targetQueue = targetManager.AccessQueue\n (targetQStr, options, targetManager.Name, null, txtUserId.Text.Trim());\n\n int i = 0;\n try\n {\n i = sourceQueue.CurrentDepth;\n }\n catch (Exception ex)\n {\n MessageBox.Show(\"Exception: \" + ex.Message, \"Error\", MessageBoxButtons.OK, MessageBoxIcon.Error);\n }\n\n gmo.Options = MQC.MQGMO_COMPLETE_MSG + MQC.MQGMO_FAIL_IF_QUIESCING +\n MQC.MQGMO_NO_WAIT + MQC.MQGMO_SYNCPOINT;\n\n pmo.Options = MQC.MQPMO_PASS_ALL_CONTEXT +\n MQC.MQPMO_SYNCPOINT + MQC.MQPMO_SYNC_RESPONSE;\n pmo.ContextReference = sourceQueue;\n\n msg.MessageId = StringToByteArray(targetMsgIdStr);\n }\n\n public byte[] StringToByteArray(String hex)\n {\n hex = hex.Trim();\n int NumberChars = hex.Length;\n if ((NumberChars % 2) != 0)\n {\n hex = \"0\" + hex;\n NumberChars++;\n }\n byte[] bytes = new byte[NumberChars / 2];\n for (int i = 0; i < NumberChars; i += 2)\n bytes[i / 2] = StringToByte(hex.Substring(i, 2));\n return bytes;\n }\n\n public byte StringToByte(string hexDigits)\n {\n if (hexDigits.Length != 2)\n return 0;\n\n int high = hexValue(hexDigits[0]);\n int low = hexValue(hexDigits[1]);\n\n return (byte)(((high << 4) & 240) | (low & 15));\n }\n\n public int hexValue(char c)\n {\n int retval = 0;\n if (c > '9')\n retval = ((int)c) - 55;\n else\n retval = ((int)c) - 48;\n return retval;\n }\n}The GUI simply prompts for a username and password (which are validated with an LDAP call) and then enables a \"test\" button which runs the btnTest_Click method. I still get the same exception (MQRC_CONTEXT_HANDLE_ERROR) even thought I have used all the open and get message options specified.### Assistant: Adding to Morag's answer, here is snippet for moving messages with context. I am also using a SYNC_POINT to ensure the message is removed from source queue after the message is successfully put to the destination queue./// \n /// Moves messages from one queue to another with context\n /// \n public void moveMessagesWithContext()\n {\n MQQueueManager qmSource = null;\n MQQueueManager qmDestination = null;\n MQQueue qSource = null;\n MQQueue qDestination = null;\n Hashtable htSource = null;\n Hashtable htDestination = null;\n\n try\n {\n htSource = new Hashtable();\n htDestination = new Hashtable();\n\n htSource.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\n htSource.Add(MQC.HOST_NAME_PROPERTY, \"localhost\");\n htSource.Add(MQC.PORT_PROPERTY, 2020);\n htSource.Add(MQC.CHANNEL_PROPERTY, \"A_QM_SVRCONN\");\n qmSource = new MQQueueManager(\"A_QM\", htSource);\n qSource = qmSource.AccessQueue(\"Q_SOURCE\", MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_FAIL_IF_QUIESCING | MQC.MQOO_SAVE_ALL_CONTEXT);\n\n htDestination.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\n htDestination.Add(MQC.HOST_NAME_PROPERTY, \"localhost\");\n htDestination.Add(MQC.PORT_PROPERTY, 3030);\n htDestination.Add(MQC.CHANNEL_PROPERTY, \"B_QM_SVRCONN\");\n qmDestination = new MQQueueManager(\"B_QM\", htDestination);\n qDestination = qmDestination.AccessQueue(\"Q_DESTINATION\", MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING | MQC.MQOO_PASS_ALL_CONTEXT);\n\n MQMessage msgSource = new MQMessage();\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.Options |= MQC.MQGMO_SYNCPOINT;\n qSource.Get(msgSource,gmo);\n if (msgSource != null)\n {\n MQMessage msgDestination = new MQMessage();\n MQPutMessageOptions pmo = new MQPutMessageOptions();\n pmo.ContextReference = qSource;\n qDestination.Put(msgSource, pmo);\n qmSource.Commit();\n }\n }\n catch (MQException mqEx)\n {\n qmSource.Backout();\n Console.WriteLine(mqEx);\n }\n catch (Exception otherEx)\n {\n Console.WriteLine(otherEx);\n }\n }\n"} +{"text": "### Human: Can you please let me know what are difference between websphere MQ class for java vs Websphere MQ classes for JMS?Which of the above should I use to connect to an IBM MQ client for performing distributed transactions (XA)?### Assistant: The JMS API is the JavaEE open standard for a messaging API. IBM MQ v8 now implements the latest version 2.0 JMS standard (MQ 8.0.0.2 has the JMS2.0 errata as well).WMQ Java classes is a proprietary API to provide messaging; it's OO based around classic MQ objects, such as QueueManagers and Queues etc. There are some features such as support for MQ Multi-instance QMs and async call backs that it doesn't have.For any new application I would recommended that you use JMS; if you encounter function that you really need that isn't in JMS please get in contact (RFE).As to XA; what is the transaction co-coordinator that you wish to use? Via JMS you can use a JavaEE server to do the XA co-ordination. Non JavaEE are not supported (though there is an RFE for thinks like Atomikos to be supported).What is the scenario here? Is it full XA that is required or would a single phase transacted JMS Session be sufficient.Via the Java Classes you can only co-ordinate messaging work via the MQ QM. DB2/Oracle can also be co-ordinated.\n"} +{"text": "### Human: We have .NET MQ client sending messages to MQ queues, it works fine. \nOn the receiver end we have a JMS client, which needs to receive BytesMessage. \nI wonder if it's possible for sender to set some MQ headers, so that produced message is always recognized as BytesMessage on receiver end?\nCurrently it defaults to TextMessage.### Assistant: The below snippet can be used to write a bytes message.MQMessage msg = new MQMessage();\n msg.Format = MQC.MQFMT_NONE; // Ensures jms_bytes type message is delivered to JMS application\n msg.WriteBytes(\"HelloWorld in bytes\");\n MQPutMessageOptions pmo = new MQPutMessageOptions();\n queue.Put(msg,pmo);\n"} +{"text": "### Human: Can any one explain about MFT and what is the difference between MFT and Websphere MQ. And why we need MFT even we have MQ.### Assistant: WebSphere MQ MFT (or Managed File Transfer) is a extra, chargable component of WebSphere MQ that allows you to send/receive files between your systems in a managed and auditable way, regardless of file size or the operating systems used. It uses your WebSphere MQ network to do this.WebSphere MQ MFT supersedes the WebSphere MQ File Transfer Edition (FTE) product.Rather than me type all about it here, you should read the \"Product overview\" section in the WebSphere MQ Knowledge Center for the MFT component:http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.wmqfte.doc/wmqfte_intro.htm?cp=SSFKSJ_8.0.0%2F2If you don't want to, or don't have the need to, transfer files over your WebSphere MQ network, you don't need to use MFT.\n"} +{"text": "### Human: I have a java program using javax.jms* classes to publish message to a MQ topic (MQv7.5), few messages goes to DLQ with following details in in DLQ Header,Format 'No Format'\nReason '3023'\n -> 3023 0x00000bcf MQRCCF_MD_FORMAT_ERRORHeader Info in Message:DeadLetter Header Information\nEncoding 'Default Encoding'\nCharacter Set 'ibm1208'\nFormat 'No Format'\nReason '3023'\nDestination Queue Manager 'QMGRSTCRT1'\nDestination Queue ' '\nPut Appl Name 'WebSphere MQ Client for Java'\nPut Appl Type 'Java'\nDate/Time '20150127-19271043'\n\nRFH Header Information \n\nEncoding 'Default Encoding'\nCharacter Set 'ibm1208'\nFlags '0'\nFormat 'No Format'\nName Value Pair 'UNIQUE_CONNECTION_ID', '414D512045414D51534331202020202054B921242739A302 MQPSCommand Publish MQPSTopic CUSTOMER_EVENT MQPSPubOpts NoReg ' \n\nMQMD\n\nPut Date 'Tue Jan 07 13:38:44 CST 2015'\nMessage ID: '414D512045414D51534331202020202054B9212427896148'\nCorrelation ID: '414D512045414D515343312020202020542907882CEF7E04'\nGroup ID: '000000000000000000000000000000000000000000000000'\nAccount Token: '0000000000000000000000000000000000000000000000000000000000000000'\nAppID Data: ' '\nApp Origin Data: ' '\nBackout Count: '0'\nCharacter Set: 'ibm1208'\nExpiry: '14'\nFormat: 'RFH version 1'\nEncoding: 'Default Encoding'\nFeedback: 'None'\nMessage Flags: 'None'\nOffset: '0'\nSequence Number: '1'\nType: 'Datagram'\nPersistence: 'Not Persistent'\nPriority: '4'\nPut Appl Name: 'QMGRSTCRT1 '\nPut Appl Type: '26'\nReply To Queue Manager: 'QMGRSTCRT1 '\nReply To Queue Name: ' '\nReport: 'Default Report Options, New Msg ID, Copy Msg ID to Correlation ID, Dead Letter Q'\nUser ID: 'tempid '\nVersion: '2'\nContent Type: 'writestring'\n\nJMS properties\nJMSDeliveryMode 2\nJMSDestination topic://CUSTOMER_EVENT\nJMSTimestamp 1422387524491\nmcd.Msd jms_object\nJMSExpiration 1422391124491Adding Qmgr logs corresponding to the DLQ message..AMQ5882: WebSphere MQ Publish/Subscribe broker has written a message to the\ndead-letter queue.\n\nEXPLANATION:\nThe broker has written a message to the dead-letter queue\n(SYSTEM.DEADLETTER.QUEUE ) for reason\n'3023:MQRCCF_MD_FORMAT_ERROR'. Note. To save log space, after the first\noccurrence of this message for stream (TEST.PUBSUB\n ), it will only be written periodically.\nACTION:\nIf the message was not deliberately written to the dead-letter queue, for\nexample by a message broker exit, determine why the message was written to the\ndead-letter queue, and resolve the problem that is preventing the message from\nbeing sent to its destination.Code Snippet used in Program..private TopicConnection topicConnection = null;\nprivate TopicSession topicSession = null;\nprivate TopicPublisher topicPub = null ;\nprivate TopicSubscriber topicSub = null ;protected void createTopicPub(String clientID,long msgLifeTime) throws JMSException {\n closeTopicPub();if (topicSession == null)\n createTopicConnectionWithClientID(clientID);\n\n Topic the_topic = (Topic)topicSession.createTopic(topicName);\n topicPub = topicSession.createPub(the_topic); \n topicPub.setDeliveryMode(DeliveryMode.PERSISTENT);\n topicPub.setPriority(4);\n //SET the time to expire the message\n topicPub.setTimeToLive(msgLife); \n topicConnection.start(); \n}\npublic void sendMessage(String msg) throws JMSException {\n TextMessage message = null ;\n if (topicPub == null) {\n throw new JMSException(\"TopicPub is null\");\n }\n message = topicSession.createTextMessage(msg);\n topicPub.publish(message); \n log.debug(\"Message sent\");}private void createTopicConnWithClientID(String clientID) throws JMSException {\n closeTopicConnection(); \n MQTopicConnectionFactory topicCF = new MQTopicConnectionFactory();\n topicCF.setHostName(hostName);\n topicCF.setPort(portNumber);\n topicCF.setQueueManager(queueManager);\n topicCF.setChannel(channel);\n topicCF.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP); \n // create connection and session\n topicConnection = topicCF.createTopicConnection(); \n topicConnection.setClientID(clientID); \n topicSession = topicConnection.createTopicSession(transactional,Session.AUTO_ACKNOWLEDGE);\n}what is causing the MD format error? where is the correction required?### Assistant: This error code,MQRCCF_MD_FORMAT_ERROR, means that the MQMD Format field of the message had a value that was notMQFMT_ADMIN.There are various parts of IBM MQ that expect to be given a message with Format =MQFMT_ADMIN:-Command ServerQueued Pub/SubFrom the provided AMQERR01.LOG error message we can see that the feature in question is the Queued Pub/Sub broker.Since you're on V7.5 you don't need to be using queued pub/sub, you could directly use the topics. You say your application is Java, but don't mention whether it is JMS or not. The use queued pub/sub vs direct use of topics is something made under the covers in JMS, so you might not be aware you are doing it. Check thatPROVIDERVERSIONis set to 7 and not 6.\n"} +{"text": "### Human: I have domain user called xxx\\herath. When I try to add this user in to queue manager's \"Manage Authority Record\" , It is giving meUnknown User 'herath@xxx'. (AMQ4808)\n Severity: 10 (Warning)\n Explanation: The named entity for the given type is not defined on the system.\n Response: Make sure the entity is defined and it matches the type of entity.This user is not in the websphere mq server machine as a local user. So my question is What is the proper way to grant permission to domain users ?### Assistant: You need to run MQ under a domain id if you want to be able to resolve domain ids. Since Microsoft went to Active Directory, an unknown user (aka local user on a server eg musr_mqadmin) is not able to query the group membership of a domain id.https://www.ibm.com/developerworks/community/blogs/aimsupport/entry/websphere_mq_domain_user_securityand the infocenter, e.g.http://www.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.ins.doc/q008840_.htm\n"} +{"text": "### Human: I am trying to set up Multi Instance MQ. I have configured NFS and able to see the active and stand by instances usingdspmq -x. However my doubt is after this setup how to proceed further.How can I configure the channel(s). I gotCONNAMEproperty should be use for this. e.g.CONNAME(,). I am not aware how to do it exactly.How many listeners I need to start.For normal mode of MQ, I follow the below steps:1. crtmqm QM \n 2. strmqm QM \n 3. runmqsc QM \n 4. runmqlsr -m QM -t tcp -p 1125 \n 5. runmqsc QM \n 6. define channel(SYSTEM.ADMIN.SVRCONN) chltype(SVRCONN) mcauser('mqm')For multi-instance MQ, what changes I have to do for the below steps. There are many good documents available for Multi Instance MQ set up, but most of these are limited to how to configure the queue manager with multi-instance. Could anybody please guide me for the remaining steps.Any guidance is much appreciated.EDITThanks Shashi and Morag for the guidance.I have created different listeners on port 1600 in both the servers. I have created the below channel:DEFINE CHANNEL(MYCHANNEL) CHLTYPE(CLNTCONN) TRPTYPE(TCP)\n CONNAME('IP11600),IP2(1600)')DEFINE CHANNEL(MYCHANNEL) CHLTYPE(SVRCONN) TRPTYPE(TCP) MCAUSER(' ')Below is the stand alone java code I am using to put a message in queue.public class MutilInstanceMq \n{\n public static void main(String[] args)\n {\n sendMsg(\"Test Message\");\n }\n\n public static void sendMsg(String msg)\n {\n MQQueueConnectionFactory connectionFactory = null;\n QueueConnection queueConn = null;\n QueueSession queueSession = null;\n QueueSender queueSender = null;\n TextMessage message = null;\n\n try\n {\n connectionFactory = new MQQueueConnectionFactory();\n connectionFactory.setConnectionNameList(\"(1600), (1600)\");\n connectionFactory.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n connectionFactory.setQueueManager(\"MYQM1\");\n connectionFactory.setChannel(\"MYCHANNEL\"); \n queueConn = connectionFactory.createQueueConnection(\" \",\"password\");\n queueSession = queueConn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); \n queueSender = queueSession.createSender(queueSession.createQueue(\"MYQ\")); \n queueSender.setDeliveryMode(DeliveryMode.NON_PERSISTENT); \n message = queueSession.createTextMessage(msg);\n message.setJMSCorrelationID(\"12345\");\n queueSender.send(message); \n queueConn.close(); \n } \n catch (Exception e)\n {\n e.printStackTrace();\n }\n } \n}With the above code I end up with the below exception while creating the connection.> com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0018: Failed to\n> connect to queue manager 'MYQM1' with connection mode 'Client' and\n> host name 'IP1(1600),IP2(1600)'. Check the queue manager is\n> started and if running in client mode, check there is a listener\n> running. Please see the linked exception for more information.Detailed Print stack trace is:com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0018: Failed to connect to queue manager 'MYQM1' with connection mode 'Client' and host name 'IP1(1600),IP2(1600)'. Check the queue manager is started and if running in client mode, check there is a listener running. Please see the linked exception for more information.\n at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:608)\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:236)\n at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:440)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:7062)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6453)\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:295)\n at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6230)\n at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:144)\n at MutilInstanceMq.sendMsg(MutilInstanceMq.java:40)\n at MutilInstanceMq.main(MutilInstanceMq.java:17)\nCaused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2543' ('MQRC_STANDBY_Q_MGR').\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:223)\n ... 8 more\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2543;AMQ9204: Connection to host 'IP2(1600)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2543;AMQ9487: Remote queue manager is a standby queue manager instance. [3=MYCHANNEL]],3=IP2(1600),5=RemoteConnection.analyseErrorSegment]\n at com.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiConnect(RemoteFAP.java:2010)\n at com.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiConnect(RemoteFAP.java:1227)\n at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:355)\n ... 7 more\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2059;AMQ9204: Connection to host 'IP1(1600)' rejected. [3=IP1(1600)]\n at com.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiConnect(RemoteFAP.java:1980)\n ... 9 moreWhere I am going wrong? Meanwhile I have turned off channel authentication and able to connect to the queue.### Assistant: To answer your explicit questions:If you want to use the comma-separatedCONNAMEmethod, then you'll end up with something like this.CONNAME('machine1(1234),machine2(1234)'). You should have the same port number in both.You have two options here. Either use runmqlsr on each machine - so you have two listeners, on the same port. The purpose of the one on the primary machine is for connections to be able to connect to the queue manager. The purpose of the one on the standby machine is to reject connections which try to connect there more quickly than they could be rejected by TCP working out that there is no listener. It also means that the error reported by the connection for the reason it could not connect is much more explicit - \"This machine is the standby\" rather than \"no TCP listener here\".\nThe alternate option is to define aLISTENERobject and have it controlled by the queue manager, this way it will only run where the queue manager runs. This keeps the configuration all within the queue manager, but does mean you don't get the benefits outlined above.\n"} +{"text": "### Human: I have a tibco activity which is giving this output in Byte.Now i have to use this in my java code and send it to Mainframe Queue.I am taking it as aString bwmsg=\"wcLDxMXGx8=\"and in my main method...byte[] bArray = bwmsg.getBytes();\nBytesMessage bytmsg = session.createBytesMessage(); \nbytmsg.writeBytes(bArray);\nmqSender.sendToMQ(bytmsg,connection,sender,session);OUTPUT: 77634c44784d584778383dAm i doing wrong? \nSomething which is already a byte I am reading it as a string and then again getting the bytes out of it and doing the workaround. Is this wrong?If yes, can you please tell how can I take thatbwmsgfield as bytes and pass it on to the method.I have Googled many links but not good help from them.### Assistant: This has nothing to do with Base64. This is simple programming 101.You started with a string then converted it to a byte array and finally you printed out the byte array.What do you expect to see? You should expect to see a byte array.i.e.\n\"wcLDxMXGx8=\" is \"77634c44784d584778383d\"Let me spell it out:\"w\" = 0x'77'\n\"c\" = 0x'63'\n\"L\" = 0x'4c'\n\"D\" = 0x'44'\n\"x\" = 0x'78'\n\"M\" = 0x'4d'\n\"X\" = 0x'58'\n\"G\" = 0x'47'\n\"x\" = 0x'78'\n\"8\" = 0x'38'\n\"=\" = 0x'3d'If you want it in human-readable format then convert the byte array back to a string and then print it out.i.e. new String(bytmsg)\n"} +{"text": "### Human: My application (.NET-based) gets messages from a queue in a multithreaded fashion and I'm worried about the fact that I may receive messages in an out-of-order manner because one thread can be quicker than the other, for instance, given the following queue state:[Message-5 | Message-4 | Message-3 | Message-2 | Message-1]In a multithreaded operation,msg #2may arrive beforemsg #1, even thoughmsg #1was first in the queue, due to many threading issues (thread time slices, thread scheduling etc).In such a situation, it would be great if a message that is inside the queue have already stamped with an ordinal/sequence number when it was enqueued and even if I get the messages in an out of order fashion, I can still order them at some point within my application using their given ordinal-number attribute.Any known mechanism to achieve it in aWebsphere MQenvironment?### Assistant: You have 2 choices:(1) Use Message Grouping in MQ as whitfiea mentioned or(2) Change you application to be single threaded.Note: If the sending application does not set the MQMD MsgId field then the queue manager will generate a unique number (based on queue manager name, date & time) and store it in the message's MQMD MsgID field.\n"} +{"text": "### Human: I have a MQ Server setup in windows . I have a client application program which connects to this server. \nI have created a QManager using my MQ explorer 7.1 .\n Created the local queues . \nCreated the Server Connection Channel with MCA as * ( for all users).\nCreated the Client Connection Channel - with QManager name , Connection name as [hostname(port)] ,The problem here is that on checking the Server COnnection Channel Status , it is always showing as Inactive . \nTried using a sample client program to connect to MQ Server but it gave 2058 error.I am not sure if I have created the Connection Channels successfully or not. \nAny help would be great.### Assistant: Creating a server-connection channel (SVRCONN) is the correct type. However MCAUSER set as * will cause you problems once you manage to connect. Your SVRCONN channel must be named to match what you supplied in the MQSERVER environment variable.If you are using the MQSERVER environment variable then the CLNTCONN channel wasn't needed. It is used to build a CCDT.The channel status will only show as running once you manage to connect.Make sure you started a listener on the same port as you put in the MQSERVER environment variable.\n"} +{"text": "### Human: I have interesting challenge of having to publish a message to a Topic in one environment and having to send a message to a Queue in another one. Both the environments needs to have the same code base. Is there any way to determine at run time if the target is a queue or a topic and invoke code to send to topic or queue accordingly?### Assistant: Queue and Topic extend Destination. So if you have an instance of Destination you can useinstanceofto determine if it's a Queue or a Topic\n"} +{"text": "### Human: I'd like my Integration Bus flow instance to be able to switch the reading from/writing to multiple queue managers, which are all active at the same time, all having the same queue definitions. Much like having a multi-instance QM, but the QMs in this case would not be related, and I would like to read for instance in sequence from the QMs.A clean solution would be to use a single JMSInput node per flow, so I'm wandering if that is possible by using CCD tables.### Assistant: The usual advice for anything that listens on a well-known queue (for example, something servicing the requests in a Request/Reply scenario as is usually the case for Broker flows) is that it does not fail over from queue to queue. There are many reasons for this but the main ones are that this precludes transactionalGETand that it is possible to end up with un-served queues where messages build up and are not processed.Although it is possible to have a server app do a round-robin as you are describing, theCONNECT/DISCONNECToperations aremuchmore expensive than are theGET/PUToperations. The result is that a flow that serviced many queues in rotation would perform orders of magnitude more slowly than an Execution Group with multiple flow instances where each is pointed at a different queue instance.If there is any need to secure those broker connections, the channel will probably use TLS and mutual authentication. That compounds theCONNECT/DISCONNECTdelay to as much as a second or more per connection attempt. Since the TLS handshake only occurs on the connection and not per-message, this is of little consequence in the normal model of 'one queue per flow'. However, in a round-robin connection scheme you'd be lucky to get 1 message per-second per-queue. This is, of course, true of any TLS connection and not specific to WMQ.\n"} +{"text": "### Human: I have got a requirement to test an application which upgrades from web methods 8.2 to 9.5 in ESB.While I tried to understand what is an ESB, I assume that ESB can be of 2 types - Web Sphere Enterprise Service Bus V6.0.2 and Web Sphere Message Broker V6.0.0.3.Now what does the Term web methods imply ? What is the relation between the 3 terms - Web Sphere Enterprise Service Bus, Web Sphere Message Broker aESBnd Web Methods ?I tried to google and in some places, it is mentioned as broker is part of ESB and some places, it is like we can use either broker or esb ... But I am still not clear how this 3 terms are related with each other.Please clarify### Assistant: There is no connection between WebMethods and WebSphere products. WebMethods is an ESB made by SoftwareAG. ESB is a generic term for referring to messaging busses (let's say software for transferring messages). Latest version seems to be 9.5. Your requirement is to upgrade their ESB (that is WebMethods) from version 8.2 to 9.5.WebSphere Message Broker is also an ESB. This one is made by IBM. So is WebSphere Enterprise Service Bus, but this one is made to cover other use cases. The later is discontinued, and the former is being renamed to IBM Integration Bus.\n"} +{"text": "### Human: i am using Websphere MQ 7.1. I want to create pub/sub and i need to define a topic\nlike \"DEPARTMENT\" with following structureDEPARTMENT---> SUBJECT1\n ---> SUBJECT2\n |===> Minor1eg I define the first one like thisdefine TOPIC(DEPARTMENT) TOPICSTR('SUBJECT1')but i hit error when i try to define subject2define TOPIC(DEPARTMENT) TOPICSTR('SUBJECT2')it says \"Object already exists\". How to remedy. thanks### Assistant: TOPIC objects are unique. Hence the same topic object can't defined again. Topic objects are to be used for administration and topic strings for publish messages and subscribing to publications. As you are using the sameDEPARTMENTobject name again to define a another topic, you are getting the error.You can do it this way:define TOPIC(DEPSUB1) TOPICSTR('DEPARTMENT/SUBJECT1')\ndefine TOPIC(DEPSUB2) TOPICSTR('DEPARTMENT/SUBJECT2')\ndefine TOPIC(DEPSUB3) TOPICSTR('DEPARTMENT/SUBJECT2/Minor1')Later for receiving publications you can use the following sample topic strings.\"#\" -> Receive all publications\n\"DEPARTMENT/#\" -> Every publication under 'DEPARTMENT' topic\n\"DEPARTMENT/+/Minor1\" -> All publications on 'Minor1' irrespective of SUBJECTs.\n"} +{"text": "### Human: I tried doing the following: \nalt ql(somequeue) statq(on)\nalt qmgr statq(on)\nalt qmgr statint(30)\nRESET QMGR TYPE(STATISTICS)But nothing appears in the SYSTEM.ADMIN.STATISTICS.QUEUE. I even tried to set the Inhibit GET on the queue to make sure noone is stealing the messages.Why are the statistics not showing?### Assistant: If your description lists all that you did, and there are no error messages in your queue manager error log, then best guess is that there was nothing to report!If I do exactly that, I get no messages on the SYSTEM.ADMIN.STATISTICS.QUEUE either.However, if before issuing the RESET command, I put a couple of messages to the queue in question, then I get some statistics on the SYSTEM.ADMIN.STATISTICS.QUEUE.\n"} +{"text": "### Human: I'm WAS 7 and Webshpere MQ 6 for JMS Application in java.\nI'm facing this error while connecting to the queue.\ncom.ibm.msg.client.jms.DetailedJMSSecurityException: JMSWMQ0018: Failed to connect to queue manager 'Test_QManager' with connection mode 'Client' and host name '172.21.136.72'. Check the queue manager is started and if running in client mode, check there is a listener running. Please see the linked exception for more information.Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2063' ('MQRC_SECURITY_ERROR').\nAny Help Please.### Assistant: As a general rule, the most detail for any security error is provided at the queue manager. The reason for this is that the administrator needs as much information as possible but an attacker should get as little information as possible.This gives us a great diagnostic tool for this kind of error. When at the client you get a very sparse \"security error\" with little explanation, look at the queue manager's logs. If they record a detailed error at the same time as your client did, then you know the request made it to MQ and why MQ rejected it.However, if the QMgr logs do not record the error then you know to concentrate your efforts on the client side.If this was an authorization error, you would get back a2035. A2063has something to do with security but not authorization. That leaves things like the client cannot find or open its keystore, or the file permissions on the keystore allow world-read. It might be that the client JSSE provider isn't compatible with MQ.The recommended diagnostic is to use the sample programs that come with MQ to perform verification tests. If these can recreate the problem, it is with configuration or the environment. If they work, then the issue is likely in the code, app server config, or managed objects. Turning on client-side trace should help tremendously, just remember to disable it afterwards,\n"} +{"text": "### Human: How do i reset a queue? I want to clear all the messages in the queue, before i start to write a message into a queue. Is there any way i can reset without doing a get call?MQQueueManager mqQMgr = new MQQueueManager(mqQueueManager);\nMQQueue queue = mqQMgr.AccessQueue(getMessageQueue, MQC.MQOO_OUTPUT | MQC.MQOO_INPUT_SHARED | MQC.MQOO_INQUIRE);There is a .clearmessages in MQMessage object, but i can access that only when i call a get method, i am looking for a way to clear the existing messages in the queue, before i can put a new message into the queue.### Assistant: Messages in a queue can be programatically cleared only withGetcalls. There is no other way. Alternatively you use the administrative console to clear messages but that's not what you are looking for.MQMessage.ClearMessage() discards any data in themessage bufferand sets the data offset back to zero. It does not clear all the messages residing in a queue.May I ask you why you want to clear the queue before putting new messages? What problem are you trying to solve?\n"} +{"text": "### Human: I am sending 3 messagesMessage1 - correlation id:5000empty message (no body/message)-correlation id:5001Message2 - correlation id:5002My outbound queue processes like thisMessage1 - correlation id:5000Message1-correlation id:5001 => same previous message ovewritten on the empty message.*Message2 - correlation id:5002The second line above should not have had Message1, instead just empty. Any thoughts?My get methodmqGetMsgOpts = new MQGetMessageOptions();\n if (mqQueue != null)\n {\n //Get options for the messsage \n mqGetMsgOpts.Options = MQC.MQGMO_BROWSE_FIRST | MQC.MQGMO_WAIT | MQC.MQOO_INQUIRE;\n mqGetMsgOpts.MatchOptions = MQC.MQMO_NONE;\n mqGetMsgOpts.WaitInterval = 5000; // 5 seconds limit for waiting\n }\n\n if (mqMsg.MessageLength > 0 && mqMsg.DataLength > 0)\n {\n messageData = mqMsg.ReadString(mqMsg.MessageLength);\n }If I don't do the length check, i will get stream reader related exception.My put methodif(mqQueue==null)\n mqQueue = mqQMgr.AccessQueue(\"Queue Name\", MQC.MQOO_OUTPUT | MQC.MQOO_INPUT_SHARED | MQC.MQOO_INQUIRE);\n\n mqMsg.WriteString(message);### Assistant: I have not heard messages getting overwritten in WMQ. I suspect this must be an issue with application. This line of code:mqGetMsgOpts.Options = MQC.MQGMO_BROWSE_FIRST | MQC.MQGMO_WAIT | MQC.MQOO_INQUIRE;TheMQC.MQGMO_BROWSE_FIRSToption will make WMQ to return always the first message that satisfies the conditions specified in MQMD structure. I can't make out from your code snippet if this option is modified at a later point to specifyMQGMO_BROWSE_NEXTto read the next message in the queue.Instead ofMQC.MQGMO_BROWSE_FIRSTyou can specifyMQGMO_BROWSE_NEXToption to continuously read messages.Also you have specifiedMQC.MQOO_INQUIREwhich is not valid for GMO options. You need to remove that.More details browse options arehere\n"} +{"text": "### Human: I have used wmqjava sample program to connect to MQ manager and put message in REQUEST queue and get response from RESPONSE queue.I can put and get the messages.\nI couldn't get the correct message when there is muliple messages arrived in RESPONSE QUEUE.Please advice whether there is a way to correlate request and response in this approach.Please also advice whether this approach is recommended one.### Assistant: Correlation id is the best way to correlate request and response messages. You will need to do the following:At the requester end:1) Cache the message id of the request message after the request message is sent.2) While getting the message specify MQMO_MATCH_CORREL_ID in MQGetMessageOptions.matchOptions field and specify the above message id as the matching value.At the responder end:1) Retrieve the message id from the request message.2) While sending the response message, set the Correlation Id of the response message with message id of request message.This is how you can correlate request and response messages. Little snippet for requester.// Send request message\n MQMessage requestMessage = new MQMessage();\n requestMessage.writeUTF(\"Request Message\");\n reqQueue.put(requestMessage);\n\n // Receive response\n MQMessage responseMessage = new MQMessage();\n responseMessage.correlationId = requestMessage.messageId;\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.matchOptions = CMQC.MQMO_MATCH_CORREL_ID;\n\n respQueue.get(responseMessage,gmo);\n"} +{"text": "### Human: In a cluster environment , I see channels to a particular server is ending abnormally and resuming frequently in a day.Eg: QMGR A has several QMGRS(B,C,D,E,F) connected to it.(each in different server)Cluster Receiver channels from QMGR B,C,D,E,F are ended abnormally on QMGR A and resuming quite frequently in a day.QMGR A LOGS------------------------------------------------------------------------------- \n08/04/12 08:44:41 - Process(1720412.1165) User(mqad) Program(amqrmppa) \nAMQ9209: Connection to host 'HOST.B (139.120.210.19)' closed. \n\nEXPLANATION: \nAn error occurred receiving data from 'HOST.B (139.120.210.19)' over TCP/IP. \n The connection to the remote host has unexpectedly terminated. \nACTION: \nTell the systems administrator. \n----- amqccita.c : 3094 ------------------------------------------------------- \n08/04/12 08:44:41 - Process(1720412.1165) User(mqad) Program(amqrmppa) \nAMQ9999: Channel program ended abnormally. \n\nEXPLANATION: \nChannel program 'CHANNEL.TO.B' ended abnormally. \nACTION: \nLook at previous error messages for channel program 'CHANNEL.TO.B' in the \nerror files to determine the cause of the failure. \n----- amqrccca.c : 777 -------------------------------------------------------- \n08/04/12 08:44:41 - Process(1720412.1175) User(mqad) Program(amqrmppa) \nAMQ9209: Connection to host 'HOST.C (155.10.186.20)' closed. \n\nEXPLANATION: \nAn error occurred receiving data from 'HOST.C (155.10.186.20)' over TCP/IP. \nThe connection to the remote host has unexpectedly terminated. \nACTION: \nTell the systems administrator. \n----- amqccita.c : 3094 ------------------------------------------------------- \n08/04/12 08:44:41 - Process(1720412.1175) User(mqad) Program(amqrmppa) \nAMQ9999: Channel program ended abnormally. \n\nEXPLANATION: \nChannel program 'CHANNEL.TO.C' ended abnormally. \nACTION: \nLook at previous error messages for channel program 'CHANNEL.TO.C' in the \nerror files to determine the cause of the failure. \n -------------------------------------------------------------------------------QMGR LOG on HOST B08/04/2012 08:44:09 AM - Process(17174.16023) User(mqad) Program(amqrmppa)\nAMQ9259: Connection timed out from host 'HOST.A'.\n\nEXPLANATION:\nA connection from host 'HOST.A' over TCP/IP timed out.\nACTION:\nCheck to see why data was not received in the expected time. Correct the\nproblem. Reconnect the channel, or wait for a retrying channel to reconnect\nitself.\n----- amqccita.c : 3546 -------------------------------------------------------\n08/04/2012 08:44:09 AM - Process(17174.16023) User(mqad) Program(amqrmppa)\nAMQ9999: Channel program ended abnormally.\n\nEXPLANATION:\nChannel program 'CHANNEL.TO.B' ended abnormally.\nACTION:\nLook at previous error messages for channel program 'CHANNEL.TO.B' in the\nerror files to determine the cause of the failure.QMGR LOG on HOST C-------------------------------------------------------------------------------\n08/04/12 08:44:35 - Process(462890.4658) User(mqad) Program(amqrmppa)\nAMQ9259: Connection timed out from host 'HOST.A'.\n\nEXPLANATION:\nA connection from host 'HOST.A' over TCP/IP timed out.\nACTION:\nCheck to see why data was not received in the expected time. Correct the\nproblem. Reconnect the channel, or wait for a retrying channel to reconnect\nitself.\n----- amqccita.c : 3341 -------------------------------------------------------\n08/04/12 08:44:35 - Process(462890.4658) User(mqad) Program(amqrmppa)\nAMQ9999: Channel program ended abnormally.\n\nEXPLANATION:\nChannel program 'CHANNEL.TO.C' ended abnormally.\nACTION:\nLook at previous error messages for channel program 'CHANNEL.TO.C' in the\nerror files to determine the cause of the failure.\n----- amqrmrsa.c : 468 --------------------------------------------------------I'm trying to understand what is causing this?? Is it caused if the Queue manager A is overloaded with as many connections ?? I don't see any TCP/IP error code logged on the qmgr log.### Assistant: Looks like you are running pre V7.1 version of MQ? In MQ V7.1 that error message was updated from:-AMQ9259: Connection timed out from host 'HOST.A'.\n\nEXPLANATION:\nA connection from host 'HOST.A' over TCP/IP timed out.\nACTION:\nCheck to see why data was not received in the expected time. Correct the\nproblem. Reconnect the channel, or wait for a retrying channel to reconnect\nitself.toAMQ9259: Connection timed out from host 'HOST.A'.\n\nEXPLANATION:\nA connection from host 'HOST.A' over TCP/IP timed out.\nACTION:\nThe select() [TIMEOUT] 60 seconds call timed out. Check to see why data was\nnot received in the expected time. Correct the problem. Reconnect the channel,\nor wait for a retrying channel to reconnect itself.as an example. The most likely reason for the AMQ9259 error message is that your receive timeout settings have caused the channel to pop out of its receive and close the channel. Suggest you review the receive time out settings in your qm.ini file to see if they are set to something shorter than your heartbeat intervals.The channels restart again automatically because you have retry intervals defined on them. This is good!\n"} +{"text": "### Human: I am using Websphere MQ as an input and output inside a Broker Application Flow. The flow also has Websphere Transformation Extender Maps in them.I want use java to send a message with a unique identifier on the input queue and receive a reply on the output queue. I should be able to pick the message from the output queue using that unique identifier.How can I do this?### Assistant: The easy way to do this is to use the CorrelationID.The application that is processing requests will need to copy the MessageID to the CorrelationID of the reply message when responding. The requestor application specifies the CorrelationID as the message selector while receiving messages and provide the MessageID of the request message as the value for the selector.If you plan to use JMS, then it will be much simpler. Use the JMSMessageID and JMSCorrelationID properties and create a consumer with JMSCorrelationID as selectorQueueReceiver queueReceiver = \n session.createReceiver(destination, \"JMSCorrelationID='+ requestMsg.JMSMessageID +\"'\");\n"} +{"text": "### Human: In WAS, I have created a jms queue X. I have also created another queue Y and in MQ, I specify that Y is backout queue for X.Now for X if I say maximum number of retries :3 and backout threshold is 2, that means that after 2 tries if the message is not consumed by X, queue manager will put message on Y. In this case, maximum number of retries (3) will never be reached because it will never try a third time. And the listener for X will never go down.\nIs my understanding correct?### Assistant: I'm not so sure about the jms interface, but in native WMQ, the queue manager does not automatically requeue the message to the backout queue. it is up to the application to query the backout_count, compare that to the backout_threshold, and put the messages to backout_queue.You should read \"How WebSphere Application Server handles poison messages\" --http://www.ibm.com/developerworks/websphere/library/techarticles/0405_titheridge/0405_titheridge.htmlAlso important to read \"Best Practices: WebSphere MQ shared queues and application programs\", scroll down to Issue 6 --http://www.ibm.com/developerworks/websphere/library/techarticles/0512_elkins/0512_elkins.html\n"} +{"text": "### Human: I need to send a message to a WMQ queue.RfhUtilc, a part ofWebSphere MQ Exploreris the only tool I know. I managed to send a message with the proper text content, but I don't know how to set JMS properties.Withrfhutilc, when I browse other messages with JMS properties set correctly, they appear in the \"usr\" tab as:valueothervalueWhen I try to reverse it \u2014 paste such string into the \"usr\" tab and send the message \u2014 I'm not getting any content in this field, when I read the message back. As a result, my message-driven bean doesn't get the message, as its message selector depends on a JMS property.Anyone knows how to set the properties withrfhutilc? Or perhaps suggest a more user-friendly tool that can do it?### Assistant: Actually, rfhutil and rfhutilc are part ofSupportPac IH03and not part of WebSphere MQ Explorer. The good news with this is that you can download the latest version of IH03 and the User Guide that comes with it. The User Guide explains that the usr folder if for use with properties stored as RFH2 headers (old V6 style) and that the User Props tab is for V7. It also provides the syntax for entering name/type/value triplets and a list of available data types.The User Prop tab is explained beginning on page 41 of the manual (page 56 of the PDF) and the usr tab content begins on page 52 of the manual (page 67 of the PDF).The page listing all the SupportPacsis here. On that page, WebSphere MQ Explorer isSupportPac MS0T.\n"} +{"text": "### Human: I am getting some compilation errors compiling some C code on my Mint Linux install.The errors are ALL version mismatch issues.Here is a section of the \"make error\":/usr/bin/ld: warning: libthread.so.1, needed by /home/lynton/Backup/Logosworld/IBM/Websphere MQ for Solaris x86 64bit/CZRV9ML/mqm/root/opt/mqm/lib64/libmqm.so, not found (try using -rpath or -rpath-link)\n/usr/bin/ld: warning: libsocket.so.1, needed by /home/lynton/Backup/Logosworld/IBM/Websphere MQ for Solaris x86 64bit/CZRV9ML/mqm/root/opt/mqm/lib64/libmqm.so, not found (try using -rpath or -rpath-link)\n/usr/bin/ld: warning: libc.so.1, needed by /home/lynton/Backup/Logosworld/IBM/Websphere MQ for Solaris x86 64bit/CZRV9ML/mqm/root/opt/mqm/lib64/libmqm.so, not found (try using -rpath or -rpath-link)\n/usr/bin/ld: warning: libdl.so.1, needed by /home/lynton/Backup/Logosworld/IBM/Websphere MQ for Solaris x86 64bit/CZRV9ML/mqm/root/opt/mqm/lib64/libmqm.so, not found (try using -rpath or -rpath-link)\n/home/lynton/Backup/Logosworld/IBM/Websphere MQ for Solaris x86 64bit/CZRV9ML/mqm/root/opt/mqm/lib64/libmqm.so: undefined reference to `xihThreadKey'\n/home/lynton/Backup/Logosworld/IBM/Websphere MQ for Solaris x86 64bit/CZRV9ML/mqm/root/opt/mqm/lib64/libmqm.so: undefined reference to `xcsCreateThreadMutexSemX'\n/home/lynton/Backup/Logosworld/IBM/Websphere MQ for Solaris x86 64bit/CZRV9ML/mqm/root/opt/mqm/lib64/libmqm.so: undefined reference to `thr_getspecific'\n/home/lynton/Backup/Logosworld/IBM/Websphere MQ for Solaris x86 64bit/CZRV9ML/mqm/root/opt/mqm/lib64/libmqm.so: undefined reference to `xcsReleaseThreadMutexSem'\n/home/lynton/Backup/Logosworld/IBM/Websphere MQ for Solaris x86 64bit/CZRV9ML/mqm/root/opt/mqm/lib64/libmqm.so: undefined reference to `xcsRequestThreadMutexSem'\ncollect2: ld returned 1 exit status\nmake: *** [idoclink_outbound] Error 1So for example it complains about \"libsocket.so.1\" but I only have \"libsocket.so.0\"?How do C developers normally get around this sort of issue? Is there any way I can download those SPECIFIC libs that it is complaining about?Thanks for the help ;-)Lynton### Assistant: You're trying to compile code written for Solaris on Linux, and neither the build system nor the code has been properly conditionalized so that this works. Clue one is the name of the build directory --.../Websphere MQ for Solaris x86 64bit/...clue two is that it seems to have hardwired a bunch of Solaris-specific dynamic library names (Linux doesn'thavea libthread or a libsocket as far as I know, and its libc and libdl do not use those sonames -- I don't know where you got alibsocket.so.0, but it's probably something completely different than what this program is looking for) and clue three islibmqm.so: undefined reference to `thr_getspecific'wherethr_getspecificis a decidedly non-portable, Solaris-specific library routine (the portable equivalent ispthread_getspecific, but porting is not simply a matter of changing the name in the code).Go back to wherever you got the code and see if they have a Linux variant. If they don't, you may have a great deal of work ahead of you.\n"} +{"text": "### Human: I develop in C# using MQ v.7 native API.I would like to use syncpoints to guarantee data consistency but can't find any code samples on how to use them.I will be using local units of work. OS is Windows.Can anyone share some links or code snippets on using Commit() and Backout() in C#?### Assistant: Unfortunately, the samples that come with WMQ do not syncpoint operations. Instead, take a look at Chapter 13.1.2 in theWebSphere MQ Solutions in a Microsoft .NET EnvironmentRedbook. The code snippets there show syncpoint and can be integrated into the samples that are installed with WMQ.If you are not on WMQ V7, please upgrade. The .Net support has been greatly enhanced and integrated into the base product. Furthermore, WMQ v6.x is end-of-life as of September 2011 and you will need to be on v7 at that point to obtain support. The WMQ V7 client can be downloaded asSupportPac MQC7.\n"} +{"text": "### Human: I'm connecting to an IBM Websphere MQ and currently reading one message at a time using the method receive() from the object:javax.jms.Message;Is there a way to retrieve multiple messages from the queue in one go?Many thanks,\nG.### Assistant: Depends on whether you make a distinction between \"read\" and \"retrieve\".From a JMS perspective, no. The API will return one message per method call.From the WMQ perspective, yes - provided the client and queue manager are both at v7 and the messages are non-persistent or being browsed. In this case you can enable read-ahead in the managed object definition or dynamically at run time. The queue manager will stream several messages off of the queue and deliver them to the application before the first one is acknowledged. For more information on this, seeUsing read ahead with WebSphere MQ classes for JMS.\n"} +{"text": "### Human: I work on a Java application which usescom.ibm.mqjmsversion 6.0.2.2. I just upgraded tocom.ibm.mq.allclientversion 9.3.1.0.After the upgrade, all attempts to put a message on the queue results the following error :com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2035'.The error message given by queue manager is :AMQ9557E: Queue Manager User ID initialization failed for '[username]'.\nEXPLANATION:\nThe call to initialize the User ID '[username]' failed with CompCode 2 and Reason\n2035. If an MQCSP block was used, the User ID in the MQCSP block was ''. If a\nuserID flow was used, the User ID in the UID header was '' and any CHLAUTH\nrules applied prior to user adoption were evaluated case-sensitively against\nthis value.\nACTION:\nCorrect the error and try again.I've tried to add the following in the java application to disable MQCSP, but this did not help.Hashtable props = new Hashtable();\nprops.put(MQConstants.USER_ID_PROPERTY, false);\nprops.put(MQConstants.PASSWORD_PROPERTY, false);\nprops.put(MQConstants.USE_MQCSP_AUTHENTICATION_PROPERTY, Boolean.FALSE);\nthis.queueManager = new MQQueueManager(getManager(), props);What can I do to troubleshoot this issue? Since the issue only exists with the more recent version of the MQ java client, I'd think the issue is caused by the client?AMQERR01.LOG2023-01-03 13:28:41 - Process(2838.71) User(mqm) Program(amqrmppa)\n Host([HOSTNAME]) Installation(Installation1)\n VRMF(9.2.5.0) QMgr(TSTMQ01)\n Time(2023-01-03T12:28:41.959Z)\n ArithInsert1(2) ArithInsert2(2035)\n CommentInsert1([USERNAME])\n\n \n\nAMQ9557E: Queue Manager User ID initialization failed for '[USERNAME]'.\n\n \n\nEXPLANATION:\nThe call to initialize the User ID '[USERNAME]' failed with CompCode 2 and Reason\n2035. If an MQCSP block was used, the User ID in the MQCSP block was ''. If a\nuserID flow was used, the User ID in the UID header was '' and any CHLAUTH\nrules applied prior to user adoption were evaluated case-sensitively against\nthis value.\nACTION:\nCorrect the error and try again.### Assistant: To get the prior v6 behavior set the java system propertyuser.nameto an empty value, for example on the command line add this:-Duser.name=or in your program add this:System.setProperty(\"user.name\", \"\")Background:The IBM MQ classes for Java and IBM MQ classes for JMS are the only libraries where IBM allows you to set the username that is passed to MQ in the protocol field called RemoteUserIdentifier. This has been in place since the Java and JMS classes were released. IBM has stated this is because a java app does not have direct access to the user the process runs under only the java system property user.name which will be filled in by the JVM with a username but can be overridden as a java system property. On the other hand C, C++, .NET and XMS MQ client APIs all pass the user that the process is running as in the RemoteUserIdentifier field and you cannot override this and specify an arbitrary value.Java and JMS also were the only APIs to allow you to specify a password value and this would be sent to the queue manager in the RemotePassword field. The RemoteUserIdentifier/RemotePassword fields are part of the MQCD (MQ channel defination) that the client sends to the queue manager when connecting.Prior to v8 the queue manager had no built in functionality to authenticate any username or password value that was provided, you would need a security exit to get any additional validation. If you configure your MQ SVRCONN channel to allow connections as any ID with no protection (Blank MCAUSER and no security exits or SSLCIPH/SSLPEER to restrict access, then anyone can write a simple Java or JMS MQ application to assert any user value and get access to what that user would have access to on MQ, even without java someone with admin rights on there own desktop or server can just create a local user with the right name and run a C program and get similar access. It is never a good idea to accept an arbitrary asserted ID without some form of validation.Prior to CHLAUTH which was added in MQ v7.1 the default configuration of a new queue manger was to allow the asserted id to be administrative unless you protected against this, this could be as simple as passing the value \"mqm\" to a linux queue manager or simply passing a blank value, if the MCAUSER was also blank on the SVRCONN channel the channel would run under the authority of the process running the listener which would be the \"mqm\" user.With 7.1 and higher a new queue manager is created by default with CHLAUTH(ENABLED) and a few default CHLAUTH rules, one restricts access to all channels that start with \"SYSTEM\" and another denies connections to SVRCONN channels from any user MQ determines has administrative authority. Note that if a queue manager was created at a version prior to 7.1, then later upgraded to 7.1 or higher the default is to leave CHLAUTH(DISABLED), so unless you alter it to set it to ENABLED at some point you do not have these protections.On the Java/JMS client side prior to 7.1, if you did not set the username a blank value would be passed in the RemoteUserIdentifier, after 7.1, if you do not set the username then the client defaults to sending the value of the java system property user.name, if you do set the username it is still sent in favor to the user.name value.Since MQ v7.0 non-java APIs have had the ability to send an additional structure to the queue manager during the channel connection called the MQCSP which has fields for a username and password and AuthenticationType, but similar to what I said about RemoteUserIdentifier/RemotePassword prior to v8 there was no built in functionality to actually authenticate or do anything with these values, you would need to use a security exit to get this functionality. Note the MQCSP.AuthenticationType field has two possible values, MQCSP_AUTH_NONE (indicating that you do not want authentication performed) or MQCSP_AUTH_USER_ID_AND_PWD (indicate that you want authentication performed).Since MQ v8.0 the Java and JMS APIs now also have the ability to send the username and password values in the MQCSP instead of the MQCD RemoteUserIdentifier/RemotePassword fields, but for all versions of MQ v8.0, MQ v9.0.0.x (LTS) and 9.0.x (CD), 9.1.0.x (LTS), and 9.1.x (CD) the default is to send the username and password in compatibility mode still using the RemoteUserIdentifier/RemotePassword fields of the MQCD. To have Java and JMS use the MQCSP, you have to specifically set a property. When the specified username and password is sent in the MQCSP the RemoteUserIdentifier is filled in with the java system property user.name by default. Note that in 9.3 it seems the default is now send the username and password in the MQCSP structure instead of in compatibility mode.At v8.0 and later the queue manager now has the feature called CONNAUTH which can authenticate a username and password that is sent via either MQCSP or RemoteUserIdentifier/RemotePassword. There are various configuration options around how this is configured, but by default at v8 or later if a username and password (note the password could be empty in this case) are sent to the queue manager and MQCSP.AuthenticationType is set to MQCSP_AUTH_USER_ID_AND_PWD, they will be validated to be correct, and if an administrative user is sent to the queue manager it must provide a password and be correct.For Java/JMS APIs, if no MQCSP is sent by the client but RemoteUserIdentifier and RemotePassword both have a value, the queue manager will build a MQCSP with MQCSP.AuthenticationType set to MQCSP_AUTH_USER_ID_AND_PWD and validate it the same way, note in this case if RemotePassword is empty a MQCSP structure is not built.Conclusion:Based on the description of how you state that the Java app with v6 jars is functioning, this means that anyone that has access to connect the MQ listener port of your queue manager can specify any username that has access to MQ including the queue manager admin user. It would be much better to send a username and password that will be validated, or use client TLS certificates to assert identity (When combined with setting the channels SSLPEER and a MCAUSER (or a CHLAUTH SSLPEERMAP rule) you can greatly restrict who can connect to your channel, and you eliminate the ability for them to assert any arbitrary username.\n"} +{"text": "### Human: Context: I have been running the NodeJS app withibmmqas an npm package. This service consumes msg with the help of ibmmq package. For running this app, I had built below docker file.STAGE1: BUILD\nFROM node:16.13.2-bullseye-slim AS base\n\nWORKDIR /app\n\nCOPY package*.json ./\nCOPY tsconfig.json ./\nCOPY src ./src\n\nRUN echo $(ls -1 ./)\nRUN echo $(ls -1 ./src)=\nRUN apt-get update && apt-get install --yes curl g++ make git python3\nRUN npm install\n\nRUN npm run app-build\nCOPY . .\n\nSTAGE2: RELEASE\n\nFROM node:16.13.2-bullseye-slim AS release\n\nWORKDIR /app\n\nCOPY --from=base /app/build/src ./src\nCOPY --from=base /app/node_modules ./node_modules\nCOPY --from=base /app/package*.json ./\nCOPY --from=base /app/tsconfig.json ./\n\nCMD node src/index.jsThe above docker image with the container was running perfectly, for the past 6 months. Now it's been giving errors while running the image in the docker container. PFB the error.container is backing off waiting to restart\n-dev:pod/---5dbc6cd9c8-x48tj: container is backing off waiting to restart\n[ -5dbc6cd9c8-x48tj ] Cannot find MQ C library.\n[ -5dbc6cd9c8-x48tj ] Has the C client been installed?\n[ -5dbc6cd9c8-x48tj ] Have you run setmqenv?\nfailed. Error: container is backing off waiting to restart.PFB the lib versions:\"node_modules/ibmmq\": { \"version\": \"0.9.18\", \"hasInstallScript\": true, \"license\": \"Apache-2.0\", \"dependencies\": { \"ffi-napi\": \">=4.0.3\", \"ref-array-di\": \">=1.2.2\", \"ref-napi\": \"^3.0.3\", \"ref-struct-di\": \">=1.1.1\", \"unzipper\": \">=0.10.11\" }Please help me here, since 2-3 days I have been trying with multiple images and all are failing now. I have also raised anissueon Github.Thanks in advance.### Assistant: Version 0.9.18 of theibmmqpackage is about a year old. It had a default version of the MQ C client library to use of 9.2.3.0. IBM removes out-of-support versions of the Redist client from its download site, and with the recent release of 9.3.0, that site got cleaned up about a week ago. So the automatic download of the C package would now fail with that level of the Node package.If you want to continue to use a particular version of the MQ client past its support lifetime then you need to keep a local copy of the tar file ready to install in your container, and put it in there yourself. And then tell the npm install process not to try to download during the postinstall phase.Theibmmqpackage has this documented in itsREADMEI would have expected thenpm installto have reported a download error but newer versions of npm seem to have stopped printing useful information during installation by default.\n"} +{"text": "### Human: I configured the IBM MQ resource adapter 9.2.5.0 in Wildfly 20.0.0 as follows:\n \n wmq.jmsra.rar\n \n XATransaction\n \n \n ${env.HOSTNAME}\n ${env.PORT}\n ${env.CHANNEL}\n CLIENT\n ${env.QUEUE_MANAGER}\n \n \n When using this connection factory to create an MQ connection, I get the following error:MQJCA1011: Failed to allocate a JMS connection\n...\nCaused by: javax.resource.ResourceException: IJ000455: Wrong ManagedConnectionFactory sent to allocateConnection (Pool=com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl@f85b573c, MCF=com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl@f85b573c)\n at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:784) ~[?:?]\n at com.ibm.mq.connector.outbound.ConnectionFactoryImpl.createManagedJMSConnection(ConnectionFactoryImpl.java:309)### Assistant: APAR IT37469was the starting point here. It addressed some inconsistencies with data types returned by getters for Resource Adapter properties - forcing them to return object types (as required by the Java EE specification) rather than primitives (which many, but not all Application Servers tolerated).Unfortunately, the fix was incompletely applied to the CD release - so 9.2.5 has the issue reported and as explained very well by Felix Siegrist.The fix has been corrected for MQ 9.3.0 - seeAPAR IT40764\n"} +{"text": "### Human: I have created a kdb file in my IBMMQ (docker) using below command:runmqakm -keydb -create -db key.kdb -stash -pw password -type cmsAnd I've created a self-signed cert by:openssl genrsa -out ca.key 2048\nopenssl req -new -x509 -key ca.key -subj \"$prefix/CN=ca\" -out ca.crt\nopenssl pkcs12 -export -out ca.pfx -in ca.crt -nokeys\nopenssl pkcs12 -export -in ca.crt -inkey ca.key -out ca.p12 -name myca -CAfile ca.crt -passin pass:mypass -passout pass:mypassNow I want to add my own ca.crt to kdb as personal cert, I mean something like below:runmqakm -cert -list -db key.kdb -stashed\nCertificates found\n* default, - personal, ! trusted, # secret key\n- CAlabelI've tried this commands:runmqckm -cert -import -file ca.pfx -pw mypass -type pkcs12 -target filename -target_pw password -target_type cms -label CAlabel\n\nrunmqckm -cert -import -file ca.p12 -pw mypass -type pkcs12 -target filename -target_pw password -target_type cms -label CAlabelBut keep facing this error (login as root in docker:docker exec -it -u 0 containerid sh):The database doesn't contain an entry with label 'CAlabel'.\n\nCheck the label and try again.And also (login normally in docker :docker exec -ti containerid /bin/bash)Dec 19, 2021 7:48:57 AM java.util.prefs.FileSystemPreferences$1 run\n\nWARNING: Couldn't create user preferences directory. User preferences are unusable.\n\nDec 19, 2021 7:48:57 AM java.util.prefs.FileSystemPreferences$1 run\n\nList item\n\nWARNING: java.io.IOException: No such file or directory\n\nThe input file '/mnt/mqm/data/qmgrs/QM1/ssl/ca.pfx' could not be found.\n\nCheck the database path.Does anyone have any suggestion that how can I solve this problem?### Assistant: This command will import all certs contained in the p12 file to the kdb.runmqcakm -cert -import -file ca.p12 -pw mypass -type pkcs12 -target key.kdb -target_stashed -target_type cms\n"} +{"text": "### Human: is there a way in either COBOL or assembler to open all the queues? i am looking to do an inquire and would simply like to scroll through all of the local queues on a queue manager. i have passed an asterisk in the object name field with no results (like you would do on the screen). i am looking to get back a list or a pointer to all of the queues that match '*' so i can do the inquire. I tried passing an asterisk in various input fields and altering other input fields to no success.### Assistant: You can't achieve this by means of anMQOPENandMQINQ. Instead you must send a message to the Command Server asking it for all the queue names.You can do this in two ways, either asking for a list of just the queue names or by asking for all the queues with some/all their attributes. If you just need the names, then the former is more efficient.This is done by means of thePCFInquire Queue Namescommand. You will get a response message back on the reply queue you provide with contents as described inPCFInquire Queue Names (Response).I will look to see if I can find a z/OS COBOL or 390 Assembler sample/example to add to this answer, but the above links will get you started.EDIT: Not having any luck finding a sample. Let me know if you need help with this and I can knock together something, but would be easier to help you with your code than try to start from scratch. Below some psuedo-code that will get you started.MQCONN\nMQOPEN(ReplyQ)\nMQOPEN(SYSTEM.ADMIN.COMMAND.QUEUE)\nBuild PCF Message buffer to describe command\nMQPUT(SYSTEM.ADMIN.COMMAND.QUEUE, Buffer, MQMD.ReplyToQ=name of ReplyQ)\nMQGET(ReplyQ) for response messages\nWalk through response to get all queue names out of response message\n"} +{"text": "### Human: For IBM MQ it is possible to useMQGETto browse messages on a queue (https://www.ibm.com/docs/en/ibm-mq/9.2?topic=queue-browsing-messages) or just do a 'normal'MQGET(https://www.ibm.com/docs/en/ibm-mq/9.2?topic=queue-getting-messages-from-using-mqget-call)I cannot find any differences in what a browse does (except using a cursor) and a normal get does, in terms of what content is being retrieved.Am I missing something here?### Assistant: In general a normal get is destructive and the message is permanently removed from the queue, a browse is not deductive and does not remove the message from the queue. The message content returned is the same in either case.There are three basic situations:A get with the browse option does not remove the message from the queue, it is still available for other consumers to get or browse from the queue.A normal get outside of a unit of work will remove the message from the queue, it will not be available for other consumers to get or browse from the queue.A normal get inside of a unit of work will make the message unavailable for other consumers to get or browse from the queue.If the unit of work is committed the message will be removed from the queue, it will not be available for other consumers to get or browse from the queue.If the unit of work is backed out the message will be available again for other consumers to get or browse from the queue.\n"} +{"text": "### Human: Im trying to connect to IBM MQ using the .net library \"IBMMQDotnetClient\" version 9.2.3, this connection has to be with TLS 1.2.properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\n properties.Add(MQC.HOST_NAME_PROPERTY, _hostname);\n properties.Add(MQC.PORT_PROPERTY, port);\n properties.Add(MQC.CHANNEL_PROPERTY, channel);\n properties.Add(MQC.SSL_CERT_STORE_PROPERTY, @\"C:\\Root\\ssl\\keystore\");\n properties.Add(MQC.SSL_CIPHER_SPEC_PROPERTY, \"TLS_RSA_WITH_AES_128_CBC_SHA256\");\n properties.Add(MQC.CERT_LABEL_PROPERTY, certLabel);when I call the :_mqQueueManager = new MQQueueManager(queueManager, properties);I get the following MQException: Reason 2195 - Message \"MQRC_UNEXPECTED_ERROR\"Does anyone know how to connect to the IBM MQ from a c# .netcore project using a .kdb/.sth certificate?On the MQTRACEPATH log I see this:000001CA 13:08:12.582896 29080.1 -----------} MQTCPConnection.ConnectUsingLocalAddr(ParsedLocalAddr,IPAddress,int) rc=OK\n000001CB 13:08:12.582914 29080.1 IP:*****\n000001CC 13:08:12.583357 29080.1 Constructing IBM.WMQ.Nmqi.MQEncryptedSocket#0083A9E6 MQMBID sn=p923-L210708 su=_rwPC4d_rEeuJxYd83sYP-w pn=basedotnet/nmqi/NmqiObject.cs\n000001CD 13:08:12.583376 29080.1 Constructing IBM.WMQ.Nmqi.MQEncryptedSocket#0083A9E6 MQMBID sn=p923-L210708 su=_rwPC4d_rEeuJxYd83sYP-w pn=basedotnet/nmqi/MQEncryptedSocket_s.cs\n000001CE 13:08:12.583712 29080.1 -----------{ MQEncryptedSocket.RetrieveAndValidateSSLParams(MQConnectOptions)\n000001CF 13:08:12.583850 29080.1 IBM.WMQ.Nmqi.MQEncryptedSocket#0083A9E6 throwing MQException: cc=2 rc=2381\n000001D0 13:08:12.584052 29080.1 New MQException CompCode: 2 Reason: 2381\n000001D1 13:08:12.586100 29080.1 -----------}! MQEncryptedSocket.RetrieveAndValidateSSLParams(MQConnectOptions) rc=(Unknown(2381))\n000001D2 13:08:12.586901 29080.1 CompCode: 2, Reason: 2381\n000001D3 13:08:12.586982 29080.1 New MQException CompCode: 2 Reason: 2538\n000001D4 13:08:12.588392 29080.1 -----------{ ManagedCommonServices.GetMessage(string objectId,uint returncode,uint control,out string basicmessage,out string extendedmessage,out string replymessage,MQLONG basicLength,MQLONG extendedLength,MQLONG replyLength)\n000001D5 13:08:12.588428 29080.1 Returncode: 0x20009202 Control: 0x00000006\n000001D6 13:08:12.590143 29080.1 -----------}! ManagedCommonServices.GetMessage(string objectId,uint returncode,uint control,out string basicmessage,out string extendedmessage,out string replymessage,MQLONG basicLength,MQLONG extendedLength,MQLONG replyLength) rc=(Unknown(536895768))\n000001D7 13:08:12.591130 29080.1 -----------{ ManagedCommonServices.DisplayMessage(string,string,uint,uint)\n000001D8 13:08:12.634418 29080.1 ------------{ ManagedCommonServices.GetMessage(string objectId,uint returncode,uint control,out string basicmessage,out string extendedmessage,out string replymessage,MQLONG basicLength,MQLONG extendedLength,MQLONG replyLength)\n000001D9 13:08:12.634472 29080.1 Returncode: 0x20009202 Control: 0x00000013\n000001DA 13:08:12.634686 29080.1 ------------}! ManagedCommonServices.GetMessage(string objectId,uint returncode,uint control,out string basicmessage,out string extendedmessage,out string replymessage,MQLONG basicLength,MQLONG extendedLength,MQLONG replyLength) rc=(Unknown(536895768))\n000001DB 13:08:12.634805 29080.1 -----------}! ManagedCommonServices.DisplayMessage(string,string,uint,uint) rc=(Unknown(536895768))\n000001DC 13:08:12.634880 29080.1 ----------} MQTCPConnection.ConnectSocket(string,string,MQLONG) rc=OK\n000001DD 13:08:12.634996 29080.1 CompCode: 2, Reason: 2538\n000001DE 13:08:12.635362 29080.1 New MQException CompCode: 2 Reason: 2538\n000001DF 13:08:12.635379 29080.1 New NmqiException CompCode: 2 Reason: 2538\n000001E0 13:08:12.635498 29080.1 ----------{ MQFAPConnection.CleanUp(Boolean,NmqiException) inputs [False] [CompCode: 2, Reason: 2538]\n000001E1 13:08:12.635514 29080.1 ----------} MQFAPConnection.CleanUp(Boolean,NmqiException) rc=OK\n000001E2 13:08:12.635594 29080.1 ---------} MQFAPConnection.Connect(MQConnectionSecurityParameters) rc=OK\n000001E3 13:08:12.635614 29080.1 CompCode: 2, Reason: 2538\n000001E4 13:08:12.635738 29080.1 --------} MQConnectionSpecification.CreateAndConnectConnection(MQConnectionSecurityParameters,MQFAP,String,MQConnectOptions,int) rc=OK\n000001E5 13:08:12.635761 29080.1 -------} MQConnectionSpecification.GetSessionFromNewConnection(MQConnectionSecurityParameters,MQFAP,String,MQConnectOptions,int) rc=OK\n000001E6 13:08:12.635768 29080.1 Exit AssingSession from new connection:\n000001E7 13:08:12.635775 29080.1 ------} MQConnectionSpecification.GetSession(MQConnectionSecurityParameters,MQFAP,String,MQConnectOptions,int) rc=OK\n000001E8 13:08:12.635782 29080.1 -----} MQFAPConnectionPool.GetSession(MQConnectOptions,MQConnectionSecurityParameters,MQChannelDefinition,String,int,String,String,int,int) rc=OK\n000001E9 13:08:12.635791 29080.1 CompCode: 2, Reason: 2538\n000001EA 13:08:12.635847 29080.1 New MQException CompCode: 2 Reason: 2538\n000001EB 13:08:12.635857 29080.1 New NmqiException CompCode: 2 Reason: 2538\n000001EC 13:08:12.635906 29080.1 CompCode: 2, Reason: 2538\n000001ED 13:08:12.635973 29080.1 ----} MQFAP.NmqiConnect(String,NmqiConnectOptions,MQConnectOptions,Hconn,Phconn,out int,out int,ManagedHconn) rc=OK\n000001EE 13:08:12.636003 29080.1 CompCode: 2, Reason: 2538\n000001EF 13:08:12.636016 29080.1 ---} MQFAP.MQCONNX(String,MQConnectOptions,Phconn,out int,out int) rc=OK\n000001F0 13:08:12.636026 29080.1 IBM.WMQ.MQQueueManager#03551B1B throwing MQException: cc=2 rc=2538\n000001F1 13:08:12.636033 29080.1 New MQException CompCode: 2 Reason: 2538\n000001F2 13:08:12.654150 29080.1 --}! MQQueueManager.Connect() rc=(Unknown(2538))### Assistant: Managed mode which is the only mode supported in Core uses the Windows user or system keystore. You need to specify*USERor*SYSTEMas yourMQC.SSL_CERT_STORE_PROPERTY. You will need to import your cert to the corresponding Windows key store.Note that in managed mode the cipher you specify is only used to determine the TLS version to use, the actual negotiated cipher may not be what you specify. In your example it will negotiate to a TLS1.2 cipher. If the SVRCONN SSLCIPH does not match what is negotiated the connection will fail. If the queue manager is also at 9.2 you can specifyANY_TLS12orANY_TLS12_OR_HIGHERin the SVRCONN SSLCIPH to allow it to accept any available TLS1.2 cipher negotiated.\n"} +{"text": "### Human: I'm developing a Spring Boot app which is using IBM MQ. I want all of that to be configured in the docker compose. But the problem is that in the app there are used custom queues that were created from the UI in the browser, example ofapplication.ymlfile:...\nibm:\n mq:\n queues:\n first: QUEUE1\n second: QUEUE2How do I create these queues on the startup now when I'm I want to run it from the docker compose file? When I was running ibm mq manually I was using command like this:docker run --env LICENSE=accept --env MQ_QMGR_NAME=QM1 --publish 1414:1414 --publish 9443:9443 --detach ibmcom/mq:latestAnd now I'm almost doing the same but in thedocker-compose.ymlfile:...\n ibm-mq:\n image: 'ibmcom/mq:latest'\n container_name: ibm-mq\n ports:\n - \"1414:1414\"\n - \"9443:9443\"\n environment:\n - LICENSE = accept\n - MQ_QMGR_NAME = QM1Is there any environment variables to create custom queues or how do I do that? I didn't find any solution to this.### Assistant: Based on this information:Customizing the queue manager configuration, you can create a MQSC file named20-config.mqscwith some config options that will be run when your queue manager is created. Just put it into the /etc/mqm directory on the image.So, create your20-config.mqscfile like this:DEFINE QLOCAL(QUEUE1) REPLACE\nDEFINE QLOCAL(QUEUE2) REPLACEAnd map it to your docker-compose.yml as a volume like this:ibmmq:\n image: ibmcom/mq\n ports:\n - \"1414:1414\"\n - \"9443:9443\"\n environment:\n - LICENSE=accept\n - MQ_QMGR_NAME=QM1\n volumes:\n - :/etc/mqm/20-config.mqscIt works for me\n"} +{"text": "### Human: I am using Apache Camel and IBM MQ to send messages. I need to receive COA when a message gets delivered to a remote queue. The general picture looks like this:When the message reaches msg_q2 queue, I should receive the COA back. So, the problem is that I am not able to set the QMGR_REM as reply-to queue manager, which is supposed to produce COA.https://www.ibm.com/docs/en/ibm-mq/8.0?topic=messages-reply-queue-queue-managerI tried setting JMS_IBM_MQMD_xxx headers, but for some reason those headers either get omitted or ignored (by Camel?), and the message fails to be put on the queue with the reason that the reply-to queue is not specified. Also, I tried setting JMSReplyTo header asqueue://reply-to-qmgr/reply-to-q. In this case thequeue://part gets removed, and the rest is simply set as a reply-to queue name.I am relatively new to Apache Camel, and IBM MQ, so any input would be very appreciated. Thank you in advance!### Assistant: In your application, just provide the name of your ReplyToQ asreplyToQ1and leave the ReplyToQMgr field blank. The queue manager will fill it in with the local queue manager nameQMGR_LOCfor you.And onQMGR_RECdo one of the following:-If your transmission queue for the channel fromQMGR_REMtoQMGR_LOCis named exactlyQMGR_LOC, you have nothing further to do. WhenQMGR_REMcomes to put the COA onto queuereplyToQ1on queue managerQMGR_LOC, it will resolve it to the transmission queue that has the nameQMGR_LOCand the channel will deliver it.If your transmission queue for the channel fromQMGR_REMtoQMGR_LOCis not named exactlyQMGR_LOC, then make the following definition onQMGR_REM:DEFINE QREMOTE(QMGR_LOC) RNAME(' ') RQMNAME(QMGR_LOC) +\n XMITQ(your-transmission-queue-going-to-QMGR_LOC)\n"} +{"text": "### Human: I'm using spring boot withmq-jms-spring-boot-starterto create a JMS Listener application which reads a message from a queue, process it and forward the message in to another queue.In case of a poison message scenario, I'm trying to generate an alert. However, in order to not generate multiple alerts to the same message, I'm thinking of comparing theJMSXDeliveryCountwithBOTHRESHvalue and generate the alert in the last redelivery before sending to the BOQ.BOTHRESHandBOQNAMEare configured for the source queue.@JmsListener(destination = \"${sourceQueue}\")\n public void processMessages(Message message) {\n TextMessage msg = (TextMessage) message;\n int boThresh;\n int redeliveryCount;\n try {\n boThresh = message.getIntProperty(\"\");\n redeliveryCount = message.getIntProperty(\"JMSXDeliveryCount\");\n String processedMessage = this.processMessage(message);\n this.forwardMessage(\"destinationQueue\", processedMessage);\n } catch (Exception e) {\n if (redeliveryCount >= boThresh) {\n //generate alert here\n }\n }\n }How should I get the value ofBOTHRESHhere? Is it possible at all? I tried to get all the available properties usinggetPropertyNames()method and following are all the properties I see.JMS_IBM_FormatJMS_IBM_PutDateJMS_IBM_Character_SetJMSXDeliveryCountJMS_IBM_MsgTypeJMSXUserIDJMS_IBM_EncodingJMS_IBM_PutTimeJMSXAppIDJMS_IBM_PutApplType### Assistant: This will do it, but the code does need admin access to an admin channel, which may not be optimal for a client application.The Configurationimport com.ibm.mq.*;\nimport org.apache.commons.logging.Log;\nimport org.apache.commons.logging.LogFactory;\nimport org.springframework.beans.factory.annotation.Value;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\n\nimport com.ibm.mq.constants.CMQC;\n\nimport java.util.Hashtable;\n\n@Configuration\npublic class MQConfiguration {\n protected final Log logger = LogFactory.getLog(getClass());\n\n @Value(\"${ibm.mq.queueManager:QM1}\")\n public String qMgrName;\n\n @Value(\"${app.mq.admin.channel:DEV.ADMIN.SVRCONN}\")\n private String adminChannel;\n\n @Value(\"${app.mq.host:localhost}\")\n private String host;\n\n @Value(\"${app.mq.host.port:1414}\")\n private int port;\n\n @Value(\"${app.mq.adminuser:admin}\")\n private String adminUser;\n\n @Value(\"${app.mq.adminpassword:passw0rd}\")\n private String password;\n\n\n @Bean\n public MQQueueManager mqQueueManager() {\n try {\n Hashtable connectionProperties = new Hashtable();\n\n connectionProperties.put(CMQC.CHANNEL_PROPERTY, adminChannel);\n connectionProperties.put(CMQC.HOST_NAME_PROPERTY, host);\n connectionProperties.put(CMQC.PORT_PROPERTY, port);\n connectionProperties.put(CMQC.USER_ID_PROPERTY, adminUser);\n connectionProperties.put(CMQC.PASSWORD_PROPERTY, password);\n\n return new MQQueueManager(qMgrName, connectionProperties);\n\n } catch (MQException e) {\n logger.warn(\"MQException obtaining MQQueueManager\");\n logger.warn(e.getMessage());\n }\n\n return null;\n }\n \n}Obtain the Queue's backout thresholdimport com.ibm.mq.*;\nimport com.ibm.mq.constants.CMQC;\nimport org.apache.commons.logging.Log;\nimport org.apache.commons.logging.LogFactory;\nimport org.springframework.beans.factory.annotation.Value;\nimport org.springframework.boot.CommandLineRunner;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class Runner {\n protected final Log logger = LogFactory.getLog(getClass());\n\n @Value(\"${app.mq.queue:DEV.QUEUE.1}\")\n private String queueName = \"\";\n\n private final MQQueueManager mqQueueManager;\n\n Runner(MQQueueManager mqQueueManager) {\n this.mqQueueManager = mqQueueManager;\n }\n\n @Bean\n CommandLineRunner init() {\n return (args) -> {\n logger.info(\"Determining Backout threshold\");\n try {\n int[] selectors = {\n CMQC.MQIA_BACKOUT_THRESHOLD,\n CMQC.MQCA_BACKOUT_REQ_Q_NAME };\n int[] intAttrs = new int[1];\n byte[] charAttrs = new byte[MQC.MQ_Q_NAME_LENGTH];\n\n int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_INQUIRE | MQC.MQOO_SAVE_ALL_CONTEXT;\n MQQueue myQueue = mqQueueManager.accessQueue(queueName, openOptions, null, null, null);\n logger.info(\"Queue Obtained\");\n\n MQManagedObject moMyQueue = (MQManagedObject) myQueue;\n moMyQueue.inquire(selectors, intAttrs, charAttrs);\n\n int boThresh = intAttrs[0];\n String backoutQname = new String(charAttrs);\n\n logger.info(\"Backout Threshold: \" + boThresh);\n logger.info(\"Backout Queue: \" + backoutQname);\n\n } catch (MQException e) {\n logger.warn(\"MQException Error obtaining threshold\");\n logger.warn(e.getMessage());\n }\n };\n }\n}\n"} +{"text": "### Human: I have an application which creates xmsffdc*.FDC ( replace * by some number ) . Not i want to stop creation of this FDC file as due to an issue there can be thousands of it generated which would fill space and create clean up issues too.My preferred way is to create this FDC file to a desired location such as\non a different mount ( so that disk where process collects data do not get impacted ) orTo stop the creation of FDC file using some environment file.What are the ways to accomplish 1 and 2 ? Note i am using IBM MQ7.5 and 8.0 client version### Assistant: As it says inIBM Knowledge Center: FFDC configuration for XMS .NET applicationsBy default, all FFDC files are written to the current directory.\nHowever, if required, you can specify a different directory by\nchangingffdcDirectoryin theTracesection of the application\nconfiguration file. In the following example, all trace files are\nlogged to the directoryc:\\client\\ffdc:.\n \nYou can disable them by settingFFDCtofalsein\ntheTracesection of the application configuration file.\n"} +{"text": "### Human: In MQ we have sender channel and receiver channel.Communication is started by sender channel and only receiver channel has SSLCAUTH attributeSo does certificate of RECEIVER channel MQ is validated by SENDER side or only certificate of SENDER channel MQ is validated by RECEIVER side?### Assistant: The queue manager initiating the connection always validates the cert presented by the other queue manager as long as theSSLCIPHattribute is populated. The cert presented must be trusted and not expired.On the receiving queue manager the sending queue manager cert is always validated if present. HavingSSLCAUTH(REQUIRED)and/or a value specified in theSSLPEERmandate that the sending queue managerMUSThave a certificate.In a TLS session the initiator is the TLS client. A MQ sender channel is always the TLS client. TheSSLCAUTHattribute stands for SSL Client Auth, by setting this toREQUIREDyou tell the receiver that the sender must have a cert. Having aSSLPEERin the receiver also behaves the same in that it requires the sender to have a cert.\n"} +{"text": "### Human: Can someone please provide the commands to replace the MQ channel IP and port and using command line in IBM MQ.Below Command is not workingALTER CHANNEL('TEC1APP.TO.OCMT') CHLTYPE (SDR) CONNAME('192.168.0.1(1415)') REPLACE### Assistant: To change IP to 192.168.0.2 and port number to 1416, below command can be usedALTER CHANNEL('TEC1APP.TO.OCMT') CHLTYPE (SDR) CONNAME('192.168.0.2(1416)')\n"} +{"text": "### Human: Currently I am trying to connect to a queue manager using C++ in a Linux machine, and MQCONNX function, making use of MQCD structure to set server, channel, transport type, etc. Once compiled and run, I get a 2058 reason code (Queue Manager Name error).I am using the following code:extern \"C\" {\n#include \n#include \n}\n#include \n#include \n#include \n#include \n\nusing namespace std;\n\nint main ( int argc, char * * argv ) {\n printf( \"TESTING QUEUE MANAGER CONNECTION\\n\" );\n \n MQHCONN sourceConnectionHandle; \n MQLONG completionCode = 0;\n MQLONG reasonCode = 0;\n MQCD connectionDescriptor = {MQCD_CLIENT_CONN_DEFAULT};\n connectionDescriptor.TransportType = MQXPT_TCP;\n strcpy(connectionDescriptor.ChannelName, \"DEV.APP.SVRCONN\");\n strcpy(connectionDescriptor.ConnectionName,\"mqprimary(1414)\");\n \n MQCNO connectionOptions = {MQCNO_DEFAULT}; \n connectionOptions.ClientConnPtr = &connectionDescriptor;\n \n MQCONNX(\" \", &connectionOptions, &sourceConnectionHandle, &completionCode, &reasonCode);\n \n if(MQCC_OK != completionCode)\n { \n printf(\"MQCONNX ended with reason code %d connecting to source queue manager.\\n\", reasonCode);\n }\n else\n { \n printf (\"Connected to Source Queue Manager.\\n\");\n }\n}I have tried to connect to the queue manager with setenv and MQCONN as follow, without using MQCD structure, and it worked fine, but I need to do this using MQCONNX and MQCD:setenv(\"MQSERVER\",\"DEV.APP.SVRCONN/TCP/mqprimary(1414)\",1);\nMQCONN(\" \", &sourceConnectionHandle, &completionCode, &reasonCode);Any idea why a 2058 reason code is being returned using MQCONNX?Thanks in advance for your help.### Assistant: The MQCD was added to version 2 of the MQCNO structure. You need to setconnectionOptions.Version = MQCNO_VERSION_2(or higher if you want to use additional fields of the CNO)\n"} +{"text": "### Human: I'm trying tho use simplified the JMS MQ connection from exampleJmsPutGet.javaprivate static void testQueueManagerNew() throws JMSException {\n \n JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\n JmsConnectionFactory cf = ff.createConnectionFactory();\n\n cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, \"\");\n cf.setIntProperty(WMQConstants.WMQ_PORT, 1414);\n cf.setStringProperty(WMQConstants.WMQ_CHANNEL, \"MY_CNL\");\n// cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\n \n cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_BINDINGS);\n cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, \"\"); //it should use default QM\n\n JMSContext context = cf.createContext();\n Destination destination = context.createQueue(\"queue:///\" + \"MY_QUEUE\");\n\n long uniqueNumber = System.currentTimeMillis() % 1000;\n TextMessage message = context.createTextMessage(\"Your lucky number today is \" + uniqueNumber);\n\n JMSProducer producer = context.createProducer();\n producer.send(destination, message);\n LOGGER.info(\"Sent message:{}{}\", message, System.lineSeparator());\n\n JMSConsumer consumer = context.createConsumer(destination); // autoclosable\n String receivedMessage = consumer.receiveBody(String.class, 15000); // in ms or 15 seconds\n LOGGER.info(\"Rreceived message:{}{}\", receivedMessage, System.lineSeparator());\n }The changes I did are using the defaut Queue Manager (WMQConstants.WMQ_QUEUE_MANAGER is empty string), using the 'Binding' Connection Mode (WMQConstants.WMQ_CM_BINDINGS) and removing the host (WMQConstants.WMQ_HOST_NAME is empty string). I received following exception:com.ibm.msg.client.jms.DetailedIllegalStateRuntimeException: JMSWMQ0018: Failed to connect to queue manager '' with connection mode 'Bindings' and host name '(1414)'.\n at com.ibm.msg.client.jms.DetailedIllegalStateException.getUnchecked(DetailedIllegalStateException.java:274)\n at com.ibm.msg.client.jms.internal.JmsErrorUtils.convertJMSException(JmsErrorUtils.java:173)\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createContext(JmsConnectionFactoryImpl.java:478)\n at poc.ibmmq.defaultqm.DefaultQM.testQueueManagerNew(DefaultQM.java:86)\n at poc.ibmmq.defaultqm.DefaultQM.main(DefaultQM.java:59)\nCaused by: com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2059' ('MQRC_Q_MGR_NOT_AVAILABLE').\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:203)\n at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:418)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:8475)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:7815)\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl._createConnection(JmsConnectionFactoryImpl.java:303)\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createContext(JmsConnectionFactoryImpl.java:444)It works with 'Client' Connection Mode when I specify host, but not with Binding. Also 'Binding' connection mode works when Queue Manager is specified (no default used).\nIs there necessary any extra Queue Manager setting?### Assistant: In order to connect to a queue manager with 'Binding' connection mode, the queue manager must be on the same machine (same O/S image) as the application. 'Binding' connection mode uses inter-process - aka shared memory - to make the connection.When making a connection using 'Client' connection mode, the application connects to the queue manager using a TCP/IP socket, with a connection made to the host and port number provided.When making a connection using 'Client' connection mode, it is not necessary to provide a queue manager name on the connection call if you are happy to connect to whichever queue manager appears at the other end of the TCP/IP socket.When making a connection using 'Binding' connection mode, the queue manager name is used to determine which local process to make the inter-process request to. You can only omit this name if you have nominated one of your locally hosted queue managers to be the default queue manager on this machine. It is not good enough to only have one queue manager, you must still nominate it to be the default.In order to see whether you have any queue manager marked as the default on your machine, issue the following command:dspmq -o defaultIf you have not got a default queue manager, you can make one of your locally hosted queue managers into the default one by following the instructionshere.\n"} +{"text": "### Human: I am trying to consume messages from three IBM MQ queues using JMS.So, there are three @JmsListener in my spring boot application.I have a doubt about it, how will they behave if all consumer can consume from their respective queues.Will there be any concurrency?If not what is the best way to concurrently consume from queues as I can't afford the serial execution of the application.Thanks in advance :)### Assistant: On the JmsListener annotation you can set the concurrency behavoir:concurrencypublic abstract String concurrencyThe concurrency limits for the listener, if any. Overrides the value\n defined by the container factory used to create the listener\n container. The concurrency limits can be a \"lower-upper\" String \u2014 for\n example, \"5-10\" \u2014 or a simple upper limit String \u2014 for example, \"10\",\n in which case the lower limit will be 1.Note that the underlying container may or may not support all\n features. For instance, it may not be able to scale, in which case\n only the upper limit is used.Source:https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/jms/annotation/JmsListener.html#concurrency--Each Listener runs in it's own Thread.You can easily test this by printing the message received. This will output the Thread it runs in. For example:2020-06-06 11:26:54.339 INFO 23404 --- [enerContainer-1] c.e.d.ShippingService : Hello World!The thread name is [enerContainer-1]Please read more in the documentation about Spring and JMShttps://docs.spring.io/spring/docs/current/spring-framework-reference/integration.html#jms-receiving\n"} +{"text": "### Human: I have DMLC listener that listens to messages from Websphere MQ 7.5.0.2. When there is a poison message, i wish to put it in the back-out Q after the retry count in MQ expires.I have configured the back-out queue on the MQ, with the threshold value at 3.However, what actually happens wen i throw an exception on the listener, the message is still being redelivered way more than 3 times and the the message goes back to the same queue every time and the cycle is repeated continuously.\nThe back-out threshold increases in MQ, but never the message never goes to the back-out Queue.Am i missing something somewhere?What should i do if i want the message to be put in the back-out Queue.\nReferring to the official docs below, there isn't any additional configuration for this.Websphere Poison Message HandlingIs there any additional configurations that I need to do ?Queue DetailsAMQ8409: Display Queue details. (This is the Source Queue)\n QUEUE(Q3) TYPE(QLOCAL)\n ACCTQ(QMGR) ALTDATE(2020-03-12)\n ALTTIME(22.16.44) BOQNAME(ORANGE.LOCAL.QUEUE)\n BOTHRESH(4) CLUSNL( )\n CLUSTER( ) CLCHNAME( )\n CLWLPRTY(0) CLWLRANK(0)\n CLWLUSEQ(QMGR) CRDATE(2019-09-16)\n CRTIME(15.22.49) CURDEPTH(2)\n CUSTOM( ) DEFBIND(OPEN)\n DEFPRTY(0) DEFPSIST(NO)\n DEFPRESP(SYNC) DEFREADA(NO)\n DEFSOPT(SHARED) DEFTYPE(PREDEFINED)\n DESCR( ) DISTL(NO)\n GET(ENABLED) HARDENBO\n INITQ( ) IPPROCS(0)\n MAXDEPTH(5000) MAXMSGL(4194304)\n MONQ(QMGR) MSGDLVSQ(PRIORITY)\n NOTRIGGER NPMCLASS(NORMAL)\n OPPROCS(0) PROCESS( )\n PUT(ENABLED) PROPCTL(COMPAT)\n QDEPTHHI(80) QDEPTHLO(20)\n QDPHIEV(DISABLED) QDPLOEV(DISABLED)\n QDPMAXEV(ENABLED) QSVCIEV(NONE)\n QSVCINT(999999999) RETINTVL(999999999)\n SCOPE(QMGR) SHARE\n STATQ(QMGR) TRIGDATA( )\n TRIGDPTH(1) TRIGMPRI(0)\n TRIGTYPE(FIRST) USAGE(NORMAL)\n\n\nAMQ8409: Display Queue details. (This is the backout queue)\n QUEUE(ORANGE.LOCAL.QUEUE) TYPE(QLOCAL)\n ACCTQ(QMGR) ALTDATE(2020-03-12)\n ALTTIME(21.27.17) BOQNAME( )\n BOTHRESH(0) CLUSNL( )\n CLUSTER( ) CLCHNAME( )\n CLWLPRTY(0) CLWLRANK(0)\n CLWLUSEQ(QMGR) CRDATE(2020-03-12)\n CRTIME(21.27.17) CURDEPTH(0)\n CUSTOM( ) DEFBIND(OPEN)\n DEFPRTY(0) DEFPSIST(NO)\n DEFPRESP(SYNC) DEFREADA(NO)\n DEFSOPT(SHARED) DEFTYPE(PREDEFINED)\n DESCR( ) DISTL(NO)\n GET(ENABLED) HARDENBO\n INITQ( ) IPPROCS(0)\n MAXDEPTH(5000) MAXMSGL(4194304)\n MONQ(QMGR) MSGDLVSQ(PRIORITY)\n NOTRIGGER NPMCLASS(NORMAL)\n OPPROCS(0) PROCESS( )\n PUT(ENABLED) PROPCTL(COMPAT)\n QDEPTHHI(80) QDEPTHLO(20)\n QDPHIEV(DISABLED) QDPLOEV(DISABLED)\n QDPMAXEV(ENABLED) QSVCIEV(NONE)\n QSVCINT(999999999) RETINTVL(999999999)\n SCOPE(QMGR) SHARE\n STATQ(QMGR) TRIGDATA( )Queue PermissionsAMQ8864: Display authority record details.\n PROFILE(Q3) ENTITY(useradmin@DT-MachineName)\n ENTTYPE(PRINCIPAL) OBJTYPE(QUEUE)\n AUTHLIST(BROWSE,CHG,CLR,DLT,DSP,GET,INQ,PUT,PASSALL,PASSID,SET,SETALL,SETID)\nAMQ8864: Display authority record details.\n PROFILE(Q3) ENTITY(mqm@DT-MachineName)\n ENTTYPE(GROUP) OBJTYPE(QUEUE)\n AUTHLIST(BROWSE,CHG,CLR,DLT,DSP,GET,INQ,PUT,PASSALL,PASSID,SET,SETALL,SETID)\nAMQ8864: Display authority record details.\n PROFILE(Q3) ENTITY(user@domainName)\n ENTTYPE(PRINCIPAL) OBJTYPE(QUEUE)\n AUTHLIST(BROWSE,CHG,CLR,DLT,DSP,GET,INQ,PUT,PASSALL,PASSID,SET,SETALL,SETID)\nAMQ8864: Display authority record details.\n PROFILE(Q3) ENTITY(user2@domainName)\n ENTTYPE(PRINCIPAL) OBJTYPE(QUEUE)\n AUTHLIST(BROWSE,CHG,CLR,DLT,DSP,GET,INQ,PUT,PASSALL,PASSID,SET,SETALL,SETID)\n\nAMQ8864: Display authority record details.\n PROFILE(ORANGE.LOCAL.QUEUE) ENTITY(useradmin@DT-MachineName)\n ENTTYPE(PRINCIPAL) OBJTYPE(QUEUE)\n AUTHLIST(BROWSE,CHG,CLR,DLT,DSP,GET,INQ,PUT,PASSALL,PASSID,SET,SETALL,SETID)\nAMQ8864: Display authority record details.\n PROFILE(ORANGE.LOCAL.QUEUE) ENTITY(mqm@DT-MachineName)\n ENTTYPE(GROUP) OBJTYPE(QUEUE)\n AUTHLIST(BROWSE,CHG,CLR,DLT,DSP,GET,INQ,PUT,PASSALL,PASSID,SET,SETALL,SETID)Queue Manager PermissionsAMQ8864: Display authority record details.\n PROFILE(SELF) ENTITY(user@domainName)\n ENTTYPE(PRINCIPAL) OBJTYPE(QMGR)\n AUTHLIST(ALTUSR,CHG,CONNECT,DLT,DSP,INQ,SET,SETALL,SETID,SYSTEM)\nAMQ8864: Display authority record details.\n PROFILE(@CLASS) ENTITY(user@domainName)\n ENTTYPE(PRINCIPAL) OBJTYPE(QMGR)\n AUTHLIST(NONE)The Following error is seen the AMQERR01.LOG14-03-2020 00:18:01 - Process(7752.172) User(MUSR_MQADMIN) Program(amqzlaa0.exe)\n Host(DT-MachineName) Installation(Installation1)\n VRMF(7.5.0.2) QMgr(QM1)\n \nAMQ8077: Entity 'user@domainNname' has insufficient authority to access object\n'ORANGE.LOCAL.QUEUE'.\n\nEXPLANATION:\nThe specified entity is not authorized to access the required object. The\nfollowing requested permissions are unauthorized: put/passall\nACTION:\nEnsure that the correct level of authority has been set for this entity against\nthe required object, or ensure that the entity is a member of a privileged\ngroup. \n----- amqzfubn.c : 515 --------------------------------------------------------\n14-03-2020 00:18:01 - Process(7752.172) User(MUSR_MQADMIN) Program(amqzlaa0.exe)\n Host(DT-MachineName) Installation(Installation1)\n VRMF(7.5.0.2) QMgr(QM1)\n \nAMQ8077: Entity 'user@domainNname' has insufficient authority to access object\n'DLQ'.\n\nEXPLANATION:\nThe specified entity is not authorized to access the required object. The\nfollowing requested permissions are unauthorized: put/passall\nACTION:\nEnsure that the correct level of authority has been set for this entity against\nthe required object, or ensure that the entity is a member of a privileged\ngroup.### Assistant: The key error you have provided from the queue manager'sAMQERR01.LOGis below:AMQ8077: Entity 'user@domainNname' has insufficient authority to access object\n'ORANGE.LOCAL.QUEUE'.\n\nEXPLANATION:\nThe specified entity is not authorized to access the required object. The\nfollowing requested permissions are unauthorized: put/passallBased on the error provided, the user which is attempting to access the back out queue isuser@domainNname.From all of the information provided it appears thatuser@domainNnameis only missing permissions toORANGE.LOCAL.QUEUE, the following command should add the require permissions:SET AUTHREC PROFILE(ORANGE.LOCAL.QUEUE) OBJTYPE(QUEUE) PRINCIPAL('user@domainNname') AUTHADD(PUT,PASSALL)Note that back out queue processing in JMS will first attempt to use the specifiedBOQNAMEfor the queue that is being consumed from, if it is unable to open or put to this queue for any reason such as permission error, or queue full, it will then attempt to put to the queue manager's dead letter queue. This is why you also see an error in your logs statinginsufficient authority to access object 'DLQ'.\n"} +{"text": "### Human: Problem Statement:When connecting to IBM MQ, credentials are taken from the user running the application, and not the MQ configuration properties set in the application trying to connect.ERROR: UnauthorizedEX:var htProperties = new Hashtable();\n htProperties[MQC.HOST_NAME_PROPERTY] = \"IPADDRESS\";\n htProperties[MQC.PORT_PROPERTY] = PORT;\n htProperties[MQC.CHANNEL_PROPERTY] = \"CHANNEL\";\n htProperties[MQC.USER_ID_PROPERTY] = \"user_id\";\n htProperties[MQC.PASSWORD_PROPERTY] = \"password\";I expect the Queue Manager to validate the credentials passed in to the Hashtable on the target system, but it takes the current login from my source computer and checks if their is a local account on the target system.How can I override the local authentication and only use the authentication my services provide? What would I have to set up in terms of credentials on the target system?I found this in the documentation..ALTER QMGR CONNAUTH(USE.PW)\nDEFINE AUTHINFO(USE.PW) +\nAUTHTYPE(IDPWOS) +\nFAILDLAY(10) +\nCHCKLOCL(OPTIONAL) +\nCHCKCLNT(REQUIRED)\nREFRESH SECURITY TYPE(CONNAUTH)However, I don't know what the value ofUSE.PWis, and when going to execute it all at once, there are multiple syntax errors. Also, do I turnCHCKLOCL(OPTIONAL)? What is the correct logic..### Assistant: In order to have the queue manager validate the credentials you provide, you must configure it to do so. You have already found the comment you need. To explain the command, as that seems to be your question:You must create an AUTHINFO object containing the configuration your need, or alter an existing one.Eitherof these MQSC commands would be fine. The stringUSE.PWis simply the name of the object in the first example.DEFINE AUTHINFO(USE.PW) +\n AUTHTYPE(IDPWOS) +\n FAILDLAY(10) +\n CHCKLOCL(OPTIONAL) +\n CHCKCLNT(REQUIRED) +\n ADOPTCTX(YES)\n\n\nALTER AUTHINFO(SYSTEM.DEFAULT.AUTHINFO.IDPWOS) +\n AUTHTYPE(IDPWOS) +\n CHCKLOCL(OPTIONAL) +\n CHCKCLNT(REQUIRED) +\n ADOPTCTX(YES)You must then ensure the queue manager is using the configuration in this object by providing the name of the object you used, into theCONNAUTHfield on the queue manager. The name would either beUSE.PWorSYSTEM.DEFAULT.AUTHINFO.IDPWOSdepending on which of the above commands you used.ALTER QMGR CONNAUTH(name-of-object)Then finally, you must tell the queue manager that the configuration has been changed with the following command:REFRESH SECURITY TYPE(CONNAUTH)With regard to the values to use in theCHCKLOCLandCHCKCLNTfields. They have the same selection of values, butCHCKLOCLapplies to connections that are made using local bindings connection (IPC), andCHCKCLNTapplies to connections that are made using a client connection (network). If you haveOPTIONAL, then if a password is provided it will be checked, but passwords are not mandated. It you haveREQUIREDthen if you do not provide a password to be checked the queue manager will not let you in.\n"} +{"text": "### Human: How can I use the IBM MQ Java APIs to query for the maximum queue depth attribute of a queue?### Assistant: You can use MQ PCF to retrieve attribute values of a queue.i.e.request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_Q);\n\n/**\n * You can explicitly set a queue name like \"TEST.Q1\" or\n * use a wild card like \"TEST.*\"\n */\nrequest.addParameter(CMQC.MQCA_Q_NAME, \"*\");\n\n// Add parameter to request only local queues\nrequest.addParameter(CMQC.MQIA_Q_TYPE, CMQC.MQQT_LOCAL);\n\n// Add parameter to request all of the attributes of the queue\nrequest.addParameter(CMQCFC.MQIACF_Q_ATTRS, new int [] { CMQC.MQCA_Q_NAME,\n CMQC.MQIA_CURRENT_Q_DEPTH,\n CMQC.MQIA_MAX_Q_DEPTH\n });\n\nresponses = agent.send(request);\n\nfor (int i = 0; i < responses.length; i++)\n{\n if ( ((responses[i]).getCompCode() == CMQC.MQCC_OK) &&\n ((responses[i]).getParameterValue(CMQC.MQCA_Q_NAME) != null) )\n {\n String name = responses[i].getStringParameterValue(CMQC.MQCA_Q_NAME);\n if (name != null)\n name = name.trim();\n\n int depth = responses[i].getIntParameterValue(CMQC.MQIA_CURRENT_Q_DEPTH);\n int maxDepth = responses[i].getIntParameterValue(CMQC.MQIA_MAX_Q_DEPTH);\n }\n}I thought I posted MQListQueueAttributes01.java to StackOverflow but I cannot find it. It is on myblog.It is a complete and fully functioning Java/MQ/PCF program to retrieve all attributes values of a queue. If you click on \"PCF\" category on my blog, you will find a variety of complete sample Java/MQ/PCF programs.\n"} +{"text": "### Human: I had theIBM MQ MacOS toolkitworking well on MacOS High Sierra, but I have now upgraded to Catalina and it's not working.In this new release Gatekeeper checks binaries started from Terminal.app, so when I run (say)runmqsc, I get an annoying pop up saying\"runmqsc\" cannot be opened because the\ndeveloper cannot be verified.\nmacOS cannot verify that this app is free \nfrom malware.\n\nChrome downloaded this file on 15 September 2019 \nfrom www14.software.ibm.com.\n\n [Move to Bin] [Cancel]I've tried some of the solutions for this general problem, (for examplehere), but it would be better if IBM could supply properly signed software so that it worked without these work-arounds.Does anyone know if there is a version of the IBM MQ MacOS toolkit that works properly on MacOS Catalina?### Assistant: Thanks for raising this, we are aware of the problem and we are looking into it. The problem applies to all non-notarised executables on Catalina.Starting with Catalina, Apple has tightened what apps are allowed to run on a Mac. All applications and dlls must be signed and notarised.It is possible to get the client to run on Catalina, but involves a long winded process of removing each executable / dll from quarantine when it is required to be run.If you take a look at System Preferences -> Security & Privacy on the General tab, you will see a notification of the last app / dll that was not allowed to run. You can remove it from quarantine from that panel, but need to repeat the process for each exe and dll.Update as of Dec 2020The IBM MQ macOS Toolkit is made available as a signed package (.pkg)https://ibm.biz/mqdevmacclientThis means that you can download and double click to install. The installer by default installs in/opt/mqm, but you can move it after the install.On my Mac I have/opt/mqmas a symbolic link to a directory in my home location~Remember to add/opt/mqm/binand/opt/mqm/samp/binto the path\nand/opt/mqm/lib64toDYLD_LIBRARY_PATH\n"} +{"text": "### Human: I have a XMS publish app, that is working, but it is including JMS headers as part of the message. My subscribe app is actually a python app, and I was wondering if it is possible to remove the JMS headers from the XMS app. I know it is possible in JMS, but is it possible in C# / XMS.My C# code is fairly simple (with some of the details left out -// Get an instance of factory.\n factoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\n\n // Create WMQ Connection Factory.\n cf = factoryFactory.CreateConnectionFactory();\n\n // Set the properties\n cf.SetStringProperty(XMSC.WMQ_HOST_NAME, conn.host);\n ...\n\n // Create connection.\n connectionWMQ = cf.CreateConnection();\n\n // Create session\n sessionWMQ = connectionWMQ.CreateSession(false, AcknowledgeMode.AutoAcknowledge);\n\n // Create destination\n destination = sessionWMQ.CreateTopic(conn.topic_name);\n\n // Create producer\n producer = sessionWMQ.CreateProducer(destination);\n\n // Start the connection to receive messages.\n connectionWMQ.Start();\n\n // Create a text message and send it.\n textMessage = sessionWMQ.CreateTextMessage();\n textMessage.Text = xmsJson.toJsonString();\n producer.Send(textMessage);In MQ /JMS I can usesetTargetClientto remove the JMS headers -private void setToNoJMSHeaders(Destination destination) {\n try {\n MQDestination mqDestination = (MQDestination) destination;\n mqDestination.setTargetClient(WMQConstants.WMQ_CLIENT_NONJMS_MQ);\n } catch (JMSException jmsex) {\n logger.warning(\"Unable to set target destination to non JMS\");\n }\n }I was wondering if I can do the same to the topic destination in XMS// Create destination\n destination = sessionWMQ.CreateTopic(conn.topic_name);\n // Configure the destination to Non-JMS\n ... ???### Assistant: Yes, you should be able to do thisTry// Create destination\n destination = sessionWMQ.CreateTopic(conn.topic_name);\n destination.SetIntProperty(XMSC.WMQ_TARGET_CLIENT, XMSC.WMQ_TARGET_DEST_MQ);See:https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.1.0/com.ibm.mq.ref.dev.doc/prx_wmq_target_client.htm\n"} +{"text": "### Human: I have below code which reads file from windows system and places that in ibm-mq. I am not getting any error. But when I checked message in IBM Queue I am not having any message.public class FileToJMS{ \n\n public static void main(String args[]) throws Exception\n {\n final Map headers=new HashMap();\n headers.put(\"xxx\",\"yy\");\n headers.put(\"yyy\",\"zzz\");\n headers.put(\"xyz\",\"1\");\n CamelContext camelContext = new DefaultCamelContext();\n\n MQQueueConnectionFactory connectionFactory = new MQQueueConnectionFactory();\n connectionFactory.setHostName(\"zrled201\");\n try {\n connectionFactory.setPort(1234);\n connectionFactory.setQueueManager(\"xxxxx\");\n connectionFactory.setChannel(\"channel\");\n connectionFactory.setTransportType(1);\n } catch (JMSException e) {\n e.printStackTrace();\n }\n camelContext.addComponent(\"wmq\", JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));\n\n try {\n camelContext.addRoutes(new RouteBuilder() {\n public void configure() throws Exception {\n from(\"file:C:/apche_camel/wmq_inputs/file_Name.xml?noop=true\").process(new Processor() {\n public void process(Exchange exchange) throws Exception {\n\n exchange.getIn().setHeaders(headers);\n }\n })\n .to(\"wmq:queue:ESB.ENTRY.SERVICE.IN\");\n System.out.println(\"done\");\n }\n });\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n camelContext.start();\n Thread.sleep(10000);\n camelContext.stop();\n }I have gone through debug information on the console I have found some thing like[Camel (camel-1) thread #0 - \n file://C:/apche_camel/wmq_inputs/SH_TEST_04.xml] DEBUG \n org.apache.camel.component.file.FileEndpoint - Using Generic file \n process strategy: \n org.apache.camel.component.file.strategy.GenericFileRename\n ProcessStrategy@74b7bb95\n 1691 [Camel (camel-1) thread #0 - \n file://C:/apche_camel/wmq_inputs/JP_SH_TEST_04.xml] DEBUG \n org.apache.camel.component.file.strategy.MarkerFileExclusive\nReadLockStrategy - Prepare on startup by deleting orphaned lock \n files from: C:\\apche_camel\\wmq_inputs\\SH_TEST_04.xml\n1691 [Camel (camel-1) thread #0 - \nfile://C:/apche_camel/wmq_inputs/SH_TEST_04.xml] DEBUG \n org.apache.camel.component.file.FileConsumer -\n Cannot poll as directory does not exists or its not a directory: \n C:\\apche_camel\\wmq_inputs\\SH_TEST_04.xml\n 1691 [Camel (camel-1) thread #0 - \n file://C:/apche_camel/wmq_inputs/SH_TEST_04.xml] DEBUG \n org.apache.camel.component.file.FileConsumer - Took\n 0.000 seconds to poll: C:\\apche_camel\\wmq_inputs\\SH_TEST_04.xml\n 2197 [Camel (camel-1) thread #0 - \n file://C:/apche_camel/wmq_inputs/SH_TEST_04.xml] DEBUG \n org.apache.camel.component.file.FileConsumer - \n Cannot poll as directory does not exists or its not a directory: \nC:\\apche_camel\\wmq_inputs\\SH_TEST_04.xml\n2197 [Camel (camel-1) thread #0 - \n file://C:/apche_camel/wmq_inputs/SH_TEST_04.xml] DEBUG \norg.apache.camel.component.file.FileConsumer - Took 0.000 seconds to \n poll: C:\\apche_camel\\wmq_inputs\\_H_TEST_04.xml\n 2696 [Camel (camel-1) thread #0 - \n file://C:/apche_camel/wmq_inputs/_SH_TEST_04.xml] DEBUG \n org.apache.camel.component.file.FileConsumer - Cannot poll as directory \n does not exists or its not a directory: \n C:\\apche_camel\\wmq_inputs\\SH_TEST_04.xmlAs one can see debug infromation shows there is \"no such file or directory\". I thought like it was permission error and I tried with normal java code and the code is able to read the file sucessfull. exactly I dont know where the problem is. Did missed anything in the code to place file in mq??### Assistant: The uri that you have should be the directory path, without the file name. You can specify the file name with the fileName option:from(\"file:C:/apche_camel/wmq_inputs?fileName=file_Name.xml&noop=true\")https://camel.apache.org/file2.html\n"} +{"text": "### Human: I am trying to run a java application in bindings mode in IBM MQ docker image, but i am not able to find a proper resource for the same. Do IBM MQ has support for bindings mode in IBM MQ Docker image?### Assistant: Yes with version limits. If the application is in the same container as the queue manager you can use local bindings to connect them. If they are not then as long as you are using MQ version 9.0.3 or above you can share container namespaces to run the application in a different container than the queue manager.Source Fromthis knowledge center pageon IBM MQ Container Support:You can use namespacing to share the namespaces of the container for the queue manager with other containers, in order to locally bind applications to a queue manager running in separate containers. For more information, seeRunning local binding applications in separate containers.\n"} +{"text": "### Human: I am new to TLS in java. I have files with KDB, RDB, and STN extensions.\nHow can I setup a JKS keystore and use that in a java application to implement TLS, which uses IBM WebSphere MQ client?My doubts are:Can I use ikeyman for the conversion?Can I convert the KDB files directly to JKS keystore?Do I need any other certificates to imlpement TLS in the IBM native MQ test application?How can I add the TLS parameters to IBM Native MQ API?I have tried to launch ikeyman. But I can't.### Assistant: You do not mention which version of the MQ client you are using, for the purpose of this answer I will assume you are using a MQ client 7.1 or later.You can build a Java Key Store (jks) from a source kdb file.This will take two steps to complete:Create an empty Java Key Store (jks):runmqckm -keydb -create -db target.jks -type jksThis will prompt for a password that will be used to protect the jks file.Import all certs from the source kdb file to the target jks file created above:runmqckm -cert -import -db source.kdb -type cms -target target.jks -target_type jksThis will prompt for two passwords, the first is the password of the kdb file, the second is the password of the jks file. If you add the flag '-stashed' it will eliminate the first password prompt.You can then list the certs contained in both the kdb and the jks to compare and validate that all certs were copied over:runmqckm -cert -list -db source.kdb -type cms -stashedThe command above will NOT prompt for a password because of the-stashedflag.runmqckm -cert -list -db target.jks -type jksThe command above WILL prompt for the jks password.NotesThe kdb/rdb/sth files together represent an IBM Certificate Management Services (CMS) keystore.There is a-keydb -convertoption that indicates it should have the same outcome as the two steps I provided above, however I have noted that it does not always copy all of the certs.\n"} +{"text": "### Human: I am doing lot of analysis for a new Java MQ client requirement got some doubts. Currently in the Unix system Queues Queue manager all created where MQ server is running.In order to run Java MQ client we are going to install MQ client on other Unix Solaris system. Mean while we had one windows server where MQ client installed before going to MQ client installation on unix System need to clear my clarifications.Since I am new MQ.Can we run Java MQ client from windows server to connect MQ server unix system(Queues,Queuue Manager)If yes what need for this to connect Windows Server to unix SolarisThe code is compiled with MQ librariesIs any error will come to face.It would be great if you provide steps or solution.### Assistant: Yes, you can run the Java MQ client from any machine to connect to a queue manager on any other machine. The MQ Clients (Java, 'C' or .NET version) all support any platform to any platform combinations, and all support any MQ version to any MQ version. So for example, you can have a V8 Client on Windows connecting to a V9 Queue manager on Unix. Equally you can have a V9 Client on Windows connection to a V8 Queue manager on Unix, i.e. any to any version can be upwards or downwards.In order to connect a client to a queue manager, you will need the client libraries on the client machine, in your case the Java client.You will also need to ensure that your queue manager has a TCP/IP listener running and that you know the port number.You will need a channel definition on the queue manager of a type called SVRCONN, and know the name of it. e.g.DEFINE CHANNEL(MQGEM.SVRCONN) CHLTYPE(SVRCONN) DESCR('Channel for my client application to connect to')In order for your Java client to connect to the queue manager it will need to useThe channel nameThe host name of the machine where the queue manager is runningThe port number of the TCP/IP listenerIf you face any errors, they may be related to connectivity, because your application is connected by the network to the queue manager. Remember to pay attention to any return codes you get from MQ, they will be in the form of 4 digits, e.g. 2059. For Java you should ensure you get hold of the linked exception. It may also be useful to look in the error log of the queue manager too.You may also face security errors if this is your first use of IBM MQ. The queue manager is locked down by default so that remote applications cannot simply connect in and do damage (e.g. delete important messages from other applications!). There are a number of posts on here that describe these errors and their solutions. Best advise, get the MQRC code (4-digits) and the AMQERR01.LOG error message from the queue manager. Armed with this information you should be able to describe and diagnose any error situations you encounter.\n"} +{"text": "### Human: I have a Spring Boot app using JMSListener + IBMConnectionFactory + CCDT for connecting an IBM MQ Cluster.A set the following connection properties:\n- url pointing to a generated ccdt file\n- username (password not required, since test environment)\n- queuemanager name is NOT defined - since it's the cluster's task to decide, and a few google results, including several stackoverflow ones indicate that in my case qmgr must be set to empty string.When my Spring Boot JMSListener tries to connect to the queue, the following MQRC_UNKNOWN_ALIAS_BASE_Q error occurs:2019-01-29 11:05:00.329 WARN [thread:DefaultMessageListenerContainer-44][class:org.springframework.jms.listener.DefaultMessageListenerContainer:892] - Setup of JMS message listener invoker failed for destination 'MY.Q.ALIAS' - trying to recover. Cause: JMSWMQ2008: Failed to open MQ queue 'MY.Q.ALIAS'.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2082' ('MQRC_UNKNOWN_ALIAS_BASE_Q').\ncom.ibm.msg.client.jms.DetailedInvalidDestinationException: JMSWMQ2008: Failed to open MQ queue 'MY.Q.ALIAS'.\n at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:513)\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:215)In the MQ error log I see the following:01/29/2019 03:08:05 PM - Process(27185.478) User(mqm) Program(amqrmppa)\n Host(myhost) Installation(Installation1)\n VRMF(9.0.0.5) QMgr(MyQMGR)\n\nAMQ9999: Channel 'MyCHL' to host 'MyIP' ended abnormally.\n\nEXPLANATION:\nThe channel program running under process ID 27185 for channel 'MyCHL'\nended abnormally. The host name is 'MyIP'; in some cases the host name\ncannot be determined and so is shown as '????'.\nACTION:\nLook at previous error messages for the channel program in the error logs to\ndetermine the cause of the failure. Note that this message can be excluded\ncompletely or suppressed by tuning the \"ExcludeMessage\" or \"SuppressMessage\"\nattributes under the \"QMErrorLog\" stanza in qm.ini. Further information can be\nfound in the System Administration Guide.\n----- amqrmrsa.c : 938 --------------------------------------------------------\n01/29/2019 03:15:14 PM - Process(27185.498) User(mqm) Program(amqrmppa)\n Host(myhost) Installation(Installation1)\n VRMF(9.0.0.5) QMgr(MyQMGR)\n\nAMQ9209: Connection to host 'MyIP' for channel 'MyCHL' closed.\n\nEXPLANATION:\nAn error occurred receiving data from 'MyIP' over TCP/IP. The connection\nto the remote host has unexpectedly terminated.\n\nThe channel name is 'MyCHL'; in some cases it cannot be determined and so\nis shown as '????'.\nACTION:\nTell the systems administrator.Since the MQ error log containsQMgr(MyQMGR), whichMyQMGRvalue I did not set in the connection properties, I assume the routing seems to be fine: the MQ Cluster figured out a qmgr to use.The alias exists and points to an existing q. Bot the target q and the alias are added to the cluster via the CLUSTER(clustname) command.What can be wrong?### Assistant: Short AnswerMQ Clustering isnotused for a consumer application to find a queue to GET messages from.MQ Clusteringisused when a producer application PUTs messages to direct them to a destination.Further readingClustering is used when messages are being sent to help provide load balancing to multiple instances of a clustered queue. In some cases people use this for hot/cold failover by having two instances of a queue and keeping only onePUT(ENABLED).If an application is a producer that is putting messages to a clustered queue, it only needs to be connected to a queue manager in the cluster and have permissions to put to that clustered queue. MQ based on a number of different things will handle where to send that message.Prior to v7.1 there was only two ways to provide access to remote clustered queues:Using aQALIAS:Define a localQALIASwhich has a TARGET set to the clustered queue nameNote thisQALIASdoes not itself need to be clustered.Grant permission to put to the localQALIAS.Provide permissions to PUT to theSYSTEM.CLUSTER.TRANSMIT.QUEUE.The first option allows for granting granular access to an application for specific clustered queues in the cluster. The second option allows for the application to put to any clustered queue in the cluster or any queue on any clustered queue manager in the cluster.At 7.1 IBM added a new optional behavior, this was provided with the settingClusterQueueAccessControl=RQMNamein theSecuritystanza of theqm.ini. If this is enabled (it is not the default), then you can actually provide permission for the app to PUT to the remote clustered queues directly without the need for a localQALIAS.What clustering isnotfor is consuming applications such as your example of a JMSListener.An application that will consume from anyQLOCAL(clustered or not) must be connected to the queue manager where theQLOCALis defined.If you have a situation where there are multiple instances of a clusteredQLOCALthat arePUT(ENABLED), you would need to ensure you have consumers connected directly to each queue managers that an instance is hosted on.Based on your comment you have a CCDT with an entry such as:CHANNEL('MyCHL') CHLTYPE(CLNTCONN) QMNAME('MyQMGR') CONNAME('node1url(port1),node2url(port2)')If there are two different queue managers with different queue manager names listening onnode1url(port1)andnode2url(port2), then you have different ways to accomplish this from the app side.When you specify the QMNAME to connect to the app will expect the name to match the queue manager you connect to unless it meets one of the following:If you specify*MyQMGRit will find the channel or channels withQMNAME('MyQMGR')and pick one and connect and will not enforce that the remote queue manager name must match.If in your CCDT you haveQNAME(''), it is set to NULL, then in your app you can specify a empty queue manager name or only a space and it will find this entry in the CCDT and will not enforce that the remote queue manager name must match.In your app you specify the queue manager name as*, MQ will use any channel in the CCDT and will not enforce that the remote queue manager name must match.One limitation of CCDT is that channel name must be unique in the CCDT. Even if theQMNAMEis different you can't have a second entry with the same channel name.When you connect you are hitting the entry with twoCONNAME's and getting connected to the firstIP(port), you would only get to the secondIP(port)if at connect time the first is not available, MQ will try the second, or if you are connected and have RECONNECT enabled and then the first goes down MQ will try to connect to the first then second.If you want to have both clustered queuePUT(ENABLED)to receive traffic then you want to be able to specifically connect to each of the two queue managers to read those queues.I would suggest you add a new channel on each queue manager that has a different QM specific name that is also different from the existing name, something like this:CHANNEL('MyCHL1') CHLTYPE(CLNTCONN) QMNAME('MyQMGR1') CONNAME('node1url(port1)')\nCHANNEL('MyCHL2') CHLTYPE(CLNTCONN) QMNAME('MyQMGR2') CONNAME('node2url(port2)')This would be in addition to the existing entry.For your putting components you can continue to use the channel that can connect to either queue manager.For your getting components you can configure at least two of them, one to connect to each queue manager using the new queue manager specific CCDT entries, this way both queues are being consumed.\n"} +{"text": "### Human: This question was already answered by joshmc but I'm not understanding the answer after a lot of digging. And don't have enough points to post a comment, sorry.C# MQ Connect get Error 2035 but Java MQ Connect works wellI only have access to the client and can't change the server, which belongs to a third-party. They require we post messages to theirIBM MQ serverover the internet forXMLintegration. We have some simple Java code working fine but can't get the same thing running in.NETbecause of the 2035 issue. We have a username and password. Trying to do both from the same Windows 10 desktop. Using the version 8 client libraries in bothJavaand.NET.The answer Josh discussed was to runALTER CHL(ServerChannel) CHLTYPE(SVRCONN) MCAUSER('mq').This looks like aserver-side commandor how do we run this on the client, ideally inC#?### Assistant: The given command is an example of an MQSC command.To invoke this from your client machine will only be possible if you have been given permissions to make administrative changes on the server from your client.To try, set up an environment variable to indicate where the server is and what channel name to use:set MQSERVER=CHANNEL-NAME/TCP/hostname(port)Then use therunmqsccommand as follows:-runmqsc -c -u yourUserIdTherunmqsctool will prompt you for a password and then try to connect. If it is successful you can then type in the MQSC command. If the MQSC command fails you will have to get the owner of the queue manager to make the change for you.\n"} +{"text": "### Human: I am new to IBM-MQ and trying to understand how we can perform unit testing on message flows.I am aware of the tools like CA Lisa to do Service Virtualization and testing at system testing level.But in my case I am looking for the unit testing framework like Java Junit tests where developer can create tests and required stubs to test the IBM MQ Message flows independently.Thank You in advance.### Assistant: We write integration tests against deployed flows. We use theSpring Testframeworkand Junit as a base.Here are some thoughts about our testing:Forsynchronousdependencies we either write mock flows that we deploy in a separate IIB application, or we use JUnit helpers for things likeSMTPandLDAP.Forasynchronousdependencies like IBM MQ we use in our tests theJmsTemplateor directly the IBMMQ classes for JMSto send and receive messages. Before each test we clean the queues withPCFmessages.For file nodes we use the environment variableMQSI_FILENODES_ROOT_DIRECTORYin the real flow and in Junit to easily find the files. We also clean the File input and output directories before each test to start clean.To speed up the unit tests and to test things like assert thatno messagearrived we subscribe in our Junit tests toMonitoring Events. When we receive the Transaction End event we are sure the flow is finished and can assert that a file is there, that no message is on a certain queue, etc.\n"} +{"text": "### Human: Currently I use PCF command to delete a Queue on QMANAGER withPCFMessage message = new PCFMessage( CMQCFC.MQCMD_DELETE_Q );\nmessage.addParameter( CMQC.MQCA_Q_NAME, name);\nagent.send( message );Could I force delete if queue is occupied?I have tried without succes on QL@Override\nprotected PCFMessage getRequestRemove(String objetName,\n String qmanagerName,boolean forceQmanager) {\n PCFMessage request = new PCFMessage(CMQCFC.MQCMD_DELETE_Q);\n request.addParameter( CMQCFC.MQIACF_PURGE, CMQCFC.MQPO_YES ); \n \n request.addParameter(CMQC.MQCA_Q_NAME, objetName);\n request.addParameter(CMQC.MQIA_Q_TYPE, CMQC.MQQT_LOCAL);\n return request;\n}Error code is Caused by: com.ibm.mq.pcf.PCFException: MQJE001: Code ach\u00e8vement '2', Motif '3014'.\nMy PCF library is 7.1.0.4regards### Assistant: There is no FORCE option on a DELETE queue command. If the queue is currently open by an application for input and they are waiting in an MQGET you can kick them out with the following command.MQSCALTER QLOCAL(q-name) GET(DISABLED)PCFPCFMessage message = new PCFMessage (CMQCFC.MQCMD_CHANGE_Q);\nmessage.addParameter(CMQC.MQCA_Q_NAME, name);\nmessage.addParameter(CMQC.MQIA_INHIBIT_GET, CMQC.MQQA_GET_INHIBITED);\nagent.send(message);However if the queue is currently open and the application is not currently in either an MQGET or an MQPUT, then you cannot kick them out in this way, your only option then is to find the application in question usingDISPLAY CONN, and then issue aSTOP CONNto get them to release the queue.The mostly likely occupation of a queue is the long MQGET-waiter, and so the above example command will help for most cases.\n"} +{"text": "### Human: we are using websphere MQ version 9.0.0.1,basically we have configured the active/passive cluster setup on linux machine, all queue managers are running on fine on both active/passive node.we have configured the channels queues in queue managers,\nwhile application is trying to connecting my queue manager we are facing errorsbelow error getting at application side.The Security athuntication was not valid that supplied for QUEUEMANAGER 'xxxxx_OUTWARD'WITH CONNECTION 'CLIENT' and HOST NAME 'xxxxx'PLEASE CHECK IF THE ERROR QUEUEMANAGER 'xxxxx_OUTWARD'WITH CONNECTION MODE 'CLIENT'AND HOST NAME'xxxxxx.below ERROR we found in queuemanager level error logs----- cmqxrsrv.c : 2362 -------------------------------------------------------\n04/27/2018 07:52:35 PM - Process(29498.16) User(mqm) Program(amqzlaa0)\n Host(xxxxxxx) Installation(Installation2)\n VRMF(9.0.0.1) QMgr(xxxxx_INWARD)\n\nAMQ5534: User ID 'mqm' authentication failed\n\nEXPLANATION:\nThe user ID and password supplied by the 'WebSphere MQ Client for Java' program\ncould not be authenticated. \nAdditional information: 'N/A'.\nACTION:\nEnsure that the correct user ID and password are provided by the application.\nEnsure that the authentication repository is correctly configured. Look at\nprevious error messages for any additional information.\n----- amqzfuca.c : 4486 -------------------------------------------------------\n04/27/2018 07:52:35 PM - Process(29498.16) User(mqm) Program(amqzlaa0)\n Host(JPRIPAYMENTMQ2) Installation(Installation2)\n VRMF(9.0.0.1) QMgr(xxxxx_INWARD)\n\nAMQ5542: The failed authentication check was caused by the queue manager\nCONNAUTH CHCKCLNT(OPTIONAL) configuration.\n\nEXPLANATION:\nThe user ID 'mqm' and its password were checked because the queue manager\nconnection authority (CONNAUTH) configuration refers to an authentication\ninformation (AUTHINFO) object named 'SYSTEM.DEFAULT.AUTHINFO.IDPWOS' with\nCHCKCLNT(OPTIONAL). \n\nThis message accompanies a previous error to clarify the reason for the user ID\nand password check.\nACTION:\nRefer to the previous error for more information. \n\nEnsure that a password is specified by the client application and that the\npassword is correct for the user ID. The authentication configuration of the\nqueue manager connection determines the user ID repository. For example, the\nlocal operating system user database or an LDAP server. \n\nIf the CHCKCLNT setting is OPTIONAL, the authentication check can be avoided by\nnot passing a user ID across the channel. For example, by omitting the MQCSP\nstructure from the client MQCONNX API call. \n\nTo avoid the authentication check, you can amend the authentication\nconfiguration of the queue manager connection, but you should generally not\nallow unauthenticated remote access.\n-------------------------------------------------------------------------------\n04/27/2018 07:52:36 PM - Process(18265.105) User(xxx) Program(amqrmppa)\n Host(xxxxx) Installation(Installation2)\n VRMF(9.0.0.1) QMgr(xxxxx_INWARD)\n\nAMQ9557: Queue Manager User ID initialization failed for 'mqm'.\n\nEXPLANATION:\nThe call to initialize the User ID 'mqm' failed with CompCode 2 and Reason\n2035. If an MQCSP block was used, the User ID in the MQCSP block was 'mqm'.\nACTION:\nCorrect the error and try again.\n----- cmqxrsrv.c : 2362 -------------------------------------------------------after this i have provided permission to 'mqm' user in queue manager level and queue level with the below command still we are facing same error.setmqaut -m queue manager name -t qmgr -p mqm +connect & \nsetmqaut -m queue manager name -n queue name -t queue -p mqm user name +allcan any one help this issue@Morag Hughson:-\nHow to turn off userid and password in queue manager level@Morag Hughson:-\n any command for turn off user id and password please share the command to resolve this issue.@JoshMC:- if i was turn it off it is a good practice or is there any other option to resolve this issue from queue manager/application side?@Hello all , i was informed to application to place the messages without mentioning any user id and password.after that my application able to access the all queue managers.\nissue got resolved. Thanks to all for helping this issue.### Assistant: The queue manager error messages tell you exactly the problem. First it says:-AMQ5534: User ID 'mqm' authentication failed\n\nEXPLANATION:\nThe user ID and password supplied by the 'WebSphere MQ Client for Java' program\ncould not be authenticated.So the Java application that was trying to connect over a client was sending up 'mqm' as the user id and either the wrong password (or possibly no password at all).The password is being checked by the queue manager. The second error message tells you WHY it is being checked.AMQ5542: The failed authentication check was caused by the queue manager\nCONNAUTH CHCKCLNT(OPTIONAL) configuration.\n\nEXPLANATION:\nThe user ID 'mqm' and its password were checked because the queue manager\nconnection authority (CONNAUTH) configuration refers to an authentication\ninformation (AUTHINFO) object named 'SYSTEM.DEFAULT.AUTHINFO.IDPWOS' with\nCHCKCLNT(OPTIONAL).The configuration described in the second error message is there by default on your queue manager.You have two options.Send the correct password to go with the 'mqm' user id on your Java application.Choose to turn off user id and password checking on the queue manager.\n"} +{"text": "### Human: I'd like to understand what is the implementation of the JMS drivers for WebSphere MQ. I'm not interested in the JMS sync/async methods directly but rather in their implementation.If an application is deployed on a J2EE server and performs asynchronous calls (by implementing onMessage()), does the J2EE server still pull to check for the availability of a message or does MQ actively call back the client (J2EE server) through the opened socket to notify the presence of the message?### Assistant: It depends on what version of IBM MQ you are using.Prior to MQ V7, the JMS layer would poll the queue manager for a message - essentially pull.After MQ V7, the queue manager natively understands and implements asynchronous get where it will notify the getter of a message so it no longer has to poll.Further ReadingWhat is new in WebSphere MQ classes for JMS- about half-way down the page.\n"} +{"text": "### Human: We are trying to import the new renewed certs into keystore in MQ windows in our production but the channels are going to retying status after deploying the certs. Looks like somehow our queue manager is not reading the certs from the below error. The issuer of the certs are same before and now. The certs being used is rootCA5, serverCA5 and personal Cert. The channels are working fine when we put back the old certs. I have checked the permissions on the ssl folder and keystore, they are fine. Looking for some valuable suggestions as our old certs are going to expire tomorrow.The MQ version we are using is MQ7.1.0.7.We tried to add the below parameters in qm.ini file and we faced the same issue yesterday.SSL:\nOCSPAuthentication=OPTIONAL\nOCSPCheckExtensions=NOThe following error is logged in the queue manager's AMQERR01.LOG:10/18/2017 19:29:45 - Process(3084.1) User(4055TMQU) Program(runmqchl.exe)\n Host(abcdefgh) Installation(Installation1)\n VRMF(7.1.0.7) QMgr(QMPDBP)\n\nAMQ9642: No SSL or TLS certificate for channel 'xxxxxx.yyyyyy'.\n\nEXPLANATION:\nThe channel 'xxxxxx.yyyyyy' did not supply a certificate to use during SSL\nor TLS handshaking, but a certificate is required by the remote queue manager. \n\nThe remote host is 'abcdefgh (10.x.x.x)(1415)'. \n\nThe channel did not start.\nACTION:\nEnsure that the key repository of the local queue manager or MQ client contains\na certificate which is associated with the queue manager or client.\nAlternatively, if appropriate, change the remote channel definition so that its\nSSLCAUTH attribute is set to OPTIONAL and it has no SSLPEER value set.### Assistant: With IBM MQ v7.5 and lower the label of the queue manager certificate must be the exact stringibmwebspheremqconcatenated with the queue manager name folded to lowercase.Based on the error you posted I can see the queue manager name isQMPDBP, so check that the label of the certificate matches the stringibmwebspheremqqmpdbpNote that with IBM MQ v8.0 and later you can tell the queue manager the name of the certificate label to use by setting the queue managerCERTLABLattribute, this defaults to the value which matches what was required in v7.5 and lower.For example:ALTER QMGR CERTLABL('DifferentLabel`)\n"} +{"text": "### Human: I am using websphere application server 8.5I have tried to recieve the messages from queue.The queue may contain multilple messages. I want to read all at once.I recive the error WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2024' ('MQRC_SYNCPOINT_LIMIT_REACHED') though I read messages.Should I call session's commit() method? If so where should I call inside while loop for each message or outside the while loop?createQueueSession(true, 0): Will there be any corrections in the arguments to be passed in this method in both Producer and consumer end?Approach:import javax.naming.InitialContext;\nimport javax.jms.Queue;\nimport javax.jms.Session;\nimport javax.jms.TextMessage;\nimport javax.jms.QueueSession;\nimport javax.jms.QueueReceiver;\nimport javax.jms.QueueConnection;\nimport javax.jms.QueueConnectionFactory;\n\npublic class Receiver\n{\n @Resource(lookup = \"jms/ConnectionFactory\")\n private static QueueConnectionFactory connectionFactory;\n\n @Resource(lookup = \"jms/Queue\")\n private static Queue queue;\n\n public void readQueueMessages() { \n try {\n // create a queue connection\n QueueConnection queueConn = connFactory.createQueueConnection();\n\n // create a queue session\n QueueSession queueSession = queueConn.createQueueSession(true, 0);\n\n // create a queue receiver\n QueueReceiver queueReceiver = queueSession.createReceiver(queue);\n\n // start the connection\n queueConn.start();\n\n // receive a message\n while(true) {\n TextMessage message = (TextMessage) queueReceiver.receive(180000);\n if (message != null) { \n if (message instanceof TextMessage) {\n // print the message\n System.out.println(\"received: \" + message.getText());\n } else {\n break;\n }\n } else {\n break;\n }\n }\n } catch(JMSException exp) {\n // Handle this exception\n } finally { \n if(queueConn != null) { \n // close the queue connection\n queueConn.close();\n }\n }\n }\n}### Assistant: The queue manager has a parameterMAXUMSGSwhich is the maximum uncommitted messages for any client, this defaults to a value of10000. When you receiveMQRC_SYNCPOINT_LIMIT_REACHEDthis means that you have reached that limit.Typically you would commit once you have processed the message, in your example this would be after printing it out. Since all persistent messages are written to disk and disk can slow things down, you can tune for performance by committing multiple messages at one time. Keep in mind that if your program crashes before the messages are committed they will be rolled back to the queue and processed the next time you start your program, because of this you would likely want to limit the number of uncommitted messages.Since you are using WebSphere Application Server you should consider using a MDB rather than write your own. The MDB will connect to the queue and wait for messages, read them from the queue and dispatch them to your ownonMessageJava method to process messages.I did a search and here are a couple links that may be helpful and I'm sure you can find others that discuss how to setup a MDB:Chris Andrews presented a session \"Using IBM WebSphere Application Server\nand IBM WebSphere MQ Together\"Craig St. Jean has a blog post \"WebSphere 8.5, MQ, Spring, and Message-Driven Beans! Part 1\"\n"} +{"text": "### Human: We have a use case of putting a group of messages with a same groupId but differing by MessageSequenceNumber. This is used to group the messages for a logical ordering so that on the receiver side, receiver can group all of the messages based on group order. I was following the IBM MQ v7.5 Knowledge Center page \"Message groups\".I have a code written to put the messages : -public boolean writeMessage(String[] messages, String queueName) { \n\n Session session = getQueueConnection().createSession(true,\n Session.AUTO_ACKNOWLEDGE);\n\n\n Destination destination = session.createQueue(queueName);\n messageProducer = session.createProducer(destination);\n for (int i = 0; i < messages.length; i++) {\n TextMessage message = session.createTextMessage(messages[i]);\n messageProducer.send(message);\n }\n\n // Commit the send (Actually put messages to Queue)\n session.commit();\n return true;\n}Now , I want to add a 1 unique groupID to all the messages which are inside an array and add a sequence number(msgSeqNum) (1,2,3..) . How can i do it through the JMS API? I am looking for JMS version of the code on the IBM IIB v8 Knowledge center page \"Sending messages in a WebSphere MQ message group.### Assistant: There was a good IBM developerWorks blog written by David Currie in 2006 titled \"Grouping messages using the WebSphere MQ Java and JMS APIs\" that described how to do what you are asking, however it appears this was recently removed by IBM.Wayback Machine link to \"Grouping messages using the WebSphere MQ Java and JMS APIs\"Below is the information that was provided by David in the post, it appears the putting logic is much simpler to implement compared to the getting logic. I am only including the putting logic code here since this is what you inquired about. I reached out to David via email to ask if this blog will be republished.Sending a message groupLet's start by looking at the sending application. As mentioned above,\nthe put message option MQPMO_LOGICAL_ORDER was simply an instruction\nto the queue manager to automatically allocate message group\nidentifiers and sequence numbers. The example in Listing 3 below\ndemonstrates how, in the absence of this option in the JMS API, we can\nset these properties explicitly.Listing 3. Sending a message group using the WebSphere MQ JMS APIMQConnectionFactory factory = new MQConnectionFactory();\nfactory.setQueueManager(\"QM_host\")\nMQQueue destination = new MQQueue(\"default\");\ndestination.setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ);\nConnection connection = factory.createConnection();\nSession session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);\nMessageProducer producer = session.createProducer(destination);\n \nString groupId = \"ID:\" + new BigInteger(24 * 8, new Random()).toString(16);\n \nfor (int i = 1; i <= 5; i++) {\n \n TextMessage message = session.createTextMessage();\n message.setStringProperty(\"JMSXGroupID\", groupId);\n message.setIntProperty(\"JMSXGroupSeq\", i);\n \n if (i == 5) {\n message.setBooleanProperty(\"JMS_IBM_Last_Msg_In_Group\", true);\n }\n \n message.setText(\"Message \" + i);\n producer.send(message);\n \n}\n \nconnection.close();\n"} +{"text": "### Human: We are using WildFly (9.0.2) and a Java EE application in EAR deployment with MDBs connecting via an IBM MQ (9.0.0) resource adapter.Now we experience that when connection to MQ server is not possible during deployment, the deployment fails:java.lang.RuntimeException: \ncom.ibm.mq.connector.DetailedResourceAdapterInternalException: \nMQJCA1011: Failed to allocate a JMS connection., error code: MQJCA1011 \nAn internal error caused an attempt to allocate a connection to fail.This behaviour is bad, since the application must be available independently of this messaging interface and should continue other deployments and later try to reconnect to the server.In a parallel project, we did the same setup against an SonicMQ server, which behaved in such a way.How can I configure IBM MQ RA to accept disconnection at deploy time and retry during application run time?### Assistant: I had the same issue. Solved it by setting the propertystartupRetryCountto1(default is0) in the standalone-full.xml:\n \n \n \n wmq.jmsra.rar\n \n \n 1\n After setting this property I got the following info message in the WildFly log[org.jboss.as.connector.deployers.RaXmlDeployer] (JMSCCThreadPoolWorker-5) wmq.jmsra.rar: MQJCA4014:Failed to reconnect one or more MDBs after a connection failure.and the MDBs deployed.Hope this solves it for you too!\n"} +{"text": "### Human: I am getting the below error while trying to extract the MQHeaders using MQHeaderIterator from MQMessage object . I am using the below line of code and getting the below Exception. Added below jar in classpath also but still it showing error.Libraries used:com.ibm.mq.jar\ncom.ibm.mq.headers.jar\ncom.ibm.mq.commonservices.jar\ncom.ibm.mq.jmqi.jar\ncom.ibm.mq.pcf.jarCode://Giving error in this line\nMQHeaderIterator it = new MQHeaderIterator(theMessage);Its throwing Exception as below.Exception in thread \"main\" java.lang.NoClassDefFoundError: com/ibm/mq/internal/MQCommonServices\n at com.ibm.mq.headers.MQHeaderIterator.(MQHeaderIterator.java:112)\n at com.test.mq.util.MQClass.main(MQClass.java:69)\nCaused by: java.lang.ClassNotFoundException: com.ibm.mq.internal.MQCommonServices\n at java.net.URLClassLoader$1.run(Unknown Source)\n at java.security.AccessController.doPrivileged(Native Method)\n at java.net.URLClassLoader.findClass(Unknown Source)\n at java.lang.ClassLoader.loadClass(Unknown Source)\n at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)\n at java.lang.ClassLoader.loadClass(Unknown Source)\n ... 2 morePlease suggest the possible reason for this error mostly ClassNot Found error occurs when some jar file is missing. Am i missing something here?### Assistant: Short answer, point the classpath to the java/lib directory of the original IBM MQ install location which containsALLrequired jar files.More detail:IBM does not support copying jar files to different locations until v8 in which case they have added support for relocation but have combined everything needed into two jar files com.ibm.mq.allclient.jar and com.ibm.mq.traceControl.jar which can be relocated from a full MQ Server or MQ Client install to another location in your enterprise.For more details see the section \"Starting with MQ 8.0, you can use Relocatable JAR Files\" on IBMs Technote \"Starting with MQ 8.0, you can use Relocatable JAR Files\".WebSphere MQ 8.0.0 > IBM MQ > Developing applications > Developing\n object-oriented applications with IBM MQ > Using IBM MQ classes for\n Java > Installation and configuration of IBM MQ classes for Java >What is installed for IBM MQ classes for JavaRelocatable JAR filesWithin an enterprise, the following files can be moved to systems\n that need to run IBM MQ classes for Java applications:com.ibm.mq.allclient.jarcom.ibm.mq.traceControl.jarThe file com.ibm.mq.allclient.jar contains the IBM MQ classes for\n JMS, the IBM MQ classes for Java, and the PCF and Headers Classes. If\n you move this file to a new location, make sure that you take steps to\n keep this new location maintained with new IBM MQ Fix Packs. Also,\n make sure that the use of this file is made known to IBM Support if\n you are getting an interim fix.To determine the version of the file com.ibm.mq.allclient.jar, use\n the command: java -jar com.ibm.mq.allclient.jarNote that all MQ versions 7.1 and earlier are end of service from IBM. IBM MQ v7.5 has an end of service date of April 30th 2018.I would recommend you move to v8.0 or v9.0 which have not had end of service dates announced yet. Newer MQ client versions can connect to older MQ queue managers. You can download a java only install of MQ 8.0 or MQ 9.0 jar files at the links below:IBM MQ v8.0 ClientIBM MQ v9.0 Client\n"} +{"text": "### Human: I tried to store information from below command using perl code,dis ql(*) all'|runmqsc MQ_NAMEAssume the output from this command as below,AMQ8409: Display Queue details.\n QUEUE(SYSTEM.RETAINED.PUB.QUEUE) TYPE(QLOCAL)\n ACCTQ(QMGR) ALTDATE(2016-08-01)\n ALTTIME(18.33.20) BOQNAME( )\n CLWLPRTY(0) CLWLRANK(0)\n CLWLUSEQ(QMGR) CRDATE(2016-08-01)\n CRTIME(18.32.37) CURDEPTH(2)\n MAXDEPTH(999999999) MAXMSGL(104857600)\n\nAMQ8409: Display Queue details.\n QUEUE(SYSTEM.SELECTION.EVALUATION.QUEUE)\n TYPE(QLOCAL) ACCTQ(QMGR)\n ALTDATE(2016-08-01) ALTTIME(18.33.20)\n BOQNAME( ) BOTHRESH(0)\n CLWLRANK(0) CLWLUSEQ(QMGR)\n CRDATE(2016-08-01) CRTIME(18.32.37)\n CURDEPTH(0) CUSTOM( )\n IPPROCS(0) MAXDEPTH(999999999)\n\nAMQ8409: Display Queue details.\n QUEUE(SYSTEM.SELECTION.VALIDATION.QUEUE)\n TYPE(QLOCAL) ACCTQ(QMGR)\n ALTDATE(2016-08-01) ALTTIME(18.33.20)\n BOQNAME( ) BOTHRESH(0)\n CLWLRANK(0) CLWLUSEQ(QMGR)\n CRDATE(2016-08-01) CRTIME(18.32.37)\n CURDEPTH(0) CUSTOM( )\n IPPROCS(0) MAXDEPTH(999999999)So, for each of this output (from we can see there are 3), I wrote a code to store information about QUEUE, CURDEPTH and MAXDEPTH for each MQ queue name.My code as below,#!/usr/bin/perl\n\nuse warnings;\nuse strict;\n\nmy %QM;\nmy $qm = 'MQ_NAME';\n\nopen (CHS_OUT, \"echo 'dis ql(*) all'|runmqsc $qm|\");\n\nwhile () {\n\n my ($QUEUE, $QName) = / ( QUEUE ) \\( ( [^)]+ ) /x;\n\n if ( my ($item, $value)\n = / ( CURDEPTH | MAXDEPTH ) \\( ( [^)]+ ) /x )\n { \n $QM{$QName}{$item} = $value;\n }\n}\n\nforeach my $Que (sort keys %QM) {\n foreach my $v (keys %{ $QM{$Que} }) {\n print \"$Que : $v = $QM{$Que}{$v} \\n\";\n }\n}I already try to make the $QName as global still cannot help, there are still error from this code.Output from my code:Use of uninitialized value $QName in hash element at mq_queue_5.pl line 25, line 7353.\nUse of uninitialized value $QName in hash element at mq_queue_5.pl line 25, line 7361.\nUse of uninitialized value $QName in hash element at mq_queue_5.pl line 25, line 7384.\nUse of uninitialized value $QName in hash element at mq_queue_5.pl line 25, line 7392.\n : CURDEPTH = 0 \n : MAXDEPTH = 999999999I already stuck for multiple days, already make a lot of changes but still does'nt help.### Assistant: You have to check if the QName is matched and remember it:#!/usr/bin/perl\n\nuse warnings;\nuse strict;\n\nmy %QM;\nmy $qm = 'MQ_NAME';\n\nopen (CHS_OUT, \"result.txt\");\nmy $QName;\nwhile () {\n my ($QUEUE, $QName1) = / ( QUEUE ) \\( ( [^)]+ ) /x;\n\n if ($QName1) {\n $QName=$QName1;\n }\n if ( my ($item, $value)\n = / ( CURDEPTH | MAXDEPTH ) \\( ( [^)]+ ) /x )\n {\n $QM{$QName}{$item} = $value;\n }\n}\n\nforeach my $Que (sort keys %QM) {\n foreach my $v (keys %{ $QM{$Que} }) {\n print \"$Que : $v = $QM{$Que}{$v} \\n\";\n }\n}OUTPUT:SYSTEM.RETAINED.PUB.QUEUE : CURDEPTH = 2\nSYSTEM.RETAINED.PUB.QUEUE : MAXDEPTH = 999999999\nSYSTEM.SELECTION.EVALUATION.QUEUE : CURDEPTH = 0\nSYSTEM.SELECTION.EVALUATION.QUEUE : MAXDEPTH = 999999999\nSYSTEM.SELECTION.VALIDATION.QUEUE : MAXDEPTH = 999999999\nSYSTEM.SELECTION.VALIDATION.QUEUE : CURDEPTH = 0\n"} +{"text": "### Human: I am very new to MQ and trying to configure it on my machine. The requirement is to setup MQ such that I can send/receive XML files as messages in MQ using my C#.NET code. I have installed IBM WebSphere MQ 9.0 version on my machine. As I understand so far, I will need to setup Queue Manager, Queue and Channel at the minimum to achieve this. So I have tried to set these up in my MQ. However, when I try to run my code, I get error \"MQRC_NOT_AUTHORIZED\".Can anybody please guide me in setting up these things so that the scenario of file sharing through .NET will work? I guess the client and server both will be local on my machine in this case? There are many parameters to choose at the time of creating the Queue, Channel, etc which are confusing to me and I guess I have chosen incorrect definitions in my setup.Here is my .Net code:using IBM.WMQ;\nusing System;\nusing System.Collections;\n\nnamespace MQTest\n{\n\nclass MQTest\n{\n public MQQueueManager ConnectMQ()\n {\n MQQueueManager queueManager;\n\n // Setup connection information \n Hashtable queueProperties = new Hashtable();\n queueProperties[MQC.HOST_NAME_PROPERTY] = \"localhost\";\n queueProperties[MQC.PORT_PROPERTY] = 1414;\n queueProperties[MQC.CHANNEL_PROPERTY] = \"QM._TEST.SVRCONN\";\n\n try\n {\n // Attempt the connection\n queueManager = new MQQueueManager(\"QM_TEST\", queueProperties);\n Console.WriteLine(\"Connected Successfully\");\n }\n catch (MQException mexc)\n {\n // TODO: Setup other exception handling\n throw new Exception(mexc.Message\n + \" ReasonCode: \" + mexc.ReasonCode\n + mexc.StackTrace, mexc);\n }\n\n // For now, return the queueManager to use in reading/writing messages next\n return queueManager;\n }\n }\n}And here are the snapshots of my MQ setup:Queue ManagerQueueChannelListener### Assistant: AladdinMQ.LOCAL.ONEFirst off, it is a bad idea to use mixed case MQ objects. You are just asking for trouble. MQ likes to uppercase MQ objects if you don't use quotes. So, it is best just to use uppercase MQ object names.If your UserId is not in the mqm group then you need to give permission to your UserId to (1) access the queue manager and (2) access the queue.i.e.It is bet to do MQ permissions by 'Group' rather than 'UserId'. Let's say the group needs access to queues that begin with \"AladdinMQ.\". Here are setmqaut commands to setup the OAM permissions:setmqaut -m QM_TEST -t qmgr -g {GROUP} +connect +inq +dsp\nsetmqaut -m QM_TEST -n AladdinMQ.** -t queue -g {GROUP} +allmqi +dspwhere {GROUP} is the name of the Group that the UserId belongs to.\n"} +{"text": "### Human: We are using IBM MQ8.0. Activitiy logs are getting logged for outgoing messages which we are sending to external system. But there is no log available for the messages which are from external system to our MQ Manager.\nIs it problem with client channel configuration ?\nOr MQ logging configuration issue ?### Assistant: IBM describes these \"activity logs\" as recover logs in the Knowledge center page \"Making sure that messages are not lost (logging)\"IBM MQ records all significant changes to the persistent data controlled by the queue manager in a recovery log.This includes creating and deleting objects,persistent message updates, transaction states, changes to object attributes, and channel activities. The log contains the information you need to recover all updates to message queues by:Keeping records of queue manager changesKeeping records of queue updates for use by the restart processEnabling you to restore data after a hardware or software failurePlease note thatnon-persistentmessages are not logged to the recover log.Based on your question it is likely that the messages you are sending to the external system arepersistentmessages and the messages you are receiving from the external system arenon-persistentmessages, this would explain why they are not logged to the recover log files.Persistence is determined at the time the message is first PUT.IBM has a good Technote \"Message persistence FAQs\" about this subject.Q3. What is the best way to be certain that messages are persistent?A3. Set MQMD message persistence to persistent (MQPER_PERSISTENT), or nonpersistent (MQPER_NOT_PERSISTENT) and your message willalwaysretain that value.Note:MQPER_PERSISTENCE_AS_Q_DEFis the default setting for the persistence value in the MQMD. See the persistence values listed below....Additional informationMQPER_PERSISTENCE_AS_Q_DEFcan lead to unexpected results. If there is more than one definition in the queue-name resolution path, the default persistence attribute is taken from first queue definition in the path at the time of theMQPUTorMQPUT1call. This queue could be an:alias queuelocal queuelocal definition of a remote queuequeue-manager aliastransmission queuecluster queueThe external system will need to make sure the messages they send you are set as persistent messages if you want them to be logged.\n"} +{"text": "### Human: I'm trying to put a message on a remote queue which is not defined locally on the queue manager (queue manager alias). I'm being told to put the remote queue manager name in the message transmission header so it will be routed to the appropriate transmission queue.I'm able to connect to the internal queue manager with the following:Hashtable properties = new Hashtable();\nproperties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\nproperties.Add(MQC.HOST_NAME_PROPERTY, hostName);\nproperties.Add(MQC.PORT_PROPERTY, port);\nproperties.Add(MQC.CHANNEL_PROPERTY, channelName); \n\nMQQueueManager queueManager = new MQQueueManager(queueManagerName, properties);I create the message and attempt to do the Put but I'm not sure where/how to set the transmission header to the destination queue manager name.message = new MQMessage();\nmessage.Format = MQC.MQFMT_STRING;\nmessage.WriteString(messageString);\n\nqueueManager.Put( ???qName???, ???qmName???, message);I've tried using a blank qName and get an [MQRC_REMOTE_Q_NAME_ERROR]UPDATE: Turned out that they configured the queue manager alias incorrectly. The answer below helped me point it out to them. As the accepted answer states, MQ handles the message transmit header for you. Once it was configured correctly it was the same as putting a message on a locally defined remote queue.### Assistant: To answer the question in your headline, you don't need to set the XMit header as MQ will do this for you.Responding to the body of the question, it's all in how MQ resolves queue names. In the case you present, you tell MQ where to send the message when you open the destination queue. MQ then follows a resolution process to determine where to put the message.When you specifyQNAMEbut noRQMNAMEor whenRQMNAMEis the local queue manager, then MQ looks for a local queue. When you specifyQNAMEand whereRQMNAMEisnotthe local queue manager, MQ looks for an XMitQ that leads to the named QMgr. If it finds one it puts your message there and includes the required XMitQ header.MQ finds the right XMitQ by looking to see if one has the same name as the destination QMgr. If not them it looks forQREMOTEdefinitions with that name and a blankRNAME, and uses theXMITQNAMEvalue. (Because that kind ofQREMOTEpoints to the entire QMgr, it can't specify anRNAME. That is called a QMgr Alias since it defines the relationship between a QMgr and the XMitQ that points to it.)For a detailed explanation, please seeQueue name resolutionin the Infocenter.Note that the ID putting the message will require access to the transmission queue. Granting access allows the app to address messages to any queue on the remote node, includingSYSTEM.*queues. It is the responsibility of the receiving QMgr to set the channel'sMCAUSERto an account ID that does not have access to administrative queues if this is an issue. On the local queue manager aQREMOTEdefinition that points to the remote queue can be authorized instead of the XMit queue to prevent such broad access.\n"} +{"text": "### Human: Currently evaluating IBM MQ version 8, and trying to put message using console. I understand that in version 7.5 there is this command calledamqsput&amqsget, however I can't found this command in version 8. Is there any equivalent command in version 8? Or do I need to use the MQExplorer for this?### Assistant: There are many sample programs provided by IBM for this purpose. To obtain them for Linux, install the MQSeriesSamples RPM as described inInstalling IBM MQ server on Linux.After installation, theamqsputcommand will be available in/opt/mqm/samp/binif the default install location is used.\n"} +{"text": "### Human: I am currently learning Camel, and have a specific project in mind that requires a Websphere MQ back-end, but I can't use JMS components, since I need a lot of non-jms headers, like MQIIH.I found thecamel-wmqproject.\nIs it the recommended solution ? Is it any good ?### Assistant: You don't need to use jms. WMQ has a client API. Just download the wmq client jars and put them in your project and use them together with your Camel routes. You will probably put the wmq client code in a processor class or something similar. Off course best to test to put a message on a queue manually via RFHUTIL or something similar as a client so you are sure the environment setup is correct.\n"} +{"text": "### Human: try\n {\n MQManager = new MQQueueManager(QueueManager);\n try\n {\n MQRequestQueue = MQManager.AccessQueue(QueueName, MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING);\n\n return true;\n }\n catch (IBM.WMQ.MQException exIBM)\n {\n CloseConnection();\n ErrorCode = exIBM.Reason;\n ErrorDescription = exIBM.Message;\n }\n }\n catch (IBM.WMQ.MQException exIBM)\n {\n CloseConnection();\n ErrorCode = exIBM.Reason;\n ErrorDescription = exIBM.Message;I am using the above c# code to connect to the MQ using MQseries dll provided by WebsphereMQ. When QueueManager is down it is taking 20-30 seconds till I get the exception and I can see everything has been just stopped at this code.Is it expected behaviour of MQ client-server communication?\nIf not ,How can I detect if queuemanager is down so that I can hit next available queuemanager?\nIs there any timeout property?### Assistant: When you are running over the client-server communication as you state that you are, then there is a network involved. The detection time of your application of when the queue manager goes unavailable will depend on what the application was doing at the time and how the queue manager was ended.If the queue manager was quiesced, and the application was using the queue manager connection at the time then you should get immediate notification. Similarly, if you have a connection exception handler then even if your application was not using the queue manager connection at the time, the exception handler counts as if it was, and you should get immediate notification. The snippet of code you provide suggests that perhaps you are hinting that you are in a waiting get when the queue manager is taken down?If the queue manager was brought down more harshly than a quiesce, then you may have to rely on network timeouts to detect that the queue manager is no longer at the other end of the socket and this is where your delay will be seen.Could you indicate in your question how the queue manager was ended and also whether you have an exception handler or whether your application was actually using the connection at the time the queue manager went down.Can you also update your question with IBM MQ versions and the details of your SVRCONN channel, specifically SHARECNV and HBINT.\n"} +{"text": "### Human: I want to pull messages off a MQS queue in a C client, and would love to do so asynchronously so I don't have to start (explicitly) multithreading. The messages will be forwarded to another system that acts \"transactionally\" but is completely incompatible with XA. So I'd like to have a way to explicitly commit (and thereby remove) a message that's been successfully handed off to the other system, andnotcommit if this failed, so that the last message is retained for a more successful later attempt.I've read about the SYNCPOINT option and understand how I'd use that around a regular GET, but I haven's seen any hints on how to make asynchronous message retrieval have transactional behavior like this. Any hints, please?### Assistant: I think you are describing using the asynchronous callback capability, ie you register a routine to be called when a message arrives, and ask for any get to be under syncpoint... An explanation of how some of it works is in here,https://share.confex.com/share/117/webprogram/Handout/Session9513/share_advanced_mqi.pdfpage 4+Effectively you get called with the MQ message under syncpoint, do your processing with another system, then commit or rollback the message before returning.Be aware without the use of e.g. XA 2 phase commit, there is always going to be the windows of e.g. committing to the external system and a power outage means the message under the unit of work gets rolled back inside MQ as you didnt have time to perform the commit.\n"} +{"text": "### Human: IBM offer an installable MQSeries Client software that allows you to access queue managers on remote hosts. They also offer some C-callable libraries that let you do messaging from a C application.My problem is that I don't have admin access on the hosts I plan to test-deploy on, and getting an application installed comes with bigtime Enterprise hassle. IBM, meanwhile, acts as if there's no alternative to installing their whole client package. Assuming I'm willing to forgo their support, can I get around this? i.e. is there some set of objects/libraries I can link with to produce a standalone client?### Assistant: From v8.0.0.4 onwards, IBM provides set of libraries as a zip/tar and you don't need to install whole client package. See here:http://www.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.ins.doc/q122882_.htm.But you still need queue manager running somewhere to test your application.\n"} +{"text": "### Human: Is there a possibility in IBM WebSphere MQ to redirect message from queue to Dead Letter Queue (DLQ), when its withdrawal counter would be bigger than 3?### Assistant: The queue manager will NOT automatically move the messages to BOQUEUE or DLQ. It is typically done by the client or client application to route the messages which they are unable to process. MQ JMS and XMS clients have this capability. If your application uses any other MQ clients, then routing of messages will need to be done by your application.\n"} +{"text": "### Human: I am trying to connect to IBM MQ 9.0 using AMQP 1.0 channel from my .Net application.The MQ Light portal currently supports Nodejs, ruby, java and python clients only. Do we have a MQ Light AMQP client for .Net?I have tried connecting to IBM MQ 9 with Amqpnetlite clientnamespace AMQPNetLiteSample\n{\n class Program\n {\n static void Main(string[] args)\n {\n Console.WriteLine(\"Start\");\n //Address addr = new Address(\"10.58.139.97\", 1234, \"Username\",\"password\", \"/\", \"AMQP\");\n Address addr = new Address(\"amqp://10.58.139.97:1234\");\n\n Connection con = new Connection(addr);\n con.Closed += con_Closed;\n Console.WriteLine(\"Created connection\");\n\n Session session = new Amqp.Session(con);\n session.Closed += session_Closed;\n Console.WriteLine(\"Created session\");\n\n SenderLink link = new SenderLink(session, \"sender_12565455877\", \"/public\");\n Console.WriteLine(\"Created link\");\n var message = new Message();\n message.Properties = new Properties();\n message.Properties.Subject = \"mysamplemsg\";\n message.ApplicationProperties = new ApplicationProperties();\n message.ApplicationProperties[\"myprop\"] = \"Hello World\";\n Console.WriteLine(\"sending message\");\n link.Send(message);\n\n }\n\n static void session_Closed(AmqpObject sender, Error error)\n {\n Console.WriteLine(\"Session closed\");\n Console.WriteLine(error.ToString());\n }\n\n static void con_Closed(AmqpObject sender, Error error)\n {\n Console.WriteLine(\"Connection closed\");\n Console.WriteLine(error.ToString());\n }\n }\n}But I could not succeed in establishing a connection. When initiating the SenderLink, I am getting 2035 MQRC_NOT_AUTHORIZED exception.\nHowever, without changing any of the channel authentication in IBM MQ 9.0 Server, if I try it with MQ Light nodejs example (send.js), I am able to connect and send messages to AMQP channel.Please suggest if there are any changes required in the above code.Has anyone succeeded in establishing communication with IBM MQ with any other .Net 1.0 AMQP Clients? Need your help here. Thanks.### Assistant: It seems that even when user name and password are not configured, the MQ broker requires SASL negotiation for the connection. You can enable SASL Anonymous on amqpnetlite as follows.Address address = new Address(\"amqp://10.58.139.97:1234\");\nConnection connection = new Connection(address, SaslProfile.Anonymous, null, null);\nSession session = new Session(connection);\nSenderLink sender = new SenderLink(session, \"sender-12345\", \"/public\");\nMessage message = new Message(\"Hello\");\nmessage.Properties = new Properties() { MessageId = \"msg\", To = \"q1\" };\nsender.Send(message);\nconnection.Close();It is also possible to do the same with ConnectionFactory.Address address = new Address(\"amqp://10.58.139.97:1234\");\nvar factory = new ConnectionFactory();\nfactory.SASL.Profile = SaslProfile.Anonymous;\nConnection connection = await factory.CreateAsync(address);\n"} +{"text": "### Human: With the following code:System.Console.WriteLine(mqMsg.ReadString(mqMsg.MessageLength))\nDim InfoMsg As String = SmqMsg.ReadString(mqMsg.MessageLength)The first line works fine and writes the MQMessage to the console but the second line gives an exception:Unable to read beyond the end of the stream in mscorlibWhat is the problem?### Assistant: TheMQMessage.ReadString(length)advances the cursor in the message body bylengthbytes. For example if the message body length is 100 bytes, the firstReadString(50)will advance the cursor to51stbyte so that the nextReadStringcall will read from51stbyte.In your case, the first statementSystem.Console.WriteLine(mqMsg.ReadString(mqMsg.MessageLength))is reading the entire message body. Since the entire message has been read and cursor advanced beyond the message length, the second statementDim InfoMsg As String = SmqMsg.ReadString(mqMsg.MessageLength)throws exception.You can change the code as belowDim InfoMsg As String = SmqMsg.ReadString(mqMsg.MessageLength)\nSystem.Console.WriteLine(InfoMsg)\n"} +{"text": "### Human: When trying to connect to MQ in bindings mode (I have a server set up locally), I get the following exception:System.TypeInitializationException: The type initializer for 'IBM.WMQ.Nmqi.BindingsNmqiMQ' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object.\n at IBM.WMQ.Nmqi.NativeManager.InitializeNativeApis(String mode)\n at IBM.WMQ.Nmqi.BindingsNmqiMQ..cctor()\n --- End of inner exception stack trace ---\n at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)\n at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\n at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)\n at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)\n at System.Reflection.Assembly.CreateInstance(String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)\n at IBM.WMQ.Nmqi.NmqiEnvironment.GetInstance(String name)\n at IBM.WMQ.Nmqi.NmqiEnvironment.GetMQI(Int32 id)\n at IBM.WMQ.MQQueueManager.Connect(String queueManagerName)\n at IBM.WMQ.MQQueueManager..ctor(String queueManagerName, Hashtable properties)\n at Project.MQConnector.CreateConnectAndAddQueueManager(QueueManagerConnectionDetails connDetails)The error occurs when trying to connect to a queue manager as follows:Constructor:Friend queueManagerConnectionProperties As New Hashtable()\nqueueManagerConnectionProperties.Add(MQC.THREAD_AFFINITY_PROPERTY, True)\nIf My.Settings.MQConnectAsClient Then\n queueManagerConnectionProperties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT)\nElse\n queueManagerConnectionProperties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_BINDINGS)\nEnd If\n\nqueueManagerConnectionProperties.Add(MQC.CONNECT_OPTIONS_PROPERTY, MQC.MQCNO_HANDLE_SHARE_BLOCK Or MQC.MQCNO_RECONNECT_Q_MGR) ' have handle-sharing with call blockingAnd in the CreateConnectAndAddQueueManager method (where connDetails is just a store for the port, host, name, etc.):Dim specificQMConnProperties As Hashtable = CType(queueManagerConnectionProperties.Clone(), Hashtable)\n specificQMConnProperties.Add(MQC.CHANNEL_PROPERTY, connDetails.Channel)\n specificQMConnProperties.Add(MQC.CONNECTION_NAME_PROPERTY, connectionName)\n Dim qmgr As MQQueueManager = Nothing\n\n Try\n qmgr = New MQQueueManager(connDetails.Name, specificQMConnProperties)\n Catch ex As MQException\n ' error handling\n End TryI have the following environment variable:NMQ_MQ_LIB=mqm.dllWhen I connect using a managed connection (NMQ_MQ_LIB=managed; and don't set theMQC.TRANSPORT_PROPERTY), it works fine.Any thoughts?--Edit--C:\\Program Files\\IBM\\MQSI\\9.0.0.2>dspmqver -a\nName: WebSphere MQ\nVersion: 7.5.0.6\nLevel: p750-006-160226\nBuildType: IKAP - (Production)\nPlatform: WebSphere MQ for Windows\nMode: 32-bit\nO/S: Windows 7 Enterprise x64 Edition, Build 7601: SP1\nInstName: Installation1\nInstDesc:\nPrimary: No\nInstPath: C:\\Program Files (x86)\\IBM\\WebSphere MQ\nDataPath: C:\\Program Files (x86)\\IBM\\WebSphere MQ\nMaxCmdLevel: 750\nLicenseType: Production\nAMQ8351: WebSphere MQ Java environment has not been configured correctly.\nAMQ8351: WebSphere MQ Java environment has not been configured correctly.\n\nName: IBM WebSphere MQ custom channel for Windows Communication Foundation\nVersion: 7.5.0.6\nLevel: wn750-006-151116\nBuild Type: Production\n\n\nName: IBM Message Service Client for .NET (XMS .NET)\nVersion: 2.5.0.6\nLevel: nn250-006-151116\nBuild Type: Production\n\n\nName: IBM Global Security Kit for WebSphere MQ\nVersion: 8.0.14.53\nBuild Type: Production\nMode: 32-bit\n\nName: IBM Global Security Kit for WebSphere MQ\nVersion: 8.0.14.53\nBuild Type: Production\nMode: 64-bit### Assistant: Looking at your latest comment. You have some unwanted entries in GAC. You need to do some clean up.1) Open a command prompt.2) Runamqiregisterdotnet.cmd /ucommand to unregister MQ .NET assemblies.3) Check Windows GAC what MQ .NET assemblies. Make sure there are no MQ .NET entries. If there are some, try unregistering manually usinggacutilcommand.4) Then run the commandamqiregisterdotnet.cmdto register the assemblies again.Hope this helps.\n"} +{"text": "### Human: I'm using Spring jms to send jms messages to websphere mq using the target client as 1 at the destination resolver. However this causing to drop all the custom headers I've set to the jms message. When I set the target client as 0 it works perfectly bt I need to keep it at 1 for some other reason. Can somebody explain whats happening here and a possible solution. Thanks.### Assistant: In MQ JMS headers are implemented as properties in an MQ RFH2 header on the message. By specifying a target client of WMQ_TARGET_DEST_MQ (1) you're instructing the MQ JMS client to strip the RFH2 header away. Which in your case means you lose your custom headers. So by setting WMQ_TARGET_DEST_MQ you're essentially opting out of this feature.You either need to use WMQ_TARGET_DEST_JMS (0) which you know works, or find another way to pass the data in your custom headers to the receiving application.One option if you want to continue with WMQ_TARGET_DEST_MQ is to include your custom headers in the message body as name/value pairs - you just need to make sure the receiving application can understand it.\n"} +{"text": "### Human: Alter channel pagehttps://www.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.ref.adm.doc/q085170_.htmshows that I can use Disconnect interval (DISCINT) inserver connection channelalter command, however I get error message which claims that itcanonlybe usedforserver or sender channeltypes, butnot for server connection channeltypes.Maybe MQ command level is too low for DISCINT attribute? How can I check that?Operating System is Linux for that particular workgroup server...### Assistant: Thisknowledge center pagefor MQ v 7.0.1 indicates thatalter chl DISCINTis only valid on zOS.Also, thispagesays: This attribute is valid for channel types Server connection (z/OS\u00ae only)Maybe you are using an older version of MQ? There are many different ways to check your MQ version - from the command line trydspmqver.\n"} +{"text": "### Human: We have a queue manager in Production system which is having around 10 cluster topics and 50 subscriptions. All the queue managers are in IBM MQ cluster topology and the data in NAS ( shared storage ) so that all queue managers are MI ( Multi-instance) enabled. We have huge volume message flow for publish-subscribe. But we sometimes see messages just get piled up in SYSTEM.INTER.QMGR.PUBS in the queue manager where Topics & subscriptions are defined and to get the message flow back again we will have to restart the queue manager. I am trying to understand what are the possible scenarios we could get this issue. I have read few of them like if there is no consumers on the destination subscription queue messages might get piled up in this SYSTEM queue.\nBut in our case all the cluster transmit & other subscription queues are empty when we see this backlog. Any help or anyone seen similar behaviour??### Assistant: As Shashi says, this queue is where inbound publications arrive from other queue managers in the MQ cluster. It is the queue manager's responsibility to process these messages as quickly as possible and send them on to any matching subscriptions. The behaviour of the consuming subscription applications will not be the cause of any build up.If you see temporary build ups on this queue it can imply that the inbound rate is faster than the queue manager can process them. You can verify this by stopping your inbound channels and seeing if the queue drains.However, if messages still don't drain from the queue it's possible that inbound messages have stopped being processed from that queue. This could be due to an error so check your queue manager error logs from the time that messages start to build up as this is where this would be reported.\n"} +{"text": "### Human: I'm trying to simplify the provisioning of JBoss EAP 6 applications by adding common components to the base EAP 6 installation directory (e.g. ojdbc driver).For the WMQ JCA resource adapter, I have everything working just fine if I put the 'wmq.jmsra.rar' archive in the 'deployments' folder. I just need to configure theresource-adapterssection of thestandalone.xmlfile according to the official documentation.Now, is it possible to create a JBoss module and include it via the 'global-modules' section? I tried creating a modulewmq.rawith resource-rootwmq.jmsra.rar, but the module won't load.### Assistant: I may have found the answer i was looking for. I ran into post about the similar issue for Active MQhereandhere. I followed the same canvas for WMQ:unpack thewmq.jmsra.rarin your module directory (e.g.modules/wmq/jmsra/main/)create amodule.xmldescriptor for you modulethis one worked for me with WMQ 7.5.0.3. I had problems when some of the dependencies were missing\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \nimport your module the usual way instandalone.xmlI didn't fully validate this solution in production like environment, I'll update if needed.\n"} +{"text": "### Human: I have installed Websphere MQ 8 server in my Windows 8,using MQ Explorer :\nI created a queue managerMAJID.QUEUE.MANAGERwith port1419.\nI created aTCPlistener on port1419.I tried one of the java programs that Tools from MQ8 installation, it runs like this :PCF_ListQueueNames MAJID.QUEUE.MANAGER 10.196.67.99 1419but I only got :Completion Code '2', Reason '2035'.UPDATE:the log file says :AMQ9777: Channel was blocked\n\n EXPLANATION:\n The inbound channel 'SYSTEM.DEF.SVRCONN' was blocked from address 'ITD- 968735\n (192.168.56.1)' because the active values of the channel matched a record\n configured with USERSRC(NOACCESS). The active values of the channel were\n 'CLNTUSER(alotfi) ADDRESS(ITD-968735)'.\n ACTION:\n Contact the systems administrator, who should examine the channel\n authentication records to ensure that the correct settings have been\n configured. The ALTER QMGR CHLAUTH switch is used to control whether channel\n authentication records are used. The command DISPLAY CHLAUTH can be used to\n query the channel authentication records. \n ----- cmqxrmsa.c : 1461 -------------------------------------------------------\n 1/13/2016 15:55:13 - Process(9988.27) User(MUSR_MQADMIN) Program(amqrmppa.exe)\n Host(ITD-968735) Installation(Installation1)\n VRMF(8.0.0.4) QMgr(MAJID.QUEUE.MANAGER)\n\n AMQ9999: Channel 'SYSTEM.DEF.SVRCONN' to host '192.168.56.1' ended abnormally.\n\n EXPLANATION:\n The channel program running under process ID 9988(8292) for channel\n 'SYSTEM.DEF.SVRCONN' ended abnormally. The host name is '192.168.56.1'; in some\n cases the host name cannot be determined and so is shown as '????'.### Assistant: There is agreat MQ security blog articlewhich describes how to configure MQ to let clients connect securely (i.e. without just turning the security features off).However to address your specific question, the default channel authentication rules for new MQ 8 queue managers prevent client connections to the queue manager via SYSTEM.* channels. If you runDIS CHLAUTH(*) ALLon a new MQ 8 queue manager you'll see:DIS CHLAUTH(*) ALL\n 2 : DIS CHLAUTH(*) ALL\nAMQ8878: Display channel authentication record details.\n CHLAUTH(SYSTEM.ADMIN.SVRCONN) TYPE(ADDRESSMAP)\n DESCR(Default rule to allow MQ Explorer access)\n CUSTOM( ) ADDRESS(*)\n USERSRC(CHANNEL) CHCKCLNT(ASQMGR)\n ALTDATE(2016-01-14) ALTTIME(16.15.20)\nAMQ8878: Display channel authentication record details.\n CHLAUTH(SYSTEM.*) TYPE(ADDRESSMAP)\n DESCR(Default rule to disable all SYSTEM channels)\n CUSTOM( ) ADDRESS(*)\n USERSRC(NOACCESS) WARN(NO)\n ALTDATE(2016-01-14) ALTTIME(16.15.20)\nAMQ8878: Display channel authentication record details.\n CHLAUTH(*) TYPE(BLOCKUSER)\n DESCR(Default rule to disallow privileged users)\n CUSTOM( ) USERLIST(*MQADMIN)\n WARN(NO) ALTDATE(2016-01-14)\n ALTTIME(16.15.20)The second rule prevents all client connections to channels named SYSTEM.*. This applies to you because you are connecting to SYSTEM.DEF.SVRCONN.You probably want to define a new SVRCONN channel for your application to connect to and use that instead of SYSTEM.DEF.SVRCONN.When defining a new channel MQ security best practice is to set the MCAUSER field of the channel to a user that doesn't exist - for example 'nobody'. You can then define a new channel authentication rule that allows your Java application to adopt the user ID you have chosen instead of the default user 'nobody'. The rule could for example be an ADDRESSMAP rule that allows any clients connecting from a specific IP address to connect to the new channel and to adopt the user ID you have chosen.In summary:1) Choose a valid user that exists on your system (but that isn't in the 'mqm' group)2) Define a new non-SYSTEM channel, with MCAUSER set to 'nobody', e.g.DEFINE CHANNEL(MY.FIRST.CHANNEL) CHLTYPE(SVRCONN) MCAUSER('nobody')3) Define a new channel auth rule that allows connections from the IP address of you client, and adopts the user you have defined, e.g.SET CHLAUTH(MY.FIRST.CHANNEL) TYPE(ADDRESSMAP) ADDRESS('192.168.56.1') USERSRC(MAP) MCAUSER('validuser') ACTION(REPLACE)You will have one further step to perform. You need to tell MQ that 'validuser' is allowed to connect, put, and/or get messages. You can use SET AUTHREC to define the authorities the client should have. Seethe KnowledgeCenterfor the valid AUTHREC options.The above is an example of how to configure MQ to let your client connect. You should use a combination of blog articles like the one I've linked to and the KnowledgeCenter to set up your security in the way want. For example you might want to use TLS certificates to authenticate your Java client which I haven't described above.\n"} +{"text": "### Human: I'm unable to process large messages from IBM MQ and get the below error:JMSCMQ0001: WebSphere MQ call failed with compcode '1' ('MQCC_WARNING') reason '2080' ('MQRC_TRUNCATED_MSG_FAILED')I'm using the DefaultListenerContainer and not consuming via a MessageConsumer using IBM MQ Java API classes directly. I believe by using IBM MQ JMS API you can specific options before retrieving the message from the queue. But how do I do that with DefaultListenerContainer, is there a system property I can set for these?If using IBM MQ JMS API(I'm not consuming message like this, pasted just for reference):MQGetMessageOptions mqGetMessageOptions = new MQGetMessageOptions();\nmqGetMessageOptions.waitInterval = ipreoProperties.getMqReceiveWaitTime();\nmqGetMessageOptions.options = MQC.MQGMO_WAIT | MQC.MQPMO_SYNCPOINT | MQC.MQGMO_ACCEPT_TRUNCATED_MSG;Below is my Java Config for the IBM MQ Connection:@Bean\n public CachingConnectionFactory ipreoMQCachingConnectionFactory() {\n\n CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory();\n\n //Not defining MQQueueConnectionFactory as separate bean as Spring boot's auto-configuration finds two instances\n //of ConnectionFactory and throws ambiguous implementation exception \n //One implementation is CachingConnectionFactory and other one would be MQQueueConnectionFactory if defined separately\n\n MQQueueConnectionFactory mqConnectionFactory = new MQQueueConnectionFactory();\n\n try {\n\n mqConnectionFactory.setHostName(env.getRequiredProperty(AppEnvPropertyConstants.JmsConstants.IPREO_MQ_HOSTNAME));\n mqConnectionFactory.setQueueManager(env.getRequiredProperty(AppEnvPropertyConstants.JmsConstants.IPREO_MQ_QUEUE_MGR));\n mqConnectionFactory.setPort(env.getRequiredProperty(AppEnvPropertyConstants.JmsConstants.IPREO_MQ_PORT, Integer.class));\n mqConnectionFactory.setChannel(env.getRequiredProperty(AppEnvPropertyConstants.JmsConstants.IPREO_MQ_CHANNEL));\n //mqConnectionFactory.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n\n //Setting connection mode as Client so it doesn't complain for native IBM MQ libraries\n mqConnectionFactory.setIntProperty(CommonConstants.WMQ_CONNECTION_MODE, CommonConstants.WMQ_CM_CLIENT);\n\n } catch (JMSException exception) {\n exception.printStackTrace();\n }\n\n cachingConnectionFactory.setTargetConnectionFactory(mqConnectionFactory);\n\n //Setting session caching size as 10, don't think we need more\n cachingConnectionFactory.setSessionCacheSize(10);\n cachingConnectionFactory.setReconnectOnException(true);\n\n return cachingConnectionFactory;\n }\n\n public DefaultMessageListenerContainer ipreoDealActivityListenerContainer() {\n\n DefaultMessageListenerContainer factory = new DefaultMessageListenerContainer();\n factory.setConnectionFactory(ipreoMQCachingConnectionFactory());\n factory.setDestinationName(env.getRequiredProperty(AppEnvPropertyConstants.JmsConstants.IPREO_DEAL_QUEUE_NAME));\n factory.setMessageListener(ipreoDealActivityListener());\n factory.setSessionAcknowledgeMode(Session.AUTO_ACKNOWLEDGE);\n\n return factory;\n }\n\n@Bean\n public MessageListener ipreoDealActivityListener() {\n return new IpreoDealActivityListener();\n }Appreciate your help, thanks.### Assistant: Adding a late response as it might be useful to someone.In my case, when the java client had this exception, we noticed the actual message size was larger than the default 4 MB buffer size.The Java API does not provide a hook to change buffer size. Hence, the buffer size has to be updated at the MQ server level.First, we increased the message size in queue properties - It did not work.Then, we increased the message size property at the MQ channel level as well, which finally resolved the issue.To summarise,increase the buffer size at the MQ server for queue & the channel both.\n"} +{"text": "### Human: Currently. I have to create client application to connect IBM MQ server which only support TLS. After google a lot. I know the JDK used have to support FIPS.Any one can help with how to set it up on Linux server?### Assistant: You're right. FIPS is not supported as default in Oracle JDK.Download JCE fromhttp://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.htmlPut the extracted jars to %JAVA_HOME%/jre/lib/security. But these jars are just interface.InstallNSSas an FIPS implementation.Change your java.security provider to it.Or you can switch to use IBM SDK will is easy to config FIPS mode, Details please refer to IBM knowledge center.\n"} +{"text": "### Human: Imagine an application(A1) running on a server(S1) makes a client connection to a Queue Manager(QM1) running on a different server(S2). Is it possible to extend the functionality of Queue Manager so that when the application makes a MQGET or MQPUT call on a queue on the Queue Manager, a message can be logged to a log file or some custom action can be performed?Thanks,Yash### Assistant: An API Exit can be used to log the API calls made by an application. This API exit can run on either S1 or S2 from your question.The sample API Exit supplied with MQ (amqsaxe) would be a good starting point as that's all it does.Remember that this will have a detrimental effect on the performance of your application.Further ReadingThe API exit sample program\n"} +{"text": "### Human: After throwing an exception, the MQ message endpoint of our Java MDB application is being paused with the messageCWWMQ0007W: The message endpoint has been paused by the system. Message delivery failed to the endpoint more than times.I understand that this is per Application Specification and that this behavior is reasonable for many applications.In our case, we would like the MQ message causing the exception to be consumed from the queue and the application remaining running, ie. processing the next messages.Is there any way to achieve this way other than by catching any Throwable in the MDB onMessage method?### Assistant: Read this articleHow WebSphere Application Server V8.x handles poison messages, it has various scenarios described.If you want to just continue processing without stopping endpoint, then either uncheck theStop endpoint if message delivery failsor setNumber of sequential delivery failures before suspending endpointto some higher value in the activation specification configuration. You also have to configureBackout threshold (BOTHRESH)property in the WebSphere MQ.In this way exception message will be put toDEAD.LETTER.QUEUEby MQ and will allow you to process next messages.\n"} +{"text": "### Human: I am attempting to link the newest Jboss Fuse 6.2 with the newest Websphere MQ 8.0.0.3.I am having issues where the application gives up waiting for the service:\n[ERROR] Failed to execute goal org.apache.camel:camel-maven-plugin:2.15.1.redhat-620133:run (default-cli) on project WebsphereThroughput: null: MojoExecutionException: InvocationTargetException: Gave up waiting for service (objectClass=org.apache.camel.CamelContext) -> [Help 1]I have added a ConnectionFactory to my blueprint source:\n \n \n \n \"/>\n \n \n \n \nMy route is simple and takes a message from a file and inserts it onto a Websphere MQ queue named INPUT:\n \n \n \n \nFinally I have added the following IBM dependencies inside of the pom.xml file (As well as installing them onto my local maven repository):\n com.ibm.mq\n com.ibm.mq.allclient\n 8.0.0.3\n\n\n com.ibm\n com.ibm.mq\n 8.0.0.3\n\n\n com.ibm\n com.ibm.mqjms\n 8.0.0.3\n\n\n jms\n jms\n 8.0.0.3\nI would appreciate any help as this has been stumping me for a while now. Thank you.Stack Trace:[INFO] Scanning for projects...\n[INFO] \n[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1\n[INFO] \n[INFO] ------------------------------------------------------------------------\n[INFO] Building Camel Blueprint Route 1.0.0\n[INFO] ------------------------------------------------------------------------\n[WARNING] The POM for com.sun.xml.bind:jaxb-core:jar:2.2.11 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details\n[WARNING] The POM for com.sun.xml.bind:jaxb-impl:jar:2.2.11 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details\n[INFO] \n[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ test ---\n[INFO] Deleting C:\\Users\\Administrator\\workspace\\test\\target\n[INFO] \n[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ test ---\n[INFO] Using 'UTF-8' encoding to copy filtered resources.\n[INFO] Copying 2 resources\n[INFO] \n[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ test ---\n[INFO] Nothing to compile - all classes are up to date\n[INFO] \n[INFO] --- maven-bundle-plugin:2.3.7:manifest (bundle-manifest) @ test ---\n[INFO] \n[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ test ---\n[INFO] Not copying test resources\n[INFO] \n[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ test ---\n[INFO] Not compiling test sources\n[INFO] \n[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ test ---\n[INFO] Tests are skipped.\n[INFO] \n[INFO] --- maven-bundle-plugin:2.3.7:bundle (default-bundle) @ test ---\n[WARNING] Bundle org.Fuse.Testing:test:bundle:1.0.0 : Instructions in Private-Package, or -testpackages that are never used: org\\.Fuse\\.Testing\\.test\\..*|org\\.Fuse\\.Testing\\.test\nClasspath: Jar:.,Jar:camel-core,Jar:jaxb-core,Jar:jaxb-impl,Jar:camel-blueprint,Jar:camel-core-xml,Jar:camel-core-osgi,Jar:slf4j-api,Jar:slf4j-log4j12,Jar:log4j,Jar:camel-test-blueprint,Jar:camel-test,Jar:camel-core,Jar:org.apache.aries.blueprint,Jar:org.apache.aries.util,Jar:org.apache.aries.proxy.impl,Jar:org.apache.aries.proxy.api,Jar:de.kalpatec.pojosr.framework,Jar:pax-swissbox-tinybundles,Jar:ops4j-base-lang,Jar:ops4j-base-io,Jar:ops4j-base-monitors,Jar:ops4j-base-store,Jar:pax-swissbox-bnd,Jar:bndlib,Jar:commons-logging,Jar:junit,Jar:hamcrest-core,Jar:org.apache.felix.configadmin,Jar:org.apache.felix.fileinstall,Jar:camel-jms,Jar:camel-spring,Jar:spring-aop,Jar:aopalliance,Jar:spring-jms,Jar:spring-core,Jar:spring-messaging,Jar:spring-context,Jar:spring-expression,Jar:spring-tx,Jar:spring-beans\n\n[INFO] \n[INFO] >>> camel-maven-plugin:2.15.1.redhat-620133:run (default-cli) @ test >>>\n[INFO] \n[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ test ---\n[INFO] Using 'UTF-8' encoding to copy filtered resources.\n[INFO] Copying 2 resources\n[INFO] \n[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ test ---\n[INFO] Nothing to compile - all classes are up to date\n[INFO] \n[INFO] --- maven-bundle-plugin:2.3.7:manifest (bundle-manifest) @ test ---\n[INFO] \n[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ test ---\n[INFO] Not copying test resources\n[INFO] \n[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ test ---\n[INFO] Not compiling test sources\n[INFO] \n[INFO] <<< camel-maven-plugin:2.15.1.redhat-620133:run (default-cli) @ test <<<\n[INFO] \n[INFO] --- camel-maven-plugin:2.15.1.redhat-620133:run (default-cli) @ test ---\n[INFO] Using org.apache.camel.test.blueprint.Main to initiate a CamelContext\n[WARNING] Invalid POM for com.sun.xml.bind:jaxb-core:jar:2.2.11, transitive dependencies (if any) will not be available, enable debug logging for more details\n[WARNING] Invalid POM for com.sun.xml.bind:jaxb-impl:jar:2.2.11, transitive dependencies (if any) will not be available, enable debug logging for more details\n[WARNING] Invalid POM for com.sun.xml.bind:jaxb-core:jar:2.2.11, transitive dependencies (if any) will not be available, enable debug logging for more details\n[WARNING] Invalid POM for com.sun.xml.bind:jaxb-impl:jar:2.2.11, transitive dependencies (if any) will not be available, enable debug logging for more details\n[WARNING] Invalid POM for com.sun.xml.bind:jaxb-core:jar:2.2.11, transitive dependencies (if any) will not be available, enable debug logging for more details\n[WARNING] Invalid POM for com.sun.xml.bind:jaxb-impl:jar:2.2.11, transitive dependencies (if any) will not be available, enable debug logging for more details\n[WARNING] Invalid POM for com.sun.xml.bind:jaxb-core:jar:2.2.11, transitive dependencies (if any) will not be available, enable debug logging for more details\n[WARNING] Invalid POM for com.sun.xml.bind:jaxb-impl:jar:2.2.11, transitive dependencies (if any) will not be available, enable debug logging for more details\n[INFO] Starting Camel ...\n[mel.test.blueprint.Main.main()] MainSupport INFO Apache Camel 2.15.1.redhat-620133 starting\n[mel.test.blueprint.Main.main()] Activator INFO Camel activator starting\n[mel.test.blueprint.Main.main()] Activator INFO Camel activator started\n[mel.test.blueprint.Main.main()] BlueprintExtender INFO No quiesce support is available, so blueprint components will not participate in quiesce operations\n[ Blueprint Extender: 1] BlueprintContainerImpl INFO Bundle test is waiting for namespace handlers [http://camel.apache.org/schema/blueprint]\n[ Blueprint Extender: 1] BeanRecipe WARN Object to be destroyed is not an instance of UnwrapperedBeanHolder, type: null\n[ Blueprint Extender: 1] BlueprintCamelContext INFO Apache Camel 2.15.1.redhat-620133 (CamelContext: camel-1) is shutting down\n[ Blueprint Extender: 1] BlueprintCamelContext INFO Apache Camel 2.15.1.redhat-620133 (CamelContext: camel-1) uptime not started\n[ Blueprint Extender: 1] BlueprintCamelContext INFO Apache Camel 2.15.1.redhat-620133 (CamelContext: camel-1) is shutdown in 0.016 seconds\n[ Blueprint Extender: 1] BlueprintContainerImpl ERROR Unable to start blueprint container for bundle test\norg.osgi.service.blueprint.container.ComponentDefinitionException: Unable to instantiate components\n at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:672)\n at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:370)\n at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:261)\n at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)\n at java.util.concurrent.FutureTask.run(Unknown Source)\n at org.apache.aries.blueprint.container.ExecutorServiceWrapper.run(ExecutorServiceWrapper.java:106)\n at org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48)\n at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)\n at java.util.concurrent.FutureTask.run(Unknown Source)\n at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)\n at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)\n at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)\n at java.lang.Thread.run(Unknown Source)\nCaused by: java.lang.NoClassDefFoundError: javax/jms/ConnectionFactory\n at java.lang.Class.getDeclaredConstructors0(Native Method)\n at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)\n at java.lang.Class.getConstructors(Unknown Source)\n at org.apache.aries.blueprint.container.BeanRecipe.findMatchingConstructors(BeanRecipe.java:509)\n at org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:327)\n at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:806)\n at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)\n at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)\n at java.util.concurrent.FutureTask.run(Unknown Source)\n at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)\n at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:245)\n at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:183)\n at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:668)\n ... 13 more\nCaused by: java.lang.ClassNotFoundException: javax.jms.ConnectionFactory\n at java.net.URLClassLoader.findClass(Unknown Source)\n at java.lang.ClassLoader.loadClass(Unknown Source)\n at java.lang.ClassLoader.loadClass(Unknown Source)\n ... 26 more\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN Test bundle headers: Bundle-ManifestVersion=2, Bundle-Name=System Bundle, Bundle-SymbolicName=de.kalpatec.pojosr.framework, Bundle-Vendor=kalpatec, Bundle-Version=0.2.1\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.camel.spi.TypeConverterLoader], bundle: org.apache.camel.camel-spring [28], symbolicName: org.apache.camel.camel-spring\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.camel.spi.DataFormatResolver], bundle: org.apache.camel.camel-core [3], symbolicName: org.apache.camel.camel-core\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.framework.hooks.bundle.EventHook], bundle: org.apache.aries.blueprint [13], symbolicName: org.apache.aries.blueprint\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.felix.cm.PersistenceManager], bundle: org.apache.felix.configadmin [25], symbolicName: org.apache.felix.configadmin\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.NamespaceHandler], bundle: org.apache.aries.blueprint [13], symbolicName: org.apache.aries.blueprint\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.camel.spi.TypeConverterLoader], bundle: org.apache.camel.camel-core [3], symbolicName: org.apache.camel.camel-core\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.camel.spi.ComponentResolver], bundle: org.apache.camel.camel-spring [28], symbolicName: org.apache.camel.camel-spring\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.service.cm.ConfigurationAdmin], bundle: org.apache.felix.configadmin [25], symbolicName: org.apache.felix.configadmin\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.NamespaceHandler], bundle: org.apache.aries.blueprint [13], symbolicName: org.apache.aries.blueprint\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.service.url.URLStreamHandlerService], bundle: org.apache.felix.fileinstall [26], symbolicName: org.apache.felix.fileinstall\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.service.startlevel.StartLevel], bundle: de.kalpatec.pojosr.framework [0], symbolicName: de.kalpatec.pojosr.framework\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.service.cm.ManagedServiceFactory], bundle: org.apache.felix.fileinstall [26], symbolicName: org.apache.felix.fileinstall\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.NamespaceHandler], bundle: org.apache.aries.blueprint [13], symbolicName: org.apache.aries.blueprint\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.NamespaceHandler], bundle: org.apache.aries.blueprint [13], symbolicName: org.apache.aries.blueprint\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.services.ParserService], bundle: org.apache.aries.blueprint [13], symbolicName: org.apache.aries.blueprint\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.NamespaceHandler], bundle: org.apache.aries.blueprint [13], symbolicName: org.apache.aries.blueprint\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.NamespaceHandler], bundle: org.apache.camel.camel-blueprint [6], symbolicName: org.apache.camel.camel-blueprint\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.service.packageadmin.PackageAdmin], bundle: de.kalpatec.pojosr.framework [0], symbolicName: de.kalpatec.pojosr.framework\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.NamespaceHandler], bundle: org.apache.aries.blueprint [13], symbolicName: org.apache.aries.blueprint\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.service.blueprint.container.BlueprintContainer], bundle: org.apache.aries.blueprint [13], symbolicName: org.apache.aries.blueprint\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.camel.spi.TypeConverterLoader], bundle: de.kalpatec.pojosr.framework [0], symbolicName: de.kalpatec.pojosr.framework\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.camel.spi.LanguageResolver], bundle: org.apache.camel.camel-spring [28], symbolicName: org.apache.camel.camel-spring\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.camel.spi.LanguageResolver], bundle: org.apache.camel.camel-core [3], symbolicName: org.apache.camel.camel-core\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.camel.spi.ComponentResolver], bundle: org.apache.camel.camel-core [3], symbolicName: org.apache.camel.camel-core\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.service.cm.ConfigurationListener, org.apache.felix.fileinstall.ArtifactListener, org.apache.felix.fileinstall.ArtifactInstaller], bundle: org.apache.felix.fileinstall [26], symbolicName: org.apache.felix.fileinstall\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.proxy.ProxyManager], bundle: org.apache.aries.proxy.impl [15], symbolicName: org.apache.aries.proxy.impl\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.service.blueprint.container.BlueprintContainer], bundle: org.apache.camel.camel-blueprint [6], symbolicName: org.apache.camel.camel-blueprint\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.camel.spi.ComponentResolver], bundle: org.apache.camel.camel-jms [27], symbolicName: org.apache.camel.camel-jms\n[mel.test.blueprint.Main.main()] BlueprintExtender INFO Destroying BlueprintContainer for bundle test\n[mel.test.blueprint.Main.main()] BlueprintExtender INFO Destroying BlueprintContainer for bundle org.apache.aries.blueprint\n[mel.test.blueprint.Main.main()] BlueprintExtender INFO Destroying BlueprintContainer for bundle org.apache.camel.camel-blueprint\n[mel.test.blueprint.Main.main()] Activator INFO Camel activator stopping\n[mel.test.blueprint.Main.main()] Activator INFO Camel activator stopped\n[mel.test.blueprint.Main.main()] CamelBlueprintHelper INFO Deleting work directory target/bundles/1442417582122\n[ERROR] *************************************\n[ERROR] Error occurred while running main from: org.apache.camel.test.blueprint.Main\n[ERROR] \njava.lang.reflect.InvocationTargetException\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\n at java.lang.reflect.Method.invoke(Unknown Source)\n at org.apache.camel.maven.RunMojo$1.run(RunMojo.java:488)\n at java.lang.Thread.run(Unknown Source)\nCaused by: java.lang.RuntimeException: Gave up waiting for service (objectClass=org.apache.camel.CamelContext)\n at org.apache.camel.test.blueprint.CamelBlueprintHelper.getOsgiService(CamelBlueprintHelper.java:240)\n at org.apache.camel.test.blueprint.CamelBlueprintHelper.getOsgiService(CamelBlueprintHelper.java:202)\n at org.apache.camel.test.blueprint.Main.doStart(Main.java:104)\n at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)\n at org.apache.camel.main.MainSupport.run(MainSupport.java:150)\n at org.apache.camel.main.MainSupport.run(MainSupport.java:354)\n at org.apache.camel.test.blueprint.Main.main(Main.java:81)\n ... 6 more\n[ERROR] *************************************\n[INFO] ------------------------------------------------------------------------\n[INFO] BUILD FAILURE\n[INFO] ------------------------------------------------------------------------\n[INFO] Total time: 34.478 s\n[INFO] Finished at: 2015-09-16T11:33:32-05:00\n[INFO] Final Memory: 33M/458M\n[INFO] ------------------------------------------------------------------------\n[ERROR] Failed to execute goal org.apache.camel:camel-maven-plugin:2.15.1.redhat-620133:run (default-cli) on project test: null: MojoExecutionException: InvocationTargetException: Gave up waiting for service (objectClass=org.apache.camel.CamelContext) -> [Help 1]\n[ERROR] \n[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.\n[ERROR] Re-run Maven using the -X switch to enable full debug logging.\n[ERROR] \n[ERROR] For more information about the errors and possible solutions, please read the following articles:\n[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException### Assistant: After many different possible solutions I have found what works:First - I did not have the correct version of the .jar files. The .jars must be the same version as the MQ you are using. (in my case I should have been using 8.0.0.2)Second - The jars you need are : com.ibm.mq.allclient.jar, fscontext.jar, providerutil.jar, and jms.jarThird - The jars must be imported through Maven. The .jars cannot be added to the classpath as Fuse does not know to look here.Finally - The bean looked like this:\n \n \n \n \n \n \n \n \n \n\n"} +{"text": "### Human: I'm having trouble trying to add MQMD header in compute node. \nTried something like that:SET OutputRoot.Properties = InputRoot.Properties;\nCREATE LASTCHILD OF OutputRoot DOMAIN('MQMD') NAME 'MQMD';\nSET OutputRoot.MQMD.Format = MQFMT_NONE; \nSET OutputRoot.MQMD.CodedCharSetId = 1208;\nSET OutputRoot.MQMD.Encoding = 546;But it always ends up with this exception:Text:CHARACTER:Caught exception and rethrowing\nInsert\nType:INTEGER:14\nText:CHARACTER:test.MyAdp.AddHeader\nRecoverableException\nFile:CHARACTER:F:\\build\\slot1\\S900_P\\src\\CommonServices\\ImbValue.cpp\nLine:INTEGER:989\nFunction:CHARACTER:ImbValue::stateError\nType:CHARACTER:\nName:CHARACTER:\nLabel:CHARACTER:\nCatalog:CHARACTER:BIPmsgs\nSeverity:INTEGER:3\nNumber:INTEGER:2329\nText:CHARACTER:Value not validFor sure, without adding MQMD header everything works perfectly well. \nI tried to use other formats as MQFMT_STRING, MQFMT_RF_HEADER_2 (with MQRFH2 header added next) but with the same result.Can anyone give me any clue?\nIs it possible to get some more meaningful diagnostics from broker somehow?UPDHere is trace out before entering Compute node which tries to add MQMD header. The trace node after Compute is never reached.( ['GENERICROOT' : 0xac05710]\n(0x01000000:Name):Properties = ( ['GENERICPROPERTYPARSER' : 0xaf5ccc0]\n(0x03000000:NameValue):MessageSet = '' (CHARACTER)\n(0x03000000:NameValue):MessageType = '' (CHARACTER)\n(0x03000000:NameValue):MessageFormat = '' (CHARACTER)\n(0x03000000:NameValue):Encoding = 546 (INTEGER)\n(0x03000000:NameValue):CodedCharSetId = 0 (INTEGER)\n(0x03000000:NameValue):Transactional = TRUE (BOOLEAN)\n(0x03000000:NameValue):Persistence = FALSE (BOOLEAN)\n(0x03000000:NameValue):CreationTime = NULL\n(0x03000000:NameValue):ExpirationTime = -1 (INTEGER)\n(0x03000000:NameValue):Priority = 0 (INTEGER)\n(0x03000000:NameValue):ReplyIdentifier = X'000000000000000000000000000000000000000000000000' (BLOB)\n(0x03000000:NameValue):ReplyProtocol = 'UNKNOWN' (CHARACTER)\n(0x03000000:NameValue):Topic = NULL\n(0x03000000:NameValue):ContentType = '' (CHARACTER)\n(0x03000000:NameValue):IdentitySourceType = '' (CHARACTER)\n(0x03000000:NameValue):IdentitySourceToken = '' (CHARACTER)\n(0x03000000:NameValue):IdentitySourcePassword = '' (CHARACTER)\n(0x03000000:NameValue):IdentitySourceIssuedBy = '' (CHARACTER)\n(0x03000000:NameValue):IdentityMappedType = '' (CHARACTER)\n(0x03000000:NameValue):IdentityMappedToken = '' (CHARACTER)\n(0x03000000:NameValue):IdentityMappedPassword = '' (CHARACTER)\n(0x03000000:NameValue):IdentityMappedIssuedBy = '' (CHARACTER)\n)\n(0x01000000:Name):BLOB = ( ['none' : 0xb30d460]\n(0x03000000:NameValue):BLOB = X'314........d0a' (BLOB)\n)\n)UPD2Here is fragment of user trace, message appears in try-catch node right after returning from compute node that creates MQMD.2015-09-14 13:20:06.936871 1200 UserTrace BIP2539I: Node '': Evaluating expression ''InputRoot.BLOB.BLOB || CAST(header AS BLOB CCSID 1208)'' at ('test.MyAdp_AddHeader.Main', '31.51'). This resolved to ''X'314....3d0d'''. \n2015-09-14 13:20:06.937023 1200 UserTrace BIP2566I: Node 'test.MyAdp.AddHeader': Assigning value ''X'314...6d0'... (data of len 3915 truncated)'' to field / variable ''OutputRoot.BLOB.BLOB''. \n2015-09-14 13:20:06.937043 1200 UserTrace BIP2537I: Node 'test.MyAdp.AddHeader': Executing statement ''RETURN TRUE;'' at ('test.MyAdp_AddHeader.Main', '33.4'). \n2015-09-14 13:20:06.937718 1200 UserTrace BIP4081I: Message propagated to catch terminal from try-catch node 'test.MyAdp.ErrorHandler.Timer.Try Catch'. \n The try-catch node 'test.MyAdp.ErrorHandler.Timer.Try Catch' has caught an exception which occurred in a node connected to its try terminal. The message has been augmented with an exception list and is propagating it to any nodes connected to its catch terminal for further processing. See the following messages for details of the exception list. \n No user action required.### Assistant: Some attributes in your Properties folder could be unexpectedly null.\nThe issue occurs when they are copied to the MQMD folder.\nA user or sys trace will show you which one.Is your issue related to the Timeout Notification node?\nI had the issue with Properties.CreationTime = null\nI saw others having the issue with Properties.Topic = nullI coded it to bypass the issue.\n"} +{"text": "### Human: We are using IBM MQ as a messaging layer with multi instance setup. The .NET application using XMS client (ver 7.5) will read off messages from the multiple Queues. Since the volume of the message is high, I have created around 5 connection per queue to read the messages. And there are 4 such queues. So in the application at any point of time, there are 20 connections and 20 session opened. With this setup I am facing two issues:Often I get the two XMS exceptions while opening the connections.One is MQRC_HOST_NOT_AVAILABLE ((2538, X\u20199EA\u2019) The attempt to allocate a conversation to the remote system failed.) and the other is MQRC_CONNECTION_BROKEN(Connection to queue manager lost.)While closing the application, it is taking lot more time to close of all the sessions and connections because they are too many of them.So I was thinking to reduce the number of connection. By just creating one connection per queue and open 5 session per queue. In this way, the number of connections will be reduced to 4 (from 20). So both the above said issues will be solved I think (yet to try)So wanted someone in the know, to share their experience on what is the best practice of handing the above scenario. Will there be any delay in delivering the messages if we open multiple sessions per connection compared to single session per connection?The code I'm using is below:private XMSFactoryFactory xMSFactoryFactory;\nprivate IConnectionFactory connectionFactory;\nprivate IConnection connectionWMQ;\nprivate ISession sessionWMQ;\nprivate IDestination destination;\nprivate IMessageConsumer messageConsumer;\n\nxMSFactoryFactory= XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\nconnectionFactory = _xMSFactoryFactory.CreateConnectionFactory();\n// Set queue manager name, set server names, channel, use\n// XMSC.WMQ_CM_CLIENT as WMQ_CONNECTION_MODE\n\nconnectionWMQ = _connectionFactory.CreateConnection();\nsessionWMQ = _connectionWMQ.CreateSession(true, AcknowledgeMode.SessionTransacted);\ndestination = sessionWMQ.CreateQueue(_queueSettings.QueueName);\nmessageConsumer = sessionWMQ.CreateConsumer(_destination);\nmessageConsumer.MessageListener = new MessageListener(ProcessNewMessage)### Assistant: The QMgr when properly tuned can handle many thousands of connections. TheMQRC_HOST_NOT_AVAILABLEsuggests that you are bumping against a resource limitation andMQRC_CONNECTION_BROKENerrors suggest that your sessions are not ending cleanly and are being orphaned.Unfortunately, there is insufficient information to diagnose this with the question as written. If I were trying to diagnose, I'd want to know the configuration settings for all the relevant tuning parameters:MAXHANDSSHARECONVThe max channel instance settings at the QMgr and channelListener backlog settingsMAXUMSGSKeepalive, heartbeat and other channel tuningOperationally, I'd want to know how many channel instances were running when this happens.I'd also want to know what errors are seen, if any, in the global error log and the QMgr's error log.I'd query for uncommitted transactions and look for rollback events in the error log. With a default tuned QMgr transaction rollbacks can cause channel loss if the exceptions aren't handled, and this is not something people intuitively look for.The answers to these might lead to tuning the QMgr, enhancing the app, or more diagnostics, after which I'd try again.But the question hasn't included even basic diagnostic information at this point so it is impossible to determine root cause with any confidence whatsoever. What I can say based on the question as written is that the one thing Iwouldn'tdo is to try to resolve this by reducing the number of connections in the app since the 20 legitimate the app is designed for is trivial for any QMgr.\n"} +{"text": "### Human: Is there a command to run, a configuration file to check or a way to check visually inIBM WepSphere MQ ExplorerifWebSphere MQis using SSL?WebSphere MQ Version:user@server:/ #dspmqver\nName: WebSphere MQ\nVersion: 7.0.1.5### Assistant: Yes! In order for a QMgr to use SSL the channel must have specified a value forSSLCIPH. If the channel has something specified inSSLCIPHthen the channel will not run without SSL. Just display the channel definition and look in theSSLCIPHfield. If it isn't blank and the channel is running, it is using SSL.(Note: MQ uses TLS, really. It has never used SSL. It has always used TLS but allowed SSL ciphers to run under TLS.)However, this doesn't mean that any other channel is using SSL. Any channel that does not have a value forSSLCIPHwill run without SSL even if one or more channelsdospecify a value. Since MQ listeners are promiscuous, the remote QMgr or app can request to start any channel.For this reason, when enabling a QMgr to use SSL, it is necessary to either make sureallchannels use SSL or else useCHLAUTHrules to make sure the non-SSL channels aren't started by the remote node that is expected to use SSL.If the SSL channel also specifiesSSLCAUTH(REQUIRED)(which is the default) then the client or remote QMgr will be required to present a certificate for the local QMgr to validate. In that case if you display the channel status the Peer Name fields will contain a non-blank value. this is called Mutual Authentication. When using mutual auth be sure to use theSSLPEERorCHLAUTHrules to specify by distinguished Name which certificates are allowed to connect.FYI - Version7.0.1 of MQ is going out of supportin September 2015.UPDATE per commentsTo see the channel attributes or status, use WMQ Explorer or therunmqsccommand. Therunmqsccommand can be used interactively or in scripts. To run it interactively just typerunmqsc [qmgr name]and then enter the commands you want. In this case, they would beDIS CHL([channel name]) SSLCIPH SSLCAUTHfor the channel definition orDIS CHS([channel name]) SSLCIPH SSLCAUTHfor the channel status.(Substitute the actual channel name where it says[channel name].)To do the same thing in a script, try something like the following:echo DIS CHL([channel name]) SSLCIPH SSLCAUTH | runmqsc [qmgr name]\necho DIS CHS([channel name]) ALL | runmqsc [qmgr name]On non-Windows systems you will need to quote the parms due to the shell special characters:echo \"DIS CHL([channel name]) SSLCIPH SSLCAUTH\" | runmqsc [qmgr name]\necho \"DIS CHS([channel name]) ALL \" | runmqsc [qmgr name]\n"} +{"text": "### Human: I have a master MQ and a slave MQ. If the master MQ goes down, can I send the messages through the slave MQ using a message driven bean ? Also after my master MQ is up again can I reconnect the line automatically without restarting the JVM ?### Assistant: Is your HA (high-availability) Active/Passive or Active/Active? The standard HA is Active/Passive, so I will answer your question under that scenario.When your MQ system is normally running - the active queue manager (master) is running (up) and the passive queue manager (slave) is stopped (down). If the the active queue manager (master) has a problem and is stopped then the passive queue manager (slave) is started.At some point in the future when the problem with the master queue manager is fixed, the passive queue manager (slave) is stopped and the master queue manager is started.If you are using reconnect in your application, when the slave queue manager is stopped, your application will be disconnected and when the master queue manager is started, your application will connect to it.For HA Active/Passive, you can only ever have 1 queue manager running at a time (or none). You never have both the master and slave running at the same time.\n"} +{"text": "### Human: I have written EA and I am placing the Request message into WebSphere MQ QOne and getting response from MQ Qtwo. When ever i place the message into Q . The JMS provider cache the Message id . Keeping this id this will compare with the correlation id and pick the Response message read from the Qtwo. Just think now application is down and I have restarted the \nServer . So what would be happen to JMS cache ids ?### Assistant: It is your application that will have to cache theMessageIdso that it can pick the sameMessageIdagain and retrieve the response matching withCorrelationIdof response message.JMS Provider (in this case MQ) is capable of generating Unique MessageId. If a message is of typePersistent, then the message will survive JMS provider restart.\n"} +{"text": "### Human: So I have a JMS application deployed on a Webpshere Application Server, this application try to connect to the queue directy using a com.ibm.mq.jms.MQConnectionFactory and I wonder if I should include Websphere MQ jars in my application or should they be provided by Websphere Application Server. My application is currenty without them and I don't have a ClassNotFoundException but I do get issues (I have a SIB_MESSAGE error that appear), could this be related to the fact that my server is on PARENT_LAST or to an incompatibility between the WAS server version and the WMQ server version ?Should I include Websphere MQ jars in my application ? Could this help with my issues or make it worse ?Thanks for any help.### Assistant: Donotbundle WebSphere MQ jar files within your application. This will not be supported by IBM and is very bad practice.You must use the WebSphere MQ classes for JMS that are shipped within WebSphere Application Server (which are included within the WebSphere MQ JCA resource adapter). This way, the version of the classes for JMS you use will be updated as and when you apply WebSphere Application Server maintenance.Any version of the WebSphere MQ JCA resource adapter shipped within WebSphere Application Server can connect to any v7.x or v8 queue manager.Without further details on the exact error you are receiving, I cannot help further.\n"} +{"text": "### Human: TheMQQueueobject in IBM MQ has propertiesMQQueue.IsOpenandMQQueue.OpenStatus. Both are inherited from theMQManagedObjectclass. What do these properties represent and what are the differences between them? Do they show, for example, whether the queue is open forGET,PUTor both?Unfortunately the docs aren't very clear on these properties. The most helpful description I found are below. Note that these are taken from the ActiveX reference so I don't know how applicable they are.SourceIsOpen propertyReturns whether the queue is open.Read-only.SourceOpenStatus propertyRead-only. Indicates if the queue is opened or not. Initial value is TRUE after AccessQueue method or FALSE after New.In a next step I debugged theamqmdnet.dllwhich showed the following implementations for the properties:public bool IsOpen\n{\n get\n {\n return this.objectHandle != null && this.objectHandle.HOBJ != null && (this.objectHandle.HOBJ.Handle != 0 && -1 != this.objectHandle.HOBJ.Handle);\n }\n}\n\npublic bool OpenStatus\n{\n get\n {\n bool flag = false;\n if (this.qMgr != null && this.qMgr.IsConnected)\n flag = !this.isClosed;\n return flag;\n }\n}Although I tend toward usingOpenStatusI'm still looking for educated advice. I'm especially unsure what theIsOpenproperty actually represents. Is it relevant when telling whether the queue instance is open for put and get calls?### Assistant: I dont think there's any better documentation, but in effect:IsOpen tells you if the open call itself has been successful, ie there is an associated handle being maintained for the queue.OpenStatus tells you whether there is a valid connection to the queue manager AND the object is also open.From that, I'd probably veer towards OpenStatus as you suggest, if you want to know if there is a best chance of using the object. I would also echo Morag and Roger's comments, that better exception handling and understanding of state should be a far better approach.\n"} +{"text": "### Human: The last time I used MQ in anger (v6, from memory, on the HPUX platform), there was a limitation in that connections could not be shared amongst threads within a process.If you tried to do anotherMQCONNfrom a thread that wasalreadyconnected to the queue manager, it very quickly came back with the previous handle and a warning saying it was re-using it so, provided you managed the shared connections properly, a single thread could make many connections to the same queue manager efficiently.However, if you tried to connect from adifferentthread in the process, that gave you a different connection handle, with all the slowness that entailed, as it had to go through all the rigmarole of IPC, security checking, running up another agent thread or process, and so on.The reason I ask this is that a client has been shown an architecture where threads are created on demand (C# under Windows) and they will all try to connect to the same queue manager. They're proposing to run MQ 7.5, if that's relevant.The threads will all connect usingXMSFactoryFactorywhich supposedly provides MQ connection pooling for efficiency but, if there's still a connection-per-thread requirement and the threadsthemselvesaren't being pooled, I'm concerned that MQ connection pooling may be useless due to the fact each new thread needs a new connection anyway.### Assistant: Now connection can be shared across threads. Read through thislinkfor more information.XMS .NET is a JMS specification implementation in C# language for communication with IBM MQ queue manager.XMSFactoryFactorydoes not provide connection pooling.You should also note that as per JMS v1.1 specifications a JMS Session object and it's children (producer, consumer etc..) should not be shared across threads.\n"} +{"text": "### Human: I am trying to put a raw MQSTR message on a WebSphere MQ queue. According tothis, I can do:((com.ibm.mq.jms.MQQueue) queue).setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ);to indicate that it is a non-JMS queue. (I'm awareJMSC.MQJMS_CLIENT_NONJMS_MQis deprecated -- that's not relevant to this question.) However, I had been usingcom.ibm.mq.MQQueueinstead ofcom.ibm.mq.jms.MQQueue. Casting from the former to the latter doesn't work. Additionally, onlycom.ibm.mq.jms.MQQueuehas thesetTargetClientmethod.Why are there twoMQQueueclasses and which one should I be using? I want to connect to a z/OS queue externally in a Java program using hostname, channel name, and queue manager name (not JNDI).### Assistant: Humm. I don't want to give the \"RTM\" answer but that is really the answer. There are 2 JAVA MQ APIs: 1 for \"MQ classes for Java\" and 1 for \"MQ classes for JMS\".Note: \"MQ classes for JMS\" will put the JMS header (aka MQRFH2) on the message where as \"MQ classes for Java\" does NOT.Therefore, if you are writing a regular Java/MQ application then do NOT use the \"MQ classes for JMS\" just use the \"MQ classes for Java\" and you will be good to go.\n"} +{"text": "### Human: I\u00b4m working on a clustered tomcat system that uses MQSeries.\nToday MQSeries is accessed in bindings mode, i.e. via IPC and tomcat and mqeries run on the same host without any virtualization/docker support.I\u00b4d like to transform that to a solution, where mqseries runs on the host (or possible in a docker container) the the tomcat instances run in docker containers.It\u00b4s possible to access mqseries in client mode (via a tcp connection) and this seems to be the right solution.Would it still be possible to access mqseries from the docker container via ipc, i.e. create exceptions for the ipc namespace separation? Is anything like that planned for docker?### Assistant: Sincedocker 1.5this is possible with the flag--ipc=hostlike indocker run --ipc=host ubuntu bash\n"} +{"text": "### Human: Well, the title is quite self expleneationry.. I'm tryin to improve mq client connection time since it takes to much time in my app.\n(look here for code)### Assistant: MQ previously had the UDP protocol available on AIX only. It was removed a few releases ago. TCP/IP is the transport of choice now. If you are having long connection times, you should get your network guys involved.\n"} +{"text": "### Human: I am new to com.ibm.mq API (1.6 version). I have been given a task where currently, I have standalone java application on Mac OS which downloads the messages from the server. Right now, the message limit has been set to default which is 4 KB. This need to be increased up to 5 MB. I have read on the forums that we can increase the MQ Queue size up to 100 MB. Can you please suggest me steps or refer to the link where I can get the details for fulfilling my requirements.### Assistant: You need to increase the max message length (MAXMSGL) three places: on the QMgr object, the local queue where your application will ultimately put messages and on the channel object. More information is available at the WMQ Knowledge Center. Here is a link to the properties for the QMgr (queue manager) object:http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.explorer.doc/e_properties_qmanager.htm?lang=en\n"} +{"text": "### Human: I'm writing a java app with a Listener to read messages from WebSphere MQ.Here's my applicationContext.xml:\n \n\n\n\n \n \n \n \n\n\n\n \n \n \n \n \n\n\n\n \n \n \n\n\n \n \n \n \n \n \n \n \n \n \nThis is what causing problems:If I remove this property everything work fine. Messages from my queue are read. But if I put this property I got the following error:17:54:20,468 WARN DefaultMessageListenerContainer:821 - Setup of JMS message listener invoker failed for destination 'asurtst1qu' - trying to recover. Cause: Could not create JMS transaction; nested exception is com.ibm.msg.client.jms.DetailedJMSSecurityException: JMSWMQ2013: The security authentication was not valid that was supplied for QueueManager 'asurtst1mgr' with connection mode 'Client' and host name '172.31.197.247(1414)'. Please check if the supplied username and password are correct on the QueueManager you are connecting.I need transaction manager to put message back to the queue if there's any errors. But i can't use it due this exception. Help me pls.### Assistant: Your transactionManager bean should ref jmsConnectionFactory not mqQueueConnectionFactory.\n"} +{"text": "### Human: I am trying to Browse a message on a queue. For some reason the message is purged/removed (destructive read) instead of being browsed.This are my OpenOptions:int openOptions2 = CMQC.MQOO_INPUT_AS_Q_DEF\n | CMQC.MQOO_FAIL_IF_QUIESCING\n | CMQC.MQOO_INQUIRE\n | CMQC.MQOO_BROWSE;And this is my GetOptions:qMQGetMessageOptions.options = CMQC.MQGMO_NO_WAIT | CMQC.MQGMO_BROWSE_FIRST;What am I doing wrong?### Assistant: Try:int openOptions2 = CMQC.MQOO_FAIL_IF_QUIESCING | CMQC.MQOO_INQUIRE | CMQC.MQOO_BROWSE;And:MQMessage getMsg;\nqMQGetMessageOptions.options = CMQC.MQGMO_NO_WAIT | CMQC.MQGMO_BROWSE_FIRST;\n\nwhile (true)\n{\n getMsg = new MQMessage();\n inQ.get(getMsg, qMQGetMessageOptions);\n qMQGetMessageOptions.options = CMQC.MQGMO_NO_WAIT | CMQC.MQGMO_BROWSE_NEXT;\n}\n"} +{"text": "### Human: I'm writing an application that uses WebSphere MQ for messaging. For my unittests (flowtests), I want to verify that I have put the right messages on the response queue.\nI'm trying to figure out how to do this. My main obstacle is that I think it might be scary to clear a queue before I run my unittest, because the same queue might be used by another application. \nI thought a decent workaround would be to create a new queue manager and queue for my unittest and delete it after using it.So my question is: Is it possible to create a queue manager and queue using C#?### Assistant: For future reference and future people who want to create queues. I figured out how to create and delete IBM MQ queues (not queuemanagers) with PCF messaging. It is not very straightforward, but it can be done.We have implemented it in a library and are using it to create and delete queues before and after integration tests respectivally. The most important part of code in this library is shown in the code sample below. Just add a reference to amqmdnet.dll and below code will create a queue and delete it.string queueManagerName = \"QM_LOCAL\";\nstring queueName = \"DeleteMeQueue\";\n\nHashtable options = new Hashtable();\n\n// This is a connection to a local server. For a remote server use 'TRANSPORT_MQSERIES_CLIENT', 'TRANSPORT_MQSERIES_XACLIENT' or 'TRANSPORT_MQSERIES_MANAGED'\noptions.Add(IBM.WMQ.MQC.TRANSPORT_PROPERTY, \"TRANSPORT_MQSERIES_BINDINGS\");\n\n// For 'TRANSPORT_MQSERIES_CLIENT', 'TRANSPORT_MQSERIES_XACLIENT' or 'TRANSPORT_MQSERIES_MANAGED' uncomment the below\n// string hostName = \"RemoteServerName\";\n// string channelName = \"SYSTEM.ADMIN.SVRCONN\";\n// int portNumber = 1414;\n// options.Add(IBM.WMQ.MQC.HOST_NAME_PROPERTY, hostName);\n// options.Add(IBM.WMQ.MQC.CHANNEL_PROPERTY, channelName);\n// options.Add(IBM.WMQ.MQC.PORT_PROPERTY, portNumber);\n// options.Add(IBM.WMQ.MQC.CONNECT_OPTIONS_PROPERTY, IBM.WMQ.MQC.MQC.MQCNO_STANDARD_BINDING);\nIBM.WMQ.MQQueueManager queueManager = null;\nIBM.WMQ.PCF.PCFMessageAgent agent = null;\ntry\n{\n // Initialize a connection to the (remote) queuemanager and a PCF message agent.\n queueManager = new IBM.WMQ.MQQueueManager(queueManagerName, options);\n agent = new IBM.WMQ.PCF.PCFMessageAgent(queueManager);\n\n // Create queue\n IBM.WMQ.PCF.PCFMessage createRequest = new IBM.WMQ.PCF.PCFMessage(IBM.WMQ.PCF.CMQCFC.MQCMD_CREATE_Q);\n createRequest.AddParameter(IBM.WMQ.MQC.MQCA_Q_NAME, queueName);\n createRequest.AddParameter(IBM.WMQ.MQC.MQIA_Q_TYPE, IBM.WMQ.MQC.MQQT_LOCAL);\n createRequest.AddParameter(IBM.WMQ.MQC.MQIA_DEF_PERSISTENCE, IBM.WMQ.MQC.MQPER_PERSISTENT);\n createRequest.AddParameter(IBM.WMQ.MQC.MQCA_Q_DESC, \"Created by \" + Environment.UserName + \" on \" + DateTime.UtcNow.ToString(\"o\"));\n IBM.WMQ.PCF.PCFMessage[] createResponses = agent.Send(createRequest);\n\n // Delete queue\n IBM.WMQ.PCF.PCFMessage deleteRequest = new IBM.WMQ.PCF.PCFMessage(IBM.WMQ.PCF.CMQCFC.MQCMD_DELETE_Q);\n deleteRequest.AddParameter(IBM.WMQ.MQC.MQCA_Q_NAME, queueName);\n IBM.WMQ.PCF.PCFMessage[] deleteResponses = agent.Send(deleteRequest);\n}\nfinally\n{\n // Disconnect the agent and queuemanager.\n if (agent != null) agent.Disconnect();\n if (queueManager != null && queueManager.IsConnected) queueManager.Disconnect();\n}\n"} +{"text": "### Human: I have been using the developer version of websphere mq to do some research for my organization.\nIt does not seem to have any licence cost or trial period.I wanted to know what are the limitations of the developer version which would make it not suitable to be used in a production environment.### Assistant: There is no support available for developer edition as described here:http://www-03.ibm.com/software/products/en/ibm-mq-advanced-for-developers. On production system you have to use licensed version.\n"} +{"text": "### Human: I have two Applications A & B. Application A puts message in QMA which is a Linux queue manager with default CCSID 1208. The QMA sends message to QMB which is a Windows queue manager with default CCSID 437. Application B consumes messages from QMB. Everything is fine. \nThen I migrated the Windows queue manager QMB to a Linux platform and changed the CCSID as default 1208. The App B started getting issues related to data. Then I altered the QMB in Linux platform use CCSID as 437 and the App B did not see any issues with data after that.I am an MQ admin and do not have much understanding of how CCSID defined in a MQ server really matter for a client application when there are no Data Conversion attributes enabled in the MQ server.My understanding was the queue manager CCSID should be the default based on the platform used and never required to be altered.Help me to understand better?### Assistant: You are correct that the CCSID defined on the MQ Server shouldn't really matter for an application (whether client or otherwise). This is because what an applicationshoulddo is request its messages on the MQGET using MQGMO_CONVERT.It sounds rather like the applications in your setup were relying upon the codepage of the message being correct and what they needed from the putter, and that they weren't using MQGMO_CONVERT.MQGMO_CONVERT should always be used for applications even if - initially - it is not needed because the putter and getter use the same codepage. This is because, eventually that application will spread, or move, and then when you do need it you have to go back and change the application. There is no down-side to using MQGMO_CONVERT when it is not needed, it is just a no-op. But there is a downside to not using it when you do need it.\n"} +{"text": "### Human: I recently upgraded to spring 4.1 from 3.1 and thejms:listener-containerdoesn't seem to wait for a timeout before retrying to setup listeners, as it used to in 3.1. I've triedrecovery-interval=\"10000\"and it's still trying around 3 times a second.Here's the section of my spring config:\n \n \nMy logs on 4.1 look like that (see times):11/09 11:56:33 WARN [org.springframework.jms.listener.DefaultMessageListenerContainer] Setup of JMS message listener invoker failed f or destination 'MYQUEUE.NAME' - trying to recover. Cause: MQJMS2008: failed to open MQ queue ''.; nested exception is com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2085'.\n11/09 11:56:33 WARN [org.springframework.jms.listener.DefaultMessageListenerContainer] Setup of JMS message listener invoker failed for destination 'MYQUEUE.NAME' - trying to recover. Cause: MQJMS2008: failed to open MQ queue ''.; nested exception is com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2085'.\n11/09 11:56:34 WARN [org.springframework.jms.listener.DefaultMessageListenerContainer] Setup of JMS message listener invoker failed f (...)And 3.1 looks like this (see 5 second delay):11/09 12:14:32 WARN [org.springframework.jms.listener.DefaultMessageListenerContainer] Setup of JMS message listener invoker failed for destination 'MYQUEUE.NAME' - trying to recover. Cause: MQJMS2008: failed to open MQ queue ''.; nested exception is com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2085'.\n11/09 12:14:37 WARN [org.springframework.jms.listener.DefaultMessageListenerContainer] Setup of JMS message listener invoker failed for destination 'MYQUEUE.NAME' - trying to recover. Cause: MQJMS2008: failed to open MQ queue ''.; nested exception is com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2085'.\n11/09 12:14:43 WARN [org.springframework.jms.listener.DefaultMessageListenerContainer] Setup of JMS message listener invoker failed for destination 'MYQUEUE.NAME' - trying to recover. Cause: MQJMS2008: failed to open MQ queue ''.; nested exception is com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2085'.When the queues are back up, it's all OK. Are these timeout settings available for configuration?Regards### Assistant: This definitely looks like a regression to me and something I just happened to find out yesterday as well. I have createdthis issueto track that problem.\n"} +{"text": "### Human: I am getting the below error.... Kindly help[8/5/14 21:06:54:277 GMT-08:00] 00000091 DiscoveryTx W DCSV1115W: DCS Stack DefaultCoreGroup at Member PT_STS_HK_CELL\\PT_STS_HK_APP_Node02\\PT_STS_QLCOMM_CL02: Member PT_STS_HK_CELL\\PT_STS_HK_APP_Node02\\nodeagent connection was closed. Member will be removed from view. DCS connection status is Discovery|Ptp, transmitter closed.\n[8/5/14 21:07:23:562 GMT-08:00] 00000010 MbuRmmAdapter W DCSV1115W: DCS Stack DefaultCoreGroup at Member PT_STS_HK_CELL\\PT_STS_HK_APP_Node02\\PT_STS_QLCOMM_CL02: Member PT_STS_HK_CELL\\PT_STS_HK_APP_Node02\\PT_STS_PYMTCAPTURE_CL02 connection was closed. Member will be removed from view. DCS connection status is View|Gossip, this member is suspected by the other member.\n[8/5/14 21:08:00:079 GMT-08:00] 00000091 DiscoveryTx W DCSV1115W: DCS Stack DefaultCoreGroup at Member PT_STS_HK_CELL\\PT_STS_HK_APP_Node02\\PT_STS_QLCOMM_CL02: Member PT_STS_HK_CELL\\PT_STS_HK_APP_Node02\\PT_STS_DOWNSTREAM_CL02 connection was closed. Member will be removed from view. DCS connection status is Discovery|Ptp, transmitter closed.\n[8/5/14 21:08:16:296 GMT-08:00] 00000010 RmmPtpGroup W DCSV1112W: DCS Stack DefaultCoreGroup at Member PT_STS_HK_CELL\\PT_STS_HK_APP_Node02\\PT_STS_QLCOMM_CL02: Member PT_STS_HK_CELL\\PT_STS_HK_APP_Node02\\PT_STS_DOWNSTREAM_CL02 failed to respond to periodic heartbeats. Member will be removed from view. Configured Timeout is 180000 milliseconds. DCS logical channel is View|Ptp.\n[8/5/14 21:08:29:236 GMT-08:00] 00000091 DiscoveryTx W DCSV1115W: DCS Stack DefaultCoreGroup at Member PT_STS_HK_CELL\\PT_STS_HK_APP_Node02\\PT_STS_QLCOMM_CL02: Member PT_STS_HK_CELL\\PT_STS_HK_DMGR_Node\\dmgr connection was closed. Member will be removed from view. DCS connection status is Discovery|Ptp, transmitter closed.\n[8/5/14 21:10:20:892 GMT-08:00] 00000018 ApplicationMo W DCSV0004W: DCS Stack DefaultCoreGroup at Member PT_STS_HK_CELL\\PT_STS_HK_APP_Node02\\PT_STS_QLCOMM_CL02: Did not receive adequate CPU time slice. Last known CPU usage time at 21:03:08:272 GMT-08:00. Inactivity duration was 402 seconds. \n[8/5/14 21:11:14:131 GMT-08:00] 00000043 ThreadMonitor W WSVR0605W: Thread \"WMQJCAResourceAdapter : 5\" (00000067) has been active for 657039 milliseconds and may be hung. There is/are 2 thread(s) in total in the server that may be hung.\n at com.ibm.ejs.ras.TraceLogger.doLog(TraceLogger.java:332)\n at com.ibm.ejs.ras.TraceLogger.processEvent(TraceLogger.java:319)\n at com.ibm.ws.logging.WsHandlerWrapper.publish(WsHandlerWrapper.java:43)\n at java.util.logging.Logger.log(Logger.java:1121)\n at com.ibm.ejs.ras.Tr.logToJSR47Logger(Tr.java:1681)\n at com.ibm.ejs.ras.Tr.fireEvent(Tr.java:1643)\n at com.ibm.ejs.ras.Tr.fireTraceEvent(Tr.java:1565)\n at com.ibm.ejs.ras.Tr.entry(Tr.java:816)\n at com.ibm.ws.sib.utils.ras.SibTr.entry(SibTr.java:912)\n at com.ibm.ws.wmqcsi.trace.TraceImpl.methodExit(TraceImpl.java:349)\n at com.ibm.msg.client.commonservices.trace.Trace.methodExitInternal(Trace.java:715)\n at com.ibm.msg.client.commonservices.trace.Trace.exit(Trace.java:628)\n at com.ibm.msg.client.wmq.v6.jms.internal.JMSMessage._setJMSXObjectProperty(JMSMessage.java:3928)\n at com.ibm.msg.client.wmq.v6.jms.internal.MQJMSMessage.write(MQJMSMessage.java:1223)\n at com.ibm.msg.client.wmq.v6.jms.internal.MQMessageProducer.sendInternal(MQMessageProducer.java:1139)\n at com.ibm.msg.client.wmq.v6.jms.internal.MQMessageProducer.send(MQMessageProducer.java:768)\n at com.ibm.msg.client.wmq.v6.jms.internal.MQMessageProducer.send(MQMessageProducer.java:2713)\n at com.ibm.msg.client.jms.internal.JmsMessageProducerImpl.sendMessage(JmsMessageProducerImpl.java:872)\n at com.ibm.msg.client.jms.internal.JmsMessageProducerImpl.send_(JmsMessageProducerImpl.java:727)\n at com.ibm.msg.client.jms.internal.JmsMessageProducerImpl.send(JmsMessageProducerImpl.java:398)\n at com.ibm.mq.jms.MQMessageProducer.send(MQMessageProducer.java:281)\n at com.ibm.ejs.jms.JMSQueueSenderHandle.send(JMSQueueSenderHandle.java:204)### Assistant: you are receiving CPU Starvation errors. This could be because you are thrashing the garbage collector, your heap is not big enough or something else is taking up the CPU time. You need to find the process or processes that are taking up the CPU and examine why they are running high.Regards,\nBrian\n"} +{"text": "### Human: I am building an application which reveives message from a Message Queue , Process it and and send the generated response to another queue. I have successfully built the same.But, before sending the msg I must get the Correlation ID, Message ID and Message Type from it, So that I will be able to set these in my generated response msg as well.I have fetched CorrelationID and Message ID using the below code.Message Requestmessage = ReceiveMessage(queueName);\n String correlationID = Requestmessage.getJMSCorrelationID();\n String messageID = Requestmessage.getJMSMessageID();How will I get the Message Type. There are 5 types of Messages as far as I understood.\n 1. Text Message\n 2. Byte Message\n 3. Stream Message\n 4. Object Message\n 5. Map Message\nAll I need is, to find out which type my \"Requestmessage\" belongs to.Thanks in Advance.### Assistant: Found the answer. I used instanceof keyword.if(Requestmessage instanceof TextMessage )\n {\n //\n }\n\n if(Requestmessage instanceof BytesMessage)\n {\n //\n }\n if(Requestmessage instanceof ObjectMessage)\n {\n // \n }\n if(Requestmessage instanceof StreamMessage)\n {\n //\n }\n"} +{"text": "### Human: I'm using following ESQL code to put the non-xml message (arriving at input queue) into an audit database (Oracle 10g) as BLOB Object.\nThe code is working when I'm using it in IBM WebSphere Message Broker 6.0. But recently I migrated to IBM WebSphere Message Broker 7.0 and now the non-xml message goes to Backout queue instead of being audited into database. \nThe ESQL code for the subflow (that writes the non xml messages into db) I'm using is:CREATE COMPUTE MODULE \"WriteNonXMLToAudit_1_0_WriteNonXMLToAudit\"\nCREATE FUNCTION main() RETURNS BOOLEAN BEGIN\n SET OutputRoot = InputRoot;\n\n DECLARE ver CHAR;\n DECLARE codeName CHAR;\n\n SET ver = '1_0_2';\n SET codeName = 'WriteNonXMLToAudit.' || 'Version:' || ver;\n\n DECLARE aonMSG REFERENCE To \"OutputRoot\".\"BLOB\";\n DECLARE appError REFERENCE To InputExceptionList;\n\n DECLARE msid INTEGER;\n DECLARE messageType CHAR;\n\n DECLARE sourceApplication CHAR;\n\n DECLARE mqHdrBlob BLOB;\n DECLARE mqHdrChar CHAR;\n\n DECLARE msgBlob BLOB;\n DECLARE msgChar CHAR;\n DECLARE msgUUID CHAR;\n\n SET OutputRoot.MQMD.Format = 'MQSTR ';\n SET OutputRoot.MQMD.CodedCharSetId = 819;\n SET OutputRoot.MQMD.Encoding = 273;\n SET OutputRoot.\"MQRFH2\" = NULL;\n\n MOVE aonMSG TO \"OutputRoot\".\"BLOB\";\n\n SET msgChar = aonMSG;\n\n SET messageType = 'NON_STANDARD_MESSAGE';\n SET msid = 9998;\n\n SET msgUUID = UUIDASCHAR;\n SET sourceApplication = RTRIM(OutputRoot.MQMD.PutApplName);\n\n SET msgChar = CAST(OutputRoot.\"BLOB\".\"BLOB\" As CHAR CCSID 819 ENCODING OutputRoot.MQMD.Encoding );\n\n Insert Into Database.Message_Audit (UUID, MSID, Message_Type, Source_Application, Message_Body)\n Values ( SUBSTRING(msgUUID FROM 1 FOR 35),\n msid,\n SUBSTRING(messageType FROM 1 FOR 29),\n SUBSTRING(sourceApplication FROM (LENGTH(sourceApplication) - 9) FOR 10),\n msgChar);\n\n IF SQLCODE <> 0 THEN\n RETURN FALSE;\n END IF;\n\n RETURN TRUE;\n\nEND;\n\nEND MODULE;The Main flow is as follows:CREATE COMPUTE MODULE \"ACIF_AUDIT_1_5_Insert exception into msg\"\nCREATE FUNCTION main() RETURNS BOOLEAN BEGIN\nSET OutputRoot = InputRoot;\n\n\nCREATE FIRSTCHILD OF OutputRoot.XML.MSG.APP_DATA Name 'APP_ERROR';\nCREATE LASTCHILD OF OutputRoot.XML.MSG.APP_DATA.APP_ERROR Name 'ERROR_SOURCE' VALUE \n\n'ACIFBROKER';\nCREATE LASTCHILD OF OutputRoot.XML.MSG.APP_DATA.APP_ERROR Name 'ERROR_OPERATION' VALUE 'ACIF_AUDIT_Exception';\nCREATE LASTCHILD OF OutputRoot.XML.MSG.APP_DATA.APP_ERROR Name 'ERROR_CODE' VALUE '';\nCREATE LASTCHILD OF OutputRoot.XML.MSG.APP_DATA.APP_ERROR Name 'ERROR_STRING';\nSet OutputRoot.XML.MSG.APP_DATA.APP_ERROR.ERROR_STRING = InputExceptionList;\nCREATE LASTCHILD OF OutputRoot.XML.MSG.APP_DATA.APP_ERROR Name 'ERROR_DETAIL' VALUE 'Exception List';\n\nSET OutputRoot.\"MQRFH2\" = NULL;\nSET OutputRoot.MQMD.CodedCharSetId = MQCCSI_INHERIT; /*819*/\nSET OutputRoot.MQMD.Encoding = MQENC_NATIVE; /*273*/\nSet OutputRoot.MQMD.Format = 'MQSTR';\n\n\nRETURN true;\nEND;\n\nEND MODULE;\nCREATE COMPUTE MODULE \"ACIF_AUDIT_1_5_Insert audit record\"\nCREATE FUNCTION main() RETURNS BOOLEAN BEGIN\nSET OutputRoot = InputRoot;\n\n\nDeclare refAONDataRoot REFERENCE To InputBody.MSG;\nDeclare refSOAPDataRoot REFERENCE TO InputBody.\"SOAP-ENV:Envelope\";\nDeclare MSGChar CHAR;\nDeclare MSGBlob BLOB;\nDECLARE intSQLCode INTEGER;\nDECLARE chrSQLErrorText CHAR;\n\n/* Added by Shailen **/\nDECLARE uuid CHAR;\nDECLARE msid INT;\nDECLARE mType CHAR;\nDECLARE srcApp CHAR;\nDeclare msgRef REFERENCE TO InputBody;\n\nIf FIELDNAME(refAONDataRoot.AONHEADER) = 'AONHEADER' Then\n\n Set MSGBlob = BITSTREAM(refAONDataRoot);\n Set MSGChar = CAST(MSGBlob As CHAR CCSID InputRoot.MQMD.CodedCharSetId);\n Set msid = refAONDataRoot.AONHEADER.MSID;\n\n IF refAONDataRoot.APP_DATA.APP_HEADER.UUID IS NOT NULL THEN\n SET uuid = refAONDataRoot.APP_DATA.APP_HEADER.UUID;\n ELSE\n /* Let check for MESSAGE_ID - BRIDGE Messages */\n IF FIELDNAME(refAONDataRoot.APP_DATA.AON_APPLICATION_MESSAGE.HEADER.MESSAGE_ID ) IS NOT NULL THEN\n SET uuid = refAONDataRoot.APP_DATA.AON_APPLICATION_MESSAGE.HEADER.MESSAGE_ID;\n SET msid = 9999;\n END IF;\n END IF;\n\nIF FIELDNAME(refAONDataRoot.APP_DATA.APP_HEADER.MESSAGE_TYPE) IS NOT NULL THEN\n SET mType = refAONDataRoot.APP_DATA.APP_HEADER.MESSAGE_TYPE;\nELSE\n /* Let check another location - historical message type location */\n IF \n\nFIELDNAME(refAONDataRoot.APP_DATA.AON_APPLICATION_MESSAGE.HEADER.MESSAGE_TYPE ) IS NOT NULL THEN\n SET mType = refAONDataRoot.APP_DATA.AON_APPLICATION_MESSAGE.HEADER.MESSAGE_TYPE;\n END IF;\n END IF;\n\n Insert Into Database.MESSAGE_AUDIT (UUID,MSID,MESSAGE_TYPE,SOURCE_APPLICATION,MQ_HEADER,MESSAGE_BODY) \n Values (uuid,msid,mType,refAONDataRoot.AONHEADER.APPLICATION_NAME,'',MSGChar);\n\n/* 08-11-2004:The following assumes that the flow will throw an error on an database error.\n * As part of this change the flow is being changed to do this, otherwise the message is just thrown away.\n\nRETURN FALSE; \n */\nElseIf FIELDNAME(refSOAPDataRoot.\"SOAP-ENV:Header\") = 'SOAP-ENV:Header' Then\n\n Set MSGBlob = BITSTREAM(refSOAPDataRoot);\n Set MSGChar = CAST(MSGBlob As CHAR CCSID InputRoot.MQMD.CodedCharSetId);\n\n Insert Into Database.MQUSER.MESSAGE_AUDIT (UUID,MSID,MESSAGE_TYPE,SOURCE_APPLICATION,MQ_HEADER,MESSAGE_BODY) \n Values (refSOAPDataRoot.\"SOAP-ENV:Header\".MessageHeader.uuid,'',refSOAPDataRoot.\"SOAP-ENV:Header\".MessageHeader.messageType,'','',MSGChar);\n /* 08-11-2004:The following assumes that the flow will throw an error on an database error.\n * As part of this change the flow is being changed to do this, otherwise the message is just thrown away.\nRETURN FALSE;\n */ \nElseIf FIELDNAME(InputBody.AON_APPLICATION_MESSAGE) IS NOT NULL Then\n /* This is to audit the message from AME to bridge.\n * The MESSAGE ID is effectively the UUID for this message.\n */\n MOVE msgRef TO InputBody.AON_APPLICATION_MESSAGE;\n Set MSGBlob = BITSTREAM(msgRef);\n Set MSGChar = CAST(MSGBlob As CHAR CCSID InputRoot.MQMD.CodedCharSetId);\n\n Set msid = '9999';\n Set mType = 'Unset';\n Set srcApp = 'Unset';\n\n IF FIELDNAME(msgRef.HEADER.MESSAGE_ID) IS NOT NULL THEN\n SET uuid = msgRef.HEADER.MESSAGE_ID;\n END IF;\n\n IF FIELDNAME(msgRef.HEADER.MSID) IS NOT NULL THEN\n SET msid = CAST(msgRef.HEADER.MSID AS INT);\n END IF;\n\n IF FIELDNAME(msgRef.HEADER.MESSAGE_TYPE) IS NOT NULL THEN\n SET mType = msgRef.HEADER.MESSAGE_TYPE;\n END IF;\n\n IF FIELDNAME(msgRef.HEADER.SENDER) IS NOT NULL THEN\n SET srcApp = msgRef.HEADER.SENDER;\n END IF;\n\n Insert Into Database.MESSAGE_AUDIT (UUID,MSID,MESSAGE_TYPE,SOURCE_APPLICATION,MQ_HEADER,MESSAGE_BODY) \n Values (uuid,msid,mType,srcApp,'',MSGChar);\n\n /* 08-11-2004:The following assumes that the flow will throw an error on an database error.\n * As part of this change the flow is being changed to do this, otherwise the message is just thrown away.\n RETURN FALSE; \n */ \nElseIf FIELDNAME(InputBody.msg.header.application_name) IS NOT NULL Then\n /* Then assume this is an ATLAS message.\n * The MESSAGE ID is effectively the UUID for this message.\n */\n MOVE msgRef TO InputBody.msg;\n Set MSGBlob = BITSTREAM(msgRef);\n Set MSGChar = CAST(MSGBlob As CHAR CCSID InputRoot.MQMD.CodedCharSetId);\n\n Set srcApp = msgRef.header.application_name;\n\n IF FIELDNAME(msgRef.header.msid) IS NOT NULL Then\n Set msid = msgRef.header.msid;\n ELSE\n Set msid = '9997';\n END IF;\n\n Set mType = 'Unset:ATLAS_MESSAGE';\n Set uuid = UUIDASCHAR;\n\n Insert Into Database.MESSAGE_AUDIT (UUID,MSID,MESSAGE_TYPE,SOURCE_APPLICATION,MQ_HEADER,MESSAGE_BODY) \n Values (uuid,msid,mType,srcApp,'',MSGChar);\n\n /* 08-11-2004:The following assumes that the flow will throw an error on an database error.\n * As part of this change the flow is being changed to do this, otherwise the message is just thrown away.\n RETURN FALSE; \n */ \nElse\n /* We have an XML message, but we do not know what it is. Lets treat is a a NONXML Message.\n */\n RETURN TRUE;\nEnd If;\n\n/* \n * Return FALSE - this means that everything was okay in this case. We have wired up the TRUE terminal to handle the case when we have \n * an XML message, but one that is not recognised. NB Non XML messages will cause an error because the MQINPUT node is expecting an XML \n * message.\n */\nRETURN FALSE;\n\nEND;\n\nEND MODULE;Broker logs:Mar 25 14:50:31 ukvmgstg008 WebSphere Broker v7005[15201]: (UKS06.ACIF_001)[35]BIP2232E: Error detected whilst handling a previous error in node 'ACIF_AUDIT_1_5.ACIF_ERROR_01'. : UKS06.7aaf0524-3801-0000-0080-9e3a13c0b2a4: /build/S700_P/src/DataFlowEngine/ImbDataFlowNode.cpp: 893: ImbDataFlowNode::logExceptionList: ComIbmMQOutputNode: ACIF_AUDIT_1_5#FCMComposite_1_2\nMar 25 14:50:31 ukvmgstg008 WebSphere Broker v7005[15201]: (UKS06.ACIF_001)[35]BIP2230E: Error detected whilst processing a message in node 'ACIF_AUDIT_1_5.Insert audit record'. : UKS06.7aaf0524-3801-0000-0080-9e3a13c0b2a4: /build/S700_P/src/DataFlowEngine/ImbComputeNode.cpp: 489: ImbComputeNode::evaluate: ComIbmComputeNode: ACIF_AUDIT_1_5#FCMComposite_1_4\nMar 25 14:50:31 ukvmgstg008 WebSphere Broker v7005[15201]: (UKS06.ACIF_001)[35]BIP2488E: (.ACIF_AUDIT_1_5_Insert audit record.main, 16.1) Error detected whilst executing the SQL statement 'DECLARE refAONDataRoot REFERENCE TO InputBody.MSG;'. : UKS06.7aaf0524-3801-0000-0080-9e3a13c0b2a4: /build/S700_P/src/DataFlowEngine/ImbRdl/ImbRdlStatementGroup.cpp: 643: SqlStatementGroup::execute: ComIbmComputeNode: ACIF_AUDIT_1_5#FCMComposite_1_4\nMar 25 14:50:31 ukvmgstg008 WebSphere Broker v7005[15201]: (UKS06.ACIF_001)[35]BIP2498E: (.ACIF_AUDIT_1_5_Insert audit record.main, 16.39) : An error occurred when navigating to path element '2' of the field reference at the given location. : UKS06.7aaf0524-3801-0000-0080-9e3a13c0b2a4: /build/S700_P/src/DataFlowEngine/ImbRdl/ImbRdlFieldRef.cpp: 1916: SqlFieldReference::navigateAbsoluteToFirst: ComIbmComputeNode: ACIF_AUDIT_1_5#FCMComposite_1_4\nMar 25 14:50:31 ukvmgstg008 WebSphere Broker v7005[15201]: (UKS06.ACIF_001)[35]BIP5009E: XML Parsing Errors have occurred. : UKS06.7aaf0524-3801-0000-0080-9e3a13c0b2a4: /build/S700_P/src/MTI/MTIforBroker/GenXmlParser2/XmlImbParser.cpp: 720: XmlImbParser::parseRightSibling: : \nMar 25 14:50:31 ukvmgstg008 WebSphere Broker v7005[15201]: (UKS06.ACIF_001)[35]BIP5004E: An XML parsing error 'Invalid character (Unicode: 0x2) ' occurred on line 1 column 441 when parsing element 'app_data'. Internal error codes are '196' and ''. : UKS06.7aaf0524-3801-0000-0080-9e3a13c0b2a4: /build/S700_P/src/MTI/MTIforBroker/GenXmlParser2/XmlBrokerAsgardParser.cpp: 730: XmlBrokerAsgardParser::error: : \nMar 25 14:50:31 ukvmgstg008 WebSphere Broker v7005[15201]: (UKS06.ACIF_001)[35]BIP2628E: Exception condition detected on input node 'ACIF_AUDIT_1_5.ACIF_AUDIT_01'. : UKS06.7aaf0524-3801-0000-0080-9e3a13c0b2a4: /build/S700_P/src/DataFlowEngine/ImbCommonInputNode.cpp: 1912: ImbCommonInputNode::run: ComIbmMQInputNode: ACIF_AUDIT_1_5#FCMComposite_1_5\nMar 25 14:50:31 ukvmgstg008 WebSphere Broker v7005[15201]: (UKS06.ACIF_001)[35]BIP2230E: Error detected whilst processing a message in node 'ACIF_AUDIT_1_5.ACIF_ERROR_01'. : UKS06.7aaf0524-3801-0000-0080-9e3a13c0b2a4: /build/S700_P/src/DataFlowEngine/ImbMqOutputNode.cpp: 864: ImbMqOutputNode::evaluate: ComIbmMQOutputNode: ACIF_AUDIT_1_5#FCMComposite_1_2\nMar 25 14:50:31 ukvmgstg008 WebSphere Broker v7005[15201]: (UKS06.ACIF_001)[35]BIP5010E: XML Writing Errors have occurred. : UKS06.7aaf0524-3801-0000-0080-9e3a13c0b2a4: /build/S700_P/src/MTI/MTIforBroker/GenXmlParser2/XmlImbParser.cpp: 443: XmlImbParser::refreshBitStreamFromElementsInner: ComIbmMQInputNode: ACIF_AUDIT_1_5#FCMComposite_1_5\nMar 25 14:50:31 ukvmgstg008 WebSphere Broker v7005[15201]: (UKS06.ACIF_001)[35]BIP5005E: There are 2 top level elements 'msg,MSG' in the document. : UKS06.7aaf0524-3801-0000-0080-9e3a13c0b2a4: /build/S700_P/src/MTI/MTIforBroker/GenXmlParser2/XmlImbParser.cpp: 954: XmlImbParser::checkForBodyElement: : \nMar 25 14:50:31 ukvmgstg008 WebSphere Broker v7005[15195]: (UKS06.CONCERT_001)[7]BIP2648E: Message backed out to a queue; node 'ACIF_AUDIT_1_5.ACIF_AUDIT_01'. : UKS06.d0420624-3801-0000-0080-83fda0200698: /build/S700_P/src/DataFlowEngine/ImbMqInputNode.cpp: 2122: ImbCommonInputNode::eligibleForBackout: ComIbmMQInputNode: ACIF_AUDIT_1_5#FCMComposite_1_5### Assistant: You need to get hold of the exception list and find out what the root cause of the failure is. If you don't have Catch of Fail terminals the error messages will be in the syslog / event viewer.If you have error handling however you need to ensure that you process the exception list in a suitable way to report the root cause of the exception.If you are really stuck you could try taking a user trace and following through execution of the affected compute node to try and identify the point of failure.If the issue is a db or db driver problem then the BIP message that gets thrown should have an SQLState and native error code which you can reference in the db vendors documentation.\n"} +{"text": "### Human: There are two threads in my application - one that asynchronously reads the messages from MQ queue and send them to the processing unit and a second that retrieves information from processing unit and puts the related messages on a sender queue. The problem is, next messages is retrieved and send to the processing unit before the previous message output thread has finished and this is not correct from application point of view. Since the messages may be found on queue at any time to be processed, it is not desirable to read messages synchronously.I know that I could introduce another queue to keep messages until ready to be processed but are there any MQ setup-related solutions that I could use instead? It seems to me like a very common setup.Thank you in advance for advice/help.### Assistant: This is basically a synchronisation problem. I would have setup an signalling mechanism where message listener sends the message received from MQ to processing unit and waits on an event. The output thread after sending the message to an output queue signals the event. Once signalled the message listener waits for the next message from queue.\n"} +{"text": "### Human: \u00a3 and \u00ea in a XML message is parsed successfully in broker but when one of the Queue manager tries to put the output message in another Queue manager, It throws 'Unconvertable character' exception and message goes to dead letter queue.Channel conversion is turned on and CCSID in both the queue managers is set to '819'.What shall be done to avoid this?\nNeed Help on this..!!Update Nov 15There is more thing that we can check If we are facing this issue.I was posting the message from RFHUTIL, and in MQMD tab, value in code page field was set to 457. So this was one of the reasons in faillure.I posted the same message again with code page value as 819 and then the same XML message worked fine.So, if you are facing the same issue, you might wanna check the RFHUTIL settings as well.### Assistant: The mentioned characters doesn't come under CCSID 819.And as the channel conversion is ON, queue manager will try your message to convert the message into it's own CCSID(819), which will fail to do so as the characters are not supported.Solutions could be:1) Turn off channel conversion.2) Change the CCSID of your queue managers to 1208.\n"} +{"text": "### Human: I am trying to build withamqmdneta IBM MQ receiver with 2 functionalities:ReceiveReply(byte correlationId)\u2013 readsREPLYmessages for supplied correlation identifiers. Is implemented by a GET with a correlation MATCH.event EventHandler NewMessage\u2013 notifies the subscriber of newREQUESTmessages. Is implemented by a GET with unlimited wait in infinite while loop.The problem is that I cannot limit the second GET to read onlyREQUESTmessages and so the correlation GET is never successful. If I only do one GET I will have to implement correlation on my own.Anyone tried to implement something similar?Thanks,\nRadu### Assistant: The simplest option is to use two queues. There are ugly ways of achieving what you are after (imagine all request messages putting something in the correlid so you could get by correlid there too, for example) but in principle you have a request queue and a reply queue - dont share!\n"} +{"text": "### Human: I have an App that references the IBM-WebSphereMQ dll \"amqmdnet.dll\".\nI'm trying to debug this Console Application locally, for which I got the 64 bit dll from our OP's team.The server that the service is running on is 32 bit.\nWhen trying to debug through, I get the following error.Could not load file or assembly 'amqmdnet, Version=1.0.0.3,\n Culture=neutral, PublicKeyToken=dd3cb1c9aae9ec97' or one of its\n dependencies. The located assembly's manifest definition does not\n match the assembly reference. (Exception from HRESULT: 0x80131040)The version of the dll givem to me was 7.1.0.0. I have added references in the solution to the version 7.1.0.0\nI'm not sure where it is expecting the 1.0.0.3 version from? I tried adding the following to my App.Config:\n \n \n \n \n \n \n but, to no effect. It still gives me the same exception.\nHere is the \"Fusionlog\" generated during the 'probing' time:=== Pre-bind state information ===\nLOG: User = xxxx\\ccc\nLOG: DisplayName = amqmdnet, Version=1.0.0.3, Culture=neutral, PublicKeyToken=dd3cb1c9aae9ec97\n (Fully-specified)\nLOG: Appbase = file:///C:/xxx/vvv/MouserMQ/services/MMQMonitor/dev/Kk/MMQconfigChange/MMQWatchDogConsole/bin/Debug/\nLOG: Initial PrivatePath = NULL\nCalling assembly : MMQTools, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.\n===\nLOG: This bind starts in default load context.\nLOG: Using application configuration file: C:\\NewCodeBase\\mm\\MouserMQ\\services\\MMQMonitor\\dev\\kk\\MMQconfigChange\\MMQWatchDogConsole\\bin\\Debug\\MMQWatchDogConsole.vshost.exe.Config\nLOG: Using host configuration file: \nLOG: Using machine configuration file from C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\config\\machine.config.\nLOG: Post-policy reference: amqmdnet, Version=1.0.0.3, Culture=neutral, PublicKeyToken=dd3cb1c9aae9ec97\nLOG: Attempting download of new URL file:///C:/nb/Mouser/MouserMQ/services/MMQMonitor/dev/kk/MMQconfigChange/MMQWatchDogConsole/bin/Debug/amqmdnet.DLL.\nWRN: Comparing the assembly name resulted in the mismatch: Major Version\nERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.Is there something else I'm missing? I deleted and re-added the references to the dll wherever it appears in my solution.Can someone help me with this? I'd really appreciate any help :)### Assistant: It appears that you have not installed the complete MQ Client. Looks like you just copied one or two dlls. Your application is compiled with amqmdnet.dll version 1.0.0.3 which means the it is from MQ Client version 7.0.1 whereas the version of amqmdnet.dll you received is from MQ Client version 7.1. I think because of this you are running into this issue.To resolve this issue, I would install the complete MQ Client version v7.1. This will install policy files also which will redirect an application compiled with MQv701 to load MQv7.1 assemblies.\n"} +{"text": "### Human: I am using MQ.NET classes, however when i specify the correct queue manager, i still get this below error.Exception:CompCode: 2, Reason: 2058\nMQRC_Q_MGR_NAME_ERROR\n Data: {System.Collections.ListDictionaryInternal}Message: \"MQRC_Q_MGR_NAME_ERROR\"\nSource: \"amqmdnet\"MQQueueManager mqQMgr=null; \n//MYMGRTEST is my queue manager\nmqQMgr = new MQQueueManager(\"MYMGRTEST\"); -> This piece of line throws above exception.What are the possible reasons this can happen(network permission/admin rights/?) ? Any measures to correct this?Also i see this information in the error log under errors folders of websphere.AMQ9518: File 'C:\\Program Files (x86)\\IBM\\WebSphere MQ\\AMQCLCHL.TAB'\n not found.EXPLANATION:\nThe program requires that the file 'C:\\Program Files (x86)\\IBM\\WebSphere\nMQ\\AMQCLCHL.TAB' is present and available.ACTION:\nThis may be caused by invalid values for the optional environment variables\nMQCHLLIB, MQCHLTAB or MQDATA. If these variables are valid or not set then\nrecord the name of the file and tell the systems administrator who must ensure\nthat file 'C:\\Program Files (x86)\\IBM\\WebSphere MQ\\AMQCLCHL.TAB' is available\nto the program.Not sure what that error is about, as i have installed MQ client in my system.### Assistant: Hope you are setting the MQEnvironment:MQEnvironment.channel\nMQEnvironment.port\nMQEnvironment.hostnameYou need to set correct value in them. Like:MQEnvironment.hostname=\"localhost\", \nMQEnvironment.port=1414\nMQEnvironment.channel=\"SYSTEM.DEF.CHANNEL\"\n"} +{"text": "### Human: According tothe Online IBM doc for WMQ 7it's possible to write channel security exits in the Java language, so I don't need to remember C programming and no worry about compiling for different operating systems.My purpose is to write a security exit, which extracts the distinguished names (DN) on my QueueManager from a client certificate and forward its values as a JMS-usr property.My problem: I even couldn't setup the provided example for my Server-connection channel. I tried to put the .class file of the IBM-example to the \\exit folder, but my QM is throwing following error:The dynamic loadable file C:\\Program Files\\IBM\\WebSphere\nMQ\\exits\\MyMQExits.dll wasn't found.Does this mean that I can't write security exits for Java for my QM-side (just in C / dll), only for client-applications??### Assistant: The InfoCenter link may not be making it clear but the queue manager side exits must be developed in C language only. On the client side you can use Java/C to develop client side exits.\n"} +{"text": "### Human: I am trying to simulate WebSphere MQ reason code 2009 to handle in the below JMS code but not able to get it. Instead I am getting 2059. All I am doing is disconnecting SVRCONN channel while making the connection call. How can I get 2009 in my sample code. \nI have added a sleep time prior making connection again and using transacted sessions. What else can be done to handle reason code 2009 properly that eventually Queue manager won't get thrashed by frequent unsuccessful connection attempts.\nPlease find the code.private static void connectToQmgr(MQQueueConnectionFactory cf) {\n // TODO Auto-generated method stub\n\n MQQueueConnection connection = null;\n MQQueueSession session = null;\n MQQueue queue = null;\n MQQueueSender sender = null;\n\n //While Statement to make sure multiple connection tries are made until connection establishes\n\n while (connection == null){\n\n try {\n connection = (MQQueueConnection) cf.createConnection();\n session = (MQQueueSession) connection.createQueueSession(true, Session.CLIENT_ACKNOWLEDGE);\n queue = (MQQueue) session.createQueue(\"queue:///LQ\");\n sender = (MQQueueSender) session.createSender(queue);\n //MQQueueReceiver receiver = (MQQueueReceiver) session.createReceiver(queue);\n long uniqueNumber = System.currentTimeMillis() % 1000;\n TextMessage message = session.createTextMessage(\"MQJMSTest \"+ uniqueNumber);\n // Start the connection\n connection.start();\n sender.send(message);\n session.commit();\n System.out.println(\"Sent message:\\\\n\" + message);\n\n // JMSMessage receivedMessage = (JMSMessage) receiver.receive(10000);\n // System.out.println(\"\\\\nReceived message:\\\\n\" + receivedMessage);\n\n session.commit();\n\n sender.close();\n // receiver.close();\n session.close();\n connection.stop();\n connection.close();\n\n System.out.println(\"\\\\nSUCCESS\\\\n\");\n\n } catch (JMSException je) {\n System.err.println(\"Caught JMSException\");\n\n // Check for linked exceptions in JMSException to catch MQException and Reason Codes \n Throwable t = je;\n while (t != null) {\n // Write out the message that is applicable to all exceptions\n System.err.println(\"Exception Msg: \" + t.getMessage());\n // Write out the exception stack trace\n t.printStackTrace(System.err);\n\n // Add on specific information depending on the type of exception\n if (t instanceof JMSException) {\n JMSException je1 = (JMSException) t;\n System.err.println(\"JMS Error code: \" + je1.getErrorCode());\n\n if (t instanceof JmsExceptionDetail){\n JmsExceptionDetail jed = (JmsExceptionDetail)je1;\n System.err.println(\"JMS Explanation: \" + jed.getExplanation());\n System.err.println(\"JMS Explanation: \" + jed.getUserAction());\n }\n } else if (t instanceof MQException) {\n MQException mqe = (MQException) t;\n System.err.println(\"WMQ Completion code: \" + mqe.getCompCode());\n System.err.println(\"WMQ Reason code: \" + mqe.getReason());\n\n //###################################################################################\n //MQ Reason Code Error Handle here\n //Currently Handling MQ Reason Code 2059 since unable to simulate 2009\n //If connection handle exists make sure you close everything and add a wait interval and try a new connection again\n if (mqe.getReason()== 2059){\n System.out.println(\"Inside MQ Reson Code Handle\");\n\n if( connection != null){\n try {\n sender.close();\n // receiver.close();\n session.close();\n connection.stop();\n connection.close();\n } catch (JMSException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n\n // Add Wait Interval for 5 sec\n try {\n Thread.sleep(5000);\n System.out.println(\"Inside Thread Sleep for 5 sec\");\n //Try New connecting Again\n connectToQmgr(cf);\n } catch (InterruptedException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n\n } \n }\n //################################################################################## \n } else if (t instanceof JmqiException){\n JmqiException jmqie = (JmqiException)t;\n System.err.println(\"WMQ Log Message: \" + jmqie.getWmqLogMessage());\n System.err.println(\"WMQ Explanation: \" + jmqie.getWmqMsgExplanation());\n System.err.println(\"WMQ Msg Summary: \" + jmqie.getWmqMsgSummary());\n System.err.println(\"WMQ Msg User Response: \"\n + jmqie.getWmqMsgUserResponse());\n System.err.println(\"WMQ Msg Severity: \" + jmqie.getWmqMsgSeverity());\n }\n\n // Get the next cause\n t = t.getCause();\n }\n }\n\n }\n\n}### Assistant: A2009isMQRC_CONNECTION_BROKEN. Have you considered pulling the network cable or shutting down the network interface over which the connection travels? This is easy enough when running the code on your laptop. For servers, you can try routing the connection through an SSH proxy or other virtual interface that can be shut down.To answer the second part of your question, make sure the program sleeps a few seconds between reconnect attempts. Or, better yet, use a modern version of WMQ client and use the automatic reconnect option. This will make a couple of fast retries and then slow down a bit for subsequent retries.\n"} +{"text": "### Human: I am having a problem withI thinkimpersonation, but I could be mistaken.I have an IBM XMS consumer, consuming data from a queue. Works fine. In order to be granted access to the queue the service needs to be running as specific user, for this I have implemented .Net impersonation. On all systems I am able to get the queue running, the problem occurs when there is a need to restart.To test restart I have placed a simpleif(messages == 500) throw...which triggers cancellation, disconnection and reconnection.I installed the application as a Windows service to my local machine, it connects (using impersonation), reaches 500, throws, disconnects, reconnects and continues to process messages. However when I run the same code on our server it fails while trying to create a queue connection. Here is the error:7765 [20] ERROR SIS (null) - Unable to connect to Websphere MQ\n IBM.XMS.XMSException: CWSMQ0006E: An exception was received during the\n call to the method ConnectionFactory.CreateConnection:\n System.ComponentModel.Win32Exception (0x80004005): Access is deniedat System.Diagnostics.ProcessManager.OpenProcess(Int32 processId,\n Int32 access, Boolean throwIfExited) at\n System.Diagnostics.NtProcessManager.GetModuleInfos(Int32 processId,\n Boolean firstModuleOnly) at\n System.Diagnostics.ProcessManager.GetModuleInfos(Int32 processId)at System.Diagnostics.Process.get_Modules() at\n IBM.WMQ.CommonServices.TraceEnvironment() at\n IBM.WMQ.CommonServices.CreateCommonServices() at\n IBM.WMQ.CommonServices.TraceEnabled() at IBM.WMQ.MQBase..ctor()at IBM.WMQ.Nmqi.Phconn..ctor(NmqiEnvironment env) at\n IBM.WMQ.Nmqi.NmqiEnvironment.NewPhconn() at\n IBM.XMS.Client.WMQ.WmqConnection..ctor(NmqiEnvironment nmqiEnv, NmqiMQ\n nmqiMQ, XmsPropertyContext connectProps) at\n IBM.XMS.Client.WMQ.Factories.WmqConnectionFactory.CreateV7ProviderConnection(XmsPropertyContext\n connectionProps). During execution of the specified method an\n exception was thrown by another component. See the linked exception\n for more information. at\n IBM.XMS.Client.WMQ.Factories.WmqConnectionFactory.CreateProviderConnection(XmsPropertyContext\n connectionProps) at\n IBM.XMS.Client.Impl.XmsConnectionFactoryImpl.CreateConnection(String\n userID, String password) at\n IBM.XMS.Client.Impl.XmsConnectionFactoryImpl.CreateConnection() at\n Spin.TradingServices.DataAcquisition.Domain.DataProcessing.SIS.SISMQConnection.Connect(ImpersonationCredentials\n impersonationCredentials)Linked Exception : System.ComponentModel.Win32Exception (0x80004005):\n Access is denied at\n System.Diagnostics.ProcessManager.OpenProcess(Int32 processId, Int32\n access, Boolean throwIfExited) at\n System.Diagnostics.NtProcessManager.GetModuleInfos(Int32 processId,\n Boolean firstModuleOnly) at\n System.Diagnostics.ProcessManager.GetModuleInfos(Int32 processId)at System.Diagnostics.Process.get_Modules() at\n IBM.WMQ.CommonServices.TraceEnvironment() at\n IBM.WMQ.CommonServices.CreateCommonServices() at\n IBM.WMQ.CommonServices.TraceEnabled() at IBM.WMQ.MQBase..ctor()at IBM.WMQ.Nmqi.Phconn..ctor(NmqiEnvironment env) at\n IBM.WMQ.Nmqi.NmqiEnvironment.NewPhconn() at\n IBM.XMS.Client.WMQ.WmqConnection..ctor(NmqiEnvironment nmqiEnv, NmqiMQ\n nmqiMQ, XmsPropertyContext connectProps) at\n IBM.XMS.Client.WMQ.Factories.WmqConnectionFactory.CreateV7ProviderConnection(XmsPropertyContext\n connectionProps)### Assistant: Looks like the user id being impersonated does not have enough permissions and not a problem with XMS.Here is a link that may be of help to you.Access is denied at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)andthisalso.\n"} +{"text": "### Human: I am Using WebSphere MQ 7,and I have two clients connected to the same QMgr and consuming messages from same queue, like following code:while (true) {\n TextMessage message = (TextMessage) consumer.receive(1000);\n if (message != null) {\n System.out.println(\"*********************\" + message.getText());\n }\n }I found only one client always retrieve messages. Is there any method to let consume-message load balancing in two client? Any config options in MQ Server side?### Assistant: When managing queue handles, it is MUCH faster for WMQ to put them in a stack rather than a LIFO queue. So if the messages arrive on the queue slower than it takes to process them, it is possible that an instance will process the message and perform another GET, which WMQ pushes down on the stack. The result is that only one instance will see messages in a low-volume use case.In larger environments where there are many instances waiting on messages, it is possible that activity will round-robin amongst a portion of those instances while the other instances starve for messages. For example, with 10 GETters on the queue you may see three processing messages and 7 idle.Although this is considerably faster for MQ, it is confusing to customers who are not aware of how it works internally and so they open PMRs asking this exact question. IBM had to choose among several alternatives:Adding several code paths to manage by stack for performance when fully loaded, versus manage by LIFO for apparent balancing when lightly loaded. This bloats the code, adds many new decision points to introduce errors and solves a problem that was one of perception rather than reliability or performance.Educate the customers as to how it works. Of course, once you document it, then you can't change it. The way I found out about this was attending the \"WMQ Internals\" presentation at IMPACT. It's not in the Infocenter so IBM can change it, but it is available for customers.Do nothing. Although this is the best result from the code design point of view, the behavior is counter-intuitive. Users need to understand why things do not behave as expected and will waste time trying to find the configuration that results in the desired behavior, or open a PMR.I don't know for sure that it still works this way but I expect that it does. The way I used to test it was to put many messages on the queue at once and then see how they were distributed. If you drop about 50 messages on the queue in one unit of work, you should see a better distribution between the two instances.How do you drop 50 messages on the queue at once? First generate them with the applications turned off or to a spare queue. If you generated them in the target queue, use theQ programto move them to the spare queue. Now start the apps and make sure the queue'sIPPROCcount equals however many instances of the app you started. Using Q again, copy all of the messages to the original queue in a single unit of work. Since they all become available on the queue at once, your two app instances should both immediately be passed a message. If you used copy instead of move, you can repeat this as often as required.\n"} +{"text": "### Human: I am using jboss-5.1 to deploy message driven bean which is used to subscribe messages from a third party queue.Around 16 messages were posted to that queue but they remained pending in our subscriber queue. I restarted the server and the messages were readily picked.As much as I have analysed, I thinkmaxsizeandmaxsessioncould have affected it, as both are 15. But I do not understand if there was some real issue, how it got solved by just restarting.The logs were in error mode. I did not get the full stack trace.This is the snippet of that error log.[2012-10-30 17:01:00,228] [MQQueueAgent (GQH1_PLANNING_MDM_001)]\n[ERROR] STDERR: 2012.10.30 17:01:00 MQJMS1023E rollback failed\n\n[2012-10-30 17:01:00,228] [exceptionDelivery0] [WARN ]\norg.jboss.resource.adapter.jms.inflow.JmsActivation: Failure in jms activation \norg.jboss.resource.adapter.jms.inflow.JmsActivationSpec@85d0d(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter@b21aae\ndestination=remotewsmq/NOTIFICATION_PLANNING_MDM_001.SUBQ\ndestinationType=javax.jms.Queue tx=true durable=false reconnect=10 provider=RemoteWSMQJMSProvider\n user=null maxMessages=1 minSession=1 maxSession=5 keepAlive=60000 useDLQ=false)GQH1_PLANNING_MDM_001: The name of the queue used for subscribing.The files that I use to configure the properties of the MDBs are as follows.1.ejb3-interceptors-aop.xml\n *(..))\">\n \n \n \n\n \n\n *(..))\">\n \n \n \n \n \n \n \n \n\n \n @org.jboss.ejb3.annotation.Pool (value=\"StrictMaxPool\", maxSize=15, timeout=10000)\n \n 2.standardjboss.xml\n message-driven-bean\n default\n org.jboss.ejb.plugins.jms.JMSContainerInvoker\n \n DefaultJMSProvider\n StdJMSPool\n false\n\n \n\n 1\n 15\n 30000\n 1\n\n \n 10\n \n queue/DLQ\n 10\n 0\n \n \n\n \n \n\n \n maxSession\n 15\n 3.jms-ds.xml\n\n\n\n \n \n \n\n \n \n DefaultJMSProvider\n org.jboss.jms.jndi.JNDIProviderAdapter\n java:/XAConnectionFactory\n java:/XAConnectionFactory\n java:/XAConnectionFactory\n \n\n \n \n JmsXA\n \n jms-ra.rar\n org.jboss.resource.adapter.jms.JmsConnectionFactory\n javax.jms.Topic\n java:/DefaultJMSProvider\n 20\n JmsXARealm\n jboss.messaging:service=ServerPeer\n \n\nPlease help.### Assistant: If the listener did not try to reconnect, then it might be the messages pending which caused it to fail.\n"} +{"text": "### Human: I am using websphere MQ and WAS .i created Message driven bean , in oncall method i am doing business layer stuffs to retrieve data from database but i am getting error as i mentioned in title\ni am using cod like hereJAXBContext context = JAXBContext.newInstance(\"com.schema.ticketservices_v1\");\n Unmarshaller unmarshaller = context.createUnmarshaller();\n\n RetrieveTicketRequest retrieveTicketRequest = (RetrieveTicketRequest) unmarshaller.unmarshal(new FileInputStream(\"D://request4.xml\"));\n System.out.println(retrieveTicketRequest.getCorrelationID());\n TicketRemarksBindingImpl bindingImpl = new TicketBindingImpl();\n RetrieveTicketResponse retrieveTicketResponse = bindingImpl.retrieve(retrieveTicketRequest);I am able to retrieve data expected from database but getting following exception[10/10/12 11:39:36:778 IST] 000000ea RegisteredRes E WTRN0063E: An illegal attempt to commit a one phase capable resource with existing two phase capable resources has occurred.\n[10/10/12 11:39:36:779 IST] 000000ea RegisteredRes E WTRN0086I: XAException encountered during prepare phase for transaction 0000013A494AE71F000000020000000AA2E8C1F524D2F1D345141C905AF81B4416CCDB030000013A494AE71F000000020000000AA2E8C1F524D2F1D345141C905AF81B4416CCDB0300000001. Local resources follow.\n[10/10/12 11:39:36:779 IST] 000000ea JTAResourceBa I WTRN0089I: LocalTransactionWrapper@:54ae54ae localTransaction:com.ibm.ws.rsadapter.spi.WSRdbSpiLocalTransactionImpl@54c554c5 enlisted:trueHas Tran Rolled Back = false registeredForSynctruemcWrapper.hashcode()1415009367: Vote: none.\n[10/10/12 11:39:36:780 IST] 000000ea JTAResourceBa I WTRN0089I: com.ibm.mq.connector.xa.XARWrapper@53985398: Vote: commit.\n[10/10/12 11:39:36:814 IST] 00000024 ActivationSpe I J2CA0524I: The Message Endpoint for ActivationSpec jms/testMDBspec (com.ibm.mq.connector.inbound.ActivationSpecImpl) and MDB Application TicketRemarkServiceEJBProjectEAR#TicketRemarkServiceEJBProject.jar#TicketMDB is deactivated.\n[10/10/12 11:39:36:815 IST] 00000024 SibMessage W [:] CWWMQ0007W: The message endpoint TicketRemarkServiceEJBProjectEAR#TicketRemarkServiceEJBProject.jar#TicketMDB has been paused by the system. Message delivery failed to the endpoint more than 0 times. The last attempted delivery failed with the following error: javax.jms.TransactionRolledBackException: \n at com.ibm.mq.connector.inbound.WorkImpl.callDeliveryFailed(WorkImpl.java:464)\n at com.ibm.mq.connector.inbound.WorkImpl.xaStateChanged(WorkImpl.java:421)\n at com.ibm.mq.connector.xa.XAObservable.update(XAObservable.java:120)\n at com.ibm.mq.connector.xa.XARWrapper.rollback(XARWrapper.java:444)\n at com.ibm.tx.jta.JTAXAResourceImpl.rollback(JTAXAResourceImpl.java:363)\n at com.ibm.tx.jta.RegisteredResources.deliverOutcome(RegisteredResources.java:1589)\n at com.ibm.tx.jta.RegisteredResources.distributeOutcome(RegisteredResources.java:1926)\n at com.ibm.tx.jta.RegisteredResources.distributeRollback(RegisteredResources.java:2579)\n at com.ibm.tx.jta.TransactionImpl.internalRollback(TransactionImpl.java:1951)\n at com.ibm.tx.jta.TransactionImpl.internalRollback(TransactionImpl.java:1914)\n at com.ibm.tx.jta.TransactionImpl.coreStage2CommitProcessing(TransactionImpl.java:1101)\n at com.ibm.tx.jta.TransactionImpl.stage2CommitProcessing(TransactionImpl.java:1128)\n at com.ibm.tx.jta.TransactionImpl.processCommit(TransactionImpl.java:989)\n at com.ibm.tx.jta.TransactionImpl.commit(TransactionImpl.java:919)\n at com.ibm.ws.tx.jta.TranManagerImpl.commit(TranManagerImpl.java:436)\n at com.ibm.tx.jta.TranManagerSet.commit(TranManagerSet.java:161)\n at com.ibm.ejs.csi.TranStrategy.commit(TranStrategy.java:927)\n at com.ibm.ejs.csi.TranStrategy.postInvoke(TranStrategy.java:230)\n at com.ibm.ejs.csi.TransactionControlImpl.postInvoke(TransactionControlImpl.java:570)\n at com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:4558)\n at com.ibm.ejs.container.MessageEndpointHandler.afterDelivery(MessageEndpointHandler.java:1449)\n at com.ibm.ejs.container.MessageEndpointHandler.invokeMessageEndpointMethod(MessageEndpointHandler.java:806)\n at com.ibm.ejs.container.MessageEndpointHandler.invoke(MessageEndpointHandler.java:767)\n at $Proxy118.afterDelivery(Unknown Source)\n at com.ibm.mq.connector.inbound.WorkImpl.run(WorkImpl.java:333)\n at com.ibm.ejs.j2c.work.WorkProxy.run(WorkProxy.java:399)\n at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1604)### Assistant: An illegal attempt to commit a one phase capable resource with\n existing two phase capable resources has occurred.This is what you should be looking at.Make sure all the resources are XA capable and are configured to work with XA, my guess is that the DB is configured with XA and MQ is not.Also, there is an option to useonenon XA resource in a XA transaction, it is called Last Participant Support.\n"} +{"text": "### Human: How to handle messages bigger than 4MB on z/OS? I can't use segmentation, because it is not supported on z/OS.Some OS have even bigger limits measured even in kB.What is the common approach in this case?### Assistant: You are not hitting a z/OS limit but rather the default maximum message length on WebSphere MQ. Note that theInfocentersays \"On z/OS, specify a value in the range zero through 100 MB (104 857 600 bytes)\".To fix this, change the MAXMSGL on any queues and channels through which the message might pass. Don't forget to update the Dead Letter Queue's MAXMSGL as well as transmission queues.Be aware that MAXMSGL is there to save you! Many people set the value to its highest possible size and then run out of disk space. If the application hits a soft limit such as MAXMSGL or MAXDEPTH the effect is limited and generally recoverable. If the disk space is exhausted, the entire QMgr comes to a screeching halt and all connected apps are impacted.For more on this, please see theMice and Elephantsarticle on developerWorks.UDATE:Update based on comments asking about specifics of HP NonStop and WMQ V5.3.Please see the WMQ V5.3 manuals available in theWMQ Documentation library. The second link is the System Administration Guide for WMQ V5.3 on HP NonStop. Message lengths are discussed on P4:The default maximum message length is 4 MB, although you can increase\n this to a maximum length of 100 MB (where 1 MB equals 1 048 576\n bytes). In practice, the message length might be limited by:The maximum message length defined for the receiving queueThe maximum message length defined for the queue managerThe maximum message length defined by the queueThe maximum message length defined by either the sending or receiving applicationThe amount of storage available for the messageSo there's no arbitrarily small max message length on HP NonStop or associated with V5.3 of WMQ.\n"} +{"text": "### Human: This is a question in continuation of the discussion inWebSphere MQ and Atomikos - Messages Lost on process terminationDoes the JMSDeliveryMode mentioned inJMS fields and properties with corresponding MQMD fieldsdetermine if the MQ Message is persistent or not?### Assistant: Yes, so long as the message is put there using IBM's JMS classes. The classes will translate theJMSDeliveryModevalue into one of the WebSphere MQ persistence values.A C program might try to set or change the message properties so that they differ from the message header and I'm not sure whether the WMQ API will enforce the consistency in that case or not.But, to reiterate the first part, the answer is yes. The page linked describes how the JMS properties map onto the native WMQ headers andJMSDeliveryModedoes indeed map toMQMD.Persistence.I notice your link to the V6.0 Infocenter. Hopefully you are not still using WMQ V6.0 since it goes End of Service in a few days. The current Infocenter topic for the same information ishereand you will find it is reorganized and clarifies some of the points. I highly recommend moving to at least a V7.1 client and QMgr, preferably V7.5 - and of course, the corresponding Infocenter.UPDATE:Responding to the comments, the order of precedence is as follows:If persistence is set explicitly in the managed object object definition as describedhere, then it takes precedence.If the managed object is set toPERSISTENCE=APP(the default) then the application's setting takes precedence.If neither the managed object nor the app explicitly set persistence, then the default is to look at the setting on the queue and use that.Note that if the queue where the message is first put happens to be a transmission queue, persistence is determined at that point and travels with the message wherever it lands, even if the remote target queue is set toDEFPSIST(NO).If you look closely at the page linked in the first bullet, you will notice a possible persistence value of HIGH. The description of that value seems to have fallen out of the book (I'll report that) but it is onthis page. This is a \"best effort\" delivery mode of JMS that falls between WMQ's persistent and non-peristent modes. Since there is no native equivalent, WMQ implements this by using non-persistent messages on a queue that is marked for recovery. When the QMgr starts up, any non-persistent messages on the queue will be saved, assuming the shutdown and startup were normal and that the queue file is not damaged. Even on a QMgr with linear logging, these messages are not logged for media recovery so there is only one copy of them. So most of the time, these messages survive a restart but if there is any condition which the QMgr can resolve by deleting them it will.Note the warning on the page that says all queues a message passes through must be set toNPMCLASS(HIGH)in order for this to work. I'm not sure what happens to the messages if they land on a queue withNPMSPEED(NORMAL)on the way through the network but you should probably treat them as non-persistent.\n"} +{"text": "### Human: I'm trying to create a WCF webservice using WMQ transport. Hosted on IIS.I couldn't find good documentation on the subject. And from the examples I did find it appears there's much detail that needs to be programmed \"manaualy\" (when comparing to WCF web services using MSMQ transport)### Assistant: WMQ configuration for WCF is quite easy - I tried it few months ago an it is only about providing bindingElement extension in configuration file, using the extension in custom binding and specifying endpoint with that binding and rather complex JMS URI specific for WCF. Thats all.But IBM doesn't provide any support for hosting in IIS. The support is only for self-hosting. If you want IIS hosting you need to build your own external WAS listener and integration with IIS (you need to do IBM's job) -here is extensibility samplerelated to building WAS listener.Side note: Tibco EMS (competitive technology) provides WAS listener.\n"} +{"text": "### Human: I found this code to enumerate a list of queues for a QueueManager. \nIt works, but I see a lot of System Queues, and even channel names in the list it provides. Is there some property I can test to see if it is a \"normal\" user-defined queue? \nObjectType, QueueType, Usage seemed to always give same values for every queue-name.// GET QueueNames - this worked on 07/19/2012 - but returned a lot of system queue, and unclear how to separate user queues from system queues. \n PCFMessageAgent agent = new PCFMessageAgent(mqQMgr);\n\n // Build the query request.\n PCFMessage requestMessage = new PCFMessage(CMQCFC.MQCMD_INQUIRE_Q_NAMES);\n requestMessage.AddParameter(MQC.MQCA_Q_NAME, \"*\");\n\n // Send the request and retrieve the response.\n PCFMessage[] responses = agent.Send(requestMessage);\n\n // Retrieve the values requested from the response.\n string[] queueNames = responses[0].GetStringListParameterValue(CMQCFC.MQCACF_Q_NAMES);\n //string[] objType = responses[0].GetStringListParameterValue(CMQCFC.MQIACF_OBJECT_TYPE);\n\n int loopCounter = 0;\n foreach (string queueName in queueNames)\n {\n loopCounter++;\n Console.WriteLine(\"QueueName=\" + queueName);\n try\n {\n mqQueue = mqQMgr.AccessQueue(\n queueName,\n MQC.MQOO_OUTPUT // open queue for output\n + MQC.MQOO_INQUIRE // inquire required to get CurrentDepth \n + MQC.MQOO_FAIL_IF_QUIESCING); // but not if MQM stopping\n\n\n Console.WriteLine(\"QueueName=\" + queueName +\n \" CurrentDepth=\" + mqQueue.CurrentDepth +\n \" MaxDepth=\" + mqQueue.MaximumDepth + \n \" QueueType=\" + mqQueue.QueueType +\n \" Usage=\" + mqQueue.Usage\n );\n }\n catch (MQException mex)\n {\n Console.WriteLine(mex.Message);\n }\n\n }\n }### Assistant: For me your sample code lists only queues, no other objects but yes it lists all queues. You can add another filterrequestMessage.AddParameter(MQC.MQIA_Q_TYPE, MQC.MQQT_MODEL);to list only model queues. Other values available forMQC.MQIA_Q_TYPEareMQC.MQQT_LOCAL,MQQT_ALIAS,MQQT_CLUSTERandMQC.MQQT_REMOTE.All system or predefined queue names begin withSYSTEM. So you could probably use this string filter out predefined queues after listing. Also if you look at a queue definition, there is DEFTYPE attribute, system defined queues have value ofPREDEFINED. But I could not add a third parameter to filter queue names by DEFTYPE. I got 3014 reason code.HTH\n"} +{"text": "### Human: I have a .net mq client on my computer and mq websphere queue manager on a remote server.How can I send and recieve messages from a queue that is on the remote computer?I get this error: MQRC_HOST_NOT_AVAILABLEHow can I connect to the remote queue manager with MQ Explorer on my computer.I get:Access not permitted. You are not authorized to perform this operation. (AMQ4036)\n Access not permitted. You are not authorized to perform this operation. (AMQ4036)==============How should I configure the server? channel settings? connection settings?\nI am able to connect locally when the queue manager is on my computer\nbut when its on a remote computer it fails because authentication.\nI know that I should add my user to the mqm group but the remote computer isNOT connected by domain.thank you!### Assistant: The reason for MQRC_HOST_NOT_AVAILABLE is because either the host name or the port number you are using are not correct.To connect to a remote queue manager the following information is required:\nQueue manager name: Name (case sensitive) of the queue manager you want to connect to.Channel name: Name of the channel - of type SVRCONN. You can use SYSTEM.DEF.SVRCONN but it is recommended you create your own SVRCONN channelConnection name: hostname(port) - Hostname/IP address on which queue manager is running and port at which it is listening, for example remotehost(1414).You can provide the above information in many ways:\n1) Via MQSERVER environment variable.MQSERVER=/TCP/.\n For exampleMQSERVER=MY.SVRCONN.CHN/TCP/remotehost(1414).\n2) Via your application code. See nmqput.cs MQ sample file for more details.\n3) Channel definition table.\n"} +{"text": "### Human: From the docs, I understand that WebSphere MQ can support messages up to size 100 MB. What is the size limit for the SIBus queues in WAS? Can it also support messages up to 100 MB?Is there a limit on the file sizes that can be handled by the RFHUtil tool?Appreciate any pointers.Thanks.### Assistant: According to the WAS Infocenterhere, SIBus is designed for messages up to 40MB on 32-bit systems.RFHUtil should handle messages up to the max size allowed. However, be aware that message properties mayor may notcount towards that size, depending on tuning. The Q program fromSupportPac MA01should also handle messages of any allowable size.\n"} +{"text": "### Human: I used the Subscriber SYSTEM.JMS.D.SUBSCRIBER.QUEUE and Client ID as setClientID(\"USER1\") and usedtopicSubscriber = topicSession.createDurableSubscriber(topic,\"SUB1\");ThetopicSubscriberis created and while trying to receive using thistopicSubscriber.receive();, it is not receiving the messages from topic , but there are messages in topic.Can any one say why its not receiving messages and whether i need to chek any queue configurations.Any help is appreciated.Thanks in advance.I already had topicConnection.Start() in my coding , also i checked in TopicSession there is no Start() Method.The same code with Non durable subscriber methodtopicSession.createSubscriber(topic);is working , but for durable it is not working.ThanksSorry, yes I meant topicConnection.Start(). It was worth a check.I got the answer for durable subscriber not working ,\n My queue depth has reached the max queue depth , so the subscriber is not able to subscribe the message.Eg . my max queue depth for queue SYSTEM.JMS.D.SUBSCRIBER.QUEUE is set to 100 , and if we check our current queue depth and if it reaches 100 the subscriber will not work.As an alternative way iam trying to create with Temporary Topic , here iam getting an error while creating the durable subscribertopicSession.createDurableSubscriber(topic,\"SUB1\");JMS Exception :: javax.jms.InvalidDestinationException: MQJMS0003:\n Destination not understood or no longer validCan anyone help to solve this error.Thanks in Advance.### Assistant: The problem seems to be how you are usingSYSTEM.JMS.D.SUBSCRIBER.QUEUE. You appear to be directing messages and subscribers to this queue as the destination for a durable subscription. IBM MQ uses that queue tomanagedurable subscriptions.As a general rule, queues whose names begin withSYSTEMare for internal system use by MQ. Some of them, such asSYSTEM.ADMIN.*.EVENTare OK to get messages from but you would not use these as a subscription destination for unrelated messages either.Many tutorials useSYSTEM.DEFAULT.LOCAL.QUEUEas a destination for messages but this is only because the queue is known to exist on all versions of MQ and MQ uses only thedefinitionof the queue and never thecontentof that queue. It is easier for the tutorial writer (and IBM is just as guilty here) to point atSYSTEM.DEFAULT.LOCAL.QUEUEthen to walk the student through the need for and means to create their own queue. So although best practices suggest it should not be an exception to the \"do not useSYSTEMobjects\" rule, common usage makesSYSTEM.DEFAULT.LOCAL.QUEUEthe de facto exception.The other exceptions are, of course, the command queues for MQ, MFT and IIB. These are also namesSYSTEM.*but are designed for users to communicate with the software listening on the queue.Note that all the exceptions \"do not useSYSTEMobjects\" rule are interfaces between applications and MQ system resources. The event queues are MQ sending information to the user. The command queues are the user sending information to the system components. A subscription is neither of these categories. A destination for a subscription is considered an application-owned object, even when the system manages it on behalf of the subscriber.When you want a durable subscription, either let the system assign a permanent queue and use that, or else pre-define a queue (that is not namedSYSTEM.*) and use that. Whatever else you do, please do NOT try to hijack MQ's internal system queues for application-level purposes.\n"} +{"text": "### Human: I have data on a WebSphere MQ queue. I've written a script task to read the data, and I can output it to a variable or a text file. But I want to use that as input to a dataflow step and transform the data. The ultimate destination is a flat file.Is there a way to read the variable as a source into a dataflow step? I could write the MQ data to a text file, and read the text file in the dataflow, but that seems like a lot of overhead. Or I could skip the dataflow altogther, and write all the transformations in a script (but then why bother with SSIS in the first place?)Is there a way to write a Raw File out of the script step, to pass into the dataflow component?Any ideas appreciated!### Assistant: If you've got the script that consumes the webservice, you can skip all the intermediary outputs and simply use it as a source in your dataflow.Drag a Data Flow Task onto the canvas and the add a Script Component. Instead of selecting Transformation (last option), selectSource.Double-Click on the Script Component and choose theInput and Output Properties. Under Output 0, select Output Columns and clickAdd Columnfor however many columns the web service has. Name them appropriately and be certain to correctly define their metadata.Once the columns are defined, click back to the Script tab, select your language and edit the script. Take all of your existing code that could write that consumes the service and we'll use it here.In theCreateNewOutputRowsmethod, you will need to iterate through the results of the Websphere MQ request. For each row that is returned, you would apply the following pattern.public override void CreateNewOutputRows()\n{\n // TODO: Add code here or in the PreExecute to fill the iterable object, mqcollection\n\n foreach (var row in mqcollection)\n {\n // Adds a new row into the downstream buffer\n Output0Buffer.AddRow();\n\n // Assign all the data to the correct locations\n Output0Buffer.Column = row.Column;\n Output0Buffer.Column1 = row.Column1;\n\n // handle nulls appropriately\n if (string.IsNullOrEmpty(row.Column2))\n {\n Output0Buffer.Column2_IsNull = true;\n }\n else\n {\n Output0Buffer.Column2 = row.Column2;\n }\n }\n}Youmusthandle nulls via the _IsNull attribute or your script will blow up. It's tedious work versus a normal source but you'll be far more efficient, faster and consume fewer resources than dumping to disk or some other staging mechanism.\n"} +{"text": "### Human: Suppose I have an application fed by a MQ queue. When the application receives a message that contains errors, the application itself pushes the received message to a certain invalid message queue.My question is: what is the recommended way to have the receiving application append the failure/rejection reason to the message pushed on the invalid message queue? Some solutions come to mind, but I'm unsure which one is considered \"best-practice\":(ab)using a standard header fieldadding a custom headerencapsualting the message in another message### Assistant: If all that you need is to place a reason code in the message, use theMQMD.Feedbackfield with one of thestandard reason codes. In WMQ v7.0 or later, the application can set any number ofmessage propertieswhich are then readable both with JMS semantics and native WMQ API calls. It is up to you to define the taxonomy for naming the application-defined properties.If the message is requeued to the Dead Letter Queue instead of an application-owned backout queue, it is customary to prepend aDead Letter Headerto it. TheMQDLHstructurecontains a field for the reason code describing why that the message was requeued. As a rule, applications should avoid using the DLQ in favor of an application-owned queue. When applications do use the DLQ, it is normal that they should have access to put messages there but not to retrieve messages from that queue. This is because it is a system-wide resource and messages from different applications may land there. Normally, an admin application or person with elevated access is responsible for adjudicating and disposing of messages on the system DLQ.\n"} +{"text": "### Human: we have WebSphere MQ server.\nI have written Java client utility which can read all messages (leaving them in queue) or delete all from queue.\nBut is that possible to read message and if it contains certain string - delete it?To read queue message i use (message will stay on server queue for future processing, coz utility only for testing):MQQueue queue = queueManager.accessQueue(queueName, MQC.MQ00_BROWSE | MQC.MQ00_INPUT_SHARED);\nMQGetMessageOptions options = new MQGetMessageOptions();\noptions.options = MQC.MQ00_BROWSE_FIRST | MQC.MQ00_INPUT_SHARED;\nwhile(true) {\nMQMessage msg = new MQMessage();\nqueue.get(msg, options);\nif (msg.getTotalMeesageLength() == 0) {\nbreak;\n} else {\nreadMessage(msg);\n}### Assistant: This is actually a fairly common requirement. The methodology is to browse through the messages looking for the one you want to delete. When you find it, delete it with a destructiveGET. You canGETthe message using the browse cursor as described in the Infocenterhere. You can also use a separate thread with it's own queue handle toGETusing theMsgIDthat you obtained from the browse. Simply call the other thread and pass it theMsgID. The simplest way is to use one thread and the browse cursor.\n"} +{"text": "### Human: I have been using the XMS API to connect to Websphere MQ and using the following code I am able to connect fine:private IConnection CreateWqmConnection() \n {\n // Create the connection factories factory using WMQ (websphere message queue)\n XMSFactoryFactory factoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\n\n // Use the connection factories factory to create a connection factory\n IConnectionFactory cf = factoryFactory.CreateConnectionFactory();\n\n // Set the properties\n\n cf.SetStringProperty(XMSC.USERID, @\"user\");\n cf.SetStringProperty(XMSC.PASSWORD, @\"password\");\n\n cf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, MessageQueueManager);\n cf.SetStringProperty(XMSC.WMQ_HOST_NAME, MessageQueueHost);\n cf.SetIntProperty(XMSC.WMQ_PORT, MessageQueuePort);\n cf.SetStringProperty(XMSC.WMQ_CHANNEL, MessageQueueChannel);\n cf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);\n cf.SetStringProperty(XMSC.CLIENT_ID, UniqueClientId);\n\n return cf.CreateConnection(); \n }However if I try and change the username and password to anyone other than the user I am currently logged in as I am getting a 2035 security error. I have logged into the host machine and added the user to the mqm group and I can connect using this user from my local machine using WMQ Explorer and publish messages, just not with XMS.Additionally I have found if I debug the program under this user account I can connect, so it appears I cannot run as one user and authenticate as another. Is this the case with XMS? And is there a way around this?### Assistant: XMS always uses the logged on user id for authenticating with queue manager. The behavior is similar to WebSphere MQ C Clients. Please refer tothis page in the Infocenterfor more details on alternatives.\n"} +{"text": "### Human: I am working with wmqfte. While creating a transfer there is a parameter for metadata attribute pair. Why is this used for ?### Assistant: One of the FTE engagements I worked on required email notifications of transfer status. Our approach to this was to add an email step in the transfer and the way we passed in the source and destination addresses was with metadata pairs. The transfer XML is provided below for an example:\n\n \n \n host.example.com\n me\n \n \n \n \n \n fteadmin@example.com\n \"dept@example.com\n \n \n \n /root/path/file\n \n \n /root/path/\n \n \n \n \n Your Job Name Here\n \n \nA better way of sending status emails is to watch the transfer notifications published at the Coordination QMgr. However this example does show one possible use for the metadata pairs.\n"} +{"text": "### Human: I am using SAP PI to connect with IBM MQseries (v 5.3).Whenever there is a network problem or any outage on WebSphere MQs, the SAP interfaces error out with the messageCompletion Code 2, Reason 2161, MQJMS2002To fix this, we are being asked to deploy new client files.Can anyone help us find these jar files?I have downloaded the v7 client fromhttp://www-01.ibm.com/support/docview.wss?rs=171&uid=swg24019253&loc=en_US&cs=utf-8&lang=en, but it doesn't contain jar files. It has rte files.### Assistant: For anyone locating this question and wanting an answer it is now (quite recently) possible to obtain the MQ JMS jar files for direct use rather than having to go through an install.Read more about it here:Obtaining the WebSphere MQ classes for JMS\n"} +{"text": "### Human: I am trying to fetch some information/data from (IBM) Websphere MQ using C#.I did manage to get a message, but i can't figure out how to get details about the queue (e.g. are there any items, how many items are contained, etc).Not Sure if it matter, but i use MQ 6.1 - the online API for c# provided by IBM is quite empty.Any suggestions welcome.### Assistant: The information you want is available asqueue object properties. Some properties are settable, all are gettable. The app needs to have inquire and/or set rights on the queue in order for these to work.The link you provided in the comment to Stephen's response is to a different section of the WMQ .Net manual. I suspect you are viewing it with curl or otherwise have script disabled or else you would have easily found the section I linked to above in the navigation panel. Any page loaded in a suitable browser will reload itself inside the navigation frame and display a table of contents on the left. The table of contents will be positioned on the page opened. The section you referenced was to compiling the .Net app but there is a complete API reference elsewhere.I would recommend viewing the Infocenter in a Javascript-enabled browser with cookies, or else installing the local version of the Infocenter as an Eclipse workbench. The local version has the ability to pull down updates when the online manuals are updated. In either case, a navigation panel is provided which includes the complete set of WMQ manuals and is searchable across all of them, by individual book or by section within a book.The landing page for WMQ documentationis here. This page contains links to the online Infocenters for v6 and v7, the downloadable Infocenters for v6 & v7 and the PDF versions of the older documentation.EDIT - The drill-down path to definitions of the constantsFrom the MQC page readers are directed to theApplication Programming Reference manualrather than directly to the MQC docs. However, the page displayed does not represent the whole APRM content! Click the plus sign in the navigation frame to open the TOC for the book.The page Constants has no content other than to direct the reader to the Constants manual. Unfortunately, it's not linked but the manual is listed in the navigation frame simply as \"Constants\". Click the plus sign to expand the TOC.This level contains the major sections of the book, one of which is the detail of all the constants under the heading of \"Constants\". Clicking that link opens an index page with all of the constants listed and links to a dedicated page for each.\n"} +{"text": "### Human: I am just dealing with a new scenario for me, which I believe might be common to some :)..As per requirements I need to build a user experience to be like a synchronous on-line transaction for a web service call, which actually delegates the call to a IBM MQ Series using an asynchronous JMS-MQ Bridge.The client calls the web service and than his message should be published in a JMS queue on the App server which will be delivered to WebSphere MQ and than after processing a response will delivered back to App server in a FIXED JMS queue endpoint.The requirement deals with this transaction that will need to time out in case WebSphere MQ does not delivery the response in a defined amount of time, than the web service should send a time-out signal to client and ignore this transaction.The sketch of the problem follows.I need to block the request on the web service until the response arrives or time-out.Than I am looking for some open library to help me on this task. \nOr the only solution is blocking a thread and keep pooling for the response?\nMaybe I could implement some block with a listener to be notified when the response arrives?A bit of discussion would be very helpful for me now to try to clear my ideas on this.\nAny suggestions?I have a sketch that I hope will help clearing the picture ;)### Assistant: Hey, thanks for posting your own solution!Yep, receive() with timeout is the most elegant way to go in this case.Beware of what happens with messages that aren't read because of the timeout. If your client acceses the same queue again, he might pick up a stale message.Make sure the messages that timeout are deleted in a timely manner (if for no other reason, then not to fill up the queue with unprocessed messages).You can do this easily either through code (setting time-to-live on the message producer) or on the Websphere MQ server (using using queues that expire messages automatically).The latter is easier if you can't/don't want to modify the MQ side of the code. It's what I would do :)\n"} +{"text": "### Human: I am trying to integrate IBMMQ v6.0.2 with jbossESB.we have local Queue available on IBMMQ on one of our QA QUEUEMANAGER. \nI am able to listen to the QUEUE using JMSprovider of jboss ESB. As soon as a message (of type jms_text ) is dropped , esb listen to it and pick it up and before it hit the next action it throws following error message.ERROR [JmsComposer] Unsupported JMS message type: com.ibm.jms.JMSTextMessageHere are the steps I followed.jboss-service.mxl : Defined Connection Factory and QUEUEadded jars ( com.ibm.mq.* ) to ${jbossesb}/server/${mynode}/libAdded jms lsinterner configuration on jboss-esb.xmlPlease guide me what I m missing here... Do I need to create custom MessagePlugin ?jboss-esb looks like this \n \n \n \n \n \n jboss-service.xml looks like this\n MQQueueConnectionFactory\n Queue\n false\n SQAT0083\n 111.111.111.111\n 1415\n MYCO.SVRCONN\n CLIENT\n jboss:service=Naming\n \n \n wsmq/SerivceOrderQueue\n Queue\n SQAT0083\n MYCO.SERVICEORDER.QA01.QL01\n MQ\n jboss:service=Naming\n I am using jboss-eap-4.3. Really appreciate any help.Here is my Service Tag Looks like in jboss-esb.xml\n\n\n \n\n \n \n\n \n \n \n \n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n### Assistant: Bit late response but if someone reads this, the answer is:queuestartEsbChannelis listening to the same queue that is delivering jmstextmessages and it hasis-gatewayset tofalse(default value).Ifis-gatewayisfalse, only ESB messages can be recieved on that listener.\n"} +{"text": "### Human: I'm using JAX-RPC 1.1 to generate services for a set of applications running on WAS 6.0, communicating via Websphere MQ. A mainframe will be sending messages to the services, so if for some reason the message can't be converted to objects (likely due to EBCDIC-to-ASCII weirdness), the message needs to be placed on the dead-letter queue for examination.Does anyone know if there's a standard way to do this (i.e. by providing the jms:/ address with a DLQ name), or if DLQ-forwarding would need to be performed manually somehow?### Assistant: First, let me recommend that you do not rely on the DLQ for this. The DLQ is a QMgr-level resource that is used to store messages that the channel cannot resolve. Because it is a potential attack vector, most security-conscious shops will not grant access to applications, or if they do it is put-only access.The best way to do this is to create an app-specific exception queue. If the app has several input queues, they can all use the same exception queue and then the application support team can manage any messages that land there without the security issues.Whichever way you go, getting the app to honor this is extremely easy. For example, suppose your app is reading from JAX.SVC.REQUEST. You define the exception queue and point the BOQ* fields at it:DEF QL(JAX.SVC.EXCEPTION)\nALTER QL(JAX.SVC.REQUEST) BOQNAME(JAX.SVC.EXCEPTION) BOQTHRESH(5)The JMS classes will inquire on the BOQ* attributes of the queue when it is opened and check the backout count of each message read. In your program use a transacted session and if you can't process the message, call the session.backout() method. The message will be read and backed out no more than BOTHRESH times, then requeued to the queue named in BOQNAME. If that queue is full or unavailable the DLQ will be tried. If that fails, the classes will throw an exception.We pick a BOTHRESH > 1 to allow for the possibility that a processable message will be backed out if, for example, the QMgr is shut down.I usually trigger the exception queue so that it can raise an alarm or send an email if something lands on it. If you have a monitoring tool you can check for depth > 0 instead.If for some reason yo don't want to use the JMS functionality to automatically requeue the message, the application would need logic to requeue it. If you were to place the message on the DLQ you will want to prepend a DLQ header. Failure to do so will probably break the DLQ handler or any other instrumentation watching that queue.\n"} +{"text": "### Human: In a J2EE environment the MQ server log shows the following:Process(954584.5) User(mqm) Program(amqzmuc0)\nAMQ7469: Transactions rolled back to release log space.\n....While increasing the logfile size/space might be a temporary solution, the definitive solution must be to identify the culprit process/queue that causes this long transaction.Is there any solution/tool for this?Note: MQ is used via JMS only### Assistant: You want the DISPLAY CONN TYPE(CONN) ALL command, paying attention to the UOW* attributes. See:http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzaj.doc/sc11950_.htm\n"} +{"text": "### Human: I am receiving the error code 2 and the reason code 2400 (MQRC_UNSUPPORTED_CIPHER_SUITE) while attempting to retrieve a message using the IBM JDK 8 and IBM MQ v8. Can someone please help me identify the issue with my code?public static void main(String[] args) {\n int i = 0;\n \n System.setProperty(\"javax.net.ssl.keyStore\", \"/home/oracle/cert/jks/cert.jks\");\n System.setProperty(\"javax.net.ssl.keytStorePassword\", \"changeit\");\n //System.setProperty(\"com.ibm.mq.cfg.useIBMCipherMappings\", \"false\");\n String str1 = \"hostname.com\";\n String str2 = \"1400\";\n String str3 = \"TEST.1\";\n String str4 = \"QMG2\";\n String str5 = \"P.OUT.TRD\";\n try {\n MQEnvironment.hostname = \"hostname.com\";\n MQEnvironment.port = Integer.valueOf(str2).intValue();\n MQEnvironment.channel = str3;\n MQEnvironment.userID = \"username\";\n MQEnvironment.sslCipherSuite = \"SSL_ECDHE_RSA_WITH_AES_256_CBC_SHA384\";\n MQEnvironment.properties.put(\"transport\", \"MQSeries\");\n MQQueueManager mQQueueManager = new MQQueueManager(str4);\n System.out.println(\"Connected to QMGR \");\n byte b = 16;\n MQQueue mQQueue = mQQueueManager.accessQueue(str5, b, null, null, null);\n i = mQQueue.getCurrentDepth();\n System.out.println(i);\n mQQueue.close();\n mQQueueManager.disconnect();\n } catch (MQException mQException) {\n mQException.printStackTrace();\n }\n }\n}I am receiving error code 2 and reason code 2400 while attempting to retrieve a message using the IBM JDK 8 and IBM MQ v8. Can someone please help me identify the issue with my code?### Assistant: A MQRC_UNSUPPORTED_CIPHER_SUITE arises when\nthe ciphersuite specified in the program is unknown either at the MQ client or the Java JRE.The usual explanation is a difference in the ciphersuite names\nbetween the IBM MQ JRE and a non-IBM JRE. See -https://www.ibm.com/support/pages/why-tls-connection-mq-failing-compcode-2-mqccfailed-reason-2400-mqrcunsupportedciphersuite-exceptionFrom the above link:To disable the ciphersuite mappings for a non-IBM runtime\nenvironments, the following Java System Property must be set:com.ibm.mq.cfg.useIBMCipherMappings=falseFor example, this can be configured by using the JVM argument:-Dcom.ibm.mq.cfg.useIBMCipherMappings=falseAsSSL_ECDHE_RSA_WITH_AES_256_CBC_SHA384is an IBM JRE CipherSuite name. The likelihood is that when you are running your application, it is using a non-IBM JRE. To verify add your logging equivalent oflogger.info(\"Running under Java \" + System.getProperty(\"java.version\") \n + \" from \" + System.getProperty(\"java.vendor\"));I suspect that that isn't going to report IBM, but if it does then\nfor a2400there are unlikely to be any server logs (https://www.ibm.com/docs/en/ibm-mq/9.2?topic=problems-tls-troubleshooting#q123400___title__12)The above link says that a2400could be caused by a FIPS / non-FIPs mismatch, but asSSL_ECDHE_RSA_WITH_AES_256_CBC_SHA384is FIPS 140-2 compatible, this is unlikely to be the cause. (https://www.ibm.com/docs/en/ibm-mq/9.3?topic=jms-tls-cipherspecs-ciphersuites-in-mq-classes)\n"} +{"text": "### Human: Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.jms.core.JmsTemplate]: Factory method 'jmsTemplate' threw exception with message: class com.ibm.mq.jms.MQConnectionFactory cannot be cast to class jakarta.jms.ConnectionFactory (com.ibm.mq.jms.MQConnectionFactory and jakarta.jms.ConnectionFactory are in unnamed module of loader 'app')\n at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:171)\n at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)\n ... 66 common frames omitted\nCaused by: java.lang.ClassCastException: class com.ibm.mq.jms.MQConnectionFactory cannot be cast to class jakarta.jms.ConnectionFactory (com.ibm.mq.jms.MQConnectionFactory and jakarta.jms.ConnectionFactory are in unnamed module of loader 'app')Issue might be because of IBM MQ is not supporting higher version or not compatible with spring 6 but not sure. looking for the resolution for the issue.### Assistant: MQ provides Jakarta-compatible packages. You have to change your dependencies to use the correct module.If you're using the MQ Spring Boot library, then use the corresponding V3.x.x artifact.If you are directly referencing the MQ client libraries, then usecom.ibm.mq.jakarta.clientinstead of thecom.ibm.mq.allclient.\n"} +{"text": "### Human: I am writing one java client application to connect to IBM-MQ queue manager configured in TLS.\nBelow is java code:import com.ibm.mq.MQC;\nimport com.ibm.mq.MQEnvironment;\nimport com.ibm.mq.MQQueueManager;\n//import com.ibm.mq.constants.CMQC;\n\npublic class IBMMQClient {\n public static void main(String[] args) throws Exception {\n System.setProperty(\"com.ibm.mq.cfg.useIBMCipherMappings\", \"false\");\n System.setProperty(\"javax.net.ssl.keyStore\", \"C:\\\\ibm_mq\\\\temp\\\\genkey.kdb\");\n\n System.setProperty(\"javax.net.ssl.keyStorePassword\", \"gen@123\");\n\n MQEnvironment.hostname = \"*************\";//removed hostname for privacy\n MQEnvironment.port = 1419; // set the port number of the queue manager\n\n MQEnvironment.channel = \"MYSSL.SVRCONN\"; // set the channel name\n\n MQEnvironment.userID = \"myuser\";\n MQEnvironment.sslCipherSuite = \"TLS_RSA_WITH_AES_128_CBC_SHA256\"; // set the cipher suite to use for SSL/TLS\n\n\n MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES_CLIENT);\n\n\n MQQueueManager qMgr = new MQQueueManager(\"MYSSL\");\n System.out.println(\"Connected to \" + qMgr.getName());\n qMgr.disconnect();\n }\n}But I am getting error as:\nException in thread \"main\" com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2393'.Caused by: java.io.IOException: Invalid keystore formatbash-4.2$ mqrc 2393\n\n 2393 0x00000959 MQRC_SSL_INITIALIZATION_ERRORSo wanted to know what should be proper way to connect to it.\nAs .kdb file it is treating as invalid keystore format.Below are the commands which I used to create keystore .kdb at queue manager side and java client application side:queue manager MYSSL settings: -cd /var/mqm/qmgrs/MYSSL/ssl\n\nCreating key store:\n---------------------------\nrunmqakm -keydb -create -db mysslkey.kdb -pw myssl@123 -type cms -stash\n\nCreating self signed certficate\n------------------------------\nrunmqakm -cert -create -label ibmwebspheremqmyssl -db mysslkey.kdb -dn \"CN=myssl,OU=IBM\" -expire 365 -size 1024 -format ascii\n\nextracting a public certifcate\n-------------------------------\nrunmqakm -cert -extract -label ibmwebspheremqmyssl -db mysslkey.kdb -target mysslpub.arm\n\n\nAdding genpub.arm(public certficate from application keystore) in myssl key repos\n-----------------------------------\nrunmqakm -cert -add -label genpub -file /var/mqm/qmgrs/MYSSL/ssl/temp/genpub.arm -db mysslkey.kdbTo create generic keystore for java application:cd /var/mqm/qmgrs/MYSSL/ssl/temp\n\nCreating key store key database\n-------------------------\nrunmqakm -keydb -create -db genkey.kdb -pw gen@123 -type cms -stash\n\ncreating selfsigned certificate: \n-------------------------------\nrunmqakm -cert -create -label ibmwebspheremqgen -db genkey.kdb -dn \"CN=GEN,OU=IBM\" -expire 365 -size 1024 -format ascii\n\nextracting a public certificate\n--------------------------------\nrunmqakm -cert -extract -label ibmwebspheremqgen -db genkey.kdb -target genpub.arm\n\n\nAdding public key(mysslkey.arm) of MYSSL queuemanage in genkey.kdb :\n-----------------------------------\nrunmqakm -cert -add -label mysslpub -file /var/mqm/qmgrs/MYSSL/ssl/mysslpub.arm -db genkey.kdb -pw gen@123\n\n-----------final output of certificates inside mysslkey.kdb:bash-4.2$ runmqakm -cert -list -db /var/mqm/qmgrs/MYSSL/ssl/mysslkey.kdb\nSource database password :\nCertificates found\n* default, - personal, ! trusted, # secret key\n! genpub\n- ibmwebspheremqmyssl\nbash-4.2$final output of certificates inside genkey.kdb:bash-4.2$ runmqakm -cert -list -db genkey.kdb\nSource database password :\nCertificates found\n* default, - personal, ! trusted, # secret key\n! mysslpub\n- ibmwebspheremqgen\nbash-4.2$So wanted to know what should be proper way to connect to queue manager with TLS configured from java application.Also I tried option as below:MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);\n MQEnvironment.properties.put(MQC.SSL_CIPHER_SUITE_PROPERTY, \"TLS_RSA_WITH_AES_128_CBC_SHA256\");\n MQEnvironment.properties.put(MQC.MQCA_SSL_KEY_REPOSITORY, \"C:\\\\ibm_mq\\\\temp\\\\genkey.kdb\");It gave me error as below:Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target\n at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)\n at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)\n at java.base/java.security.cert.CertPathBuilder.build(CertPathBuilder.java:297)\n at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:383)\n ... 43 moreEven triedTLS_RSA_WITH_AES_256_CBC_SHA256instead ofTLS_RSA_WITH_AES_128_CBC_SHA256but no luckThanks @JoshMc for input, I converted .kdb to .jks format, but I am getting error as below, for reference I pasted complete console output below:New code://commented useIBMCipherMappings to use default value of true\n//System.setProperty(\"com.ibm.mq.cfg.useIBMCipherMappings\", \"false\");\n \nSystem.setProperty(\"javax.net.ssl.keyStore\", \"C:\\\\ibm_mq\\\\jks\\\\target.jks\");\n \n System.setProperty(\"javax.net.ssl.keyStoreType\", \"JKS\");Console output of error:Exception in thread \"main\" com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2400'.\n at com.ibm.mq.MQManagedConnectionJ11.constructMQCD(MQManagedConnectionJ11.java:1418)\n at com.ibm.mq.MQManagedConnectionJ11.constructCNO(MQManagedConnectionJ11.java:1511)\n at com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:237)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnection(MQClientManagedConnectionFactoryJ11.java:450)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnection(MQClientManagedConnectionFactoryJ11.java:487)\n at com.ibm.mq.StoredManagedConnection.(StoredManagedConnection.java:97)\n at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:194)\n at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:874)\n at com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:822)\n at com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:764)\n at com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:200)\n at com.ibm.mq.MQQueueManager.(MQQueueManager.java:871)\n at IBMMQClient.main(IBMMQClient.java:64)Why I am getting return code 2400 mentioning unsupported cipher suite:$ mqrc 2400\n\n 2400 0x00000960 MQRC_UNSUPPORTED_CIPHER_SUITEI tried with cipher suite:TLS_RSA_WITH_AES_128_CBC_SHA256andTLS_RSA_WITH_AES_256_CBC_SHA256both .If I keepSystem.setProperty(\"com.ibm.mq.cfg.useIBMCipherMappings\", \"false\")Then it gives different error:javax.net.ssl|DEBUG|10|main|2023-03-06 12:32:03.317 IST|SSLCipher.java:466|jdk.tls.keyLimits: entry = AES/GCM/NoPadding KeyUpdate 2^37. AES/GCM/NOPADDING:KEYUPDATE = 137438953472\njavax.net.ssl|ERROR|10|main|2023-03-06 12:32:04.154 IST|TransportContext.java:363|Fatal (CERTIFICATE_UNKNOWN): PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target (\n\"throwable\" : {\n sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target\n at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:388)Note: In my opinion useIBMCipherMappings should be default i.e. true hence I kept it commented(removed from code):import com.ibm.mq.*;\nimport com.ibm.mq.constants.*;\nimport com.ibm.mq.headers.*;\nimport com.ibm.msg.client.wmq.common.*;\n\npublic class IBMMQClient {\n public static void main(String[] args) throws Exception {\n System.setProperty(\"javax.net.debug\", \"ssl\");\n\n System.setProperty(\"javax.net.ssl.keyStore\", \"C:\\\\ibm_mq\\\\jks\\\\target.jks\");\n \n System.setProperty(\"javax.net.ssl.keyStoreType\", \"JKS\");\n \n System.setProperty(\"javax.net.ssl.keyStorePassword\", \"gen@123\");\n \n MQEnvironment.hostname = \"********\";//removed hostname for privacy\n MQEnvironment.port = 1419; // set the port number of the queue manager\n\n MQEnvironment.channel = \"MYSSL.SVRCONN\"; // set the channel name\n\n\n MQEnvironment.userID = \"myuser\";\n \n MQEnvironment.sslCipherSuite = \"TLS_RSA_WITH_AES_256_CBC_SHA256\";\n \n MQQueueManager qMgr = new MQQueueManager(\"MYSSL\");\n System.out.println(\"Connected to \" + qMgr.getName());\n qMgr.disconnect();\n }\n}Also I made sure my channel is properly configured with expected cipher suite :SSLCIPH(TLS_RSA_WITH_AES_256_CBC_SHA256)By command :ALTER CHL(MYSSL.SVRCONN) CHLTYPE(SVRCONN) SSLCIPH(TLS_RSA_WITH_AES_256_CBC_SHA256)\n\nREFRESH SECURITY TYPE(SSL)bash-4.2$ runmqsc MYSSL\n5724-H72 (C) Copyright IBM Corp. 1994, 2020.\nStarting MQSC for queue manager MYSSL.\n\n\ndis CHL(MYSSL.SVRCONN)\n 1 : dis CHL(MYSSL.SVRCONN)\nAMQ8414I: Display Channel details.\n CHANNEL(MYSSL.SVRCONN) CHLTYPE(SVRCONN)\n ALTDATE(2023-03-03) ALTTIME(10.57.24)\n CERTLABL( ) COMPHDR(NONE)\n COMPMSG(NONE) DESCR( )\n DISCINT(0) HBINT(300)\n KAINT(AUTO) MAXINST(999999999)\n MAXINSTC(999999999) MAXMSGL(4194304)\n MCAUSER( ) MONCHL(QMGR)\n RCVDATA( ) RCVEXIT( )\n SCYDATA( ) SCYEXIT( )\n SENDDATA( ) SENDEXIT( )\n SHARECNV(10) SSLCAUTH(REQUIRED)\n SSLCIPH(TLS_RSA_WITH_AES_256_CBC_SHA256)\n SSLPEER( ) TRPTYPE(TCP)Also I made sure the cipher is supported by my JVM , by following below link:https://confluence.atlassian.com/stashkb/list-ciphers-used-by-jvm-679609085.htmlAnd TLS_RSA_WITH_AES_256_CBC_SHA256 is supported by my java version .TLS settings details:bash-4.2$ cd /var/mqm/qmgrs/MYSSL/ssl/\nbash-4.2$ ls -al\ntotal 36\ndrwxrws--- 2 mqm mqm 4096 Mar 3 06:35 .\ndrwxrwsr-x 25 mqm mqm 4096 Mar 3 05:09 ..\n-rw------- 1 mqm mqm 88 Mar 3 06:27 mysslkey.crl\n-rw------- 1 mqm mqm 10088 Mar 3 06:28 mysslkey.kdb\n-rw------- 1 mqm mqm 88 Mar 3 06:27 mysslkey.rdb\n-rw------- 1 mqm mqm 193 Mar 3 06:27 mysslkey.sth\n-rw------- 1 mqm mqm 749 Mar 3 06:27 mysslpub.arm\n\n\nrunmqsc MYSSL\nALTER QMGR SSLKEYR('/var/mqm/qmgrs/MYSSL/ssl/mysslkey')\n\nALTER CHL(MYSSL.SVRCONN) CHLTYPE(SVRCONN) SSLCIPH(TLS_RSA_WITH_AES_256_CBC_SHA256)runmqsc MYSSL\n\nDIS QMGR\n 3 : DIS QMGR\nAMQ8408I: Display Queue Manager details.\n QMNAME(MYSSL) ACCTCONO(DISABLED)\n ACCTINT(1800) ACCTMQI(OFF)\n ACCTQ(OFF) ACTIVREC(MSG)\n ACTVCONO(DISABLED) ACTVTRC(OFF)\n ADVCAP(ENABLED) ALTDATE(2023-03-03)\n ALTTIME(04.45.30) AMQPCAP(YES)\n AUTHOREV(DISABLED) CCSID(1208)\n CERTLABL(ibmwebspheremqmyssl) CERTVPOL(ANY)\n CHAD(DISABLED) CHADEV(DISABLED)\n CHADEXIT( ) CHLEV(DISABLED)\n CHLAUTH(ENABLED) CLWLDATA( )\n CLWLEXIT( ) CLWLLEN(100)\n CLWLMRUC(999999999) CLWLUSEQ(LOCAL)\n CMDEV(DISABLED) CMDLEVEL(920)\n COMMANDQ(SYSTEM.ADMIN.COMMAND.QUEUE) CONFIGEV(DISABLED)\n CONNAUTH(SYSTEM.DEFAULT.AUTHINFO.IDPWOS)\n CRDATE(2023-03-03) CRTIME(04.24.33)\n CUSTOM( ) DEADQ( )\n DEFCLXQ(SCTQ) DEFXMITQ( )\n DESCR( ) DISTL(YES)\n IMGINTVL(60) IMGLOGLN(OFF)\n IMGRCOVO(YES) IMGRCOVQ(YES)\n IMGSCHED(MANUAL) INHIBTEV(DISABLED)\n IPADDRV(IPV4) LOCALEV(DISABLED)\n LOGGEREV(DISABLED) MARKINT(5000)\n MAXHANDS(256) MAXMSGL(4194304)\n MAXPROPL(NOLIMIT) MAXPRTY(9)\n MAXUMSGS(10000) MONACLS(QMGR)\n MONCHL(OFF) MONQ(OFF)\n PARENT( ) PERFMEV(DISABLED)\n PLATFORM(UNIX) PSMODE(ENABLED)\n PSCLUS(ENABLED) PSNPMSG(DISCARD)\n PSNPRES(NORMAL) PSRTYCNT(5)\n PSSYNCPT(IFPER) QMID(MYSSL_2023-03-03_04.24.33)\n REMOTEEV(DISABLED) REPOS( )\n REPOSNL( ) REVDNS(ENABLED)\n ROUTEREC(MSG) SCHINIT(QMGR)\n SCMDSERV(QMGR) SPLCAP(ENABLED)\n SSLCRLNL( ) SSLCRYP( )\n SSLEV(DISABLED) SSLFIPS(NO)\n SSLKEYR(/var/mqm/qmgrs/MYSSL/ssl/mysslkey)\n SSLRKEYC(0) STATACLS(QMGR)\n STATCHL(OFF) STATINT(1800)\n STATMQI(OFF) STATQ(OFF)\n STRSTPEV(ENABLED) SUITEB(NONE)\n SYNCPT TREELIFE(1800)\n TRIGINT(999999999) VERSION(09020000)\n XRCAP(YES)\n\ndis CHL(MYSSL.SVRCONN) ALL\n 4 : dis CHL(MYSSL.SVRCONN) ALL\nAMQ8414I: Display Channel details.\n CHANNEL(MYSSL.SVRCONN) CHLTYPE(SVRCONN)\n ALTDATE(2023-03-03) ALTTIME(10.57.24)\n CERTLABL( ) COMPHDR(NONE)\n COMPMSG(NONE) DESCR( )\n DISCINT(0) HBINT(300)\n KAINT(AUTO) MAXINST(999999999)\n MAXINSTC(999999999) MAXMSGL(4194304)\n MCAUSER( ) MONCHL(QMGR)\n RCVDATA( ) RCVEXIT( )\n SCYDATA( ) SCYEXIT( )\n SENDDATA( ) SENDEXIT( )\n SHARECNV(10) SSLCAUTH(REQUIRED)\n SSLCIPH(TLS_RSA_WITH_AES_256_CBC_SHA256)\n SSLPEER( ) TRPTYPE(TCP)Regards,\nAmit M### Assistant: Java clients can not use a kdb (CMS) key store. You can use either a jks (Java Key store) or pkcs12 (pfx or p12) key store.This answer provides a method to create a jks from a kdb:KDB to JKS keystore conversion\n"} +{"text": "### Human: I had a problem in implementation of dead letter queue in IBM MQ in .net6.\nI am using IBMMQDotnetClient library from nuGet. The problem is that when we face to any message which is not successfully commited, the message from queue continues in while(true).\nI want to get the message to dead letter queue and continue to next messages from the queue.\nhow can I use dead letter queue for this issue in .net6 project ?### Assistant: When you use XMS you get the IBM MQ XMS library handling of backout threshold and backout.Seehttps://www.ibm.com/docs/en/ibm-mq/latest?topic=consumers-poison-messages-in-xmsYou need to setBOTHRESHandBOQUEUEfor your queue. This will be an MQ admin job. Then when read attempts for any message exceed the threshold the message is requeued to the backout queue. If the requeuing fails for any reason, the message is removed from the input queue and either requeued to the dead-letter queue, or discarded.The only code change needed is to signal when a message can't be processed. You will need to transaction enable the session.sessionWMQ = connectionWMQ.CreateSession(true, AcknowledgeMode.SessionTransacted);commit good messagessessionWMQ.Commit();rollback (and signal a read failure) bad messagessessionWMQ.Rollback();To get you started there is a set of XMS samples that don't have transactions enabled athttps://github.com/ibm-messaging/mq-dev-patterns/tree/master/dotnet\n"} +{"text": "### Human: We are currently having an issue with an MQ Cluster were a CLUSSDR channel is going into retry as the receiving MQ object is showing as damaged.Configuration is many QMGR's (STAT00-11) sending messages to the Cluster of 4 QMGR's, 2 FullRepos (HUB01-02 and 2PartialRepos HUB03-04)Problem is that on the STAT02 QMGR the CLUSSDR channel to HUB01 is in a retry state\nwith the MQ log error;AMQ9506: Message receipt confirmation failed.and on HUB01 the MQ log errors;AMQ7472: Object %CHLBATCH.706, type scratchpad damaged. (many)AMQ9999: Channel 'TO_HUB01' to host 'server02 (n.n.n.n)' ended abnormally.AMQ9588: Program cannot update queue manager object. (single instance)AMQ9587: Program cannot open queue manager object (many)I have now stopped the CLUSSDR on STAT02 to HUB01 and there is no longer any log entries, however as the QMGR's have linear logging the log files are not being released on the HUB01 QMGRthis has introduced a new errorAMQ7084: Object syncfile, type syncfile damaged.which is filling up the disk.I have so far tried to recover the damaged object, the command used was on the HUB01 QMGRrcrmqobj -m HUB01 -t channel TO_STAT02and this returned the result,AMQ7085: Object TO_STAT02, type channel not found., although the following results contradict this;DIS CLUSQMGR(STAT*) CHANNELoutputs a list of all the STAT* QMGR's which includes the TO_STAT02 channeland the channel statusDIS CHS(TO_STAT*) STATUSshows all the channels in a RUNNING state, including the supposed non-existent TO_STAT02Anyone had similar issues please, note that this is the second occurrence we have had in the last month to different clusters and last time we had to take the drastic action of rebuilding the QMGR once the disk space was exhausted and the QMGR crashed### Assistant: rcrmqobj -m HUB01 -t syncfileis the correct way to rebuild a corrupt syncfile and if using linear logging this will also repair any damaged scratchpad objects. Damaged scratchpad objects should only ever occur through operational or filesystem error, for example if files were deleted or partially restored from backup and so having a large number is something that you should try and identify the root cause.rcrmqobj -t channelwill be able to recover damage to channel object definitions, but it is the synchronization data and its index (syncfile) that is damaged/missing. TO_STAT02 sounds like it is a cluster sender that MQ clustering maintains from information shared within the cluster - you can check on whether a cluster channel has a local channel definition using DEFTYPE on DISPLAY CLUSQMGR.\n"} +{"text": "### Human: I am trying to retrieve some XML messages as a readable string straight from IBM MQ, AND render them on a UI.I used the following code and I get the error. GET Exception: com.IBM.mq.MQException: MQJE001: Completion Code '1', Reason '2110'.What changes could I possibly make to get the messages back as a string? However, when the messages are of the format MQSTR they are rendered on the UI.MQQueueManager _queueManager = null;\n int port = inputPort;\n String hostname = host;\n String channel = chanel;\n String qManager = queuemanager;\n String inputQName = queuename;\n\n MQEnvironment.hostname = hostname;\n MQEnvironment.channel = channel;\n MQEnvironment.port = port;\n\n _queueManager = new MQQueueManager(qManager);\n\n\n int openOptions = MQC.MQOO_INQUIRE + MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_BROWSE;\n\n\n MQQueue queue = _queueManager.accessQueue( inputQName,\n openOptions,\n null, // default q manager\n null, // no dynamic q name\n null ); // no alternate user id\n\n System.out.println(\"MQRead is now connected.\\n\");\n int depth = queue.getCurrentDepth();\n System.out.println(\"Current depth: \" + depth + \"\\n\");\n\n if (depth == 0)\n {\n System.out.println(\"Depth is zero\");\n }\n\n MQGetMessageOptions getOptions = new MQGetMessageOptions();\n getOptions.options = MQC.MQGMO_NO_WAIT + MQC.MQGMO_FAIL_IF_QUIESCING + MQC.MQGMO_CONVERT + MQC.MQGMO_BROWSE_NEXT;\n\n ArrayList myMessages = new ArrayList<>();\n\n while(true)\n {\n MQMessage message = new MQMessage();\n\n\n try\n {\n queue.get(message, getOptions);\n byte[] b = new byte[message.getMessageLength()];\n message.readFully(b);\n\n\n System.out.println (new MQHeaderList (message, false));\n\n String newMessage = new String(b);\n MessageDTO newMsg = new MessageDTO();\n newMsg.setMessage(newMessage);\n Random rand = new Random();\n newMsg.setMessageNumber(rand.nextInt());\n\n\n myMessages.add(newMsg);\n\n\n model.addAttribute(\"myMessages\", myMessages);\n System.out.println(myMessages);\n message.clearMessage();\n }\n catch (IOException e)\n {\n System.out.println(\"IOException during GET: \" + e.getMessage());\n break;\n }\n catch (MQException e)\n {\n if (e.completionCode == 2 && e.reasonCode == MQException.MQRC_NO_MSG_AVAILABLE) {\n if (depth > 0)\n {\n System.out.println(\"All messages read.\");\n }\n }\n else\n {\n System.out.println(\"GET Exception: \" + e);\n }\n break;\n } catch (MQDataException e) {\n e.printStackTrace();\n }\n\n\n }\n queue.close();\n _queueManager.disconnect();\n }\n\n}```### Assistant: I hope this helps someone one day, but the issue was caused by a format error, I ended up using the RFHUtil and changed the message format to to MQSTR and I got my messages back as desired.\n"} +{"text": "### Human: Got a small spring-boot messaging app that receives a message from the queue and inserts/updates a row in DB2 table. Noticed this week it received lot of messages but consumption was very slow that msgs filling the disk (infra complained about it). How could we improve the reading of the messages from the queue faster?JMS Config...\n ...\n @Bean\n public MQXAConnectionFactory mqxaQueueConnectionFactory() {\n MQXAConnectionFactory mqxaConnectionFactory = new MQXAConnectionFactory();\n log.info(\"Host: {}\", host);\n log.info(\"Port: {}\", port);\n log.info(\"Channel: {}\", channel);\n log.info(\"Timeout: {}\", receiveTimeout);\n try {\n mqxaConnectionFactory.setHostName(host);\n mqxaConnectionFactory.setPort(port);\n mqxaConnectionFactory.setQueueManager(queueManager);\n if (channel != null && !channel.trim().isEmpty()) {\n mqxaConnectionFactory.setChannel(channel);\n }\n mqxaConnectionFactory.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n } catch (JMSException e) {\n throw new RuntimeException(e);\n }\n return mqxaConnectionFactory;\n }\n\n @Bean\n public CachingConnectionFactory cachingConnectionFactory(MQXAConnectionFactory mqxaConnectionFactory) {\n CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory();\n cachingConnectionFactory.setTargetConnectionFactory(mqxaConnectionFactory);\n cachingConnectionFactory.setSessionCacheSize(this.sessionCacheSize);\n cachingConnectionFactory.setCacheConsumers(this.cacheConsumers);\n cachingConnectionFactory.setReconnectOnException(true);\n return cachingConnectionFactory;\n }\n\n @Bean\n @Primary\n public SingleConnectionFactory singleConnectionFactory(MQXAConnectionFactory mqxaConnectionFactory) {\n SingleConnectionFactory singleConnectionFactory = new SingleConnectionFactory(mqxaConnectionFactory);\n singleConnectionFactory.setTargetConnectionFactory(mqxaConnectionFactory);\n singleConnectionFactory.setReconnectOnException(true);\n return singleConnectionFactory;\n }\n\n @Bean\n public PlatformTransactionManager platformTransactionManager(CachingConnectionFactory cachingConnectionFactory) {\n return new JmsTransactionManager(cachingConnectionFactory);\n }\n\n @Bean\n public JmsOperations jmsOperations(CachingConnectionFactory cachingConnectionFactory) {\n JmsTemplate jmsTemplate = new JmsTemplate(cachingConnectionFactory);\n jmsTemplate.setReceiveTimeout(receiveTimeout);\n return jmsTemplate;\n }\n\n @Bean\n public DefaultJmsListenerContainerFactory defaultJmsListenerContainerFactory(PlatformTransactionManager transactionManager,\n @Qualifier(\"singleConnectionFactory\") SingleConnectionFactory singleConnectionFactory) {\n EnhancedJmsListenerContainerFactory factory = new EnhancedJmsListenerContainerFactory();\n factory.setConnectionFactory(singleConnectionFactory);\n factory.setTransactionManager(transactionManager);\n factory.setConcurrency(concurrency);\n factory.setSessionAcknowledgeMode(Session.CLIENT_ACKNOWLEDGE);\n factory.setSessionTransacted(true);\n factory.setMaxMessagesPerTask(this.messagesPerTask);\n factory.setIdleTaskExecutionLimit(this.idleTaskExecutionLimit);\n return factory;\n }\n ...\n ...We moved from CachingConnectionFactory to SingleConnectionFactory since it opened too many queue connections.Queue Listener@Transactional\n@Slf4j\n@Component\n@Profile(\"!thdtest\")\npublic class QueueListener {\n private CatalogStatusDataProcessor catalogStatusDataProcessor;\n private HostToDestDataAckProcessor hostToDestDataAckProcessor;\n\n @Autowired\n public QueueListener(CatalogStatusDataProcessor catalogStatusDataProcessor, HostToDestDataAckProcessor hostToDestDataAckProcessor) {\n this.catalogStatusDataProcessor = catalogStatusDataProcessor;\n this.hostToDestDataAckProcessor = hostToDestDataAckProcessor;\n }\n\n @JmsListener(destination = \"${project.mq.queue}\", containerFactory = \"defaultJmsListenerContainerFactory\")\n public void onMessage(MAOMessage message) throws Exception {\n\n String messageString = message.getStringMessagePayload();\n try {\n if (log.isDebugEnabled())\n log.debug(\"Message received = \"+messageString);\n StopWatch sw = new StopWatch(\"Received message\");\n sw.start();\n Object obj= XMLGenerator.generateTOfromXML(messageString);\n if(obj instanceof ResponseTO){\n catalogStatusDataProcessor.processCatalogStatusInfo((ResponseTO)obj);\n }\n else if(obj instanceof HostToStoreDataAckWrapper){\n hostToDestDataAckProcessor.processHostToDestDataACK(messageString);\n }\n sw.stop();\n log.info(\"Message is processed in = \"+sw.getTotalTimeSeconds() +\" seconds\");\n } catch (Exception e) {\n log.error(\"Exception in processing message: {}\", e);\n throw e;\n }\n }\n}Tried changing the concurrency settings from 2-4 to 4-6 and it didn't improve much.\nUsing spring-boot 1.5.4.RELEASE, JdK8, javax.jms 2.0.1, MQ allclient 9.0### Assistant: How do you know this is an MQ problem, In my experience (MQ performance) most performance problems were due to the other processing for example\nMQGET(fast) database update(slow).. commit.I would put some code around the various components, and time them. For exampleGet time1\nMQGET\nGet time2calculate time2 - time 1\nif delta > 10 ms report this ( or add it to a global counter)do database work\nget time 3\ncalculate time 3 - time 2If delta > 10 ms report this (or add it to a global counter).If this does not report any problems, drop the time from 10ms to 2 ms.If this does not report any problems, try adding additional instances of your program, as it could be that work is coming in faster than one thread can process it.I've also seen reducing threads helped! When they did a database insert/update this caused contention and threads were all waiting on the thread holding the lock- you would see this from the long database times.As a first step you could turn on some MQ traces to report how long the MQ calls take.... but adding the code I mentioned is good practice - especially if they problems is else where.\n"} +{"text": "### Human: I am using a message worfklow made of of message-driven-channel-adapter => channel => outbound-channel-adapter. Its purpose is to transport messages from a MqSeries broker to another MQSeries broker. It's transactionnal (ack required)The relevant part of it is below (some parts are obvisously missing. If you think they are required, I will edit my post and add them).My problem is about message headers, and specificallymsgId.\nWhen I put a message with a messageId in the inbound queue, I expect it to remain the same through the whole pipeline.But instead the messageId is transformed in the outbound queue, with its content being replaced by a generated ID including outbound queue mananager name.From the emitter (it's only an exemple for a possible emitting code. I have the same problem from every code I used, as long as I provide a msgId):com.ibm.mq.MQMessage message = new MQMessage(); \nmessage.messageId=(\"TEST MessageId 1234\").getBytes();And from MQExplorer :From Inbound Queue : MessageId = TEST MessageId 1234From Outbound Queue : MessageId = AMQ There may be a obvious (but not for me) reason, but I don't get it now.\nI read (well?) that themessage Idcan be generated by the QM from specific scenarii, or specific commands.\nBut I don't see how it does apply in spring integration.Any one has an idea on how Spring Integration handles messageId and how I can retain the same through my whole pipeline?\n \n \n\n \n \n \n ... \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n ...\n \n \n \n \n\n \n\nEdit 1:Following @artem-bilan advice, I set up a header-enricher.\nBut atm, this is not working at all... None of the properties are set up.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Edit 2:\nafter some research, we found anIBM docstating that\"To be able to set the Message ID, the JMS destination queue needs to have the property 'MQMD WRITE ENABLE\" set to ENABLED. This property allows a JMS application to set the value of the MQMD fields.\"So we tried to set this property from our JmsQueue :\n ...\n \n \n Unfortunately, although it was promising, this did not work for the messageId (but other MQMD fields work).Edit3 :Following Artem Bilan advice on debugging JmsHeaderMapper, sounds like we found out that byte array is not supported by the header mapper (spring integration version : 5.3.2.RELEASE), but expected by IBM... which leads to header being basically skipped.\nThus, this will not work that way:Edit 4:After noticing that current version of spring-integration-jms not accepting \"byte[]\" type (which is IBM MSGID type), we added a custom header mapper. It worked but we had to retrieved (hex to byte) it from already-mapped message (looking like \"ID:3214F1044...\") and passing it as a byte array into the header as a \"JMS_IBM_MQMD_MsgId\" property.\nAnd this was a dubious solution because of the triple conversion (MQ [BYTE24] => JMS [ID:String] => Java [Byte[]] => MQ[BYTE24] )Eventually, we found out that the inbound queue, as well as the outbound one, can be configured such as they will pass all context (jms-mapped headers as well as raw MQ ones). Thus, we don't have to do complex mapping.... only basic mapping (since byte[] are still not mapped in defaultHeaderMapper).So the final solution is:\n ...\n \n \n\n\n\n ...\n \n \n\n\n\n \n\n... \n_public class MqCompatibleJmsHeaderMapper extends DefaultJmsHeaderMapper {\n...\n public void fromHeaders(MessageHeaders headers, Message jmsMessage) {\n Object messageId = headers.get(WMQConstants.JMS_IBM_MQMD_MSGID);\n if(messageId !=null) {\n if (messageId instanceof byte[]) {\n jmsMessage.setObjectProperty(WMQConstants.JMS_IBM_MQMD_MSGID, messageId);\n }else {\n ...\n }\n }\n super.fromHeaders(headers, jmsMessage);\n }\n\n...\n}### Assistant: It didn't seen that obvious to me.... do you mean that the behavior is \"normal\" and that I should use a headerMapper to change it, ie remove the \"jms_\" prefix?Well, that header is mapped in theDefaultJmsHeaderMapperlike this:headers.put(JmsHeaders.MESSAGE_ID, messageId);. So, it indeed comes as ajms_messageId. And it is really not mapped on the outbound side:if (StringUtils.hasText(headerName) &&\n !headerName.startsWith(JmsHeaders.PREFIX) &&\n jmsMessage.getObjectProperty(headerName) == null) {I think there was a reason to ignore them since not all JMS vendors allows to override all thoseorg.springframework.jms.support.JmsHeaders.For your use-case you can do this before:\n
\n\n"} +{"text": "### Human: Good Day,I am struggling with below error when trying to connect to IBM MQ. Unable to access createContext(); and forces me to use(JMSContext) cf.createConnection();which is resulting me error as below:\n\"Exception in thread \"main\" java.lang.ClassCastException: com.ibm.mq.jms.MQConnection cannot be cast to javax.jms.JMSContext\nat pushmsgs.main(pushmsgs.java:55)\"import com.ibm.msg.client.jms.JmsConnectionFactory;\nimport com.ibm.msg.client.jms.JmsFactoryFactory;\nimport com.ibm.msg.client.wmq.WMQConstants;\n\nimport javax.jms.*;\n\npublic class pushmsgs {\n\n // System exit status value (assume unset value to be 1)\n private static int status = 1;\n\n // Create variables for the connection to MQ\n private static final String HOST = \"22.188.133.100\"; // Host name or IP address\n private static final int PORT = 3415; // Listener port for your queue manager\n private static final String CHANNEL = \"DEV.APP.SVRCONN\"; // Channel name\n private static final String QMGR = \"SITQUEUEMGR\"; // Queue manager name\n // private static final String APP_USER = \"app\"; // User name that application uses to connect to MQ\n //private static final String APP_PASSWORD = \"_APP_PASSWORD_\"; // Password that the application uses to connect to MQ\n private static final String QUEUE_NAME = \"TESTQUEUE.MQAPP.REQ.RCV\"; // Queue that the application uses to put and get messages to and from\n\n\n /**\n * Main method\n *\n * @param args\n */\n public static void main(String[] args) {\n\n // Variables\n JMSContext context = null;\n Destination destination = null;\n JMSProducer producer = null;\n JMSConsumer consumer = null;\n\n\n\n try {\n // Create a connection factory\n JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\n JmsConnectionFactory cf = ff.createConnectionFactory();\n\n // Set the properties\n cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, HOST);\n cf.setIntProperty(WMQConstants.WMQ_PORT, PORT);\n cf.setStringProperty(WMQConstants.WMQ_CHANNEL, CHANNEL);\n cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\n cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, QMGR);\n // cf.setStringProperty(WMQConstants.WMQ_APPLICATIONNAME, \"JmsPutGet (JMS)\");\n //cf.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, true);\n // cf.setStringProperty(WMQConstants.USERID, APP_USER);\n //cf.setStringProperty(WMQConstants.PASSWORD, APP_PASSWORD);\n //cf.setStringProperty(WMQConstants.WMQ_SSL_CIPHER_SUITE, \"*TLS12\");\n\n // Create JMS objects\n context = (JMSContext) cf.createConnection();\n destination = context.createQueue(\"queue:///\" + QUEUE_NAME);\n\n long uniqueNumber = System.currentTimeMillis() % 1000;\n TextMessage message = context.createTextMessage(\"Your lucky number today is \" + uniqueNumber);\n\n producer = context.createProducer();\n producer.send(destination, message);\n System.out.println(\"Sent message:\\n\" + message);\n\n context.close();\n\n recordSuccess();\n } catch (JMSException jmsex) {\n recordFailure(jmsex);\n }\n\n System.exit(status);\n\n } // end main()\n\n /**\n * Record this run as successful.\n */\n private static void recordSuccess() {\n System.out.println(\"SUCCESS\");\n status = 0;\n return;\n }\n\n /**\n * Record this run as failure.\n *\n * @param ex\n */\n private static void recordFailure(Exception ex) {\n if (ex != null) {\n if (ex instanceof JMSException) {\n processJMSException((JMSException) ex);\n } else {\n System.out.println(ex);\n }\n }\n System.out.println(\"FAILURE\");\n status = -1;\n return;\n }\n\n /**\n * Process a JMSException and any associated inner exceptions.\n *\n * @param jmsex\n */\n private static void processJMSException(JMSException jmsex) {\n System.out.println(jmsex);\n Throwable innerException = jmsex.getLinkedException();\n if (innerException != null) {\n System.out.println(\"Inner exception(s):\");\n }\n while (innerException != null) {\n System.out.println(innerException);\n innerException = innerException.getCause();\n }\n return;\n }\n\n}Added JMS mvn dependency and com.ibm.mq.allclient dependency### Assistant: It's because you are assigning the wrong object to the wrong variable.context = (JMSContext) cf.createConnection();I don't know why you would want to do that. A connection is not a context.It should be:Connection conn = cf.createConnection(\"MyUserId\", \"mypassword\");See my example called MQTestJMS51here.\n"} +{"text": "### Human: I am trying to consume/write to a messaging queue in Quarkus, but have been unable to do so. I have an example code with which I can connect to the queue but it is made with the com.ibm.mq.allclient library based on javax.jms,\n com.ibm.mq\n com.ibm.mq.allclient\n 9.0.4.0\n and to connect use the parameters: hostname, port, name, channel, queuename.The example code, using the com.ibm.mq.allclient library to create the connections for consumption and writing, is as follows:import com.ibm.mq.jms.MQQueue;\nimport com.ibm.mq.jms.MQQueueConnection;\nimport com.ibm.mq.jms.MQQueueConnectionFactory;\nimport com.ibm.mq.jms.MQQueueSession;\n\nimport javax.jms.Message;\nimport javax.jms.MessageConsumer;\nimport javax.jms.MessageProducer;\nimport javax.jms.TextMessage;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\npublic class MyClass {\n\n private static Logger logger = LoggerFactory.getLogger(MyClass.class);\n\n private MQQueueConnection connectionRq;\n private MQQueueConnection connectionRs;\n\n public void initConnection(){\n \n try {\n MQQueueConnectionFactory connectionFactoryRq = new MQQueueConnectionFactory();\n connectionFactoryRq.setHostName(\"localhost\");\n connectionFactoryRq.setPort(5672);\n connectionFactoryRq.setTransportType(1);\n connectionFactoryRq.setQueueManager(\"QM_NAME\");\n connectionFactoryRq.setChannel(\"CHANNEL\");\n\n MQQueueConnectionFactory connectionFactoryRs = new MQQueueConnectionFactory();\n connectionFactoryRs.setHostName(\"localhost\");\n connectionFactoryRs.setPort(5672);\n connectionFactoryRs.setTransportType(1);\n connectionFactoryRs.setQueueManager(\"QM_NAME\");\n connectionFactoryRs.setChannel(\"CHANNEL\");\n\n connectionRq = (MQQueueConnection) connectionFactoryRq.createQueueConnection();\n connectionRs = (MQQueueConnection) connectionFactoryRs.createQueueConnection();\n\n\n } catch (Exception e) {\n logger.info(e.getMessage());\n }\n }\n\n public String sendMessage(String msg, String correlativeId){\n \n String corId = null;\n MQQueueSession sessionRq = null;\n MQQueueSession sessionRs = null;\n MessageProducer producer = null;\n try {\n sessionRq = (MQQueueSession) connectionRq.createQueueSession(false, 1);\n MQQueue queueRq = (MQQueue) sessionRq.createQueue(\"queue:///QUEUENAME.RQ\");\n queueRq.setMessageBodyStyle(1);\n queueRq.setTargetClient(1);\n\n sessionRs = (MQQueueSession) connectionRs.createQueueSession(false, 1);\n MQQueue queueRs = (MQQueue) sessionRs.createQueue(\"queue:///QUEUENAME.RS\");\n\n producer = sessionRq.createProducer(queueRq);\n\n Message messageRq = sessionRq.createTextMessage(msg);\n messageRq.setJMSReplyTo(queueRs);\n messageRq.setIntProperty(\"JMS_IBM_Character_Set\", 819);\n messageRq.setIntProperty(\"JMS_IBM_Encoding\", 273);\n messageRq.setIntProperty(\"JMS_IBM_MsgType\", 8);\n messageRq.setJMSMessageID(correlativeId);\n messageRq.setJMSCorrelationIDAsBytes(correlativeId.getBytes());\n messageRq.setJMSPriority(1);\n messageRq.setJMSType(\"Datagram\");\n\n producer.send(messageRq);\n\n corId = messageRq.getJMSCorrelationID();\n } catch (Exception e) {\n logger.info(e.getMessage());\n } finally {\n try {\n sessionRq.close();\n } catch (Exception e) {\n logger.info(e.getMessage());\n }\n try {\n sessionRs.close();\n } catch (Exception e) {\n logger.info(e.getMessage());\n }\n try {\n producer.close();\n } catch (Exception e) {\n logger.info(e.getMessage());\n }\n }\n return corId;\n }\n\n public String consumerMessage(String correlativeId){\n\n String msg = null;\n MQQueueSession sessionRs = null;\n MessageConsumer consumer = null;\n try {\n sessionRs = (MQQueueSession) connectionRs.createQueueSession(false, 1);\n MQQueue queueRs = (MQQueue) sessionRs.createQueue(\"queue:///QUEUENAME.RS\");\n consumer = sessionRs.createConsumer(queueRs, \"JMSCorrelationID='\" + correlativeId + \"'\");\n connectionRs.start();\n Message messageRs = consumer.receive(10000L);\n msg = ((TextMessage) messageRs).getText();\n } catch (Exception e) {\n logger.info(e.getMessage());\n } finally {\n try {\n sessionRs.close();\n } catch (Exception e) {\n logger.info(e.getMessage());\n }\n try {\n consumer.close();\n } catch (Exception e) {\n logger.info(e.getMessage());\n }\n }\n return msg;\n }\n\n public static void main(String[] args) {\n MyClass myClass = new MyClass();\n myClass.initConnection();\n String corId = myClass.sendMessage(\"Test Message Send\", \"UNIQUE\");\n String message = myClass.consumerMessage(corId);\n logger.info(\"The message: \" + message);\n }\n}The code above works fine, the problem is that the library is not compatible with the native Quarkus compiler.For the connection with the MQ in Quarkus I am using the library:\n org.amqphub.quarkus\n quarkus-qpid-jms\n In the application.properties I assign:quarkus.qpid-jms.url=amqp://localhost:5672And when trying to run the sample project in:Quarkus Qpid JMS Quickstartthrows me the following error:__ ____ __ _____ ___ __ ____ ______ \n --/ __ \\/ / / / _ | / _ \\/ //_/ / / / __/ \n -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\\ \\ \n--\\___\\_\\____/_/ |_/_/|_/_/|_|\\____/___/ \n2022-03-17 12:02:31,489 INFO [org.acm.jms.PriceConsumer] (pool-11-thread-1) Writing MQ Client...\n2022-03-17 12:02:31,486 INFO [org.acm.jms.PriceConsumer] (pool-10-thread-1) Reading MQ Client...\n2022-03-17 12:02:31,757 INFO [io.quarkus] (Quarkus Main Thread) jms-quickstart 1.0.0-SNAPSHOT on JVM (powered by Quarkus 2.7.2.Final) started in 4.626s. Listening on: http://localhost:8080\n2022-03-17 12:02:31,758 INFO [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.\n2022-03-17 12:02:31,759 INFO [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, qpid-jms, resteasy, smallrye-context-propagation, vertx]\n2022-03-17 12:02:34,068 ERROR [org.apa.qpi.jms.JmsConnection] (pool-11-thread-1) Failed to connect to remote at: amqp://localhost:5672\n2022-03-17 12:02:34,068 ERROR [org.apa.qpi.jms.JmsConnection] (pool-10-thread-1) Failed to connect to remote at: amqp://localhost:5672I know that it is most likely a configuration error and I am missing something, but I am new to Quarkus and I have already read and tried so many things that I have already collapsed.I appreciate any kind of help as it would be great, or at least documentation or something to guide me is also welcome.Documentation consulted:Developing JMS apps with Quarkus and GraalVMUSING JMS### Assistant: You are getting a connection failure when you try to connect tolocalhost:5672. This implies that you do not have anything listening on that TCP/IP port. The instructions you reference have a template MQSC script which sets up the required resources needed on the queue manager to allow an AMQP connection. This script can be foundhere.The most pertinent commands within this script for your specific reported problem are likely these (although I suggest you run the whole script):START SERVICE(SYSTEM.AMQP.SERVICE)\nSTART CHANNEL(SYSTEM.DEF.AMQP)\n"} +{"text": "### Human: I am trying to understand some of the IBM MQ put options:I have usedhttps://www.ibm.com/docs/en/ibm-mq/9.2?topic=interfaces-mqputmessageoptionsnet-classfor documentation.It seems thatMQPMO_ASYNC_RESPONSEandMQPMO_SYNC_RESPONSEin fact are mutually exclusive, yet these options have to different ID's (bit 12 and bit 13). What does MQ do when both options are set or neither one is set?t seems thatMQPMO_SYNCPOINTandMQPMO_NO_SYNCPOINTin fact are mutually exclusive, yet these options have to different ID's (bit 2 and bit 3). What does MQ do when both options are set or neither one is set?MQPMO_RESPONSE_AS_Q_DEFmakes things even more confusing for me. As I understand from the documentation this bit defers the control of the requests being synchronous or asynchronous to the queue definition. Therefore ignorning the options set withMQPMO_ASYNC_RESPONSEandMQPMO_SYNC_RESPONSE. But the documentation states the followingFor an MQDestination.put call, this option takes the put response type from DEFPRESP attribute of the queue.\nFor an MQQueueManager.put call, this option causes the call to be made synchronously.And the documentation forDEFRESPathttps://www.ibm.com/docs/en/ibm-mq/9.1?topic=queues-defpresp-mqlongis stating this:The default put response type (DEFPRESP) attribute defines the value used by applications when the PutResponseType within MQPMO has been set to MQPMO_RESPONSE_AS_Q_DEF. This attribute is valid for all queue types.The value is one of the following:SYNC\nThe put operation is issued synchronously returning a response.ASYNC\nThe put operation is issued asynchronously, returning a subset of MQMD fields.But the other documentation says setting this option makes the call synchronous.So in short: What happens with the seemingly mutually exclusive options and what does theMQPMO_RESPONSE_AS_Q_DEFreally do?### Assistant: If you combine options flags that are not supposed to be combined, such asMQPMO_SYNCPOINTandMQPMO_NO_SYNCPOINTyou will be return MQRC_OPTIONS_ERROR on the MQPUT call. you can see the documentation for this in IBM Docshere.You are correct, the use ofMQPMO_RESPONSE_AS_Q_DEFtells the queue manager to take the value for Put Response from the queue attributeDEFPRESP. The queue manager will look up the queue definition, and if it isSYNCit will effectively useMQPMO_SYNC_RESPONSEand if it isASYNCit will effectively useMQPMO_ASYNC_RESPONSE.The documentation you pointed us to states the following:-MQC.MQPMO_RESPONSE_AS_Q_DEFFor an MQDestination.put call, this option takes the put response type from DEFPRESP attribute of the queue.For an MQQueueManager.put call, this option causes the call to be made synchronously.I don't know why it would be different depending on the class used, but I can tell you that if theMQPMO_RESPONSE_AS_Q_DEFmakes it to the queue manager it will change it as described above. This documentation suggests that the MQQueueManager class is changing it itself which is an odd decision.\n"} +{"text": "### Human: Any help or help would be greatly appreciated it!!\nI am running on Redhat Enterprise 7.3\nI ran the following:\n$usermod -aG wheel jadeite1000My userid is: jadeite1000\ncd /opt/mqm/bin\nI ran this command to tried to create queue \"TESTQM\" but get error:$sudo crtmqm TESTQMerror:\nAM17877E: You are not authorized to perform the requested operation.### Assistant: This is most likely due to the user used to issue the crtmqm command not being in the mqm group. See the article herehttps://www.ibm.com/docs/en/ibm-mq/9.2?topic=objects-authority-administer-mq-aix-linux-windows\n"} +{"text": "### Human: I'm trying to send a message to a IBM MQ queue from my spring boot service. I could send/receive the message from the IBM MQ installed on my laptop.However when I replaced the configuration to connect to the IBM MQ Cloud, this is not workingConfiguration is as follows:getting the following errorNote:I could telnet into the host & portI tried with the following for Username & PasswordWith APIKey & App NameMy IBM Username & Password### Assistant: It seems to be a known issue:The connection may be broken for a number of different reasons. The 2009 return code indicates that something prevented a successful connection to the Queue Manager. The most common causes for this are the following are:A firewall that is terminating the connectionAn IOException that causes the socket to be closedAn explicit action to cause the socket to be closed by one endThe queue manager is offlineThe maximum number of channels allowed by the queue manager are openA configuration problem in the Queue Connection Factory (QCF)Can you please try suggestions fromhere\n"} +{"text": "### Human: We are connecting to IBM MQ from Java client we have successfully established the connection when sslauth is set to optional SSLCAUTH(OPTIONAL). But when we change it to required SSLCAUTH(REQUIRED) we are gettingAMQ9637E: During handshake, the remote partner sent no certificateI have checked below linkConnecting to a Websphere MQ in Java with SSL/KeystoreT.Rob's answer mentions about \"the QMgr must have your application's self-signed cert or a CA root cert that signed your app's cert in its keystore\"and below link.Net and IBM MQ Managed connection SSL using pfx ca certwhich exactly quotes the exception/error that we are getting at Server / Queue Manager's end.(During handshake, the remote partner sent no certificate.)As quoted by Daniel in one the comment of above answer \"the MQ server needs all the CA certs of your certificate\". I feel this may be issue in my case too.My question isIn response section for AMQ9637E in IBM doc'shttps://www.ibm.com/docs/en/ibm-mq/9.0?topic=multiplatforms-amq9xxx-remoteIt is mentioned that \"Look at the key repository on the remote side of this channel, and make sure the appropriate certificates are present, with correct labels.\".Here I am not very much sure about what labels is referring to is it referring to Alias name that we have given to certificate ?### Assistant: Based on the labels you have a Java based application. Java does not use the cert label when selecting a cert to present, it picks a cert based on what signers the queue manager trusts. The queue manager must have the full signer chain in its key store for the java client to present a cert. If your cert is signed by an intermediate and then that is signed by a root you would need both in the queue manager key store.\n"} +{"text": "### Human: We have an existing C# XMS client that works pretty well and we are using amqmxmsstd.dll 9.1.3. Now that we decided to upgrade and use the Nuget Package to manage our dependency instead (https://www.nuget.org/packages/IBMXMSDotnetClient) we have tried with versions 9.1.4 through the latest 9.2.2 and for each test, we drop a message or a few on the queue, it picks them up, then we drop another after those are done being picked up and nothing. The messages just sit there. We have a connection exception listener and no problems there. Drop back to the 9.1.3 client and it works fine. Can't seem to find any documentation as to any changes from 9.1.3 as to why this would happen.We develop locally using the IBM MQ Container which is at MQ version 9.2.0.0. The 9.1.3 client works fine against it. Our production servers are at 9.1.3, so I suppose we can just keep the client at 9.1.3, but thought there may be some improvements, but fixes, etc.Any ideas?### Assistant: I think there is an APAR IT34722 that has gone in for this issue.See postIBM MQ XMS Message Listener fetching only the Messages which is already available in Queue and not a new one\n"} +{"text": "### Human: We faced a issue in production.A queue has curdepth of 176.but while taking backup,its showing only 170 messages . There is no uncommitted messages also.. why 6 messages are not getting backed up?Issued command:-dmpmqmsg -m -i -f When I checked using theamqsbcgsample program, I could see all 176 messages. 176 headers were there. There were no empty messages.### Assistant: A couple of thoughts:(1) From the time you issued the 'dis ql({qname})' command to you running the dmpmqmsg program, 6 messages could have been consumed by another program.(2) Those 6 messages could be expired messages.(3) Even though UNCOM has a value of 'NO', you can run the dspmqtrn program to see if there are any uncommitted messages:Internally coordinated:dspmqtrn -i -m {QMgrName}Externally coordinated:dspmqtrn -e -m {QMgrName}\n"} +{"text": "### Human: I have crafted code based on the Java DSL documentation for Spring Integration. When I run the code, I keep on getting the following warning, even though the logs also suggest that the message has been passed successfully to both subscribers.2021-03-04 17:21:25.589 WARN 46929 --- [enerContainer-1] bleJmsChannel$DispatchingMessageListener : Dispatcher has no subscribers for jms-channel 'application.jmsPublishSubscribeChannel'.\n\norg.springframework.integration.MessageDispatchingException: Dispatcher has no subscribers\n at org.springframework.integration.dispatcher.BroadcastingDispatcher.dispatch(BroadcastingDispatcher.java:153) ~[spring-integration-core-5.4.3.jar:5.4.3]\n at org.springframework.integration.jms.SubscribableJmsChannel$DispatchingMessageListener.onMessage(SubscribableJmsChannel.java:229) ~[spring-integration-jms-5.4.4.jar:5.4.4]\n at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:761) ~[spring-jms-5.3.3.jar:5.3.3]\n at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:699) ~[spring-jms-5.3.3.jar:5.3.3]\n at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:674) ~[spring-jms-5.3.3.jar:5.3.3]\n at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:318) ~[spring-jms-5.3.3.jar:5.3.3]\n at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:257) ~[spring-jms-5.3.3.jar:5.3.3]\n at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1189) ~[spring-jms-5.3.3.jar:5.3.3]\n at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1179) ~[spring-jms-5.3.3.jar:5.3.3]\n at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1076) ~[spring-jms-5.3.3.jar:5.3.3]\n at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]\n\n2021-03-04 17:21:26.598 INFO 46929 --- [ scheduling-1] o.s.integration.handler.LoggingHandler : GenericMessage [payload={\"Greeting\":\"Hello from Node at Thu Mar 04 2021 17:21:25 GMT+0000 (Greenwich Mean Time)\"}, headers={id=50ab26ae-7a3d-8a2e-f694-94928b5097d6, timestamp=1614878485580}]I have@EnableIntegrationon my application, and my pub / sub component looks like:import org.apache.commons.logging.Log;\nimport org.apache.commons.logging.LogFactory;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.integration.channel.BroadcastCapableChannel;\nimport org.springframework.integration.dsl.IntegrationFlow;\nimport org.springframework.integration.dsl.IntegrationFlows;\nimport org.springframework.integration.dsl.Pollers;\nimport org.springframework.integration.jms.dsl.Jms;\nimport org.springframework.messaging.Message;\nimport org.springframework.stereotype.Component;\n\nimport javax.jms.ConnectionFactory;\nimport java.util.concurrent.TimeUnit;\n\n@Component\npublic class MessageFlowPub {\n\n protected final Log logger = LogFactory.getLog(getClass());\n\n @Autowired\n private ConnectionFactory connectionFactory;\n\n @Bean\n public BroadcastCapableChannel jmsPublishSubscribeChannel() {\n return Jms.publishSubscribeChannel(connectionFactory)\n .destination(\"dev/\")\n .get();\n }\n\n @Bean\n public IntegrationFlow pubSubFlow() {\n return f -> f\n .publishSubscribeChannel(jmsPublishSubscribeChannel(),\n pubsub -> pubsub\n .subscribe(subFlow -> subFlow\n .channel(c -> c.queue(\"jmsPubSubBridgeChannel1\")))\n .subscribe(subFlow -> subFlow\n .channel(c -> c.queue(\"jmsPubSubBridgeChannel2\"))))\n .log()\n .handle(System.out::println)\n ;\n }\n\n @Bean\n public IntegrationFlow msgHandler1() {\n return IntegrationFlows.from(\"jmsPubSubBridgeChannel1\")\n .bridge(e -> e.poller(Pollers.fixedRate(1, TimeUnit.SECONDS, 20)))\n .log()\n .handle(System.out::println)\n .get();\n }\n\n @Bean\n public IntegrationFlow msgHandler2() {\n return IntegrationFlows.from(\"jmsPubSubBridgeChannel2\")\n .bridge(e -> e.poller(Pollers.fixedRate(1, TimeUnit.SECONDS, 20)))\n .log()\n .handle(System.out::println)\n .get();\n }\n \n}The warning message leads me to think that I am doing something fundamentally wrong here, but I can't see what.### Assistant: OK, I found what's the problem.You use a@Componentand@Beanmethods combination. More over you try to call one bean method from another:.publishSubscribeChannel(jmsPublishSubscribeChannel(). This is not possible outside of the@Configurationclass. The annotation config just with the@Componentis considered as \"lightweight\" and therefore we can't call bean methods from each other - they are just not proxied to supply a proper dependency injection via method call.This one should work for you as well:@Bean\npublic BroadcastCapableChannel jmsPublishSubscribeChannel() {\n return Jms.publishSubscribeChannel(connectionFactory)\n .destination(\"dev/\")\n .get();\n}\n\n@Bean\npublic IntegrationFlow pubSubFlow(BroadcastCapableChannel jmsPublishSubscribeChannel) {\n return f -> f\n .publishSubscribeChannel(jmsPublishSubscribeChannel,Please, read more about lightweight config andproxyBeanMethods = false:https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#beans-java-basic-concepts\n"} +{"text": "### Human: I need to mockIBM MQ managerfor load testing with auto-replay for some MQ applications.Are there instruments to do it? Maybe, several instruments for each operation - mock and auto-replay.Thank you.### Assistant: What exactly do you mean bymock IBM MQ manager?You cannot a fake queue manager. The best thing to do is to downloadIBM MQ for Developers(Linux or Windows) and set it up with what queues, channels, etc. you need. You can also downloadIBM MQ Advanced for Developers for Raspberry Pi.Now if you only meant that you want to simulate either server-side or client-side component getting or putting of messages via replaying of messages then have a look atMQ Visual Edit. MQ Visual Edit can off messages in a queue to an SQLite database file which includes both the MQMD and message data. Hence, later you can replay those same messages over and over again. Also, it has 4 different test servers built into it to simulate server-side or client-side components.\n"} +{"text": "### Human: We are trying to connect to IBM MQ from RHEL 8.3 using .net core 3.1 application.\nThe same code runs ok on Windows- we are able to connect to QM.We are facing an error that comes, as we believe, from openssl:---> Interop+OpenSsl+SslException:SSL Handshake failed with OpenSSL error - SSL_ERROR_SSL.\n---> Interop+Crypto+OpenSslCryptographicException: error:14094412:SSL routines:ssl3_read_bytes:sslv3 >alert bad certificate--- End of inner exception stack trace ---\nat Interop.OpenSsl.DoSslHandshake(SafeSslHandle context, Byte[] recvBuf, Int32 recvOffset, Int32 >recvCount, Byte[]& sendBuf, Int32& sendCount) in >/_/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs:line 278We can see that MQClient loaded certificates00000157 12:30:07.116059 536167.15 -----------{\nMQEncryptedSocket.MakeSecuredConnection()00000158 12:30:07.116425 536167.15 Created an instance of\nSSLStreams00000159 12:30:07.116466 536167.15 Setting current certificate\nstore as 'User'0000015A 12:30:07.116528 536167.15 Linux so use My & CurrentUser0000015B 12:30:07.116542 536167.15 Created store object to access\ncertificates\n0000015C 12:30:07.116780 536167.15 Opened store0000015D 12:30:07.116795 536167.15 Accessing certificate - ZZZZ0000015E 12:30:07.230836 536167.15 Number of certificates in the\nstore:50000015F 12:30:07.231092 536167.15 TLS12 supported - True00000160 12:30:07.233622 536167.15 Setting SslProtol as Tls1200000161 12:30:07.233652 536167.15 Starting SSL AuthenticationWe have unit test that verifies if cert of given subject exists in that store and it passes.What we've done already:We build openssl 1.1.1h and linked it system wide.We verified cert store. The cert we are using is validvar cert = x509Store2.Certificates.Find(X509FindType.FindBySubjectName, mockIbmMqOptions.MqCertificateLabel, true).Count;\n x509Store2.Close();\n x509Store2.Dispose();\n Assert.True(cert > 0);We ran the code on Windows with success.We searched for sslv3 alert bad certificate in openssl source and found nothing but statics with error code 1420 but not referenced.Any ideas?### Assistant: Thank you @JoshMc based onthis questionwe successfully managed to finish the handshake.\nI think this is a general solution for .net core on RHEL and IBM MQ Client libraries:Be sure that CA and Intermediate CA are stored in /usr/share/pki/ca-trust-source/anchors/ or /etc/pki/ca-trust/source/anchors/If your pfx contain certificates in certification pathEXPORT ONLY private key and public certBe sure to have Friendly Name set to some value.Add exported pfx to .net core key storecertificate-tool addSet CertificateLabel to match FriendlyName or set the friendly name to ibmwebspheremq\n"} +{"text": "### Human: We are setting up client app on linux to connect to remote mq on IBM i (old name- iSeries/AS400).mq client on linux on ppc64le servermq manager, channel & queue on IBM i (old name iSeries)python 3.7.3Firstpymqi.connectwas failing with error2393: MQRC_SSL_INITIALIZATION_ERROR.Here is 2393 error description:AMQ9641E: Remote CipherSpec error for channel 'SVRCHLSSL256' to host 'remote IBM I host here'\n(10.239.53.242)(1414)'.\n\nEXPLANATION:\nThe remote end of channel 'SVRCHLSSL256' on host 'remote IBM I host here'\n(1414)' has indicated a CipherSpec error 'SSLCIPH(' ') ->\nSSLCIPH(????)'. The channel did not start.\nACTION:\nCheck that the CipherSpec values specified on the SVRCHLSSL256 channel\ndefinition on both the local and remote system match. If necessary, review the\nqueue manager error logs on the remote system to discover more information\nabout the CipherSpec error. When using the the 'ANY' type CipherSpecs, check\nthat the Client CipherSpec value would meet the requirements of the\nSVRCHLSSL256 channel definition CipherSpec requirements. If the client is set\nto use the 'ANY' type CipherSpecs then the TLS handshake may use a higher\nprotocol than is allowed by the SVRCHLSSL256 channel definition CipherSpec.We fixed it by adding below to/var/mqm/mqclient.inifile.SSL:\n AllowedCipherSpecs=ANY_TLS12_OR_HIGHERBut nowpymqi.connectis failing with error2059: MQRC_Q_MGR_NOT_AVAILABLE. MQ manager & channel both are up & running on IBM i. so not sure why I am getting the error? I would appreciate your help to resolve this issue.Here is mynewcode snippet:queue_manager = 'quename here' \nchannel = 'channel name here' \nhost ='remote host-name here'\nport = '1414'\nconn_info = '%s(%s)' % (host, port)\nuser = 'user id here'\npassword = 'my pwd here'\nssl_cipher_spec = 'TLS_RSA_WITH_AES_256_CBC_SHA256'\nkey_repo_location = '/var/mqm/qmgrs/QM1/ssl'\n\ncd = pymqi.CD()\ncd.ChannelName = channel.encode()\ncd.ConnectionName = conn_info.encode()\ncd.ChannelType = pymqi.CMQC.MQCHT_CLNTCONN\ncd.TransportType = pymqi.CMQC.MQXPT_TCP\ncd.SSLCipherSpec = ssl_cipher_spec.encode()\n\nsco = pymqi.SCO()\nsco.KeyRepository = key_repo_location\n\n_MQmgr = pymqi.QueueManager(None)\n_MQmgr.connect_with_options(queue_manager, cd=cd, sco=sco, user=user, password=password)Old codequeue_manager = 'quename here' \nchannel = 'channel name here' \nhost ='remote host-name here'\nport = '1414'\nconn_info = '%s(%s)' % (host, port)\nuser = 'user id here'\npassword = 'my pwd here'\n_MQmgr = pymqi.connect(queue_manager, channel, conn_info, user, password)More details on error message:Traceback (most recent call last):\n File \"/opt/class-python/'host-name here'/app/routing/src/main.py\", line 61, in \n qmgr = get_MQmanager()\n File \"/opt/class-python/'host-name here'/utility/classMQ.py\", line 49, in get_MQmanager\n _MQmgr = pymqi.connect(queue_manager, channel, conn_info, user, password)\n File \"/opt/class-python/python-venv/'host-name here'/env3.6/lib64/python3.6/site-packages/pymqi/__init__.py\", line 3024, in connect\n qmgr.connect_tcp_client(queue_manager or '', CD(), channel, conn_info, user, password)\n File \"/opt/class-python/python-venv/'host-name here'/env3.6/lib64/python3.6/site-packages/pymqi/__init__.py\", line 1649, in connect_tcp_client\n self.connect_with_options(name, **kwargs)\n File \"/opt/class-python/python-venv/'host-name here'/env3.6/lib64/python3.6/site-packages/pymqi/__init__.py\", line 1624, in connect_with_options\n raise MQMIError(rv[1], rv[2])\npymqi.MQMIError: MQI Error. Comp: 2, Reason 2059: FAILED: MQRC_Q_MGR_NOT_AVAILABLEHere's the 2059 error description:10/27/2020 01:38:42 PM - Process(16087.1) User(classpy) Program(python)\n Host('linux host-name here') Installation(Installation1)\n VRMF(9.2.0.0)\n Time(2020-10-27T18:38:42.796Z)\n ArithInsert1(1073766407)\n CommentInsert1(xcsGetRandomBytes)\n\nAMQ9546E: Error return code received.\n\nEXPLANATION:\nThe program has ended because return code 1073766407 was returned from function\nxcsGetRandomBytes\nACTION:\nCorrect the cause of the failure and retry the operation.\n----- amqrmssa.c : 514 --------------------------------------------------------Here is the SVRCONN definitionChannel name . . . . . . . . . : SVRCHLSSL256 \nMessage Queue Manager name . . : APPSVRDEV \nChannel type . . . . . . . . . : *SVRCN \nTransport type . . . . . . . . : *TCP \nText 'description' . . . . . . : SSL Server Conn Channel - SHA256 \nMaximum message length . . . . : 20480000 \nHeartbeat interval . . . . . . : 300 \nLast alter date . . . . . . . : 2019-09-28 \nLast alter time . . . . . . . : 08.33.15 \nSSL CipherSpec . . . . . . . . : *TLS_RSA_WITH_AES_256_CBC_SHA256 \nSSL client authentication . . : *OPTIONAL### Assistant: As all the comments suggest, your python code is lacking the TLS settings. You should be using connect_with_options to connect.Refer to the pymqi samples -https://dsuch.github.io/pymqi/examples.html#how-to-use-ssl-tlsCode copied from the above link (which also has explanations)import logging\n\nimport pymqi\n\nlogging.basicConfig(level=logging.INFO)\n\nqueue_manager = 'QM1'\nchannel = 'SSL.SVRCONN.1'\nhost = '127.0.0.1'\nport = '1414'\nqueue_name = 'TEST.1'\nconn_info = '%s(%s)' % (host, port)\nssl_cipher_spec = 'TLS_RSA_WITH_AES_256_CBC_SHA'\nkey_repo_location = '/var/mqm/ssl-db/client/KeyringClient'\nmessage = 'Hello from Python!'\n\ncd = pymqi.CD()\ncd.ChannelName = channel\ncd.ConnectionName = conn_info\ncd.ChannelType = pymqi.CMQC.MQCHT_CLNTCONN\ncd.TransportType = pymqi.CMQC.MQXPT_TCP\ncd.SSLCipherSpec = ssl_cipher_spec\n\nsco = pymqi.SCO()\nsco.KeyRepository = key_repo_location\n\nqmgr = pymqi.QueueManager(None)\nqmgr.connect_with_options(queue_manager, cd, sco)\n\n...\n"} +{"text": "### Human: I have C# application that only reads messages from IBM MQ (ver 9.x). I'm callingMQQueueManager'sAccessQueue()method and thenMQQueue.Get(), reading messages in a loop and eventually callqueue.Close().I cannot find explicit information whether should I callMQQueueManager.Commit()after each messages (or beforequeue.Close()or ever) to be sure that processed messages are not consumed second time by another client, that's connected to the samequeueName. can someone clarify this for me?Here are message options:MQC.MQGMO_WAIT | MQC.MQGMO_FAIL_IF_QUIESCINGand open options:MQC.MQSO_FAIL_IF_QUIESCING | MQC.MQSO_MANAGED | MQC.MQSO_NON_DURABLE | MQC.MQOO_INPUT_AS_Q_DEF.### Assistant: It is somewhat confusing why you are usingMQSOoptions for a queue (SO = Subscription Options), however these are just bitwise operations, so you would be getting the results of what the equivalentMQOOoption is for the sameMQSO. See below:Bits OptionsSub OptionsEquivalent Open Options0x00000000MQSO_NONE MQSO_NON_DURABLE MQSO_READ_AHEAD_AS_Q_DEFMQOO_BIND_AS_Q_DEF MQOO_READ_AHEAD_AS_Q_DEF0x00000001MQSO_ALTERMQOO_INPUT_AS_Q_DEF0x00000020MQSO_MANAGEDMQOO_INQUIRE0x00002000MQSO_FAIL_IF_QUIESCINGMQOO_FAIL_IF_QUIESCINGThis means that you are opening the queue with the equivalent of the following options:MQOO_BIND_AS_Q_DEF | MQOO_READ_AHEAD_AS_Q_DEF | MQOO_INPUT_AS_Q_DEF | MQOO_INQUIRE |MQOO_FAIL_IF_QUIESCINGThis may or may not be what you want, but if nothing else it is extremely unclear how you have it currently.Commit is only required if you do your GET under sync point. This would mean you would addMQGMO_SYNCPOINTorMQGMO_SYNCPOINT_IF_PERSISTENTto your Get Message Options. If you were to do this then the messages are not fully removed from the queue until you issueMQQueueManager.Commit(), it does not mean that other instances are able to read them at the same time, but if one of the following conditions happens the messages will be back on the queue available to be read by another instance of the application:The application crashesThe application is disconnected from the queue managerThe application issuesMQQueueManager.Backout()When you get a message withoutMQGMO_SYNCPOINTorMQGMO_SYNCPOINT_IF_PERSISTENTthe message is immediately removed from the queue. The message can never be read by another instance of the application.In IBM MQ you can non-destructively read messages from a queue, this is called browsing the queue and is the result of opening the queue withMQOO_BROWSEand specifying one of the following get message options:MQGMO_BROWSE_FIRSTMQGMO_BROWSE_NEXTMQGMO_BROWSE_MSG_UNDER_CURSORMost of the time the message you browsed can still be read by another application that opens the same queue. You can however also addMQGMO_LOCKwhich will lock the message from being read by another application. This allows you to later issue a destructive GET against the message you locked, several things will release the lock including issuing another GET call.If you open the queue with one of theMQOO_INPUT*options and do not specify aMQGMO_BROWSE*option, then you are destructively reading messages from the queue. This means the message will not be available for another application to read.You can also issue a destructive GET withMQGMO_SYNCPOINTfor any message (persistent or non-persistent) (orMQGMO_SYNCPOINT_IF_PERSISTENTif you only want it to apply to persistent messages) and the message will be read in a unit of work, it is no longer available for another application to get, but it is not removed from the queue until the unit of work is committed.I could not find any specific statement from IBM that says the following:When you get a message without MQGMO_SYNCPOINT or MQGMO_SYNCPOINT_IF_PERSISTENT the message is immediately removed from the queue. The message can never be read by another instance of the application.Here are some references that together paint this picture:IBM Knowledge center pageIBM MQ>About IBM MQ>Introduction to IBM MQIBM MQ provides:Qualities of service that provide once and once only delivery of messages to ensure messages will withstand application and system outagesIBM Knowledge center pageIBM MQ>Developing applications>Developing MQI applications with IBM MQ>Writing a procedural application for queuing>Committing and backing out units of workCommit and back outSimilarly, when a program gets a message from a queue within a unit of work, that message remains on the queue until the program commits the unit of work, but the message is not available to be retrieved by other programs. The message is permanently deleted from the queue when the program commits the unit of work. If the program backs out the unit of work, IBM MQ restores the queue by making the messages available to be retrieved by other programs.Syncpoint coordination, syncpoint, unit of workSyncpoint coordinationis the process by which units of work are either committed or backed out with data integrity.\nThe decision to commit or back out the changes is taken, in the simplest case, at the end of a transaction. However, it can be more useful for an application to synchronize data changes at other logical points within a transaction. These logical points are calledsyncpoints(orsynchronization points) and the period of processing a set of updates between two syncpoints is called aunit of work. Several MQGET calls and MQPUT calls can be part of a single unit of work.IBM Knowledge center pageIBM MQ>Developing applications>Developing MQI applications with IBM MQ>Writing a procedural application for queuing>Getting messages from a queue>Getting messages from a queue using the MQGET callSpecifying MQGET options using the MQGMO structure...OptionsWithin your code, you can select the options in any order; each option is represented by a bit in theOptionsfield.TheOptionsfield controls:...Whether the get operation is included in a unit of work....Whether the message is removed from the queue, or merely browsed\n"} +{"text": "### Human: I am trying to send REST calls to IBM MQ on Cloud to PUT and GET messages from a queue. I want to do this in the browser-side JavaScript, but am receiving \u201cCross-Origin Request Blocked\u201d error messages.\nMy preference would be to have the client browser code send the message, but I will settle for my server-side Node.js code sending the message.### Assistant: Sending a message directly to IBM MQ on Cloud from the browserThis is not possible due CORS being blocked, but there is a workaround.Essentially, to prevent misuse of APIs without the user\u2019s control your browser will prevent you from accessing resources from another site, unless that site has specifically allowed access to them from your site, using theAccess-Control-Allow-Originheader (a value of*can be used to allow access from all sites).IBM MQ on Cloud\u2019s REST API does not allow CORS, nor does it allow you to modify any of the Web Console or REST API properties, meaning you cannot send messages to IBM MQ on Cloud directly from the browser.Another reason why using the REST API from the browser is often a bad idea, is because it encourages developers to distribute credentials within their browser-side JavaScript code, which is a bad security practice.The workaround to this is to have the browser clients make a request to your server, which you configure to send the messages to IBM MQ on Cloud on their behalf. This allows you to have full control over what messages are sent to the queue, which has its own benefits.Sending a message to IBM MQ on Cloud from the Node.js serverYou may wish to use theibmmqnpm package to take care of everything for you.https://www.npmjs.com/package/ibmmqIf you do not wish to use that package, then you can use your favourite request package and call the API with calls such asGET https://web-qmanager-example.qm.us-south.mq.appdomain.cloud/ibmmq/rest/v1/login.You may still run into problems with CORS request blocked error messages even with server-side Node.js code. In my personal experience many years ago, I struggled to get jQuery running in my backend app to ignore CORS checks, this has most probably since been fixed, but some other npm packages may have a similar issue.\nThere are a couple of things to try if you hit these issues. First check the documentation for the package you are using, there may be a skip CORS check option that you need to enable. The next option is to try a different package for handling your REST calls. The final option would be to write a simple proxy in another programming language, such as in Python withhttp.server.\n"} +{"text": "### Human: IBM Mq Helm chart installation failed to create Pod showing \"Crashloop Backoff error\". Pod error Message:\nmkdir /mnt/mqm/data: permission denied. Infrastructure: Google Cloud Platform ,Kubectl version: Client Version: v1.18.6\nServer Version: v1.16.13-gke.1.\nhelm chart :helm repo add ibm-chartshttps://raw.githubusercontent.com/IBM/charts/master/repo/stable/### Assistant: This looks like an issue with permissions on the mounted volume. You can try resolving this by adding the following additional parameter when you do the helm install:\nOn CLI:--set security.initVolumeAsRoot=trueOn UI: Select the check-box for initVolumeAsRootThis will allow init-container to run as root and setup the filesystem, which can then be used by the queue manager.\n"} +{"text": "### Human: I have installed IBM MQ classes from NuGet repository (amqmdnetstd.dll version 9.1.4) using below code to create a connection but getting error \"CWSMQ0006E: An exception was received during the call to the method ConnectionFactory.CreateConnection: System.ArgumentNullException: Value cannot be null. (Parameter 'destinationArray')\"var xff = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\n var cf = xff.CreateConnectionFactory();\n cf.SetStringProperty(XMSC.WMQ_HOST_NAME, WebsphereMqHost);\n cf.SetIntProperty(XMSC.WMQ_PORT, WebsphereMqPort);\n cf.SetStringProperty(XMSC.WMQ_CHANNEL, WebsphereMqChannel);\n cf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, WebsphereMqQueueManager);\n cf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);\n\n var conn = cf.CreateConnection();\n var sess = conn.CreateSession(false, AcknowledgeMode.AutoAcknowledge);\n var queue = sess.CreateQueue(QueueName);\n var consumer = sess.CreateConsumer(queue);### Assistant: The above error seems to be a bug in the code and is fixed inAPAR IT31572and is part of MQ v9.1.5 CD or MQ v9.2 LTS. So using 9.1.5/9.2 should solve the problem.\n"} +{"text": "### Human: I seeSENDERchannel goes intoRETRYmode afterLONGRTSstart. It remains inRETRYmode and re-started afterLONGMTR(1200)seconds. My question is - does Sender channel comes back toRUNNINGas soon as message come, without completion ofLONGMTRor it waits forLONGMTRtime?### Assistant: A SENDER channel will go intoSTATUS(RETRY)- a.k.a. Retry Mode - when the connection to its partner fails.To begin with, on the assumption that many network failures are very short lived, a SENDER channel will try a small number of fairly close together attempts to re-make the network connection. It will try 10 times at 60 seconds apart, to re-make the connection. This is known as the \"short retries\".This 10 times and 60 seconds apart, are coded in the SENDER channel fields calledSHORTRTYandSHORTTMR.If after these first 10 attempts, the SENDER channel has still not managed to get reconnected to the network partner, it will now move to \"long retries\". It is now operating with the assumption that the network outage is a longer one, for example the partner queue manager machine is having maintenance applied, or there has been some other major outage, and not just a network blip.The SENDER channel will now try what it hopes is an infinite number of slightly more spaced apart attempts to re-make the connection. It will try 999999999 times at 1200 seconds apart, to re-make the connection.This 999999999 and 1200, are coded in the SENDER channel fields calledLONGRTYandLONGTMR.You can see how many attempts are left by using the DISPLAY CHSTATUS command and looking at theSHORTRTSandLONGRTSfields. These should how many of the 10 or 999999999 are left. IfSHORTRTS(0)then you know the SENDER is into \"long retry mode\".If, on any of these attempts to re-make the connection, it is successful, it will stop retrying and you will see the SENDER channel showSTATUS(RUNNING). Note that the success is due to the network connection having been successfully made, and is nothing to do with whether a message arrives or not.It will not continue making retry attempts after it successfully connects to the partner (until the next time the connection is lost of course).If your channel is inSTATUS(RETRY)you should look in theAMQERR01.LOGto discover the reason for the failure. It may be something you can fix at the SENDER end or it may be something that needs to be fixed at the RECEIVER end, for example restarting the queue manager or the listener.\n"} +{"text": "### Human: I have requirement to copy the message in real time from one queue to another for a specific period of time. How can we configure this ? Manual switch is possible with IBM MQ.\nuse case is like ..\nMy primary queue connected to primary application.\nwhen primary application goes down i need to process the data through secondary application using a secondary queue.\nonce primary application is up , then it will pick the data from primary queue and re process it .So here the MQ switch should replicate/copy the data from primary to secondary queue in the down time. so that secondary app can do the processing.I have gone through the docs and understand that replication is possible but not sure how to do with manual switch (ON / OFF) for a specific period.Appreciate your help.### Assistant: What you are asking is for MQ to know about your application infrastructure. That's not possible.Solution #1:Why don't you copy/replicate all messages to a secondary queue, then have your secondary application ONLY process messages IF the IPPROCS of the primary queue is ZERO. As soon as IPPROCS of the primary queue is NOT zero then discard messages in the secondary queue.Solution #2:Create a third application that monitors the IPPROCS of the primary queue. When it is ZERO, start copying the messages to the secondary queue. Note: When the third application has the primary queue opened, IPPROCS wiil be 1. Hence, when the IPPROCS of the primary queue is 2 (or greater) then stop copying the messages and close the primary queue.Solution #3:Would involve a 3rd party solution. You could useMQ Message Replication(MQMR) to copy/replicate the messages in the primary queue to the secondary queue. Configure MQMR as needed but set it to inactive. When the primary application goes down/offline then immediately change MQMR to active. When the primary application is up and running again switch MQMR back to inactive.Solution 4:This solution is a combination of solution #1 and #3. UseMQMRto copy/replicate all messages in the primary queue to the secondary queue. Have your secondary application ONLY process messages IF the IPPROCS of the primary queue is ZERO. As soon as IPPROCS of the primary queue is NOT zero then discard messages in the secondary queue.\n"} +{"text": "### Human: Does anybody know why when I try to inquire channel with MQCMD_INQUIRE_CHANNEL command with these parameters in this order I have error MQRCCF_MSG_LENGTH_ERROR:ChannelName (MQCFST)\nChannelAttrs (MQCFIL) can have any single or multiple attributes except MQIACF_ALL. With MQIACF_ALL works OK.\nIntegerFilterCommand (MQCFIF)If I change order (put MQCFIL structure to the end) it works OK:ChannelName (MQCFST)\nIntegerFilterCommand (MQCFIF)\nChannelAttrs (MQCFIL)Similar inquire for queue (MQCMD_INQUIRE_Q) works OK in both cases with any QAttrs values:QName (MQCFST)\nQAttrs (MQCFIL)\nIntegerFilterCommand (MQCFIF)andQName (MQCFST)\nIntegerFilterCommand (MQCFIF)\nQAttrs (MQCFIL)Debug info:runmqrasmessagepart of the codeThe one of the strangest thing for me is MQIACF_ALL parameter, simple replacement it with any other allowable parameter (ex MQCACH_DESC) brokes inquire.PS\nI use python (pymqi branch without MQAI) for creating MQ PCF message.\nIf it is really needed I can create sample C program for approve, but I checked resulting binary message multiple times and it has no issue.### Assistant: I strongly suspect this is a bug in MQ. Can you take a trace of the command server on the queue manager while running your program? The command server process is named amqpcsea, or amqpcsea.exe on Windows. In these commands replace QMGRNAME with your actual queue manager name and TSxxxxxxxxx with your IBM case number once you've opened it:strmqtrc -m QMGRNAME -p amqpcsea[.exe]\n/* Run the program to get the error */\nendmqtrc -a\nrunmqras -qmlist QMGRNAME -section defs,trace -caseno TSxxxxxxxxxUpload the zip file from runmqras along with the binary command message (since it appears you can capture it), and we can review it.Could you also clarify your point about MQIACF_ALL? When you say that replacing it with any other parameter breaks inquire, what kind of error are you getting in that case? It sounds as if there might be two errors, and I want to make sure I understand them both properly.As for parameter order, the only restriction I know is that distributed (non-z/OS) platforms need the required parameters first:https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.1.0/com.ibm.mq.ref.adm.doc/q086880_.htm\n"} +{"text": "### Human: Below Code is just working fine with IBMMQ 8.0 DLL and server when I switch to 7.5 (both DLL and server) it is giving me this error using same certificateThe SSL key repository cannot be used because MQ cannot obtain a\n password to access it. Reasons giving rise to this error include: &B\n (a) the key database file and password stash file are not present in\n the location configured for the key repository, &B (b) the key\n database file exists in the correct place but that no password stash\n file has been created for it, &B (c) the files are present in the\n correct place but the userid underpublic void test() {\n Environment.SetEnvironmentVariable(\"MQCCSID\", \"437\");\n\n MQQueueManager mQQueueManager = null;\n MQQueue mQQueue = null;\n Hashtable hashTable = null;\n try {\n hashTable = new Hashtable();\n // Setup properties for connection\n hashTable.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\n hashTable.Add(MQC.HOST_NAME_PROPERTY, \"IP\");\n hashTable.Add(MQC.PORT_PROPERTY, 1414);\n hashTable.Add(MQC.CHANNEL_PROPERTY, \"Channel\");\n hashTable.Add(MQC.PASSWORD_PROPERTY, \"123\");\n hashTable.Add(MQC.USER_ID_PROPERTY, \"user\");\n\n mQQueueManager = new MQQueueManager(\"QueueName\", hashTable);\n\n // Open queue for browsing\n mQQueue = mQQueueManager.AccessQueue(\"que\", MQC.MQOO_BROWSE | MQC.MQOO_FAIL_IF_QUIESCING);\n\n ListOfMessages = new List < MQMessageDto > ();\n // In a loop browse all messages till we reach end of queue\n while (true) {\n try {\n // Need to create objects everytime\n var mQMessage = new MQMessage();\n\n var mQGetMessageOptions = new MQGetMessageOptions {\n // Use browse next option to start browsing\n Options = MQC.MQGMO_BROWSE_NEXT\n };\n mQQueue.Get(mQMessage, mQGetMessageOptions);\n ListOfMessages.Add(new MQMessageDto() {\n Id = ListOfMessages.Count + 1,\n Message = Encoding.UTF8.GetString(mQMessage.ReadBytes(mQMessage.MessageLength))\n });\n } catch (MQException mqex) {\n if (ListOfMessages.Count == 0) {\n MessageBox.Show(\"There is no messages in MQ\");\n }\n mQQueue.Close();\n break;\n }\n }\n mQQueueManager.Disconnect();\n\n grdMessages.DataSource = ListOfMessages;\n grdMessages.Columns[\"Id\"].Width = (int)(grdMessages.Width * 0.1);\n grdMessages.Columns[\"Message\"].Width = (int)(grdMessages.Width * 0.8);\n } catch (Exception ex) {\n MessageBox.Show(ex.Message);\n }\n}### Assistant: What are you describing means you have wrong configuration at IBM side, and Since you are using IBM MQ 7.5. I think you got the path for the SSL key repository wrong, it should point to the key name not the folder.Also make sure that you have selected Optional from SSL tab inside your Channel.For more details.. More details about this issue can be found here about error this error code:2538 error on MQ for SSL channel connection\n"} +{"text": "### Human: I try to build anxmlmessage to inject it in IBM MQ.The format to be used should beRFH2. Do you know, do you have any documentation about the format (xsd?) of the header?Thank you.### Assistant: MQ's RFH2 is an extensible header consisting of a fixed-format binary structure followed by a variable portion with an XML-like syntax.The structure is described (in basic terms) in the Knowledge Center here:https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.1.0/com.ibm.mq.ref.dev.doc/q099070_.htmSome MQ clients (for example JMS and .NET) will automatically prefix the messages they send with an RFH2 header. If you are using one of these clients then you might not need to encode the RFH2 yourself - it will be added for you.Do you have any more information about why the application needs an RFH2 header? \nThe RFH2 is often used to carry message properties so you will need to ensure that you encoded these correctly if you are building your own RFH2.If the application is using the MQ JMS or .NET client then it will be expecting the RFH2 header in the message to be formatted as described in the following topic:https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.1.0/com.ibm.mq.dev.doc/q032000_.htmYou may find the following utility program (rfhutil) helpful in understanding the RFH2 header and debugging your application:https://github.com/ibm-messaging/mq-rfhutilNote that the variable portion of the RFH2 header uses an XML-like syntax but does not support or understand all the features of XML, so you should not attempt to include your XML payload in the variable portion of the RFH2 header.... Instead the XML document should follow the RFH2 in the message.One last point to note is that MQ can perform codepage conversions based on the format and CCSID of the message, but this is rarely what you want with an XML document (which typically describes the character encoding of the document it's own declaration like this:. I would therefore recommend that you set the Format field in the RFH2 to \"MQFMT_NONE\" so that the XML document is treated as binary data and not converted unnecessarily when the message is received by the MQ client.\n"} +{"text": "### Human: Can someone explain me should i use MQXAQueueConnectionFactory if i want just read messages by @JmsListener in Spring Boot?I read messages with MQXAQueueConnectionFactory and with MQQueueConnectionFactory and i don't see the difference. If i make exception in listener method i see that message delivered again and again.In this time setSessionTransacted setting is true and setTransactionManager setting is null for DefaultJmsListenerContainerFactory:public void configure(DefaultJmsListenerContainerFactory factory,\n ConnectionFactory connectionFactory) {\n Assert.notNull(factory, \"Factory must not be null\");\n Assert.notNull(connectionFactory, \"ConnectionFactory must not be null\");\n factory.setConnectionFactory(connectionFactory);\n factory.setPubSubDomain(this.jmsProperties.isPubSubDomain());\n if (this.transactionManager != null) {\n factory.setTransactionManager(this.transactionManager); // null\n }\n else {\n factory.setSessionTransacted(true);\n }\n ...### Assistant: As the name suggests,MQXAQueueConnectionFactoryis used when working with XA transactions. Technically speakingMQXAQueueConnectionFactoryimplementsjavax.jms.XAConnectionFactorywhich ultimately provides access to the other XA-relatedconnection,context,session, andresourceinterfaces. Typically these would be used by the underlying framework (e.g. Java EE or Spring) along with the transaction manager to coordinate your XA transaction between multiple resource managers (e.g. a JMS provider and a JDBC database).Since you're not working with XA transactions then you should just useMQQueueConnectionFactory.To be clear, an XA transaction is different from a transacted JMS session (which is what you've configured).\n"} +{"text": "### Human: I am using a JMS template to publish a message to a topic. The message is being routed from the topic to a queue using aSUB()defined on the topic.I want the RFH2 headers not to be received by the consumer from the destination queue. For the same, I have set thePSPROP(NONE)on the topic definition. But still, the RFH2 headers are being received by the consumer from the queue.Is there some way where I can remove only the RFH2 headers, but still publish the other text or int properties along with the message from the JMS Producer?### Assistant: What does the receiving application have set for the MQGMO options?If they set the options to MQGMO_PROPERTIES_IN_HANDLE, then MQ will return the message payload only and the message properties (aka named properties) are accessed via the get***Properties() methods.i.e.MQGetMessageOptions gmo = new MQGetMessageOptions();\ngmo.options = CMQC.MQGMO_PROPERTIES_IN_HANDLE + CMQC.MQGMO_FAIL_IF_QUIESCING + CMQC.MQGMO_NO_WAIT;\nMQMessage receiveMsg = new MQMessage();\nqueue.get(receiveMsg, gmo);\n"} +{"text": "### Human: I have read about the EJB MDB where its providing consuming the message from queue asynchronous and thread safe.i was searching IBM MQ dependency for spring and i found \"mq-jms-spring-boot-starter\" but i am not getting any example that showing the consuming asynchronous data from queue/topic.Does any body use this dependency to resolve asynchronous and thread safe issue in spring?if not using this dependency then what are other option available in spring with IBM MQ to achieve the consuming asynchronous message reading?### Assistant: i found the solution. we have to use IBM MQ dependencyhttps://github.com/ibm-messaging/mq-jms-springand then we can access queue asynchronous using following sample code.public class Test {\n\n@Bean\npublic JmsListenerContainerFactory myFactory(\n ConnectionFactory connectionFactory,\n DefaultJmsListenerContainerFactoryConfigurer configurer) {\n DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();\n factory.setConcurrency(\"5\");\n configurer.configure(factory, connectionFactory);\n return factory;\n}\n\n@JmsListener(destination = \"DEV.QUEUE.1\", containerFactory = \"myFactory\")\npublic void receiveMessage(String transaction) {\n System.out.println(\"Received <\" + transaction + \">\"+ \"start time\"+System.currentTimeMillis());\n\n}\n}\n"} +{"text": "### Human: #!/bin/bash\nsu - mqm -c \" echo 'define channel(CLSTQ1.ESBQM) CHLTYPE(CLUSRCVR) TRPTYPE(TCP) CONNAME('example.corp(1414)') CLUSTER(CLSTQ1) DESCR('tcp cluster receirver channel for QM ESBQM')' | runmqsc ESBQM \"when i execute this script I have the following errors:-bash: -c: line 0: syntax error near unexpected token \\`('\n-bash: -c: line 0: ` echo 'define channel(CLSTQ1.ESBQM) CHLTYPE(CLUSRCVR) TRPTYPE(TCP) CONNAME('example.corp(1414)') CLUSTER(CLSTQ1) DESCR(tcp cluster receirver channel for QM ESBQM)' | runmqsc ESBQM '### Assistant: That's not a good way to do it.Do the following:(1) Put your MQSC commands in a file. Lets call itcrt_chl.mqscdefine channel(CLSTQ1.ESBQM) CHLTYPE(CLUSRCVR) TRPTYPE(TCP) CONNAME('example.corp(1414)') CLUSTER(CLSTQ1) DESCR('tcp cluster receirver channel for QM ESBQM')(2) Issue the command as follows:su - mqm -c \"runmqsc ESBQM < crt_chl.mqsc > crt_chl.mqsc.out\"(3) Now check the bottom of the crt_chl.mqsc.out file to see if it was successful or had errors.\n"} +{"text": "### Human: Has anyone succeeded in creating a bridge between IBM MQSeries (MQS) and ActiveMQ Artemis 7.x (AMQ 7) so that the later can send messages to and receive from the first? Currently I have no problem bridging between MQS 7.5 and AMQ 6.3 by deploying a camel route and MQS libraries on the broker itself. However, the same way doesn't work anymore as each route deployment requires a broker reconfiguration and restart.Thanks in advance for any feedback.### Assistant: A few examples ship with ActiveMQ Artemis which might be helpful:The \"inter-broker-bridge\" example in theexamples/features/sub-modules/directory. This example demonstrates how to deploy an instance oforg.apache.activemq.artemis.jms.bridge.impl.JMSBridgeImplto the broker using Spring in a web application.The \"camel\" example in theexamples/features/standard/directory. This example demonstrates how to deploy a Camel route to the broker using Spring in a web application.I can't speak to whether or not either of these can be updated at runtime as I've not actually attempted that. Both of these options should be able to move messages in either direction (i.e. from Artemis to MQS or from MQS to Artemis).Another option would simply be torun Camel standaloneand deploy your routes there. This would give you more flexibility as it would allow you to specifically choose the hardware where the routes run as well as how many resources the Camel JVM consumes. Running Camel routes directly on the broker, while convenient, isn't a great fit because the broker is a broker and not an application server.To be clear, ActiveMQ Artemis and IBM MQSeries are not directly compatible with each other and are not expected to be. This true for most (if not all) JMS broker implementations. The role of components like the ActiveMQ Artemis JMS bridge and integration platforms like Camel are to solve the compatibility problem by using a common API to speak to both brokers - JMS in this case. Any broker which implements JMS can be integrated using these methods.\n"} +{"text": "### Human: I want to send messages in MQ queue to EMS queues on different server. I am not sure how can I do this using Java. How can i assure that no message is lost while sending the message.I am able to consume messages from MQ using java.try {\n // Create a connection factory\n JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\n JmsConnectionFactory cf = ff.createConnectionFactory();\n\n // Set the properties\n cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, HOST);\n cf.setIntProperty(WMQConstants.WMQ_PORT, PORT);\n cf.setStringProperty(WMQConstants.WMQ_CHANNEL, CHANNEL);\n cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\n cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, QMGR);\n cf.setStringProperty(WMQConstants.WMQ_APPLICATIONNAME, \"JmsPutGet (JMS)\");\n cf.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, true);\n cf.setStringProperty(WMQConstants.USERID, APP_USER);\n cf.setStringProperty(WMQConstants.PASSWORD, APP_PASSWORD);\n\n // Create JMS objects\n context = cf.createContext();\n destination = context.createQueue(\"queue:///\" + QUEUE_NAME);\n\n long uniqueNumber = System.currentTimeMillis() % 1000;\n TextMessage message = context.createTextMessage(\"Your lucky number today is \" + uniqueNumber);\n\n producer = context.createProducer();\n producer.send(destination, message);\n System.out.println(\"Sent message:\\n\" + message);\n\n consumer = context.createConsumer(destination); // autoclosable\n String receivedMessage = consumer.receiveBody(String.class, 15000); // in ms or 15 seconds\n\n System.out.println(\"\\nReceived message:\\n\" + receivedMessage);\n\n recordSuccess();\n} catch (JMSException jmsex) {\n recordFailure(jmsex);\n}\n\nSystem.exit(status);### Assistant: Your code is almost correct, but if you want to switch JMS providers in your program you must also switch the JMS ConnectionFactory. This is the central (provider-specific) class to create consumers and messages from.So when creating the context, producer and message you need to use TIBCO'scom.tibco.tibjms.naming.TibjmsInitialContextFactory, for example like this:try {\n\n // 1) Create a MQ connection factory\n JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\n JmsConnectionFactory cf = ff.createConnectionFactory();\n\n // 2) Set the properties\n cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, HOST);\n cf.setIntProperty(WMQConstants.WMQ_PORT, PORT);\n cf.setStringProperty(WMQConstants.WMQ_CHANNEL, CHANNEL);\n cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\n cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, QMGR);\n cf.setStringProperty(WMQConstants.WMQ_APPLICATIONNAME, \"JmsPutGet (JMS)\");\n cf.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, true);\n cf.setStringProperty(WMQConstants.USERID, APP_USER);\n cf.setStringProperty(WMQConstants.PASSWORD, APP_PASSWORD);\n\n // 3) Create MQ consumer\n JMSContext mqContext = cf.createContext();\n destination = mqContext.createQueue(\"queue:///\" + QUEUE_NAME);\n consumer = mqContext.createConsumer(destination); // autoclosable\n\n // 4) wait for message from MQ (or null)\n String receivedText = mqContext.receiveBody(String.class, 15000); // in ms or 15 seconds\n System.out.println(\"\\nReceived message:\\n\" + receivedText);\n\n // 5) Create TIBCO EMS ConnectionFactory and an EMS MessageProducer\n TibjmsConnectionFactory emsCF = new com.tibco.tibjms.TibjmsConnectionFactory( \"tcp://1.2.3.4:7222\");\n Connection emsConnection = emsCF.createConnection(user, password);\n Session emsSession = emsConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);\n MessageProducer emsProducer = emsSession.createProducer( emsSession.createQueue(QUEUE_NAME) );\n\n // 6) Create EMS TextMessage from MQ TextMessage\n TextMessage emsMsg = emsSession.createTextMessage( receivedText );\n\n // 7) publish to EMS\n emsProducer.send(emsMsg);\n\n // 8) cleanup\n emsConnection.close();\n\n recordSuccess();\n} catch (JMSException jmsex) {\n recordFailure(jmsex);\n}\n"} +{"text": "### Human: I don't have a clear knowledge about MQ using TOPICS and I have searched in IBM documentation and I can't find the way to subscribe with C++ to a Topic. In Java I have seen that you can go to the Websphere Control Panel and you configure it there. Programmatically how is possible to do it in C++? \nIn C++ I have connected to queues using the functions MQCONN, MQOPEN and to get the messages I use MQGET and MQPUT, but I think I am only connected to queues not TOPICS. \nI want too to figure it out if I have the correct idea if connect to topic is different than connect to a queue. Thanks in advance guys.### Assistant: It is advisable to use the C MQ API when programming in C++ because the C++ classes are stabilized and have not (and will not) be updated with classes for topics, as perIBM Knowledge Center: Developing C++ applicationsIBM WebSphere\u00ae MQ Version 7.0, enhancements to the IBM MQ programming interfaces are not applied to the C++ classes.In order use a topic from the C MQ API here is a quick pseudo-code example. Please also check out the IBM supplied samples, such asamqspuba.candamqssuba.c.To Publish to a topicMQOD mqod {MQOD_DEFAULT};\nMQCONN...\nmqod.ObjectType = MQOT_TOPIC;\nmqod.Version = MQOD_VERSION_4; /* To use ObjectString field */\nmqod.ObjectString.VSPtr = argv[1];\nmqod.ObjectString.VSLength = MQVS_NULL_TERMINATED;\nMQOPEN(hConn,\n &mqod,\n MQOO_OUTPUT,\n &hObj,\n &CompCode, &Reason);\nMQPUT....To Subscribe to a topicMQSD mqsd {MQSD_DEFAULT};\nMQCONN...\nmqsd.Options = MQSO_CREATE | MQSO_NON_DURABLE | MQSO_MANAGED;\nmqsd.ObjectString.VSPtr = argv[1];\nmqsd.ObjectString.VSLength = MQVS_NULL_TERMINATED;\nMQSUB(hConn,\n &mqsd,\n &hObj,\n &hSub,\n &CompCode, &Reason);\nMQGET from hObj...\n"} +{"text": "### Human: How to subscribe a IBM MQ topic from .net client in a subscriber modelI have already a working copy of the code which is able to get message from the topic.string qmName = \"Q1\";\n string hostName = \"MyHost\";\n string strPort = \"1114\";\n string channelName = \"MyCh\";\n string transport = TRP;\n\n Hashtable connectionProperties = new Hashtable();\n connectionProperties.Add(MQC.HOST_NAME_PROPERTY, hostName);\n connectionProperties.Add(MQC.PORT_PROPERTY, strPort);\n connectionProperties.Add(MQC.CHANNEL_PROPERTY, channelName);\n\n MQQueueManager mqQueueManager = new MQQueueManager(qmName, connectionProperties);\n\n string topicString = \"TTTT\";\n string subscriptionName = \"SSS\";\n int openOptionsForGet = MQC.MQSO_FAIL_IF_QUIESCING | MQC.MQSO_DURABLE | MQC.MQSO_RESUME;\n MQTopic destForGet = mqQueueManager.AccessTopic(null, null, null, openOptionsForGet, null, subscriptionName);\n\n MQMessage messageForGet = new MQMessage();\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.Options |= MQC.MQGMO_WAIT | MQC.MQGMO_FAIL_IF_QUIESCING;\n gmo.WaitInterval = 3000; // wait 60 seconds\n destForGet.Get(messageForGet, gmo);\n string msg = messageForGet.ReadLine();\n System.Console.WriteLine(\"Received message data : \" + msg);\n\n MessageBox.Show(\"Received message data : \" + msg);\n\n destForGet.Close();\n mqQueueManager.Disconnect();\n mqQueueManager.Close();so above code is always opening and closing the connection however I want to make a connection and subscription to call in a loop/sleep time interval so every time no connection is made and closed. So requirement is:Make connection for one time and then topic subscription is on every 1 minutes to read the data and process.As of now whenever message is read it's being removed from topic. I want to know how to commit/ack to remove the queue message post successful processing.I don't want to get the msg removed from the queue.### Assistant: Make connection for one time and then topic subscription is on every 1\n minutes to read the data and process.Just use a while loop (that's not an MQ issue). Also, why do you want to wait 1 minute? With Pub/Sub or even point-to-point messaging, messages could be building while your application sleeps.As of now whenever message is read it's being removed from topic. I\n want to know how to commit/ack to remove the queue message post\n successful processing.You can use a syncpoint but then you need to either commit or backout the message.I don't want to get the msg removed from the queue.Why are you using Pub/Sub? Wouldn't it be better to use point-to-point messaging? i.e. browse rather than get.MQC.MQSO_DURABLE | MQC.MQSO_RESUME;I would strongly suggest you read theMQ Knowledge Centerand understand what these options do. Because there is a world of difference between durable and non-durable.Here is a fully functioning C# .NET MQ program running in managed-mode to get messages from a topic string:using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Threading;\nusing IBM.WMQ;\n\n/// Program Name\n/// MQTest82\n///\n/// Description\n/// This C# class will connect to a remote queue manager\n/// and get messages from a topic using a managed .NET environment.\n///\n/// Sample Command Line Parameters\n/// -h 127.0.0.1 -p 1415 -c TEST.CHL -m MQWT1 -t ABC/XYZ -u tester -x mypwd\n/// \n/// Roger Lacroix\n/// \nnamespace MQTest82\n{\n public class MQTest82\n {\n private Hashtable inParms = null;\n private Hashtable qMgrProp = null;\n private System.String qManager;\n private System.String topicString;\n\n /*\n * The constructor\n */\n public MQTest82()\n : base()\n {\n }\n\n /// Make sure the required parameters are present.\n /// true/false\n /// \n private bool allParamsPresent()\n {\n bool b = inParms.ContainsKey(\"-h\") && inParms.ContainsKey(\"-p\") &&\n inParms.ContainsKey(\"-c\") && inParms.ContainsKey(\"-m\") &&\n inParms.ContainsKey(\"-t\");\n if (b)\n {\n try\n {\n System.Int32.Parse((System.String)inParms[\"-p\"]);\n }\n catch (System.FormatException e)\n {\n b = false;\n }\n }\n\n return b;\n }\n\n /// Extract the command-line parameters and initialize the MQ variables.\n /// \n /// \n /// IllegalArgumentException \n private void init(System.String[] args)\n {\n inParms = System.Collections.Hashtable.Synchronized(new System.Collections.Hashtable(14));\n if (args.Length > 0 && (args.Length % 2) == 0)\n {\n for (int i = 0; i < args.Length; i += 2)\n {\n inParms[args[i]] = args[i + 1];\n }\n }\n else\n {\n throw new System.ArgumentException();\n }\n\n if (allParamsPresent())\n {\n qManager = ((System.String)inParms[\"-m\"]);\n topicString = ((System.String)inParms[\"-t\"]);\n\n qMgrProp = new Hashtable();\n qMgrProp.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\n\n qMgrProp.Add(MQC.HOST_NAME_PROPERTY, ((System.String)inParms[\"-h\"]));\n qMgrProp.Add(MQC.CHANNEL_PROPERTY, ((System.String)inParms[\"-c\"]));\n\n try\n {\n qMgrProp.Add(MQC.PORT_PROPERTY, System.Int32.Parse((System.String)inParms[\"-p\"]));\n }\n catch (System.FormatException e)\n {\n qMgrProp.Add(MQC.PORT_PROPERTY, 1414);\n }\n\n if (inParms.ContainsKey(\"-u\"))\n qMgrProp.Add(MQC.USER_ID_PROPERTY, ((System.String)inParms[\"-u\"]));\n\n if (inParms.ContainsKey(\"-x\"))\n qMgrProp.Add(MQC.PASSWORD_PROPERTY, ((System.String)inParms[\"-x\"]));\n\n logger(\"Parameters:\");\n logger(\" QMgrName ='\" + qManager + \"'\");\n logger(\" Topic String ='\" + topicString + \"'\");\n\n logger(\"QMgr Property values:\");\n foreach (DictionaryEntry de in qMgrProp)\n {\n logger(\" \" + de.Key + \" = '\" + de.Value + \"'\");\n }\n }\n else\n {\n throw new System.ArgumentException();\n }\n }\n\n /// Connect, open topic, get messages, close topic and disconnect. \n ///\n private void testReceive()\n {\n MQQueueManager qMgr = null;\n MQTopic inTopic = null;\n int openOptionsForGet = MQC.MQSO_CREATE | MQC.MQSO_FAIL_IF_QUIESCING | MQC.MQSO_MANAGED | MQC.MQSO_NON_DURABLE;\n\n try\n {\n qMgr = new MQQueueManager(qManager, qMgrProp);\n logger(\"successfully connected to \" + qManager);\n\n inTopic = qMgr.AccessTopic(topicString, null, MQC.MQTOPIC_OPEN_AS_SUBSCRIPTION, openOptionsForGet);\n logger(\"successfully opened \" + topicString);\n\n testLoop(inTopic);\n }\n catch (MQException mqex)\n {\n logger(\"CC=\" + mqex.CompletionCode + \" : RC=\" + mqex.ReasonCode);\n }\n catch (System.IO.IOException ioex)\n {\n logger(\"ioex=\" + ioex);\n }\n finally\n {\n try\n {\n if (inTopic != null)\n inTopic.Close();\n logger(\"closed: \" + topicString);\n }\n catch (MQException mqex)\n {\n logger(\"CC=\" + mqex.CompletionCode + \" : RC=\" + mqex.ReasonCode);\n }\n\n try\n {\n if (qMgr != null)\n qMgr.Disconnect();\n logger(\"disconnected from \" + qManager);\n }\n catch (MQException mqex)\n {\n logger(\"CC=\" + mqex.CompletionCode + \" : RC=\" + mqex.ReasonCode);\n }\n }\n }\n\n private void testLoop(MQTopic inTopic)\n {\n bool flag = true;\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.Options |= MQC.MQGMO_NO_WAIT | MQC.MQGMO_FAIL_IF_QUIESCING;\n MQMessage msg = null;\n\n while (flag)\n {\n try\n {\n msg = new MQMessage();\n inTopic.Get(msg, gmo);\n if (msg.Feedback == MQC.MQFB_QUIT)\n {\n flag = false;\n logger(\"received quit message - exiting loop\");\n }\n else\n logger(\"Message Data: \" + msg.ReadString(msg.MessageLength));\n }\n catch (MQException mqex)\n {\n logger(\"CC=\" + mqex.CompletionCode + \" : RC=\" + mqex.ReasonCode);\n if (mqex.Reason == MQC.MQRC_NO_MSG_AVAILABLE)\n {\n // no meesage - life is good - loop again\n logger(\"sleeping\");\n Thread.Sleep(60*1000); // sleep for 60 seconds\n }\n else\n {\n flag = false; // severe error - time to exit\n }\n }\n catch (System.IO.IOException ioex)\n {\n logger(\"ioex=\" + ioex);\n }\n }\n }\n\n private void logger(String data)\n {\n DateTime myDateTime = DateTime.Now;\n System.Console.Out.WriteLine(myDateTime.ToString(\"yyyy/MM/dd HH:mm:ss.fff\") + \" \" + this.GetType().Name + \": \" + data);\n }\n\n /// main line\n /// \n /// \n // [STAThread]\n public static void Main(System.String[] args)\n {\n MQTest82 write = new MQTest82();\n\n try\n {\n write.init(args);\n write.testReceive();\n }\n catch (System.ArgumentException e)\n {\n System.Console.Out.WriteLine(\"Usage: MQTest82 -h host -p port -c channel -m QueueManagerName -t topicString [-u userID] [-x passwd]\");\n System.Environment.Exit(1);\n }\n catch (MQException e)\n {\n System.Console.Out.WriteLine(e);\n System.Environment.Exit(1);\n }\n\n System.Environment.Exit(0);\n }\n }\n}\n"} +{"text": "### Human: We have a ASP.NET web service that receives text and destination information and sends MQ messages from our server to another windows server using IBM WebSphere MQ Client.We had v6 installed and everything was working fine sending messages to a server with v9.0.0.1 installed. We have upgraded our server from v6 to v9.Messages are now being received as header type MQHRF2 when these messages are being explicitly sent as MQSTR header type.This is likely something to do with the upgrade from v6->v9. Any ideas on what could be causing this would be very helpful as I'm at a loss.EDIT:\nCode Sample:This is a condensed version of how we are interacting with the MQ API in our web application:MQEnvironment.Hostname = \"TEST_HOST\";\nMQEnvironment.Channel = \"TEST_CHANNEL\";\nMQEnvironment.Port = 1414; // Default MQ Port\nvar queueMgr = new MQQueueManager(\"TEST\", new Hashtable());\n\nvar openOptions = MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_OUTPUT + MQC.MQOO_SET_ALL_CONTEXT;\nvar queue = queueMgr.AccessQueue(\"QueueName\", openOptions);\n\nvar message = new MQMessage();\nmessage.ApplicationIdData = \".xml\";\nmessage.Write(Encoding.UTF8.GetBytes(\"test\"));\nmessage.Format = MQC.MQFMT_STRING;\nmessage.Persistence = MQC.MQPER_PERSISTENT;\nmessage.CorrelationId = MQC.MQCI_NEW_SESSION;\n\nvar putOptions = new MQPutMessageOptions();\nputOptions.Options += MQC.MQPMO_SET_IDENTITY_CONTEXT + MQC.MQPMO_SYNCPOINT;\n\nqueue.Put(message, putOptions);\nqueueMgr.Commit();### Assistant: The issue here is that we have a third party tool, AppDynamics installed and running on this server. This tool is used for performance management. This tool interferes with MQ messages causing the behaviour I have details; messages being received as MQHRF2 format.This is noted in IBM's documentation:https://www.ibm.com/support/knowledgecenter/en/SSYHZ9_5.5.0/com.ibm.omegamon_apm.doc/troubleshooting/zapm_issues.htmAppDynamics dynamically adds an MQ message property to messages to be tracked, which is transmitted in the message via an MQRFH2\n header. Before you configure AppDynamics, ensure that your\n application programs are not affected by this modification to\n messages. Examples of applications that might be affected are ones\n that expect message content at a specific location in the message\n without bypassing possible extra headers in the message.This issue can be exposed by toggling on & off the AppDynamics service on the server. With the service stopped, all messages are received in the MQSTR when send as MQSTR.AppDynamics was already installed and running when the server had MQ Client v6 installed. This issue only started to arise when upgrading to MQ Client v9.\n"} +{"text": "### Human: Using spring boot and IBM MQ i need to send message to MQ.In My Spring boot application i have registeredMQQueueConnectionFactoryas below.@SpringBootApplication\n@EnableJms\npublic class MainApplication {\n\n public static void main(String[] args) {\n new SpringApplicationBuilder(MainApplication.class).web(WebApplicationType.NONE).run(args);\n logger.info(\"init completed...\");\n }\n\n @Bean\n public MQQueueConnectionFactory queueConnectionFactory() {\n MQQueueConnectionFactory queueConnectionFactory = new MQQueueConnectionFactory();\n try {\n queueConnectionFactory.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n queueConnectionFactory.setHostName(host);\n queueConnectionFactory.setChannel(channel);\n queueConnectionFactory.setPort(port);\n queueConnectionFactory.setQueueManager(queueManager);\n } catch (Exception e) {\n logger.error(e.getMessage(), e);\n }\n return queueConnectionFactory;\n }\n\n}And i have destination resolver as below.@Component\n public class IBMWebSphereMqDestinationResolver extends \n DynamicDestinationResolver implements DestinationResolver {\n\n@Override\npublic Destination resolveDestinationName(Session session, String destinationName, boolean pubSubDomain) throws JMSException {\n Destination destination = super.resolveDestinationName(session, destinationName, pubSubDomain);\n if (destination instanceof MQDestination) {\n MQDestination mqDestination = (MQDestination) destination;\n }\n return destination;\n}\n\n}I am using JmsTemplate to send message to MQ.@Service\npublic class MqServiceImpl implements MqService {\n\n private final Logger logger = LoggerFactory.getLogger(this.getClass());\n\n @Autowired\n private JmsTemplate jmsTemplate;\n\n @Autowired\n private MQDestination destination;\n\n @Handler\n @Override\n public void sendMessage(String textMessage) {\n logger.info(\"textMessage {} \", textMessage);\n logger.info(\"destination {} \", destination);\n jmsTemplate.convertAndSend(destination, textMessage);\n }\n\n}However when i try to start the application i am gettingMQDestination' that could not be found.service.impl.MqServiceImpl required a bean of type 'com.ibm.mq.jms.MQDestination' that could not be found.\n\nThe injection point has the following annotations:\n - @org.springframework.beans.factory.annotation.Autowired(required=true)\n\n\nAction:\n\nConsider defining a bean of type 'com.ibm.mq.jms.MQDestination' in your configuration.Shouldn't spring try to call DestinationResolver ?If not how do i register destination for IBM MQ?### Assistant: You are defining anDestinationResolverbean, but injecting anMQDestinationbean. This is why you get the error. You should inject theDestinationResolverand callsetDestinationResolveron theJmsTemplate.But theJmsTemplateresolves the destinations dynamically. This works as well:public void sendMessage(String textMessage) {\n String destination = \"MY.QUEUE\";\n jmsTemplate.convertAndSend(destination, textMessage);\n}\n"} +{"text": "### Human: We have existing Xquery files in Oracle Service Bus projects.If we want to resuse the xquery files in IIB projects which saves lot of development effort as there are so many xquery files already available in different projects. So we have created a POC using Saxon processor library to execute the Xquery files in Java compute node by passing Input message available in MbMessageAssembly to XQPreparedExpression which is working fine and getting the response. Here my question is , does it have any performance impact if we follow this approach. Could you please suggest if it causes any issue or it is okay to follow this approach.### Assistant: I've never used Xquery, so my answer might not be fully accurate, but there are some recommendation by IBM on how to use external classes like JAXB inside IIB, so they are not especially against such scenario.Of course, it will most likely have worst performances than the same code written in optimized ESQL, but I think in your case it should be relevant to perform a Proof Of Concept. Just compare the average execution time on Oracle and compare it to IIB one, and then you should be able to decide if you go with that solution or if you need to rewrite everything.\n"} +{"text": "### Human: I am getting the below error while connecting to IBM MQ using library pymqi.Its a clustered MQ channelpymqi.MQMIError: MQI Error. Comp: 2, Reason 2539: FAILED: MQRC_CHANNEL_CONFIG_ERRORPlease see my code below.queue_manager = \"QMNAME\"\nchannel = bytes(str(\"CHANNEL_NAME\"))\nhost = \"xx.xx.xx.xx\"\nport = \"1800\"\nqueue_name = \"QN\"\nconn_info1 = bytes(\"%s(%s)\" % (host, port))\nmessage = b'{\"alert\":[{\"timestamp\":\"Wed Jun 27 11:07:37 CDT 2018\",\"shortDescription\":\"Last 24 hrs Sev 4 Volume Deviation is 84% lower than baseline\",\"alertColor\":\"red\",\"title\":\"Sev 4 Volume Deviation\"}]}'\n\n# Message Descriptor\nput_mqmd = pymqi.MD()\nqmgr = pymqi.connect(queue_manager, channel, conn_info1)\nqueue = pymqi.Queue(qmgr, queue_name)Getting error at the line belowqmgr = pymqi.connect(queue_manager, channel, conn_info1)### Assistant: Cause:The2539 (MQRC_CHANNEL_CONFIG_ERROR)error is a result of you attempting to connect to a channel on the queue manager that is not of typeSVRCONN. A MQ client must connect to aSVRCONNchannel.Additional information:If you review the queue manager error logs you would see correspondingAMQ9502errors, for example:AMQ9502: Type of channel not suitable for action requested.\n\nEXPLANATION:\nThe operation requested cannot be performed on channel 'CHANNEL_NAME'. Some\noperations are only valid for certain channel types. This channel is a\n'CLUSRCVR' channel type. For example, you can only ping or trigger a channel\nfrom the initiating end.\nACTION:\nCheck whether the channel name is specified correctly. If it is check that the\nchannel has been defined correctly.Resolution:Make sure you have aSVRCONNchannel defined on the queue manager you wish to connect to.Troubleshooting:The MQ client comes with a sample programamqscnxc, you could use this to test out the parameters you have specified in your example. For instance on Linux/Unix (quoting of the conname may be different on Windows) do the following:amqscnxc -x 'xx.xx.xx.xx(1800)' -c CHANNEL_NAME QMNAMEThe result would be the same2539error, but this does show it is not a pymqi specific problem.\n"} +{"text": "### Human: I'm facing problem when developing an application that subscribe a MQ Topic (MQ version 9).I need to do a shared topic connection because the application will be ran in multiple instances (cluster).The specs and the documentation says :\n\"A non-durable shared subscription is used by a client which needs to be able to share the work of receiving messages from a topic subscription amongst multiple consumers. A non-durable shared subscription may therefore have more than one consumer. Each message from the subscription will be delivered to only one of the consumers on that subscription.\"For me, all the clients using the same subscription name are in the same \"cluster\", only one client will receive a message at one time.In my code, inspired by thisarticle, I've got an exception when the second client try to create the shared subscription. I really don't understand if this is a bug in MQ client libraries implementation or in my code.Here my sample code :import javax.jms.Connection;\nimport javax.jms.Message;\nimport javax.jms.MessageConsumer;\nimport javax.jms.Session;\nimport javax.jms.Topic;\n\nimport com.ibm.mq.jms.MQTopicConnectionFactory;\nimport com.ibm.msg.client.wmq.WMQConstants;\n\npublic class TestGB2 {\n\n public static void main(final String[] args) throws Exception {\n\n for (int i = 0; i < 10; i++) {\n new Thread(new MyThread(\"THREAD\" + i, \"TESTSUB/#\", \"myClient\", \"SUBTEST\")).start();\n }\n\n }\n\n public static class MyThread implements Runnable {\n\n private final String topicString;\n private final String clientId;\n private final String subscriptionName;\n\n public MyThread(final String threadName, final String topicString, final String clientId, final String subscriptionName) {\n Thread.currentThread().setName(threadName);\n this.topicString = topicString;\n this.clientId = clientId;\n this.subscriptionName = subscriptionName;\n }\n\n @Override\n public void run() {\n\n try {\n System.out.println(String.format(\"%s : Connecting...\", Thread.currentThread().getName()));\n MQTopicConnectionFactory cf = new MQTopicConnectionFactory();\n cf.setHostName(\"xxxx\");\n cf.setPort(1416);\n cf.setQueueManager(\"xxxx\");\n cf.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n cf.setChannel(\"xxx\");\n cf.setClientID(clientId);\n\n Connection con = cf.createConnection();\n\n Session session = con.createSession(false, Session.AUTO_ACKNOWLEDGE);\n con.start();\n Topic topic = session.createTopic(topicString);\n MessageConsumer messageConsumer = session.createSharedConsumer(topic, subscriptionName); // fail here\n\n System.out.println(String.format(\"%s : Waiting for a message...\", Thread.currentThread().getName()));\n Message msg = messageConsumer.receive();\n System.out.println(String.format(\"%s : Received :\\n%s\", Thread.currentThread().getName(), msg));\n\n }\n catch (Exception ex) {\n System.out.println(String.format(\"%s : FAILED\", Thread.currentThread().getName()));\n ex.printStackTrace();\n }\n\n }\n\n }\n}The code below tries to create 10 threads consuming messages on the same topic. Only the first thread is able to connect, all the others fail with following exception :com.ibm.msg.client.jms.DetailedIllegalStateException: JMSWMQ0026: Failed to subscribe to topic 'TESTSUB' with selector 'none' using MQSUB.\nThere may have been a problem creating the subscription due to it being used by another message consumer.\nMake sure any message consumers using this subscription are closed before trying to create a new subscription under the same name. Please see the linked exception for more information.\n at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:472)\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:214)\n at com.ibm.msg.client.wmq.internal.WMQMessageConsumer.checkJmqiCallSuccess(WMQMessageConsumer.java:212)\n at com.ibm.msg.client.wmq.internal.WMQMessageConsumer.checkJmqiCallSuccess(WMQMessageConsumer.java:112)\n at com.ibm.msg.client.wmq.internal.WMQConsumerShadow.initialize(WMQConsumerShadow.java:1038)\n at com.ibm.msg.client.wmq.internal.WMQSyncConsumerShadow.initialize(WMQSyncConsumerShadow.java:134)\n at com.ibm.msg.client.wmq.internal.WMQMessageConsumer.(WMQMessageConsumer.java:470)\n at com.ibm.msg.client.wmq.internal.WMQSession.createSharedConsumer(WMQSession.java:938)\n at com.ibm.msg.client.jms.internal.JmsSessionImpl.createSharedConsumer(JmsSessionImpl.java:4228)\n at com.ibm.msg.client.jms.internal.JmsSessionImpl.createSharedConsumer(JmsSessionImpl.java:4125)\n at com.ibm.mq.jms.MQSession.createSharedConsumer(MQSession.java:1319)\n at TestGB.lambda$0(TestGB.java:33)\n at java.lang.Thread.run(Thread.java:748)\nCaused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2042' ('MQRC_OBJECT_IN_USE').\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:202)\n ... 11 moreTried with the last lib :\n com.ibm.mq\n com.ibm.mq.allclient\n 9.1.1.0\n### Assistant: Summary of the issueThe issue is not with your program, the issue is with the model queue associated to the topic you are subscribing to.On the queue manager if you look at the topic object that your subscription will match, it will have a parameterMNDURMDLthat points to a model queue.If you look at the model queue you will note two parameters where either or both can cause the error you are receiving:[ DEFSOPT( EXCL | SHARED ) ]\n[ SHARE | NOSHARE ]These must be set toDEFSOPT(SHARED)andSHARE. If either one is set to the other value you will only be able to have one subscriber on the shared subscription.Additional details of the cause of the issueWith IBM MQ Pub/Sub, when you create a JMS subscription MQ treats this as a managed subscription, in the background IBM MQ will create a temporary queue to subscribe to the topic string. If it is a non-durable subscription the queue is a temporary dynamic queue.The reason for the failure is that the first thread will open the temporary dynamic queue in an exclusive mode, any other threads then cannot open the temporary dynamic queue and you receive theMQRC_OBJECT_IN_USEerror.Possible cause where an application specificMNDURMDLmodel queue was createdI suspect the cause of this is that IBM comes with a few different default model queues.The default for a non-durable subscriber has these settings:QUEUE(SYSTEM.NDURABLE.MODEL.QUEUE) TYPE(QMODEL)\n DEFSOPT(SHARED) SHAREThere is another default queue that is not pub/sub specific that has these settings:QUEUE(SYSTEM.DEFAULT.MODEL.QUEUE) TYPE(QMODEL)\n DEFSOPT(EXCL) NOSHAREIt is likely that the model queue created for use by your topic object was created with a command like the following that will default to use the setting of theSYSTEM.DEFAULT.MODEL.QUEUE.:DEFINE QMODEL(xxx)In the future you could either specifically set those two parameters, or define it with theLIKEkeyword to force it to use a different queue to model settings from, both commands are below:DEFINE QMODEL(xxx) DEFSOPT(SHARED) SHARE\nDEFINE QMODEL(xxx) LIKE(SYSTEM.NDURABLE.MODEL.QUEUE)Additional details on creation and usage of application specific TOPIC objects and MODEL queuesBy default the root node of the tree is represented by the standard TOPIC object namedSYSTEM.BASE.TOPIC, the default model queues associated to this TOPIC are shown below:TOPIC(SYSTEM.BASE.TOPIC) TYPE(LOCAL)\n TOPICSTR() MDURMDL(SYSTEM.DURABLE.MODEL.QUEUE)\n MNDURMDL(SYSTEM.NDURABLE.MODEL.QUEUE)If you do not define any further administrative TOPIC objects, then all topics match againstSYSTEM.BASE.TOPIC. Additionally if you do not define any further administrative TOPIC objects and you want to give an application permission to a specific subset of the topic tree (for example topic strings beginning withTESTSUB) you must grant the permissions viaSYSTEM.BASE.TOPIC, this in turn grants the application access for any arbitrary topic string with no restrictions.Best practice would be to create a TOPIC object with a topic string that matches the portion of the topic tree an an application should have access to. Specific to your example ofTESTSUB/#if your admin defined a new TOPIC object and specified theTOPICSTR(TESTSUB), the defaults would create it like this:TOPIC(TESTSUB.TOPIC) TYPE(LOCAL)\n TOPICSTR(TESTSUB) MDURMDL( )\n MNDURMDL( )the blankMDURMDLandMNDURMDLvalues tell MQ to use the value from the next closest higher topic object in the tree, if nothing else is defined this would be theSYSTEM.BASE.TOPICand the model queues would still default to using theSYSTEM.DURABLE.MODEL.QUEUEandSYSTEM.NDURABLE.MODEL.QUEUEmodel queues.The admin can instead create the TOPIC object and specify different model queues for example:TOPIC(TESTSUB.TOPIC) TYPE(LOCAL)\n TOPICSTR(TESTSUB) MDURMDL(TESTSUB.DURABLE.MODEL.QUEUE)\n MNDURMDL(TESTSUB.NDURABLE.MODEL.QUEUE)By doing this they can define application specific model queues that have the settings required for shared subscriptions and not impact the SYSTEM model queues. The other benefit is they can provide the application permissions for only topic strings that start withTESTSUB, for exampleTESTSUB/AorTESTSUB/BorTESTSUB/X/Y/Z.\n"} +{"text": "### Human: I am able to set correlation id for IBM mq but unable to set message id for the message the message id I am setting is being overridden by the MQ how to set this message id below one is the code I am trying please help me on this task. Is there any thing I need do in the code???public static void main(String args[]) \n {\n\n try{\n MQQueueConnectionFactory cf = new MQQueueConnectionFactory();\n cf.setHostName(\"xxx\");\n cf.setPort(4444);\n cf.setTransportType(1);\n cf.setQueueManager(\"xxxx\");\n cf.setChannel(\"CLIENT.xyZ\");\n\n MQQueueConnection connection = (MQQueueConnection) cf.createQueueConnection();\n MQQueueSession session = (MQQueueSession) connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\n\n MQQueue queue = (MQQueue) session.createQueue(\"WW.ESB.ENTRY.SERVICE.IN\");\n queue.setBooleanProperty(WMQConstants.WMQ_MQMD_WRITE_ENABLED, true);\n queue.setIntProperty(WMQConstants.WMQ_MQMD_MESSAGE_CONTEXT, WMQConstants.WMQ_MDCTX_SET_IDENTITY_CONTEXT);\n MQQueueSender sender = (MQQueueSender) session.createSender(queue);\n\n true);\n\n\n\n\n File f=new File(\"C:/InputPayloads/Payloads/test4.xml\");\n JMSTextMessage message = (JMSTextMessage) session.createTextMessage(FileUtils.readFileToString(f)); \n message.setStringProperty(\"JMS_IBM_MQMD_UserIdentifier\", \"avada2\");\n\n\n // Hex-string 010203040506070801020304050607080102030405060708\n byte[] customMessageId = new byte[24];\n for (int i = 0; i < 24; i++) {\n customMessageId[i] = (byte) ((i % 8) + 1);\n }\n\n message.setObjectProperty(WMQConstants.JMS_IBM_MQMD_MSGID, customMessageId);\n\n\n message.setStringProperty(\"xxx\", \"SH_TEST04\");\n message.setStringProperty(\"yyy\", \"JP\");\n message.setStringProperty(\"zzz\", \"1\");\n connection.start();\n\n System.out.println(\"before Sent message:\\\\n\" + message);\n\n sender.send(message);\n System.out.println(\"Sent message:\\\\n\" + message);\n\n sender.close();\n session.close();\n connection.close();\n }catch(Exception e)\n {\n System.out.println(e);\n }\n}}\nI am getting below errorcom.ibm.msg.client.jms.DetailedJMSSecurityException: JMSWMQ2008: Failed to open MQ queue 'WW.zzz.xxx.yyy.zz'.JMS attempted to perform an MQOPEN, but IBM MQ reported an error.\nUse the linked exception to determine the cause of this error. Check that the specified queue and queue manager are defined correctly.due to this line### Assistant: The JMS Spec indicates that the message ID must be set by the JMS provider and that it must either be unique or null, i.e. you can't set it yourself.However, you can use an IBM MQ specific extension to set the Message ID yourself, bearing in mind that you are now breaking the JMS Spec.To do so, you need to setJMS_IBM_MQMD_MsgId, whose value is then copied intoJMSMessageID(i.e. you can't set it directly).Now you know the name of the attribute to set, seethis other questionfor more details and a code example in an answer from an IBM MQ JMS expert (@Calanais).Further readingJMS message object propertiesReading and writing the message descriptor from a WebSphere MQ classes for JMS application\n"} +{"text": "### Human: I am able to connect to TDE MQ using CCDT file with User id and password in Java. I am unable to do that in Python.In Python I have set the environment variable for MQCHLLIB and MQCHLTAB, but when I try to connect using pymqi.connect, I am getting MQRC 2538. My code is as belowimport pymqi\nimport os\n\nos.environ['MQCHLLIB']='/root/pythonmq/'\nos.environ['MQCHLTAB']='APPTDECH.TAB'\n\nqueue_manager = 'QM_APP'\nuser = \"******\" \npassword = \"*****\"\n\nqmgr = pymqi.connect(queue_manager, pymqi.CD(),None, user, password )\n\nprint('Connected')\n\nqmgr.disconnect()The exception is :pymqi.MQMIError: MQI Error. Comp: 2, Reason 2538: FAILED: MQRC_HOST_NOT_AVAILABLE.Please let me know if anybody know how can I make this happen.### Assistant: In order to use the CCDT, you have to use the version ofpymqi.connectthat doesn't specify channel stuff (e.g.pymqi.CD()), e.g.qmgr = pymqi.connect(queue_manager)However, then you don't have any parameters to put theuserandpasswordinto.In short, the Python interface doesn't have all the combinations you need.IBM MQ supplied an exit calledmqccredwhich can substitute in the credentials for you, for applications that either can't be changed, or in your case don't have the ability to, pass a user id and password.Further ReadingBlog Post: MQ V8 - mqccred exitIBM Knowledge Center: Client side security exit to insert user ID and password (mqccred)\n"} +{"text": "### Human: In my JavaEE application, I read messages from and IBM MQ queue in the following way:@TransactionAttribute(TransactionAttributeType.REQUIRED)\n public class MyMessageHandler implements MessageListener {\n @Resource\n private MessageDrivenContext context;\n\n @Override\n public void onMessage(Message message) {\n try {\n processMessage(message);\n\n }\n catch (Exception e) {\n context.setRollbackOnly();\n } \n}The application is deployed on Jboss EAP 6.4, and the wmq.jms.rar adapter ( Implementation-Version: 7.1.0.0-k000-L111005) is used.\nHere is the activation config from ejb-jar.xml:\n MyMessageHandler\n MyMessageHandler\n org.example.MyMessageHandler\n Container\n \n \n hostName\n ${somejbossproperty}\n \n \n port\n ${somejbossproperty}\n \n \n channel\n ${somejbossproperty}\n \n \n queueManager\n ${somejbossproperty}\n \n \n transportType\n ${somejbossproperty}\n \n \n username\n ${somejbossproperty}\n \n \n password\n ${somejbossproperty}\n \n \n destinationType\n javax.jms.Queue\n \n \n destination\n ${somejbossproperty}\n \n \n acknowledgeMode\n auto-acknowledge\n \n \nWhen an exception is thrown, the transaction is rolled back, and the message is put into the IBM MQ backout queue using the IBM MQ backout mechanism. However, I notice a growth in the number of connections, and they are not released.\nThis is how I monitor the number of connections on the IBM MQ server:echo \"display conn(*) all\" | runmqsc | grep | wc -lWhy can it happen?### Assistant: It seems that the issue was due to the version of the wmq.jms.rar-adapter. When we upgraded to a newer version (7.5.0.9-p750-009-180830), the connection leak stopped.\n"} +{"text": "### Human: I am using IBM provided sample program amqsevt to monitor MQ event queues and parse the messages. But I notice that by default the event creation time is represented in GMT time. I would like to get it converted to System local time. Is there a way to accomplish this?**** Message #1 (120 Bytes) on Queue SYSTEM.ADMIN.CHANNEL.EVENT ****\nEvent Type : Channel Event [46]\nReason : Channel Stopped By User [2279]\nEvent created : 2018/09/04 20:17:39.48 GMT### Assistant: The source for the sample can be found on Linux with MQ installed in/opt/mqmat/opt/mqm/samp/amqsevta.c.In theMQMD(Message Descriptor) of every message there is aPutDateandPutTimefield that is always stored in GMT and are each simple 8 digit strings for example:PutDate: 20180904 (YYYYMMDD)PutTime: 20173948 (HHMMSSSS)In the sample program it just converts that to the displayed format of2018/09/04 20:17:39.48and appendsGMTto the end since it knows this is always in GMT./**********************************************************/\n /* Timestamp is read from the MQMD - it is always in GMT */\n /* regardless of local timezone. Do not want to try to */\n /* convert it, because this machine may be a client in a */\n /* different timezone than the server generating the */\n /* event. So stick to GMT (or UCT if you prefer). */\n /**********************************************************/\n sprintf(valbuf,\"%4.4s/%2.2s/%2.2s %2.2s:%2.2s:%2.2s.%2.2s GMT\",\n &pMsgDesc->PutDate[0],\n &pMsgDesc->PutDate[4],\n &pMsgDesc->PutDate[6],\n &pMsgDesc->PutTime[0],\n &pMsgDesc->PutTime[2],\n &pMsgDesc->PutTime[4],\n &pMsgDesc->PutTime[6]);\n printLine(offset,\"Event created\",valbuf);It looks like you could use the c functionstrptimeto parse the string into a epoch time stamp and then print that in your local time zone.\n"} +{"text": "### Human: I am connecting MQ-8.x from Mule via JMS and recently I had faced an issue that seems like MQ write operation is going out of sync point range and due to this and also the huge inbound load, MQ went in to deadlock state.\n \n \n \n \n \n \n\n \n\nMy operation volume will be move but its just a PUT operation, so I am really not sure whether XA or other Transaction manager to be needed in this.### Assistant: This has been handled in MQ-9.x version that MQ itself will manage the out of sync point implicitly. MQ-9.x upgrade will be the solution for this kind of issue.https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.dev.doc/q026865_.html\n"} +{"text": "### Human: The theory is that when publishing in a cluster topic, a copy of the message is delivered to all queue managers subscribed to that topic via a subscription object.The question is a pure theoretical one: \nis the copy of the message delivered to the target queue manager via cluster channels? Are the cluster channels used for this purpose?If the answer is no, then which is the mechanism that delivers a copy of the publication from origin to destination?### Assistant: The short answer is yes IBM MQ uses cluster channels to deliver messages published to clustered topics if the publisher is not local to the queue manager where a subscription is made.The longer answer is that for IBM MQ v7.0/7.1/7.5 the delivery was always directly from the queue manager were the publish happened to all the queue managers that registered proxy subscriptions to that topic.The issue with this is that every queue manager in the cluster needs to know about every other queue manager in the cluster AND every subscriber to any clustered topic in the cluster. In a large cluster even if only two queue managers are participating in the clustered pub/sub every queue manager in the cluster needs to know about every other queue manager and the subscriptions.When you first cluster a topic on a PR (partial repository) queue manager it would notify the FRs (full repositories) about the new topic and they would then send this out to every PR queue manager in the cluster along with information about how to connect to every other PR in the cluster. If you had a thousand PR queue managers in the cluster that means each PRs will now have knowledge of the 999 other PRs.In addition when you add a subscription to a clustered topic on any PR, that PR will connect out to every other PR and tell it to setup a proxy subscription, that means that PR will start 999 CLUSSDR channels to propagate this proxy subscription.After this initial propagation of information, if only two PRs were using pub/sub, for example publisher app publishes to the topic on PR1 and subscriber app subscribes to the topic on PR2, other than cluster updates about the topic there would be communication only between PR1 and PR2.This is different than clustered QUEUE behavior. When you first cluster a QUEUE the PR queue manager it will notify the FRs (full repositories) about the QUEUE. At this point the FRs do not need to notify other PRs (they do how ever notify the other FRs). If you then want to put to that clustered queue on another PR, if the PR does not know about the queue it will go to the FR to see if the queue exists and if it does the FR sends information about it to the PR. The FR then knows that the PR has interest in that object and any further updates to the clustered QUEUE are only sent to the interested PRs. PRs also periodically will let the FR know they are still interested if applications continue to put to the clustered queue to keep this interest alive, but if applications stop using the queue eventually the PR will not express interest and the FR will stop sending updates to that PR.In MQ v8 IBM added routed pub/sub for clusters and the original is now called direct pub/sub.You can now change the behavior of a clustered topic with the new attributeCLROUTE, this can be set toDIRECTwhich is the default and works as things did before MQ v8, or you can get the new behavior by setting it toTOPICHOST.The first part of what I said remains the same in that every PR in the cluster will get a update from the FR about the new clustered TOPIC, but they will only learn about the one PR that you defined the TOPIC on not all other queue managers in the cluster.When a subscription is made to a TOPIC, the PR where the subscription is made will only connect to the PR that has the clustered TOPIC defined withCLROUTE(TOPICHOST), not to all other PRs to create the proxy subscription. If a message is published to the topic on any PR, that PR will send it to only to the TOPICHOST which will then send it to the other PRs that notified it of the proxy subscription. (Note you can and should have more than one TOPICHOST for redundancy, but I didn't get into those details).Angel Rivera from IBM MQ L2 support presented a Webcast on this topic that is very good, you can access the PDF and MP3 of the audio here:MQ Pub/Sub: Topic host routing clusters.\n"} +{"text": "### Human: I am completely new to WebSphere MQ, but instead I have worked with NServiceBus as messaging system.The situation that I face is that I have two systems, both using their own WebSphere MQ, and I need the endpoints in one of those systems to receive and send messages to the other system, and vice versa.It is worth mentioning that The two systems are deployed in two separate infrastructures, and there will be security restrictions which basically mean that the endpoints on each system should not be able to access the resources in the other system.Is there any bridging mechanism that could allow to create a single and secured point of integration between the two infrastructures, which would then copy messages from the queues in one side to another?### Assistant: You have two systems both using their own WebSphere MQ queue manager. I will call them QM1 and QM2 for this answer. You will need to make some definitions like the following to join them together.On QM1 create these:DEFINE QLOCAL(QM2) USAGE(XMITQ) +\n DESCR('Transmission queue for messages being delivered to QM2')\n\nDEFINE CHANNEL(TO.QM2) CHLTYPE(SDR) CONNAME('ipaddr-qm2(port-qm2)') XMITQ(QM2) +\n DESCR('Sender channel to move messages to QM2')\n\nDEFINE CHANNEL(TO.QM1) CHLTYPE(RCVR) +\n DESCR('Receiver channel is receive messages from QM1')On QM2 create these:DEFINE QLOCAL(QM1) USAGE(XMITQ) +\n DESCR('Transmission queue for messages being delivered to QM1')\n\nDEFINE CHANNEL(TO.QM1) CHLTYPE(SDR) CONNAME('ipaddr-qm1(port-qm1)') XMITQ(QM1) +\n DESCR('Sender channel to move messages to QM1')\n\nDEFINE CHANNEL(TO.QM2) CHLTYPE(RCVR) +\n DESCR('Receiver channel is receive messages from QM2')You can additionally look into creating digital certificates and using the various SSL/TLS settings to secure these connections between the two queue managers.You presumably have a queue where messages are put that need to move to the other system?If you make that queue into a QREMOTE instead of a QLOCAL then you can funnel it down the above channels to the other system.DEFINE QREMOTE(SEND.TO.QM2) RNAME(Q.ON.QM2) RQMNAME(QM2) XMITQ(QM2)If you already have messages on a QLOCAL on QM1 that need to get to QM2 (and vice versa) then you will need a simple pipe application to get them from where they currently reside and put them to the QREMOTE defined above. Something like QLOAD could do this.\n"} +{"text": "### Human: We are seeing the frequent JVM hung in Apache camel based application whenever there is a network/connection issue to the IBM MQ.The logger clearly says the connection problem happened and Spring CachingConnectionFactory is trying to reset the underlying MQ connection. Looks like there is an hand-off issue between Spring and IBM MQ Lib when resetting the connection.Jul 13, 2018 8:51:48 PM org.springframework.jms.connection.CachingConnectionFactory onException\nWARNING: Encountered a JMSException - resetting the underlying JMS Connection\ncom.ibm.msg.client.jms.DetailedJMSException: JMSWMQ1107: A problem with this connection has occurred.\nAn error has occurred with the IBM MQ JMS connection.\nCaused by: com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2009' ('MQRC_CONNECTION_BROKEN').\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:203)\n ... 220 more\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2009At exactly the same timestamp, the JVM gets hung and DMLC is no longer processing the messages. But I do see the 20 listeners count on the consumer queue.I took a thread dump of the process and I see hung/blocked threads which causes the JVM to be hung.Here is the JMSCCThreadPoolWorker stacktrace which is waiting because of blocked thread.JMSCCThreadPoolWorker-727742 \nStack Trace is: \njava.lang.Thread.State: WAITING (parking)\nat sun.misc.Unsafe.park(Native Method)\n- parking to wait for <0x00000006d75964c0> (a java.util.concurrent.locks.ReentrantReadWriteLock$FairSync)\nat java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)\nat java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:836)\nat java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:870)\nat java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1199)\nat java.util.concurrent.locks.ReentrantReadWriteLock$WriteLock.lock(ReentrantReadWriteLock.java:943)\nat com.ibm.msg.client.jms.internal.JmsSessionImpl$ReentrantDoubleLock.getExclusiveLock(JmsSessionImpl.java:4931)\nat com.ibm.msg.client.jms.internal.JmsSessionImpl.stop(JmsSessionImpl.java:2521)\nat com.ibm.msg.client.jms.internal.JmsSessionImpl.stop(JmsSessionImpl.java:2498)\nat com.ibm.msg.client.jms.internal.JmsConnectionImpl.stop(JmsConnectionImpl.java:1263)\n- locked <0x00000006ca146118> (a com.ibm.msg.client.jms.internal.State)\nat com.ibm.mq.jms.MQConnection.stop(MQConnection.java:473)\nat org.springframework.jms.connection.SingleConnectionFactory.closeConnection(SingleConnectionFactory.java:452)\nat org.springframework.jms.connection.SingleConnectionFactory.resetConnection(SingleConnectionFactory.java:345)\n- locked <0x00000006cfba30c8> (a java.lang.Object)\nat org.springframework.jms.connection.CachingConnectionFactory.resetConnection(CachingConnectionFactory.java:207)\nat org.springframework.jms.connection.SingleConnectionFactory.onException(SingleConnectionFactory.java:323)\nat org.springframework.jms.connection.SingleConnectionFactory$AggregatedExceptionListener.onException(SingleConnectionFactory.java:673)\n- locked <0x00000006cfba30c8> (a java.lang.Object)\nat com.ibm.msg.client.jms.internal.JmsProviderExceptionListener.run(JmsProviderExceptionListener.java:413)\nat com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.runTask(WorkQueueItem.java:319)\nat com.ibm.msg.client.commonservices.workqueue.SimpleWorkQueueItem.runItem(SimpleWorkQueueItem.java:99)\nat com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.run(WorkQueueItem.java:343)\nat com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.runWorkQueueItem(WorkQueueManager.java:312)\nat com.ibm.msg.client.commonservices.j2se.workqueue.WorkQueueManagerImplementation$ThreadPoolWorker.run(WorkQueueManagerImplementation.java:1227)\nLocked ownable synchronizers:\n- <0x00000006ca05eb40> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)Here is the stacktrace of blocked thread:Stack Trace is: \njava.lang.Thread.State: BLOCKED (on object monitor)\nat org.springframework.jms.connection.SingleConnectionFactory.getConnection(SingleConnectionFactory.java:281)\n- waiting to lock <0x00000006cfba30c8> (a java.lang.Object)\nat org.springframework.jms.connection.SingleConnectionFactory.createConnection(SingleConnectionFactory.java:224)\nat org.springframework.jms.connection.JmsTransactionManager.createConnection(JmsTransactionManager.java:288)\nat org.springframework.jms.connection.JmsTransactionManager.doBegin(JmsTransactionManager.java:186)\nat org.springframework.transaction.support.AbstractPlatformTransactionManager.handleExistingTransaction(AbstractPlatformTransactionManager.java:429)\nat org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:349)\nat org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)\nat org.apache.camel.spring.spi.TransactionErrorHandler.doInTransactionTemplate(TransactionErrorHandler.java:176)\nat org.apache.camel.spring.spi.TransactionErrorHandler.processInTransaction(TransactionErrorHandler.java:136)\nat org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:105)\nat org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:172)\nat org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:97)\nat org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:172)\nat org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:62)\nat org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)\nat org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)\nat org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)\nat org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:97)\nat org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:172)\nat org.apache.camel.processor.Pipeline.process(Pipeline.java:120)\nat org.apache.camel.processor.Pipeline.process(Pipeline.java:83)\nat org.apache.camel.processor.FatalFallbackErrorHandler.process(FatalFallbackErrorHandler.java:81)\nat org.apache.camel.processor.RedeliveryErrorHandler.deliverToFailureProcessor(RedeliveryErrorHandler.java:1057)\nat org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:468)\nat org.apache.camel.spring.spi.TransactionErrorHandler.processByErrorHandler(TransactionErrorHandler.java:220)\nat org.apache.camel.spring.spi.TransactionErrorHandler$1.doInTransactionWithoutResult(TransactionErrorHandler.java:183)\nat org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:34)\nat org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)\nat org.apache.camel.spring.spi.TransactionErrorHandler.doInTransactionTemplate(TransactionErrorHandler.java:176)\nat org.apache.camel.spring.spi.TransactionErrorHandler.processInTransaction(TransactionErrorHandler.java:136)\nat org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:105)\nat org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:172)\nat org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:97)\nat org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:172)\nat org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:62)\nat org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)\nat org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)\nat org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)\nat org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:542)\nat org.apache.camel.spring.spi.TransactionErrorHandler.processByErrorHandler(TransactionErrorHandler.java:220)\nat org.apache.camel.spring.spi.TransactionErrorHandler$1.doInTransactionWithoutResult(TransactionErrorHandler.java:183)\nat org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:34)\nat org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)\nat org.apache.camel.spring.spi.TransactionErrorHandler.doInTransactionTemplate(TransactionErrorHandler.java:176)\nat org.apache.camel.spring.spi.TransactionErrorHandler.processInTransaction(TransactionErrorHandler.java:136)\nat org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:105)\nat org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:114)\nat org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)\nat org.apache.camel.processor.Pipeline.process(Pipeline.java:120)\nat org.apache.camel.processor.Pipeline.process(Pipeline.java:83)\nat org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)\nat org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:97)\nat org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:112)\nat org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:721)\nat org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:681)\nat org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:651)\nat org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:317)\nat org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:235)\nat org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1166)\nat org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1060)\nat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\nat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\nat java.lang.Thread.run(Thread.java:748)\nLocked ownable synchronizers:\n- <0x00000006d0b19600> (a java.util.concurrent.ThreadPoolExecutor$Worker)### Assistant: You need to figure out which thread ownsReentrantLock < 0x00000006d75964c0>; it won't show in the stack trace.It's probably a deadlock in the IBM client - either a thread has failed to unlock it or they have a lock order problem.You might look for a thread that is blocked trying to synchronize on- waiting to lock <0x00000006ca146118> (a com.ibm.msg.client.jms.internal.State)It could be that that thread has already acquired theReentrantLock. If no such thread exists then it's likely the former case (failure to unlock).In any case, the deadlock appears to be in the IBM code. Tough to debug since (last time I looked) the MQ client is closed-source. You might need to open a ticket with IBM; assuming you have support there.\n"} +{"text": "### Human: I am trying to connect to a remote QM using SSL from an AIX Machine.I have setup my QM and Channel to allow SSL connections.I have created a KeyStore on the Server (Machine containing the above QM + Channel) and have exported its self signed certificate and imported the certificate from the Client.I have used GSK on the AIX machine to create an Keystore in which both Self Signed and Signer of the Server are present.Client Code is as below when trying to connect to the QM. This code does work on Windows however does not work on AIX which leads me to believe this is a certificate issue which i have done wrong and not a code issue.the CipherSpec is - TLS_RSA_WITH_AES_256_CBC_SHA256\nand the keystore location is correct.m_QChannel.setChannelName(m_strChannelName);\n m_QChannel.setConnectionName(m_pParent->GetName());\n m_QChannel.setTransportType( MQXPT_TCP );\n\n if (!m_strCipherSpec.IsEmpty())\n {\n m_QChannel.setSslCipherSpecification(m_strCipherSpec);\n\n if (!m_strKeyStore.IsEmpty())\n {\n m_QMgr.setKeyRepository(m_strKeyStore);\n }\n else\n {\n CString strKeyStore = getenv(\"MQSSLKEYR\");\n m_QMgr.setKeyRepository(strKeyStore);\n }\n }\n\n //Set the queue manager options\n m_QMgr.setName(m_strName);\n m_QMgr.setChannelReference(&m_QChannel);\n\n if (!m_QMgr.connect()) \n {\n m_iLastError =m_QMgr.reasonCode( ) ;\n\n return false; \n }However when i try to run my application to connect i get a MQRC 2393 Error returned, When checking the Error logs it complains about the Certificates.I have tried Restarting the QM, Restarting the Channel, Refreshing the SSL but all with no luck. What have i missed ?Any help appreciated.### Assistant: The current label of the client cert you have isibmwebspherebldaix02.For a MQI client app the default cert label that MQ will look for is the stringibmwebspheremqfollowed by the name of the user that the application is running as all in lowercase.In this case it does not meet the first part of the default's requirement since it starts out asibmwebsphereand is missing themqand is then followed bybldaix02.You have a few options:If the user isbldaix02then you can rename the cert in the keystore toibmwebspheremqbldaix02. If that is not the username then rename the cert toibmwebspheremqall in lowercase. This option should work with all version of the IBM MQ product.If you are using IBM MQ v7.0 - 7.5 (these are all out of support), you could tell MQ to use the Default cert by setting the environment variableAMQ_SSL_ALLOW_DEFAULT_CERTto any value before starting the application or if doing it within the program, do it before calling connect. Note this feature was removed in the initial versions of IBM MQ v8.0 and v9.0 but was later added back at 8.0.0.7 and 9.0.0.1 and later.If you are using IBM MQ v8.0 or later (you should be since these are the only currently supported versions) you can tell MQ to look for a different label. You can do this in four ways:If using a CCDT set theCERTLABLattribute of theCLNTCONNchannel.Programmatically set theCertificateLabelattribute in theMQSCOSet the environment variableMQCERTLABLbefore starting the application or if doing it within the program, do it before calling connect.Using theCertificateLabelattribute of theSSL:stanza in the mqclient.ini.Note:there are various ways MQ will find the mqclient.ini and these are detailed in both the IBM MQ Knowledge center and various answers here on StackOverflow.You can find more information in the following links:Technote: Specifying the userid in the SSL certificate label for an MQ clientIBM MQ 8.0.0 Knowledge Center > IBM MQ > Security > Security overview > IBM MQ security mechanisms > Security protocols in IBM MQ> The SSL or TLS key repository > Digital certificate labels, understanding the requirements\n"} +{"text": "### Human: I'm trying to combine suggestions on how to use SSL with openshift :https://blog.openshift.com/openshift-demo-part-13-using-ssl/with those on how to use ssl with mq:Spring Configuration for JMS (Websphere MQ - SSL, Tomcat, JNDI, Non IBM JRE)So I managed to modify my Spring Boot Camel app to move from connection via svrconn mq channel without SSL to one that uses SSL,\nby adding SSLCipherSuite property to com.ibm.mq.jms.MQConnectionFactory bean, and by adding these VM arguments to Run Configuration\n(as described in the second linked document):-Djavax.net.ssl.trustStore=C:\\path-to-keystore\\key.jks\n-Djavax.net.ssl.trustStorePassword=topsecret\n-Djavax.net.ssl.keyStore=C:\\path-to-keystore\\key.jks\n-Djavax.net.ssl.keyStorePassword=topsecret\n-Dcom.ibm.mq.cfg.useIBMCipherMappings=falseAnd it works fine locally on embedded Tomcat server, however, I would need to deploy it to Openshift, so my first impulse was\nto add the same VM arguments to those that I use for Openshift deployment, that is these ones:-Dkubernetes.master=\n-Dkubernetes.namespace=\n-Dkubernetes.auth.basic.username=\n-Dkubernetes.auth.basic.password=\n-Dkubernetes.trust.certificates=\n-Dfabric8.mode=openshiftbut it obviously doesn't work, for example because I don't have the same path to keystore. So I investigated it a bit,\nand learned that I have to use secrets, that can be defined via CLI >>oc secrets new<< command, or via Openshift console, \nbut I don't understand how exactly to proceed.\nDo I have to add parameters to image, or environment variables to deployment config or something else? \nSomehow it has to reference the defined secrets, and it has to be named by changing each dot with underscore in its name?\nSo, for example if I issue:oc secrets new my-key-jks key.jksthen I have to >>Add Value from Config Map or Secret<>Crash Loop Back-off<<, and >>The logs are no longer available or could not be loaded.<< Without SSL, the same app runs fine on Openshift.### Assistant: IMHO you are misinterpreting some of the settings you specify here.1.The VM arguments after \"-Dkubernetes.master=\" you specify here I assume are meant to be given to the fabric8 maven plugin which you use for deployment. Right?The parameters that are about authentication/certificates here are ONLY for the communication to kubernetes and NOT intended for giving keystore data to your application to use. So I think they are unrelated.Instead you need to ensure that inside your container your app gets started with the same parameters that you use for local execution. Of course you then would have to change the parameter values to where the respective data is available inside your container.2.Secrets are a tool to add sensitive data to your deployment that you don't want to be baked into your application image. So for example your keystores and the keystore passwords would qualify to be injected via secret.An alternative to providing secret data as environment variable, like you tried, is to just mount them into the filesystem which makes the secret data available as files. As your application needs the JKS as a file you could do the following.In the web console on your deployment, use the link \"Add config files\" under section \"Volumes\"Select the secret \"my-key-jks\" created before as \"source\".Specify some path where the secret should be mounted inside your container, for example \"/secret\". Then click \"Add\".You jks will then be available inside your container under path \"/secret/key.jks\" so your applications parameter can point to this path.\n"} +{"text": "### Human: When I am writing message in MQ queue through JMS, RFH header is also getting added with message as its property.Property includingJms delivery ModeJMS DestinationJMS TimestampMcd.msdCan anyone explain me its use and significance?### Assistant: The RFH header only allow for a single header to exist in a message, and the RFH2 header allow multiples headers to exist in a message.I'm not going to explain, this site explained it better than I can :New Link (previous one was not working anymore)https://docs.actian.com/dataconnect/11.4/index.html#page/User/RFH_Header_Support_3a_Websphere_MQ.htmI hope it will help you !\n"} +{"text": "### Human: I am sending a messages to MQ from my Java application. And I want to get the acknowledgement on the message I pushed. I know we can request COA (Conformation on arrival) from MQ Manager. But I want to know which COA corresponds to the message I pushed.For example, I pushed two messages and I got one COA. So how to identify which message has failed to reach MQ. Is there any identification in COA like, this COA is for message1 something like that?I am using Java8 and IBM MQ core library to push the message.### Assistant: By default Correlation ID of the COA message will be same as the message id of the original message. So you can compare the Correlation ID of a COA message with the message id of the message you have put. See the description of MQRO_COPY_MSG_ID_TO_CORREL_IDhere.\n"} +{"text": "### Human: I was executing two mqsc commands on IBM MQ v8 to find out the number of connections made by App1 on queue manager QMGR and found a discrepancy between the output values on one of the attribute called CONNAMEecho 'dis chs('APP1.SVRCONN.CHL')'| runmqsc QMGR | grep CONNAMEThis time I got 14 IP's as CONNAMEecho 'dis qs(APP1.QUEUE) type(handle) All where(CHANNEL eq 'APP1.SVRCONN.CHL')'| runmqsc QMGR | grep CONNAMEWhen I checked the number of handles on the only App1 queue connected by App1 channel I got only 7 IP's as CONNAMESo there are 7 handles on the App1 queue but there are 14 connections by the App1 channel on queue manager. How can I relate these two values? Is this multi-threaded connections on each queue handles and if so how can I find a relationship between them?### Assistant: TheDIS CHScommand will show you how many channel instances are running which is really how many TCP sessions there are established between your client and the queue manager.MQ v7.0.1 and higher supports shared conversations within each channel. Each time the app makes a connection to the queue manager this can be another conversation in the same channel instance. The client and the server can set a maximum number of shared connections. On the queue manager'sSVRCONNthe attribute isSHARECNV, on the client it could be in a CCDT or programatically. When the channel starts up the client and server will negotiate to the lowest value between them. On aDIS CHSyou can addMAXSHCNVto see what the running channel instances negotiated the maximum to andCURSHCNVto see how many conversations are running in each channel instance.TheDIS QScommand withTYPE(HANDLE)will only show you connections where the application has a handle open to that queue at the point in time you ran the command.An application can connect to the queue manager without having a queue open, or it may open and close the queue, if you don't catch it with the queue open you won't see a handle.A more accurate command to show what the channel is doing isDIS CONNwhich will show all connections, each connection represents a conversation, so the number of connections should match the number total ofCURSHCNVfrom all channel instances.The following command will show you all connections running through a channel with the name specified.echo \"DIS CONN(*) TYPE(ALL) WHERE(CHANNEL EQ APP1.SVRCONN.CHL)\"|runmqsc QMGRThe output may look like this:AMQ8276: Display Connection details.\n CONN(ABABABABABABABAB)\n EXTCONN(ABABABABABABABABABABABABABABABAB)\n TYPE(*)\n PID(99998) TID(998)\n APPLDESC(WebSphere MQ Channel) APPLTAG(App1)\n APPLTYPE(USER) ASTATE(NONE)\n CHANNEL(APP1.SVRCONN.CHL) CLIENTID( )\n CONNAME(10.10.10.10)\n CONNOPTS(MQCNO_HANDLE_SHARE_BLOCK,MQCNO_SHARED_BINDING)\n USERID(appuser) UOWLOG( )\n UOWSTDA( ) UOWSTTI( )\n UOWLOGDA( ) UOWLOGTI( )\n URTYPE(QMGR)\n EXTURID(XA_FORMATID[] XA_GTRID[] XA_BQUAL[])\n QMURID(0.0) UOWSTATE(NONE)\nAMQ8276: Display Connection details.\n CONN(BABABABABABABABA)\n EXTCONN(BABABABABABABABABABABABABABABABA)\n TYPE(*)\n PID(99999) TID(999)\n APPLDESC(WebSphere MQ Channel) APPLTAG(App1)\n APPLTYPE(USER) ASTATE(STARTED)\n CHANNEL(APP1.SVRCONN.CHL) CLIENTID( )\n CONNAME(10.10.10.10)\n CONNOPTS(MQCNO_HANDLE_SHARE_BLOCK,MQCNO_SHARED_BINDING)\n USERID(appuser) UOWLOG( )\n UOWSTDA(2018-05-21) UOWSTTI(10.11.27)\n UOWLOGDA( ) UOWLOGTI( )\n URTYPE(QMGR)\n EXTURID(XA_FORMATID[] XA_GTRID[] XA_BQUAL[])\n QMURID(0.99999) UOWSTATE(ACTIVE)\n\n OBJNAME(APP1.QUEUE) OBJTYPE(QUEUE)\n ASTATE(ACTIVE) HSTATE(INACTIVE)\n OPENOPTS(MQOO_INPUT_SHARED,MQOO_BROWSE,MQOO_INQUIRE,MQOO_SAVE_ALL_CONTEXT,MQOO_FAIL_IF_QUIESCING)\n READA(NO)In the above outputCONN(ABABABABABABABAB)only has a connection to the queue manager and no objects open whileCONN(BABABABABABABABA)had a connection to the queue manager and has the queueAPP1.QUEUEopen.If you were to add to the above command|grep 'APP1.QUEUE'the count should match the number of handles from theDIS QScommand.You may have a app that browses the queue on one connection to look for messages and then dispatches to other threads to actually process the messages. In your case 7 channel instances may have the queue open for BROWSE and the other 7 would be waiting to open the queue for INPUT to read a message off.Below is a command I use on Linux that will spit out a CSV format of theDIS CONNcommand along with each object that is open.echo \"DIS CONN(*) TYPE(ALL) WHERE(CHANNEL EQ CHL_NAME)\"|runmqsc QMGR|grep -o '^\\w\\+:\\|\\w\\+[(][^)]\\+[)]' | awk -F '[()]' -v OFS='\",\"' 'function printValues() { if (\"CONN\" in p) { print p[\"CONN\"], p[\"CHANNEL\"], p[\"APPLTAG\"], p[\"USERID\"], p[\"CONNAME\"], p[\"OBJNAME\"], p[\"OBJTYPE\"], p[\"OPENOPTS\"] } } /^\\w+:/ { if (x !~ /YES/) {printValues()}; x = \"NO\"; delete p; next } { p[$1] = $2 } { if (\"OPENOPTS\" in p) { printValues() ; delete p[\"OPENOPTS\"]; x = \"YES\"} } END { if (x !~ /YES/) {printValues()} }'|sed -e 's/^/\"/g' -e 's/$/\"/g'The fields in the CSV output are:\"CONN\",\"CHANNEL\",\"APPLTAG\",\"USERID\",\"CONNAME\",\"OBJNAME\",\"OBJTYPE\",\"OPENOPTS\"Objects can be the QMGR itself, a QUEUE, TOPIC, etc. The CONN id will be repeated in lines of the output if the same CONN has multiple objects open. If the CONN has no objects open you will see a single entry with no objects listed at the end of the line, if at least one object is open there will not be a line representing no objects:\n"} +{"text": "### Human: I have been trying to connect IBM MQ to Kafka on my Ubuntu. I want to get the messages from MQ to Kafka. I am trying to use a connectorLink. I followed all the steps, but I keep on getting the following errors:host name supplied is not valid.andJMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2538' ('MQRC_HOST_NOT_AVAILABLE').I tried everything, but nothing seems to work. If anyone has faced the same issue, please let me know.My configuration includes the following line:-# A list of one or more host(port) entries for connecting to the queue manager. Entries are separated with a comma - required\nmq.connection.name.list=localhost:1414### Assistant: Turning Andrew Schofield's comment into an answer in case it gets lost in mist.Your configuration file has the following:-mq.connection.name.list=localhost:1414IBM MQ does not use the industry-standardhost:portsyntax. It useshost(port). Unfortunately, there was a (now fixed) mistake in the instructions.Please use the following syntax instead:-mq.connection.name.list=localhost(1414)\n"} +{"text": "### Human: I've been assigned the task of using Apache Jmeter to connect to an MQ. Unfortunately, I'm not the admin of the MQ, and all my attempts to get more information about it have gotten me nowhere. What I have now is a queue name (call it q), a queue manager (its name, anyway; call it v), a host (w), a port (x), a channel (y), a user (z), and a test message I'm supposed to send across. The object of the game is straightforward: send the test message from Apache Jmeter to the MQ (after which I'll ask the admins whether the message went through or not). In other words, I need help figuring out what to do with Jmeter.The MQ is version 8.0.0.4. I already have Jmeter installed, so I don't need advice on that (unless there's some special way it should have been installed for this task).The links provided inthisquestion's answer didn't get me very far. They seemed largely unrelated to what I was trying to do (and also imprecise in their instructions).### Assistant: Download8.0.0.4-WS-MQ-Install-Java-AllfileRun it likejava -jar 8.0.0.4-WS-MQ-Install-Java-All.jarand accept the license agreementAdd all .jars fromwmq/JavaSE/folder toJMeter ClasspathRestart JMeter to pick the .jars upAddJSR223 Samplerto your Test Plan and put the following code into \"Script\" area:import com.ibm.msg.client.jms.JmsFactoryFactory\nimport com.ibm.msg.client.wmq.WMQConstants\n\nimport javax.jms.Session\n\n// 1\ndef hostName = \"127.0.0.1\"\ndef hostPort = 1414\ndef channelName = \"DEV.APP.SVRCONN\"\ndef queueManagerName = \"QM1\"\ndef queueName = \"DEV.QUEUE.1\"\n\n// 2\ndef ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER)\ndef cf = ff.createConnectionFactory()\n\n// 3\ncf.setStringProperty(WMQConstants.WMQ_HOST_NAME, hostName)\ncf.setIntProperty(WMQConstants.WMQ_PORT, hostPort)\ncf.setStringProperty(WMQConstants.WMQ_CHANNEL, channelName)\ncf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT)\ncf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, queueManagerName)\n\n// 4\ndef conn = cf.createConnection(\"app\", \"\")\ndef sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE)\n\n// 5\ndef destination = sess.createQueue(queueName)\n\nconn.start()SeeIBM MQ testing with JMeter - Learn Howarticle for more information if needed.\n"} +{"text": "### Human: I'm learning IBM MQ. I need to put and get messages to IBM MQ from java code using the best practices.I did this question but I don't know if it's the best way:How to put and get IBM MQ messages without application serverCould you give me some tip about that, please?### Assistant: IBM provides sample code with the MQ install, you should look into those.There are samples for using MQ classes for Java and JMS as well.\nThe source for these samples are located under \"MQ install dir\"\\Tools on Windows.\n"} +{"text": "### Human: I am trying to send an MQ Message with MD and RFH2 headers set.\nI need the Message to appear like this on AppWatch.But the RFH2 part comes as a part of Message data as a continous string.am using the following code:MQMessage msg = new MQMessage();\nmsg.writeString(\"Data to go as Message Content\"); \n\n//Setting MQMD values\nmsg.persistence = MQConstants.MQPER_PERSISTANT;\nmsg.encoding = MQConstants.MQENC_S390;\nmsg.characterSet = 500;\n\n//Setting RFH2 Values\nMQRFH2 rfh2 = new MQRFH2();\nrfh2.setEncoding(CMSQC.MQENC_NATIVE);\nrfh2.setCodedCharSetId(CMSQC.MQCCSI_INHERIT);\nrfh2.setFormat(CMSQC.MQFMT_STRING);\nrfh2.setFlags(0);\nrfh2.setNameValueCCSID(1208);\nrfh2.setFieldValue(\"mcd\",\"msd\",\"jms_text\");\nrfh2.setNameValueData(123TEST123);\n\n//Setting the Header to the Message\nrfh2.write(msg);\n\nMQQueue queue = qmngr.accessQueue(qname,MQConstants.MQOO_OUTPUT);\nqueue.put(msg,pmo);\nqueue.close;Can someone help me out in setting the RFH2 Values properly.NOTE: The above screenshot is just a sample and code is not related to that screenshot### Assistant: But the RFH2 part comes as a part of Message data as a continous\n string.Yes, technically speaking, MQRFH2 header and folders are part of the message body.It appears I wasn't explicit enough in my others posts regarding MQRFH2 class. The order of how you do things is IMPORTANT.i.e. If you do A then B your message will be AB. If you do B then A your message will be BA. MQ does NOT reorder things.Have you ever looked at an MQRFH2 message in its raw form? see here:https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.ref.dev.doc/q099250_.htmThere are several tools that can show you the raw layout: amqsbcg, MQ Visual Edit, MO71, etc...From your code above, you did things backwards. You added the message payload then added the RFH2 header and folders. That is garbage to MQ.The correct sequence should be MQRFH2 followed by message payload.MQMessage msg = new MQMessage();\n\n//Setting RFH2 Values\nMQRFH2 rfh2 = new MQRFH2();\nrfh2.setEncoding(CMQC.MQENC_NATIVE);\nrfh2.setCodedCharSetId(CMQC.MQCCSI_INHERIT);\nrfh2.setFormat(CMQC.MQFMT_STRING);\nrfh2.setFlags(0);\nrfh2.setNameValueCCSID(1208);\nrfh2.setFieldValue(\"usr\", \"ENTRYNUM\", \"123\");\nrfh2.setFieldValue(\"usr\", \"text\", \"TEST123\");\n\n//Setting the Header to the Message\nrfh2.write(msg);\n\nmsg.writeString(\"Data to go as Message Content\");\n\n//Setting MQMD values\nmsg.persistence = CMQC.MQPER_PERSISTANT;\nmsg.format = CMQC.MQFMT_RF_HEADER_2;\n\nMQQueue queue = qmngr.accessQueue(qname, CMQC.MQOO_FAIL_IF_QUIESCING + CMQC.MQOO_OUTPUT);\nqueue.put(msg,pmo);\nqueue.close;Update April 5th 2018.Ok Faizan, by your comments below, you still are not getting it.I ran a sample JMS MQ program I have and it put the following message data on the queue: \"Nice simple test. Time in 'ms' is -> 1522946795894\".Note: I changed my MQ Visual Edit Preferences from \"Show message properties as Named Properties\" to \"Show message properties as an MQRFH2 structure in message body\". (see bottom of this posting about MQGetMessageOptions for more info).The first 3 screen-shots from MQ Visual Edit shows you how the message looks in the queue (as you are seeing it):Screen-shot #1 shows that the MQMD Format of the message is 'MQHRF2':Screen-shot #2 shows the message payload in HEX format:Screen-shot #3 shows the message properly formatted for MQRFH2:If I switch MQ Visual Edit's Preferences back to \"Show message properties as Named Properties\" then (THIS IS EXACTLY THE SAME MESSAGE):Screen-shot #4 shows that the MQMD Format of the message is 'MQSTR' (string):Screen-shot #5 shows the message payload in HEX format:Screen-shot #6 shows the message payload as:Screen-shot #7 shows that all the values from the MQRFH2 folders are now Named Properties:Note: In both cases, it is the SAME message but the difference is how you want the RECEIVING application to handle it.The MQGetMessageOptions class has an option field called 'options'. You can add (OR) either MQGMO_PROPERTIES_IN_HANDLE or MQGMO_PROPERTIES_FORCE_MQRFH2 option to that field. Right now, you appear to be using MQGMO_PROPERTIES_FORCE_MQRFH2. See here for more info:https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.ref.dev.doc/q096780_.htm\n"} +{"text": "### Human: I'm trying to send a message to IBM MQ (Version: 9.0.0.0), code bellow.* I have tried with\\without the userid and password. When I try the same code with IBM MQ installed on my machine (localhost) it works smoothly.private static void foo() throws JMSException {\n Request request = new Request();\n request.setRequestKey(\"11-12347\");\n request.setQueryString(\"This is a query string!\");\n\n MQQueueConnectionFactory cf = new MQQueueConnectionFactory();\n cf.setHostName(\"192.168.1.107\");\n cf.setPort(1414);\n cf.setAppName(\"WMQ Tester\");\n// cf.createConnection(sccsid, sccsid)\n cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\n cf.setQueueManager(\"SanctionManager\");\n cf.setChannel(\"system.def.sanction\");\n\n MQQueueConnection connection = (MQQueueConnection) cf.createQueueConnection(\"hanash\", \"hanash1\");\n MQQueueSession session = (MQQueueSession) connection.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);\n\n MQQueue queue = (MQQueue) session.createQueue(\"queue:///SanctionQueue\");\n MQQueueSender sender = (MQQueueSender) session.createSender(queue);\n\n ObjectMessage objectMessage = session.createObjectMessage(request);\n connection.start();\n sender.send(objectMessage);\n session.commit();\n\n }This gives the following exception:Exception in thread \"main\" com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0018: Failed to connect to queue manager 'SanctionManager' with connection mode 'Client' and host name '192.168.1.107(1414)'.\nCheck the queue manager is started and if running in client mode, check there is a listener running. Please see the linked exception for more information.\n at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:595)\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:215)\n at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:422)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:8475)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:7814)\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl._createConnection(JmsConnectionFactoryImpl.java:299)\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:236)\n at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6024)\n at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:136)\n at com.dgbi.cre.MQSample.foo(MQSample.java:135)\n at com.dgbi.cre.MQSample.main(MQSample.java:63)\nCaused by: com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2195' ('MQRC_UNEXPECTED_ERROR').\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:203)\n ... 9 more\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2195;AMQ9204: Connection to host '192.168.1.107(1414)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2195;AMQ6047: Conversion not supported. [1=720,5=???]],3=192.168.1.107(1414),5=RemoteConnection.initSess]\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:2280)\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1285)\n at com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.jmqiConnect(InterceptedJmqiImpl.java:376)\n at com.ibm.mq.ese.jmqi.ESEJMQI.jmqiConnect(ESEJMQI.java:563)\n at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:355)\n ... 8 more\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2195;AMQ6047: Conversion not supported. [1=720,5=???]\n at com.ibm.mq.jmqi.remote.impl.RemoteConnection.initSess(RemoteConnection.java:1282)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnection.connect(RemoteConnection.java:863)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSessionFromNewConnection(RemoteConnectionSpecification.java:409)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSession(RemoteConnectionSpecification.java:305)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionPool.getSession(RemoteConnectionPool.java:146)\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1721)\n ... 12 more\nCaused by: java.io.UnsupportedEncodingException: 720\n at com.ibm.mq.jmqi.remote.impl.RemoteConnection.initSess(RemoteConnection.java:1268)\n ... 17 moreWhat does this exception mean? and how can I solve it?### Assistant: The key errors in the exception is:Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2195;AMQ6047: Conversion not supported. [1=720,5=???]\nCaused by: java.io.UnsupportedEncodingException: 720It appears this is a known issue in IBM MQ v9.0.0.0 documented in the following APAR:IT17154: Java client fails to connect to z/OS with exception 'AMQ6047: conversion not supported' in a non-IBM Java runtimeThis APAR was fixed in 9.0.0.1. I would suggest you go with 9.0.0.3 which is the current LTS (Long Term Support) version.If you review the APAR and compare to your issue the difference is that you are connecting to a remote queue manager that is set with CCSID 720 (MSDOS ARABIC). The problem is that the Java JRE you are using does not support this CCSID and due to a defect the client does not attempt to renegotiate the CCSID to one supported by the JRE and the connection fails with the 2195 error.\n"} +{"text": "### Human: I am trying to put a message with an RFH2 header in a queue using MQPUT function. Said function returns completion code 2 and reason 2142 which according to IBM docs means that header structure is not valid. Docs on thislinkspecify the fields that need to be checked. Header and message descriptor have following contents:MQMD:\nStrucId = 'MD '\nVersion = 2\nReport = 0\nMsgType = 8\nExpiry = -1\nFeedback = 0\nEncoding = 273\nCodedCharSetId = 1208\nFormat = 'MQHRF2 '\nPriority = -1\nPersistence = 2\nMsgId = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\nCorrelId = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\nBackoutCount = 0\nReplyToQ = ''\nReplyToQMgr = ''\nUserIdentifier = ''\nAccountingToken = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\nApplIdentityData = ''\nPutApplType = 0\nPutApplName = ''\nPutDate = ''\nPutTime = ''\nApplOriginData = ''\nGroupId = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\nMsgSeqNumber = 1\nOffset = 0\nMsgFlags = 0\nOriginalLength = -1\n\nMQRFH2:\nStrucId = 'RFH '\nVersion = 2\nStrucLength = 128\nEncoding = 273\nCodedCharSetId = 0\nFormat = 'MQSTR '\nFlags = 0\nNameValueCCSID = 1208I fail to understand how come the header is invalid and how do I fix this.\nThanks in advance.int SendMessage(PMQHCONN connectionDescriptorPtr, PMQHOBJ queueDescriptorPtr, const char* payload, const char* message)\n{\n MQLONG completionResult;\n MQLONG reason;\n\n unsigned char* buffer = NULL;\n\n PMQRFH2 pHeader;\n\n PMQINT32 pNameValueLength;\n\n PMQCHAR pNameValueData;\n\n PMQCHAR pMessage;\n\n PMQCHAR p;\n\n MQLONG bufferLength;\n MQLONG structLength;\n MQLONG nameValueLength;\n\n size_t payloadLength = strlen(payload);\n size_t messageLength = strlen(message);\n size_t sizeOfLength = sizeof(MQINT32);\n size_t headerStructLength = MQRFH_STRUC_LENGTH_FIXED_2;\n size_t padding = CalcPadding(payload);\n size_t i;\n\n /* mqmd */\n MQMD md = {MQMD_DEFAULT};\n\n MQPMO pmo = {MQPMO_DEFAULT};\n\n structLength = (MQLONG) (headerStructLength + sizeOfLength + payloadLength + padding);\n\n /* calc total buffer length */\n bufferLength = (MQLONG) (headerStructLength + sizeOfLength + payloadLength + padding + messageLength);\n printf(\"Lengths:\\n\"\n \" Header:\\n\"\n \" structure : %zu\\n\"\n \" length field : %zu\\n\"\n \" payload : length = %zu, padding = %zu (total: %zu)\\n\"\n \" Total : %d\\n\"\n \" Message : %zu\\n\"\n \"Total : %d\\n\",\n headerStructLength,\n sizeOfLength,\n payloadLength, padding, payloadLength + padding,\n structLength,\n messageLength,\n bufferLength\n );\n\n buffer = malloc((size_t) bufferLength);\n\n /* setting up payload */\n nameValueLength = (MQLONG) payloadLength;\n pNameValueData = (PMQCHAR) (buffer + MQRFH_STRUC_LENGTH_FIXED_2 + sizeOfLength);\n memcpy(pNameValueData, payload, (size_t) nameValueLength);\n\n p = pNameValueData + nameValueLength;\n for (i = 0; i < padding; i++)\n {\n *p = ' ';\n p++;\n nameValueLength++;\n }\n\n /* setting up valueLength */\n pNameValueLength = (PMQINT32) (buffer + MQRFH_STRUC_LENGTH_FIXED_2);\n *pNameValueLength = nameValueLength;\n\n /* setting up message */\n pMessage = pNameValueData + nameValueLength;\n memcpy(pMessage, message, messageLength);\n\n /* setting up header */\n pHeader = (PMQRFH2) buffer;\n memcpy(pHeader, &DefaultHeader, MQRFH_STRUC_LENGTH_FIXED_2);\n memcpy(pHeader->Format, MQFMT_STRING, MQ_FORMAT_LENGTH);\n pHeader->CodedCharSetId = MQCCSI_INHERIT;\n pHeader->NameValueCCSID = 1208;\n pHeader->StrucLength = (MQLONG) (headerStructLength + sizeOfLength + nameValueLength); /* !!! */\n\n /* seeting up for put */\n memcpy(md.Format, MQFMT_RF_HEADER_2, MQ_FORMAT_LENGTH);\n md.MsgType = MQMT_DATAGRAM;\n md.Persistence = MQPER_PERSISTENT;\n\n pmo.Options = pmo.Options | MQPMO_NEW_MSG_ID | MQPMO_NO_SYNCPOINT;\n\n MQPUT(*connectionDescriptorPtr, *queueDescriptorPtr, &md, &pmo, bufferLength, buffer, &completionResult, &reason);\n free(buffer);\n printf(\"Message put in queue with code %d and reason %d\\n\", completionResult, reason);\n\n return 0;\n}I use the code above to setup the buffer to be sent.\nThe problem was narrowed down to the following cases:1) if I DO NOT set the StrucLength field in header (line with !!!), message is being successfully put in queue and carries the correct format and data that can be read in message browser2) if I DO set the field calculated correctly like in the code, the message is put in queue, but is displayed as MQSTR message type with no MQRFH2 header data3) if I DO set the field calculated INCORRECTLY, then I get the 2142 reason code, which apparently was the source of the problem in the first place.Now all of this has led me to a question:\nAm I not supposed to populate the StrucLength field manually if I put messages?### Assistant: The short answer to your question is you will need to set the length if you create the RFH2 header in the above fashion. The RFH2 header can vary in length. The default length will be MQRFH_STRUC_LENGTH_FIXED_2.Regarding why it doesn't display properly I don't have a good understanding of why that might be.I would recommend some RFH2 code samples for you to review. These samples can be found in your installation directory, for example: C:\\Program Files\\IBM\\WebSphere MQ\\Tools\\c\\Samples\\pubsub\\amqsgr2a.c. The samples in the pubsub directory have build RFH2 header functions. In these examples the length is explicitly set. They take a slightly different approach than you when it comes to obtaining and initializing storage.There is also the MQSETMP api, that I believe can be used to modify the RFH2 header. This api may also maintain and set the length for you in the RFH2 header. I haven't been able to find examples of its usage.Hope this helps.\n"} +{"text": "### Human: I have a Java EE aplication on IBM WAS 8.5.5.x which connects to IBM MQ 9.0 with Activation specs.\nI'm interested in problem of autoreconnecting from WAS to MQ, if for some reason there was a connection loss (MQ server was shut down).In IBM WAS admin console I have set Resources -> JMS -> Queue connection factories -> Factory -> Advanced properties -> Client reconnect options -> RECONNECTI set Client reconnect timeout to 120 seconds.That worked well (there was a reconnection) until queue manager was ended for a long period of time (about 9 hours).Am I doing something wrong ? Is there a way to make QCF or Activation Spec auto reconnect if there was a connection loss. Is there a limit on number of reconnetion tries ?### Assistant: This behavior can be controlled by updating the \"Reconnection retry count\" and \"Reconnection retry interval\" properties for \"WebSphere MQ messaging provider\" JMS provider in WAS console.Path :Resources > JMS Providers > WebSphere MQ messaging provider (select scope) > Resource adapter properties (under Additional properties) .Reconnection retry count: The maximum number of attempts made by a WebSphere MQ messaging provider activation specification to reconnect to a WebSphere MQ queue manager if a connection fails.Reconnection retry interval: The time, in milliseconds, that a WebSphere MQ messaging provider activation specification waits before making another attempt to reconnect to a WebSphere MQ queue manager.Refer :https://www.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.doc/ae/umj_pjmswmq_raprops.htmlfor more details.\n"} +{"text": "### Human: I am looking for an MQ Client to use with Python \\ Jython.Looking for a stand-alone program so that I dont have to install anything in the machine I am running as it may have to be run on multiple machines. So I guess Websphere is ruled out. Want something which is stand alone, may be a jar that can be imported through Jython but if something could work using Python compiler and additional library that would be great.### Assistant: As well as the download of the redistributable client that JoshMc mentions, you might be interested in the fact that the MQ jars are also available through Mavenhttps://developer.ibm.com/messaging/2018/01/09/developing-mq-java-applications-maven/There are also open source ways to talk to MQ with Python. For a simple pub/sub API there is the MQ Light API that talks AMQP to MQ (client can be found herehttps://github.com/mqlight/python-mqlight).There's also the PyMQI project (https://pythonhosted.org/pymqi/), this requires an MQ client on the system, so you'd use the same redistributable MQ client package to obtain that.\n"} +{"text": "### Human: I use Camel with Fuse, and I have trouble with setting JMSReplyTo. Here is an excerpt from my route:\n QTEST\n\n\n queue://QM_TEST/SYSTEM.DEFAULT.LOCAL.QUEUE?targetClient=1\n\nI took as an example the code given here:Implementing native websphere MQ with CoD over Camel JMS componentAt first, I thought it is because I removed unwanted jms header with targetClient=1 directive set in CamelJmsDestinationName header, but even without it, it won't set anything to ReplyToQ attribute of MQMD. I tried the suggestion given here tooHow to send message to different Queue hosted in different queue manager and hostname in IBM MQ cluster, but this also doesn't work for me, that is like this:queue://QM_TEST/QTEST?mdReadEnabled=true&messageBody=0&mdWriteEnabled=true&XMSC_WMQ_REPLYTO_STYLE=1&targetClient=1The question is why does it not work?### Assistant: I have figured out how to set ReplyToQ attribute, but this is only a part of the problem that I'm facing now. As explained here, in JMS Producer chapter:http://camel.apache.org/jms.htmlall that is needed is this:\n queue://QMib_TEST/OUTPUTQ?targetClient=1\n \n What this does is it puts request message to OUTPUTQ, and then listens on REPLYQ, but with matching some autogenerated Correlation ID. Good thing is that ReplyToQ is now set to REPLYQ in a request message, due to pattern=\"InOut\" setting, bad thing is that the in our case replying application responds with setting Correlation ID to Message ID of received request, all from MQMD, and this Camel pattern by default doesn't generate message id in MQMD of request equal to (JMS?) correlation ID that it expects, so that response remains in queue, not consumed, even though it was put in proper queue. In fact, it even repeats putting requests after a wait interval for get elapses, producing further reponse messages unconsumed in REPLYQ. So, that is another problem I have to solve, how to deal with MessageID and CorrelationID properly, but the one from the subject, I have solved.\n"} +{"text": "### Human: Could you please explain why there would be messages pending in the queue SYSTEM.CHLAUTH.DATA.QUEUE. There are 3 messages in the queue now.\nwhat if these messages are deleted. Will there be any issues if we delete these messages.\nAre those information messages about the channel authentication records?\nPlease suggest a resolution.### Assistant: The IBM MQ v7.5 Knowledge Center page \"Troubleshooting channel authentication recordsaddresses the topic of what theSYSTEM.CHLAUTH.DATA.QUEUEis used for.Behaviour of SET CHLAUTH command over queue manager restartIf the SYSTEM.CHLAUTH.DATA.QUEUE, has been deleted or altered in a way\n that it is no longer accessible i.e. PUT(DISABLED), the SET CHLAUTH\n command will only be partially successful. In this instance, SET\n CHLAUTH will update the in-memory cache, but will fail when hardening.This means that although the rule put in place by the SET CHLAUTH\n command may be operable initially, the effect of the command will not\n persist over a queue manager restart. The user should investigate,\n ensuring the queue is accessible and then reissue the command (using\n ACTION(REPLACE) ) before cycling the queue manager.If the SYSTEM.CHLAUTH.DATA.QUEUE remains inaccessible at queue manager\n startup, the cache of saved rules cannot be loaded and all channels\n will be blocked until the queue and rules become accessible.In Summary, each time you add, change, or delete aCHLAUTHrule, the queue manager updates does two things:It updates the in-memory cache (running configuration)It hardens the configuration by adding, updating, or removing messages in theSYSTEM.CHLAUTH.DATA.QUEUE. This is so that the running configuration will be available when the queue manager is restarted.When the queue manager is restarted, it reads the messages from theSYSTEM.CHLAUTH.DATA.QUEUEto initially populate the in-memory cache (running configuration) with previously existing rules.If you were to delete the messages from this queue and restart your queue manager you would find there would be noCHLAUTHrecords set.A similar queue exists calledSYSTEM.AUTH.DATA.QUEUEwhich holds the queue manager's OAM (authorization) rules. One difference between the CHLAUTH queue and this queue is that the AUTH queue is opened by an internal MQ process withMQOO_INPUT_EXCLUSIVEwhich means you can not open the queue at all.Note that CHLAUTH was added at MQ v7.1. If a queue manager is created new under 7.1 or higher CHLAUTH will be ENABLED by default. If a queue manager is upgraded to MQ v7.1 or higher from a version prior to 7.1 then CHLAUTH will be DISABLED by default. No matter if it a new or upgraded queue manager, or if CHLAUTH is ENABLED or DISABLED, there are three default rules that will be in place (listed below).BLOCKUSER rule to deny any MQADMIN user on all SRVCONN channels.ADDRESSMAP rule to deny usage of any channel that starts withSYSTEM.*from any IP address.ADDRESSMAP rule to allow connections toSYSTEM.ADMIN.SVRCONNfrom any IP address. Rule #1's restriction still applies.The three default rules are likely directly related to the three messages you observed in the queue. In general leaving CHLAUTH ENABLED with the default rules is a good thing. I normally get rid of #3 because I do not have a channel with this name. You noted that CHLAUTH is disabled, if you have no intention of using this feature you could usesaveqmgrordmpmqcfgto dump MQSC commands to recreate these three default rules and then delete those three rules, this will remove the three messages on theSYSTEM.CHLAUTH.DATA.QUEUE.If in the future you come to your senses and turn CHLAUTH back on, you can restore the rules you deleted with the backup created.\n"} +{"text": "### Human: I want to send a message to MQ server and receive the output message back. For example, the message is \"pwd\", the message I received back should be the directory path such as \"/usr/home\". However, my receiveMessage returns exactly same message I sent \"pwd\". Is there a way that my receiveMessage can return the directory patch?connectionFactory.setCCDTURL(ccdt.tab);\nconnectionFactory_.setQueueManager(QUEUE_MANAGER_NAME);\nMQQueueConnection connection = (MQQueueConnection)connectionFactory.createQueueConnection();\nconnection.start();\nMQQueue mqQueue= new MQQueue();\nMQQueueSender sender = (MQQueueSender) session.createSender(mqQueue);\nJMSTextMessage message = (JMSTextMessage)session.createTextMessage(\"pwd\");\nmessage.setJMSCorrelationID(correlationId);\nsender.send(message);\nMQQueueSession session =(MQQueueSession) connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\nString selector = \"JMSCorrelationID = '\" + correlationId + \"'\";\nMQQueueReceiver receiver = (MQQueueReceiver) session.createReceiver(mqQueue, selector);\nTextMessage receiveMessage = (TextMessage) receiver.receive(500);\nreceiver.close();\nSystem.out.println(\"Received Message: \" + receiveMessage );Thanks### Assistant: The example you provided is simply putting a message with the textpwdto a queue and then getting the same message back from the queue. The result you see is what would be expected.If you wanted to be able to send a message to a queue where the content of that message would be executed and the output of that command returned to you, you would need to write a program to perform that function.\n"} +{"text": "### Human: There is an application on Spring Boot, it puts its jms requests in one queue and takes the answers from the other. One more application is working with the queue of responses. Requests ~ 100 per second. Actually, the problem is how to process them and choose what I need? Now I read all the messages from the queue using @ JmsListener, but those that are not intended for my application are drawn. To create a thread and wait for the answer separately in it turns out to me it seems not a good idea because there can be several thousand threads. How to be?### Assistant: You can use aSpring Integration Aggregatorto avoid suspending a thread to wait for the result.\n"} +{"text": "### Human: I have:Camel route (transacted=true), consuming from an MQ QueueUsing Spring's WebSphereUowTransactionManagerTransactionality worksRunning on IBM LibertyBut, I get this message:Setup of JMS message listener invoker failed for destination 'MY.QUEUE' - trying to recover. \nCause: Local JMS transaction failed to commit; nested exception is com.ibm.msg.client.jms.DetailedIllegalStateException: \nMQJCA1020: The session is closed.\nThe application attempted to use a JMS session after it had closed the session.\nModify the application so that it closes the JMS session only after it has finished using the session.This appears to be related to thisother Stack Overflow question, but I've tried changing the configuration in server.xml, with no success.### Assistant: You can try settingcacheLevelName=CACHE_CONSUMERwhich allows to re-use the JMS consumer and avoids endless of creation/destruction of JMS resources, as indicated by the error message may be the cause.You can see more about the importanse of cache levels on the Camel JMS documentation:http://camel.apache.org/jms\n"} +{"text": "### Human: I have a java program I run to write messages to Mid-Tier IBM MQ's to test functionality before attaching our main programs to them. The write method looks like the following below:private static void sendSingleMessage(ConnectionFactory connectionFactory,\n String[] messages, String destination) throws Exception {\n Connection connection = null;\n try {\n connection = connectionFactory.createConnection();\n for (String payload : messages) {\n Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);\n Queue queue = session.createQueue(destination);\n MessageProducer producer = session.createProducer(queue);\n Message msg = session.createTextMessage(payload);\n System.out.println(\"Sending text '\" + payload + \"'\");\n producer.send(msg);\n session.close();\n System.out.println(\"Message sent\");\n }\n } finally {\n if (connection != null) {\n connection.close();\n }\n }\n}The connectionFactory is setup before this method executes, but within that method I set the MQConncetionFactory properties(host,port,channel,queuemanager, etc...) This send method works and I can see the queue depth increasing on my IBM MQ Explorer when I call it from my main method.When I run a similarreadSingleMessagemethod, the code gets stuck on the consumer.receive() and never finishes executing. See below:private static void readSingleMessage(ConnectionFactory connectionFactory,\n String[] messages, String destination) throws Exception {\n Connection connection = null;\n try {\n connection = connectionFactory.createConnection();\n for (String payload : messages) {\n Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);\n Queue queue = session.createQueue(destination);\n MessageConsumer consumer = session.createConsumer(queue);\n System.out.println(\"Recieving text '\" + payload + \"'\");\n consumer.receive();\n session.close();\n System.out.println(\"Received message\");\n }\n } finally {\n if (connection != null) {\n connection.close();\n }\n }\n}Is there anyway I can further debug this, or find why I am able to write to the queue, but unable to read a message off of it?### Assistant: You have to start the JMS Connection by calling thestart()method on it. You cannot receive any messages until the connection is started. This is noted in the JMS Specification and Javadoc.As an aside, if you use the JMS 2.0 \"simplified\" API and create a JMSContext object (an object which is essentially a combined Connection and Session) you do not need to call start to receive messages. A consumer crated from it can be used to receive messages without being explicitly started.\n"} +{"text": "### Human: MQ Manager MQ 7.5 on LinuxAre the MQ MFTresource monitor(fteCreateMonitor) definitions contained in the MQ Queue Manager queue definitions (like fte.xxxx) ?If so, can I simply use the commanddmpmqcfg -m QMA -a > /mq/backups/QMA.mqscand restore the configuration on a queue manager with the same name and IP/Hostname (clone) and the resource monitors will be recreated without further effort?### Assistant: My suggestion would be to use1) fteListMonitors command to export task definition to a xml file.2) Use that xml file with fteCreateMonitor command to recreate the resource monitor on another queue manager.For example:\nExport the resource task definition on machine 1.fteListMonitors -ma SRC -mn QMON -ox c:\\temp\\qmon.xmlTake theqmon.xmlfile to machine 2 and run the following commandfteCreateMonitor -ix C:\\temp\\qmon.xml -ma SRC -mn QMON\n"} +{"text": "### Human: Is there a way to configure a JMS message queue to drop all received messages automatically? (In other words: for the sender it must look like the message arrived ok, but the queue should silently drop it. That is, the queue should behave like \"/dev/null\") In case that matters, I'm most interested in IBM MQ, however, if JMS specification offers this possibility, that would be even better.Since I already tried searching, and did not find such a possibility, I suspect the answer is \"no\". So an answer that confirms that this is the case (and I'm not missing anything) is also valid for me.Use case: test a system, that sends messages to a real JMS queue, which (in the test setup) are not read out by any other program. (I do not want to mock the JMS queue, to keep the test environment as close to production as possible. For the same reason, it is also not a valid solution to e.g. set \"time to live\" for the messages on the client side.)### Assistant: How about making a queue which you put to being an alias to a topic with noone listening on it?e.g.:def qalias(MYQUEUE) target(DUMMYTOPIC) targtype(TOPIC)\ndef topic(DUMMYTOPIC) topicstr(DUMMYTOPIC)Then you can put to the queue, it becomes a publish and if noone is listening on the queue it vanishes.amqsput MYQUEUE QMfor example will work fine.When you want to then consume the messages, change the QALIAS to either point to a real queue, or replace the QALIAS definition with a QLOCAL for example.The only downside is if anyone is subscribed to every topic, but for testing purposes you can\n"} +{"text": "### Human: Since IIB v10.0.0.7 I can use KafkaConsumer node to receive messages that was published on a Kafka topic.I need some client which will be able to recieve message from Kafka and put it in IBM MQ and get message from IBM MQ and publish in to Kafka topic. I alredy have IIB and IBM MQ. Kafka is messaging system of one of integration systems.Can I somehow put received message from Kafka in IBM queue using KafkaConsumer node and MQOutput node ? Or get message from queue with MQOutput and publish it to Kafka topic with KafkaProducer node ?Or it is not a good idea to mix this tecnologies in such a way and should look for some another workaround ?### Assistant: Hi you could use Kafka Connect connectors.https://www.confluent.io/product/connectors/There are community connectors for MQ.Alternatively, if you're using IBM MessageHub, i.e. Kafka-as-a-service in the IBM Cloud, there you can have an MQ-to-Kafka bridge ran as a service itself.https://console.bluemix.net/docs/services/MessageHub/messagehub088.html#bridges\n"} +{"text": "### Human: We are trying to place message on IBM message clustered queue. When we place the message on the queue the following error will be thrown:MQJE001: Completion Code '2', Reason '2085'.When we try to place a message on a local queue on one of our queue managers it's working fine. But on a clustered queue it does not work.MQQueue queue = null;\nMQMessage mqMessage = null;\n\nMQEnvironment.hostname = settings.getServer();\nMQEnvironment.channel = settings.getChannel();\nMQEnvironment.port = settings.getPort();\n\nMQQueueManager queueManager = new MQQueueManager(settings.getQueueManager());\n\nint openOptions = CMQC.MQOO_INPUT_AS_Q_DEF | CMQC.MQOO_OUTPUT;\n\nqueue = queueManager.accessQueue(settings.getQueue(), openOptions);Can someone help us with placing message on a clustered queue?### Assistant: MQRC2085isMQRC_UNKNOWN_OBJECT_NAMEwhich normally means the queue manager you are connected to can't find this queue either locally defined or via the cluster(s) it is a member of.Another reason you get a2085is if you try to open a clustered queue forINPUT(GET). You can onlyOUTPUT(PUT) to a clustered queue that is not located on the local queue manager. If you removeCMQC.MQOO_INPUT_AS_Q_DEFfrom youropenOptionsit should fix your problem. Unrelated to your problem, it is good practice to always includeCMQC.MQOO_FAIL_IF_QUIESCINGthis will allow the queue manager to shutdown normally and not be held up by your process being connected.int openOptions = CMQC.MQOO_FAIL_IF_QUIESCING | CMQC.MQOO_OUTPUT;You can confirm if the queue manager you are connected too knows about this queue in its partial repository along with which cluster it is a member of and what cluster queue managers it is hosted on with the following command:DIS QC(clustered_queue_name_here) CLUSTER CLUSQMGRA partial repository only learns about a clustered queue the first time it is accessed so it may not show up until you fix youropenOptionsand try to access it again.\n"} +{"text": "### Human: Closed. This question isopinion-based. It is not currently accepting answers.Want to improve this question?Update the question so it can be answered with facts and citations byediting this post.Closed5 years ago.Improve this questionI have a IBM websphere MQ .net client application which uses amqmdnet dll. It works fine but I am not able to read messages in event(subscription) based manner. Reading online I found that XMS library has in-built subscriber methods.I am also looking at scalability of the .net client application which will allow a cluster of nodes reading the same MQ pipeline. My objective is to create a .net message consumer which supportspoint-to-point & publish/subscribe methodCluster of nodes connecting to same queue and consuming messages.Remove the messages from pipeline once it is persisted.Which of the method is preferred in such scenario?### Assistant: Both IBM MQ classes for .NET(amqmdnet.dll) and IBM Message Service API for .NET(XMS .NET) support most features of IBM MQ: Both support point-to-point & publish/subscribe. Both support multiple clients connecting and consuming from a single queue. Both support units of work. Both are fully supported by IBM.XMS .NET supports MessageListener objects to simplify consuming from a queue. In IBM MQ classes for .NET you would need to write your own function to consume from a queue.IBM Technote \"XMS .NET \u2013 An Overviewhas a good overview of XMS .NET features.\n"} +{"text": "### Human: I have setup a JMS listener for IBM MQ . When the listener is running on single JVM like tomcat on local machine it runs fine. But when i deploy it to the Cloud where there are 2 VM's , it's running fine on one of the VM and connects to MQ but it says below on the other one.Is there any limitation from IBM MQ on using a ID,password from multiple clients in order to connect to the Queue manager?RROR> com.ssc.ach.mq.JMSMQReceiver[main]: errorMQJMS2013: invalid security authentication supplied for MQQueueManager\njavax.jms.JMSSecurityException: MQJMS2013: invalid security authentication supplied for MQQueueManager\n at com.ibm.mq.jms.MQConnection.createQM(MQConnection.java:2050)\n at com.ibm.mq.jms.MQConnection.createQMNonXA(MQConnection.java:1532)\n at com.ibm.mq.jms.MQQueueConnection.(MQQueueConnection.java:150)\n at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:185)\n at com.ibm.mq.jms.MQQueueConnectionFactory.createConnection(MQQueueConnectionFactory.java:1066)\n atI am starting the listener on VM startup using Servlet init methodpublic void init(ServletConfig config) throws ServletException {\n logger.info(\"App Init\");\n try {\n boolean isListnerOn = Boolean.parseBoolean(System.getProperty(\"listner\", \"false\"));\n logger.info(\" startReceiver , listner flag is \"+isListnerOn);\n if(isListnerOn){\n if (mqReceive == null) {\n MyMessageListener jmsListner = new MyMessageListener();\n mqReceive = new JMSMQReceiver(jmsListner);\n }\n if (mqReceive != null) {\n try{\n mqReceive.start();\n } catch (Exception e) {\n logger.error(\"Error starting the listner \", e);\n }\n\n }\n }else{\n logger.info(\" listner not started as flag is \"+isListnerOn);\n }\n\n } catch (Exception e) {\n logger.error(e, e);\n }\n }\n\n\nprivate MQQueueConnectionFactory mqQueueConnectionFactory;\n\n\n\n public MQReceiver(MyMessageListener listner) {\n userName=System.getProperty( \"mqId\",\"\");\n pwd=System.getProperty(\"mqId\",\"\");\n host = System.getProperty(PREFIX + \".host\");\n port = Integer.parseInt(System.getProperty(PREFIX + \".port\"));\n qManager = System.getProperty(PREFIX + \".qManager\");\n channel = System.getProperty(PREFIX + \".channel\");\n queueName = System.getProperty(PREFIX + \".achqueueName\");\n logger.info(\"HOST:\" + host + \"\\tPORT:\" + port + \"\\tqManager:\"+ qManager + \"\\tchannel:\" + channel + \"\\tqueueName:\"+ queueName);\n try {\n\n mqQueueConnectionFactory = new MQQueueConnectionFactory();\n mqQueueConnectionFactory.setHostName(host);\n mqQueueConnectionFactory.setChannel(channel);//communications link\n mqQueueConnectionFactory.setPort(port);\n mqQueueConnectionFactory.setQueueManager(qManager);//service provider \n mqQueueConnectionFactory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);\n queueConnection = mqQueueConnectionFactory.createConnection(trustUserName, trustID);\n session = queueConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);\n queue = session.createQueue(queueName); \n ((MQDestination) queue).setTargetClient(WMQConstants.WMQ_CLIENT_NONJMS_MQ);\n MessageConsumer consumer = session.createConsumer(queue);\n consumer.setMessageListener(listner);\n logger.info(\" Connect MQ successfully.\");\n\n } catch (JMSException e) {\n logger.error(\"error\" + e.getMessage(), e);\n }\n }\n\n public void start() {\n logger.info(\"Starting MQListener... \");\n //mqListener.start();\n try {\n queueConnection.start();\n logger.info(\"MQListener start successfully\");\n } catch (JMSException e) {\n logger.error(\"error\" + e.getMessage(), e);\n }\n\n }### Assistant: The IBM MQ Classes for JMS client errorJMSWMQ2013can be caused by quite a few issues.IBM Support Technote \"WMQ 7.1 / 7.5 / 8.0 / 9.0 queue manager RC 2035 MQRC_NOT_AUTHORIZED or AMQ4036 or JMSWMQ2013 when using client connection as an MQ Administrator\" has a good write up on diagnosing and resolving issues like this.If you want more specific help, to start with please provide the following details by editing and adding them to your question.Version of IBM MQ Classes for JMS used by the client application.Version of IBM MQ installed on the IBM MQ queue managerErrors in the queue manager's AMQERR01.LOG that happen at the same time as the error you receive in the IBM MQ Classes for JMS client application on the second VM..It is strange that it works on the first VM and fails on the second. If the trustUserName, trustID are the same for both VMs, IBM MQ should accept them equally.If you are using IBM MQ v8 or later native connection authentication it is possible the OS or PAM is denying the second connection. I have only seen this where pam_tally had a limit of 5 and more than 5 connection hit at the same time. It could be possible there is some sort of login limit of one login per user.Per you comment it appears that you had a CHLAUTH ADDRESSMAP rule missing, the first VM's IP was allowed and the second VM's IP was not allowed. Depending on how the queue manager is configured and how the CHLAUTH rule is blocking the connection the queue manager may return MQRC 2035 to the client. On a IBM MQ Classes for JMS client this is returned as MQJMS2013. This could happen for instance if your queue manager is usingADOPTCTX(NO)and has a CHLAUTH rule that mapsADDRESS(*)to aMCAUSERthat does not exist (ex:*NOACCESS) and other CHLAUTH rules that map connections from specific IPs to a user that does have access.A more secure setup is to useADOPTCTX(YES)which will tell MQ to set theMCAUSERto the id that is authenticated by CONNAUTH. You could also have a ADDRESSMAP rule withADDRESS(*) USERSRC(NOACCESS)to block by default and then other rules with specific IPs andUSERSRC(CHANNELto allow those IPs you want to whitelist.\n"} +{"text": "### Human: Question:Is it possible to copy MQ Messages from one Queue Manager/Queue to a different Queue Manager/Queue?Scenario:I have a \"PROD\" Queue Manager and when it receives a Message on it's Queues I would like to \"copy\" the Message to a queue on a \"TEST\" Queue Manager.RequirementsThe original message must be left on the PROD queue to be processed as normal.This must be an automated process (lots of messages during a day). I could not intervene on a Message by Message basis.If at all possible I would like this to be implemented by some native MQ functionality rather than an ad hoc program/script.The copying must be as near to real time as possibleMust work with MQ version is 7.0.2.1(!). This cannot be changed.Must run on Red Hat Enterprise Linux Server release 5.11 (Tikanga). Again, can't be changed.I'm no MQ expert so use small words pleaseThanks in advance### Assistant: The only problem with thetechnotepointed out by gouda is that MQ will modify/changed the MsgId and CorrelId of each message replicated.If the MsgId and/or CorrelId fields are important then the only other option is an MQ API Exit that replicates the message. You may need a commercial product likeMQ Message Replication.The next question is how are you going to move the message from a PROD queue to a TEST queue? You definitely do NOT want to create channels between a PROD queue manager and a TEST queue manager.There are lots of tools that can off offload PROD messages to a file then you can move the file to your TEST environment and then load the messages into a TEST queue. Here is a list ofMQ toolsthat can do it. The 2 tools you should try out are: MQ Batch Toolkit and QLoad.Personally, I would create a schedule task (CRONTAB) to be run every night at midnight to off the messages and I would make the filename include the date and time. The last steps of the script would be to zip/compress the file and delete the original file (because the data you offload could be massive).Hence, any time you want a particular day's PROD messages, just copy the file to your TEST server and unzip/uncompress it and load it into the queue.\n"} +{"text": "### Human: I have setup the IBM Websphere MQ in my localhost pc and follow the tutorial fromhereandhereWhen i run the code it always give me the same error.Error 2035 : MQRC_NOT_AUTHORIZEDwhen it reach this line ;MQQueueManager queueManager = new MQQueueManager(\"QM_TEST\", props);I already set the MCA UserID in the server-connection channel : mqm and use it in my codeprops.Add(MQC.USER_ID_PROPERTY, \"mqm\");And from what i read on the internet when we set MCA UserID it should override\nwhat is provided by client.But still the problem occurred.Not sure if it related, but Im using Websphere Version: 7.5.0.2 and Windows 10 Pro.Thank you in advance### Assistant: props.Add(MQC.USER_ID_PROPERTY, \"mqm\");Bad idea, absolutely not recommended. That UserId is for the exclusive use of MQ and NOT applications.ALTER QMGR CHLAUTH(DISABLED)Really, really bad and stupid idea. You are disabling security in MQ. So, you just want anybody or hackers to get whatever they want from your messaging system.\n"} +{"text": "### Human: I am trying to Create a topic and publish a message to IBM MQ topic. I am getting the 2085 MQ exception and sure how to resolve this.IBM.XMS.dll version I am using is 8.0.0.6.Console app code:static void Main(string[] args)\n {\n try\n {\n XMSFactoryFactory factoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\n\n IConnectionFactory connectionFactory = factoryFactory.CreateConnectionFactory();\n Console.WriteLine(\"Connection Factory created.\");\n\n connectionFactory.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, \"MQ_TX_MGR\");\n connectionFactory.SetStringProperty(XMSC.WMQ_CONNECTION_NAME_LIST, \"10.10.10.10(1414)\");\n connectionFactory.SetStringProperty(XMSC.WMQ_CHANNEL, \"CL.SVRCONN\");\n\n connectionFactory.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);\n connectionFactory.SetIntProperty(XMSC.WMQ_CLIENT_RECONNECT_OPTIONS, XMSC.WMQ_CLIENT_RECONNECT);\n connectionFactory.SetIntProperty(XMSC.WMQ_CLIENT_RECONNECT_TIMEOUT, 3); \n\n mqConnection = connectionFactory.CreateConnection();\n Console.WriteLine(\"Connection created.\");\n\n session = mqConnection.CreateSession(false, AcknowledgeMode.AutoAcknowledge);\n Console.WriteLine(\"Session created.\");\n\n\n IDestination destination = session.CreateTopic(\"topic://TOPIC/NAME\"); // destinationName\n Console.WriteLine(\"Destination created.\");\n\n // create producer\n IMessageProducer producer = session.CreateProducer(destination); //My Code is erroring out at this line.\n\n }\n catch (Exception ex)\n {\n Console.WriteLine(ex.Message);\n }\n finally\n {\n Console.WriteLine(\"Program waiting for message:\");\n Console.ReadLine();\n }\n\n }Exception Details:Error Message:CWSMQ0006E: An exception was received during the call\n to the method WmqV6Session.SetupPubSub: CompCode: 2, Reason: 2085.\n During execution of the specified method an exception was thrown by\n another component. See the linked exception for more information.Linked Exception Reason: 2085Linked Exception Stack Trace:at\n IBM.WMQ.MQDestination.Open(MQObjectDescriptor& od) at\n IBM.WMQ.MQQueue..ctor(MQQueueManager qMgr, String queueName, Int32\n openOptions, String queueManagerName, String dynamicQueueName, String\n alternateUserId) at IBM.WMQ.MQQueueManager.AccessQueue(String\n queueName, Int32 openOptions, String queueManagerName, String\n dynamicQueueName, String alternateUserId) at\n IBM.WMQ.MQQueueManager.AccessQueue(String queueName, Int32\n openOptions) at\n IBM.XMS.Client.WMQ.MqV6Impl.WmqV6Session.SetUpPubSub(Boolean\n startCleanup)### Assistant: Ensure that yourSVRCONNchannel has aSHARECNVvalue of 1 or higher.IBM MQ v8 Knowledge center page \"MQI client: Default behavior of client-connection and server-connection channels\" documents the following aboutSHARECNV(0):This value specifies no sharing of conversations over a TCP/IP socket.The channel instance behaves exactly as if it was a Version 6.0 server\n or client connection channel, and you do not get the extra features\n such as bi-directional heartbeats that are available when you set\n SHARECNV to 1 or greater.Only use a value of 0 if you have existing\n client applications that do not run correctly when you set SHARECNV to\n 1 or greater.The IBM MQ v8 Knowledge center page \"XMSC_WMQ_PROVIDER_VERSION\" documents the following:By default this property is set to \"unspecified\"....IBM WebSphere MQ Version 7.0 specific features are disabled if\n XMSC_WMQ_PROVIDER_VERSION is set to UNSPECIFIED and SHARECNV is set to\n 0.That would cause XMS to attempt to use the STREAM queue to publish messages with queued publish/subscribe. Set it to 1 or higher to get av7style connection and use normalv7integrated publish/subscribe.In some past versions settingSHARECNV(0)was a work around for certain problems, I don't know of anyv8problems that have this work around.\n"} +{"text": "### Human: How can I implement a data compression plan other than RLE,ZLIBFAST or ZLIBHIGH for channel compression in IBM MQ using Java classes?There are several algorithms like Lempel,DEFLATE and Huffman coding for data compression.Can I use these algorithms for my implementation?### Assistant: I would strongly suggest you use the builtin compress features because otherwise you will need to write send and receive exits for MQ. You will need above average programming skills and a very strong knowledge of MQ to do this.Yes, you can write the client-side in Java but the server-side must be written in C or Assembler!Once you go down this path, are you prepared to support other client-side platforms? i.e. native (C or COBOL), .NET, C++, etc..Also, application messages are segmented into 32KB chunks. All segments that move between the client-side and server-side (and vice versa) are prefix with a TSH header. IBM does not document the TSH structure because they don't want people messing with it. Although, Wire Shark has done a good job of interpreting it (except for the new TSHC & TSHM headers).There is absolutely nothing simple about your question. I know because I have written a lot of MQ exits.\n"} +{"text": "### Human: What is a channel exit in IBM MQ? On my research I found three types of channel exits.WMQSendExitWMQReceiveExitWMQSecurityExitCan someone explain this?### Assistant: An \"exit\" or \"exit program\" in IBM-speak is the same thing that non-IBM software might call a \"callback\" or a \"listener\". It is a way to hook in your custom code into an event generated by the software.https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_7.1.0/com.ibm.mq.javadoc.doc/WMQJavaClasses/com/ibm/mq/exits/WMQSendExit.htmlThe send exit interface allows you to examine, and possibly alter, the\n data sent to the queue manager by the WebSphere MQ Client for Java.\n Note: This interface does not apply when connecting directly to\n WebSphere MQ in bindings mode.To provide your own send exit, define a class that implements this\n interface.\n"} +{"text": "### Human: I am having difficulties in understanding IBM MQ.I would like to write a client that will only send messages to the queue. From what I have understood it looks to me that I don't need to use a channel for that scenario. My source is this book:http://www.redbooks.ibm.com/abstracts/redp0021.htmlBut when I try to connect to the Queue I am getting the error code2540 (09EC) (RC2540): MQRC_UNKNOWN_CHANNEL_NAMEThis is my sample code that will catch the exception with the above mentioned error code:@Test \n public void init() throws InitializationException {\n MqConfigurationData mqConfigurationData = confManager.getUserConfig().getMqConfigurationData();\n MQEnvironment.hostname = mqConfigurationData.getHostname();\n MQEnvironment.port = new Integer(mqConfigurationData.getPort());\n\n try {\n MQQueueManager mqQueueManager = new MQQueueManager(mqConfigurationData.getQueueManager());\n } catch (MQException e) {\n throw new InitializationException(ApiExceptionId.INIT_MQ_CONFIGURATION, e.getMessage());\n }\n\n }So my question is: Do I need a channel even in a client-only scenario?### Assistant: If your application executes on the same server as the queue manager you want it to connect to then youdo notneed a channel to connect to, in this case the application would connect in Bindings mode using IPC.If you want to connect over the network to the queue manager (on a different server or even the same server) then youdoneed a channel to connect to, in this case the application would connect in Client mode using TCP/IP.See the Knowledge center page \"Using IBM MQ classes for Java\" for further details on the two modes of connection.In your sample you are indicating you want to use a Client mode of connection by specifying theMQEnvironment.hostnameandMQEnvironment.port. The errorMQRC_UNKNOWN_CHANNEL_NAMEwould be expected if aSVRCONNchannel does not exist on the queue manager. Since you are not specifyingMQEnvironment.channelthe IBM MQ classes for Java application is probably trying to connect with a NULL channel name which would not exist.Please note that per the v9.0 Knowledge center page \"Using IBM MQ classes for Java\", IBM MQ Classes for Java have been functionally stabilized at the level shipped in IBM MQ Version 8.0.IBM will make no further enhancements to the IBM MQ classes for Java\n and they are functionally stabilized at the level shipped in IBM MQ\n Version 8.0.It would be recommended to use IBM MQ Classes for JMS for a newly developed application.\n"} +{"text": "### Human: I am using Spring boot 1.2.2 and JDK1.8.0.40, I have specified the SSL cipher suit as SSL_RSA_WITH_3DES_EDE_CBC_SHA and also import cer file to keystore.When I run my project, I set the jvm arguments as following:-Djavax.net.debug=all -Djavax.net.ssl.keyStore=/java_home/jre/lib/security/cacerts -Djava.net.keyStorePassword=changeitBut I always gethanding exception:javax.net.ssl.SSLHandshakeException: No appropriate protocol(protocol is disabled or cipher suites are inappropriate)\nSEND TLSv1.2 ALERT: fatal, description = handshake_failure\nWRITE: TLSv1.2 Alert, length = 2\n[Raw write]: length = 7\n0000: 15 03 03 00 02 02 28 ......(\ncalled closeSocket()\ncom.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0018: Failed to connect to queue manager 'XXXX' with connection mode 'Client' and host name 'xxx.xxx.com(xxxxx)'.Indeed I have do several operations to fix the issue, such as:Replace jce jars to unlimit encryptImport cer file to jksspecified jks path in jvm argumentsUsing matched SSL Cipher SuiteUsing SSL channelBut now, I still failed on handshake and the error logs are same as above.Or do I need generate the cer from my machine and upload to the server? Could you kindly give some advice?### Assistant: SSL_RSA_WITH_3DES_EDE_CBC_SHAis an SSL 3 cipher suite. SSL 3 is insecure anddisabled by defaultin Java 8. Is there any reason why you're using a ciphersuite for an insecure protocol?If you want to stick to a single cipher suite, you can pick one thatJava 8 supports.\n"} +{"text": "### Human: I have inherited some legacy code, it is basically a wrapper for IBM MQ. It has a reference to IBM.XMS.dll 2.0.50727. Does this DLL support 64 bit OS like WIN2K16?I've updated the build properties to Any CPU but I am not sure if this DLL can be run in 32 and 64 environments.IBM MQ Clients are up to version 9 now, should I just download the latest version?### Assistant: IBM MQ Clients are up to version 9 now, should I just download the\n latest version?Yes and if you install the IBM MQ Client V9 on a 64-bit PC then the 64-bit versions of the DLLs will be installed too.i.e.the 32-bit DLL will be in the {MQ_install_dir}\\bin\\ directorythe 64-bit DLL will be in the {MQ_install_dir}\\bin64\\ directory\n"} +{"text": "### Human: I am new to MQ, I have a requirement where in I have to send a mq message from 1 system to another. The Message queue and Queue Manager is Set up at the server, and i only have the qname and the mqmanager name,I have written the following code to create a connection to mq, but i am getting this Exception:UnsatisfiedLinkError: mqjbnd (Not found in java.library.path)The code is:package com.demo.mqsamplimport com.ibm.mq.MQC;\n\nimport com.ibm.mq.MQEnvironment;\nimport com.ibm.mq.MQException;\nimport com.ibm.mq.MQGetMessageOptions;\nimport com.ibm.mq.MQMessage;\nimport com.ibm.mq.MQPutMessageOptions;\nimport com.ibm.mq.MQQueue;\nimport com.ibm.mq.MQQueueManager;\nimport com.ibm.mq.constants.MQConstants;\n\n\npublic class MQSample {\n private static final String qManager = \"(MyQueueManagerName)\";\n private static final String qName = \"(MyQueueName)\";\n\n public static void putGet(String args[]) {\n try {\n\n MQQueueManager qMgr = new MQQueueManager(qManager);\n\n int openOptions = MQConstants.MQOO_OUTPUT;\n\n MQQueue queue = qMgr.accessQueue(qName, openOptions);\n\n MQMessage msg = new MQMessage();\n\n msg.writeString(\"Hello World!\");\n\n MQPutMessageOptions pmo = new MQPutMessageOptions();\n\n queue.put(msg, pmo);\n\n }\n catch (MQException ex) {\n ex.printstacktrace();\n }\n catch (java.io.IOException ex) {\n ex.printstacktrace(););\n }\n }\n}can anyone please help me on this.### Assistant: UnsatisfiedLinkError: mqjbnd (Not found in java.library.path)error is normally caused when you try to make a binding mode connection to IBM MQ Queue Manager hosted on the same server and the IBM MQ Classes for Java can not locate the library mqjbnd. If you do not specify a hostname and channel name for IBM MQ Classes for Java to use to connect, they default to a binding mode connection.If your applications runs on the same server as the IBM MQ Queue Manager then you would need to tell the client how to find the mqjbnd libraries (on Linux this is /opt/mqm/java/lib) with one of the following methods:set the LIBPATH environment variable for example on Linux bashexport LIBPATH=/path/to/libraryWith the command line option-Djava.library.path=/path/to/libraryProgrammatically withSystem.setProperty(\"java.library.path\", \"/path/to/library\");If you are trying to connect to a IBM MQ Queue Manager hosted on a remote server I agree with @user7790438 that you would need to provide MQ with the details on how to connect to the remote queue manager. The MQEnvironment is global and not thread safe. You should use a hashtable to pass these values for example:import java.util.Hashtable;\n\nprivate static String host = \"dns.name\";\nprivate static int port = 1414;\nprivate static String channel = \"MQ.SVRCONN.CHL\";\n\nHashtable properties = new Hashtable();\nproperties.put(\"hostname\", host);\nproperties.put(\"port\", port);\nproperties.put(\"channel\", channel);\n\nMQQueueManager qMgr = new MQQueueManager(qManager, properties);You do not mention what version of IBM MQ the queue manager is, or what version of IBM MQ classes for Java jar files you are referencing. Other details can be passed via the hash table, for example if you are using IBM MQ v8 or later Classes for Java and connecting to a IBM MQ v8 or later Queue Manager you may need to pass a UserID and Password, this would be accomplished by adding the following to the has table:private static String user = \"UserID\";\nprivate static String password = \"Password\";\n\nproperties.put(MQConstants.USE_MQCSP_AUTHENTICATION_PROPERTY, true);\nproperties.put(MQConstants.USER_ID_PROPERTY, user);\nproperties.put(MQConstants.PASSWORD_PROPERTY, password);Please note that per the IBM v9.0 Knowledge center page \"Deprecated, stabilized and removed features\", IBM MQ Classes for Java have been Stabilization as of v8.0. This means that no further enhancements will be made and eventually IBM will deprecated the IBM MQ Classes for Java. You may want to write your application using the IBM MQ classes for JMS which has no support restrictions.Stabilization of IBM MQ classes for JavaIBM will make no further enhancements to the IBM MQ classes for Java and they are functionally stabilized at the level shipped in IBM MQ Version 8.0. Existing applications that use the IBM MQ classes for Java will continue to be fully supported, but this API is stabilized, so new features will not be added and requests for enhancements rejected. Fully supported means that defects will be fixed together with any changes necessitated by changes to IBM MQ System Requirements.\n"} +{"text": "### Human: I am facing an issue in PublishJMS processor of NIFI while pushing the json message from it.Note:Just to add tried various processors to see if the attributes can be modified, but none helped, I am able to figure out the issue is only because I am using ConsumeJMS & PublishJMS together in the same flow.JSON Message to be published:{\"dataprepcomplete\":{\"modelfamilytype\":\"property\",\"groupid\":\"1\",\"claims\":[{\"requestid\":\"1\",\"claimid\":\"10001\"},{\"requestid\":\"2\",\"claimid\":\"10002\"}]}}The issue of the \"JMSCC0051: THE PROPERTY 'JMS_IBM_REPORT_PASS_CORREL_ID' SHOULD SET USING TYPE 'JAVA.LANG.INTEGER', NOT 'JAVA.LANG.STRING'\" is resolved as per the solution posted in my earlierpostand I am able to publish json messages to my MQ Queue from the below flow.QueryDatabaseTable > ConvertAvroToJSON > PublishJMSBut I am getting the same error as reported in the earlier post from the PublishJMS processor when I am using the PublishJMS is the below mentioned flow.ConsumeJMS > ReplaceText > PublishJMSAm I missing anything?Do I have to plug some other processor before the PublishJMS to be able to publish the message successfully.?Any help on this will be highly appreciated.Below are properties for the procesors.ConsumeJMS properties:ReplaceText propertiesPublishJMS propertiesDataProvenance of PublishJMS processor### Assistant: Try deleting all attributes starting with JMS before sending. Use UpdateAttribute with a regex mask for that.\n"} +{"text": "### Human: I am trying to get an existing Java application connect to WebSphere MQ 8. This has worked in the past with other versions of Java and WMQ, but with Java 8 and WMQ8, this doesn't want to work. \nI am getting:handling exception: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)\nSEND TLSv1.2 ALERT: fatal, description = handshake_failure\nWRITE: TLSv1.2 Alert, length = 2\ncalled closeSocket()\nException in thread \"main\" com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2397'.I just can't see why this is occurring. I have set the various javax.net.ssl parameters. I use appropriate SSL_TRUSTSTORE & KEYSTORE that I have created. Have a SSL_CIPHERSUITE.I have tried (almost) all of the documented CipherSuites that WMQ supports; I am working my through the entire list, with settings and environment like this:JAVA SSL_CIPHERSUITE = SSL_RSA_WITH_AES_256_CBC_SHAWMQ Channel SSL_CIPHERSUITE = TLS_RSA_WITH_AES_256_CBC_SHAMQ Client 7.0.0.1 -- I have tried switching to MQ Client 8, with no improvementIBM WebSphere MQ, Version: 8.0.0.5Nothing in AMQERR01.log corresponding to the client errorOracle Java 8 (Java(TM) SE Runtime Environment (build 1.8.0_60-b27)) -- with SSLv3 enabled (changed jdk.tls.disabledAlgorithms=RC4, DH keySize < 768)Additional info:The customer (bank) is using MQ 7 so I don't have a choice in the\nmatter of which QM they are using. But I have been testing locally with MQ 8 to check if that is part of the issue.I've tried: -Dcom.ibm.mq.cfg.useIBMCipherMappings=falseUsing JCE Unlimited Strength Jurisdiction Policy Files from Oracle.### Assistant: MQ v7.0 was released June 27th 2008 (Fix Pack 7.0.0.1 was related January 20th 2009) and has been out of support since September 30th 2015 (over 1.5 years). Is per my answer below this version of MQ will not support TLS CipherSuites on a Oracle JRE, while you could update to a later Fix Pack I would strongly suggest that you move to a supported version of the MQ client. Newer MQ client versions can connect to older MQ queue managers. You can download a java only install of MQ 8.0 or MQ 9.0 jar files at the links below:IBM MQ v8.0 ClientIBM MQ v9.0 ClientAPARIV66840added new functionality to allow users of non-IBM Java runtime environments to make use of TLS CipherSuites.For v7.0 this is included in Fix Pack 7.0.1.13 (note that Fix Pack 7.0.1.14 was the final for this version).For 8.0 this is included in Fix Pack 8.0.0.2.NOTE:This APAR is a client side fix.To enable this option you would need to do the following:To enable these non-default mappings for non-IBM runtime\n environments, the following Java System Property:com.ibm.mq.cfg.useIBMCipherMappingsmust be set to the value:falseFor example, this can be configured by using the JVM argument:-Dcom.ibm.mq.cfg.useIBMCipherMappings=falseYou would then need to specify the CipherSuite asTLS_RSA_WITH_AES_256_CBC_SHAfor a Oracle JRE, note thatSSL_RSA_WITH_AES_256_CBC_SHAis the IBM JRE CipherSuite name.After getting past the above you may then run into getting a AMQ9771, 2393 SSL Initialization error.dW Answers post \"Why do I get AMQ9771, 2393 SSL Initialization error from a MQ Java/JMS application when trying to use an TLS AES 256 cipher?\". It states that the following:In this case, the issue is caused by attempting to use AES 256 strong\n cipher algorithms.Most Java JREs, including Oracle/Sun and IBM's have Import Limits on\n Cryptographic Algorithms enabled. This limits the maximum key sizes\n and also some algorithms.When trying to use a AES 256 cipher, such as\n ECDHE_RSA_AES_256_CBC_SHA384 or TLS_RSA_WITH_AES_256_CBC_SHA256 with a\n MQ Java/JMS application, you need to ensure your JRE supports this\n cipher. In most cases, when the stronger cipher algorithms are needed,\n such as AES 256 ciphers, the JCE Unlimited Strength Jurisdiction\n Policy Files must be obtained and installed in the JDK/JRE.This is noted in the JDK/JRE documentation: For Oracle 1.7:http://docs.oracle.com/javase/7/docs/technotes/guides/security/SunProviders.htmlThe link above to the oracle site states:If stronger algorithms are needed (for example, AES with 256-bit\n keys), theJCE Unlimited Strength Jurisdiction Policy Filesmust be\n obtained and installed in the JDK/JRE.It is the user's responsibility to verify that this action is\n permissible under local regulations.If you do get the 2393 follow the advise above to obtain and install theJCE Unlimited Strength Jurisdiction Policy Files.\n"} +{"text": "### Human: I am trying to get the example snippet to publish and subscribe below, I can't get it to run with Node JS 6 and mqlight v2.0https://www.npmjs.com/package/mqlight?cm_mc_uid=47189062138014548006442&cm_mc_sid_50200000=1490060435// Receive:\nvar mqlight = require('mqlight');\nvar recvClient = mqlight.createClient({service: 'amqp://user:user@localhost:5672'});\nrecvClient.on('started', function() {\nrecvClient.subscribe('/TEST/#','sub1');\nrecvClient.on('message', function(data, delivery) {\n console.log(data);\n });\n});\n\n// Send:\n\n var sendClient = mqlight.createClient({service: 'amqp://user:user@localhost:5672'});\n sendClient.on('started', function() {\n sendClient.send('TEST');\n});i run the sample code mqlight 2.0 with node js v6$node mqlight_sample.js\n\n events.js:160\n throw er; // Unhandled 'error' event\n ^\n SecurityError: AMQXR0100E: A connection from 172.17.0.1 was not authorized.\n at lookupError (/media/Data/mqlight/node_modules/mqlight/mqlight.js:1034:11)\n at AMQPClient. (/media/anonim/Data/mqlight/node_modules/mqlight/mqlight.js:1925:13)\n at emitOne (events.js:96:13)\n at AMQPClient.emit (events.js:188:7)\n at Connection. (/media/anonim/Data/mqlight/node_modules/amqp10/lib/amqp_client.js:388:10)\n at emitOne (events.js:96:13)\n at Connection.emit (events.js:188:7)\n at Connection._processCloseFrame (/media/anonim/Data/mqlight/node_modules/amqp10/lib/connection.js:495:10)\n at Connection._receiveAny (/media/anonim/Data/mqlight/node_modules/amqp10/lib/connection.js:423:12)\n at Connection._receiveData (/media/anonim/Data/mqlight/node_modules/amqp10/lib/connection.js:357:8)\n at NetTransport. (/media/anonim/Data/mqlight/node_modules/amqp10/lib/connection.js:515:38)\n at emitOne (events.js:96:13)\n at NetTransport.emit (events.js:188:7)\n at Socket. (/media/anonim/Data/mqlight/node_modules/amqp10/lib/transport/net_transport.js:26:49)\n at emitOne (events.js:96:13)\n at Socket.emit (events.js:188:7)this one error log from MQ Server# tail -100f /var/mqm/qmgrs/QM1/errors/amqp_0.log\n\n3/31/17 19:14:44.115 AMQXR0041E: A connection was not authorized for channel SYSTEM.DEF.AMQP received from 172.17.0.1. MQRC 2035 MQRC_NOT_AUTHORIZED\n3/31/17 19:14:45.142 AMQXR0041E: A connection was not authorized for channel SYSTEM.DEF.AMQP received from 172.17.0.1. MQRC 2035 MQRC_NOT_AUTHORIZEDactually authenticate for AMQP is enabled if CONNAUTH and CHCKCLNT required changed to disabled i can connected with Node JS 6START SERVICE(SYSTEM.AMQP.SERVICE)\nSET CHLAUTH(SYSTEM.DEF.AMQP) TYPE(BLOCKUSER) USERLIST('nobody')\nSET CHLAUTH(SYSTEM.DEF.AMQP) TYPE(ADDRESSMAP) ADDRESS(*) USERSRC(CHANNEL) CHCKCLNT(REQUIRED)\nREFRESH SECURITY TYPE(CONNAUTH)\nSTART CHANNEL(SYSTEM.DEF.AMQP)\nDISPLAY CHSTATUS(SYSTEM.DEF.AMQP) CHLTYPE(AMQP)below the error log from /var/mqm/qmgrs/QM1/errors/AMQERR01.LOG04/02/17 07:10:16 - Process(587.6) User(mqm) Program(java)\n Host(770e29171038) Installation(Installation1)\n VRMF(9.0.1.0) QMgr(QM1)\n\nAMQ5534: User ID 'user' authentication failed\n\nEXPLANATION:\nThe user ID and password supplied by the 'AMQP' program could not be\nauthenticated. \nAdditional information: 'N/A'.\nACTION:\nEnsure that the correct user ID and password are provided by the application.\nEnsure that the authentication repository is correctly configured. Look at\nprevious error messages for any additional information.\n----- amqzfuca.c : 4486 -------------------------------------------------------\n04/02/17 07:10:16 - Process(587.6) User(mqm) Program(java)\n Host(770e29171038) Installation(Installation1)\n VRMF(9.0.1.0) QMgr(QM1)\n\nAMQ5542: The failed authentication check was caused by the queue manager\nCONNAUTH CHCKCLNT(REQDADM) configuration.\n\nEXPLANATION:\nThe user ID 'user' and its password were checked because the queue manager\nconnection authority (CONNAUTH) configuration refers to an authentication\ninformation (AUTHINFO) object named 'USE.OS' with CHCKCLNT(REQDADM). \n\nThis message accompanies a previous error to clarify the reason for the user ID\nand password check.\nACTION:\nRefer to the previous error for more information. \n\nEnsure that a password is specified by the client application and that the\npassword is correct for the user ID. The authentication configuration of the\nqueue manager connection determines the user ID repository. For example, the\nlocal operating system user database or an LDAP server. \n\nIf the CHCKCLNT setting is OPTIONAL, the authentication check can be avoided by\nnot passing a user ID across the channel. For example, by omitting the MQCSP\nstructure from the client MQCONNX API call. \n\nTo avoid the authentication check, you can amend the authentication\nconfiguration of the queue manager connection, but you should generally not\nallow unauthenticated remote access.\n-------------------------------------------------------------------------------\n04/02/17 07:10:17 - Process(587.6) User(mqm) Program(java)\n Host(770e29171038) Installation(Installation1)\n VRMF(9.0.1.0) QMgr(QM1)\n\nAMQ5534: User ID 'user' authentication failed\n\nEXPLANATION:\nThe user ID and password supplied by the 'AMQP' program could not be\nauthenticated. \nAdditional information: 'N/A'.\nACTION:\nEnsure that the correct user ID and password are provided by the application.\nEnsure that the authentication repository is correctly configured. Look at\nprevious error messages for any additional information.\n----- amqzfuca.c : 4486 -------------------------------------------------------\n04/02/17 07:10:17 - Process(587.6) User(mqm) Program(java)\n Host(770e29171038) Installation(Installation1)\n VRMF(9.0.1.0) QMgr(QM1)\n\nAMQ5542: The failed authentication check was caused by the queue manager\nCONNAUTH CHCKCLNT(REQDADM) configuration.\n\nEXPLANATION:\nThe user ID 'user' and its password were checked because the queue manager\nconnection authority (CONNAUTH) configuration refers to an authentication\ninformation (AUTHINFO) object named 'USE.OS' with CHCKCLNT(REQDADM). \n\nThis message accompanies a previous error to clarify the reason for the user ID\nand password check.\nACTION:\nRefer to the previous error for more information. \n\nEnsure that a password is specified by the client application and that the\npassword is correct for the user ID. The authentication configuration of the\nqueue manager connection determines the user ID repository. For example, the\nlocal operating system user database or an LDAP server. \n\nIf the CHCKCLNT setting is OPTIONAL, the authentication check can be avoided by\nnot passing a user ID across the channel. For example, by omitting the MQCSP\nstructure from the client MQCONNX API call. \n\nTo avoid the authentication check, you can amend the authentication\nconfiguration of the queue manager connection, but you should generally not\nallow unauthenticated remote access.\n-------------------------------------------------------------------------------### Assistant: SASL flow has been changed within the new Node JS client version. The new SASL flow is currently not supported by the IBM AMQP server. The AMQP server thinks that at this moment it should already have enough data for authentication and authorization of the client user. However, because of the change in the new Node JS client, the rest of the required data has not yet been sent when the server tries to authenticate the client. This is why the logs show that only the user 'mqm' has been set and no password supplied to the QMgr. Thus causing an authorization error APAR IT20283\n"} +{"text": "### Human: I need to create a SSL connection between an IBM MQ Qmanager and a Java Client. In order to do that using IBM Key Management GUI,Created key.dkb for QManager and added self-signed certificate to it.Then I extracted that certificate.(cert.arm)Created trustStore.jks file and under signer certificated I added cert.arm previously extracted.Put the path of key.dkb to Qmanager->SSL and choose suitable ciphersuit.In Java Client added System.property to trustStore.jks.When I run the program I got an exception as bellow.Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2397' ('MQRC_JSSE_ERROR').\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:203)\n ... 10 more\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2397;AMQ9204: Connection to host '127.0.0.1(1414)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2397;AMQ9771: SSL handshake failed. [1=javax.net.ssl.SSLHandshakeException[Remote host closed connection during handshake],3=localhost/127.0.0.1:1414 (localhost),4=SSLSocket.startHandshake,5=default]],3=127.0.0.1(1414),5=RemoteTCPConnection.protocolConnect]\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:2282)\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1294)\n at com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.jmqiConnect(InterceptedJmqiImpl.java:376)\n at com.ibm.mq.ese.jmqi.ESEJMQI.jmqiConnect(ESEJMQI.java:560)\n at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:345)\n ... 9 more\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2397;AMQ9771: SSL handshake failed. [1=javax.net.ssl.SSLHandshakeException[Remote host closed connection during handshake],3=localhost/127.0.0.1:1414 (localhost),4=SSLSocket.startHandshake,5=default]\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:1329)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnection.connect(RemoteConnection.java:863)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSessionFromNewConnection(RemoteConnectionSpecification.java:409)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSession(RemoteConnectionSpecification.java:305)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionPool.getSession(RemoteConnectionPool.java:146)\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1730)\n ... 13 more\nCaused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake\n at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:992)\n at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)\n at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)\n at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection$6.run(RemoteTCPConnection.java:1298)\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection$6.run(RemoteTCPConnection.java:1290)\n at java.security.AccessController.doPrivileged(Native Method)\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:1290)\n ... 18 more\nCaused by: java.io.EOFException: SSL peer shut down incorrectly\n at sun.security.ssl.InputRecord.read(InputRecord.java:505)\n at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)\n ... 25 moreBasically this means Qmanager doesn't have certificate signed by trustStore. \nSo I guess I have missed something during making selfsigned certificate and truststore.Can someone help me to create self-signed certificate to establish SSL connection with a java client using IBM Key Management GUI tool?### Assistant: I could solve the problem going through theibm mq troubleshooting guideI just ran mqcertck command in my Qmanager keystore repository and found it hasn't read access to key.kdb. After giving read access using chmod problem solved.\n"} +{"text": "### Human: In Windows7 when I setMQSNOAUT=yeseverything is ok and I can do whatever I want in WebSphere MQ. But in RedHat even after settingMQSNOAUTtoyesI'm getting this error:[root@RHEL6-135 bin]$ ll crtmqm \n-rwxrwxrwx. 1 mqm mqm 41822 Oct 22 2015 crtmqm \n[root@RHEL6-135 bin]$ crtmqm testqm \nAMQ7077: You are not authorized to perform the requested operation. \n[root@RHEL6-135 bin]$Usingmqmuser I can create queue manager but cannot start it:[mqm@RHEL6-135 bin]$ crtmqm testqm \nWebSphere MQ queue manager created. \nDirectory '/var/mqm/qmgrs/testqm' created. \nThe queue manager is associated with installation 'Installation1'. \nCreating or replacing default objects for queue manager 'testqm'. \nDefault objects statistics : 79 created. 0 replaced. 0 failed. \nCompleting setup. \nSetup completed. \n[mqm@RHEL6-135 bin]$ strmqm testqm \nWebSphere MQ queue manager 'testqm' starting. \nThe queue manager is associated with installation 'Installation1'. \n5 log records accessed on queue manager 'testqm' during the log replay phase. \nLog replay for queue manager 'testqm' complete. \nTransaction manager state recovered for queue manager 'testqm'. \nThe queue manager ended for reason 545284129, ''. \n[mqm@RHEL6-135 bin]$Unfortunately, there is no useful information in these log files:/var/mqm/errors/AMQERR01.LOG:----- amqxfdcx.c : 888 -------------------------------------------------------- \n03/14/2017 10:00:16 AM - Process(15859.1) User(mqm) Program(amqzmur0) \n Host(RHEL6-135) Installation(Installation1) \n VRMF(8.0.0.4) \nAMQ6125: An internal WebSphere MQ error has occurred. \n\nEXPLANATION: \nAn internal error has occurred with identifier 2080520F. This message is \nissued in association with other messages. \nACTION: \nUse the standard facilities supplied with your system to record the problem \nidentifier and to save any generated output files. Use either the MQ Support \nsite: http://www.ibm.com/software/integration/wmq/support/, or IBM Support \nAssistant (ISA): http://www.ibm.com/software/support/isa/, to see whether a \nsolution is already available. If you are unable to find a match, contact your \nIBM support center. Do not discard these files until the problem has been \nresolved. \n... \nrepeated 27 times!/var/mqm/qmgrs/testqm/errors/AMQERR01.LOG:03/14/2017 10:00:16 AM - Process(15840.4) User(mqm) Program(amqzmuc0) \n Host(RHEL6-135) Installation(Installation1) \n VRMF(8.0.0.4) QMgr(testqm) \n\nAMQ5051: The queue manager task 'LOGGER-IO' has started. \n\nEXPLANATION: \nThe critical utility task manager has started the LOGGER-IO task. This task has \nnow started 1 times. \nACTION: \nNone. \n------------------------------------------------------------------------------- \n ....\n------------------------------------------------------------------------------- \n03/14/2017 10:00:16 AM - Process(15859.6) User(mqm) Program(amqzmur0) \n Host(RHEL6-135) Installation(Installation1) \n VRMF(8.0.0.4) QMgr(testqm) \n\nAMQ5037: The queue manager task 'DEFERRED_DELIVERY' has started. \n\nEXPLANATION: \nThe restartable utility task manager has started the DEFERRED_DELIVERY task. \nThis task has now started 1 times. \nACTION: \nNone. \n-------------------------------------------------------------------------------Themqmuser issudoerand the following is a part of my /etc/group file:root:x:0:root, mqm, bin\nadm:x:4:root,adm,daemon, mqm, mquser\nmqm:x:500:root, mqm\nmquser:x:502:mqm... regardless all these, I think havingMQSNOAUTvariable that is set toyesshould be enough to work with WebShpere MQ using any user. Maybe something related to RedHat caused the problem.BTW, searching forThe queue manager ended for reason 545284129, ''., I couldn't find any solution.Any thoughts?UPDATEHaving donechmod -R 6550on/opt/mqm/bin, now I can start queue managers and create queue, channel, ... using IBM MQ's command line binaries. For more convenient, however, still I can't use MQ Explorer, because when I runMQExplorerI get the following error:[mqm@RHEL6-135 bin]$ MQExplorer\nNo protocol specified\nMQExplorer: Cannot open display:\nNo protocol specified\nNo protocol specified\nMQExplorer: Cannot open display:\nMQExplorer:\nAn error has occurred. See the log file\n/var/mqm/IBM/WebSphereMQ/workspace-Installation1/.metadata/.log.\n[mqm@RHEL6-135 bin]$Running it withsudoI get this error:[mqm@RHEL6-135 bin]$ sudo MQExplorer\n[sudo] password for mqm:\n/opt/mqm/java/jre64/jre/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory\n\n(process:4451): Gtk-WARNING **: This process is currently running setuid or setgid.\nThis is not a supported use of GTK+. You must create a helper\nprogram instead. For further details, see:\n\n http://www.gtk.org/setuid.html\n\nRefusing to initialize GTK+.\n[mqm@RHEL6-135 bin]$and the/var/mqm/IBM/WebSphereMQ/workspace-Installation1/.metadata/.logis as follows:!SESSION 2017-03-15 16:41:52.369 -----------------------------------------------\neclipse.buildId=unknown\njava.fullversion=JRE 1.7.0 IBM J9 2.7 Linux amd64-64 Compressed References 20150630_255653 (JIT enabled, AOT enabled)\nJ9VM - R27_Java727_SR3_20150630_2236_B255653\nJIT - tr.r13.java_20150623_94888.01\nGC - R27_Java727_SR3_20150630_2236_B255653_CMPRSS\nJ9CL - 20150630_255653\nBootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US\nCommand-line arguments: -os linux -ws gtk -arch x86_64\n\n!ENTRY org.eclipse.osgi 4 0 2017-03-15 16:41:54.516\n!MESSAGE Application error\n!STACK 1\norg.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]\n at org.eclipse.swt.SWT.error(SWT.java:4423)\n at org.eclipse.swt.widgets.Display.createDisplay(Display.java:925)\n at org.eclipse.swt.widgets.Display.create(Display.java:909)\n at org.eclipse.swt.graphics.Device.(Device.java:156)\n at org.eclipse.swt.widgets.Display.(Display.java:507)\n at org.eclipse.swt.widgets.Display.(Display.java:498)\n at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:691)\n at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:162)\n at com.ibm.mq.explorer.ui.rcp.internal.base.RcpApplication.start(RcpApplication.java:88)\n at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)\n at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)\n at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)\n at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)\n at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)\n at java.lang.reflect.Method.invoke(Method.java:620)\n at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)\n at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)\n at org.eclipse.equinox.launcher.Main.run(Main.java:1450)\n at org.eclipse.equinox.launcher.Main.main(Main.java:1426)The log/stacktrace looks like acatch-allexception handling. I didn't yet completely digged into this error but maybe it is also caused by some permission problems. For example, maybe some authorization errors are raised when MQExplorer tries to load it's components from mqm's sub-directories! However, runningchmod -R 6550on some related paths didn't solve the problem.### Assistant: SettingMQSNOAUT=ANYVALUEonly turns off MQ OAM if it is set at the time the queue manager is created. It results a few lines being omitted from the qm.ini file for the queue manager you create while it is set.If OAM is turned off it means only that any user connecting to the queue manager will have full authority.The queue manager itself on Unix still needs to run under the mqm userid.I noted that you showed the following permissions on the crtmqm binary:-rwxrwxrwx. 1 mqm mqmThis is not correct, the MQ install on Unix has many of the files with setuid permission because the permissions on the files that are created under/var/mqm/qmgrs,/var/mqm/log,/var/mqm/socketsare very important. From the research I did the 545284129 and 2080520F errors are related to file permissions. I would suggest you reset the permissions back to what they previously were, if you do not know then I would suggest you remove the IBM MQ software and reinstall. For reference below is the normal permissions on the crtmqm binary:-r-sr-s--- 1 mqm mqmOnce the IBM MQ binary permissions are corrected I would suggest that you usedltmqmto delete your queue manager and ensure that nothing remains related to that queue manager name under/var/mqm/qmgrs,/var/mqm/log,/var/mqm/sockets, and in the/var/mqm/mqs.inifile.Once it is cleaned up, create it again as the mqm user and try starting it.I would suggest that you try not to disable security and instead set things up with proper permissions. Even if this is a development environment, it is much better to get things working with security enabled. When you develop with security disabled you end up needing to troubleshoot why things are not working later when security is turned on in a real environment.Take a look at my answer to question \"Provide anonymous access to IBM WebSphere MQ\" for some more information on how to keep security enabled as well as disabling things if you want to continue down that path.\n"} +{"text": "### Human: I Am using Java application to connect to WMQ so as to create test suite, which pass message from a file to queue and wait for response from other queue, I am using WMQ V7.0 and ih03_RFHutil package provided by IBM, but after configuring every thing correctly I am getting below error message. It looks like some Authentication issue. Can some one please help me in this.Below is Logs I have taken using log4j:2017-03-06 17:26:01 DEBUG Runner_TMH_Tester:108 - initial sleep time 20 tune = 0\n2017-03-06 17:26:01 DEBUG Runner_TMH_Tester:108 - connecting to TESTQMGR\n2017-03-06 17:26:01 DEBUG Runner_TMH_Tester:108 - MQSeries error with MQCONN on TESTQMGR - compcode = 2, reason = 2058### Assistant: MQ v7.0 was released June 27th 2008 and has been out of support since September 30th 2015 (almost 1.5 years). The version probably does not have anything to do with your issue but I would strongly suggest that you move to a supported version of the MQ client. Newer MQ client versions can connect to older MQ queue managers. You can download a java only install of MQ 8.0 or MQ 9.0 jar files at the links below:IBM MQ v8.0 ClientIBM MQ v9.0 ClientThe MQ client and queue manager install come with a program called mqrc. You can run this against the MQ return code, in this case 2058 to come up with a more meaning full description:$ mqrc 2058\n\n 2058 0x0000080a MQRC_Q_MGR_NAME_ERRORThis is telling you thatTESTQMGRis not the name of the queue manager that exists on the host and port you are connecting too. Verify the queue manager name, hostname, and port are all correct.\n"} +{"text": "### Human: I have a virtual ip which points to 2 servers having qmgrs qm1 and qm2 respectively. \nI need a qmgr alias to give it to another application so that they can call the virtual ip with the the qmgr alias and the qmgr alias should point to the particular server's qmgr accordingly.What I did:I have created qmgr alias as follows.In server 1 with QM1:Define qremote(QMALIAS) rname('') rqmname(QM1) xmitq(x)In server2:Define qremote(QMALIAS) rname('') rqmname(QM2) xmitq(x)I get a 2059 error from the other application when it tries to access the virtualip and QMALIAS.I use IBM MQ. \nCan someone please help?### Assistant: You said you get a2059error from the application, I think you mean a2058(MQRC_Q_MGR_NAME_ERROR).In the QREMOTE definitions for a QMALIAS you should leave the XMITQ blank:DEFINE QREMOTE(QMALIAS) RNAME('') RQMNAME(QM1) XMITQ('')\nDEFINE QREMOTE(QMALIAS) RNAME('') RQMNAME(QM2) XMITQ('')On the client side you have two choices to make this work:Do not specify the queue manager name on the MQCONN call, either leave it blank (NULL) or spaces only.Place a*in the queue manager name on the MQCONN call, ex:*QMALIASor simply*.This will cause the client to not check that the RQMNAME matches the name in the MQCONN call and it will then not produce the2058(MQRC_Q_MGR_NAME_ERROR).Also note that if you leave the BASE QMNAME blank on MQOPEN calls you do not need the QMALIAS entries for client apps. If you need to also support remote queue managers connecting through the VIP, then you will need the QMALIAS for that purpose.\n"} +{"text": "### Human: My company uses IBM MQ's Multi-Instance Queues right now. We would like to replicate those queues to a different Data Center over the WAN for Disaster Recover purposes. I'm skeptical it will work simply due to all the message traffic and even a slight delay will cause the Queues to fail.What is the technical reason why this will not work?### Assistant: Are you talking about storage replication? If so are you planning to use synchronous or asynchronous replication?Asynch will not cause any delay on the replicating end but there will be some amount of delay before the receiving end receives data depending on network distance. Your storage team should be able to tell you how many seconds the async replication delay could be.With synch the data is sent over the network by the replicating end storage array and a confirmation comes back over the network before the the storage array returns to the OS that the write was successful. To be usable the two arrays have to be with in 6ms of each other. This type of replication adds a delay to each write equal to the network ms.MQ application can batch messages into single units of work to improve performance with sync replication is in place, but this will slow down persistent message performance.\n"} +{"text": "### Human: I have used the below code to inhibit the queue but when I try to inhibit I got the error.I have tried various open options for the particular queue but still i have the issue. what else i missed in my code;public void control(String mgrName, String queueName, int openOptions, string option)throws MQException{\n qMgr = new MQQueueManager(mgrName);\n mqQueue = qMgr.accessQueue(queueName, openOptions); \n if (option.equalsIgnoreCase(\"stop\")){\n System.out.println(\"Stop mesage received\");\n mqQueue.setInhibitGet(MQC.MQQA_GET_INHIBITED);\n System.out.println(\"Queue inhibitted successfully\");\n }else if(option.equalsIgnoreCase(\"start\")){\n System.out.println(\"Start mesage received\");\n mqQueue.setInhibitGet(MQC.MQQA_GET_ALLOWED);\n System.out.println(\"Queue get allowed successfully\");\n }\n}I have got the below Error when call this method.com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2040### Assistant: 2040 = MQRC_NOT_OPEN_FOR_SET. The IBM v7.5 Knowledge center page \"2040 (07F8) (RC2040): MQRC_NOT_OPEN_FOR_SET\" describes the reason for this error:ExplanationAn MQSET call was issued to set queue attributes, but the queue had not been opened for set.Programmer responseSpecify MQOO_SET when the object is opened.If theopenOptionspassed tocontrolincludedMQOO_SETthen the error should go away.Example below:int openOptions = MQConstants.MQOO_FAIL_IF_QUIESCING | MQConstants.MQOO_SET\n"} +{"text": "### Human: Guys I am trying to connect to MQ Hub from WAS Liberty application. Our MQ Hub supports only SSL certificate authentication. I have created QCF, Keystore with JKS file and with certificate inside it. Then I created defaultSSLConfig and pointed to that keystore.But I could not find anyway to specify the SSLConfig in the QCF and read on some page that it was not possible. The only way was to use defaultSSLConfig and specify keystore from there which I did. So now I am here and MQ connection does not work. On the MQ Hub logs I see the error saying that \"The channel is lacking a certificate to use for the SSL handshake.\"This is how my QCF looks like, no parameter to specify an SSL config\n \n Full error on MQ sideEXPLANATION:The channel is lacking a certificate to use for the SSL handshake. Thechannelname is 'XXX.ADM.SVRCONN' (if '????' it is unknown at this stage in the \n SSLprocessing).The remote host is 'XXX (10.xx.xx.x)'.The channel did not start.ACTION:Make sure the appropriate certificates are correctly configured in thekeyrepositories for both ends of the channel.----- amqccisa.c : 735502/14/17 15:07:44 - Process(7510.304808) User(mqm) Program(amqrmppa)Host(xxx) Installation(Installation1)VRMF(7.5.0.6) QMgr(XXXXX)AMQ9999: Channel 'XXX.ADM.SVRCONN' to host 'xxx (10.xx.xx.xx)' ended\n abnormally.EXPLANATION:The channel program running under process ID 7510 for channel 'XX.ADM. \n SVRCONN'ended abnormally. The host name is 'xx (10.xx.xx.xx)'; in somecases thehost name cannot be determined and so is shown as '????'.ACTION:Look at previous error messages for the channel program in the errorlogs todetermine the cause of the failure. Note that this message can beexcludedcompletely or suppressed by tuning the \"ExcludeMessage\" or\"SuppressMessage\"attributes under the \"QMErrorLog\" stanza in qm.ini. Further information \n can befound in the System Administration Guide.### Assistant: It is working now :) What we think was the cause of the problem is this bughttp://www-01.ibm.com/support/docview.wss?uid=swg1IT16056Although the error in APAR above is not the same I was getting. I was seeing this error on the Liberty (client side)Caused by: com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed withcompcode '2' ('MQCC_FAILED') reason '2059' ('MQRC_Q_MGR_NOT_AVAILABLE').\nat com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.\njava:203)I was using this resource adapter when the problem was manifesting itself: 9.0.1.0-IBM-MQ-Java-InstallRA.jar\nThen we decided to try lower version of the adapter which had that APAR/fix in it and thus used this one: 8.0.0.6-WS-MQ-Java-InstallRA.jarSo that solved the problem.I was pretty sure that the above bugfix was included in Ver 9.X of the resource adapter but as it turns out it is not the case.\n"} +{"text": "### Human: I want to know TLSv2 with JDk8 Ciphersuites and specs with MQ8?I created a jks file on MQ8 with 'runmqckm' command on unixis jks have any dependency on Ciphersuites and Spec on parameter '-sig_alg'https://www.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.ref.adm.doc/q083860_.htmQuestion on TLSv2 CiphersuiteSUite<>SPec combination is not working as below sitehttps://www.ibm.com/support/knowledgecenter/en/SSFKSJ_8.0.0/com.ibm.mq.dev.doc/q113220_.htmCipherSpec - TLS_RSA_WITH_AES_128_CBC_SHA256Equivalent CipherSuite - SSL_RSA_WITH_AES_128_CBC_SHA256Protocol - TLSv1.2FIPS 140-2 compatible - yesworkingMQEnvironment.sslCipherSuite = \"TLS_RSA_WITH_AES_128_CBC_SHA256\"ALTER CHANNEL(TEST.CH) CHLTYPE(SVRCONN) SSLCIPH(TLS_RSA_WITH_AES_128_CBC_SHA256)Not workingMQEnvironment.sslCipherSuite = \"SSL_RSA_WITH_AES_128_CBC_SHA256\";ALTER CHANNEL(TEST.CH) CHLTYPE(SVRCONN) SSLCIPH(TLS_RSA_WITH_AES_128_CBC_SHA256)Only 3 TLS Ciphers i can Test as below , what spec i can use?Oracle CipherSuite1.TLS_RSA_WITH_NULL_SHA2562.TLS_RSA_WITH_AES_128_CBC_SHA2563.TLS_RSA_WITH_AES_256_CBC_SHA256MQ Spec1.??2.TLS_RSA_WITH_AES_128_CBC_SHA2563.??Only 1 cipher i can use part of TLS (JDK8 + MQ8)?WorkingTLS_RSA_WITH_AES_128_CBC_SHA256 --> TLS_RSA_WITH_AES_128_CBC_SHA256Not WorkingTLS_RSA_WITH_NULL_SHA256 --> TLS_RSA_WITH_NULL_SHA256ALTER CHANNEL(TEST.CH) CHLTYPE(SVRCONN) SSLCIPH(TLS_RSA_WITH_NULL_SHA256)\n 1 : ALTER CHANNEL(TEST.CH) CHLTYPE(SVRCONN) SSLCIPH(TLS_RSA_WITH_NULL_SHA256)\nAMQ8242: SSLCIPH definition wrong.Not workingTLS_RSA_WITH_AES_256_CBC_SHA256 --> TLS_RSA_WITH_AES_256_CBC_SHA256MQJE001: Completion Code '2', Reason '2393'.\ncom.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2393'.\n at com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:249)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnection(MQClientManagedConnectionFactoryJ11.java:450)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnection(MQClientManagedConnectionFactoryJ11.java:487)\n at com.ibm.mq.StoredManagedConnection.(StoredManagedConnection.java:97)\n at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:194)\n at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:868)\n at com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:816)\n at com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:758)\n at com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:200)\n at com.ibm.mq.MQQueueManager.(MQQueueManager.java:682)\n at MQProducerTLS.main(MQProducerTLS.java:89)\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2393;AMQ9204: Connection to host 'localhost(2017)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2393;AMQ9771: SSL handshake failed. [1=java.lang.IllegalArgumentException[Cannot support TLS_RSA_WITH_AES_256_CBC_SHA256 with currently installed providers],3=localhost/127.0.0.1:2017 (localhost),4=SSLSocket.createSocket,5=default]],3=localhost(2017),5=RemoteTCPConnection.makeSocketSecure]\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:2282)\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1294)\n at com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.jmqiConnect(InterceptedJmqiImpl.java:376)\n at com.ibm.mq.ese.jmqi.ESEJMQI.jmqiConnect(ESEJMQI.java:560)\n at com.ibm.mq.MQSESSION.MQCONNX_j(MQSESSION.java:916)\n at com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:235)\n ... 10 more\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2393;AMQ9771: SSL handshake failed. [1=java.lang.IllegalArgumentException[Cannot support TLS_RSA_WITH_AES_256_CBC_SHA256 with currently installed providers],3=localhost/127.0.0.1:2017 (localhost),4=SSLSocket.createSocket,5=default]\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.makeSocketSecure(RemoteTCPConnection.java:2049)\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.connnectUsingLocalAddress(RemoteTCPConnection.java:861)\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:1277)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnection.connect(RemoteConnection.java:863)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSessionFromNewConnection(RemoteConnectionSpecification.java:409)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSession(RemoteConnectionSpecification.java:305)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionPool.getSession(RemoteConnectionPool.java:146)\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1730)\n ... 15 more\nCaused by: java.lang.IllegalArgumentException: Cannot support TLS_RSA_WITH_AES_256_CBC_SHA256 with currently installed providers\n at sun.security.ssl.CipherSuiteList.(CipherSuiteList.java:81)\n at sun.security.ssl.SSLSocketImpl.setEnabledCipherSuites(SSLSocketImpl.java:2461)\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.makeSocketSecure(RemoteTCPConnection.java:2041)\n ... 22 moreUpdate on 20-Feb-2017when sample code , placed in application getting below Authorization errors\n New Question link as belowhttp://stackoverflow.com/questions/42347461/authorization-errors-with-mq8-jdk8### Assistant: Regarding the-sig_algflag for therunmqckmcommand, the details below are in the link you provided:The hashing algorithm used during the creation of a certificate\n request, a self-signed certificate, or the signing of a certificate.\n This hashing algorithm is used to create the signature associated with\n the newly-created certificate or certificate request.In shore the-sig_algflag for therunmqckmcommand is not related to the CipherSuite your specify in Java or the CipherSpec you specify on the MQ SVRCONN channel.In my answer to your previous question \"mq-error-on-ssl-enabledI provided this information:The table in the APARIV66840has this information:The following WebSphere MQ CipherSuite to CipherSpec mappings have\n been enabled by this APAR for WebSphere MQ v7.1 and v7.5 where the\n classes for Java and classes for JMS support SHA-2:\ufff4Oracle CipherSuite IBM MQ CipherSpec\nTLS_RSA_WITH_NULL_SHA256 TLS_RSA_WITH_NULL_SHA256\nTLS_RSA_WITH_AES_128_CBC_SHA256 TLS_RSA_WITH_AES_128_CBC_SHA256\nTLS_RSA_WITH_AES_256_CBC_SHA256 TLS_RSA_WITH_AES_256_CBC_SHA256If you follow the link to APAR IV66840 I provided you will find the same type of information regarding MQ v8.0:The following WebSphere MQ CipherSuite to CipherSpec mappings\n have been enabled by this APAR for WebSphere MQ v8:CipherSuite --> CipherSpec\n...\nTLS_RSA_WITH_AES_128_CBC_SHA256 --> TLS_RSA_WITH_AES_128_CBC_SHA256\n...\nTLS_RSA_WITH_AES_256_CBC_SHA256 --> TLS_RSA_WITH_AES_256_CBC_SHA256\n...\nTLS_RSA_WITH_NULL_SHA256 --> TLS_RSA_WITH_NULL_SHA256UPDATE (2017/02/16) to address further questionsQuestion 1:TLS_RSA_WITH_NULL_SHA256Not WorkingAnswer:TLS_RSA_WITH_NULL_SHA256is considered a weak Cipher Specification since it does not provide encryption of the data and is disabled by default in v8.0.If you really want to use this weak Cipher Specification you would either set the following Environment variable before you start the Queue Manager:AMQ_SSL_WEAK_CIPHER_ENABLE=TLS_RSA_WITH_NULL_SHA256Or add the following to theSSL:stanza of the qm.ini and start the Queue Manager:SSL:\n AllowWeakCipherSpec=TLS_RSA_WITH_NULL_SHA256Below is more detail on this subject.In my Answer to your prior question\"MQ Error on SSL enabled\" I provided the following information:There is a very good IBM developerWorks blog post \"SSL and TLS Cipher\n Specification Deprecations for the MQ\n Product\"\n posted May 19 2016 by Miguel A. Rodriguez that goes into detail about\n which ciphers are deprecated in various Fix Packs.In that link it states:V. With the release IBM MQ V8.0.0.3, SSL and weak TLS Cipher\n Specifications continue to be deprecated (disabled), as in the prior\n versions mentioned above, but now weak Cipher Specifications require a\n new value. This change is for both SSL and weak TLS Cipher\n Specifications.AMQ_SSL_WEAK_CIPHER_ENABLE=Value\nor\nSSL:\nAllowWeakCipherSpec=ValueThe accepted values for the environment variable or queue manager configuration setting is as follows:A single SSL or Weak TLS Cipher Specification Name.A string of SSL or Weak TLS Cipher Specification names delimited by commas.The value of \"ALL\" to enable all SSL and all weak TLS Cipher Specifications.. . .VI. Deprecated (disabled) SSL Cipher Specifications and Weak TLS\n Cipher Specifications.NOTE: These are the Cipher Specifications that REQUIRE the environment\n variables or qm.ini setting discussed previously, in order to use them\n for encrypted communications.Below is a list of deprecated (disabled) Cipher Specifications\n categorized by the protocol, the version, and applicable Operating\n System. Details concerning deprecated Cipher Specifications can be\n found in product documentation section \"Deprecated CipherSpecs.\"SSL V3All CipherSpecs are disabled by defaultTLS 1.0Cipher Specification Operating SystemTLS_RSA_EXPORT_WITH_RC2_40_MD5 IBMiTLS_RSA_EXPORT_WITH_RC4_40_MD5 IBMiTLS_RSA_WITH_DES_CBC_SHA All PlatformsTLS_RSA_WITH_NULL_MD5 IBMiTLS_RSA_WITH_NULL_SHA IBMiTLS_RSA_WITH_RC4_128_MD5 IBMiTLS 1.2Cipher Specification Operating SystemECDHE_ECDSA_NULL_SHA256 Linux,Windows,UnixECDHE_ECDSA_RC4_128_SHA256 Linux,Windows,UnixECDHE_RSA_NULL_SHA256 Linux,Windows,UnixECDHE_RSA_RC4_128_SHA256 Linux,Windows,UnixTLS_RSA_WITH_NULL_NULL Linux,Windows,UnixTLS_RSA_WITH_NULL_SHA256 All PlatformsTLS_RSA_WITH_RC4_128_SHA256 Linux,Windows,UnixQuestion 2:TLS_RSA_WITH_AES_256_CBC_SHA256Not WorkingAnswer: Reusing the same Answer to your prior question\"MQ Error on SSL enabled\" I provided the following information:After searching on the error you are receiving I found this dW Answers\n post \"Why do I get AMQ9771, 2393 SSL Initialization error from a MQ\n Java/JMS application when trying to use an TLS AES 256\n cipher?\".\n It states that the following:In this case, the issue is caused by attempting to use AES 256 strong\n cipher algorithms.Most Java JREs, including Oracle/Sun and IBM's have Import Limits on\n Cryptographic Algorithms enabled. This limits the maximum key sizes\n and also some algorithms.When trying to use a AES 256 cipher, such as\n ECDHE_RSA_AES_256_CBC_SHA384 orTLS_RSA_WITH_AES_256_CBC_SHA256with a\n MQ Java/JMS application, you need to ensure your JRE supports this\n cipher. In most cases, when the stronger cipher algorithms are needed,\n such as AES 256 ciphers, the JCE Unlimited Strength Jurisdiction\n Policy Files must be obtained and installed in the JDK/JRE.This is noted in the JDK/JRE documentation: For Oracle 1.7:http://docs.oracle.com/javase/7/docs/technotes/guides/security/SunProviders.htmlThe link above to the oracle site states:If stronger algorithms are needed (for example, AES with 256-bit\n keys), theJCE Unlimited Strength Jurisdiction Policy Filesmust be\n obtained and installed in the JDK/JRE.It is the user's responsibility to verify that this action is\n permissible under local regulations.I would suggest that you either use the lower CipherSuiteTLS_RSA_WITH_AES_128_CBC_SHA256, or follow the advise above to\n obtain and install theJCE Unlimited Strength Jurisdiction Policy\n Files.\n"} +{"text": "### Human: I'm trying to configure an MQ client connection (using amqsgetc for the moment).\nI need to use SSL to get access using channel authentication records.It works perfectly when using a CHLTAB, but I can't find a way to do the same using mqclient.ini file.IthinkI have looked all over the documentation, but do not see an option to specify the cipher spec I need, neither in the ini file itself, nor in an environment variable.AMQERR01.log keeps telling me my client did not specify the cipher spec.Below is the mqclient.ini I use. (the file works fine when I'm using a non-SSL channel)CHANNELS:\nDefRecon=YES\nServerConnectionParms=LAURENT_PC450_SSL/TCP/localhost(1414)\n\nSSL:\nSSLKeyRepository=C:\\ProgramData\\IBM\\MQ\\qmgrs\\LAURENT_PC450\\ssl\\clientkey\nCertificateLabel=ibmwebspheremqlaurent\nSSLCipherSpec=ssl_rsa_with_3des_ede_cbc_sha### Assistant: Themqclient.inican specify the equivalent of theMQSERVERenvironment variable or theMQCHLLIB/MQCHLTABenvironment variables.When providing the client connection details viaMQSERVERenvironment variable or mqclient.ini equivalent you can not specify encryption details.To specify encryption details you can use one of the follow:Specify this programmatically usingMQCONNXin theMQCDprovided byClientConnOffsetandClientConnPtrinMQCNO.A pre-connect exit can also override or provide the details above by modifying theMQCDif present or providing aMQCD.If aMQCDis not found then a MQ Channel Table pointed to by theMQCHLLIB/MQCHLTABenvironment variables or the mqclient.ini equivalent of this.\n"} +{"text": "### Human: I am attempting to create multi queue. I have array of Queues.MessageConsumer consumer = session.createConsumer(queue[i]);How do i make MessageConsumer as array to loop consumer list and process consumers. Since it is interface i cannot able to do it.Please provide me suggestion.### Assistant: You can instantiate an array but you cannot interface.MessageConsumer[] consumer = new MessageConsumer[queue.length]This should help you.\n"} +{"text": "### Human: Can you please help me, I am trying to find the ibm mq depth over SSL channel.Security.setProperty(\"ssl.SocketFactory.provider\",\n \"com.ibm.jsse2.SSLSocketFactoryImpl\");\nSecurity.setProperty(\"ssl.ServerSocketFactory.provider\",\n \"com.ibm.jsse2.SSLServerSocketFactoryImpl\");\n\nSystem.setProperty(\"javax.net.ssl.trustStore\", \"abcd.jks\");\nSystem.setProperty(\"javax.net.ssl.trustStorePassword\",\n \"abcd\");\n\nSystem.setProperty(\"javax.net.ssl.keyStore\", \"abcd.jks\");\nSystem.setProperty(\"javax.net.ssl.keyStorePassword\",\n \"abcd\");\n\n\nint openOptions = MQC.MQOO_INQUIRE + MQC.MQOO_INPUT_AS_Q_DEF;\n\nMQEnvironment.hostname = \"test\";\nMQEnvironment.port = 1234;\nMQEnvironment.channel = \"test\";\n\nMQEnvironment.sslCipherSuite = \"TLS_RSA_WITH_AES_128_CBC_SHA\";\n\nMQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,\n MQC.TRANSPORT_MQSERIES_CLIENT);\n\nMQQueueManager qMgr = new MQQueueManager(\"test\");\n\nMQQueue destQueue = qMgr.accessQueue(\"TEST.ERROR\", openOptions);\nSystem.out.println(\"TEST.ERROR size:\" + destQueue.getCurrentDepth());\ndestQueue.close();\nqMgr.disconnect();\n\n\n } catch (MQException e) {\n\n e.printStackTrace();\n }When I try to run this code, I got the following exception:MQJE001: Completion Code 1, Reason 2068### Assistant: The reason code 2068clearly statesthat you are trying to get the depth of a remote queue. You can't - it's on a different box. You have to connect to the queue manager where yourTEST.ERRORqueue is local.\n"} +{"text": "### Human: I have written a Websphere MQ listener using Spring boot (JMS). I have configured the backout queue at queue level with threshold as 0As part of program I am throwing JMSException immediately I receive message so that my message goes to back out queue.The problem that I am facing is that message is getting continuously re-delivered to listenerJMSMessage class: jms_text\nJMSType: null\nJMSDeliveryMode: 2\nJMSExpiration: 0\nJMSPriority: 0\nJMSMessageID: ID:414d51204d5148554244313020202020583e8e2b26af9905\nJMSTimestamp: 1484639118180\nJMSCorrelationID: null\nJMSDestination: null\nJMSReplyTo: null\nJMSRedelivered: true\nJMSXAppID: WebSphere MQ Client for Java\nJMSXDeliveryCount: 98\nJMSXUserID: a450922 \nJMS_IBM_Character_Set: UTF-8\nJMS_IBM_Encoding: 546\nJMS_IBM_Format: MQSTR \nJMS_IBM_MsgType: 8\nJMS_IBM_PutApplType: 28\nJMS_IBM_PutDate: 20170117\nJMS_IBM_PutTime: 07451818\n\n\n\n @JmsListener(destination = \"${ibm.mq.incomingqueue}\", containerFactory = \"defaultJmsListenerContainerFactory\")\npublic void onMessage(TextMessage message) throws JMSException {\n\n System.out.println(\"Here\" + message.toString());\n\n throw new JMSException(\"reason\");\n\n}### Assistant: BOTHRESH must be greater than or equal to1. Setting BOTHRESH to0disables it.Reference theHow WebSphere Application Server handles poison messagesby IBM's \nPaul Titheridge.When WebSphere MQ is the JMS provider\n By default, queues created with WebSphere MQ have the Backout threshold property (known in WebSphere MQ terms as BOTHRESH) set to 0. Therefore, the default behaviour of WebSphere MQ is never to back out poison messages.\n"} +{"text": "### Human: Searching in the web I found a lot of example of how spring have to be configured (file.xml) for publish/subscriber mode for active MQ but I need how beans need to be configured for Websphere MQ\nAnyone have been configured both product with success?### Assistant: The following is bean definition of a Websphere MQConnectionFactory:\n \n QUEUE_MANAGER\n \n \n 127.0.0.1\n \n \n 1414\n \n \n 1\n \n \n SYSTEM.DEF.SVRCONN\n \nyou may need to provide a username and password, and you can accomplish that by wrapping it in aUserCredentialsConnectionFactoryAdapter:\n \n \n \nIt is also a good idea to wrap it in aCachingConnectionFactory, so that sessions, consumers and producers are cached, this wrapper also switches the auto-recovery to true:\n \n \n \n \nwith this configuration, you can use thecachingConnectionFactorywith whatever bean you need.\n"} +{"text": "### Human: I'm migrating a queue from one QM to another. I stopped the application reading the queue, but I don't have control over the application putting to it.What I want to do is:Create a new queue with the same name on another QM but shared in the MQ cluster where both QMs belong to.Install a new application that will read from this new queue.Remove the old queue so that the application putting will start putting on the new queue because of the MQ cluster queue location resolution.For this to work, I need to stop the application making the PUT because it's keeping the old queue opened (when trying to delete I have the \"Object is open\" error). The application in question cannot be easily stopped, however, due to some SLA constraints.I would like to find a command that would force the release of this queue and remove it, thus forcing the client (application doing PUT) to reconnect. Or is there any other way to achive this at runtime?### Assistant: Queue which has open handle can not be deleted. I suggest stopping the connection from the application and then delete the queue before the application making a new connection. Other option would be to stop the channel instance, delete the queue and then start the channel instance. However, for a SVRCONN channel, it would affect other applications if they use the same channel.Identify the connection using DISPLAY CONN:http://www.ibm.com/support/knowledgecenter/SSFKSJ_9.0.0/com.ibm.mq.ref.adm.doc/q086140_.htmStop the connection using STOP CONN:http://www.ibm.com/support/knowledgecenter/SSFKSJ_9.0.0/com.ibm.mq.ref.adm.doc/q086790_.htmIf this is not helpful (e.g. the application might initiate a new connection before the queue is deleted) then you could try STOP CHL. However as indicated other applications might be affected depending on whether they use the same channel or different channel. Moreover if you running the Channel Process in FASTPATH mode (trusted listener), mode FORCE can not be used.\n"} +{"text": "### Human: Below I have posted a Java MQ GET routine to get info from MQ and store it on DB.But the problem is raised when the connection is lost between GET and COMMIT.Connection lost is interpreted as COMMIT!!! Then data is lost.How should I implement concrete GET & COMMIT/BACKOUT model ???String hostName = \"192.168.163.63\";\nint port = 1418;\nString userId = \"mq\";\nString password = \"mq\";\nString queueManagerName = \"QueueManager1418\";\nString channelName = \"ServerChannel\";\nString queueName = \"TestQueue\";\n\nMQEnvironment.hostname = hostName;\nMQEnvironment.port = port;\nMQEnvironment.userID = userId;\nMQEnvironment.password = password;\nMQEnvironment.channel = channelName;\ntry {\n MQQueueManager qMgrIn1 = new MQQueueManager(queueManagerName);\n int openOptionsIn1 = CMQC.MQOO_INPUT_SHARED | CMQC.MQOO_INQUIRE;\n MQQueue queueIn1 = qMgrIn1.accessQueue(queueName, openOptionsIn1);\n MQMessage getMessage1 = new MQMessage();\n MQGetMessageOptions mqGetMessageOptions1 = new MQGetMessageOptions();\n mqGetMessageOptions1.options = CMQC.MQGMO_SYNCPOINT;\n queueIn1.get(getMessage1, mqGetMessageOptions1);\n String txt1 = getMessage1.readLine();\n System.out.println(\"get1 << \" + txt1);\n\n //////////// make problem point like network disconnect with MQ server\n DoSaveInfo2DB();\n qMgrIn1.commit();\n if (queueIn1 != null)\n queueIn1.close();\n if (qMgrIn1 != null)\n qMgrIn1.disconnect();\n} catch (Exception ex) {\n System.out.println(\"ex.getMessage() = \" + ex.getMessage());\n}In IBM MQ documents, I noticed bellow TextExcept on z/OS batch with RRS, if a program issues the MQDISC call while there are uncommitted requests, an implicit syncpoint occurs. If the program ends abnormally, an implicit backout occurs. On z/OS, an implicit syncpoint occurs if the program ends normally without first calling MQDISC. The program is deemed to have ended normally if the TCB connected to MQ ends normally. When running under z/OS UNIX System Services and Language Environment (LE), default condition handling is invoked for abends or signals. The LE condition handlers process the error condition and the TCB ends normally.Under these conditions MQ commits the unit of work.It means if application lost connection with MQ server & DB (network problem) before commit/backout, MQ automatically COMMIT them and in result we lost it !!!!### Assistant: It means if application lost connection with MQ server & DB (network\n problem) before commit/backout, MQ automatically COMMIT them and in\n result we lost it !!!!Are you running your program on z/OS UNIX System Services? Because if you are not then that does not apply. Very few companies are actually running applications on z/OS UNIX System Services - usually it is either z/OS (batch, CICS or IMS) or Linux on System Z.If you are running on Windows or Linux or Unix (AIX, HP-UX or Solaris) then you following 2 statements apply:If a program issues the MQDISC call while there are uncommitted\nrequests, an implicit syncpoint occurs.If the program ends abnormally, an implicit backout occurs.Does that make sense?Finally, you are doing single phase UOW (Unit Of Work) but you should probably be doing 2 phase UOW.\n"} +{"text": "### Human: I try to alter channel definition as:ALTER CHANNEL(CNL_TEST) CHLTYPE(SVRCONN) SSLCIPH(TRIPLE_DES_SHA_US) SSLCAUTH(REQUIRED)\nAMQ8242: SSLCIPH definition wrong.using same cipher names as are listed in WebSphere MQ Explorer: Channels -> Properties -> SSL: SSL Cipher Spec but it fails with AMQ8242.Not sure why but this Cipher Spec is not specified in ALTER CHANNEL command description:http://www.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.ref.adm.doc/q085170_.htm### Assistant: This is because SSLv3 CipherSpecs, which includes TRIPLE_DES_SHA_US, were deprecated from MQ V8.0.0.2. So you must be using this version of the product or later. Take a look here:https://www.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.pro.doc/q123420_.htmThis is also why this CipherSpec is not listed on the supported CipherSpecs page here:https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_8.0.0/com.ibm.mq.sec.doc/q014260_.htmIf youmustuse this CipherSpec then you can update the queue manager's qm.ini file as stated at the bottom of the first link to re-enable it:SSL:\n AllowSSLV3=Y\n AllowWeakCipherSpec=ALLBounce the queue manager to pick up the changes.However you really should be trying to use a TLSv1.2 Cipher.\n"} +{"text": "### Human: I recently encountered the problem with wrong encoding of the message data that I'm trying to send from one MQManager to another.My C# code that sends the message go as follows:var mqMessage = new MQMessage()\n{\n CharacterSet = MQC.MQCCSI_Q_MGR,\n Format = MQC.MQFMT_STRING\n};\n\nmqMessage.MessageId = Encoding.Default.GetBytes(message.MessageId);\nmqMessage.WriteString(message.Message);\nwriteQueue.Put(mqMessage, _putMsgOptions);Despite the fact that both MQManagers (source and destination) has the the same code page (852) in configuration set, message \"WARSZAWA\" on the destination MQManager is decoded as \"WA\u0119S]AWA\".Where am I making the problem?### Assistant: Based on this knowledgecenter article:http://www.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.ref.dev.doc/q111220_.htmThe WriteString method doesn't convert character data when you set CharacterSet = MQC.MQCCSI_Q_MGR, so you are sending your data in Unicode.Depending on how you read it on the receiving side, this might cause your problem.I suggest that you set CharacterSet of the messages to the CCSID you want to use. Every message denotes the codepage used for the character data in it, you shouldn't ever depend on the CCSID of the queue manager.\n"} +{"text": "### Human: Recently we upgraded our MQ server to 8.0.0.5 and after that our application is not working . Getting the below error log from Server console.\n Getting a message terminated in the Servlet for the following reason -MQRC_NO_MSG_AVAILABLE*********************STACK TRACE************************\ncom.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2033'.\n at com.ibm.mq.MQDestination.getInt(MQDestination.java:683)\n at com.ibm.mq.MQDestination.get(MQDestination.java:473)\n at support.operations.inventory.mq.MQFWServlet.getMessage(MQFWServlet.java:77)\n at support.operations.inventory.mq.MQFWServlet.init(MQFWServlet.java:115)\n at support.operations.inventory.list.InvOnlineList.fetchData(InvOnlineList.java:75)\n at support.operations.inventory.servlets.SearchServlet.verifiedPost(SearchServlet.java:169)\n at support.operations.inventory.servlets.MasterServlet.doPost(MasterServlet.java:439)\n at support.operations.inventory.servlets.MasterServlet.doGet(MasterServlet.java:363)\n at javax.servlet.http.HttpServlet.service(HttpServlet.java:575)\n at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)\n at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1232)\n at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:781)\n at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:480)\n at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)\n at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1114)\n at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:1385)\n at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:194)\n at support.operations.inventory.servlets.MasterServlet.forwardServlet(MasterServlet.java:621)\n at support.operations.inventory.servlets.ReRouteServlet.verifiedPost(ReRouteServlet.java:254)\n at support.operations.inventory.servlets.MasterServlet.doPost(MasterServlet.java:439)\n at support.operations.inventory.servlets.MasterServlet.doGet(MasterServlet.java:363)\n at javax.servlet.http.HttpServlet.service(HttpServlet.java:575)\n at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)\n at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1232)\n at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:781)\n at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:480)\n at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)\n at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1114)\n at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3928)\n at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)\n at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1007)\n at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1817)\n at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)\n at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:463)\n at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:530)\n at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:316)From the WebSphere logs I can see this errror message :[8/31/16 14:40:11:249 GMT] 000000a9 ThreadMonitor W WSVR0605W: Thread \"WebContainer : 3\" (000000e5) has been active for 603065 milliseconds and may be hung. There is/are 2\n thread(s) in total in the server that may be hung.\n at java.lang.Object.wait(Native Method)\n at java.lang.Object.wait(Object.java:196)I would need a help for this issue.### Assistant: NO_MSG_AVAILABLE(2033) means just that - your application issued anMQGETand no message was found (satisfying the selection criteria, including message id/correlation id and/or whatever else if anything was specified.)I would venture a guess that you issue anMQGETwithMQGMO_WAIT, and you set timeout to a pretty high value (orUNLIMITED.) As a result of no message being available, you end up hanging the thread. Not MQ, but the application itself.In short, I don't see anything wrong with MQ in these messages. As usual with upgrades or any changes in the environment, check what else has been changed. Check what happened to the message sender.And avoid long waiting in a Web container (UNLIMITEDis out of bounds, certainly.) Ideally, do it asynchronously. Or at least cap the waiting - for example, a timeout of 15 seconds is plenty, as a rule of thumb. If your backend can't respond within 15 seconds, something is wrong. And many Web applications would not tolerate even a 15 seconds delay.\n"} +{"text": "### Human: I have upgraded to IBM MQ 7.5 to 8.0.Beforehand I was using SSL. Since SSL is disabled in MQ8. I have to use TLS. But the question is do I need to create the certificate again to use with MQ 8 after upgrading process?### Assistant: No, the certificate is independent of the protocol used.\n"} +{"text": "### Human: I've a scenario where I would receive message using MQ Input node and based on the value of source system present in the message, I need to form topic string and publish the message. This is how my flow looks like:MQInput -> Compute -> PublicationAnd I populate the value of Topic using: \nSET OutputRoot.Properties.Topic = 'TopicName/' || sourceName ;This works fine in case message contains one source system.However there is possibility that message contain multiple source system. Is it possible to use the above mentioned command to publish the messages on multiple topic string? (something like this)SET OutputRoot.Properties.Topic = 'Topic/' || sourceName1 ;SET OutputRoot.Properties.Topic = 'Topic/' || sourceName2 ;Appreciate any suggestions.### Assistant: You should propagate 2 separate messages from the Compute node with different topic strings set.You can propagate a message without returning by using the PROPAGATE ESQL statement.\nSo your code should look something like this:\n\nSET OutputRoot.Properties.Topic = 'TopicName/' || sourceName1;\nPROPAGATE DELETE NONE;\n\nSET OutputRoot.Properties.Topic = 'TopicName/' || sourceName2;\nRETURN TRUE;\n"} +{"text": "### Human: I have IBM MQ server with the latest feature of AMQP channel enabled. I am trying to write a RabbitMQ client program in Java which can connect to AMQP channel in IBM MQ and publish & consume messages. Is that possible?### Assistant: RabbitMQ clients use the 0.9.1 version of AMQP which is very different to the version supported by IBM MQ (AMQP 1.0) You could use a Qpid Proton client to connect to IBM MQ, one of the MQ Light clients, or anything which supports AMQP 1.0.\n"} +{"text": "### Human: From Linux server with MQ client installed we are trying to set up connection to secured channel. I am ETL person and our MQ admin is struggling. Anyways I will explain what I tried (which obviously hasn't worked yet ) and anyone please let me know what else needs to be done to set up the connectivity.. Thanks :)tmp/mqmutility/keyrepmodmq> ls\nAMQCLCHL.TAB key.kdb key.rdb key.sth MODE_MODELTAP_DEV_keyStLst.txt\n\nexport MQSSLKEYR=/tmp/mqmutility/keyrepmodmq/key\nexport MQCHLLIB=/tmp/mqmutility/keyrepmodmq\nexport MQCHLTAB=AMQCLCHL.TAB\n\n/opt/mqm/samp/bin> amqsputc \nSample AMQSPUT0 start\nMQCONN ended with reason code 2058Note: I can connect to the same queue manager for a non-SSL channel. \nAny help will be great and other approaches you follow for SSL channel connectivity from client machine will also be helpful.### Assistant: When using a Client Channel Definition Table (CCDT) file - your AMQCLCHL.TAB file, a return code of 2058 usually means that the queue manager name the application tried to use - your 'queue_manager_name' - was not found in any of the channel entries in the CCDT file.If you're using. MQ V8 you can very easily display the entries in your CCDT file and the queue manager names they are configured for using the following command:runmqsc -n\n\nDISPLAY CHANNEL(*) QMNAMEIf none of the channels in your file have the queue manager name you are using when running theamqsputcsample then this is the cause of your 2058 reason code.Hopefully it will be clear when you see the entries in the file listed out which queue manager name you should be using, but if not, update your question with some more details (like the contents of said file and the queue manager details) and we can help further.You must ensure that you have a CLNTCONN channel defined which has the queue manager name you want to use in the QMNAME field, and that you have a matching named SVRCONN channel defined on the queue manager. Since you are using SSL, you must also ensure that these two channels are using the same SSLCIPH.Please readCreating server-connection and client-connection definitions on the serverand it's child topics.\n"} +{"text": "### Human: This article indicates that if MQ has to be used as a Transaction Manager, the application has to compulsorily use Bindings mode.http://www.ibm.com/developerworks/websphere/library/techarticles/0601_ritchie/0601_ritchie.htmlBindings mode also means that the MQ Server and the application both have to be on the same host because it uses JNI.My question is, what is the fundamental reason behind this requirement? Why can't MQ Manager work like JBOSS which can reside on any host and take requests for managing distributed transactions?What prevents WMQ from supporting client connection for distributed transactions?Thanks,\nYash### Assistant: That article is very old, it was from 2006, for a long time now MQ clients that are located remote from a queue manager have been able to use XA transactions.MQ supports XA with JMS when using a supported transaction manager within a JEE containerhttp://www.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.dev.doc/q032590_.htm?lang=en\n"} +{"text": "### Human: We are trying to send JMS text message over IBM mq using Apache Camel. We are able set few JMS header properties except the JMSPriority. We tried setting int value and used resultType=\"java.lang.Integer\" but unable to alter priority. Any clue would be more than helpful.\n \n \n ${body} != null\n \n ${body}\n \n \n ${body.messageContextVO.requestID}\n \n \n ${body.metadata[\"VersionId\"]}\n \n \n ${body.metadata[\"FunctionId\"]}\n \n \n ${body.metadata[\"Format\"]}\n \n \n \n ${property.originalRequest.metadata[\"FetchPriorityValue\"]}== \"true\"\n \n ${body.formattedData}\n \n \n ${property.originalRequest.priority}\n \n\n queue:///${property.originalRequest.metadata[\"queueName\"]}?targetClient=1\n\n \n \n \n \n wmq:queue:${property.originalRequest.metadata[\"queueName\"]}?exchangePattern=InOnly\n \n \n ${property.originalRequest}\n \n \n \n ### Assistant: We found solution to make it work. Priority attribute is required to set at header CamelJmsDestinationName\ni.e,queue:///${property.originalRequest.metadata[\"queueName\"]}?targetClient=1&priority=${dynamicValue}Sender code checks for value of priority at MQ Destination level in native code. TimeToLive and Priority values needs to set at MQ destination level to work with Camel.\n"} +{"text": "### Human: I have a wcf service that executes some code and sends a message to the IBM WebSphere MQ hosted on a linux server. I can put and get messages from the queue just fine. What I wanted to know that is there a way by which whenever a message is sent to the queue a listener service (WCF) activates to process those messages?(this can be done by using netmsmqbinding and WAS for MSMQ)I have researched a lot but was unable to find any code examples which made me think that is this even possible....I have looked at someanswersbut they don't link wcf and mq part. A similar question isWCF / WebService to act as Listener for MQ Message?but there is no concrete answer. I have also looked atListening to new enqueued messages using WCF Service.So this scenario lead me to think that my only option is to write a windows service that after some interval listens (polls i.e invokes the get method on) the queue or write a console application that does that same thing.Does anyone have a more elegant solution?### Assistant: Triggering might be an option. WebSphere MQ can start an application when a message arrives on a queue:http://www-01.ibm.com/support/docview.wss?uid=swg27020075&aid=1As you want to trigger an application not running on the server of the queue manager, you will need a trigger monitor like this:http://www-01.ibm.com/support/docview.wss?uid=swg24000149\n"} +{"text": "### Human: I have just started work on a software which uses IBM MQ for some communication.As I understand that MQ can be used for many to one communication and one to many communication.Lets say there are 3 Business applications A, B and C. A wants to send a message using MQ to B and another message to C but A is only using one queue Queue1.Now my question is if we can define (in MQMD or otherwise) that a certain message is only for B NOT for C, hence only B can retrieve it from Queue1 whenever B is available. If not how can we do this if it is at all possible?One other thing is can we make a separate queue Queue2 only for A-B communication?### Assistant: It is better to use separate queues. For example use queueQA2Bfor application A to send messages to application B andQA2Cfor application A to send messages to application C. This way traffic is separated out and you can administratively restrict application B from receiving message meant for C and vice-versa.It is possible to use just one queue wherein application A while sending messages sets a message property that says something like \"Message is for B\" or \"Message is for C\". Application B uses a selector to match the property value \"Message for B\" while receiving messages. Similarly application C also uses selector \"Message for C\" and receives messages. But note if either B or C receives messages without any selector, then messages can go to wrong hands.\n"} +{"text": "### Human: I'm using sed/awk to parse mq runmqsc output. We want to get certain fields displayedon a single line. This seems to be a straightforward sed/awk problem.echo \"display conn(*) ALL\" | \nrunmqsc | \nawk '{ RS = \"AMQ8276: Display Connection details.\" } ; { print $0 }' | \nsed -e 's/( )/()/g'5724-H72 (C) Copyright IBM Corp. 1994, 2009. ALL RIGHTS RESERVED.\nStarting MQSC for queue manager .1 : display conn(*) ALL\n\n\n\nCONN(3923A95601000020)\n EXTCONN(414D51435465737442726F6B65725553)\n TYPE(CONN)\n PID(9263) TID(1)\n APPLDESC(WebSphere MQ Object Authority Manager)\n APPLTAG(amqzfuma) APPLTYPE(SYSTEM)\n ASTATE(NONE) CHANNEL()\n CONNAME() CONNOPTS(MQCNO_FASTPATH_BINDING)\n USERID(mqm) UOWLOG()\n UOWSTDA() UOWSTTI()\n UOWLOGDA() UOWLOGTI()\n URTYPE(QMGR)\n EXTURID(XA_FORMATID[00000000] XA_GTRID[] XA_BQUAL[])\n QMURID(0.0) UOWSTATE(NONE)This code:echo \"display conn(*) ALL\" | runmqsc TestBrokerUS | awk '{ RS = \"AMQ8276: Display Connection details.\" } ; { print $0 }' | sed -e 's/( )/()/g' | \nsed -n -e 's/^.* CHANNEL(\\(.*\\).*) /\\1/p' -e 's/^.* USERID(\\(.*\\).*)/\\1/p' -e 's/^.* CONNOPTS(\\(.*\\).*)/\\1/p' -e 's/^.* CONN(\\(.*\\).*)/\\1/p' -e 's/^.* CONNAME(\\(.*\\).*)/\\1/p'Returns this:3923A95601000020)\n) CONNOPTS(MQCNO_FASTPATH_BINDING)Need to parse out these fields on 1 line. Thoughts?### Assistant: One option would be to replace the newlines from the output and then add one newline per each dis conn.Example:echo \"dis conn(*) all\" | runmqsc MQ8QMGR|sed ':a;N;$!ba;s/\\n/ /g'|sed 's/UOWSTATE/\\n/g'Other option would be to store the values in variables and then print when you get the last attribute. Here is an example to parse dis qs output./QUEUE/{i1=index($1,\"(\"); i2=index($1,\")\")-1; QUEUE=substr($1,i1+1,i2-i1);}\n/CURDEPTH/{i1=index($1,\"(\"); i2=index($1,\")\")-1; CURDEPTH=substr($1,i1+1,i2-i1);\n i3=index($2,\"(\"); i4=index($2,\")\")-1; IPPROCS=substr($2,i3+1,i4-i3);\n }\n/LGETDATE/{i1=index($1,\"(\"); i2=index($1,\")\")-1; LGETDATE=substr($1,i1+1,i2-i1);\n i3=index($2,\"(\"); i4=index($2,\")\")-1; LGETTIME=substr($2,i3+1,i4-i3);\n }\n/LPUTDATE/{i1=index($1,\"(\"); i2=index($1,\")\")-1; LPUTDATE=substr($1,i1+1,i2-i1);\n i3=index($2,\"(\"); i4=index($2,\")\")-1; LPUTTIME=substr($2,i3+1,i4-i3)\n }\n/MSGAGE/{i3=index($2,\"(\"); i4=index($2,\")\")-1; MSGAGE=substr($2,i3+1,i4-i3);}\n/OPPROCS/{i1=index($1,\"(\"); i2=index($1,\")\")-1; OPPROCS=substr($1,i1+1,i2-i1);\n i3=index($2,\"(\"); i4=index($2,\",\")-1; QTIME=substr($2,i3+1,i4-i3);\n i5=1; i6=index($3,\")\")-1; QTIME2=substr($3,i5,i6-i5+1);\n }\n/UNCOM/{\n i1=index($1,\"(\"); i2=index($1,\")\")-1; UNCOM=substr($1,i1+1,i2-i1);\n\n if( QUEUE == \"SYSTEM.CLUSTER.TRANSMIT.QUEUE\" )\n {\n print date \"|\" QUEUE \"|\" CURDEPTH \"|\" LGETDATE \"|\" LGETTIME \"|\" LPUTDATE \"|\" LPUTTIME \"|\" MSGAGE \"|\" QTIME \",\" QTIME2 \"|\" UNCOM;\n }\n }\n"} +{"text": "### Human: What are the best practices regarding sessions in an application that is designed to fetch messages from a MQ server every 5 seconds?Should I keep one session open for the whole time (could be weeks or longer), or better open a session, fetch the messages, and then close the session again?I am using the .net IBM XMS v8 client library.### Assistant: Adding to what @Attila Repasi's response, I would go for a consumer with message listener attached. The message listener would get called whenever a message needs to be delivered to application. This avoids application explicitly calling receive() to retrieve messages from queue and waste CPU cycles if there are no messages on the queue.\n"} +{"text": "### Human: I am using the IBM.WMQ (amqmdnet dll). On the MQMessage object it has a property to set the correlationID in byte[].IBM.WMQ.MQMessage msg = new IBM.WMQ.MQMessage();\n msg.Write(sendBuffer);\n\n\n //THIS IS byte[]\n msg.CorrelationId = MQUtils.StringToCorrelationId(corrId);I want to set the correlaitonID as a string. Is there anyway I can do this?### Assistant: Did you try:System.Buffer.BlockCopy(corrID.ToCharArray(), 0, msg.CorrelationId, 0, corrID.Length);\n"} +{"text": "### Human: I am trying to set RFH2Header type to a message string. But it's not appending to the message.\nPlease help. Thanks in advance!!!!\nIs My approach is correct ?? If i check in response queue, RFH Property gets added to bytes message.String message1 = \"MQ Message header test\";\nMessage message11 = session.createTextMessage(message1);\n\nMQRFH2 header = new MQRFH2();\nByteArrayOutputStream out = new ByteArrayOutputStream ();\nDataOutput dout = new DataOutputStream(out);\nheader.write(dout);\nbyte[] outheaders = out.toByteArray();\nbyte[] bArray = message1.getBytes(\"UTF-8\");\nBytesMessage responseMessage = session.createBytesMessage(); // throws JMSException\nresponseMessage.writeBytes(outheaders);\nresponseMessage.writeBytes(bArray);\nresponseMessage.setJMSType(\"MQRFH2\");\nresponseMessage.setJMSCorrelationID(\"12345678900000\");\nresponseMessage.setJMSDeliveryMode(2);\nresponseMessage.setJMSPriority(4);\nresponseMessage.setJMSReplyTo(queue);\nresponseMessage.setStringProperty(\"JMS_IBM_Format\", \"MQRFH2\"); \nresponseMessage.setIntProperty(\"JMS_IBM_Encoding\", MQConstants.MQENC_NATIVE); \nresponseMessage.setIntProperty(\"JMS_IBM_Character_Set\", 1208);\nresponseMessage.setIntProperty(\"JMS_IBM_PutApplType\", 11);\nproducer.send(responseMessage);My output looks like below in response queue.., Please help , how to set header to a string00000 4D 51 20 4D 65 73 73 61--67 65 20 68 65 61 64 65 |MQ Message heade|\n00010 72 20 74 65 73 74 52 46--48 20 00 00 00 02 00 00 |r testRFH ......|\n00020 00 24 00 00 00 00 00 00--00 00 20 20 20 20 20 20 |.$........ |\n00030 20 20 00 00 00 00 00 00--04 B8 | .......\ufffd |### Assistant: Not very clear about the question but in any case the following may be useful to you.RFH2 is MQ specific while JMS is a standard. A MQ JMS application can not explicitly set RFH2 data asJMS message header. MQ JMS client internally sets the required RFH2 headers to build a JMS message while the message is being sent. The application can only set message body and a number of JMS properties usingsetJMSxxxxand user defined properties usingsetxxxPropertymethods. For example the snippet below sets a string type property calledMyStringProperty.responseMessage.setStringProperty(\"MyStringProperty\", \"SomeString Data\");RFH2 data will be a stream of bytes with a fixed header part and variable data part as described here:http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q032000_.htm?lang=en. Hence you need to createBytesMessageif you want to send RFH2 data as part ofmessagebody.\n"} +{"text": "### Human: We are using Websphere MQ 7.5 with the Javax-JMS-classes and have some performance-problems, which aren't reproducable.I have isolated the performance-issue to these two method-callscreateSessionandsend.These two calls sometimes take a large amount of time(> 300ms per message). Often there is aObject.waitcall which causes the slowdown. So maybe jms is waiting for resources.Sometimes I can send 500 messages without any occurence of that issue, but suddenly it's really slow. It isn't possible that the problem is in our code, because every step before doesn't take much time. Only these two JMS method calls.So my question is, what could be the cause for the sudden performance-drop?Is it possible to debug it by using the queuemanager-logs?Any idea is helpful.Edit:We are using client-bindings and the SHARECNV-setting is set to 10.### Assistant: I have isolated the performance-issue to these two method-calls\n createSession and send.I hope you are NOT doing a createSession method call for each message put to the queue because if you are, that is a TERRIBLE design.Do 1 createConnection method call and 1 createSession method call then send all of your messages. If you have multiple threads then use connection pooling.\n"} +{"text": "### Human: I am experimenting with assured delivery in MQ Light.I am using Node-RED with a modified mqlight input node. I have added the following options the the subscribe() call:qos: mqlight.QOS_AT_LEAST_ONCE, autoConfirm: false, ttl: (60 * 60 * 24 * 1000)This requires that I call delivery.message.confirmDelivery() to acknowledge to MQ Light the receipt of the message.The screenshot below is when the subscription from mqlight_NodeREDClient is set up with autoConfirm false, a message was received, BUT no delivery.message.confirmDelivery() was called. This was to simulate some sort of error occuring in the Node-RED flow.I have since modified the Node-RED flow to do a confirmDelivery(), and any messages consumed by the flow now are acknowledged OK, even if Node-RED isn't running at the time of publish. The message is held by MQ Light since there is a TTL on the destination and arrives as soon as i start up Node-RED again.However, the message in this screenshot, which has been sent once already but never confirmed, is never resent. A restart of Node-RED does not change this, the message is still pending. What are the criteria that needs to be fulfilled in order for MQ Light to retransmit a message already sent before but never confirmed by a client?### Assistant: If you hadn't restarted NodeRED I'd say that it was because MQ Light won't redeliver to a connected client because it thinks the client is still processing the message. However since you have it must be something else.I've just tried the same basic setup (without NodeRED) and the behaviour is as you'd expect - when you reconnect the receiving client MQ Light redelivers the message and the MQ Light UI ticks it off.The remaining things I can think of are:Is it possible when that particular message was sent you had a QoS 0\nsubscription?What TTL are you setting on the message at the sender?What destination TTL have you set on your subscribe call?If 2. is too low, the message will have been expired from the destination regardless of the QoS of the subscriber or the value of 3.If 3. is too low and NodeRED was stopped for long enough, the entire destination will have been expired.\n"} +{"text": "### Human: I have created a WMQ cluster with 3 QMgrs. 2 Full repository and 1 partial repository. Here is themqscused:crtmqm GW\nstrmqm GW\nrunmqsc GW\nalter qmgr deadq('SYSTEM.DEAD.LETTER.QUEUE')\ndefine listener(gw.listener) trptype(TCP) port(1416) ipaddr(xx.xx.xx.xx)\nstart listener(gw.listener)\ndefine channel(SYSTEM.ADMIN.SVRCONN) chltype(svrconn)\nALTER QMGR CHLAUTH(DISABLED)\nend\n\nrunmqsc QM01\nalter qmgr repos('DEVELOPMENT.CLUSTER')\nend\n\nrunmqsc QM02\nalter qmgr repos('DEVELOPMENT.CLUSTER')\nend\n\nrunmqsc QM01\ndefine chl(to.QM01) chltype(clusrcvr) trptype(tcp) +\n conname('xx.xx.xx.xx(1414)') cluster(DEVELOPMENT.CLUSTER) \nend\n\nrunmqsc QM02\ndefine chl(to.QM02) chltype(clusrcvr) trptype(tcp) +\n conname('xx.xx.xx.xx(1415)') cluster(DEVELOPMENT.CLUSTER) \nend\n\nrunmqsc GW\ndefine chl(to.GW) chltype(clusrcvr) trptype(tcp) +\n conname('xx.xx.xx.xx(1416)') cluster(DEVELOPMENT.CLUSTER) \nend\n\nrunmqsc QM01\nDEFINE CHANNEL(TO.QM02) CHLTYPE(CLUSSDR) TRPTYPE(TCP) +\n CONNAME('xx.xx.xx.xx(1415)') CLUSTER(DEVELOPMENT.CLUSTER)\nend\n\nrunmqsc QM02\nDEFINE CHANNEL(TO.QM01) CHLTYPE(CLUSSDR) TRPTYPE(TCP) +\n CONNAME('xx.xx.xx.xx(1414)') CLUSTER(DEVELOPMENT.CLUSTER)\nend\n\nrunmqsc GW\nDEFINE CHANNEL(TO.QM01) CHLTYPE(CLUSSDR) TRPTYPE(TCP) +\n CONNAME('xx.xx.xx.xx(1414)') CLUSTER(DEVELOPMENT.CLUSTER)\nDEFINE CHANNEL(TO.QM02) CHLTYPE(CLUSSDR) TRPTYPE(TCP) +\n CONNAME('xx.xx.xx.xx(1415)') CLUSTER(DEVELOPMENT.CLUSTER)\nend\n\nrunmqsc QM02\ndefine qlocal('BACKUP') CLUSTER(DEVELOPMENT.CLUSTER)\ndefine qlocal('PROVIDER') CLUSTER(DEVELOPMENT.CLUSTER)\ndefine qlocal('RESPONSE') CLUSTER(DEVELOPMENT.CLUSTER)\ndefine qlocal('STORE') CLUSTER(DEVELOPMENT.CLUSTER)\nREFRESH CLUSTER(DEVELOPMENT.CLUSTER) REPOS(YES) \nend\n\nrunmqsc QM01\ndefine qlocal('BACKUP') CLUSTER(DEVELOPMENT.CLUSTER)\ndefine qlocal('PROVIDER') CLUSTER(DEVELOPMENT.CLUSTER)\ndefine qlocal('RESPONSE') CLUSTER(DEVELOPMENT.CLUSTER)\ndefine qlocal('STORE') CLUSTER(DEVELOPMENT.CLUSTER)\nREFRESH CLUSTER(DEVELOPMENT.CLUSTER) REPOS(YES)\nendNow I am putting a message to QMgrGWon queuePROVIDER. Please note thatGWdoes not host this queue. It is hosted byQM01andQM02amqsput PROVIDER GWSadly all the messages are going to dead letter queue of the QMgrGW.Kindly help to fix this. Any suggestions for debugging will help a lot.### Assistant: There are several possible issues here.The channels are not identically defined. Some have mixed-case names, others have all uppercase names. Thismaywork if you are counting on the lack of quotes to ensure they are all folded to upper case by the QMgr. However, the commands have obviously been edited, at least so far as theCONNAMEvalues are concerned, so I'm not assuming that the resulting objects match.After creating the cluster, did you check that all channels show asAUTO-EXPLICIT? This is how you know the cluster was properly booted up.It's also possible that theREFRESH CLUSTERcommand is causing the outage. This is not required when defining new objects, and in fact is quite disruptive. It waits on the channels to restart and at the point in time that you are running the command, the commands to advertise the new objects have been sent to the repositories but not returned. TheREFRESH CLUSTERthen requests the channels to stop, possibly in mid-batch, queues up commands for the cluster to delete the information it just received but has not yet replied to, and then sends new commands to the cluster advertising the objects it just deleted. If this sounds confusing, think how the cluster command server on the repository feels.Remove theREFRESH CLUSTERcommand from the queue definition script.Once you ascertain that the channels have all advanced toAUTO-EXPLICITand removed theREFRESH CLUSTERyou can start the actual debugging. It really helps in these cases to look at the DLQ header of the dead messages to find out what reason code is listed. This usually provides sufficient information to find the problem. You can also enable a variety of QMgr diagnostic events and view them using one of the event viewing tools, or look at the error logs on the QMgrs at either end of the channel.These next suggestions have nothing to do with your diagnostic, other than a QMgr built using Best Practices will in general be less error prone and easier to debug. Here then are some unsolicited MQ Cluster Best Practice recommendations.Abandon theTO.[QMGR]channel names! Use[cluster].[qmgr]names instead, for exampleDEVCLUS.QM01. This ensures that you will always have channels dedicated to each cluster, even if you have overlapping clusters. It does, however, mean cluster names can't have a.in them and must be < 10 characters.On things that are not full repositories, define an explicitCLUSSDRto only one of the repositories. Should you ever have more than two repositories (for example during a migration) the cluster members will be able to find it this way.Always use quotes in your definitions. If you are having problems getting something to work then definitions that have only one possible interpretation are a shorter path to resolution.Give the channels time to settle when defining a new cluster channel, and verify that it starts and goes to the correct state.UseAMQSPUTto open newly defined remotely-hosted cluster queues for output, but without actually putting messages to them. Make sure you get no errors (i.e. the queues resolve) during the open and then make sure the cluster channels are up.Thenexecuteamqsputand send messages.REFRESH CLUSTERis a command to be used on partial repositories whereasRESET CLUSTERis the command to be used on full repositories. In this case the command is being used improperly and on the wrong type of cluster node. Expect problems.Hopefully in real life there are no application queues hosted on full repository QMgrs. The best possible thing you can do for your cluster is to host the full repositories on dedicated QMgrs - even if those are extra QMgrs on the same host as the application QMgrs. Separating these ensures that cluster operation traffic and application traffic never traverse the same channels. It also makes it possible to patch or upgrade the repositories before the application QMgrs.\n"} +{"text": "### Human: I am curious to know the difference between mqsc end vs mqsc quit vs mqsc exit in IBM Websphere MQ. A detailed explanation on these command could be helpful.### Assistant: Themanual page for runmqscstates thatend,exitandquitare synonyms:To stop the runmqsc command, use the end command. You can also use the\n exit or the quit command.As for the part about \"a detailed explanation on these command could be helpful,\" I'm not sure how much more detail would be appropriate. I could write a sonnet or something if you think it would be useful. :-)\n"} +{"text": "### Human: I use java application with IBM mq websphere. When i am killing the application in mq is remained some information about channels. I don't know way to correct stopping of application.Simply put, i need kill application with mq channels. Because when i restart application, it can't start and throw exception:ERROR Failed to initialize Queue Channel.\ncom.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0018: Failed to connect to queue manager 'TL4UZ8T' with connection mode '1' and host name 'mq4u-TL4UZ8T.lb.com(64424)'.Thanks for helping!### Assistant: Boy! why you have to kill application? Do you mean abnormal termination of application?The application must call Disconnect() to inform the queue manager to do clean up it's end. It's a best practice, please read other best practiceshere. If Disconnect is not called, queue manager does not immediately clean up resources allocated for a client connection.So check your application code and ensure it has code to close any queues/topics/connections opened.\n"} +{"text": "### Human: we have a Windows c# application that puts messages on an iSeries Websphere MQ Queue for core system processing.This application puts tens of thousands of messages on the iSeries MQ every day, runs round the clock, and has been reliable and resilient for 5 years.Yesterday 5 messages (in a batch of 10) put on the MQ were not received from the iSeries side, yet on our side we appear to have got COMPLETION CODE MQCC_OK (value = 0)Here is our code:foreach (DataRow dRow in mqRequests.Rows)\n{\n try\n {\n queuePutMessage = new MQMessage();\n queuePutMessageOptions = new MQPutMessageOptions();\n queuePutMessage.WriteString(dRow[(int)Common.InboundSQLFields.EDB_Message].ToString()); \n queuePutMessage.Format = MQC.MQFMT_STRING; // MQFMT_STRING = \"MQSTR \";\n\n /* Put message on Queue */\n pMQQueue.Put(queuePutMessage, queuePutMessageOptions);\n\n switch (pMQQueue.CompletionCode){\n\n case MQC.MQCC_OK:\n /* Message successfully PUT on return MQ */\n dRow[(int)Common.InboundSQLFields.MQ_Put_Date] = DateTime.Now.ToString(\"yyyy-MM-dd HH:mm:ss.fffffff\");\n dRow[(int)Common.InboundSQLFields.Message_Status] = \"Complete\";\n dRow[(int)Common.InboundSQLFields.Last_Modified_Date] = DateTime.Now.ToString(\"yyyy-MM-dd HH:mm:ss.fffffff\");\n break;\n\n case MQC.MQCC_WARNING:\n // with warning\n dRow[(int)Common.InboundSQLFields.Message_Status] = \"Warning:\\t\" + pMQQueue.ReasonCode + '\\t' + pMQQueue.ReasonName;\n dRow[(int)Common.InboundSQLFields.Last_Modified_Date] = DateTime.Now.ToString(\"yyyy-MM-dd HH:mm:ss.fffffff\");\n\n /* Write to log */\n Common.logBuilder(\"WebSphereMQ --> putMessages <--\", \"MQWarning\", Common.ActiveMQ, dRow[(int)Common.InboundSQLFields.Message_Type].ToString(), \"Exception\");\n emailer.messageMonitorEmail(dRow[(int)Common.InboundSQLFields.Message_Type].ToString(), Common.ActiveMQ, \"Warning:\\t\" + pMQQueue.ReasonCode + '\\t' + pMQQueue.ReasonName);\n break;\n\n case MQC.MQCC_FAILED:\n\n dRow[(int)Common.InboundSQLFields.Message_Status] = \"Error:\\t\" + pMQQueue.ReasonCode + '\\t' + pMQQueue.ReasonName;\n dRow[(int)Common.InboundSQLFields.Last_Modified_Date] = DateTime.Now.ToString(\"yyyy-MM-dd HH:mm:ss.fffffff\");\n\n /* Write to log */\n Common.logBuilder(\"WebSphereMQ --> putMessages <--\", \"MQFAIL\", Common.ActiveMQ, dRow[(int)Common.InboundSQLFields.Message_Type].ToString(), \"Exception\");\n emailer.messageMonitorEmail(dRow[(int)Common.InboundSQLFields.Message_Type].ToString(), Common.ActiveMQ, \"Warning:\\t\" + pMQQueue.ReasonCode + '\\t' + pMQQueue.ReasonName);\n break;\n }\n }\n catch (MQException mqe)\n {\n dRow[(int)Common.InboundSQLFields.Message_Status] = \"Error\";\n dRow[(int)Common.InboundSQLFields.Last_Modified_Date] = DateTime.Now.ToString(\"yyyy-MM-dd HH:mm:ss.fffffff\");\n /* Write to log */\n Common.logBuilder(\"WebSphereMQ --> putMessages <--\", \"MQException\", Common.ActiveMQ, mqe.Message, \"Exception\");\n emailer.exceptionEmail(mqe);\n\n // Return nothing\n return;\n }\n catch (Exception ex)\n {\n dRow[(int)Common.InboundSQLFields.Message_Status] = \"Error\";\n dRow[(int)Common.InboundSQLFields.Last_Modified_Date] = DateTime.Now.ToString(\"yyyy-MM-dd HH:mm:ss.fffffff\");\n /* Write to log */\n Common.logBuilder(\"WebSphereMQ --> putMessages <--\", \"Exception\", Common.ActiveMQ, ex.Message, \"Exception\");\n emailer.exceptionEmail(ex);\n // Return nothing\n return;\n }\n }so the process is:Loop through all the messages to be put on the MQFor each one, create an MQ Message and put it on the queueCheck theCompletion Codewhich is an INT and therefore DEFAULTS to ZERO, which BTW is = MQCC_OKUpdate the datatable, if theCompletion Code=MQCC_OKwe assume the message has been received with no error, otherwise we update the datatable for that message either with the MQ Warning message or the Fail message...Now, in the .NET Framework an INT is a STRUCT, which defaults to 0, so if no COMPLETION CODE is sent by the MQ we seem to have an MQCC_OKSo, is it possible that a message is rejected or failed on the MQ, but because we have an INT defaulting to zero, we appear to have received anOKfrom the MQ? Surely the secure communication between the client/server with handshakes would prevent this?If that is possible (however unlikely), how can we prevent this situation we have where I have marked 5 messages on the database asCompletebased on MQC.MQCC_OK but the iSeries doesn't appear to have received them (again, code running for several years)### Assistant: You should not be checking the CompletionCode of the MQQueue class when you do a put() method. The code should look like:foreach (DataRow dRow in mqRequests.Rows)\n{\n try\n {\n outMsg = new MQMessage();\n pmo = new MQPutMessageOptions();\n outMsg.WriteString(dRow[(int)Common.InboundSQLFields.EDB_Message].ToString());\n outMsg.Format = MQC.MQFMT_STRING; // MQFMT_STRING = \"MQSTR \";\n\n /* Put message on Queue */\n pMQQueue.Put(outMsg, pmo);\n\n dRow[(int)Common.InboundSQLFields.MQ_Put_Date] = DateTime.Now.ToString(\"yyyy-MM-dd HH:mm:ss.fffffff\");\n dRow[(int)Common.InboundSQLFields.Message_Status] = \"Complete\";\n dRow[(int)Common.InboundSQLFields.Last_Modified_Date] = DateTime.Now.ToString(\"yyyy-MM-dd HH:mm:ss.fffffff\");\n }\n catch (MQException mqe)\n {\n switch (mqe.CompletionCode)\n {\n case MQC.MQCC_WARNING:\n // with warning\n dRow[(int)Common.InboundSQLFields.Message_Status] = \"Warning: CC=\" + mqe.CompletionCode + ' : RC=' + mqe.ReasonCode;\n dRow[(int)Common.InboundSQLFields.Last_Modified_Date] = DateTime.Now.ToString(\"yyyy-MM-dd HH:mm:ss.fffffff\");\n\n /* Write to log */\n Common.logBuilder(\"WebSphereMQ --> putMessages <--\", \"MQWarning\", Common.ActiveMQ, dRow[(int)Common.InboundSQLFields.Message_Type].ToString(), \"Exception\");\n emailer.messageMonitorEmail(dRow[(int)Common.InboundSQLFields.Message_Type].ToString(), Common.ActiveMQ, \"Warning: CC=\" + mqe.CompletionCode + ' : RC=' + mqe.ReasonCode);\n break;\n\n case MQC.MQCC_FAILED:\n\n dRow[(int)Common.InboundSQLFields.Message_Status] = \"Error: CC=\" + mqe.CompletionCode + ' : RC=' + mqe.ReasonCode;\n dRow[(int)Common.InboundSQLFields.Last_Modified_Date] = DateTime.Now.ToString(\"yyyy-MM-dd HH:mm:ss.fffffff\");\n\n /* Write to log */\n Common.logBuilder(\"WebSphereMQ --> putMessages <--\", \"MQFAIL\", Common.ActiveMQ, dRow[(int)Common.InboundSQLFields.Message_Type].ToString(), \"Exception\");\n emailer.messageMonitorEmail(dRow[(int)Common.InboundSQLFields.Message_Type].ToString(), Common.ActiveMQ, \"Warning: CC=\" + mqe.CompletionCode + ' : RC=' + mqe.ReasonCode);\n break;\n }\n\n /* Write to log */\n Common.logBuilder(\"WebSphereMQ --> putMessages <--\", \"MQException\", Common.ActiveMQ, mqe.Message, \"CC=\" + mqe.CompletionCode + ' : RC=' + mqe.ReasonCode);\n emailer.exceptionEmail(mqe);\n\n // Return nothing\n return;\n }\n catch (Exception ex)\n {\n dRow[(int)Common.InboundSQLFields.Message_Status] = \"Error:\\t\" + ex.Message;\n dRow[(int)Common.InboundSQLFields.Last_Modified_Date] = DateTime.Now.ToString(\"yyyy-MM-dd HH:mm:ss.fffffff\");\n /* Write to log */\n Common.logBuilder(\"WebSphereMQ --> putMessages <--\", \"Exception\", Common.ActiveMQ, ex.Message, \"Exception\");\n emailer.exceptionEmail(ex);\n // Return nothing\n return;\n }\n}\n"} +{"text": "### Human: I have a queue for which the reader consumes messages under sycpoint and it ended abruptly. This caused 2 messages left in Uncommitted state. so the \"msgage\" property keeps increasing for the message and \"uncom\" property of queue remains same as 2, even though we restarted the consumer application and no long running UOW.Anyway we can reset these properties without restarting MQ?### Assistant: Presuming your application is connecting in client mode (over TCP) I expect that although your application has gone away, from the queue manager's point of view it is still active.When the network socket the application opened closes, then MQ should roll back the 2 messages so they're eligible for consumption by another application.The network socket will close when the operating system eventually notices the remote end of the TCP connection is unresponsive - this triggers a 'connection reset by peer' type socket closure. It's the operating system the queue manager is running on which will do this, not the remote one.Some operating systems can take hours to notice a duff socket in their default configuration. Look into 'TCP keepalive' settings on your operating system to tune how long this takes.\n"} +{"text": "### Human: Requirement: Build a .NET based application that can reads messages at regular interval from a IBM Websphere Message Queue and save those messages in databaseMy solution: I created a windows service application that polls the Message Queue at certain interval and process the data.Problem with polling is that application process is delayed by the polling interval. I cannot set the interval too short as I am not sure how much data there will be in the Message Queue and how long it will take to process.Question: What would be better way to process data from a WebSphere Message Queue using .NET? How will I be able to process the data as soon as arrive in Message queue?### Assistant: What you need is asynchronous messaging. This works by registering a callback, which the MQ client will then invoke when a message is available. Take a look at the Knowledge Center page:http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.dev.doc/q023050_.htm\n"} +{"text": "### Human: I am trying to connect a Windows client application to a remote WebSphere MQ Manager in a test environment.ClientWindows 7 SP1 x64WebSphere MQ 7.5 ClientServer (VM)Windows 2008 R2WebSphere MQ 7.5 ServerBoth machines are on the same domain.The queue manager QM1 was created in WebSphere MQ Explorer (elevated to Administrator).For test purposes, I am not interested in authentication, so I have disabled MQ authentication with ALTER QMGR CHLAUTH(DISABLED).C:\\Program Files (x86)\\IBM\\WebSphere MQ\\bin64>runmqsc QM1\n5724-H72 (C) Copyright IBM Corp. 1994, 2011. ALL RIGHTS RESERVED.\nStarting MQSC for queue manager QM1.\ndisplay qmgr chlauth\n 1 : display qmgr chlauth\nAMQ8408: Display Queue Manager details.\n QMNAME(QM1) CHLAUTH(DISABLED)However, despite disabling authentication I still get the 2035 error.The AMQERR01.log for the QM shows:03/06/2015 11:35:41 - Process(3520.657) User(MUSR_MQADMIN) Program(amqrmppa.exe)\n Host(MYSERVER) Installation(Installation1)\n VRMF(7.5.0.1) QMgr(QM1)\n\nAMQ9557: Queue Manager User ID initialization failed.\n\nEXPLANATION:\nThe call to initialize the User ID failed with CompCode 2 and Reason 2035.\nACTION:\nCorrect the error and try again.I am running the client application as my domain user (elevated to Administrator). It's worth noting that this client code has been working in production environments for years and still does. It works in environments with and without MQ channel authentication configured, so I feel certain the issue is an environmental problem particular to my client or server machine.Are there any other things that can cause 2035 MQ authentication error?### Assistant: Check that the client side user ID is known on the server side machine. It is flowed from client to queue manager and used if you don't override it with anything else, e.g. CHLAUTH.\n"} +{"text": "### Human: I have a Java application (which comunicate via JMS, connects using client mode) which need to support multiple versions of the websphere mq (v6,v7.1) (some clients want to remain on version 6 and others to upgrade to version 7). The problem can be solved if i will create two bundles with specific code/configuration for each version. But i want to avoid this. So there is a solution to avoid this problem?For example to have the latest clients jar(v7) as dependency and work with older mq(v6) also or vice-versa?Can somebody point me to some documentation which presents the compatibility between the client jars and mq versions.### Assistant: Yes, MQ v7 clients can connect to MQ v6 queue manager. But note all features that are specific to V7 will not work when connecting V6 queue manager.I would like remind you, MQ v6 is already out of support. You have to migrate to at least V7.0.1 and possibly latest fix pack.\n"} +{"text": "### Human: I have a C# application that connects to a Websphere MQ.Basically:MQEnvironment.Hostname = HostName;\n MQEnvironment.Channel = Channel;\n MQEnvironment.Port = Port;\n MQQueueManager queueManager = new MQQueueManager(QueueManagerName);\n\n using (MQQueue putQueue = queueManager.AccessQueue(putQueueName, MQC.MQOO_OUTPUT))\n { \n }My question is: Should I create only one instance of the MQQueueManager for the whole application and reuse it everytime I want to put a message or create new MQQueueManager object(connection) for every call?### Assistant: Unless your are sharing connections, create MQQueueManager instance once per thread and keep it as long as you need, call the Disconnect method when your job is done. Don't keep the instance till end of your application.Similarly for queue, open queue once and keep putting/getting messages and once job done, close the queue.Read this article ob MQ Best practices:http://www.ibm.com/developerworks/websphere/library/techarticles/0807_hsieh/0807_hsieh.html\n"} +{"text": "### Human: I have the following issue (simplified):Two queue managers - QM1 and QM2 - form a cluster.QMgr QM1alias queue Q1 with base queue Q1.L, which is a local cluster queue (i.e. defined on QM1)alias queue Q2 with base queue Q2.L, which is a non-local cluster queue (i.e. defined on QM2)QMgr QM2local cluster queue Q2.LI can open the alias queues for inquiry, request MQCA_BASE_Q_NAME and I get the base queues in both cases.I need to programatically find out, if this base queue is a local cluster queue or a remote (non-local) cluster queue. We are using C API (MQI).I open the base queue for inquiry and, based on this documentation:http://www-01.ibm.com/support/knowledgecenter/#!/SSFKSJ_7.5.0/com.ibm.mq.ref.dev.doc/q101840_.htm(see Usage Notes - 4.)I can request only the following attributes:\n- MQCA_Q_DESC, MQCA_Q_NAME, MQIA_DEF_BIND, MQIA_DEF_PERSISTENCE, MQIA_DEF_PRIORITY, MQIA_INHIBIT_PUT, MQIA_Q_TYPEThis works, but MQIA_Q_TYPE returns for a cluster queue MQQT_CLUSTER (7). This is good - I know that I handle a cluster queue, but not enough - local or non-local?Checking the cmqc.h header, I can see some other interesting attribute selectors, unfortunatelly not working.\nFor example: MQIA_CLUSTER_Q_TYPE, but when passing in the selector vector for inquiry, getting back\nCompCode:2, Reason:2067 - Attribute selector not valid.In the PCF documentation this seems to be possible:http://www-01.ibm.com/support/knowledgecenter/#!/SSFKSJ_7.5.0/com.ibm.mq.ref.adm.doc/q087800_.htm(Table 1, column Cluster queue)Is this some limitation of C API? Any workaround?Cheers, Miro### Assistant: I knowwhatyou want to do, butwhyyou would want to do it is an interesting question. I hope that what you are working on is instrumentation and monitoring rather than an application program. If a business application needs to know this information, then the design is almost certainly broken. The whole idea of async messaging was to decouple the sender from the receiver of the message, and thus the need for the app to know or care whether the destination is local or not. This is why the API doesn't address your question - to do so for business apps breaks the async model.That said, the simplest way is to useMQIA_CURRENT_Q_DEPTHand inquire on the queue depth. If the queue is non-local, the call will fail.(Deleted the previous answer about using PCF to DIS QL since this is much simpler and 100% accurate.)Of the 60 queue attributes available for inquiry, why do you believe that you \"can request only the following attributes: - MQCA_Q_DESC, MQCA_Q_NAME, MQIA_DEF_BIND, MQIA_DEF_PERSISTENCE, MQIA_DEF_PRIORITY, MQIA_INHIBIT_PUT, MQIA_Q_TYPE\"? Is this a local shop standard?\n"} +{"text": "### Human: I am a PHP developer and have mostly worked in PHP on the web based systems. I know PHP supports AMQP protocols and on a standalone server I can install a broker like Rabbit MQ / Apache MQ etc and use PHP along with it. I have worked earlier with MQ (IBM MQ, Apache MQ, Fusesoft MQ) and I understand that the broker for above have to run on a standalone server (within a LAN/WAN or may be a VPS). I wanted to understand if there is an available module which could be used as a plugin to the apache server to provide the functionality of the brokers.I have done my research for this and have found no solution so far. All I have come across are few vendors which offer cloud based services for MQ and not any stand alone product which could be installed on the cloud.I know cloud are not the best options for creating enterprise level infrastructure which clustered servers in LAN/WAN can provide. I am just looking for available options if any.Thank in advance for your answers.### Assistant: MQ Lightis available both as a standalone download or can be used as a service via the Bluemix IBM cloud offering. When you have created an MQ Light application locally, you can choose to deploy it to the cloud using MQ Light Service for Bluemix.IBM MQ Hypervisor Editionis specially tailored for use with IBM Workload Deployer and IBM Pure Application Systems, which are both flavors of cloud platforms.IBM has also provided anAmazon Machine Imagewith MQ included and a bring-your-own-license model.\n"} +{"text": "### Human: I have a working proof of concept with EHCache using JMS Replication. I am using Websphere MQ as the message broker. I am able to successfully post messages to an MQ Topic which are then replicated accross all the cache nodes within my cluster but how can I validate that each Cache is in sync with its peers?Is there a way I can utilize Websphere MQ to log each message received / sent from the topic?Does anyone know if there's a way through EHCache to achieve something like this?I know this is a high level question but I am not sure which direction to take with this. If I find help / solutions I will be sure to include source code on how to implement it in this post.### Assistant: To answer 1.Since you are making use of publish/subscribe, you could simply attach a further subscription to the same topic and it will also be given a copy of each message sent and then that application can then save these off as log of all the messages.\n"} +{"text": "### Human: When trying to start a queue manager I get aAMQ7017 Log not availablemessage. I have checked, theLogPathfor the queue manager in themqs.inifile is correct. When the problem started I checked and there were two log files in the log folder for the manager:S000000andS0000002. I simply copied the first one and renamed the copy toS000001(with the correct number of zeroes). Still the same error.How can I fix this issue?### Assistant: I hope its not a production qmgr. Few options below.You can restore the missing log file from backup and try to start.Create a qmgr of the same name (in another machine) with the same qm.ini. Basically the log setting should be the same as this qmgr. Copy the log files from that machine to this qmgr and try to start the qmgr. If it starts, the qmgr might recover the persistent messages from the queue files. This is not recommended by IBM, but works in some situations. If its a non-production qmgr, this is the best way.recreate the qmgr\n"} +{"text": "### Human: I am trying to retrieve message from MQ Queue. Below is the code I am using://Fetching Queue details\n MQEnvironment.hostname=getMqCall().getMqHost();\n MQEnvironment.channel=getMqCall().getMqChannel();\n MQEnvironment.port=getMqCall().getMqPort();\n MQQueueManager qMgr= new MQQueueManager(getMqCall().getMqQueManager());\n MQQueue outputQueue = qMgr.accessQueue(getMqCall().getRespQueue(), MQC.MQOO_INQUIRE | MQC.MQOO_BROWSE | MQC.MQOO_INPUT_AS_Q_DEF);\n\n //Checking for messages in queue\n int i=outputQueue.getCurrentDepth();\n System.out.println(\"Number of messages in Assign promo queue:: \"+i);\n\n for(int j=0;j\" + new String(b));\n }\n catch (MQException e)\n {\n if ( (e.completionCode == CMQC.MQCC_WARNING) &&\n (e.reasonCode == CMQC.MQRC_NO_MSG_AVAILABLE) )\n {\n System.out.println(\"Bottom of the queue reached.\");\n getMore = false;\n }\n else\n {\n System.err.println(\"MQRead CC=\" +e.completionCode + \" : RC=\" + e.reasonCode);\n getMore = false;\n }\n }\n catch (IOException e)\n {\n System.out.println(\"MQRead \" +e.getLocalizedMessage());\n }\n }\n }\n catch (MQException e)\n {\n System.err.println(\"MQRead CC=\" +e.completionCode + \" : RC=\" + e.reasonCode);\n }\n finally\n {\n try\n {\n if (queue != null)\n queue.close();\n }\n catch (MQException e)\n {\n System.err.println(\"MQRead CC=\" +e.completionCode + \" : RC=\" + e.reasonCode);\n }\n try\n {\n if (qMgr != null)\n qMgr.disconnect();\n }\n catch (MQException e)\n {\n System.err.println(\"MQRead CC=\" +e.completionCode + \" : RC=\" + e.reasonCode);\n }\n }\n}\n"} +{"text": "### Human: I use an C# Console Application to put and read messages of the MQ..\nWhen the application starts, it connect once with the MQ and then the connection should be always upholded.\nThe program runs every 30 sec and check if new messages are in the queue or a database(to put them on the queue) and check the isConnected-variable if its true.But what happen if an exception(2009 - connection broke) in the Put/Get occur? Will the isConnected automatically set to false?Is the connection automatically disconnected or do I have to call Disconnect() in the error handling?Thanks!### Assistant: To answer your exact question, for a basic .net application (non XMS) using MQQueue for put/get, if you get CERTAIN bad return codes from the underlying API call which indicates a connection issue, MQ will attempt an MQBACK and an MQDISC for you and will result in the connection handle being invalidated (IsConnected would return false) and an exception being thrown. However if an exception occurs outside those return codes then no attempt is made to do anything with the connection.Basically you should not code an application relying on this behaviour, when the most simple answer is to always disconnect if you get an exception which relates to the quality of the connection or queue manager. For example, a no message available etc type exception doesnt mean you need to disconnect but a connection broken obviously does. There is no harm in calling disconnect on an already disconnected connection.\n"} +{"text": "### Human: I am Migrating from Mq version 7.0 to 7.5 . I am able to receive messages through the inbound queues using ejb - Message Driven Beans(MDBs) but while posting the message after processing it on the. I am getting the IBM MQRC 2082 MQRC_UNKOWN_ALIAS_BASE_Q Exception.This is the exception that I am getting :Caused by: javax.jms.InvalidDestinationException: MQJMS2008: failed to\n open MQ queue 'OFS.TIG_IND2NSE_MSG'.\n at com.ibm.msg.client.wmq.v6.jms.internal.MQQueueServices.getQueueOpenException(MQQueueServices.java:901)\n at com.ibm.msg.client.wmq.v6.jms.internal.MQQueueServices.getOutputQueue(MQQueueServices.java:727)\n at com.ibm.msg.client.wmq.v6.jms.internal.JMSServicesMgr.getOutputQueue(JMSServicesMgr.java:210)\n at com.ibm.msg.client.wmq.v6.jms.internal.MQSession.createQProducer(MQSession.java:3138)\n at com.ibm.msg.client.wmq.v6.jms.internal.MQSession.createProducer(MQSession.java:2863)\n at com.ibm.msg.client.wmq.v6.jms.internal.MQSession.createProducer(MQSession.java:2920)\n at com.ibm.msg.client.jms.internal.JmsSessionImpl.createProducer(JmsSessionImpl.java:1191)\n at com.ibm.msg.client.jms.internal.JmsXAQueueSessionImpl$1.createSender(JmsXAQueueSessionImpl.java:415)\n at com.ibm.mq.jms.MQQueueSession.createSender(MQQueueSession.java:148)\n at weblogic.deployment.jms.WrappedSession.createSender(WrappedSession.java:344)\n at com.tiger.gmfs.framework.jms.QUtil.getSender(QUtil.java:216)\n at com.tiger.gmfs.framework.jms.QUtil.sendMessage(QUtil.java:110)The piece of code that i wrote is :\nthis is my getSender method:\nprotected QueueSender getSender() throws JavaMessagingException,\n JMSException {QueueSender sender = null;\n queue = qsess.createQueue(qVO.getName());\n sender = qsess.createSender(queue);\n if (sender == null)\n throw new JavaMessagingException(\"The queue sender is null.\");\n\n\n sender.setPriority(qVO.getPriority());\n return sender;\n}and this is my sendMessage method:public void sendMessage(Message jmsMessage) throws JavaMessagingException,\n JMSException {\n QueueSender sender = null;\n try {\n sender = getSender();\n sender.send(jmsMessage);\n } catch (JMSException j) {\n Exception l = j.getLinkedException();\n if (l != null) {\n JavaMessagingException be = new JavaMessagingException(\n \"JMSErrCode:\" + l + \" Code:\" + j.getErrorCode()\n + \" Message: \" + jmsMessage, j);\n throw be;\n } else\n throw new JavaMessagingException(j);\n }catch(Exception e1){\n System.out.println(e1);\n }finally {\n\n if (sender != null) {\n sender.close();\n TracingHelper.infoLog(QUtil.class, \"sendMessage\",\n \"Closed sender\");\n }\n }\n }What changes should i do here that my code works?I have Implemented the same code in jre 1.7 +weblogic 12c that works perfectly but when i changed it to jre 1.6 + weblogic 11g, i get this error.### Assistant: From a development point of view, when an application opens the queue - the developer has to make sure that the right open options are used to open a WebSphere MQ queue.If the application wants to put a message, open the queue with MQOO_OUTPUT open option and not any of the MQOO_INPUT* options.If the application wants to get a message, open the queue with any one of the below open options, but not all at the same time\nMQOO_INPUT_SHARED\nMQOO_INPUT_EXCLUSIVE\nMQOO_INPUT_AS_Q_DEFThe reason being, if the queue being opened is an alias queue pointing to a base queue in the same queue manager where the alias queue is present, and the base queue is a local queue - both, the OUTPUT and INPUT open options are valid.However, if the alias queue being opened is pointing to a remote queue or a topic in the same queue manager where the alias queue is present, or if the alias queue is pointing to a cluster local queue present in a different queue manager in the cluster, all of the MQOO_INPUT* open options are invalid in this scenario.Hence it is always advisable to open a WebSphere MQ queue only and only with the appropriate open options required for the operation being performed.In your case, if you are trying to open the alias queue with any of the MQOO_INPUT* open option, and it is pointing to a cluster local queue in a different queue manager, it is incorrect. You have to remove the MQOO_INPUT* open option from your code to resolve the issue, as the MQOO_INPUT* option is not valid in this scenario.\n"} +{"text": "### Human: Hi I'm using the CSP struct to send the client ID on a client application, my goal is to get the queue operation being authorized by the OAM based on this ID and not the ID of the process my application is running under. What I observe is:If my process is running as alice and I send bob in the MQCSP I get a 2035 on the MQCONNX call.If a I create a user alice on my local machine and execute the program as alice sending alice in the MQSCSP the call succeeds.If I run the program as alice but send bob in the MQCSP the MQCONNX fails with a 2035 reason code.Why, apparently, in the 3rd case the ID used for authorization seems to be the ID sent in the MQSCP field while not in the 1st case?Is there anything that needs to be set in addition to use the fields in the MQSCP structure to send the CLNTID in the options parameter of the MQCONNX call?The environment is WMQ 7.5 running on Linux.The code is:MQCNO mqcno = {MQCNO_DEFAULT};\n mqcno.Version = MQCNO_VERSION_5;\n // Identification\n if (mqpar->user != NULL) {\n MQCSP sp = {MQCSP_DEFAULT};\n sp.Version = MQCSP_CURRENT_VERSION;\n sp.AuthenticationType = MQCSP_AUTH_USER_ID_AND_PWD;\n sp.CSPUserIdPtr = mqpar->user;\n sp.CSPUserIdLength = strlen(mqpar->user);\n sp.CSPPasswordPtr = mqpar->pwd;\n sp.CSPPasswordLength = strlen(mqpar->pwd);\n\n mqcno.SecurityParmsPtr = &sp;\n }\n\n\n MQCONNX(\"\",&mqcno,mgrd,retc,reasc);Thanks for any help.Adding extra information from subsequent comments made by OP.The intention of writing this code is not authenticate the connection, but to get the authorisations checks made by the OAM be based on the user sent within the MQCSP and not the user ID that the process on the client side is running under.I'm trying to achieve the same effect of configuring a Connection Factory in the Java WebSphere Application Server, that if I'm not wrong transmit the userid on a connection to the manager based on the Authentication Alias one specify for the Connection Factory.### Assistant: What do you have on the queue manager side of things to actually do anything with your MQCSP? Since you are only at V7.5, the queue manager doesn't have it built in (that is in V8), so if you don't have a security exit your MQCSP is being ignored.Actually 'ignored' is not quite accurate, I think the built-in behaviour checks that the MQCSP user is and the run-as user ID are the same. But nothing will be checking the password unless you have a security exit or use MQ V8.More information as a result of more from the OP'C' client works differently from the Java client in this regard. The Java client uses the MQEnvironment set user ID as the run-as user ID. A historical anomaly from a time when Java could not obtain the client side process ID.I think you have three choice here:-Use MQ V8 with ADOPTCTX(YES)Use CHLAUTH rules to set the server-sideMCAUSERbased on the client IP address and/or run-as user.Write a small security exit to copy the MQCSP user ID into theMCAUSER\n"} +{"text": "### Human: I am trying to understand theSHARECNVparameter of Websphere MQ. Can some one please help me understand the followingDoes SHARECNV greater than 0 mean that the same message will be shared to those many number of threads? Or does it mean only the connection will be shared?In my application multiple consumer thread listen on the same Queue. With SHARECNV set to 10 does that mean same message can be picked up by different threads. Because I am observing messages getting duplicated.Could there be a scenario where due to SHARECNV variable the msg.acknowledge() is not sent correctly?If someone can provide some good docs regarding SHARECNV it would be really helpful.Thanks### Assistant: TheSHARECNVis an attribute of SVRCONN type of channel. This parameter indicates how many conversations can be shared over a single TCP/IP connection (i.e. TCP socket) to queue manager.It doesNOTmean message will be shared to multiple threads. It just means one TCP/IP connection will be shared.You can find more details here onSHARECNVCan you provide details of your application? You can checkJMSRedeliveredattribute on received message to determine if a message has been redelivered. ATruevalue indicates the message has been redelivered which means a consumer who got this message earlier did not acknowledge it.\n"} +{"text": "### Human: So far I didn't find a solution to read segmented messages with IBM's JMS implementation (without message grouping). See also:is IBM MQ Message Segmentation possible using JMS?Ist there any workaround for a JMS client yet to receive segmented messages?For e.g. is it possible to configure a \"MQ server component\" to reassemble segmented messages into one single message for the JMS client? Other ideas?### Assistant: If the total reassembled message stays within 100MB (i.e. the maximum allowed message size), then you could have an interim queue with a non JMS MQ API application getting and reassembling the messages and then putting the large reassembled message onto a queue that the JMS application gets from. This would retain the smaller sized messages while they traverse though the MQ network, and are only large (read inefficient) messages at the last point before the application retrieves them.However, if the total reassembled message is larger than 100MB, which may be the case if segments are in use then the above solution will not help.In fact, if the total reassembled message is larger than 100MB then you can't send it over a client connection anyway, in which case you'll need to make th application local to the queue manager.If you are local to a queue manager, then an API exit that changes the underlying MQGET call made by the JMS layer may also be a possibility. You can only use this if you have a local queue manager because client side API Exits are only supported in the C Client. You could cross the SVRCONN channel regardless of the type of client at the other end of the socket, but you cannot send a message greater than 100MB over the client channel so if the total reassembled message is greater than the channel'sMAXMSGLthen it can't be sent.Related ReadingWriting API ExitsAPI Exit Reference\n"} +{"text": "### Human: I created a keydatabase and added the public certificate signed by a CA. I need to change the label of this certificate. I can do it using the ikeyman tool. Is there any command to do that?\nthanks### Assistant: Yes, you can use the runmqakm utility to rename a label. See the sample command below where-label -> Current lable-new-lable - New lablerunmqakm -cert -rename -db C:\\ProgramData\\IBM\\MQ\\qmgrs\\SSLQM\\ssl\\sslqm.kdb -pw passw0rd -label TestCert -new-label MQCERT\n"} +{"text": "### Human: When you do a \"normal\"MQGETon an MQ queue, my understanding is that expired messages (those whose expiry time have passed) will not be retrieved. Instead, they will be thrown away and the next message in the queue attempted.My question has to do withcorrelatedMQGET operations. Since they are specifically looking for a message with a given correlation ID, do they bypass the normal mechanism which would result in expired messages being discarded?In other words, since they're looking for a specific message, do they just go straight for that message?Obviously, ifthatmessage has expired, it will be discarded, my question has to do with the messages in the queuebeforethat point.### Assistant: An expired message will never be returned to your application whether you get it directly by MsgId or CorrelId, or whether you get-next to it.Expired messages are cleared off the queue by an internal task as well as by passing MQGETs noticing them.This is detailedhere on developerWorks, where it states:To remedy this situation [expired messages being left on queues because no MQGETs are trying to read them] on the z/OS platform, you can specify a time period for messages to be removed with the EXPRYINT (expiry interval) queue manager attribute. Each time the expiry interval is reached, the queue manager scans queues to discard expired messages.If your queue manager is located on a UNIX distributed platform, MQ V6 has incorporated an expirer task that works in a similar fashion for distributed platforms.IBM also has a more official technote detailing the behaviour, locatedhere, and stating:Beginning in WMQ V6.0, functionality has been added to internally discard expired messages silently.When a message expires, it will be discarded when: an MQGET which matches the message is issued, or It is internally removed by the queue manager's expirer task.The internal expirer task runs every 300 seconds (5 minutes), by default. If you wish to alter the frequency of this task, you may use the 'ExpiryInterval' setting. This value is configured in seconds, with a range from 1 to 1,000,000 seconds. If you set the value to '0', you will disable the task.On z/OS, 'ExpiryInterval' is a queue manager attribute.\nOn distributed platforms, 'ExpiryInterval' can be added to the 'TuningParameters' stanza in the queue manager's qm.ini file.\n"} +{"text": "### Human: How do I get a JMS Client using SSL_RSA_WITH_AES_128_CBC_SHA (in the queue connection factory) to connect to a server using TLS_RSA_WITH_AES_128_CBC_SHAClient Sun JDK 7 winServer IBM Power (i)MQ version 7.1 on the serverMQ version 7.5.0.4 on the clientConnections with MQ Explorer works finethe below code works with the ibm JDK C:\\Program Files\\IBM\\WebSphere MQ Explorer\\jre\\jre\\binthe below code does not work with \"C:\\Program Files\\Java\\jdk1.7.0_67\\bin withJava Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 7 Download installedCode:// Instantiate the initial context\n String contextFactory = \"com.sun.jndi.fscontext.RefFSContextFactory\";\n Hashtable environment = new Hashtable();\n environment.put(Context.INITIAL_CONTEXT_FACTORY, contextFactory);\n environment.put(Context.PROVIDER_URL, initialContextUrl);\n Context context = new InitialDirContext(environment);\n System.out.println(\"Initial context found!\");\n\n String keystoreName = System.getProperty(\"javax.net.ssl.keyStore\");\n System.out.println(\"keystoreName \" + keystoreName + \" canRead \" + new File(keystoreName).canRead());\n String truststoreName = System.getProperty(\"javax.net.ssl.trustStore\");\n System.out.println(\"truststoreName \" + keystoreName + \" canRead \" + new File(truststoreName).canRead());\n\n\n // Lookup the connection factory\n JmsConnectionFactory cf = (JmsConnectionFactory) context.lookup(connectionFactoryFromJndi);\n\n\n System.out.println(\"CF = \" + cf.getClass().getName());\n\n MQConnectionFactory mqcf = (MQConnectionFactory) cf;\n System.out.println(\"getSSLCipherSuite:\" + mqcf.getSSLCipherSuite());\n System.out.println(\"getSSLSocketFactory:\" + mqcf.getSSLSocketFactory());\n\n // Lookup the destination\n destination = (JmsDestination) context.lookup(destinationFromJndi);\n System.out.println(\"getSSLSocketFactory:\" + mqcf.getSSLSocketFactory());\n\n // Create JMS objects\n connection = cf.createConnection();\n System.out.println(\"getSSLSocketFactory:\" + mqcf.getSSLSocketFactory());\n\n session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);\n System.out.println(\"getSSLSocketFactory:\" + mqcf.getSSLSocketFactory());\n\n consumer = session.createConsumer(destination);\n System.out.println(\"getSSLSocketFactory:\" + mqcf.getSSLSocketFactory());\n\n // Start the connection\n\n connection.start();\n System.out.println(\"getSSLSocketFactory:\" + mqcf.getSSLSocketFactory());Gives me:Initial context found!\nkeystoreName C:/Users/...key.jks canRead true\ntruststoreName C:/Users/.../key.jks canRead true\nCF = com.ibm.mq.jms.MQConnectionFactory\ngetSSLCipherSuite:SSL_RSA_WITH_AES_128_CBC_SHA\ngetSSLSocketFactory:null\ngetSSLSocketFactory:null\nkeyStore is : C:/Users/.../key.jks\nkeyStore type is : jks\nkeyStore provider is : \ninit keystore\ninit keymanager of type SunX509\n***\nfound key for : ibmwebspheremquserid\n.....\n Valid from Mon May 14 23:59:46 CEST 2012 until Thu May 14 23:59:46 CEST 2015\n\ntrigger seeding of SecureRandom\ndone seeding SecureRandom\nIgnoring unsupported cipher suite: TLS_DHE_DSS_WITH_AES_128_CBC_SHA256\nIgnoring unsupported cipher suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA256\nIgnoring unsupported cipher suite: TLS_DHE_RSA_WITH_AES_128_CBC_SHA256\nIgnoring unsupported cipher suite: TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256\nIgnoring unsupported cipher suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA256\nIgnoring unsupported cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384\nIgnoring unsupported cipher suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384\nIgnoring unsupported cipher suite: TLS_RSA_WITH_AES_256_CBC_SHA256\nIgnoring unsupported cipher suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256\nIgnoring unsupported cipher suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384\nIgnoring unsupported cipher suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384\nIgnoring unsupported cipher suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256\nIgnoring unsupported cipher suite: TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256\nIgnoring unsupported cipher suite: TLS_RSA_WITH_AES_128_CBC_SHA256\nAllow unsafe renegotiation: false\nAllow legacy hello messages: true\nIs initial handshake: true\nIs secure renegotiation: false\ncom.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0018: Failed to connect to queue manager 'qm' with connection mode 'Client' and host name 'host(1414)'.\nCheck the queue manager is started and if running in client mode, check there is a listener running. Please see the linked exception for more information.\nInner exception(s):\ncom.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2393' ('MQRC_SSL_INITIALIZATION_ERROR').\ncom.ibm.mq.jmqi.JmqiException: CC=2;RC=2393;AMQ9204: Connection to host 'host(1414)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2393;AMQ9771: SSL handshake failed. [1=java.lang.IllegalArgumentException[Unsupported ciphersuite SSL_RSA_WITH_AES_128_CBC_SHA],3=host/host:1414 (10.20.28.12),4=SSLSocket.createSocket,5=default]],3=host(1414),5=RemoteTCPConnection.makeSocketSecure]\ncom.ibm.mq.jmqi.JmqiException: CC=2;RC=2393;AMQ9771: SSL handshake failed. [1=java.lang.IllegalArgumentException[Unsupported ciphersuite SSL_RSA_WITH_AES_128_CBC_SHA],3=host/host:1414 (10.20.28.12),4=SSLSocket.createSocket,5=default]\njava.lang.IllegalArgumentException: Unsupported ciphersuite SSL_RSA_WITH_AES_128_CBC_SHA\nFAILURE### Assistant: Switch to the IBM JRE/JDK and it will work.\n"} +{"text": "### Human: I'm working with Websphere MQ. And I need to convert a specific JAR file to a DLL.Hereis the collection of JARS from the WMQ Client.Hereis the JAR Analyzer File for the collection listing the various incoming and outgoing dependencies.The File I want to convert iscom.ibm.mq.jarwhich has the following outgoing dependencies -com.ibm.mq.commonservice.jar\n com.ibm.mq.headers.jar\n com.ibm.mq.jmqi.jarThe problem is I don't know what command to pass in the command prompt to convert the jar without losing any of the classes.Basically, I need to get access to MQMessage and MQMD which are part ofcom.ibm.mq.jarbut when I convert it by itself, those specific classes doesn't get imported.I took a look atanother similar StackOverflow Questionbut the main difference is that the dependencies are circular.For example,com.ibm.mq.headers.jardepends oncom.ibm.mq.jmqi.jarand vice-versa.### Assistant: I have no idea why you will not read the MQ link that I gave.(1) Create a pure '.NET managed' MQ applicationint openOptions = MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING;\nHashtable qMgrProp = new Hashtable();\nqMgrProp.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED); /* very important */\nqMgrProp.Add(MQC.HOST_NAME_PROPERTY, \"10.10.10.10\");\nqMgrProp.Add(MQC.CHANNEL_PROPERTY, \"TEST.CHL\");\nqMgrProp.Add(MQC.PORT_PROPERTY, 1414);\nqMgrProp.Add(MQC.USER_ID_PROPERTY, \"myUserID\");\n\ntry\n{\n MQQueueManager _qMgr = new MQQueueManager(\"MQA1\", qMgrProp);\n\n MQQueue queue = _qMgr.AccessQueue(\"TEST.Q\", openOptions, null, null, null);\n\n /* Do whatever you want to do */\n\n queue.Close();\n _qMgr.Disconnect();\n}\ncatch (MQException mqex)\n{\n System.Console.Out.WriteLine(\"MQTest01 cc=\" + mqex.CompletionCode + \" : rc=\" + mqex.ReasonCode);\n}(2) Compile it.C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\csc.exe /nologo /t:exe /r:System.dll /r:\"C:\\Program Files (x86)\\IBM\\WebSphere MQ\\bin\\amqmdnet.dll\" /out:bin\\Release\\Test.exe Test.cs Properties\\AssemblyInfo.cs(3) Create \"Test.config\" file (to go with Test.exe) where Test.exe is stored\n \n \n \n(4) Copy 3 files to your target PC: Test.exe, Test.config and amqmdnet.dll and then run it. You may need to update the PATH environment variable to point to the directory that amqmdnet.dll resides in. This is generally not needed but sometimes Windows get picky.\n"} +{"text": "### Human: I want to list the headers of a message. But when I use the code provided by the IBM the loop is never entered:...\nint openOptions = MQConstants.MQOO_INPUT_AS_Q_DEF;\nMQQueue queue = qMgr.accessQueue(qName, openOptions);\n...\nMQMessage rcvMessage = new MQMessage();\nMQGetMessageOptions gmo = new MQGetMessageOptions();\nqueue.get(rcvMessage, gmo);\nMQHeaderIterator it = new MQHeaderIterator(rcvMessage);\n while (it.hasNext()) {\n MQHeader header = it.nextHeader();\n System.out.println(\"Header type \" + header.type() + \": \" + header);\n }\n...Has anyone any idea where my mistake is?Here is a message read withqload:A VER 2\nA RPT 0\nA MST 8\nA EXP -1\nA FDB 0\nA ENC 273\nA CCS 819\nA FMT\nA PRI 0\nA PER 0\nA MSI 414D5120574D42514D3144312020202035E2165414530020\nA COI 000000000000000000000000000000000000000000000000\nA BOC 0\nA RTQ\nA RTM WMBQM1D1\nA USR lanes\nA ACC 0000000000000000000000000000000000000000000000000000000000000000\nA AID\nA PAT 28\nA PAN mq.MQ\nA PTD 20140916\nA PTT 11415704\nA AOD\nA GRP 000000000000000000000000000000000000000000000000\nA MSQ 1\nA OFF 0\nA MSF 0\nA ORL -1\nX 000D48656C6C6F2C20576F726C6421### Assistant: Calanaisgave the answer: the message descriptors aren't classed as header.Here is atableof headers:Header Header Description Format Name\n\nMQCIH CICS information header MQFMT_CICS\nMQDLH Dead-letter header MQFMT_DEAD_LETTER_HEADER\nMQDH Distribution-list header MQFMT_DIST_HEADER\nMQEPH Embedded PCF header MQFMT_EMBEDDED_PCF\nMQIIH IMS information header MQFMT_IMS\nMQMDE Message-descriptor extension MQFMT_MD_EXTENSION\nMQCFH PCF header MQFMT_ADMIN / MQFMT_EVENT / MQFMT_PCF\nMQRMH Reference message header MQFMT_REF_MSG_HEADER\nMQRFH Formatting header MQFMT_RF_HEADER\nMQRFH2 Version-2 rules and formatting header MQFMT_RF_HEADER_2\nMQWIH Work information header MQFMT_WORK_INFO_HEADER\nMQXQH Transmission queue header MQFMT_XMIT_Q_HEADERIf you want to read theMQMD fieldsseehere.\n"} +{"text": "### Human: I created 2 message flows, the 1st flow put message in queue and the 2nd flow must read it, transform and reply to the 1st. But I have a trouble with reading in the 2nd flow. Can you give some advices? Thank you### Assistant: Your message actually lacks a lot of details about your flows, but generally, \nif the initial request is performed via HTTP, you have to do the following:1) To save reply identifier when you receive request, so that it could be restored before sending responseSET OutputRoot.XMLNSC.MyBody.MyReplyId = CAST(InputLocalEnvironment.Destination.SOAP.Reply.ReplyIdentifier AS CHARACTER) // for SOAPInput node\nSET OutputRoot.XMLNSC.MyBody.MyReplyId = CAST(InputLocalEnvironment.Destination.HTTP.RequestIdentifier AS CHARACTER) // for HTTPInput node2) To restore reply identifier before sending responseSET OutputLocalEnvironment.Destination.HTTP.RequestIdentifier = CAST(OutputRoot.XMLNSC.MyBody.MyReplyId AS BLOB) // HTTPReply node\nSET OutputLocalEnvironment.Destination.SOAP.Reply.ReplyIdentifier = = CAST(OutputRoot.XMLNSC.MyBody.MyReplyId AS BLOB) // SOAPReply node\n"} +{"text": "### Human: We are using WSO2 ESB and as transport we have WebSphere MQ which is accessed using JMS.\nProblem is that each proxy service works in one thread with WebSphere MQ and because of that we have performance issues.\nHow can we start multiple instances of proxy service without deploying multiple copies of it? Maybe there are some hidden configuration parameters?### Assistant: In addition to already mentioned parameter2you might need to add another one:2147483647This parameter represents number of idle message read attempts per thread. When counter of such idle read attempts becomes equal to this parameter, the thread stops reading messages (if it is not the only reader).Given that, setting this parameter to the upper limit of java int provides you with virtually infinite reading by all the threads.\n"} +{"text": "### Human: I would like to deploy MDB on JBOSS. But the publisher will not send messages to the JBOSS AS, it is sending messages to IBM MQ.Should I use JCA to integrate JBOSS and IBM MQ?ORCan the MDB on JBOSS AS subscribe to the topic on which IBM MQ is getting messages from publisher?What are the advantages of one approach to another?### Assistant: The recommended way to consume messages in JBoss from IBM MQ is via a Message Driven Bean (MDB). This is done by deploying the IBM JCA resource adapter (RA) in JBoss. You must use the IBM RA in JBoss as this rar file contains the IBM MQ client code that is needed for communicating with IBM MQ.When using the MDB approach, the container (JBoss, in this case) works with the JCA to manage JMS connections, message delivery and transactions. This leaves you to only write the onMessage() method - quite a lot gets done for you under the hood.\n"} +{"text": "### Human: I am logged as a domain user on my machine with Windows 7 (with local admin rights). I have installed IBM WebSphere MQ 7.0 and created queue manager via IBM WS MQ Explorer. I see that queue manager is working but I cannot connect to it. When I login as a local user and run MQ Explorer then I can connect to newly created queue manager and manage its settings.\nI guess this is related to some security issues.I tried to add domain user to \"mqm\" group but that did not help.\nI also tried to set variable: \"SET MQSNOAUTH=YES\" and then created queue manager - but it also did not work for me.Any idea on how to solve this ?### Assistant: Have you configured MQ to run under a domain id when you install (or rerun the prepare wizard). The problem is, if you dont, then when a domain id comes along and MQ is running under a local id (MUSR_MQADMIN), it goes off to the domain controller to find out what groups it is a member of, to be told you are not authorized to know. See the docs here:http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.ins.doc/q008820_.htm?lang=enNote there is a subtle difference as to what the prepare wizard does on 7.0 (which sets the id as an identity to a dcom object) vs 7.1+ (which sets the id for the service to run under), but you should always do it through the prepare wizard\n"} +{"text": "### Human: I have been using WebSphere MQ lately to send message from local machine to the WebSphere MQ present on same (local) machine. Which works fine as expected.I dont know how to install WebSphere MQ in other/remote Machine so that I can send message form my local machine to that remote machine.Thanks,### Assistant: There are a number of ways to do this but the most likely is that you will need to install an Websphere MQ Client onto the remote machine. I am not sure what version you want to use but the WMQ 7.5 client is available hereMQC75You can google for other versions by changing the number (MQC7, MQC71, MQC8 etc).You haven't said what language your application is written in, if it is Java then the WMQ Client provides everything you need, if it is C/C++ or .NET then the page I linked to has more information about what you need for these languages.\n"} +{"text": "### Human: I had asked this question before :MQDestination overriding accounting token valueAccording to the response I was even able to set the MQ Accounting token. But the changes have resulted in an impact on the COD which we used to receive earlier. We set the reply to Q and reply to Q Manager as followsDestination codeDestination = session.createQueue(\"queue://\" + replyToQueueMgr + \"/\" +replyToQueueName);\nlogger.info(\":::: codeDestination :::\"+ codeDestination);\nmsg.setJMSReplyTo(codeDestination);Using the above we used to get the COD correctly on the sent queue. But after I added the following line to support Accounting Token((MQDestination) destination).setMQMDMessageContext(WMQConstants.WMQ_MDCTX_SET_ALL_CONTEXT);After adding the above line COD does not come. If I comment out the above line COD starts coming again but that would mean accounting Token does not get set. I also tried the following line((MQDestination) destination).setMQMDMessageContext(WMQConstants.WMQ_MDCTX_SET_IDENTITY_CONTEXT);But even with this I am not getting COD. Its only this context which seems to be causing the issue. Other lines where I am setting MQMDReadEnabled and MQMDWriteEnabled properties is not causing any issue.Can someone please help me on this as I need both COD and Accounting Token?### Assistant: Looks like the COD message is ending up in Queue managers dead letter queue(DLQ). Have you defined a DLQ for your queue manager? If it is defined, please check that DLQ.The reason for COD message ending up in DLQ could be because of insufficient user authority. Please check this link:http://www-01.ibm.com/support/docview.wss?uid=swg1IZ76359.Setting a valid user identifier while sending the message should help. I tried with MQ v8 and I could see COD message being put to a reply queue I specified while sending the message.requestMessage.setStringProperty(JmsConstants.JMS_IBM_MQMD_USERIDENTIFIER, \"\");\n"} +{"text": "### Human: I am trying to set the Accounting Token on the a message which my system received from inbound queue. I am setting this token using the following.msg.setObjectProperty(JmsConstants.JMS_IBM_MQMD_ACCOUNTINGTOKEN,value)Also I have the following properties in my JmsSUpport class((JmsDestination) dest).setBooleanProperty(WMQConstants.WMQ_MQMD_READ_ENABLED, true);\n((JmsDestination) dest).setBooleanProperty(WMQConstants.WMQ_MQMD_WRITE_ENABLED, true); \n((MQDestination) dest).setMQMDWriteEnabled(true);\n((MQDestination) dest).setMQMDReadEnabled(true);\n((MQDestination) dest).setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ);Since the outbound queue is MQDestination I have to set the above properties. Now I am observing that I am correctly setting the value on the outbound message. But when the other application reads the message from the MQ it has default value for Accounting Token. Could this be because the MQ is configured in such way to override the value? Or is it because the other application is not reading MQ message correctly? Or should I be using any other property to enable accounting token?Is it because I am setting ((MQDestination) dest).setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ); the msg gets stripped of MQMD Headers?### Assistant: No, MQMD is never stripped off. You have to set identity context on the destination before sending a message. Otherwise queue manager will ignore the Accounting token. Please see the sample code:import javax.jms.Connection;\nimport javax.jms.Destination;\nimport javax.jms.Message;\nimport javax.jms.MessageProducer;\nimport javax.jms.Session;\n\nimport com.ibm.msg.client.jms.JmsConnectionFactory;\nimport com.ibm.msg.client.jms.JmsFactoryFactory;\nimport com.ibm.msg.client.jms.JmsDestination;\nimport com.ibm.msg.client.wmq.WMQConstants;\nimport com.ibm.msg.client.jms.JmsConstants;\nimport com.ibm.mq.jms.MQDestination;\n\npublic class AccountingTokenDemo {\n\n public static void main(String[]args) {\n // TODO Auto-generated method stub\n AccountingTokenDemo demo = new AccountingTokenDemo();\n demo.putMessageWithAccountingToken();\n }\n public void putMessageWithAccountingToken() {\n JmsConnectionFactory cf = null;\n Connection connection = null;\n Session session = null;\n Destination reqQ = null;\n MessageProducer producer = null;\n\n try { \n // Create a connection factory\n JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\n cf = ff.createConnectionFactory();\n\n // Set the properties\n cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_BINDINGS);\n cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, \"QM2\");\n\n // Create JMS objects\n connection = cf.createConnection();\n session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);\n\n // Create a 32 byte accounting toke\n byte [] accountingToken = new byte[32];\n byte b = 'a';\n for(int i=0; i < 32;i++)\n accountingToken[i] = b++;\n\n // Create destination to send requests\n reqQ = session.createQueue(\"queue:///REQUESTQ\");\n ((MQDestination) reqQ).setTargetClient(WMQConstants.WMQ_CLIENT_NONJMS_MQ); \n ((JmsDestination) reqQ).setBooleanProperty(WMQConstants.WMQ_MQMD_READ_ENABLED, true);\n ((JmsDestination) reqQ).setBooleanProperty(WMQConstants.WMQ_MQMD_WRITE_ENABLED, true); \n ((MQDestination) reqQ).setMQMDMessageContext(WMQConstants.WMQ_MDCTX_SET_IDENTITY_CONTEXT);\n\n // Create producer\n producer = session.createProducer(reqQ);\n\n // Create a request message\n Message requestMessage = session.createTextMessage(\"Setting Accounting token on message\");\n requestMessage.setObjectProperty(JmsConstants.JMS_IBM_MQMD_ACCOUNTINGTOKEN, accountingToken);\n // Send it off\n producer.send(requestMessage);\n\n }catch(Exception ex){\n System.out.println(ex);\n }\n } \n}\n"} +{"text": "### Human: currently I am working with Apache Camel and what I need to do is create a WMQ Queue in camel (Something like session queue) when I start the application and the delete it when I stop the application. Is there any possible way?Or, I have checked that the apache camel will create a temporary with random name when I create a connection factory. is there any ways to change the name of the temporary queue from random name into static name?FYI, for now I am usign Spring for my Component Configuration.Thanks### Assistant: Okay, this does not have anything to do with Apache Camel actually, as it can be seen as any JMS client application with respect to this issue.IBM WebSphere MQ have two types of queues.Regular queues that needs to be created (and possibly deleted) by an administrator, script or the like.Temporary queues, where the name is irrelevant, it has to be unique in the context of the queue manager. JMS does not allow naming of temporary queues since the name is actually irrelevant since it should be used once and then discarded.WMQ is not really designed to behave in a way to support your usecase.The only option is to figure out if you can somehow automate the task of create/remove queues. That is usually done manually in a MQ Explorer/MQSC/MQMON or similar tools. Other MOM software such as ActiveMQ does such things automatically.There are probably several ways to create queues remotely. One is to usePCF commandswhich you may send to queues like SYSTEM.ADMIN.COMMAND.QUEUE. However, that queue is usually very well protected in an enterprise setup so that only administrators can use it. You have no information about that in your question, however. Another option (not nice, but non the less), is to let an application on the queue manager server (maybe camel?) invoke runmqsc with params to create a queue.\n"} +{"text": "### Human: While establishing connection to WebSphere MQ over JMS using MQ 7.0 libraries, I am able to set following WMQ-specific connection attributes:HostnamePortChannelQueue ManagerQueue NameUser IDPasswordI am pretty sure I would need send things to specific queue, so I believe the Queue Name and Hostname will be always necessary.Which of the remaining are typically always required while establishing a connection via \nJMS? \nFor example, does it make sense to setup WebSphere MQ in such a way, that no Queue Manager or Channels would exist or be necessary to send messages to specific queue?Is it common for such MQ/JMS setup to not use UserID/Password at all?### Assistant: Depends on the type of connection,server bindingsorclient bindings. Inserver bindingsthe queue manager and application communicate using shared memory and in client bindings, the communication is over sockets.When usingserver bindingsonly queue manager name is required for establishing a connection whereashost name,port,channel nameare required forclient bindings.UserID and Password are optional for MQ JMS. As of v7.5, MQ validates only the UserID and not password. If UserID is not specified, MQ JMS will pass the logged in UserID of the machine to the queue manager. Additional components likeSecurity Exitis required for password validation.\n"} +{"text": "### Human: I have somestoppedQMGRs. When I try to start them or delete them from MQ Explorer, I encounter this error:AMQ7077: You are not authorized to perform the requested operation.\nexitvalue=119How can I change or remove the restrictions on this object?### Assistant: You can start or delete a queue manager via the MQ Explorer too, so long as the queue manager and MQ Explorer are running on the same machine/installation. You must ensure that the MQ Explorer is running under an mqm user ID, just as you needed to do run thestrmqmordltmqmcommands.\n"} +{"text": "### Human: We are trying to delete one or more queue from a MQ Channel that was previously configured. DEletion was successful. When we ran the application code we got the below error code/description:-2136 (0858) (RC2136): MQRC_MULTIPLE_REASONS\nExplanation\nAn MQOPEN, MQPUT or MQPUT1 call was issued to open a distribution list or put a message to a distribution list, but the result of the call was not the same for all of the destinations in the list. One of the following applies:\n\u2022 The call succeeded for some of the destinations but not others. The completion code is MQCC_WARNING in this case.\n\u2022 The call failed for all of the destinations, but for differing reasons. The completion code is MQCC_FAILED in this case.\nThis reason code occurs in the following environments: AIX\u00ae, HP-UX, i5/OS\u2122, Solaris, Windows, plus WebSphere\u00ae MQ clients connected to these systems.\nCompletion Code\nMQCC_WARNING or MQCC_FAILEDProgrammer response\nExamine the MQRR response records to identify the destinations for which the call failed, and the reason for the failure. Ensure that sufficient response records are provided by the application on the call to enable the error(s) to be determined. For the MQPUT1 call, the response records must be specified using the MQOD structure, and not the MQPMO structure.https://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.amqzao.doc/fm13300_.htmhttp://www.mqseries.net/phpBB/viewtopic.php?p=6475&sid=eb310522e0959bb828917836dfa550eaHow can we solve this issue ?### Assistant: This reason code suggests that your application is doing an MQPUT to multiple queues at once by providing the names of them in the MQOR structure hung off the MQOD structure.You say that you deleted some queues and then after that deletion was done your application started to report this error. This suggests that you have deleted at least one of the queues that your application was previously referring to, but not all of the queues that it was using. So some of the reason codes were MQRC_NONE and some of the reason codes were MQRC_OBJECT_NOT_FOUND because you deleted them, hence the MQRC_MULTIPLE_REASONS. As your text in your question indicates, to see all the individual reason codes, you need to look in the MQRR structure returned to your application.Perhaps you could post your application code, or at least the part where the queue names are set, so we can advise further.\n"} +{"text": "### Human: Good time!When application try to start after deploying on WASCE 3.0 it fails with error. In log I got this exception:Caused by: com.ibm.msg.client.jms.DetailedInvalidDestinationException: JMSWMQ2008: \u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043e\u0447\u0435\u0440\u0435\u0434\u044c MQ 'OZI_INPUT'.\n\u041f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 JMS \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c MQOPEN WebSphere MQ \u0441\u043e\u043e\u0431\u0449\u0438\u043b \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435.\n\u0414\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0447\u0438\u043d\u044b \u043e\u0448\u0438\u0431\u043a\u0438 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435\u0441\u044c \u043a \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0439 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438. \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0438\u043b\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u0435\u0439.\n at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:503)\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:221)\n...\nCaused by: com.ibm.mq.MQException: JMSCMQ0001: \u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432\u044b\u0437\u043e\u0432 WebSphere MQ \u0441 \u043a\u043e\u0434\u043e\u043c '2' ('MQCC_FAILED') \u043f\u0440\u0438\u0447\u0438\u043d\u0430 '2085' ('MQRC_UNKNOWN_OBJECT_NAME').\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:209)\n ... 98 moreI checked queue name (it's right) and I can get messages from OZI_INPUT in wasce 3.0 console admin.With the error code I found this urlibm docsIt says that this error occurs when the application is looking the queue in the other queue manager (not given queue manager). \nTo disable this feature, I should remove the property \"Base queue manager name\" in the queue.\nBut I can't find something like that property in Websphere MQ Explorer.So the question is where I can edit this property in Websphere MQ Explorer for Websphere MQ 7.5?UPDATEOn Websphere MQ I have two queue managers: MQ_ADM and MQ_ADM2 (OZI_INPUT and OZI_OUTPUT are here).\nOn Websphere CA 3.0 I have to JMS resources:\nFor MQ_ADM - MQRA (com.ibm.mq/WMQRA/7.1.0.1/rar):Connection Factory jms/MQRA\nQueue jms/EHD_CE_OUTPUT\nQueue jms/EHD_INPUT\nQueue jms/EHD_LK_NPF_OUTPUT \nQueue jms/EHD_OUTPUT\nQueue jms/EHD_OZI_OUTPUTFor MQ_ADM2 - OziRA (ozi.jms/OziCommands/1.0/rar):Queue jms/OZI_INPUT\nQueue jms/OZI_OUTPUTI can see all of this queues when I click \"browse\" button.I made a test: add OZI_INPUT and OZI_OUTPUT in MQ_ADM queue manager without any changes on Websphere CA.\nAnd my application successfully started.I can add connectors deployment plan if it will be usefull.UPDATE2\nDISPLAY QUEUE(SYSTEM.*) for MQ_ADMDISPLAY QUEUE(SYSTEM.*)\n 4 : DISPLAY QUEUE(SYSTEM.*)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.ADMIN.ACCOUNTING.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.ADMIN.ACTIVITY.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.ADMIN.CHANNEL.EVENT) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.ADMIN.COMMAND.EVENT) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.ADMIN.COMMAND.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.ADMIN.CONFIG.EVENT) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.ADMIN.LOGGER.EVENT) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.ADMIN.PERFM.EVENT) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.ADMIN.PUBSUB.EVENT) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.ADMIN.QMGR.EVENT) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.ADMIN.STATISTICS.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.ADMIN.TRACE.ACTIVITY.QUEUE)\n TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.ADMIN.TRACE.ROUTE.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.AUTH.DATA.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.BROKER.ADMIN.STREAM) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.BROKER.CONTROL.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.BROKER.DEFAULT.STREAM) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.BROKER.INTER.BROKER.COMMUNICATIONS)\n TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.CHANNEL.INITQ) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.CHANNEL.SYNCQ) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.CHLAUTH.DATA.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.CICS.INITIATION.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.CLUSTER.COMMAND.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.CLUSTER.HISTORY.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.CLUSTER.REPOSITORY.QUEUE)\n TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.CLUSTER.TRANSMIT.MODEL.QUEUE)\n TYPE(QMODEL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.CLUSTER.TRANSMIT.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.DEAD.LETTER.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.DEFAULT.ALIAS.QUEUE) TYPE(QALIAS)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.DEFAULT.INITIATION.QUEUE)\n TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.DEFAULT.LOCAL.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.DEFAULT.MODEL.QUEUE) TYPE(QMODEL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.DEFAULT.REMOTE.QUEUE) TYPE(QREMOTE\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.DOTNET.XARECOVERY.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.DURABLE.MODEL.QUEUE) TYPE(QMODEL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.DURABLE.SUBSCRIBER.QUEUE)\n TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.HIERARCHY.STATE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.INTER.QMGR.CONTROL) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.INTER.QMGR.FANREQ) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.INTER.QMGR.PUBS) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.INTERNAL.REPLY.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.JMS.TEMPQ.MODEL) TYPE(QMODEL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.MQEXPLORER.REPLY.MODEL) TYPE(QMODEL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.MQSC.REPLY.QUEUE) TYPE(QMODEL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.NDURABLE.MODEL.QUEUE) TYPE(QMODEL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.PENDING.DATA.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.PROTECTION.ERROR.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.PROTECTION.POLICY.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.RETAINED.PUB.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.SELECTION.EVALUATION.QUEUE)\n TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.SELECTION.VALIDATION.QUEUE)\n TYPE(QLOCAL)AND DISPLAY QUEUE(SYSTEM.*) for MQ_ADM2DISPLAY QUEUE(SYSTEM.*)\n 1 : DISPLAY QUEUE(SYSTEM.*)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.ADMIN.ACCOUNTING.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.ADMIN.ACTIVITY.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.ADMIN.CHANNEL.EVENT) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.ADMIN.COMMAND.EVENT) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.ADMIN.COMMAND.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.ADMIN.CONFIG.EVENT) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.ADMIN.LOGGER.EVENT) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.ADMIN.PERFM.EVENT) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.ADMIN.PUBSUB.EVENT) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.ADMIN.QMGR.EVENT) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.ADMIN.STATISTICS.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.ADMIN.TRACE.ACTIVITY.QUEUE)\n TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.ADMIN.TRACE.ROUTE.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.AUTH.DATA.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.BROKER.ADMIN.STREAM) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.BROKER.CONTROL.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.BROKER.DEFAULT.STREAM) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.BROKER.INTER.BROKER.COMMUNICATIONS)\n TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.CHANNEL.INITQ) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.CHANNEL.SYNCQ) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.CHLAUTH.DATA.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.CICS.INITIATION.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.CLUSTER.COMMAND.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.CLUSTER.HISTORY.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.CLUSTER.REPOSITORY.QUEUE)\n TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.CLUSTER.TRANSMIT.MODEL.QUEUE)\n TYPE(QMODEL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.CLUSTER.TRANSMIT.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.DEAD.LETTER.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.DEFAULT.ALIAS.QUEUE) TYPE(QALIAS)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.DEFAULT.INITIATION.QUEUE)\n TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.DEFAULT.LOCAL.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.DEFAULT.MODEL.QUEUE) TYPE(QMODEL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.DEFAULT.REMOTE.QUEUE) TYPE(QREMOTE\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.DOTNET.XARECOVERY.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.DURABLE.MODEL.QUEUE) TYPE(QMODEL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.DURABLE.SUBSCRIBER.QUEUE)\n TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.HIERARCHY.STATE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.INTER.QMGR.CONTROL) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.INTER.QMGR.FANREQ) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.INTER.QMGR.PUBS) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.INTERNAL.REPLY.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.JMS.TEMPQ.MODEL) TYPE(QMODEL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.MQEXPLORER.REPLY.MODEL) TYPE(QMODEL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.MQSC.REPLY.QUEUE) TYPE(QMODEL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.NDURABLE.MODEL.QUEUE) TYPE(QMODEL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.PENDING.DATA.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.PROTECTION.ERROR.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.PROTECTION.POLICY.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.RETAINED.PUB.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.SELECTION.EVALUATION.QUEUE)\n TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.SELECTION.VALIDATION.QUEUE)\n TYPE(QLOCAL)For MQ_ADM:DISPLAY QUEUE(*)\n 1 : DISPLAY QUEUE(*)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(AMQ.MQEXPLORER.1380471368) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(COMMAND_INPUT) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(EHD_CE_OUTPUT) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(EHD_INPUT) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(EHD_LK_NPF_OUTPUT) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(EHD_OUTPUT) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(EHD_OZI_OUTPUT) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(OZI_INPUT) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(OZI_OUTPUT) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.ADMIN.ACCOUNTING.QUEUE) TYPE(QLOCAL)For MQ_ADM2:DISPLAY QUEUE(*)\n 1 : DISPLAY QUEUE(*)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(AMQ.MQEXPLORER.1293962528) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(OZI_INPUT) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(OZI_OUTPUT) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.ADMIN.ACCOUNTING.QUEUE) TYPE(QLOCAL)\nAMQ8409: \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\n QUEUE(SYSTEM.ADMIN.ACTIVITY.QUEUE) TYPE(QLOCAL)### Assistant: Is OZI_INPUT a MQ cluster queue? The link you provided is applicable for MQ cluster queues. The Base queue manager in a MQ cluster is the queue manager where the queue/topic is defined. There is nothing like \"Base Queue Manager\" property that you can set. It is just the queue manager where the queue is defined.Is your application trying to get messages from a MQ cluster queue (OZI_INPUT in this case) and isNOTdefined in the queue manager to which your application is connected to? Remember even if a queue is a cluster queue, application must connect to the queue manager where the queue is defined to get GET messages. However you can PUT messages to a cluster queue even if the queue is defined in some other queue manager in the cluster.If not using MQ Cluster, then check if your application is connecting to the queue manager where OZI_INPUT queue is defined.\n"} +{"text": "### Human: Using WebSphere MQ on z/OS for messaging and the WebSphere MQ resource adapter within JBoss EAP 6, I want to set theApplication Namethat appears when viewing the active handles on a queue.The default isWebSphere MQ Client for Javaand I have not managed to change it. I have no administrative access to the queue / queue manager, I am just the sender posting messages to it.My configuration for the queues / queue manager are located in the JBoss EAP config file at the resource adapter configurations. I have tried - without success - setting the application name using a config-property inside the connection definition, for example:\n my application name\nI have also tried names like applicationName, applName, appName, application or JMS_IBM_MQMD_PutApplName. The latter and the name from the example I have taken fromhereandhere.How can I change the displayed application name?\nIs this even possible without using the specific WebSphere MQ classes inside the java application?### Assistant: http://pic.dhe.ibm.com/infocenter/wmqv7/v7r5/index.jsp?topic=%2Fcom.ibm.mq.dev.doc%2Fq030790_.htmSomewhere buried in there, it says its not supported for z/OS.Note: Queue managers running on z/OS\u00ae platforms do not support setting\n application names.\n"} +{"text": "### Human: I'm connecting to a Websphere MQ topic with a durable subscription using Spring:Since this is a durable subscription, I'm concious that whilst the application is not subscribed to the topic in WMQ the messages for next time I connect are piling up either on disk or in memory. I'm concerned that as a result WMQ will run out of either memory or disk space unless a timeout is specified somewhere.Does anyone know what my options are for specifying the timeout? Should it be in themessage-driven-channel-adapteror WMQ, or should it be an expiry set on the message before publication?### Assistant: or should it be an expiry set on the message before publication?Yes.\n"} +{"text": "### Human: I have a binary file which runs fine 99% of the time. And from time to time, for no reason I can understand, It crashes with this output. After what I just relaunch and everything works fine.The binary is a template system. it read some templates with placeholders like\n{%foo%} or {%include:foo%} whose respective for are:to look for \"foo\" in the current context (std::map )to include right there a subtemplate called \"foo\" ( as many times as a given stored procedures returns lines ) overwriting/adding to current std::map context.Each template generator gets its own copy of its contexts and then execute in its own thread, where it saves the generated output to a file and send it to an MQ. Once every generators has returned, everything is cleaned up and the exe returns 0.I do not even use a doubly linked list ( or any form or linked list anywhere ). I do not understand this crashes even though they seem to be related to some multithread heap corruption.I would welcome any hint:How could I reproduce this more often so I can debug it?Where/what should i look for?*** glibc detected *** /Soft/fox_dev/redhat/env/Dev_FXA/exe/fxa_march: corrupted double-linked list: 0x08da3d18 ***\n\n======= Backtrace: =========\n/lib/libc.so.6[0x8dc5b6]\n/lib/libc.so.6[0x8de3bd]\n/lib/libc.so.6(__libc_malloc+0x7b)[0x8e03ab]\n/opt/quest/lib/libvas.so.4(vassym_sqlite3Malloc+0x1e)[0xb65eb15e]\n/opt/quest/lib/libvas.so.4(vassym_sqlite3pager_open+0x10a)[0xb65dc4aa]\n/opt/quest/lib/libvas.so.4(vassym_sqlite3BtreeOpen+0x42)[0xb65c5a42]\n/opt/quest/lib/libvas.so.4(vassym_sqlite3BtreeFactory+0x35)[0xb65d8cb5]\n/opt/quest/lib/libvas.so.4[0xb65d953d]\n/opt/quest/lib/libvas.so.4(vassql_init+0xea)[0xb6644d2e]\n/opt/quest/lib/libvas.so.4(libvascache_misc_db_init+0xc4)[0xb66226ce]\n/opt/quest/lib/libvas.so.4[0xb662b3b7]\n/opt/quest/lib/libvas.so.4(vascache_miscinfo_get+0x4b)[0xb662b4cb]\n/opt/quest/lib/libvas.so.4(vascache_init+0x1c1)[0xb6622ac1]\n/lib/libnss_vas3.so.2[0xb66b9970]\n/lib/libnss_vas3.so.2[0xb66ba52e]\n/lib/libnss_vas3.so.2(_nss_vas3_getXXent_get_tsd+0x8c)[0xb66ba6b0]\n/lib/libnss_vas3.so.2[0xb66bdf28]\n/lib/libnss_vas3.so.2(_nss_vas3_getpwuid_r+0x1d)[0xb66bed85]\n/lib/libc.so.6(getpwuid_r+0xa3)[0x9055a3]\n/Soft/fox_dev/redhat/dist/fx/libs/Qt/libsybdb.so.5[0xb671c60f]\n/Soft/fox_dev/redhat/dist/fx/libs/Qt/libsybdb.so.5[0xb670e049]\n/Soft/fox_dev/redhat/dist/fx/libs/Qt/libsybdb.so.5[0xb670e233]\n/Soft/fox_dev/redhat/dist/fx/libs/Qt/libsybdb.so.5[0xb670d499]\n/Soft/fox_dev/redhat/dist/fx/libs/Qt/libsybdb.so.5(tdsdbopen+0x26c)[0xb66e15ef]\n/Soft/fox_dev/redhat/dist/fxa/exe/sqldrivers/libqsqltds.so[0xb67495ce]\n/Soft/fox_dev/redhat/dist/fx/libs/Qt/libQtSql.so.4(_ZN12QSqlDatabase4openEv+0x41)[0xb76eee81]\n/Soft/fox_dev/redhat/env/Dev_FXA/exe/fxa_march[0x806446b]\n/Soft/fox_dev/redhat/env/Dev_FXA/exe/fxa_march[0x8065e27]\n/Soft/fox_dev/redhat/env/Dev_FXA/exe/fxa_march[0x8065d30]\n/Soft/fox_dev/redhat/env/Dev_FXA/exe/fxa_march[0x8066298]\n/Soft/fox_dev/redhat/env/Dev_FXA/exe/fxa_march[0x8066528]\n/Soft/fox_dev/redhat/env/Dev_FXA/exe/fxa_march[0x80690cb]\n/Soft/fox_dev/redhat/env/Dev_FXA/exe/fxa_march[0x80699a4]\n/Soft/fox_dev/redhat/env/Dev_FXA/exe/fxa_march[0x809db9c]\n/Soft/fox_dev/redhat/dist/fx/libs/Qt/libQtCore.so.4[0xb6e5fe0f]\n/Soft/fox_dev/redhat/dist/fx/libs/Qt/libQtCore.so.4[0xb6e6c5f2]\n/lib/libpthread.so.0[0x9ef49b]\n/lib/libc.so.6(clone+0x5e)[0x94642e]\n======= Memory map: ========\n00356000-00365000 r-xp 00000000 fd:00 461183 /lib/libresolv-2.5.so\n00365000-00366000 r-xp 0000e000 fd:00 461183 /lib/libresolv-2.5.so\n00366000-00367000 rwxp 0000f000 fd:00 461183 /lib/libresolv-2.5.so\n00367000-00369000 rwxp 00367000 00:00 0\n00385000-00465000 r-xp 00000000 fd:00 597951 /usr/lib/libstdc++.so.6.0.8\n00465000-00469000 r-xp 000df000 fd:00 597951 /usr/lib/libstdc++.so.6.0.8\n00469000-0046a000 rwxp 000e3000 fd:00 597951 /usr/lib/libstdc++.so.6.0.8\n0046a000-00470000 rwxp 0046a000 00:00 0\n00495000-00497000 r-xp 00000000 fd:00 461203 /lib/libcom_err.so.2.1\n00497000-00498000 rwxp 00001000 fd:00 461203 /lib/libcom_err.so.2.1\n007b8000-007ba000 r-xp 00000000 fd:00 458824 /lib/libkeyutils-1.2.so\n007ba000-007bb000 rwxp 00001000 fd:00 458824 /lib/libkeyutils-1.2.so\n007e4000-007e8000 r-xp 00000000 fd:00 461202 /lib/libgthread-2.0.so.0.1200.3\n007e8000-007e9000 rwxp 00003000 fd:00 461202 /lib/libgthread-2.0.so.0.1200.3\n00857000-00871000 r-xp 00000000 fd:00 461149 /lib/ld-2.5.so\n00871000-00872000 r-xp 00019000 fd:00 461149 /lib/ld-2.5.so\n00872000-00873000 rwxp 0001a000 fd:00 461149 /lib/ld-2.5.so\n00875000-009b3000 r-xp 00000000 fd:00 461180 /lib/libc-2.5.so\n009b3000-009b5000 r-xp 0013e000 fd:00 461180 /lib/libc-2.5.so\n009b5000-009b6000 rwxp 00140000 fd:00 461180 /lib/libc-2.5.so\n009b6000-009b9000 rwxp 009b6000 00:00 0\n009bb000-009bd000 r-xp 00000000 fd:00 461185 /lib/libdl-2.5.so\n009bd000-009be000 r-xp 00001000 fd:00 461185 /lib/libdl-2.5.so\n009be000-009bf000 rwxp 00002000 fd:00 461185 /lib/libdl-2.5.so\n009c1000-009e6000 r-xp 00000000 fd:00 461182 /lib/libm-2.5.so\n009e6000-009e7000 r-xp 00024000 fd:00 461182 /lib/libm-2.5.so\n009e7000-009e8000 rwxp 00025000 fd:00 461182 /lib/libm-2.5.so\n009ea000-009fd000 r-xp 00000000 fd:00 461188 /lib/libpthread-2.5.so\n009fd000-009fe000 r-xp 00012000 fd:00 461188 /lib/libpthread-2.5.so\n009fe000-009ff000 rwxp 00013000 fd:00 461188 /lib/libpthread-2.5.so\n009ff000-00a01000 rwxp 009ff000 00:00 0\n00a03000-00a15000 r-xp 00000000 fd:00 597527 /usr/lib/libz.so.1.2.3\n00a15000-00a16000 rwxp 00011000 fd:00 597527 /usr/lib/libz.so.1.2.3\n00a18000-00a1f000 r-xp 00000000 fd:00 461189 /lib/librt-2.5.so\n00a1f000-00a20000 r-xp 00006000 fd:00 461189 /lib/librt-2.5.so\n00a20000-00a21000 rwxp 00007000 fd:00 461189 /lib/librt-2.5.so\n00a23000-00a39000 r-xp 00000000 fd:00 461192 /lib/libselinux.so.1\n00a39000-00a3b000 rwxp 00015000 fd:00 461192 /lib/libselinux.so.1\n00a3d000-00a78000 r-xp 00000000 fd:00 461191 /lib/libsepol.so.1\n00a78000-00a79000 rwxp 0003a000 fd:00 461191 /lib/libsepol.so.1\n00a79000-00a83000 rwxp 00a79000 00:00 0\n00a85000-00b22000 r-xp 00000000 fd:00 461196 /lib/libglib-2.0.so.0.1200.3\n00b22000-00b23000 rwxp 0009c000 fd:00 461196 /lib/libglib-2.0.so.0.1200.3\n00b25000-00b2e000 r-xp 00000000 fd:00 461186 /lib/libcrypt-2.5.so\n00b2e000-00b2f000 r-xp 00008000 fd:00 461186 /lib/libcrypt-2.5.so\n00b2f000-00b30000 rwxp 00009000 fd:00 461186 /lib/libcrypt-2.5.so\n00b30000-00b57000 rwxp 00b30000 00:00 0\n00c8a000-00c95000 r-xp 00000000 fd:00 461190 /lib/libgcc_s-4.1.2-20080825.so.1\n00c95000-00c96000 rwxp 0000a000 fd:00 461190 /lib/libgcc_s-4.1.2-20080825.so.1\n00c98000-00cab000 r-xp 00000000 fd:00 461184 /lib/libnsl-2.5.so\n00cab000-00cac000 r-xp 00012000 fd:00 461184 /lib/libnsl-2.5.so\n00cac000-00cad000 rwxp 00013000 fd:00 461184 /lib/libnsl-2.5.so\n00cad000-00caf000 rwxp 00cad000 00:00 0\n08048000-080b2000 r-xp 00000000 00:26 181700 /Soft/fox_dev/redhat/dist/fxa/exe/fxa_march\n080b2000-080b3000 rwxp 0006a000 00:26 181700 /Soft/fox_dev/redhat/dist/fxa/exe/fxa_march\n08a80000-09f31000 rwxp 08a80000 00:00 0 [heap]\naf800000-af828000 rwxp af800000 00:00 0\naf828000-af900000 --xp af828000 00:00 0\nafa00000-afc00000 rwxp afa00000 00:00 0\nafc00000-afd00000 rwxp afc00000 00:00 0\nafe00000-aff00000 rwxp afe00000 00:00 0\nb0000000-b0100000 rwxp b0000000 00:00 0\nb0100000-b0200000 rwxp b0100000 00:00 0\nb0200000-b0400000 rwxp b0200000 00:00 0\nb0400000-b0600000 rwxp b0400000 00:00 0\nb0600000-b0700000 rwxp b0600000 00:00 0\nb0800000-b0a00000 rwxp b0800000 00:00 0\nb0a00000-b0b00000 rwxp b0a00000 00:00 0\nb0b00000-b0c00000 rwxp b0b00000 00:00 0\nb0c00000-b0e00000 rwxp b0c00000 00:00 0\nb0e00000-b0ff1000 rwxp b0e00000 00:00 0\nb0ff1000-b1000000 --xp b0ff1000 00:00 0\nb1000000-b1100000 rwxp b1000000 00:00 0\nb1200000-b12f7000 rwxp b1200000 00:00 0\nb12f7000-b1300000 --xp b12f7000 00:00 0\nb1300000-b1400000 rwxp b1300000 00:00 0\nb1400000-b14e5000 rwxp b1400000 00:00 0\nb14e5000-b1500000 --xp b14e5000 00:00 0\nb1500000-b15e9000 rwxp b1500000 00:00 0\nb15e9000-b1600000 --xp b15e9000 00:00 0\nb1600000-b16f6000 rwxp b1600000 00:00 0\nb16f6000-b1700000 --xp b16f6000 00:00 0\nb1700000-b17f8000 rwxp b1700000 00:00 0\nb17f8000-b1800000 --xp b17f8000 00:00 0\nb1800000-b18dd000 rwxp b1800000 00:00 0\nb18dd000-b1900000 --xp b18dd000 00:00 0\nb1a00000-b1c00000 rwxp b1a00000 00:00 0\nb1c00000-b1e00000 rwxp b1c00000 00:00 0\nb1e00000-b1ee5000 rwxp b1e00000 00:00 0\nb1ee5000-b1f00000 --xp b1ee5000 00:00 0\nb1f00000-b2000000 rwxp b1f00000 00:00 0\nb2100000-b2200000 rwxp b2100000 00:00 0\nb2200000-b2300000 rwxp b2200000 00:00 0\nb2300000-b2400000 rwxp b2300000 00:00 0\nb2474000-b2475000 --xp b2474000 00:00 0\nb2475000-b2e75000 rwxp b2475000 00:00 0\nb2e75000-b2e76000 --xp b2e75000 00:00 0\nb2e76000-b3876000 rwxp b2e76000 00:00 0\nb3876000-b3877000 --xp b3876000 00:00 0\nb3877000-b4277000 rwxp b3877000 00:00 0\nb4277000-b4278000 --xp b4277000 00:00 0\nb4278000-b4c78000 rwxp b4278000 00:00 0\nb4c78000-b4c79000 --xp b4c78000 00:00 0\nb4c79000-b5679000 rwxp b4c79000 00:00 0\nb5679000-b567a000 --xp b5679000 00:00 0\nb567a000-b607a000 rwxp b567a000 00:00 0\nb607a000-b60fb000 rwxp b641f000 00:00 0\nb60fb000-b63ed000 r-xp 00000000 fd:00 461150 /lib/libnss_ldap-2.5.so\nb63ed000-b6405000 rwxp 002f2000 fd:00 461150 /lib/libnss_ldap-2.5.so\nb6405000-b6414000 rwxp b6405000 00:00 0\nb6430000-b645e000 r-xp 00000000 fd:00 40163 /opt/mqm/lib/amqcctca_r\nb645e000-b6460000 rwxp 0002e000 fd:00 40163 /opt/mqm/lib/amqcctca_r\nb6460000-b6461000 rwxp b6460000 00:00 0\nb6461000-b6496000 r-xs 00000000 fd:03 65542 /var/db/nscd/hosts\nb6496000-b66ad000 r-xp 00000000 fd:00 989554 /opt/quest/lib/libvas.so.4.5.1\nb66ad000-b66b7000 rwxp 00217000 fd:00 989554 /opt/quest/lib/libvas.so.4.5.1\nb66b7000-b66c3000 r-xp 00000000 fd:00 989556 /opt/quest/lib/nss/libnss_vas3.so.2\nb66c3000-b66c4000 rwxp 0000b000 fd:00 989556 /opt/quest/lib/nss/libnss_vas3.so.2\nb66c4000-b66cd000 r-xp 00000000 fd:00 458792 /lib/libnss_files-2.5.so\nb66cd000-b66ce000 r-xp 00008000 fd:00 458792 /lib/libnss_files-2.5.so\nb66ce000-b66cf000 rwxp 00009000 fd:00 458792 /lib/libnss_files-2.5.so\nb66da000-b673f000 r-xp 00000000 00:26 182147 /Soft/fox_dev/redhat/dist/fx/libs/Qt/libsybdb.so.5\nb673f000-b6742000 rwxp 00064000 00:26 182147 /Soft/fox_dev/redhat/dist/fx/libs/Qt/libsybdb.so.5\nb6742000-b674d000 r-xp 00000000 00:26 181921 /Soft/fox_dev/redhat/dist/fxa/exe/sqldrivers/libqsqltds.so\nb674d000-b674e000 rwxp 0000b000 00:26 181921 /Soft/fox_dev/redhat/dist/fxa/exe/sqldrivers/libqsqltds.so\nb674e000-b6750000 r-xp 00000000 fd:00 689014 /usr/lib/gconv/UTF-16.so\nb6750000-b6752000 rwxp 00001000 fd:00 689014 /usr/lib/gconv/UTF-16.so\nb6752000-b6759000 r-xs 00000000 fd:00 689043 /usr/lib/gconv/gconv-modules.cache\nb6759000-b675a000 r-xp 01738000 fd:00 594281 /usr/lib/locale/locale-archive\nb675a000-b6760000 r-xp 016bb000 fd:00 594281 /usr/lib/locale/locale-archive\nb6760000-b6794000 r-xp 01682000 fd:00 594281 /usr/lib/locale/locale-archive\nb6794000-b6994000 r-xp 00000000 fd:00 594281 /usr/lib/locale/locale-archive\nb6994000-b6997000 rwxp b6994000 00:00 0\nb6997000-b6a13000 r-xp 00000000 fd:00 40235 /opt/mqm/lib/libmqiz_r.so\nb6a13000-b6a16000 rwxp 0007c000 fd:00 40235 /opt/mqm/lib/libmqiz_r.so\nb6a16000-b6a1a000 rwxp b6a16000 00:00 0\nb6a1a000-b6ac9000 r-xp 00000000 fd:00 598559 /usr/lib/libstdc++.so.5.0.7\nb6ac9000-b6ace000 rwxp 000ae000 fd:00 598559 /usr/lib/libstdc++.so.5.0.7\nb6ace000-b6ad3000 rwxp b6ace000 00:00 0\nb6ad3000-b6c0b000 r-xp 00000000 fd:00 38366 /opt/mqm/lib/libmqmcs_r.so\nb6c0b000-b6c6f000 rwxp 00137000 fd:00 38366 /opt/mqm/lib/libmqmcs_r.so\nb6c6f000-b6c7d000 rwxp b6c6f000 00:00 0\nb6c7d000-b6ca0000 r-xp 00000000 fd:00 40239 /opt/mqm/lib/libmqic_r.so\nb6ca0000-b6ca3000 rwxp 00023000 fd:00 40239 /opt/mqm/lib/libmqic_r.so\nb6ca3000-b6cbc000 r-xp 00000000 fd:00 40173 /opt/mqm/lib/3.2/libimqb23gl_r.so\nb6cbc000-b6cc1000 rwxp 00019000 fd:00 40173 /opt/mqm/lib/3.2/libimqb23gl_r.so\nb6cc1000-b6cc2000 rwxp b6cc1000 00:00 0\nb6cc2000-b6cc8000 r-xp 00000000 00:27 70166 /Soft/sybase/V12.5.1_32_14757/OCS-12_5/lib/libintl.so\nb6cc8000-b6cc9000 rwxp 00006000 00:27 70166 /Soft/sybase/V12.5.1_32_14757/OCS-12_5/lib/libintl.so\nb6cc9000-b6d1d000 r-xp 00000000 00:27 70165 /Soft/sybase/V12.5.1_32_14757/OCS-12_5/lib/libcomn.so\nb6d1d000-b6d26000 rwxp 00053000 00:27 70165 /Soft/sybase/V12.5.1_32_14757/OCS-12_5/lib/libcomn.so\nb6d26000-b6d2a000 rwxp b6d26000 00:00 0\nb6d2a000-b6d56000 r-xp 00000000 00:27 70160 /Soft/sybase/V12.5.1_32_14757/OCS-12_5/lib/libsybtcl.so\nb6d56000-b6d5a000 rwxp 0002b000 00:27 70160 /Soft/sybase/V12.5.1_32_14757/OCS-12_5/lib/libsybtcl.so\nb6d5a000-b6d5b000 rwxp b6d5a000 00:00 0\nb6d5b000-b6d67000 r-xp 00000000 00:27 70168 /Soft/sybase/V12.5.1_32_14757/OCS-12_5/lib/libcs.so\nb6d67000-b6d68000 rwxp 0000b000 00:27 70168 /Soft/sybase/V12.5.1_32_14757/OCS-12_5/lib/libcs.so\nb6d68000-b6dc5000 r-xp 00000000 00:27 70169 /Soft/sybase/V12.5.1_32_14757/OCS-12_5/lib/libct.so\nb6dc5000-b6dd1000 rwxp 0005c000 00:27 70169 /Soft/sybase/V12.5.1_32_14757/OCS-12_5/lib/libct.so\nb6dd1000-b6dd2000 rwxp b6dd1000 00:00 0\nb6dd2000-b6ded000 r-xp 00000000 fd:00 40245 /opt/mqm/lib/3.2/libimqc23gl_r.so\nb6ded000-b6df3000 rwxp 0001a000 fd:00 40245 /opt/mqm/lib/3.2/libimqc23gl_r.so\nb6df3000-b6df4000 rwxp b6df3000 00:00 0\nb6df9000-b6dfa000 rwxs 00000000 00:09 0 /SYSV83868006 (deleted)\nb6dfa000-b6dfb000 r-xp 00000000 fd:00 459612 /lib/libfipscheck.so.1.0.0\nb6dfb000-b6dfc000 rwxp 00000000 fd:00 459612 /lib/libfipscheck.so.1.0.0\nb6dfc000-b6dfd000 r-xp 00000000 fd:00 688966 /usr/lib/gconv/ISO8859-1.so\nb6dfd000-b6dff000 rwxp 00000000 fd:00 688966 /usr/lib/gconv/ISO8859-1.so\nb6dff000-b70af000 r-xp 00000000 00:26 184836 /Soft/fox_dev/redhat/dist/fx/libs/Qt/libQtCore.so.4\nb70af000-b70b8000 rwxp 002b0000 00:26 184836 /Soft/fox_dev/redhat/dist/fx/libs/Qt/libQtCore.so.4\nb70b8000-b70fe000 r-xp 00000000 00:26 186498 /Soft/fox_dev/redhat/dist/fx/libs/Qt/libQtXml.so.4\nb70fe000-b7100000 rwxp 00045000 00:26 186498 /Soft/fox_dev/redhat/dist/fx/libs/Qt/libQtXml.so.4\nb7100000-b723f000 r-xp 00000000 00:26 187416 /Soft/fox_dev/redhat/dist/fx/libs/Qt/libQtNetwork.so.4\nb723f000-b7244000 rwxp 0013e000 00:26 187416 /Soft/fox_dev/redhat/dist/fx/libs/Qt/libQtNetwork.so.4\nb7244000-b76bd000 r-xp 00000000 00:26 185561 /Soft/fox_dev/redhat/dist/fx/libs/Qt/libQtXmlPatterns.so.4\nb76bd000-b76de000 rwxp 00478000 00:26 185561 /Soft/fox_dev/redhat/dist/fx/libs/Qt/libQtXmlPatterns.so.4\nb76de000-b76df000 rwxp b76de000 00:00 0\nb76df000-b771d000 r-xp 00000000 00:26 183945 /Soft/fox_dev/redhat/dist/fx/libs/Qt/libQtSql.so.4\nb771d000-b771e000 rwxp 0003e000 00:26 183945 /Soft/fox_dev/redhat/dist/fx/libs/Qt/libQtSql.so.4\nb771e000-b771f000 rwxp b771e000 00:00 0\nb771f000-b79c1000 r-xp 00000000 00:26 185457 /Soft/fox_dev/redhat/dist/fx/libs/Qt/libQtScript.so.4\nb79c1000-b79cc000 rwxp 002a1000 00:26 185457 /Soft/fox_dev/redhat/dist/fx/libs/Qt/libQtScript.so.4\nb79cc000-b79dc000 rwxp b79cc000 00:00 0\nb79dc000-b7d38000 r-xp 00000000 00:26 578147 /Soft/fox_dev/xerces-c-3.1.1-x86-linux-gcc-3.4/lib/libxerces-c-3.1.so\nb7d38000-b7dcc000 rwxp 0035c000 00:26 578147 /Soft/fox_dev/xerces-c-3.1.1-x86-linux-gcc-3.4/lib/libxerces-c-3.1.so\nb7dcc000-b7dcd000 rwxp b7dcc000 00:00 0\nb7dcd000-b7eb1000 r-xp 00000000 00:26 514553 /Soft/fox_dev/boost/boost_bin/lib/libboost_regex.so.1.54.0\nb7eb1000-b7eb4000 rwxp 000e3000 00:26 514553 /Soft/fox_dev/boost/boost_bin/lib/libboost_regex.so.1.54.0\nb7eb4000-b7ebb000 r-xp 00000000 00:26 514381 /Soft/fox_dev/boost/boost_bin/lib/libboost_chrono.so.1.54.0\nb7ebb000-b7ebc000 rwxp 00006000 00:26 514381 /Soft/fox_dev/boost/boost_bin/lib/libboost_chrono.so.1.54.0\nb7ebc000-b7ebf000 r-xp 00000000 00:26 514342 /Soft/fox_dev/boost/boost_bin/lib/libboost_system.so.1.54.0\nb7ebf000-b7ec0000 rwxp 00002000 00:26 514342 /Soft/fox_dev/boost/boost_bin/lib/libboost_system.so.1.54.0\nb7ec0000-b7ec1000 rwxp b7ec0000 00:00 0\nb7ec1000-b7ec5000 r-xp 00000000 00:26 515549 /Soft/fox_dev/boost/boost_bin/lib/libboost_timer.so.1.54.0\nb7ec5000-b7ec6000 rwxp 00003000 00:26 515549 /Soft/fox_dev/boost/boost_bin/lib/libboost_timer.so.1.54.0\nb7ec6000-b7eca000 r-xp 00000000 00:26 180293 /Soft/fox_dev/redhat/dist/fx/lib/libMQ.so\nb7eca000-b7ecb000 rwxp 00004000 00:26 180293 /Soft/fox_dev/redhat/dist/fx/lib/libMQ.so\nb7ecb000-b7f30000 r-xp 00000000 00:26 167289 /Soft/fox_dev/redhat/dist/fx/lib/libfx.so\nb7f30000-b7f32000 rwxp 00064000 00:26 167289 /Soft/fox_dev/redhat/dist/fx/lib/libfx.so\nb7f32000-b7f33000 rwxp b7f32000 00:00 0\nb7f33000-b7f34000 r-xp b7f33000 00:00 0 [vdso]\nbfc3e000-bfc53000 rwxp bffe8000 00:00 0 [stack]\nbfc53000-bfc55000 rw-p bfffd000 00:00 0\n/Soft/fox_dev/redhat/env/Dev_FXA/bin/fxa_march.sh: line 28: 8322 Aborted ${FXA_ESP}/exe/fxa_march -b $1 -t $2 -p $3 -o $4 -m $5 -d $6 -e $7\nFin du fichier de fxa_march.sh : 10/02/14 09:24:19the lines about database open and Qtds scares me. Because there is very few I can do about that. It seems this driver/plugin is not very robust.EDITthis is my valgrind (partial) output on a simplified batch:(\"/Soft/fox_dev/Qt-4.7.4/plugins\", \"/Soft/fox_dev/redhat/dist/fxa/exe\")\n ==24089== Syscall param semctl(arg) points to uninitialised byte(s)\n ==24089== at 0x947DDE: semctl@@GLIBC_2.2 (in /lib/libc-2.5.so)\n ==24089== by 0x59B82B0: nss_vas3_semctl (in /opt/quest/lib/nss/libnss_vas3.so.2)\n ==24089== by 0x59B91A4: get_sem_id (in /opt/quest/lib/nss/libnss_vas3.so.2)\n ==24089== by 0x59B935A: get_tsd (in /opt/quest/lib/nss/libnss_vas3.so.2)\n ==24089== by 0x59B96AF: _nss_vas3_getXXent_get_tsd (in /opt/quest/lib/nss/libnss_vas3.so.2)\n ==24089== by 0x59BCF27: internal_nss_vas_getpwuid_r (in /opt/quest/lib/nss/libnss_vas3.so.2)\n ==24089== by 0x59BDD84: _nss_vas3_getpwuid_r (in /opt/quest/lib/nss/libnss_vas3.so.2)\n ==24089== by 0x9055A2: getpwuid_r@@GLIBC_2.1.2 (in /lib/libc-2.5.so)\n ==24089== by 0x597A60E: tds_get_homedir (in /Soft/fox_dev/redhat/dist/fx/libs/Qt/libsybdb.so.5)\n ==24089== by 0x596C048: tds_get_home_file (in /Soft/fox_dev/redhat/dist/fx/libs/Qt/libsybdb.so.5)\n ==24089== by 0x596C232: tds_read_conf_file (in /Soft/fox_dev/redhat/dist/fx/libs/Qt/libsybdb.so.5)\n ==24089== by 0x596B498: tds_read_config_info (in /Soft/fox_dev/redhat/dist/fx/libs/Qt/libsybdb.so.5)\n ==24089== Address 0xbe93d0a0 is on thread 1's stack\n ==24089==\n ==24089== Thread 2:\n ==24089== Syscall param semctl(arg) points to uninitialised byte(s)\n ==24089== at 0x947DDE: semctl@@GLIBC_2.2 (in /lib/libc-2.5.so)\n ==24089== by 0x59B82B0: nss_vas3_semctl (in /opt/quest/lib/nss/libnss_vas3.so.2)\n ==24089== by 0x59B9411: get_tsd (in /opt/quest/lib/nss/libnss_vas3.so.2)\n ==24089== by 0x59B96AF: _nss_vas3_getXXent_get_tsd (in /opt/quest/lib/nss/libnss_vas3.so.2)\n ==24089== by 0x59BCF27: internal_nss_vas_getpwuid_r (in /opt/quest/lib/nss/libnss_vas3.so.2)\n ==24089== by 0x59BDD84: _nss_vas3_getpwuid_r (in /opt/quest/lib/nss/libnss_vas3.so.2)\n ==24089== by 0x9055A2: getpwuid_r@@GLIBC_2.1.2 (in /lib/libc-2.5.so)\n ==24089== by 0x597A60E: tds_get_homedir (in /Soft/fox_dev/redhat/dist/fx/libs/Qt/libsybdb.so.5)\n ==24089== by 0x596C048: tds_get_home_file (in /Soft/fox_dev/redhat/dist/fx/libs/Qt/libsybdb.so.5)\n ==24089== by 0x596C232: tds_read_conf_file (in /Soft/fox_dev/redhat/dist/fx/libs/Qt/libsybdb.so.5)\n ==24089== by 0x596B498: tds_read_config_info (in /Soft/fox_dev/redhat/dist/fx/libs/Qt/libsybdb.so.5)\n ==24089== by 0x593F5EE: tdsdbopen (in /Soft/fox_dev/redhat/dist/fx/libs/Qt/libsybdb.so.5)\n ==24089== Address 0x7532d50 is on thread 2's stack\n ==24089==\n ==24089== Conditional jump or move depends on uninitialised value(s)\n ==24089== at 0x5286AA3: rriCopyChannelExits (in /opt/mqm/lib/libmqiz_r.so)\n ==24089== by 0x52BEA8B: ConvertMQCD (in /opt/mqm/lib/libmqiz_r.so)\n ==24089== by 0x52AF797: DoConnect (in /opt/mqm/lib/libmqiz_r.so)\n ==24089== by 0x52AE5EC: zstMQCONNX (in /opt/mqm/lib/libmqiz_r.so)\n ==24089== by 0x4FFE7C6: MQCONNX (in /opt/mqm/lib/libmqic_r.so)\n ==24089== by 0x4E9C212: ImqMgr::connect() (in /opt/mqm/lib/3.2/libimqc23gl_r.so)\n ==24089== by 0x4075E07: MQConnection::connect(MQAccessType, std::string&) (in /Soft/fox_dev/redhat/dist/fx/lib/libMQ.so)\n ==24089== by 0x80614BA: reports::sendToQueue() (reports.cpp:611)\n ==24089== by 0x8068152: reports::run() (reports.cpp:761)\n ==24089== by 0x80A9644: reportGroup::run() (reportgroup.cpp:16)\n ==24089== by 0x4C2AE0E: ??? (in /Soft/fox_dev/Qt-4.7.4/lib/libQtCore.so.4.7.4)\n ==24089== by 0x4C375F1: ??? (in /Soft/fox_dev/Qt-4.7.4/lib/libQtCore.so.4.7.4)\n ==24089==\n ==24089== Conditional jump or move depends on uninitialised value(s)\n ==24089== at 0x5286AF0: rriCopyChannelExits (in /opt/mqm/lib/libmqiz_r.so)\n ==24089== by 0x52BEA8B: ConvertMQCD (in /opt/mqm/lib/libmqiz_r.so)\n ==24089== by 0x52AF797: DoConnect (in /opt/mqm/lib/libmqiz_r.so)\n ==24089== by 0x52AE5EC: zstMQCONNX (in /opt/mqm/lib/libmqiz_r.so)\n ==24089== by 0x4FFE7C6: MQCONNX (in /opt/mqm/lib/libmqic_r.so)\n ==24089== by 0x4E9C212: ImqMgr::connect() (in /opt/mqm/lib/3.2/libimqc23gl_r.so)\n ==24089== by 0x4075E07: MQConnection::connect(MQAccessType, std::string&) (in /Soft/fox_dev/redhat/dist/fx/lib/libMQ.so)\n ==24089== by 0x80614BA: reports::sendToQueue() (reports.cpp:611)\n ==24089== by 0x8068152: reports::run() (reports.cpp:761)\n ==24089== by 0x80A9644: reportGroup::run() (reportgroup.cpp:16)\n ==24089== by 0x4C2AE0E: ??? (in /Soft/fox_dev/Qt-4.7.4/lib/libQtCore.so.4.7.4)\n ==24089== by 0x4C375F1: ??? (in /Soft/fox_dev/Qt-4.7.4/lib/libQtCore.so.4.7.4)\n ==24089==\n ==24089== Conditional jump or move depends on uninitialised value(s)\n ==24089== at 0x5286B37: rriCopyChannelExits (in /opt/mqm/lib/libmqiz_r.so)\n ==24089== by 0x52BEA8B: ConvertMQCD (in /opt/mqm/lib/libmqiz_r.so)\n ==24089== by 0x52AF797: DoConnect (in /opt/mqm/lib/libmqiz_r.so)\n ==24089== by 0x52AE5EC: zstMQCONNX (in /opt/mqm/lib/libmqiz_r.so)\n ==24089== by 0x4FFE7C6: MQCONNX (in /opt/mqm/lib/libmqic_r.so)\n ==24089== by 0x4E9C212: ImqMgr::connect() (in /opt/mqm/lib/3.2/libimqc23gl_r.so)\n ==24089== by 0x4075E07: MQConnection::connect(MQAccessType, std::string&) (in /Soft/fox_dev/redhat/dist/fx/lib/libMQ.so)\n ==24089== by 0x80614BA: reports::sendToQueue() (reports.cpp:611)\n ==24089== by 0x8068152: reports::run() (reports.cpp:761)\n ==24089== by 0x80A9644: reportGroup::run() (reportgroup.cpp:16)\n ==24089== by 0x4C2AE0E: ??? (in /Soft/fox_dev/Qt-4.7.4/lib/libQtCore.so.4.7.4)\n ==24089== by 0x4C375F1: ??? (in /Soft/fox_dev/Qt-4.7.4/lib/libQtCore.so.4.7.4)\n ==24089==\n ==24089== Syscall param write(buf) points to uninitialised byte(s)\n ==24089== at 0x9F644B: ??? (in /lib/libpthread-2.5.so)\n ==24089== by 0x5270CCF: ccxSend (in /opt/mqm/lib/libmqiz_r.so)\n ==24089== by 0x52A8BA0: rriInitSess (in /opt/mqm/lib/libmqiz_r.so)\n ==24089== by 0x52AF968: DoConnect (in /opt/mqm/lib/libmqiz_r.so)\n ==24089== by 0x52AE5EC: zstMQCONNX (in /opt/mqm/lib/libmqiz_r.so)\n ==24089== by 0x4FFE7C6: MQCONNX (in /opt/mqm/lib/libmqic_r.so)\n ==24089== by 0x4E9C212: ImqMgr::connect() (in /opt/mqm/lib/3.2/libimqc23gl_r.so)\n ==24089== by 0x4075E07: MQConnection::connect(MQAccessType, std::string&) (in /Soft/fox_dev/redhat/dist/fx/lib/libMQ.so)\n ==24089== by 0x80614BA: reports::sendToQueue() (reports.cpp:611)\n ==24089== by 0x8068152: reports::run() (reports.cpp:761)\n ==24089== by 0x80A9644: reportGroup::run() (reportgroup.cpp:16)\n ==24089== by 0x4C2AE0E: ??? (in /Soft/fox_dev/Qt-4.7.4/lib/libQtCore.so.4.7.4)\n ==24089== Address 0x65113af is 159 bytes inside a block of size 32,810 alloc'd\n ==24089== at 0x4007100: malloc (vg_replace_malloc.c:270)\n ==24089== by 0x50837AB: xcsGetMem (in /opt/mqm/lib/libmqmcs_r.so)\n ==24089== by 0x527C174: cccGetMem (in /opt/mqm/lib/libmqiz_r.so)\n ==24089== by 0x7D427FB: cciTcpAllocMem (in /opt/mqm/lib/amqcctca_r)\n ==24089== by 0x5276698: ccxAllocMem (in /opt/mqm/lib/libmqiz_r.so)\n ==24089== by 0x52A883C: rriInitSess (in /opt/mqm/lib/libmqiz_r.so)\n ==24089== by 0x52AF968: DoConnect (in /opt/mqm/lib/libmqiz_r.so)\n ==24089== by 0x52AE5EC: zstMQCONNX (in /opt/mqm/lib/libmqiz_r.so)\n ==24089== by 0x4FFE7C6: MQCONNX (in /opt/mqm/lib/libmqic_r.so)\n ==24089== by 0x4E9C212: ImqMgr::connect() (in /opt/mqm/lib/3.2/libimqc23gl_r.so)\n ==24089== by 0x4075E07: MQConnection::connect(MQAccessType, std::string&) (in /Soft/fox_dev/redhat/dist/fx/lib/libMQ.so)\n ==24089== by 0x80614BA: reports::sendToQueue() (reports.cpp:611)\n ==24089==\n ==24089== Thread 1:\n ==24089== Invalid free() / delete / delete[] / realloc()\n ==24089== at 0x4006B0D: free (vg_replace_malloc.c:446)\n ==24089== by 0x985D2D: free_mem (in /lib/libc-2.5.so)\n ==24089== by 0x9858A6: __libc_freeres (in /lib/libc-2.5.so)\n ==24089== by 0x4001468: _vgnU_freeres (vg_preloaded.c:62)\n ==24089== by 0x9065A3: _Exit (in /lib/libc-2.5.so)\n ==24089== by 0x88AE93: (below main) (in /lib/libc-2.5.so)\n ==24089== Address 0x4fc07a0 is not stack'd, malloc'd or (recently) free'dBasically My mq lib from ibm and my sybase TDS driver are doing crap ?\nI checked \"my calls\" nearly everything is build on the stack locally inside one function or another.### Assistant: If you're accessing the database driver from multiple threads, then the problem is likely in the driver, and there are two solutions:Protect all accesses to the driver by a mutex. Ideally, create a wrapper class for database access that enforces this.Create multiple instances of the driver, one per each thread.A connection can only be used from within the thread that created it. Moving connections between threads or creating queries from a different thread is not supported.This means that you cannot usecloneDatabasein one thread, and use the cloned connection in another thread. You must create and then open a fresh, independent connection, by code running in the thread where you wish to use that connection.You must be also very careful that whatever implicitly shared classes you pass to the threads are in fact separate instances.It is a bugif they are references, const references, or pointers. Seethis answerfor details.\n"} +{"text": "### Human: I am using java API to interact with MQ.When I try to get a message from an empty queue, I get exception.Ok, but when I control it with try catch, I am expecting not prompted any error message in console.but I get!!try {\n queue.get(getMessage, new MQGetMessageOptions());\n return getMessage.readUTF();\n} catch (Exception e) {\n return \"\";\n}get in console as \"MQJE001: Completion Code '2', Reason '2033'.\"How can I disable this information output?how can I check message availability or current queue size?\nThanks### Assistant: First question: How can I disable this information output? \nThis link might help:Hide Java OutputSecond question: How can I check message availability or current queue size?MQQueue.getCurrentDepth() method will get you the current queue size. But you must note that this may not represent the correct queue depth at all times as messages could be consumed by other applications from the same queue. Actually you should not worry about queue depth. It is best practice to keep consuming messages and handle 2033 (MQJE001: MQRC_NO_MSG_AVAILABLE) exception which is thrown when there are no messages in the queue in your application.\n"} +{"text": "### Human: I have simple IBM MQ application: there are 2 queues -> one receive queue and obviously another one is send queue. Now I put a large number messages into receive queue and while the application is processing the messages, I pause the MQ core process using SIGSTOP.Should the message flow stop immediately? This is what is happening in my case:The application can receive all the messages and push them to the send queue after processing. Now if I try push further messages into receive queue, the MQ putter (a sample utility program) cannot push the messages which is usual.My question is: how should MQ behave in this case? Should the message flow not stop immediately after SIGSTOP signal? My application program does not catch any exception also.Any answer would be helpful.### Assistant: The short answer is that nobody can tell you how WMQ is supposed to behave in this situation because OMG, DON'T DO THAT!Someone asked a similar question lately on the list server. Andrew Hickson of the WMQ development team responded thus:Sending a STOP signal to an MQ server side application is dangerous\n enough, but sending a STOP signal to an MQ process (e.g amqrmppa)\n would be extremely dangerous. If that process happened to own an inter\n process lock at the time the STOP signal arrived the entire queue\n manager could easily grind to a halt. The same issue does arise for a\n 'simple' server side application (for example queue manager scope\n locks are obtained/released during MQCONN processing), but the scope\n for inadvertently stopping the queue manager is much greater with an\n MQ internal process.The obvious question here is what do you consider to be \"the MQ core process\"? The controller? One of the agent processes? They are all intercommunicating and there is no single process that represents \"the QMgr.\"If you need to interrupt processing, use the WMQ facilities such as disabling PUT or GET on the queue, terminating the connection to the QMgr, etc.\n"} +{"text": "### Human: I need to hook up a Multi-instance queue manager on a Tomcat server. I have found all kinds of \"properties\" that I have to set to do it, but where do they go? Tomcat, in the server XML has some settings but most of the settings needed in the IBM documentation do not map. Currently we have hooked up a \"single\" instance queue like this:How do I hook up a multi-instance one? AND, Can I still use the SpringDefaultMessageListenerContainer? AND (o man...) what settings do I need?### Assistant: I don't have much of Tomcat knowledge but I come from WebSphere MQ background. Looking at the Context you provided, I think the below would work for Multi-instance queue manager.I am setting CRHOSTS to multiple connection names. I am assuming, on blah.blah.com host, active instance of queue manager runs and listens at port 1414 and standby instance runs on b2.b3.com and listens at port 1544.CROPT is reconnect option and is set toWMQ_CLIENT_RECONNECT_Q_MGRwhose value is 67108864. You can find the value of these constants fromcmqc.hfile.CRT is the reconnection timeout value which tells, for how long the client will try to reconnect. After the timeout period, client stops reconnecting if a connection attempt was not successful. In this case I have set the value to 500 seconds.Hope this helps.\n"} +{"text": "### Human: I\u2019m new to MQ. I have successfully installed WebSphere MQ, setup the queue managers, queues and channels between the queue managers. I have set up agents and I can start, stop and successfully ping the agents but the agents are not listed as shown on the attached screen shot. I have been trying to make the agents work so that I can test file transfer and set it up in our environment.\nI even tried to create new coordination and command queue managers and no luck. I even tried the fteListAgents -p (coordination queue manager) and -v\nI will really appreciate all the help I can get.### Assistant: What is the user id you are logged into machine as? Is itAdministrator(on Windows)? If so you may be hitting the 12 character user id issue. Administrator is 13 character long and the 'r' at the end may be getting chopped off. I recommend you to look at this troubleshootinglink.\n"} +{"text": "### Human: My Below is the code works good with MQ6 but for MQ7 its giving exception'package javaapplication1;\n\nimport java.io.*;\nimport java.net.*;\nimport java.util.*;\nimport java.util.TimerTask;\n import com.ibm.mq.MQEnvironment;\nimport com.ibm.mq.MQException;\n import com.ibm.mq.MQQueue;\n import com.ibm.mq.MQQueueManager;\n import com.ibm.mq.constants.CMQC;\nclass Connectivity \n{\n public static void main(String args[]) throws MQException\n {\n String qManager=\"\";\n int port_num=0;\n int openOptions = CMQC.MQOO_FAIL_IF_QUIESCING + CMQC.MQOO_INPUT_SHARED;\n\n MQEnvironment.hostname = \"Host_name\";\n MQEnvironment.port = port_num;\n MQEnvironment.channel = \"Chn_name\";\n System.out.println(\"Connecting to queue manager: \" + qManager);\n Hashtable props = new Hashtable();\n\n // Change the host name to your host name. Leave it as it is if \n // queue manager is on the same machine\n props.put(CMQC.HOST_NAME_PROPERTY, \"Host_name\"); \n props.put(CMQC.PORT_PROPERTY, port_num);\n props.put(CMQC.CHANNEL_PROPERTY, \"Chn_Name\");\n\n MQQueueManager qMgr = new MQQueueManager(qManager, props);\n //MQQueueManager qMgr = new MQQueueManager(\"SW1_QM\");\n\n MQQueue destQueue = qMgr.accessQueue(\"Q_Name\", openOptions);\n\n System.out.println(\"E_RETRY size:\" + destQueue.getCurrentDepth());\n destQueue.close();\n qMgr.disconnect();\n }\n\n\n}'I get exception on the line'System.out.println(\"E_RETRY size:\" + destQueue.getCurrentDepth());'and the exception message is'MQJE001: Completion Code 1, Reason 2068\nException in thread \"main\" com.ibm.mq.MQException: MQJE001: Completion Code 1, Reason 2068\n at com.ibm.mq.MQManagedObject.inquire(MQManagedObject.java:257)\n at com.ibm.mq.MQManagedObject.getInt(MQManagedObject.java:428)\n at com.ibm.mq.MQQueue.getCurrentDepth(MQQueue.java:1478)\n at javaapplication1.Connectivity.main(Connectivity.java:36)\nJava Result: 1'Kindly help me..### Assistant: Your open option does not includeMQOO_INQUIREwhich is a must for getting queue depth. I expected a MQRC 2038 because MQOO_INQUIRE option was not specified.Not sure why you are initializing MQEnvironment also and you are passing a properties hash table to MQQueueManager constructor.Anyway here is the sample code that gets queue depth for a local queue.public static void getQueueDepth()\n{\n String qManager=\"QM1\";\n int port_num=1414;\n int openOptions = CMQC.MQOO_FAIL_IF_QUIESCING + CMQC.MQOO_INPUT_SHARED + CMQC.MQOO_INQUIRE;\n\n try {\n Hashtable props = new Hashtable();\n\n props.put(CMQC.HOST_NAME_PROPERTY, \"localhost\"); \n props.put(CMQC.PORT_PROPERTY, port_num);\n props.put(CMQC.CHANNEL_PROPERTY, \"SYSTEM.DEF.SVRCONN\");\n\n MQQueueManager qMgr = new MQQueueManager(qManager, props);\n\n MQQueue destQueue = qMgr.accessQueue(\"SYSTEM.DEFAULT.LOCAL.QUEUE\", openOptions);\n\n System.out.println(\"E_RETRY size:\" + destQueue.getCurrentDepth());\n destQueue.close();\n qMgr.disconnect();\n }catch(MQException mqe){\n System.out.println(mqe);\n }\n}\n"} +{"text": "### Human: We are have a IBM websphere MQ[v5.2] on AIX platform and my machine is windows 7 pro which has MQ client v7.5.I tried to connect to server remotely but i received aAuthorizationerror message. This is because my local user account does have rights to connect to queue manager remotely.So,i created a new user account in my system with some name as on server which has rights to put/get message and now i am able to connect in client mode[Websphere MQ v7.5].I don't know whether it is actually connecting to server but it is not giving me authorization error message so i took it as success. But the issue is, when I tried to put message into queue from cmd usingamqsputc Queue_name mqmthe queue is opening and taking a message. But when i tried to get the message using commandamqsgetc queue_name mqmit says \"NO MORE MESSAGE\".What could be the issue?Screen shot:### Assistant: The fact the amqsputc doesnt give an error, and the fact the amqsgetc runs through to success implies the functionality is working. However, it finds nothing on the queue which makes me very suspicious that you have an application listening on that queue, which will consume the message as it arrives and hence before your amqsgetc. Check DISPLAY QSTATUS in runmqsc for IPPROCS on the queue - is it 0 when amqsgetc isnt running?\n"} +{"text": "### Human: I have developed a java application that reads MQ queue, now I want to make the ssl connection, I have no idea on trust store and keystore, could any one please help me on this.I am using Websphere MQ on solaris which donot have any gui to create keys etc, I need to use commands. any one having idea on this please help me out.### Assistant: Does the solaris qmgr comes with KeyMan package installed?You can install the windows MQ client on your desktop. That comes with a IBM key management tool (if you are looking for a GUI) which can create the keystores for you. make sure to select the option to dump the password to the stash file. Alternatively, you can use the gsk7cmd/gsk8capicmd/ikeyman command line tools.http://www-01.ibm.com/support/docview.wss?uid=swg21006430You will need two keystores, one for the qmgr and another for the application.The qmgr's keystore should have a personal certificate named ibmwebspheremq. The keystore files (kdb, sth, crl, rdb) should be copied to the dir /var/mqm/qmgrs//ssl. The qmgr properties SSLKEYR should be set as /var/mqm/qmgrs//ssl/\nQmgr should be restarted.If you are going for personal certificates, the qmgr keystore needs to be signed with the application certificate and vice versa.The application keystore should have a personal certificate named ibmwebspheremq. Normally for nonjava environments, the application_name should match the running user id.You can set the SSL keystore in the application programatically or use a client channel definition table. Make sure the SVRCONN channel and CLNTCONN channel SSL parameters are set (SSLCIPH, SSLCAUTH, SSLPEER, )I suggest reading the MQ clients manual (http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=%2Fcom.ibm.mq.csqzaf.doc%2Fcs10120_.htm) and MQ java manual (http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzaw.doc/uj10120_.htm) as this is a complex topic with variety of options to be answered in one go.Read T.Rob's answer's to troubleshoot ssl connections. Generally look for his posts, they have wealth of information and well explained.Connecting to a Websphere MQ in Java with SSL/Keystorehttps://stackoverflow.com/search?q=user%3A214668+ssl\n"} +{"text": "### Human: What kind of database does websphere MQ come with? A DB2 db? or a local file system based db. It needs to have some form of persistent storage because if it receives a message on the queue and the listeners are down then it needs to persist the message until the listeners are back up.### Assistant: AFAIK, on distributed systems, WMQ uses a proprietary storage format for both the rolling transaction logs and the safe-store queue files. IBM does not release any information regarding these files, as the formats and contents are subject to chance without notice between releases and versions as necessary to support new features and functions.Someone else can provide similar information for z/OS systems.\n"} +{"text": "### Human: I upgraded my previous MQ V6.0 to MQ 7.0 a few days ago. But once upgrade completed, MQ Explorer can not display local QMGR in the Queue Manages. I have to add local QMGR through \"Add Remote Queue Manager\" and it works fine.I just wonder why that local QMGR cannot be shown in the MQ Explorer.Thanks in advance### Assistant: Open a Command Prompt and run the following command:strmqcfg -c\n"} +{"text": "### Human: I have read many articles according to my issue, but I stiil have no solution.When I try to create connection to WebSpereMQ I getMQJE001: An MQException occurred: Completion Code 2, Reason 2009\nMQJE016: MQ queue manager closed channel immediately during connect\nClosure reason = 2009After reading different articles I tried to change CCSID by doingMQEnvironment.properties.put(MQC.CCSID_PROPERTY, 1208); \n// also tried other CCSIDs like 1200,819,500but I had no success. Than I read that a good idea is to look at MQ log files to find out if there is another process wich interrupt the connection. But I am not able to investigate that log files since they are encoded and I don't how to read them.Questions:\n1) Do you know how to read MQ logs? How to make them readable?\n2) Do you know what else could cause that kind of problem?Logs from file AMQERR01.txt :----- amqxfdcp.c : 773 --------------------------------------------------------\n04.07.2013 10:41:01 - Process(2880.3) User(Anton.Kasianchuk) Program(javaw.exe)\nAMQ6118: An internal WebSphere MQ error has occurred (20806211)\n\nEXPLANATION:\nAn error has been detected, and the MQ error recording routine has been called.\nACTION:\nUse the standard facilities supplied with your system to record the problem\nidentifier, and to save the generated output files. Contact your IBM support\ncenter. Do not discard these files until the problem has been resolved. \n----- amqxfdcp.c : 735 --------------------------------------------------------\n04.07.2013 10:41:01 - Process(2880.3) User(Anton.Kasianchuk) Program(javaw.exe)\nAMQ6184: An internal WebSphere MQ error has occurred on queue manager MMSG01Q2.\n\nEXPLANATION:\nAn error has been detected, and the WebSphere MQ error recording routine has\nbeen called. The failing process is process 2880.\nACTION:\nUse the standard facilities supplied with your system to record the problem\nidentifier, and to save the generated output files. Contact your IBM support\ncenter. Do not discard these files until the problem has been resolved. \n----- amqxfdcp.c : 773 --------------------------------------------------------\n04.07.2013 10:41:05 - Process(2880.1) User(Anton.Kasianchuk) Program(javaw.exe)\nAMQ6118: An internal WebSphere MQ error has occurred (20806211)\n\nEXPLANATION:\nAn error has been detected, and the MQ error recording routine has been called.\nACTION:\nUse the standard facilities supplied with your system to record the problem\nidentifier, and to save the generated output files. Contact your IBM support\ncenter. Do not discard these files until the problem has been resolved. \n----- amqxfdcp.c : 735 --------------------------------------------------------\n04.07.2013 10:41:05 - Process(2880.1) User(Anton.Kasianchuk) Program(javaw.exe)\nAMQ6184: An internal WebSphere MQ error has occurred on queue manager MMSG01Q2.\n\nEXPLANATION:\nAn error has been detected, and the WebSphere MQ error recording routine has\nbeen called. The failing process is process 2880.\nACTION:\nUse the standard facilities supplied with your system to record the problem\nidentifier, and to save the generated output files. Contact your IBM support\ncenter. Do not discard these files until the problem has been resolved. \n----- amqxfdcp.c : 773 --------------------------------------------------------\n04.07.2013 10:41:05 - Process(2880.1) User(Anton.Kasianchuk) Program(javaw.exe)\nAMQ6118: An internal WebSphere MQ error has occurred (20806211)\n\nEXPLANATION:\nAn error has been detected, and the MQ error recording routine has been called.\nACTION:\nUse the standard facilities supplied with your system to record the problem\nidentifier, and to save the generated output files. Contact your IBM support\ncenter. Do not discard these files until the problem has been resolved. \n----- amqxfdcp.c : 735 --------------------------------------------------------\n04.07.2013 10:41:05 - Process(2880.1) User(Anton.Kasianchuk) Program(javaw.exe)\nAMQ6184: An internal WebSphere MQ error has occurred on queue manager MMSG01Q2.\n\nEXPLANATION:\nAn error has been detected, and the WebSphere MQ error recording routine has\nbeen called. The failing process is process 2880.\nACTION:\nUse the standard facilities supplied with your system to record the problem\nidentifier, and to save the generated output files. Contact your IBM support\ncenter. Do not discard these files until the problem has been resolved. \n----- amqxfdcp.c : 773 --------------------------------------------------------\n04.07.2013 10:41:05 - Process(2880.1) User(Anton.Kasianchuk) Program(javaw.exe)\nAMQ6118: An internal WebSphere MQ error has occurred (20806211)\n\nEXPLANATION:\nAn error has been detected, and the MQ error recording routine has been called.\nACTION:\nUse the standard facilities supplied with your system to record the problem\nidentifier, and to save the generated output files. Contact your IBM support\ncenter. Do not discard these files until the problem has been resolved. \n----- amqxfdcp.c : 735 --------------------------------------------------------\n04.07.2013 10:41:05 - Process(2880.1) User(Anton.Kasianchuk) Program(javaw.exe)\nAMQ6184: An internal WebSphere MQ error has occurred on queue manager MMSG01Q2.\n\nEXPLANATION:\nAn error has been detected, and the WebSphere MQ error recording routine has\nbeen called. The failing process is process 2880.\nACTION:\nUse the standard facilities supplied with your system to record the problem\nidentifier, and to save the generated output files. Contact your IBM support\ncenter. Do not discard these files until the problem has been resolved. \n----- amqxfdcp.c : 773 --------------------------------------------------------\n04.07.2013 10:41:05 - Process(2880.1) User(Anton.Kasianchuk) Program(javaw.exe)\nAMQ6118: An internal WebSphere MQ error has occurred (20806211)\n\nEXPLANATION:\nAn error has been detected, and the MQ error recording routine has been called.\nACTION:\nUse the standard facilities supplied with your system to record the problem\nidentifier, and to save the generated output files. Contact your IBM support\ncenter. Do not discard these files until the problem has been resolved. \n----- amqxfdcp.c : 735 --------------------------------------------------------\n04.07.2013 10:41:05 - Process(2880.1) User(Anton.Kasianchuk) Program(javaw.exe)\nAMQ6184: An internal WebSphere MQ error has occurred on queue manager MMSG01Q2.\n\nEXPLANATION:\nAn error has been detected, and the WebSphere MQ error recording routine has\nbeen called. The failing process is process 2880.\nACTION:\nUse the standard facilities supplied with your system to record the problem\nidentifier, and to save the generated output files. Contact your IBM support\ncenter. Do not discard these files until the problem has been resolved. \n----- amqxfdcp.c : 773 --------------------------------------------------------\n04.07.2013 10:45:41 - Process(3192.1) User(Anton.Kasianchuk) Program(crtmqm.exe)\nAMQ6119: An internal WebSphere MQ error has occurred (Failed to create mapped\nmemory segment: [rc=536895769 errorCode=5])\n\nEXPLANATION:\nMQ detected an unexpected error when calling the operating system. The MQ error\nrecording routine has been called.\nACTION:\nUse the standard facilities supplied with your system to record the problem\nidentifier, and to save the generated output files. Contact your IBM support\ncenter. Do not discard these files until the problem has been resolved. \n----- amqxfdcp.c : 735 --------------------------------------------------------\n04.07.2013 10:45:41 - Process(3192.1) User(Anton.Kasianchuk) Program(crtmqm.exe)\nAMQ6183: An internal WebSphere MQ error has occurred.\n\nEXPLANATION:\nAn error has been detected, and the WebSphere MQ error recording routine has\nbeen called. The failing process is process 3192.\nACTION:\nUse the standard facilities supplied with your system to record the problem\nidentifier, and to save the generated output files. Contact your IBM support\ncenter. Do not discard these files until the problem has been resolved. \n----- amqxfdcp.c : 779 --logs from file amqtsivt.txt10:45:39 IVT Started\n\n10:45:41 Setup IVT Environment...\n\n10:45:41 Creating Queue Manager...\n\n10:45:42 Starting Queue Manager...\n\n10:45:42 Ready.\n\n10:45:42 Connect to QueueManager(1), CC:2 - RC:2058\n\n10:45:42 Connect to QueueManager(2), CC:2 - RC:2058\n\n10:45:42 Open queue, CC:2 - RC:2018\n\n10:45:42 Put Message, CC:2 - RC:2018\n\n10:45:42 Message Put: AMQMTSIVT\n\n10:45:42 Get Message, CC:2 - RC:2018\n\n10:45:42 Message Returned: \n\n10:45:42 Close queue, CC:2 - RC:2018\n\n10:45:42 Started thread 01\n\n10:45:42 MQOpen in Child Thread, CC:2 - RC:2018\n\n10:45:42 MQPut in Child Thread, CC:2 - RC:2018\n\n10:45:42 MQGet in Child Thread, CC:2 - RC:2018\n\n10:45:42 MQClose in Child Thread, CC:2 - RC:2018\n\n10:45:42 Child Thread finished 43 cycles\n\n10:45:43 Started thread 02\n\n10:45:43 MQOpen in Child Thread, CC:2 - RC:2018\n\n10:45:43 MQPut in Child Thread, CC:2 - RC:2018\n\n10:45:43 MQGet in Child Thread, CC:2 - RC:2018\n\n10:45:43 MQClose in Child Thread, CC:2 - RC:2018\n\n10:45:43 Child Thread finished 46 cycles\n\n10:45:44 Started thread 03\n\n10:45:44 MQOpen in Child Thread, CC:2 - RC:2018\n\n10:45:44 MQPut in Child Thread, CC:2 - RC:2018\n\n10:45:44 MQGet in Child Thread, CC:2 - RC:2018\n\n10:45:44 MQClose in Child Thread, CC:2 - RC:2018\n\n10:45:44 Child Thread finished 49 cycles\n\n10:45:45 Started thread 04\n\n10:45:45 MQOpen in Child Thread, CC:2 - RC:2018\n\n10:45:45 MQPut in Child Thread, CC:2 - RC:2018\n\n10:45:45 MQGet in Child Thread, CC:2 - RC:2018\n\n10:45:45 MQClose in Child Thread, CC:2 - RC:2018\n\n10:45:45 Child Thread finished 3 cycles\n\n10:45:45 Started thread 05\n\n10:45:45 MQOpen in Child Thread, CC:2 - RC:2018\n\n10:45:45 MQPut in Child Thread, CC:2 - RC:2018\n\n10:45:45 MQGet in Child Thread, CC:2 - RC:2018\n\n10:45:45 MQClose in Child Thread, CC:2 - RC:2018\n\n10:45:45 Child Thread finished 3 cycles\n\n10:45:45 Started thread 06\n\n10:45:45 MQOpen in Child Thread, CC:2 - RC:2018\n\n10:45:45 MQPut in Child Thread, CC:2 - RC:2018\n\n10:45:45 MQGet in Child Thread, CC:2 - RC:2018\n\n10:45:45 MQClose in Child Thread, CC:2 - RC:2018\n\n10:45:45 Child Thread finished 3 cycles\n\n10:45:45 Started thread 07\n\n10:45:45 MQOpen in Child Thread, CC:2 - RC:2018\n\n10:45:45 MQPut in Child Thread, CC:2 - RC:2018\n\n10:45:45 MQGet in Child Thread, CC:2 - RC:2018\n\n10:45:45 MQClose in Child Thread, CC:2 - RC:2018\n\n10:45:45 Child Thread finished 3 cycles\n\n10:45:45 Started thread 08\n\n10:45:45 MQOpen in Child Thread, CC:2 - RC:2018\n\n10:45:45 MQPut in Child Thread, CC:2 - RC:2018\n\n10:45:45 MQGet in Child Thread, CC:2 - RC:2018\n\n10:45:45 MQClose in Child Thread, CC:2 - RC:2018\n\n10:45:45 Child Thread finished 3 cycles\n\n10:45:46 Started thread 09\n\n10:45:46 MQOpen in Child Thread, CC:2 - RC:2018\n\n10:45:46 MQPut in Child Thread, CC:2 - RC:2018\n\n10:45:46 MQGet in Child Thread, CC:2 - RC:2018\n\n10:45:46 MQClose in Child Thread, CC:2 - RC:2018\n\n10:45:46 Child Thread finished 6 cycles\n\n10:45:47 User cancelled action\n\n10:45:47 Started thread 10\n\n10:45:47 MQOpen in Child Thread, CC:2 - RC:2018\n\n10:45:47 MQPut in Child Thread, CC:2 - RC:2018\n\n10:45:47 MQGet in Child Thread, CC:2 - RC:2018\n\n10:45:47 MQClose in Child Thread, CC:2 - RC:2018\n\n10:45:47 Child Thread finished 9 cycles\n\n10:45:48 Error(s) encountered during thread execution\n\n10:45:48 All threads terminated\n\n10:45:48 Disconnect from QueueManager (1), CC:2 - RC:2018\n\n10:45:48 Disconnect from QueueManager (2), CC:2 - RC:2018\n\n10:45:48 Ready.\n\n10:45:49 Cleaning Up...\n\n10:45:49 Deleting MTS Package\n\n10:45:49 Access MTS Admin Catalog, OK\n\n10:45:52 Get MTS Packages, OK\n\n10:45:52 Ending Queue Manager...\n\n10:45:52 Deleting Queue Manager...\n\n10:45:53 Ready.logs from \\Qmgrs\\MMSG01Q2\\errors\\AMQERR01.txt----- amqrmrsa.c : 468 --------------------------------------------------------\n05.07.2013 09:41:10 - Process(6004.21) User(j2mquser) Program(amqrmppa.exe)\nAMQ9502: Type of channel not suitable for action requested.\n\nEXPLANATION:\nThe operation requested cannot be performed on channel 'CLOUD.MMSG01Q2.S1'.\nSome operations are only valid for certain channel types. For example, you can\nonly ping a channel from the end sending the message.\nACTION:\nCheck whether the channel name is specified correctly. If it is check that the\nchannel has been defined correctly. \n----- amqrmsaa.c : 1072 -------------------------------------------------------\n05.07.2013 09:41:10 - Process(6004.21) User(j2mquser) Program(amqrmppa.exe)\nAMQ9999: Channel program ended abnormally.\n\nEXPLANATION:\nChannel program 'CLOUD.MMSG01Q2.S1' ended abnormally.\nACTION:\nLook at previous error messages for channel program 'CLOUD.MMSG01Q2.S1' in the\nerror files to determine the cause of the failure. \n----- amqrmrsa.c : 468 --------------------------------------------------------### Assistant: What logs are you referring to? MQ Error logs are not in binary. You can find them under (on Windows) WebSphere MQ installation folder. Error logs specific to queue manager will be under \\Qmgrs\\\"qmgr\"\\ folder. Please look at these error logs, they may have information regarding your problem.Check if the port that you are using in application is the one queue manager is listening on. Do you have SSL enabled on the queue manager port and your application does not use SSL?\n"} +{"text": "### Human: How do you get the same effect as ibm's proprietary mq api's openOptions when using MQ with JMS api?Is there even a concept of openOptions in the JMS API? If so, what is the equivilent in terms of the API classes/methods?Related stackoverflow question - migrating-from-ibm-mq-to-javax-jms-weblogic### Assistant: You are comparing apples and oranges. Yes, both are fruit but they are completely different fruit. There is no direct comparison between the 2.1) A JMS session with \"transacted\" and \"createSender\" is basically an open output with syncpoint.\ni.e.// Open Options\nint oo = MQC.MQOO_OUTPUT + MQC.MQOO_INQUIRE + MQC.MQOO_FAIL_IF_QUIESCING;\n// Put Msg Options\nMQPutMessageOptions pmo = new MQPutMessageOptions();\npmo.options = MQC.MQPMO_SYNCPOINT + MQC.MQPMO_FAIL_IF_QUIESCING;2) A JMS session with \"createReceiver\" (non-transacted) is basically an open input.\ni.e.int oo = MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_INQUIRE + MQC.MQOO_FAIL_IF_QUIESCING;\n// Get Msg Options\nMQGetMessageOptions gmo = new MQGetMessageOptions();\ngmo.options = MQC.MQGMO_FAIL_IF_QUIESCING;\n"} +{"text": "### Human: SOLVEDI found the answer fromIBM Technote IZ66146Hope it helps others with same problem.I wrote a simple method to a read messages from an MQ Queue.In a loop, I try to read a message (with waitInterval). After reading a message successfully from the queue, a 2195 return code is returned. How can I resolve this?Here is simplified version of my code without exception handling or any other thing.public static void main(String args[]) {\n MQException.logExclude(MQException.MQRC_NO_MSG_AVAILABLE);\n MQException.logExclude(MQException.MQRC_UNEXPECTED_ERROR);\n MQException.log = null;\n while (true) {\n incomeDeployMsg = readFromQueue(waitReadInterval);\n System.out.println(dateFormater.format(new Date()) + \" Income msg\");\n }\n } \n public String readFromQueue(int waitInterval) throws MQException{\n MQMessage message = new MQMessage();\n try {\n if (m_inQueue == null || !m_inQueue.isOpen())\n m_inQueue = m_mqQmgr.accessQueue(m_inQueueName, CMQC.MQOO_INQUIRE + CMQC.MQOO_FAIL_IF_QUIESCING + CMQC.MQOO_INPUT_SHARED);\n message.messageId = CMQC.MQMI_NONE;\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.options = CMQC.MQGMO_WAIT;\n gmo.waitInterval = waitInterval;\n m_inQueue.get(message, gmo);\n return message.readStringOfCharLength(message.getMessageLength());\n } catch (MQException mqe) {\n throw mqe;\n } finally {\n message.clearMessage();\n }\n}The first line in the result is not from my code!!! I think it is IBM's classes that print it out on standard output. How can I resolve the error?Result:MQJE001: Completion Code '2', Reason '2195'.2013-05-15 11:44:27 Income msg### Assistant: Comment out the 2 lines with MQException.logExclude() and just use:MQException.log = null;\n"} +{"text": "### Human: I am designing a new file transfer infrastructure using WebSphere MQ v7.5 FTE product and like to know for creating an FTE agent in a Windows box, what is the basic minimum requirement? Does it require the MQ v7.5 server edition installed or will it work with the MQ v7.5 client libraries?### Assistant: You need at least one WMQ queue manager to act as the queuing hub for all the agents. The regular FTE agents can be client-based. Typically, these are placed local to the file endpoints and access the underlying filesystem directly. For most agents a client connection to a central queue manager works great. The exception is a node where the transfer volume is very high, in which case it might warrant having a local queue manager.The exception is the \"Protocol Bridge\" agents which are the ones that talk to remote FTP, SFTP and FTPS servers. These must reside on the same host as the queue manager.Short answer: on your Windows box a client agent is the minimal requirement. Just point its configuration to a queue manager somewhere on the network.\n"} +{"text": "### Human: I used IBM MQs on my local machine to connect to a remote IBM MQ Queue Manager on a client machine for sending and receiving messages.\nDue to some issues I need to uninstall IBM MQs on my end.\nCan I connect to the client remote queue manager using Apache ActiveMQ? (With SSL)If possible please guide me how to proceed with it.\nIf not please suggest any alternative solutions to connect.### Assistant: No. Connect to it using the WebSphere MQ Client. It is freely downloadable asSupportPac MQC75and includes support for several languages, including C and Java. Rather than just grabbing the jar files, please install the entire client distribution. IBM includes a number of diagnostic utilities, tracing and so forth in that distribution. These make debugging much easier and IBM requires them to be installed if you open a support ticket. Since the client is free, requiring the diagnostic tools to be installed seems reasonable.The documentation for the client ishere.Active MQ uses a different wire protocol and its client won't work with WebSphere MQ.\n"} +{"text": "### Human: I'm trying to create certificate request through below command line and returned with error:./runmqckm -certreq -create -db \n/var/mqm/qmgrs/QMGR01/ssl/sslreceiver.kdb -pw password123 -label \nibmwebspheremqsslreceiver -dn \"CN=SSLCLIENT,O=IBMIBM,C=US\" -file \n/var/mqm/sslreceiverreq.arm\n\n The keystore already contains an entry with label\n'ibmwebspheremqsslreceiver'.\n\n Choose a different label and try again.However, there is no such entry asibmwebspheremqsslreceiverin my current keystore file,**@/usr/mqm/bin $ ./runmqckm -cert -list -db\n/var/mqm/qmgrs/QMGR01/ssl/sslreceiver.kdb -pw password123 \nCertificates in database /var/mqm/qmgrs/QMGR01/ssl/sslreceiver.kdb: \nssl_caSo why this happened?### Assistant: The first command creates a certificate request.The second command lists certificates.If you want to list certificaterequests, use the-certreq -listcommand instead of the-cert -listcommand.\n"} +{"text": "### Human: In websphere app server 6.1, when i want to set up JMS, I need to set up a topic, and i need to set up queues and then in MQ explorer I create a subscription between the topic and the queues. Now this configuration is for a publish /subscribe model. If something is published to the topic, all queues will pick up the message.So how do we do point to point messaging in websphere? I ask this question because I thought topic is for publish subscribe model. And queue is for point to point messaging. But in WAS, the two are mixed up.### Assistant: The two aren't mixed up. There's no contradiction here, really.The publish/subscribe model uses a topic (to which \"things\" are published), and a set of queues that are set to consume that topic.The point-to-point model uses a queue; the \"producing\" application puts messages in the queue, and the \"consuming\" application gets messages from that queue.Therefore, there's no contradiction. Remember, topics and queues are just \"tools\" to implement publish/subscribe or point-to-point topologies.\n"} +{"text": "### Human: A customer uses this pattern:Apache Camel and CXF JMS receiversThese internally use Spring MDPs (message-driven POJOs) to implement their message receiversThey are deployed on IBM WebSphere Application Server 7The queue manager is IBM Websphere MQ 6The Spring MDPs are bound to the queue manager using JNDI Queue Connection Factories -- with support for connection pooling and session poolingHere is an example of such message receiver, this one is using Camel:\n \n\n\n\n\n\n\n\n\n \n \n \n\n\n\n\n \n \n \n \n\n \n \nProblem:the WebSphere MQ administrators are reporting lager number of MGET() requests against the queue manager. The hypothesis at the moment is that those receiver are constantly polling the channel for new messages.They do not seem to have this problem with MDBs (message-driven beans). Is the MDP async implementation really a polling mechanism? If so, is there a way to limit the trips to the queue manager? Perhaps increasing the polling interval? Any insights would be appreciated.### Assistant: I am not sure about CXF, but for Camel listeners:It seems like a default JMS consumer in the JmsConfiguration is of type \"Default\".\nThe means, it will implement a DefaultMessageListenerContainer from Spring.FromJavadocMessage listener container variant that uses plain JMS client API, specifically a loop of MessageConsumer.receive() callsReceive calls would map to MQ GET calls.There is also the option to specify aSimpletype of consumer, which I guess is what you want.Message listener container that uses the plain JMS client API's MessageConsumer.setMessageListener()I am not sure here, but the Spring docs indicate that the simple message listener container does not support XA transactions. That might be something to consider, since you are running inside an application server.\n"} +{"text": "### Human: i know we can make use of thewhere filterto help get more specific result during runningrunmqsc. i have no problem with those operators likeLT\u3001GT\u3001EQ\u3001NE\u3001LE and GE. However, as withLK\u3001NL, it always failed. Please see the detail as below:dis chl(SERVER.C01)\n27 : dis chl(SERVER.C01)\nAMQ8414: \u663e\u793a\u901a\u9053\u7ec6\u8282\u3002\n CHANNEL(SERVER.C01) CHLTYPE(SVRCONN)\n ALTDATE(2012-08-27) ALTTIME(16.05.40)\n COMPHDR(NONE) COMPMSG(NONE)\n DESCR( ) HBINT(300)\n KAINT(AUTO) MAXINST(999999999)\n MAXINSTC(999999999) MAXMSGL(4194304)\n MCAUSER( ) MONCHL(QMGR)\n RCVDATA( ) RCVEXIT( )\n SCYDATA( ) SCYEXIT( )\n SENDDATA( ) SENDEXIT( )\n SHARECNV(10) SSLCAUTH(REQUIRED)\n SSLCIPH( ) SSLPEER( )\n TRPTYPE(TCP)\ndis chl(*) where(type lk SVRC*)\n 28 : dis chl(*) where(chltype lk SVRC*)\n AMQ8569: \u8fc7\u6ee4\u5668\u89c4\u8303\u4e2d\u7684\u9519\u8bef\n dis chl(*) where(chltype lk SVRC*\n\n AMQ8427: MQSC \u547d\u4ee4\u7684\u6709\u6548\u8bed\u6cd5\u4e3a\uff1a\n\n DISPLAY display_cmd\n WHERE( filter_keyword operator filter_value )\n\n operator := [ LT | GT | EQ | NE | LE | GE | CT | EX | LK | NL | CTG | EXG ]In addition, how aboutCT and EX? Please help me outWebSphere MQ\n7.0.1.9Thanks### Assistant: It is not clear whether you are having this problem with other object types but as for channels, filtering based on channel type is not allowed. This is probably because selection by type has always been supported anyway. Just specifyTYPEorCHLTYPEin the display command:dis chl(*) chltype(svrconn)\n 1 : dis chl(*) chltype(svrconn)\nAMQ8414: Display Channel details.\n CHANNEL(SYSTEM.AUTO.SVRCONN) CHLTYPE(SVRCONN)\nAMQ8414: Display Channel details.\n CHANNEL(SYSTEM.DEF.SVRCONN) CHLTYPE(SVRCONN)\ndis chl(*) type(svrconn)\n 2 : dis chl(*) type(svrconn)\nAMQ8414: Display Channel details.\n CHANNEL(SYSTEM.AUTO.SVRCONN) CHLTYPE(SVRCONN)\nAMQ8414: Display Channel details.\n CHANNEL(SYSTEM.DEF.SVRCONN) CHLTYPE(SVRCONN)The Infocenter page forDISPLAY CHANNELstates:Almost any parameter that can be used to display attributes for this\n DISPLAY command. However, you cannot use the CMDSCOPE, QSGDISP, or\n MCANAME parameters as filter keywords. You cannot use TYPE (or\n CHLTYPE) if it is also used to select channels.I'm not sure how you might useTYPEorCHLTYPEotherthan to select channels and I've requested a clarification made to the page to explain that. In the meantime, be aware that selection onTYPEorCHLTYPEis not supported using theWHEREclause. Were there cases other than channels where you had trouble withLKandNK?UPDATEResponding to the comment, two things to be aware of. First, as per the Infocenter, \"You cannot use a generic filter-value for parameters with numeric values or with one of a set of values.\" This means, for example, that it is invalid to specifyDIS CHL(*) WHERE(MCATYPE LK P*)becauseMCATYPEis specified by one of a set of values. It can be onlyPROCESSorTHREAD. Nor would it be valid to specifyDIS CHL(*) WHERE(LONGTMR LK 1*)becauseLONGTMRtakes a numeric value.The second item of interest is the syntax of the quoting in theWHEREclause. Like allMQSCparameters, theWHEREclause folds unquoted values to UPPER CASE. Since WebSphere MQ evaluates these in case-sensitive fashion, something likeDIS Q(*) WHERE(DESCR LK W*)works because many of the queues have a description beginning withWebSphereand the upper caseWmatches. However,DIS Q(*) WHERE(DESCR LK We*)fails because the lower caseeis folded to upper case which then does not match the value in the description field. What does work here isDIS Q(*) WHERE(DESCR LK 'We*')where the string specifier is single-quoted.So the issues you are seeing may be due to use of theLKoperator against a string value that is part of an enumeration, or possibly due to case sensitivity failing to match unquoted filter values.TheCTandCTGand their complements are the operators to use when the filter keyword is a list. For example, in theNAMELISTobject the attributeNAMEScontains a list of values. Something likeWHERE(NAMES LK SYS*)would be ambiguous becauseLKoperates on unary values. SoCTandCTGare provided as operators that work on sets. A couple of examples to demonstrate this syntax would then be:DIS NAMELIST(*) WHERE(NAMES CT SYSTEM.BROKER.DEFAULT.STREAM)\nDIS NAMELIST(*) WHERE(NAMES CTG SYS*)The first displays anyNAMELISTobjects where one of the entries in theNAMESattribute matches exactly. The second allows a similar match based on a generic string prefix. Be sure to quote if the expected value is in anything other than all UPPER CASE or if the value contains an embedded space.\n"} +{"text": "### Human: i did a test with the MQ propertyMAXCHANNELSfrom QMGR's qm.ini but got the result which i don't understand, please see my WMQ environment detail as below:OS: Windows 7\nMQ: 7.0.1.3MaxChannels configuration:MQSCdis chs(*)whose total number is5That's my confusion. According to the description from MQ inforcenter, thatMAXCHANNELSmeans the maximum number of channels that can be current (including server-connection channels with connected clients). However, my config value is1while the number of current active ones gets be 5 already. BTW, i did the qmgr restart after value reset. Why does it happen? From the point of my view, some error like reaching the max number should be shown in the error.log. But i don't see anything. Everything seems working fine.Please help me out.Thanks### Assistant: One possibility for this not taking effect is that you may be updating the configuration in the wrong location.In MQ 7.0.1.x the queue manager configuration could instead be held in a qm.ini file, for example if its configured as multi-instance. From MQ 7.1 onwards the qm.ini is the location that all distributed queue managers keep their configuration data.If the queue manager is using ini files then the following stanza should be added instead to qm.ini, which can be found in the queue manager data directory;Channels:\n MaxChannels=1Thanks, Jon\n"} +{"text": "### Human: i'm kind of confused with the relationship amongACTCHL, MAXCHL, MAXCHANNELS and MAXACTIVECHANNELS. Is propertyACTCHLsame withMAXACTIVECHANNELS, andMAXCHLwithMAXCHANNELS? In addition, what's the default value for them? i can see either100or200, not sure which one is correct.Thanksi just findACTCLandMAXCHLare for z/OS, butMAXCHANNELSandMAXACTIVECHANNELSare for open system. It's clear. However, please help answer the default value question.### Assistant: Oddly enough, the best reference for these is in the WMQ Explorer manual rather than the WMQ manual. The tables in theQueue Manager Propertiestopic list the settings, their default values and in some cases the relationship between them. When you get there use your browser search for the specific attributes (i.e. MAXACTIVECHANNELS) because the tales are organized based on tabs in WMQ Explorer rather than strict alphabetical sequence.\n"} +{"text": "### Human: Is there a way to get all the properties of queues, channels, etc,. with a single mq command and store it in a file ?### Assistant: I believe theMS03SupportPac will do what you require. Quoting...AbstractThis SupportPac (saveqmgr) saves all the objects, such as queues, channels, etc, defined in either a local or remote queue manager, to a file.\n"} +{"text": "### Human: I have to connect Webshpere MQ 7.1 with MQSeries 5.0. I have to choose between message compression on application level or turn on the compression in MQ natively. I cannot, however, connect to MQSeries 5.0 and check whether or not it support things I care about - compression and message integrity.Therefore, my question is this:\nDoes MQSeries 5.0 (in that particular version) provide message compression and/or ensures the message integrity?### Assistant: Short answer - no.Longer answer, you can verify this because the old WMQ manuals are still onlinehere. I checked the V5.3 Intercommunications Manual and the MQSC Script Reference manual and the only mention of compression was that you might want to write use of channel exits to perform that function.If you did write a channel exit, it would not interoperate with WMQ V7.1 since the channel negotiation would disable that feature on the WMQ V7.1 side. It would be necessary to install the exit on both sides.With all levels of MQ V5 many years out of support, skip the effort to alter the application or write an exit and just migrate to a current, supported version of MQ.\n"} +{"text": "### Human: After solvingthe first blockerI was able to move toward more complex scenario and I tried to roundtrip custom message properties from my .NET component sending JMS messages to message driven bean hosted in WebSphere Application Server v7 and the bean responding back to to .NET component. This communication is done over WebSphere MQ v7 but .NET uses WebSphere MQ Client v7.5 and amqmdnet.dll v7.5.0.0 (because it fixes some other issues I had with v7 client: for examplethis).I'm not able to send simple boolean property from .NET component:MQMessage message = new MQMessage();\nmessage.SetBooleanProperty(\"TEST_BOOL\", true);\nqueue.Put(message);Receiving such message in message driven bean will fail with:[8/3/12 17:37:20:087 CEST] 0000003b SibMessage W [:] CWSJY0003W: JMSCC0110: An exception '\n Message : com.ibm.msg.client.jms.DetailedMessageFormatException: JMSCMQ1050: The MQRFH2 header has an incorrect format. Received a message with a badly formed MQRFH2 header. Ensure that any non-JMS applications building messages with MQRFH2 headers create well-formed MQRFH2 headers.\n Class : class com.ibm.msg.client.jms.DetailedMessageFormatException\n Stack : sun.reflect.NativeConstructorAccessorImpl.newInstance0(NativeConstructorAccessorImpl.java:-2)\n : sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:45)\n : sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:39)\n : java.lang.reflect.Constructor.newInstance(Constructor.java:515)\n : com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:313)\n : com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:388)\n : com.ibm.msg.client.wmq.common.internal.messages.WMQMessageBase._parseUsrFolder(WMQMessageBase.java:1984)\n : com.ibm.msg.client.wmq.common.internal.messages.WMQReceiveMarshal.constructProviderMessageFromRFH2(WMQReceiveMarshal.java:402)\n : com.ibm.msg.client.wmq.common.internal.messages.WMQReceiveMarshal.constructProviderMessageFromProperties(WMQReceiveMarshal.java:191)\n : com.ibm.msg.client.wmq.common.internal.messages.WMQReceiveMarshal.createProviderMessage(WMQReceiveMarshal.java:467)\n : com.ibm.msg.client.wmq.common.internal.messages.WMQReceiveMarshal.exportProviderMessage(WMQReceiveMarshal.java:627)\n : com.ibm.msg.client.wmq.internal.WMQConsumerShadow.getMsg(WMQConsumerShadow.java:1318)\n : com.ibm.msg.client.wmq.internal.WMQConsumerShadow.getMsg(WMQConsumerShadow.java:1208)\n : com.ibm.msg.client.wmq.internal.WMQSyncConsumerShadow.receive(WMQSyncConsumerShadow.java:366)\n : com.ibm.msg.client.wmq.internal.WMQSession.loadMessageReference(WMQSession.java:1318)\n : com.ibm.msg.client.jms.internal.JmsSessionImpl.consume(JmsSessionImpl.java:2940)\n : com.ibm.msg.client.jms.internal.JmsSessionImpl.run(JmsSessionImpl.java:2631)\n : com.ibm.mq.jms.MQSession.run(MQSession.java:862)\n : com.ibm.mq.connector.inbound.WorkImpl.run(WorkImpl.java:265)\n : com.ibm.ejs.j2c.work.WorkProxy.run(WorkProxy.java:399)\n : com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1604)\n Caused by [1] --> Message : com.ibm.msg.client.jms.DetailedMessageFormatException: JMSCMQ0008: WebSphere MQ classes for JMS attempts to use a data type not supported by a message or attempts to read data in the wrong type. Wrong data types used to read message property types. Check that the message received and the properties to be read are of the type expected.\n Class : class com.ibm.msg.client.jms.DetailedMessageFormatException\n Stack : sun.reflect.NativeConstructorAccessorImpl.newInstance0(NativeConstructorAccessorImpl.java:-2)\n : sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:45)\n : sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:39)\n : java.lang.reflect.Constructor.newInstance(Constructor.java:515)\n : com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:313)\n : com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:388)\n : com.ibm.msg.client.wmq.common.internal.messages.WMQMessageUtils.deformatTypedElement(WMQMessageUtils.java:306)\n : com.ibm.msg.client.wmq.common.internal.messages.WMQMessageUtils.deformatElement(WMQMessageUtils.java:414)\n : com.ibm.msg.client.wmq.common.internal.messages.WMQMessageBase._parseUsrFolder(WMQMessageBase.java:1963)\n : com.ibm.msg.client.wmq.common.internal.messages.WMQReceiveMarshal.constructProviderMessageFromRFH2(WMQReceiveMarshal.java:402)\n : com.ibm.msg.client.wmq.common.internal.messages.WMQReceiveMarshal.constructProviderMessageFromProperties(WMQReceiveMarshal.java:191)\n : com.ibm.msg.client.wmq.common.internal.messages.WMQReceiveMarshal.createProviderMessage(WMQReceiveMarshal.java:467)\n : com.ibm.msg.client.wmq.common.internal.messages.WMQReceiveMarshal.exportProviderMessage(WMQReceiveMarshal.java:627)\n : com.ibm.msg.client.wmq.internal.WMQConsumerShadow.getMsg(WMQConsumerShadow.java:1318)\n : com.ibm.msg.client.wmq.internal.WMQConsumerShadow.getMsg(WMQConsumerShadow.java:1208)\n : com.ibm.msg.client.wmq.internal.WMQSyncConsumerShadow.receive(WMQSyncConsumerShadow.java:366)\n : com.ibm.msg.client.wmq.internal.WMQSession.loadMessageReference(WMQSession.java:1318)\n : com.ibm.msg.client.jms.internal.JmsSessionImpl.consume(JmsSessionImpl.java:2940)\n : com.ibm.msg.client.jms.internal.JmsSessionImpl.run(JmsSessionImpl.java:2631)\n : com.ibm.mq.jms.MQSession.run(MQSession.java:862)\n : com.ibm.mq.connector.inbound.WorkImpl.run(WorkImpl.java:265)\n : com.ibm.ejs.j2c.work.WorkProxy.run(WorkProxy.java:399)\n : com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1604)\n' was caught while processing a message for delivery to a message driven bean.### Assistant: I usedRFHUtilsto get the message sent by my .NET component.usrRFH2 folder contains this definition:TEST_BOOL(dt='boolean')=TrueIf I change the value to1instead ofTrueand send the message using RFHUtils, it is processed correctly. Decompiled resource adapter (I'm usingJD-GUI) also showed that it expects only0and1values for boolean JMS properties.static Object deformatTypedElement(int datatype, String value)\n throws JMSException\n{\n Object result = null;\n switch (datatype) {\n ...\n case 1:\n if (value.equals(\"1\")) {\n result = new Boolean(true);\n }\n else if (value.equals(\"0\")) {\n result = new Boolean(false);\n }\n else {\n JMSException je = (JMSException)NLSServices.createException(\"JMSCMQ0008\", null); // Line 306 - BOOM!\n throw je;\n }\n\n // There is also no break here but I think it is a problem of decompiler\n ...\n }\n}Decompiled code of amqmdnet.dll library for .NET (I'm using.NET Reflector) showed that it doesn't convert boolean values before passing them to the message. It simply usesToString()on the value:internal class MQMarshalMessageForPut : MQBaseObject\n{\n ...\n\n private void SetContent(RFH2Folder element, object value)\n {\n ...\n\n if (value is bool)\n {\n element.SetContent(value.ToString(), 1);\n }\n\n ...\n }\n}ButToStringonbooltype returnsTrueorFalse!The response from message driven bean back to .NET application works without any problem becauseGetBoolPropertyis prepared to work with bothTrueandFalsestrings and0and1values.private bool ParseBoolean(object obj) \n{\n ...\n\n if ((string.Compare(strA, \"true\", true) == 0) || (strA == \"1\"))\n {\n strA = bool.TrueString;\n }\n else if ((string.Compare(strA, \"false\", true) == 0) || (strA == \"0\"))\n {\n strA = bool.FalseString;\n }\n\n\n ...\n}I think this is a bug in IBM's amqmdnet.dll library.\n"} +{"text": "### Human: I understand JMS spec allows me to write MDBs. Then I can deploy them on an appserver like websphere or jboss (and they have inbuilt implementation of JMS provider which is Java EE compliant). The question is when to use a full fledged product like IBM WebSphere MQ or ACtiveMQ instead of using App server's inbuilt JMS provider.### Assistant: This appears to be a good reference to what you are asking, specific to IBM products but can be generalized to using an application server integrated messaging system vs a standalone messaging system -http://www.ibm.com/developerworks/websphere/library/techarticles/1109_wallis/1109_wallis.html\n"} +{"text": "### Human: Hi when I tried to transfer the contents of a folder ( The folder has several subfolders and few files) using MQFTE ftecreatetransfer command, Not only the few files in the folder but also the contents of the subfolder are transferred to destination. The same subfolders are created in destination and the contents are transferred. Is there a way to avoid the files from subfolders being transferred ?### Assistant: As perthis pagein the Infocenter:When a directory is specified as a source file specification, the\n contents of the directory are copied. More precisely, all files in the\n directory and in all its subdirectories, including hidden files, are\n copied.However, it looks like they anticipated your question because the page recently added this clarification:For example, to copy the contents of DIR1 to DIR2 only, specify\n fteCreateTransfer ... -dd DIR2 DIR1/*So instead of specifying the folder, add the wild card to the end and you get just the files in the top level of that folder. (Assuming of course that you do not also use the -r option!)\n"} +{"text": "### Human: Has anyone tried to use IBM's .NET Websphere client libraries (XMS, etc) on Mono? If so, was it a good (seamless) experience?### Assistant: I just installed MonoDevelop IDE and prerequisites Gtk#2.12.x tool kit. Wrote a sample producer application in couple of minutes and it worked fine, successfully put a message onto a queue.MonoDevelop IDE worked much faster than VS2010 IDE. Experience was good.Mono is a software platform designed to allow developers to easily create cross platform applications. Are there any specifics that you are looking for? platform compatibility etc?\n"} +{"text": "### Human: I am trying to connect to a websphere MQ queue manager from a camel route deployed as an OSGI bundle on Apache Service Mix.I have deployed the IBM OSGI bundles that come with Websphere MQ and configured the Spring configuration as per below:-\n ....\n \n\n\n\n \n \n \n \n \n \n \n \n \n \n \n \nAt runtime I'm getting this error => java.lang.ClassNotFoundException: javax.net.ssl.HandshakeCompletedListener not found by com.ibm.msg.client.osgi.wmqNone of the IBM bundles import javax.net.ssl and I can't really re-bundle them?Has anyone managed to get a connection working to WMQ from servicemix/fuse - 4 ?Any help is much appreciated.Many thanks in advance, Tom### Assistant: Was answered herehttp://fusesource.com/forums/message.jspa?messageID=13274. Pasting it below:Tom,OK, something else to try... sometimes when dealing with odd classloading issues, it helps to try out another OSGi framework. Felix and Equinox both implement the spec but approach things differently under the hood. So, to try out Equinox instead of Felix open up etc/config.properties and make the following change:karaf.framework=equinoxMake sure to also delete the \"data\" dir before start the ESB again.\n"} +{"text": "### Human: I have two general question on Websphere MQ regardingmessageId:1) This field can be used to achieve synchronous communication in a queue?\nFor example in the following source code:MQMessage hello_world = new MQMessage(); \nhello_world.writeUTF(\"Hello World!\"); \nMQPutMessageOptions pmo = new MQPutMessageOptions(); \nsystem_default_local_queue.put(hello_world,pmo); \nMQMessage retrievedMessage = new MQMessage();\nretrievedMessage.messageId = hello_world.messageId; \nMQGetMessageOptions gmo = new MQGetMessageOptions(); \nsystem_default_local_queue.get(retrievedMessage, gmo);The retrieved message will be the exact response for thehello_worldmessage and only this message will be retrieved leaving all the other messages in the queue even if there are more aged than this?2) If this is the case can this be done with two queues?\nExample:\nClient Side:MQMessage hello_world = new MQMessage(); \nhello_world.writeUTF(\"Hello World!\"); \nMQPutMessageOptions pmo = new MQPutMessageOptions(); \ninput_queue.put(hello_world,pmo); \nMQMessage retrievedMessage = new MQMessage();\nretrievedMessage.messageId = hello_world.messageId; \nMQGetMessageOptions gmo = new MQGetMessageOptions(); \noutput_queue.get(retrievedMessage, gmo);Server Side:while(true){\nMQMessage inMessage= new MQMessage();\ninput_queue.get(mqMessage ,gmo); \n//actions to get the contents of the inMessage and create proper response\n MQMessage outMessage= new MQMessage();\n//write the proper response to outMessage\n outMessage.messageId = inMessage.messageId; \noutput_queue.put(outMessage, pmo);\n}### Assistant: I think you are using \"synchronous\" the wrong way. What you describe in #1 above is true - aGETby MsgID will retrieve only that one message. However, this is not a synchronous messaging example.The general case of the client/server exchange you've outlined is correct. It is a common pattern that many application instances can use the same reply queue if they always look for messages by ID. Normally what happens is that the MsgID is copied to the Correlation ID though so instead of initializing themsgIDon theretrievedMessageobject, one would expect to seecorrelIDinitialized instead. Of course, the behavior is entirely dependent on the server application's behavior and some do copy the requestmsgIDto the replymsgID.Just make sure that the GET bymsgIDorcorrelIDincludes a wait so that a late-arriving message has somewhere to go. Also with this pattern, it is common that the replies would expire if not picked up within some time frame - such as an hour or two.\n"} +{"text": "### Human: I'm developing windows service that serves two purposes.It is a proxy to WebSphere MQ for web application that asks other\nsystems - it sends request and second system replies.It is a server that should respond to other system requests - other system sends request, the service responds.In scenario 1 I'm waiting for response with specific correlation ID. However, in scenario 2 I'm waiting for any message that is a request. How can I avoid situation that I will read the response from scenario 2 and treat it like a request in scenario 2? I would like to filter the messages that I read in scenario 2 only to messages that have Message TypeMQMT_REQUEST.Thanks in advance for help.### Assistant: Use two different input queues. The overhead of selecting the right messages from the queue when there are mixed message types is considerably greater, in terms of program logic and WMQ indexing, than to simply create two queues.Typically in a Service Oriented Architecture, the service endpoint queues are well-known and the reply-to queues are either dynamic or at least not well-known since the service provider needs only to look at the reply-to fields for the return address. In this case your application is both a service provider and a service consumer. The queue it uses as an endpoint for the service it provides should be a well-known queue that all of its clients send messages to. The queue it uses for replies to its service requests should be an entirely different queue.One good example of why is that it is common when enhancing a service to provide a different endpoint queue for the new version. For example a service that returns a customer name based on an account number might live on a queueSVC.CUST.LOOKUP.V01. If the service is enhanced a new version can be made available onSVC.CUST.LOOKUP.V02. Requestors of the service then have the ability to migrate from theV1queue to theV2queue on their own schedule rather than requiring them all to convert at once.You would definitelynotwant your application's reply-to queue to be associated with its service endpoint queue in this situation. The two serve entirely different functions, are subject to entirely different change control and enhancement schedules, etc.\n"} +{"text": "### Human: I have a asynchronous JMS receiver coded thus (obvious details missing):connection = connectionFactory.createConnection();\nconnection.setExceptionListener(new ExceptionListener() {\n @Override\n public void onException(JMSException ex) {\n logger.info(\"JMS exception \" + ex.getMessage());\n }\n});\n\nsession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);\nconsumer = session.createConsumer(queue);\nconsumer.setMessageListener(listener);\nlogger.info(\"Waiting for a message\");\nconnection.start();Everything starts up nicely, but when a message arrives I get a JMSException which the ExceptionListener picks up. The exception says:javax.jms.JMSException: MQJMS2002: failed to get message from MQ queue.\nat com.ibm.msg.client.wmq.v6.jms.internal.ConfigEnvironment.newException(ConfigEnvironment.java:374)\nat com.ibm.msg.client.wmq.v6.jms.internal.MQMessageConsumer.getMessage(MQMessageConsumer.java:3047)\nat com.ibm.msg.client.wmq.v6.jms.internal.MQMessageConsumer.receiveAsync(MQMessageConsumer.java:4042)\nat com.ibm.msg.client.wmq.v6.jms.internal.SessionAsyncHelper.run(SessionAsyncHelper.java:507)\nat java.lang.Thread.run(Thread.java:662)The linked exception just says NullPointerException and gives no other details.I've trawled the web looking for an answer but I am no MQ expert and have got nowhere with this. The middleware people here are not very helpful and getting them to do anything is proving slow and painful. I get the impression it's something to do with queue config but I feel I am clutching at straws.If anyone has got any suggestions I would be grateful - especially if it is something I can arm myself with and confront middleware :)I'm using the MQ 7.0.0.2 client jars.### Assistant: Embarrassingly I have just found that a bit of the 'obvious' code that I skipped above had a finally block in it that closed the connection shortly after it was opened. Not sure why the error message has to be so vague - telling me that the connection was closed would have saved me hours of head scratching.Thanks for those that took time to read through my problem!\n"} +{"text": "### Human: I have queue name, host name, port, channel, queue manager, Get and Put option details of IBM WebSphere MQ queue.Is it possible to send a message to the queue with the above details? If anyone has an idea, please provide some hints.### Assistant: If you have a proper install of WMQ then you will have the samples. These will be in the installation directory for your platform as describedhere. I would direct you to theSimpleRequestor.javacode which hard-codes these values. You can alternatively get them from Java properties files, the command line or a JNDI call.// Set the properties\n cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, \"localhost\");\n cf.setIntProperty(WMQConstants.WMQ_PORT, 1414);\n cf.setStringProperty(WMQConstants.WMQ_CHANNEL, \"SYSTEM.DEF.SVRCONN\");\n cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\n cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, \"QM1\");Other methods of making the connection are illustrated in the other samples. Look around the directory and one of the programs will have the connection method that you need.If you do not have the samples, they are distributed with the MQ Client install. For v7 client, this isSupportPac MQC7. Other versions are distributed in their corresponding SuppportPac which you can find from thelanding page. Be sure to refer to theInfocenterthat corresponds to the version of WMQ client that you are using. Since v6 is end-of-life as of September 2012, hopefully you are already using v7.0 or v7.1 client and your QMgr will also be at one of these versions.\n"} +{"text": "### Human: I'm new to WebSphere MQ File Transfer, I want to send a file through Java code to Message Queue Server and read it from another end. Please let me know or any link where I can get the details to send a file through Message Queue.Thanks in Advance.### Assistant: WMQ File Transfer Edition is an advanced manage file transfer product. It comes with a MQ Explorer plug-in where you can configure your file transfers. It also has command line and script based interface for transfer configuration. This means that you don't need any coding to do file transfer. Just configuration is enough.There is a redbook onMQ FTE. There are also some developerWorks articles. One that I like most isWMQ FTE Walkthough.\n"} +{"text": "### Human: All,Could some one tell me whether WebSphere Application Server v 7.0 is compatible with WebSphere MQ v 6.0.2.8?We have upgraded our WAS 6 to WAS 7 version but we are unable to access MQ queues (v 6.0.2.8)We got the below error messagecom.ibm.ejs.jms.listener.ServerSession run WMSG0036E: Maximum message delivery retry count of 5 reached for MDB.........Let me know what will be the solution for this.Thanks for your inputs Manglu. Now I am confident that there should not be a compatibility issue for having WAS 7 + MQ 6 on Solaris 9. IBM website also says the this combination is supportable.IBM Web Page 1IBM Web Page 2So the main challenge for me to find out the proper configuration.Any more inputs on this configuration would be more helpful.Yes, the MQ 6 is at the end of service life however the MQ 6 upgrade is considered in the pipeline but at the moments we are trying to make WAS 7 works with MQ 6.### Assistant: WebSphere MQ 6.x is supported till 3Q 2012 - SeeWebSphere MQ Lifecycle\n"} +{"text": "### Human: I am running two grails web applications in single instance of tomcat 7, both trying to connect to websphere MQ publishing and receiving messages. First one that gets loaded works well but second one we have following error. If I deploy both of them in different instances of tomcat on same machine it works well but error below is raised when I run both applications in same instance.2011-08-30 14:09:24,661 [Thread-5] [uk.co.pershing.jbf.messaging.ReaderListener] [ERROR] - Exception Occured ... com.ibm.msg.client.jms.DetailedJMSException: JMSFMQ6312: An exception occurred in the Java(tm) MQI. The Java(tm) MQI has thrown an exception describing the problem. See the linked exception for further information.\n Linked Exception is \ncom.ibm.mq.jmqi.JmqiException: CC=2;RC=2495;AMQ8568: The native JNI library 'mqjbnd' was not found. [3=mqjbnd]\n2011-08-30 14:09:24,661 [Thread-5] [uk.co.pershing.jbf.servlet.BusStartupServlet] [ERROR] - uk.co.pershing.jbf.messaging.config.ConfigurationException: com.ibm.msg.client.jms.DetailedJMSException: JMSFMQ6312: An exception occurred in the Java(tm) MQI. The Java(tm) MQI has thrown an exception describing the problem. See the linked exception for further information.### Assistant: The Java Virtual Machine only allows JNI libraries to be loaded once. If you are trying to load Websphere-MQ JNI libraries from the applications, then the application which loads first will have exclusive access to the JNI libraries through its application-specific ClassLoader.With separate Tomcat instances there is only one application per Tomcat JVM attempting to load the JNI libraries, so it isn't an issue.The solution to this is to load the JNI libraries from the Tomcat ClassLoader, by placing the Websphere-MQ JNI jars in the Tomcat lib/ directory instead of the application's lib/ directory. Then, the Tomcat ClassLoader will load the JNI libraries and they will be accessible by both applications.\n"} +{"text": "### Human: I need to map WebSphere MQ7 queue (Say queA in Queue Manager QMA) to a EJB3 MDB.I created the MQ Queue Manager and Queue usingcrtmqm QMAand start it usingstrmqm MQAThen i wrote a file file nameQMA.confand includedDEFINE QLOCAL ('queA')line it and run the commandrunmqsc QMA < QMA.confthen I runstrmqcsv MQA &runmqlsr -m QMA -t TCP &All these steps done as mqm logged user.Then I followhttp://community.jboss.org/wiki/JBossEAP5IntegrationwithWebSphereMQlink and configure RAR to the jboss 5.1. When I run the test connection that also succeeded.There I include* channel - SYSTEM.DEF.SVRCONN\n* hostName - localhost\n* port - 1414\n* queueManager - ExampleQM\n* transportType - CLIENTand In my MDB I include@MessageDriven( name=\"WMQMDBTest\",\n activationConfig = \n { \n @ActivationConfigProperty(propertyName=\"messagingType\",propertyValue=\"javax.jms.MessageListener\"),\n @ActivationConfigProperty(propertyName = \"destinationType\",propertyValue = \"javax.jms.Queue\"),\n @ActivationConfigProperty(propertyName = \"destination\", propertyValue = \"queA\"),\n @ActivationConfigProperty(propertyName = \"useJNDI\", propertyValue = \"true\"),\n @ActivationConfigProperty(propertyName = \"channel\", propertyValue = \"SYSTEM.DEF.SVRCONN\"),\n @ActivationConfigProperty(propertyName = \"hostName\", propertyValue = \"localhost\"),\n @ActivationConfigProperty(propertyName = \"queueManager\", propertyValue = \"QMA\"),\n @ActivationConfigProperty(propertyName = \"port\", propertyValue = \"1414\"),\n @ActivationConfigProperty(propertyName = \"transportType\", propertyValue = \"CLIENT\"),\n @ActivationConfigProperty(propertyName = \"username\", propertyValue = \"mqm\"),\n @ActivationConfigProperty(propertyName = \"password\", propertyValue = \"password\")\n }) \n@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n@ResourceAdapter(value = \"wmq.jmsra.rar\")When I try to deploy the bean it saysDEPLOYMENTS IN ERROR:\n Deployment \"jboss.j2ee:ear=integration-1.0-SNAPSHOT.ear,jar=business-logic-1.0-SNAPSHOT.jar, \n name=WMQMDBTest,service=EJB3\" is in error due to the following reason(s): \njavax.naming.NameNotFoundException: queA not bound### Assistant: You've written@ActivationConfigProperty(propertyName = \"destination\", propertyValue = \"queA\"),\n @ActivationConfigProperty(propertyName = \"useJNDI\", propertyValue = \"true\"),with theuseJNDIproperty implying that 'queA' is the name under which the JMS Queue is bound into the JNDI namespace - this does not directly correspond to the queue you have defined hereDEFINE QLOCAL ('queA')If you want it to refer to a physical WMQ queue on your queue manager then you need the useJNDI property set to false, in which case destination specifies the name of a queue on the queue manager, not a JNDI name. On the other hand, if you do want to use JNDI lookup of Destinations then you need to ensure that the destination name specified matches the Queue definition in the -ds.xml file, e.g.@ActivationConfigProperty(propertyName = \"destination\", propertyValue = \"jms/request\")would correspond to\n jms/request\n jboss.jca:service=RARDeployment,name='wmq.jmsra.rar'\n javax.jms.Queue\n \n baseQueueManagerName=QMA \n baseQueueName=queA\n \nnote the JNDIName attribute of the mbean corresponds to the destination name\n"} +{"text": "### Human: I am new to Websphere, and at this client site, we are running an older version of Websphere in an older version of RAD. I used a python script to define a queue factory and some queues, using a script provided by another individual at the site. However, there was not mention of a queue manager in the script. It appears that the queues are created, I can see that they are defined in the Admin Console. Same is true for the queue factory. The admin console does not seem to expose the name of a queue manager, however.I have been googling for a few days trying several different angles, but always come back to no answer. There seems to be tool called MQ Explorer, but that comes with Websphere MQ, which is not installed. No one here seems to have tried anything like this before, of if they have, may not have attempted what it is I am trying to achieve.Ideally, what I would like to do would be to connect to the queue with a third party tool called MQ Visual Edit, for example.### Assistant: There are about 3 or 4 questions here. Let's see if I can address all of them.First, creating administered objects is completely separate from defining queues in the queue manager. Typically, the WebSphere MQ admin defines the queues and topics, then provides the host, port, channel, QMgr and queue/topic names to the WAS admin who then generates the matching connection factory and queue or topic objects. Defining the WAS objects does not create the corresponding WMQ objects, nor does it even imply that they exist. From your description, it sounds as though they may not have been defined on the QMgr.In fact, it is not even obvious from your description that you are using MQ as your transport. If WAS is configured to use it's own JMS implementation (System Integration Bus or SIBus for short) then the connection factories and other objects may point to SIBus instead of WMQ. If you created a QCF for WMQ then someone should have already provided the details you are requesting - QMgr name, host, port and channel name.WMQ Explorer is available as a free, stand-alone download calledSupportPac MS0T. In order to use it, or any of the other 3rd party desktop tools such as MQ Visual Edit orSupportPac MO72you will need to know the QMgr name as well as host, port and channel name. In addition, if the WMQ admin has enabled any security, you will need to be authorized to connect and, at a minimum, inquire on WMQ objects. The WMQ admin will provide these details to you. Assuming you have the QMgr details and are sufficiently authorized, just download and install SupportPac MS0T and point it at WMQ. Instructions on all things WMQ (including WMQ Explorer) are at the Infocenter pages. Since the stand-alone WMQ Explorer is V7 you will want theV7 Infocenterfor any Explorer help. If the QMgr is at V6 then you may need to refer to theV6 Infocenteras well.That answers the questions in the body of your post. The answer to the question in the title - how do I find out the QMgr name - is \"ask the WMQ administrator.\" You should be given the name when you get the host, port and channel. That said, you often do not need it. A WMQ client will connect to any QMgr if provided the host, port and channel. This is what allows your client app to fail over to a different QMgr. Things like WMQ Explorer are the exception because they should not fail over. If you have a primary and backup QMgr, you typically want WMQ Explorer to see them both at the same time (so for example that you can configure them identically) and if one QMgr is down you want Explorer to report it as such. Therefore Explorer requires a QMgr name but most apps do not.\n"} +{"text": "### Human: Is it possible to invoke a antscript in postdst and presrc call in MQFTE??### Assistant: Here's an example: \n \n \n $hostName \n $userID \n \n \n \n \n \n Some value \n \n \n \n \n \n \n \n \n \n $filepath \n \n \n $destFile \n \n \n \n \n Example FTE job \n \n \nThe properties passed to the ant script are arbitrary names. You could pass any properties in that way. I used postSourceCall but you can change that to postDest, preSource, etc.\n"} +{"text": "### Human: What is the recommended architecture for accessing WebSphere MQ message queues across internet (i.e. 100+ ms latency) and over organizational boundaries?The two approaches that we are considering are to access the other organization's Queue Manager directly from our clients and the alternative is to have a Queue manager locally that would pump the messages from the remote queue and then local clients will access it. I think that both have merit but I am not sure of the trade-offs between the two architectures.The volume that we would have to handle is 600 per second with message size of about 50 bytes. The other org's queue manager is not changeable (and it is WebSphere MQ). The messages have to be processed in order. Perhaps they can be split between different queues and then each queue to be processed by separate client but in each queue the order is still very important. In general there would be one transaction processing client. There could be one additional business intelligence client that would process a copy of the message.Does anyone have any perf metrics of MQSeries to MQSeries queue manager throughput and a comparison of WebSphere MQ queue manager to client throughput?### Assistant: The recommended answer from a security standpoint is that the other org should be requiring you to use a full QMgr and not a client. A channel connection from an external QMgr will only ever issueCONNECT,INQUIREandPUTcommands. A client connection has access to the entire WMQ API and can execute any API call on any object. For example, if the other party uses structured data in their queue names (an account number for example) a client app can cycle through all possible names to enumerate all the account numbers. If the call returns 2035, the object exists but authorization failed. If the call returns 2085 the object does not exist. In addition to allowing various types of enumeration, a client that gets stuck in a connect loop can throw hundreds of reconnect attempts per second at a QMgr that will completely tie up a listener. So clients are inherently more dangerous to accept connections from on a QMgr and clients from 3rd parties even more so. However, clients are free and the cost often outweighs the risk, especially when the application is not moving high-value transactions or sensitive data. If I were charged with connecting to a vendor's QMgr and they allowed the choice of client connections or QMgr connections and the application was high-visibility or mission critical, I'd choose a full QMgr.Another aspect to consider is that the QMgr-to-QMgr channels are more resilient to network connectivity problems. This is because two QMgrs keep track of message sequence numbers, hold batches under syncpoint until acknowledged and are capable of negotiating channel recovery automatically without losing or duplicating any persistent messages. Because a client channel gives you as the developer full access to the API, including the freedom to write programs that sacrifice reliability for performance, it is possible to write a client app that loses or duplicates messages. In fact, an inherent problem with async message over a network is that session recovery issues can create ambiguous outcomes that lead to duplicate messages. This is not specific to WebSphere MQ and in fact, the JMS specification talks about this issue and notes that it is the application's responsibility to properly account for \"functionally duplicate\" messages produced as a result of session recovery. You can eliminate the possibility of message loss by always using transacted sessions but eliminating the possibility of sending a dupe message takes a bit of work. Two QMgrs talking use a protocol that eliminates any such ambiguity.As for the performance metrics, take a look at the Performance Reports for your platform. These are all available from theSupportPacs landing page. Look for the SupportPacs with names likeMP**such as SupportPac MP71 for Windows or SupportPac MPL5 for Linux.\n"} +{"text": "### Human: Can I use the same keystore and cert for AMS that my app already uses?### Assistant: You can, but also have the option to use separate certs and/or keystores if you want. The keystore.conf file contains the details of the keystore and the label of the certificate that AMS will use for encrypting and signing messages. This can point to the same certificate as used by the application for making connections to WebSphere MQ, the same certificate the app server uses for SSL connections or an entirely separate keystore dedicated to AMS.The key (excuse the pun) is to manage the keystores based on the security model required. The app server's keystore probably has a number of external-facing certificates in its trust store. For example, it might trust several commercial certificate authorities. The AMS keystore must contain the certificates of anyone who will be signing or encrypting messages that your app will consume or receiving encrypted messages from your app. Since these are usually internal-facing it might be worthwhile to use a separate keystore for AMS than is used for external-facing entities. Otherwise the two different security models (internal-facing and external-facing) end up trusting each others participants.This is just one example and in general the idea is to construct the keystores based on the specific security model required and using a least-trust principle. You have to balance the cost of maintaining separate keystores against the extra security of maintaining individual ones.\n"} +{"text": "### Human: I have to encrypt messages with WMQ Advanced Message Security. What do I need to do in my program or .bindings file to make it work?### Assistant: Good news - there is nothing to do in your code or .bindings file. WMQ AMS uses interceptors to catch the API calls before they are handed to WMQ. The configuration is entirely external to your program and consists of using an environment variable to point to an ini file. The ini file in turn points to the keystore which can be a jks or IBM's kdb format (such as that used by QMgrs).The various quick start guides outline the steps required to get AMS up and running.Quick Start Guide for WebSphere MQ AMS on UNIX platformsQuick Start Guide for WebSphere MQ AMS on Windows platformsQuick Start Guide for WebSphere MQ AMS with Java clients\n"} +{"text": "### Human: I have an issue where the call the MQQueueManager constructor is hanging if the queue manager is down.I have a TransactionScope open with EnterpriseOptions.Full when I call the constructor to the MQQueueManager. If MQ is down though (or possibly attempts a connect as the QM goes down) then this call hangs. Even if the transaction expires it doesn't raise a timeout exception in the transaction.If I don't have the transaction scope open when I do the connect, I can never get the MQQueueManager to participate in a transaction after that point.SO, if the MQ can go down (which it does....) how can I stop the queue from hanging when I make the connection. I am using the Managed client from MQ 6.0.2.5.I've added some code to make the question clearer:TransactionOptions opt = new TransactionOptions();\nopt.IsolationLevel = IsolationLevel.Serializable;\nopt.Timeout = new TimeSpan(0, 0, 20);\nTransactionScopeOption ScopeOption = TransactionScopeOption.Required;\n\nusing (TransactionScope tran = \n new TransactionScope\n (ScopeOption, \n opt, \n EnterpriseServicesInteropOption.Full))\n{\n //This line hangs if MQ is down, doesn't backout or throw a 2059.\n var m_qMgr = new MQQueueManager(QueueManager, Channel, Hostname);\n tran.Complete();\n}### Assistant: I see two possibilities for the hang. One is that it's lower-level than WMQ and the other is that the WMQ code may have an unhandled exception. Let's look at both of these.Assuming TCP is hanging trying to build the socket, why would it work when WMQ is up but not down? One answer is if the WMQ listener remained up after the QMgr came down. In this case, the listener accepts the socket but has nothing to hand it off to. This is common if the listener is started with runmqlsr rather than as a QMgr listener object. It is practically unavoidable if using inetd as the listener. You didn't mention the version at the QMgr side. What version of WMQ and how is the listener started? What platform is the QMgr running on?The second possibility I'm considering is a mismatch in configuration vs. options. WMQ will perform 1-phase commit with any client install but what you are asking it to do is coordinate with Windows as the transaction controller. In client mode, that requires the Extended Transactional Client (a.k.a. XTC). The XTC component is part of the WMQ Server installation and in fact is licensed as WMQ Server. In other words, if you pay for WMQ server on your Windows host then you are entitled to install the full WMQ server and/or the XTC component there. The XTC component is what supplies the mqic32xa.dll which provides XA transactionality over WMQ client connections.Many times people who are unaware of the licensing implications grab the XA dlls or Java/JMS XA classes and drop them onto their WMQ client installation. If the XA classes are not installed using the WMQ Server media, this can cause unpredictable results such as what you are seeing. This is especially true if the XA support files and the WMQ Client installation are at different fix pack levels or, worse, different versions.How was the XA support installed in your Windows server? If anything less than from the WMQ Server media, you may have an invalid installation. In any case, using the latest Fix Pack would be advisable since 6.0.2.5 is quite old at this point. The fix list for v6.0.2.9 contains several .Net-related APARs includingIZ54336which reads \"AMQ9456 protocol error observed on server and 2018 hconn error on client during mqconn attempt by managed .NET application.\"To properly install WMQ for your application, the proscribed method is to obtain the WMQ v7.0 Server media and install WMQ client from that. Select Extended Transactional Client for the installation. Once complete, then apply the latest Fix Pack. The .Net classes have been integrated into WMQ base product in v7 and are fully supported. Using the server media makes the XA support available when installing the client. In addition to v7 being a much better implementation of .Net, v6 is end-of-life in 12 months so using v7 now will save you from a conversion later or losing support. The v7 client is compatible with a v6 QMgr but you don't get the new v7 functionality, of course.You can do roughly the same thing from the v6 Server media but be sure to install the latest Fix Pack to get the benefit of all the .Net fixes that have been applied. Some of the new v7 functionality has also been provided in the service stream so you get that benefit as well.You can download the WMQ Server trial athttp://bit.ly/WMQTrialYou can download the latest Fix Pack athttp://bit.ly/WMQFixes\n"} +{"text": "### Human: I need to move one single message from an MQ queue to another queue. This other queue may already have existing messages in it. Is there a way to do this?### Assistant: Yes! You can do this at the command-line using the Q program which is supplied asSupportPac MA01or if you would like a GUI you can useSupportPac MO71instead.\n"} +{"text": "### Human: We have 5000+ clients, 10 gateway servers and 6 backend servers. Both gateway and backend Servers are in same cluster. If v7.0.1 is used on clients and gaetway servers, is round robin load balancing possible if CCDT is used? We want distribute load even across all the 10 gateway servers.Thank You### Assistant: Great that you are using WMQ v7.0.1 at both the client and server! The trick to getting load balancing is in how you tag the channels in the CCDT. When you build the CCDT file the QMNAME parameter does not need to match the actual QMgr name. In fact, calling it QMNAME is rather unfortunate because it leads to the expectation that there is some correlation between that and the QMgr name the client connects to. In fact, it is just an index for the client app to use while searching the CCDT.So when you build the CCDT for your 10 QMgrs, each will need a different channel name but use the same QMgr name for all. So for example,DEF CHL(QMGR01.CLNT) CHLTYPE(CLNTCONN) QMNAME(GTWY.QMGR)\nDEF CHL(QMGR02.CLNT) CHLTYPE(CLNTCONN) QMNAME(GTWY.QMGR)\n...\nDEF CHL(QMGR10.CLNT) CHLTYPE(CLNTCONN) QMNAME(GTWY.QMGR)Then when the application needs to connect it specifies GTWY.QMGR as the QMgr name. This resolves to the group of channel entries.OK, so that gets you failover but not load balancing. To get load balancing you will want to set CLNTWGHT and AFFINITY parameters as described in the V7 docs in the sectionExamples of Channel Weighting and Affinity. I would advise reading through the entire parent sectionConnecting WebSphere MQ client applications to queue managers, especially the sections on CCDT and MQCONN.\n"} +{"text": "### Human: am connectting the MQ with below code. I am able connected to MQ successfully. My case is i place the messages to MQ every 1 min once. After disconnecting the cable i get a ResonCode error but IsConnected property still show true. Is this is the right way to check if the connection is still connected ? Or there any best pratcices around that.I would like to open the connection when applicaiton is started keep it open for ever.public static MQQueueManager ConnectMQ() \n{if ((queueManager == null) || (!queueManager.IsConnected)||(queueManager.ReasonCode == 2009)) \n{ \nqueueManager = new MQQueueManager(); \n} \nreturn queueManager; \n}### Assistant: The behavior of the WMQ client connection is that when idle it will appear to be connected until an API call fails or the connection times out. So isConnected() will likely report true until a get, put or inquire call is attempted and fails, at which point QMgr will then report disconnected.The other thing to consider here is that 2009 is not the only code you might get. It happens to be the one you get when the connection is severed but there are connection codes for QMgr shutting down, channel shutting down, and a variety of resource and other errors.Typically for a requirement to maintain a constant connection you would want to wrap the connect and message processing loop inside a try/catch block nested inside a while statement. When you catch an exception other than an intentional exit, close the objects and QMgr, sleep at least 5 seconds, then loop around to the top of the while. The sleep is crucial because if you get caught in a tight reconnect loop and throw hundreds of connection attempts at the QMgr, you can bring even a mainframe QMgr to its knees.An alternative is to use a v7 WMQ client and QMgr. With this combination, automatic reconnection is configurable as a channel configuration.\n"} +{"text": "### Human: Has anyone had any experience of talking between an iSeries (using IBM's Websphere MQ) and PC code - hopefully using Delphi 2009.Modification:I have a large PC based program (that talks to an iSeries) that I need to rewrite. One option would be to do most of the tricky and processor intensive processing on the iSeries and then have that program signal the PC based program (written in Delphi at the moment) to do the part of the processing that are best done on the PC. So I need to signal the final part somehow from the iSeries, without it polling the iSeries all the time.### Assistant: First option: add a Java app to the Delphi side which uses a JMS client to listen to an event topic on the MQ server, which receives acompletemessage from the worker process and forwards this message to the Delphi app (over TCP/IP or other simple IPC methods).Second option: implement a simple web service server in the Delphi app which has only one methodnotify()and call this service from the WebSphere side. An example for a stand-alone SOAP server for Delphi 7 (but can be modified to work with D2009 too) using Indy can be foundhere.\n"} +{"text": "### Human: What are my options for pubsubing (or point to point but pubsub is better) messages to and from an IBM message broker from an embedded headless C/C++ linux client that doesn't have a JVM?Ideally we want\nlarge file transfer (2GB once per day off of the client)\nencryption (SSL)\nreliable ('assured' delivery / QoS2, maybe QoS1 would do)The client in question currently only has exes and some bash scripts, I've been playing with MQTTv3 and RSMB, but for that I'd have to chomp the large files up (and reassemble back home) and I don't want to get into that if there's a transport that will do this for me?I've looked at MQTTv5 (but our client's got no JVM); JMS (no JVM) and XMS? which again looks like it gives me a C API but then needs the JVM to be installed on the client (or am I wrong?)Any clues or hints would be appreciated.### Assistant: Why not just use the WMQ C/C++ API? The WMQ Client install is downloadable asSupportPac MQC7: WebSphere MQ V7.0 Clients. Once you have that, justuse the C APIandcompile as usual. This is all native WMQ base product functionality.Note that the WMQ V7 QMgr with the WMQ v7 client providesmuchbetter interop with JMS, WMQ Broker and so forth, because all message attributes are now message properties and pub/sub is natively supported in WMQ v7 QMgrs. Also, v6 is end-of-life as of Sept 2011 so do as much new development on v7 components as possible to avoid migration later.\n"} +{"text": "### Human: I have a Java application that sets a listener on a queue, theonMessage(Message)gets a subclass ofjavax.jms.TextMessage, how can i make it get a subclass ofjavax.jms.BytesMessageNote: I don't have access to the application that sends the messages.### Assistant: The message type is determined by the sender. If the sender can't change, the received message type can't change.What's the ultimate goal? Can you change how the receiver processes the message to accomplish what you're trying to do? Having the String from a TextMessage, you could useString.getBytes()to get the byte array version of that String.If you want to do anything much more exotic than that, wouldn't you need some cooperation from the sender anyway?\n"} +{"text": "### Human: I need to rejig some VERY old Windows code that uses Perl to talk to MQ. Specifically, I need to be able to install Perl's MQClient::MQSeries, MQSeries::QueueManager, MQSeries::Queue and MQSeries::Message modules.When I fire up Strawberry Perl, go into CPAN and try to install them, I can see that there's several MQ client DLLs that are required for these Perl modules to build. However, they're not on my system, even after downloading and installing the current MQ Client from IBM.It used to be that downloading and installing the MQ Client from IBM gave you the option to install a whole bunch of development libraries (presumably including the bits necessary to install the above Perl libraries), but it seems that's no longer the case. For example, there's no MQM.DLL file anywhere, which is one file that the Perl libraries seem to need to build correctly.Suspect I've probably just not installed the correct MQ Client package to get this stuff, but have no idea where to find it (Google is no help). Any suggestions?### Assistant: MQSeries1.29 was released in 16 Jun 2009, so I guess you can just ask it's maintainer.You can also ask in newsgroup news://news.software.ibm.com/ibm.software.websphere.mq , or ask IBM's support.\n"} +{"text": "### Human: I am wondering about the reliabilty of message delivery in messaging systems such as WebsphereMQ or ActiveMQ (used via JMS). As far as I know messages can be buffered if the recepient is unavailable and will be delivered later.Now I am wondering what happens if the sender temporarily cannot reach the network. Is there some kind of local buffering which will send the messages later? I assume this depends on where the message broker is running. Are there local brokers on all machines or just a central one?To pinpoint my question: Is a messaging system the right choice if I need to ensure, that messages are received eventually, even in the face of temporary network failure? Is there a certain setup required to achieve this reliabilty?Any pointers to relevant documentation would be appreciated.### Assistant: The common solution is called \"store and forward\". In such systems, once you've handed off the message to the local message agent it becomes their responsibility. This agent might not be a full broker. If the messaging system has basic delivery guarantees, the local agent will still need persistent buffering of messages until they're handed off to a real broker.\n"} +{"text": "### Human: We have two systems, one based on JMS and another based on WebSphere MQ.\nThere is client A which sends a message to a topic configured in JMS. Another client B which receives this message through the Topic configured in WebSphere MQ.How can I make this communication happen? What are the considerations while building this bridge? If bridge is the solution, how can I build it?### Assistant: I assume from your description that one of the clients is written in Java (JMS) and the other one is written in an other language and both have access to the same queue. MQ-Series is a queuing product, JMS is a Java API (like JDBC is to relational databases). MQ-Series supports the JMS API so there is no problem in communciating messages. JMS will probably be a subset of possible MQ-Series features.Make sure that the content can be interpreted by both parties. The standard way is to use XML in the message. But you could use any other format that both clients can understand. You could also use CSV (comma separated values), JSON (JavaScript object notation) and there are even cross platform binary formats like Hessian.But if you could be more specific about the participants and the kind of information you want to communicate, you probably would get more specific answers.\n"} +{"text": "### Human: My application is a stand alone Java app, that customers download, install and run. It uses MQ to communicate with a host, which has been working for years. Neither myself nor customers have anything MQ installed on their Windows machines; we include and use com.ibm.mq.jar to do the work.Apparently though, MQ needs a mqji.properties file in the classpath to prevent this :Unable to load message catalog - mqji\ncom.ibm.mq.MQException: Message catalog not foundSo my question is : Where do I get one??### Assistant: Here is a copy of my mqji.properties file.Copy and paste into a text editor.Save as mqji.propertiesPut the directory that this file is in into your CLASSPATH.# mqjiEn_US.properties\n# Messages produced by the Websphere MQ Java interface classes\n# (shared by bindings and by client)\n# Messages beginning with MQJI are explanations for exceptions\n# Messages beginning with MQJE are errors\n#\n# From class MQDistributionList\n#\n1=MQJI001: Queue manager object was null.\n2=MQJI002: Not connected to a queue manager.\n3=MQJI003: No object records supplied.\n4=MQJI004: No response records supplied.\n5=MQJI005: Not enough response records supplied.\n6=MQJI006: An object or response record was null.\n7=MQJI007: openResponse parameter was null.\n8=MQJI008: Null message passed to put.\n9=MQJI009: Null put message options passed to put.\n10=MQJI010: Number of message trackers and response records do not match.\n11=MQJI011: The distribution list has been closed.\n#\n# From class MQEnvironment\n#\n12=Websphere MQ Client for Java v5.3\n#\n# From class MQGetMessageOptions\n#\n13=MQJI013: Unsupported version number - {0}\n14=MQJI014: Insufficient data received from queue manager.\n15=MQJI015: Erroneous eyecatcher : {0}\n#\n# From class MQManagedObject\n#\n16=MQJI016: Object has been closed.\n17=MQJI017: No selectors specified.\n#\n# From class MQMD\n#\n18=MQJI015: Erroneous eyecatcher : {0}\n19=MQJI018: Array copy error in MQMD\n#\n# From class MQMessage\n#\n20=MQJI019: Malformed UTF string in MQMessage::readLine\n21=MQJI020: Unsupported codeset : {0}\n22=MQJI021: String index error occurred during codeset conversion\n23=MQJI015: Erroneous eyecatcher : {0}\n#\n# From class MQOD\n#\n24=MQJI022: Unmatched number of object and response records\n#\n# From class MQPutMessageOptions\n#\n25=MQJI023: Null MQMessageTracker object supplied\n#\n# From class MQMessageTracker\n#\n26=MQJI024: Array copy error in MQMessageTracker\n#\n# From class MQQueue\n#\n27=MQJI025: Null MQMessage passed to get\n28=MQJI026: Null MQGetMessageOptions passed to get\n29=MQJI027: The queue has been closed\n30=MQJI028: Null MQMessage passed to put\n31=MQJI029: Null MQPutMessageOptions passed to put\n#\n# From class MQQueueManager\n#\n32=MQJI030: The queue manager does not support distribution lists.\n#\n# From class MQS390FloatSupport\n#\n33=MQJI031: Number outside of range for double precision S/390 Float\n#\n# From class MQS390PackedDecimalSupport\n#\n34=MQJI032: Invalid sign nibble in packed decimal\n35=MQJI033: Packed Decimal digit outside of range 0-9\n36=MQJI034: Outside of range for short packed decimal (+/-999)\n37=MQJI035: Outside of range for integer packed decimal (+/-9999999)\n38=MQJI036: Outside of range for long packed decimal (0+/-999999999999999)\n#\n# From class MQException\n#\n39=MQJE001: Completion Code {0}, Reason {1}\n40=MQJE001: An MQException occurred: Completion Code {0}, Reason {1}\\n{2}\n#\n# Messages produced by client only classes...\n#\n41=MQJI037: Error occurred during Websphere MQ API call - reason code {0}\n42=MQJI038: Unexpected internal error during string index processing\n43=MQJE002: Socket output stream was null\n44=MQJE003: IO error transmitting message buffer\n45=MQJE004: Socket input stream was null\n46=MQJE005: TSH eyecatcher not found. Eyecatcher was {0}\n47=MQJE006: Internal error during array copy\n48=MQJE007: IO error reading message data\n49=MQJE008: IOException whilst sending status message\n50=MQJE009: Failed to build API header\n51=MQJE010: Unknown host: {0}\n52=MQJE011: Socket connection attempt refused\n53=MQJE012: Security error - cannot connect to host {0}\n54=MQJE013: Error accessing socket streams\n55=MQJE014: Control Point rejected connection\n56=MQJE015: Error connecting to Control Point\n57=MQJE016: MQ queue manager closed channel immediately during connect\\n\\Closure reason = {0}\n58=MQJE017: MQ queue manager sent status error {0} during connect\n59=MQJE018: Protocol error - unexpected segment type received\n60=MQJE019: Error creating initial data segment\n61=MQJE020: CCSID not supported by queue manager\n62=MQJE021: Encoding not supported by queue manager\n63=MQJE022: FAP level not supported by queue manager\n64=MQJE023: Negotiation failed on maximum messages per batch\n65=MQJE024: Sequence wrap value not supported by queue manager\n66=MQJE025: Channel closed after two initial changes. Closure reason {0}\n67=MQJE026: Queue manager sent status error {0} during connect\n68=MQJE027: Queue manager security exit rejected connection with error code {0}\n69=MQJE028: Channel closed during security exchanges\n70=MQJE029: Unexpected message type sent by queue manager\n71=MQJE030: IOException during security flows\n72=MQJE031: Security exit closed the channel\n73=MQJE032: Queue manager security exit rejected connection with reason code {0}\n74=MQJE033: A required security flow was not sent by the queue manager\n75=MQJE034: Unexpected message type sent by queue manager\n76=MQJE035: Negotiated maximum transmission size is too small\n77=MQJE036: Queue manager rejected connection attempt\n78=MQJE037: Remote queue manager closed the connection\n79=MQJE038: Unexpected segment type {0} received\n80=MQJE039: IOException whilst building connection data stream\n81=MQJE040: Channel closed by exit\n82=MQJE041: Unsupported version number - (0)\n83=MQJE042: Erroneous eyecatcher: {0}\n84=MQJE043: Insuffucient data received from queue manager\n85=MQJE044: Array copy error in MQMD\n86=MQJE045: Malformed UTF string\n87=MQJE046: Unsupported codeset : {0}\n88=MQJE047: String index error occurred during codeset conversion\n89=MQJE048: Invalid sign nibble in packed decimal\n90=MQJE049: Packed Decimal digit outside of range 0-9\n91=MQJE050: Outside of range for short packed decimal (+/-999)\n92=MQJE051: Outside of range for integer packed decimal (+/-9999999)\n93=MQJE052: Outside of range for long packed decimal (0+/-999999999999999)\n94=Websphere MQ Bindings for Java v5.3\n95=MQJE053: The Websphere MQ Bindings for Java library could not be loaded\n96=MQJE054: The queue manager does not support distribution lists\n97=MQJE055: The queue manager does not support version 2 Websphere MQ API structures\n98=MQJE056: Initial negotiation failure\n99=MQJE057: Channel closed during security exchanges\n100=MQJE058: Invalid number of object or response records\n101=MQJE059: String index error\n102=MQJE060: Could not find class {0}\n103=MQJE061: Could not find field {0}\n104=MQJE062: Could not find method {0}\n#\n# Messages used by MQManagedConnectionJ11, ManagedConnectionFactories\n# and MQManagedConnectionMetaData\n#\n105=MQJI039: Invalid ConnectionRequestInfo object\n106=MQJI040: MQManagedConnection already destroyed\n107=MQJI041: Method {0} is not supported by Websphere MQ Classes for Java\n108=MQJI042: MQManagedConnection is not reusable\n#\n# Messages from MQManagedConnectionMetaData\n#\n109=IBM Websphere MQ\n110=Command Level {0}\n#\n# Messages from MQXAi\n#\n111=Security manager prevented access to native methods library for MQ XA support.\n112=Failed to load native methods library for MQ XA support.\n#\n# Messages from MQXAResource\n#\n113=xa_open failed\n114=XA operation failed, see errorCode\n115=XAResource closed\n\n#\n# Messages produced by com.ibm.mq.MQMsg2\n#\n116=MQJE063: Unsupported character set {0}\n117=MQJE064: Unsupported version of MQMD structure {0}\n118=MQJE065: Inconsistent internal state detected\n\n# message when server doesn't support client XA\n119=client connection not XA enabled\n\n#\n# Messages produced via SSL options on a client connection\n#\n120=MQJE066: {0} provided as an unsupported object type\n121=MQJE067: Peer name {0} did not match requested name {1}\n122=MQJE068: Server certificate has been revoked\n123=MQJE069: Unable to contact CertStore\n124=MQJE070: SSL Protocol error: Channel not configured for SSL?\n"} +{"text": "### Human: I am attempting to update my IBM MQ application running on .NET from the amqmdnet.dll to the amqmdnetstd.dll from the nuget package \"IBMMQDotnetClient\". After making the update, I receive the following Exception when attempting to 'new' the MQQueueManager :Exception thrown: 'IBM.WMQ.MQException' in amqmdnetstd.dll: 'MQRC_SSL_INITIALIZATION_ERROR'\n at IBM.WMQ.MQQueueManager.Connect(String queueManagerName)\n at IBM.WMQ.MQQueueManager..ctor(String queueManagerName, Hashtable properties)My code is essentially identical to the .NET sample code given by IBM for a managed client.My amqmdnet.dll was version 9.0.0.2 and I'm attempting to migrate to amqmdnetstd.dll v9.3.3. I'm running the application on Windows.In the Trace log I see the following error:000001C1 17:27:55.575445 145264.43 SSL Server Certificate validation failed - RemoteCertificateNameMismatch, RemoteCertificateChainErrors\n000001C2 17:27:55.575464 145264.43 ------------} MQEncryptedSocket.ClientValidatingServerCertificate(Object,X509Certificate,X509Chain,SslPolicyErrors) rc=OK\n000001C3 17:27:55.579448 145264.43 System.Security.Authentication.AuthenticationException: The remote certificate was rejected by the provided RemoteCertificateValidationCallback.I'm using the same cipher as before - TLS_RSA_WITH_AES_256_CBC_SHA256. As far as I can tell, this is still a valid CipherSpec.I am wondering if anyone is aware of some breaking change between the IBMMQDotnetClient versions that would be causing an SSL Issue like this? I read through the changes between each version and was unable to find anything.I've tried different CipherSpecs, including TLS_RSA_WITH_AES_128_CBC_SHA256 and just using ANY_TLS12_OR_HIGHER. I've double checked the label on the cert matches the label that my application is looking for.### Assistant: I've managed to resolve the issue, we didn't have the root and intermediate certificates from the server installed in the \"Trusted Root Certification Authorities\" folder in windows. This begs the question how it worked previously without the certificates, I'm thinking MQ was previously looking in a different location for certificates and after updating it was no longer looking in this location.\n"} +{"text": "### Human: So, I have a message that I'm sending over an IBM mq queue and I would like to give it a customised MessageID. I've implemented DestinationResolver with the below properties in order to enable MQMD properties:queue.setBooleanProperty(WMQConstants.WMQ_MQMD_WRITE_ENABLED, true);I'm able to set theJMS_IBM_MQMD_ApplIdentityDataheader but I'm struggling to set theJMS_IBM_MQMD_MsgIdheader.This is the MessageID I'm trying to set:String messageID = \"ID:TESTYTEST\";If I setJMS_IBM_MQMD_MsgIdlike this:message.setAttribute(\"JMS_IBM_MQMD_MsgId\", messageID.getBytes());then I get the below errororg.apache.camel.component.jms.JmsBinding - Ignoring non primitive header: JMS_IBM_MQMD_MsgId of class: [BHowever, if I setJMS_IBM_MQMD_MsgIdlike this:message.setAttribute(\"JMS_IBM_MQMD_MsgId\", messageID);then I get the below errorcom.ibm.msg.client.jms.DetailedMessageFormatException: JMSCC0051: The property 'JMS_IBM_MQMD_MsgId' should be set using type '[B', not 'java.lang.String'. JMS_IBM properties may only be set using a specific variable type. Correct application code to use the required variable type when setting this JMS_IBM property.### Assistant: First of all - MessageId is array of 24 bytes. And that is your error. You are trying to push String in byte array - [B. Once you fix this error, you will still not be able to successfully set MessageId. As MQ will completely ignore any value set by message producer, and it will always override your MessageId with arbitary value.Blame JMS API. It is little bit idiotic and it doesn't make distiction between end user interface and messaging driver programmer interface. There is more than one setter on javax.jms.Message which is not inteded to be used by everday Joe.So what can you do about it? For start you can use different field: Message Type and CorrelationID headers are inteded to be used by end users. CorrelationID shares the same byte[24] design, and it is functionally identical to MessageID. Usually, CorrelationID is shared between couple different messages which are \"correleated\", thus the name. You can also add arbitary header to message.But if you really really need to know MessageID of sent message - because of audit, correlation or something else - you can first send message, and the read MessageID field back. It will contain generated value.\n"} +{"text": "### Human: I am getting below error when I am trying to connect to IBM-MQ deployed on openshift.\nHere I am trying to use user id of container: 1000440000.SET CHLAUTH(QM1_AMIT.SVRCONN) TYPE(ADDRESSMAP) ADDRESS('*') MCAUSER('1000440000')----- amqzmgr0.c : 2996 -------------------------------------------------------\n03/27/23 14:31:35 - Process(2970521.4) User(1000440000) Program(amqrmppa)\n Host(amit-ibm-mq-0) Installation(Installation1)\n VRMF(9.2.3.0) QMgr(QM1_AMIT)\n Time(2023-03-27T14:31:35.436Z)\n RemoteHost(10.104.14.15)\n CommentInsert1(QM1_AMIT.SVRCONN)\n CommentInsert2(10.104.14.15)\n CommentInsert3(MCAUSER(1000440000) CLNTUSER(1000440000))\n \nAMQ9776E: Channel was blocked by userid\n\nEXPLANATION:\nThe inbound channel 'QM1_AMIT.SVRCONN' was blocked from address '10.104.14.15'\nbecause the active values of the channel were mapped to a userid which should\nbe blocked. The active values of the channel were 'MCAUSER(1000440000)\nCLNTUSER(1000440000)'.Display output ofCHLAUTH:dis chlauth(*) all\n 1 : dis chlauth(*) all\nAMQ8878I: Display channel authentication record details.\n CHLAUTH(QM1_AMIT.SVRCONN) TYPE(ADDRESSMAP)\n DESCR( ) CUSTOM( )\n ADDRESS(*) MCAUSER(1000440000)\n USERSRC(MAP) CHCKCLNT(ASQMGR)\n ALTDATE(2023-03-27) ALTTIME(14.31.05)\nAMQ8878I: Display channel authentication record details.\n CHLAUTH(SYSTEM.ADMIN.SVRCONN) TYPE(ADDRESSMAP)\n DESCR(Default rule to allow MQ Explorer access)\n CUSTOM( ) ADDRESS(*)\n USERSRC(CHANNEL) CHCKCLNT(ASQMGR)\n ALTDATE(2023-03-27) ALTTIME(14.30.31)\nAMQ8878I: Display channel authentication record details.\n CHLAUTH(SYSTEM.*) TYPE(ADDRESSMAP)\n DESCR(Default rule to disable all SYSTEM channels)\n CUSTOM( ) ADDRESS(*)\n USERSRC(NOACCESS) WARN(NO)\n ALTDATE(2023-03-27) ALTTIME(14.30.31)\nAMQ8878I: Display channel authentication record details.\n CHLAUTH(*) TYPE(BLOCKUSER)\n DESCR(Default rule to disallow privileged users)\n CUSTOM( ) \n USERLIST(*MQADMIN) WARN(NO)\n ALTDATE(2023-03-27) ALTTIME(14.30.31)Is there any mechanism by which I can use the users of container to connect IBM-MQ from java client or any other way to skip the user.Regards,\nAmit M### Assistant: If I understand correctly your queue manager is running in the container and runs under a user1000440000. You have specified aADDRESSMAPrule to set theMCAUSERto1000440000. In this case since1000440000is what the queue manager runs under it is the user with full MQ Admin rights. The default BLOCKUSER rule blocks all admin users and is causing your channel blocked error.There is a feature in 9.3 LTS (9.2.1 CD) which allows you to use arbitrary users and provide low privileged access which is better than giving them full access. Usually you would want some authentication of the incoming connection above and beyond the IP address. You could use a certificate. You could configure the queue manger to use LDAP and provide a username and password.This blog by Mark Taylor describes the feature.More flexibility for user management in MQ\n"} +{"text": "### Human: In continuation to my earlier post:how to connect to queue manager with TLS enabled in ibm-mqMy IBM-MQ is configured to use SSL for cipher:TLS_RSA_WITH_AES_256_CBC_SHA256ALTER CHL(MYSSL.SVRCONN) CHLTYPE(SVRCONN) SSLCIPH(TLS_RSA_WITH_AES_256_CBC_SHA256)Wanted to know in my java code which is connecting to IBM-MQ configured in TLS, in below line:MQEnvironment.sslCipherSuite = \"TLS_RSA_WITH_AES_128_CBC_SHA256\";Is there any way where I can mention in my java client I will mention some generic cipher where I can connect to IBM-MQ by whatever cipher is mentioned in configuring IBM-MQ server channel.I tried vice versa, like in IBM-MQ client I gave cipher name as \"ANY\" as its officially supported by ibm-mq in their supported cipher list:https://www.ibm.com/docs/en/ibm-mq/9.2?topic=jms-tls-cipherspecs-ciphersuites-in-mq-classes#q113220___d366e918ALTER CHL(MYSSL.SVRCONN) CHLTYPE(SVRCONN) SSLCIPH(TLS_RSA_WITH_AES_256_CBC_SHA256So like in IBM-MQ side I can give ANY, I can connect to it by any cipher suite provided in my java client.Is there any way where I can provide generic cipher like \"ANY\" at java client side? So that whatever cipher is configured at IBM-MQ side I can connect to it.Thanks,\nAmit M### Assistant: If you set any of the*ANYvalues on the client side you must have anANYvalue on the queue manager side. You can have anANYvalue on the queue manager a specific cipher on the client, but it won't work the other way.I suggest you useANY_TLS12_OR_HIGHERon the SVRCONN and*TLS12ORHIGHERon the java client. (Note the*is part of the the java cipher value)\n"} +{"text": "### Human: I recently posted thisHow to reconnect to all IBM MQ queue managers in a clusterquestion and I was suggested that a uniform cluster would be the solution. Reading through the docs it seemed to be exactly what we need.Our infrastructure guys configured the uniform cluster and I am trying to connect to it and test the functionality.To connect to that I created a json CCDT file similar with below:{\n \"channel\":\n [\n {\n \"general\":\n {\n \"description\": \"My channel\",\n \"maximumMessageLength\": 4194304\n },\n \"name\": \"CHANNEL.NAME\",\n \"clientConnection\":\n {\n \"connection\":\n [\n {\n \"host\": \"server1\",\n \"port\": 1414\n }\n ],\n \"queueManager\": \"QM1\"\n },\n \"transmissionSecurity\":\n {\n \"cipherSpecification\": \"TLS_AES_256_GCM_SHA384\"\n },\n \"type\": \"clientConnection\"\n },\n {\n \"general\":\n {\n \"description\": \"My channel\",\n \"maximumMessageLength\": 4194304\n },\n \"name\": \"CHANNEL.NAME\",\n \"clientConnection\":\n {\n \"connection\":\n [\n {\n \"host\": \"server2\",\n \"port\": 1414\n }\n ],\n \"queueManager\": \"QM2\"\n },\n \"transmissionSecurity\":\n {\n \"cipherSpecification\": \"TLS_AES_256_GCM_SHA384\"\n },\n \"type\": \"clientConnection\"\n },\n {\n \"general\":\n {\n \"description\": \"My channel\",\n \"maximumMessageLength\": 4194304\n },\n \"name\": \"CHANNEL.NAME\",\n \"clientConnection\":\n {\n \"connection\":\n [\n {\n \"host\": \"server3\",\n \"port\": 1414\n }\n ],\n \"queueManager\": \"QM3\"\n },\n \"transmissionSecurity\":\n {\n \"cipherSpecification\": \"TLS_AES_256_GCM_SHA384\"\n },\n \"type\": \"clientConnection\"\n },\n {\n \"general\":\n {\n \"description\": \"My channel\",\n \"maximumMessageLength\": 4194304\n },\n \"name\": \"CHANNEL.NAME\",\n \"clientConnection\":\n {\n \"connection\":\n [\n {\n \"host\": \"server1\",\n \"port\": 1414\n },\n {\n \"host\": \"server2\",\n \"port\": 1414\n },\n {\n \"host\": \"server3\",\n \"port\": 1414\n }\n ],\n \"queueManager\": \"*\"\n },\n \"transmissionSecurity\":\n {\n \"cipherSpecification\": \"TLS_AES_256_GCM_SHA384\"\n },\n \"type\": \"clientConnection\"\n }\n ]\n}In other words I was trying to create a client connection to each queue manager and a forth one to the group of three queue managers. Initially this entry was not in the file \"queueManager\": \"*\" but when trying to run I was gettingmissing required attribute. That made me put that \" * \". The error went away however I am still unable to connect which make me think that my CCDT config is wrong. On the client side I have thisConnectionFactorycreation:connectionFactory.setTransportType(WMQ_CM_CLIENT);\n if (Objects.isNull(ccdtUrl)) {\n connectionFactory.setConnectionNameList(connectionNameList);\n connectionFactory.setChannel(queueManagerChannel);\n connectionFactory.setPort(connectionPort);\n } else {\n connectionFactory.setCCDTURL(ccdtUrl);\n }\n connectionFactory.setCCSID(1208);\n connectionFactory.setClientReconnectOptions(WMQ_CLIENT_RECONNECT_Q_MGR);\n connectionFactory.setClientReconnectTimeout(reconnectTimeout);\n connectionFactory.setAppName(applicationName);\n\n if (sslEnabled) {\n connectionFactory.setSSLCipherSuite(sslCipherSuite);\n connectionFactory.setSSLFipsRequired(sslFipsRequired);\n System.setProperty(\"com.ibm.mq.cfg.useIBMCipherMappings\", useIBMCipherMappings);\n }Can you advise about what I am doing wrong and how can I fix it. I haven't used CCDT before.Thank you in advance.UPDATEFollowing the provided answer and the comments I ended up with this CCDT definition:{\n \"channel\":\n [\n {\n \"connectionManagement\":\n {\n \"clientWeight\": 10,\n \"affinity\": \"none\"\n },\n \"general\":\n {\n \"description\": \"My channel\",\n \"maximumMessageLength\": 4194304\n },\n \"name\": \"CHANNEL.NAME\",\n \"clientConnection\":\n {\n \"connection\":\n [\n {\n \"host\": \"server1\",\n \"port\": 1415\n }\n ],\n \"queueManager\": \"QM1\"\n },\n \"transmissionSecurity\":\n {\n \"cipherSpecification\": \"TLS_AES_256_GCM_SHA384\"\n },\n \"type\": \"clientConnection\"\n },\n {\n \"connectionManagement\":\n {\n \"clientWeight\": 10,\n \"affinity\": \"none\"\n },\n \"general\":\n {\n \"description\": \"My channel\",\n \"maximumMessageLength\": 4194304\n },\n \"name\": \"CHANNEL.NAME\",\n \"clientConnection\":\n {\n \"connection\":\n [\n {\n \"host\": \"server2\",\n \"port\": 1415\n }\n ],\n \"queueManager\": \"QM2\"\n },\n \"transmissionSecurity\":\n {\n \"cipherSpecification\": \"TLS_AES_256_GCM_SHA384\"\n },\n \"type\": \"clientConnection\"\n },\n {\n \"connectionManagement\":\n {\n \"clientWeight\": 10,\n \"affinity\": \"none\"\n },\n \"general\":\n {\n \"description\": \"My channel\",\n \"maximumMessageLength\": 4194304\n },\n \"name\": \"CHANNEL.NAME\",\n \"clientConnection\":\n {\n \"connection\":\n [\n {\n \"host\": \"server3\",\n \"port\": 1415\n }\n ],\n \"queueManager\": \"QM3\"\n },\n \"transmissionSecurity\":\n {\n \"cipherSpecification\": \"TLS_AES_256_GCM_SHA384\"\n },\n \"type\": \"clientConnection\"\n },\n {\n \"connectionManagement\":\n {\n \"clientWeight\": 10,\n \"affinity\": \"none\"\n },\n \"general\":\n {\n \"description\": \"My channel\",\n \"maximumMessageLength\": 4194304\n },\n \"name\": \"CHANNEL.NAME\",\n \"clientConnection\":\n {\n \"connection\":\n [\n {\n \"host\": \"server1\",\n \"port\": 1415\n }\n ],\n \"queueManager\": \"QMGROUP\"\n },\n \"transmissionSecurity\":\n {\n \"cipherSpecification\": \"TLS_AES_256_GCM_SHA384\"\n },\n \"type\": \"clientConnection\"\n },\n {\n \"connectionManagement\":\n {\n \"clientWeight\": 10,\n \"affinity\": \"none\"\n },\n \"general\":\n {\n \"description\": \"My channel\",\n \"maximumMessageLength\": 4194304\n },\n \"name\": \"CHANNEL.NAME\",\n \"clientConnection\":\n {\n \"connection\":\n [\n {\n \"host\": \"server2\",\n \"port\": 1415\n }\n ],\n \"queueManager\": \"QMGROUP\"\n },\n \"transmissionSecurity\":\n {\n \"cipherSpecification\": \"TLS_AES_256_GCM_SHA384\"\n },\n \"type\": \"clientConnection\"\n },\n {\n \"connectionManagement\":\n {\n \"clientWeight\": 10,\n \"affinity\": \"none\"\n },\n \"general\":\n {\n \"description\": \"My channel\",\n \"maximumMessageLength\": 4194304\n },\n \"name\": \"CHANNEL.NAME\",\n \"clientConnection\":\n {\n \"connection\":\n [\n {\n \"host\": \"server3\",\n \"port\": 1415\n }\n ],\n \"queueManager\": \"QMGROUP\"\n },\n \"transmissionSecurity\":\n {\n \"cipherSpecification\": \"TLS_AES_256_GCM_SHA384\"\n },\n \"type\": \"clientConnection\"\n }\n ]\n}And this connection factory implementation on the client side:connectionFactory.setTransportType(WMQ_CM_CLIENT);\n if (Objects.isNull(ccdtUrl)) {\n connectionFactory.setConnectionNameList(connectionNameList);\n connectionFactory.setChannel(queueManagerChannel);\n connectionFactory.setPort(connectionPort);\n if (sslEnabled) {\n connectionFactory.setSSLCipherSuite(sslCipherSuite);\n connectionFactory.setSSLFipsRequired(sslFipsRequired);\n System.setProperty(\"com.ibm.mq.cfg.useIBMCipherMappings\", useIBMCipherMappings);\n }\n } else {\n connectionFactory.setCCDTURL(ccdtUrl);\n connectionFactory.setQueueManager(\"*QMGROUP\");\n }\n connectionFactory.setCCSID(1208);\n connectionFactory.setClientReconnectOptions(WMQ_CLIENT_RECONNECT);\n connectionFactory.setClientReconnectTimeout(reconnectTimeout);\n connectionFactory.setAppName(applicationName);When deployed we were able to process a message, then we started seeing lots of connection broken exceptions, the service became unhealthy and being restarted.Caused by: com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2009' ('MQRC_CONNECTION_BROKEN').At this point I am not sure if this was caused by my CCDT configuration and or the way I created connection factory or by the way the cluster was configured. We know that the cluster works OK when the connection factory is not driven by CCDT.Any advice much appreciated.### Assistant: You need to have a CCDT with n x 2 entries.1 entry for each individual queue manager with the queue manager name set to the REAL queue manager name (as you have)1 entry for each individual queue manager with the queue manager name set to the group name - anything you want, I tend to use the Uniform Cluster name.So just duplicate the first three entries, and then edit the queue manager names.Also, in your client program, do not set any channel attributes, e.g. channel name, connection name, port number, ssl cipher, as those attributes all come from the CCDT. That looks like what you are doing, but I thought I'd mention it explicitly as I'm not sure where yoursslEnabledboolean is coming from.Ensure your reconnect options are not limited to the queue manager, but allow the connection to be sent to another queue manager, so useWMQ_CLIENT_RECONNECTrather thanWMQ_CLIENT_RECONNECT_Q_MGR.And as @JoshMc said in his comment, ensure your connect is made using a queue manager name of the group name, whatever it was you chose.For further reading, this blog post released by Hursley, at the time JMS was supported by Application Rebalancing, might be of interest.Rebalancing JMS applications within a MQ Uniform Cluster in MQ 9.1.3\n"} +{"text": "### Human: I face this MQJE001: Completion Code '2', Reason '2538' when I create new MQQueueManager using hashmaps,here is my code snippet:I run using this code:static private int PORT = 1417; \nstatic private String HOST = \"localhost\"; \nstatic private String QMANAGER = \"QM1\"; \nstatic private String QUEUE = \"Q1\";\n\nstatic private Hashtable props = new Hashtable();\nstatic MQQueueManager qMgr = null;\n\nprops.put(MQConstants.CHANNEL_PROPERTY, CHANNEL); \nprops.put(MQConstants.PORT_PROPERTY, PORT); \nprops.put(MQConstants.HOST_NAME_PROPERTY, HOST);\n\nMQQueueManager qMgr = null; \nqMgr = new MQQueueManager(QMANAGER, props);\n\nint openOptions = MQConstants.MQOO_OUTPUT; \nMQQueue queue = qMgr.accessQueue(QUEUE, openOptions); \nMQPutMessageOptions pmo = new MQPutMessageOptions();\n\npmo.options = MQConstants.MQPMO_ASYNC_RESPONSE;\n\n// create message \nMQMessage mqMessage = new MQMessage(); \nString message =\"Test\"; \nSystem.out.println(\"Writing message to queue: \" + QUEUE);\n\n// Message Send\nmqMessage.writeString(message);\n\nqueue.put(mqMessage, pmo); \nqueue.close();### Assistant: Did you start the MQ listener on port 1417? Update your question with either a screenshot from MQ Explorer or from issuing the MQSC command:DIS LSSTATUS(*)then take what was returned and issue the following MQSC command:DIS LISTENER(???)where ??? is the listener name from the listener status command.You are using 'localhost' for the host value. Did you try 127.0.0.1 because localhost may not be defined in your 'hosts' file.As Josh asked you, can you telnet to port 1417? If not then you will need to open a port in your firewall.\n"} +{"text": "### Human: I have a dotnet 6 application that works well from local machine in terms of connecting with MQ series queue manager. But when I host the app within linux docker container, the application can't establish connectivity with queue manager and fails with error :MQRC_HOST_NOT_AVAILABLE Reason:2538Are there any suggestions or pointers ?I wanted to disable firewall within container, but iptables command doesn't seem to be working within linux docker container with dotnet 6 image.### Assistant: Queue manager is on premise and not on container.\nI managed to resolve my issue by adding a hosts file entry in docker container. The hostname of queue manager client connection tab file was not resolving to a valid IP address. Hence I added a mapping in etc/hosts which resolved the problem.\n"} +{"text": "### Human: I need to install the certificate to the personal store of CurrentUser in openshift4 pod. When I run the below code, it throws the error.private static void InstallCertificate(string cerFileName, string friendlyName)\n {\n X509Store store = new X509Store(StoreName.My, StoreLocation.CurrentUser);\n store.Open(OpenFlags.ReadOnly);\n try\n {\n X509Certificate2 certificate = new X509Certificate2(cerFileName, \"<>\");\n if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !string.IsNullOrEmpty(friendlyName))\n {\n certificate.FriendlyName = friendlyName;\n }\n store.Open(OpenFlags.ReadWrite);\n store.Add(certificate);\n }\n catch (Exception ex)\n {\n Console.WriteLine($\"Error in adding cert: {ex.Message}\");\n }\n store.Close();\n }Code is in a .NET 6 console application. This certificate will be used for SSL authentication required for connecting to MQ from OCP4 pod.Error Message:The X509 certificate could not be added to the store.Error:System.Security.Cryptography.CryptographicException: The X509 certificate could not be added to the store.\n ---> System.UnauthorizedAccessException: Access to the path '/.dotnet/corefx/cryptography/x509stores/my' is denied.\n ---> System.IO.IOException: Permission denied\n --- End of inner exception stack trace ---\n at System.IO.FileSystem.CreateDirectory(String fullPath)\n at System.IO.Directory.CreateDirectory(String path)\n at Internal.Cryptography.Pal.DirectoryBasedStoreProvider.AddCertToStore(ICertificatePal certPal)\n at Internal.Cryptography.Pal.DirectoryBasedStoreProvider.Add(ICertificatePal certPal)\n --- End of inner exception stack trace ---\n at Internal.Cryptography.Pal.DirectoryBasedStoreProvider.Add(ICertificatePal certPal)\n at System.Security.Cryptography.X509Certificates.X509Store.Add(X509Certificate2 certificate)### Assistant: I was able to resolve the issue using the below steps:Added the command to create the .dotnet folder only in the dockerfile. (This created the folder .dotnet in the root directory.)RUN mkdir /.dotnetAdded the below command to provide the permission to root group for the .dotnet folderRUN chgrp -R 0 /.dotnet && \\\n chmod -R g=u /.dotnetBy default the container started in OpenShift gets a random user ID. Therefore images not designed to handle such a random UID will fail with permission errors. Adding the given command to the Dockerfile sets the directory and file permissions to allow users in the root group to access them in the built image. Because the container user is always a member of the root group, the container user can read and write these files. The root group does not have any special permissions (unlike the root user) so there are no security concerns with this arrangement.After adding the above two commands in the dockerfile, the code ran without any issues.I have collated all the steps that might help others!\n"} +{"text": "### Human: I am trying to connect to MQ using MQ managed client which refers to the certificate from certificate store. I have created the docker image for the code and now wondering how to push the certificate along with it.End goal is to deploy the image to the openshift pod.Hashtable properties = new Hashtable();\nproperties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\nproperties.Add(MQC.HOST_NAME_PROPERTY, \"XXXXXXXXXXXX\");\nproperties.Add(MQC.PORT_PROPERTY, \"XXXX\");\nproperties.Add(MQC.CHANNEL_PROPERTY, \"XXXXX\");\n\n//SSL\nproperties.Add(MQC.SSL_CERT_STORE_PROPERTY, \"*USER\");\nproperties.Add(MQC.SSL_CIPHER_SPEC_PROPERTY, \"TLS_RSA_WITH_AES_256_CBC_SHA256\");\nproperties.Add(MQC.SSL_PEER_NAME_PROPERTY,\"XXXXXX\");\nproperties.Add(MQC.SSL_RESET_COUNT_PROPERTY, 0);\n\nqueueManager = new MQQueueManager(QueueManagerName, properties);The code is working fine directly without any issues but I am not aware of how to proceed with docker image.UPDATE-1Client Logs:\nSSL Server Certificate validation failed -RemoteCertificateNameMismatch, RemoteCertificateChainErrors\n0000016A 08:51:43.609321 54.1 ------------} MQEncryptedSocket.ClientValidatingServerCertificate(Object,X509Certificate,X509Chain,SslPolicyErrors) rc=OK\n0000016B 08:51:43.610594 54.1 System.Security.Authentication.AuthenticationException: The remote certificate was rejected by the provided RemoteCertificateValidationCallback.\n at System.Net.Security.SslStream.SendAuthResetSignal(ProtocolToken message, ExceptionDispatchInfo exception)\n at System.Net.Security.SslStream.CompleteHandshake(SslAuthenticationOptions sslAuthenticationOptions)\n at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthenticationData, Boolean isApm)\n at System.Net.Security.SslStream.AuthenticateAsClient(SslClientAuthenticationOptions sslClientAuthenticationOptions)\n at System.Net.Security.SslStream.AuthenticateAsClient(String targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation)\n at IBM.WMQ.Nmqi.MQEncryptedSocket.MakeSecuredConnection()\n0000016C 08:51:43.610655 54.1 -----------} MQEncryptedSocket.MakeSecuredConnection() rc=OK\n0000016D 08:51:43.610803 54.1 System.Security.Authentication.AuthenticationException: The remote certificate was rejected by the provided RemoteCertificateValidationCallback.\n at IBM.WMQ.Nmqi.MQEncryptedSocket.MakeSecuredConnection()\n at IBM.WMQ.Nmqi.MQEncryptedSocket..ctor(NmqiEnvironment env, MQTCPConnection conn, Socket socket, MQChannelDefinition mqcd, MQSSLConfigOptions sslConfigOptions)\n at IBM.WMQ.MQTCPConnection.ConnectSocket(String localAddr, String connectionName, Int32 options)### Assistant: Finally, I was able to resolve the issue with the below steps:Add the root CA and sub CA certs to the CA certificate folder of the container and run the update-ca-certificates. (Make sure you copy all the CA and intermediate certificates to the ca-certificates folder)docker cp \"<>\\<>.crt\" <>:/usr/local/share/ca-certificates/<>.crt\nupdate-ca-certificates --fresh --verboseInstall the certificate used for SSL authentication of MQ to the personal store of the Current User using the below code.private static void InstallCertificate(string cerFileName, string friendlyName)\n {\n X509Store store = new X509Store(StoreName.My, StoreLocation.CurrentUser);\n store.Open(OpenFlags.ReadOnly);\n try\n {\n X509Certificate2 certificate = new X509Certificate2(cerFileName, \"<>\");\n if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !string.IsNullOrEmpty(friendlyName))\n {\n certificate.FriendlyName = friendlyName;\n }\n store.Open(OpenFlags.ReadWrite);\n store.Add(certificate);\n }\n catch (Exception ex)\n {\n Console.WriteLine($\"Error in adding cert: {ex.Message}\");\n }\n store.Close();\n }Update the cipherstring in the container to match with the required Cipherstring for the MQ. In my case it was TLS_RSA_WITH_AES_256_CBC_SHA256/etc/ssl/openssl.cnf\nCipherString = AES256-SHA256Thanks @JoshMc for providing the helpful links. Hope this helps!\n"} +{"text": "### Human: During high load, we see that the MQQueueConnectionFactory suddenly trying to connect to default MQ port 1414 instead of the assigned port.Background:We use Websphere 9.0.5.13 to deploy an ear file. Java version: 8.0.7.15.\nThe server in this Websphere communicate to external IBM MQ. We use IBM MQ library version: com.ibm.mq.allclient-9.2.5.0.jar.\nWe connect to 3 different IBM MQ queue managers and hundreds of channels. We don't use IBM MQ default port numbers i.e. 1414. Instead, we override it to some other ports.\nWe always use new MQQueueConnectionFactory before we send to a queue, and close the sender, session, and connection afterwards.Issue:At the start of server, we process multiple queues simultaneously. Most of the time, this causes:JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2538' ('MQRC_HOST_NOT_AVAILABLE').Digging deeper, it is because the MQQueueConnectionFactory try to connect to default port 1414 instead of the correct port we have configured.Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2538;AMQ9204: Connection to host 'ecpmq2(1414)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2538;AMQ9204: Connection to host 'hostname******/ipaddr***...:1414' rejected. [1=java.net.ConnectException[A remote host did not respond within the timeout period. (Connection timed out)],3=hostname***/ipaddr***...:1414,4=TCP,5=Socket.connect]],3=hostname***(1414),4=,5=RemoteTCPConnection.bindAndConnectSocket]I tried to replicate the scenario in local PC and our test env, but to no avail.Sample Code:This is the code that we have. Yes, the code is farcry from being efficient, but it still does not explain why suddenly the MQ try to connect to default port.for (String msg : messages) {\n MQQueueConnectionFactory queueConnectionFactory = null;\n MQQueueConnection mqConn = null;\n try {\n queueConnectionFactory = new MQQueueConnectionFactory();\n queueConnectionFactory.setQueueManager(queueInfo.getQueueManager());\n queueConnectionFactory.setHostName(queueInfo.getHostname());\n queueConnectionFactory.setPort(queueInfo.getPort());\n queueConnectionFactory.setChannel(queueInfo.getChannel());\n queueConnectionFactory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);\n \n mqConn = (MQQueueConnection) queueConnectionFactory.createQueueConnection();\n mqConn.start();\n sendSingleMsg(mqConn, queueInfo.getQueueName(), msg);\n } catch (Exception e) {\n log.error(e.getMessage(), e);\n printQueueDetails(queueConnectionFactory);\n } finally {\n if (mqConn != null) {\n try {\n mqConn.close();\n } catch (JMSException ex) {\n log.error(ex.getMessage(), ex);\n }\n mqConn = null;\n }\n }\n }Question:Is it possible that MQQueueConnectionFactory fail somewhere due to high concurrency and set the port to default port instead of the assigned port? Does it keep some failover set of hostnames and it includes the default port?### Assistant: One reason may be down to not testing whatqueueInfo.getPort()returns. I would log the return, to see if there are conditions when it doesn't return the port you are expecting.\n"} +{"text": "### Human: Is there a way to set the back-out threshold and back-out queue in Java? I don't have access to MQ Console to manually set these as I am using Testcontainers. So each test run should set these property on the queue. Currently I am using JMS to send messages to the queue, and I want to set a threshold to 3 so as soon as the threshold reaches I will transfer the message to the back-out queue. Currently the message redelivers indefinitely.I tried using MQ as shown inthis article. However, it just sends a message to the queue.After reading the comments I tried doing through PCFPCFMessageAgent agent = new PCFMessageAgent(queueManager);\nPCFMessage request = new PCFMessage(MQConstants.MQCMD_CHANGE_Q);\nrequest.addParameter(MQConstants.MQCA_Q_NAME, queueName);\nrequest.addParameter(MQConstants.MQIA_BACKOUT_THRESHOLD, 3);\nrequest.addParameter(MQConstants.MQCA_BACKOUT_REQ_Q_NAME, backoutQueue);\nagent.send(request);It just throws PCFExceptionMQJE001: Completion Code 2, Reason 3014.### Assistant: Thanks to @Morag for pointing me to right direction. For anyone who wants to setup.PCFMessageAgent agent = new PCFMessageAgent(queueManager);\n PCFMessage request = new PCFMessage(MQConstants.MQCMD_CHANGE_Q);\n request.addParameter(MQConstants.MQCA_Q_NAME, queueName);\n request.addParameter(MQConstants.MQIA_Q_TYPE, MQConstants.MQQT_LOCAL);\n request.addParameter(MQConstants.MQIA_BACKOUT_THRESHOLD, 3);\n request.addParameter(MQConstants.MQCA_BACKOUT_REQ_Q_NAME, backoutQueue);\n agent.send(request);\n"} +{"text": "### Human: I have a simple dev instance of IBM MQ 9.1.x. It's got the default setup on QM1 with the default user/password.I have a JMS application that does connect already, but when I try JMSToolbox (latest 5.14.0) and I put thecom.ibm.mq.allclient-9.3.0.0.jarin thejre/libfolder, I get a proper MQ properties page and I put in the same values as my JMS app, it comes back and says:com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED').\nJMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED').I feel like it's probably something simple, but I can't quite figure it out. I am fairly new to MQ.### Assistant: The proper way to configure JMSToolBox to connect to IBM MQ isdocumented hereThe specific jars needed must be setup asdescribed here, via the\"Q Managers\"tabYou must not add jars to the jre\\lib directory or elsewhereAs for the error you receive, its probable either a misconfigured user/password/channel in JMSToolBox or the user you are using does not have the right to access MQ(I'm the author of JMSToolBox)\n"} +{"text": "### Human: I'm trying to create a node app that dockerizes the server and the MQ container, and use the ibmmq node client to interact with said container. I'm running into an issue where I'm not able to get my server running because the MQ C library can't be found. The specific error in question:Cannot find MQ C library.\n System appears to be: linux[x64]\n Has the MQ C client been installed?\n Have you run setmqenv?\n Error: ENOENT: no such file or directory, open '/opt/mqm/lib/libmqm_r.so'\n at Object.openSync (fs.js:462:3)\n at readFileSync (fs.js:364:35)\n at new DynamicLibrary (/server/node_modules/ffi-napi/lib/dynamic_library.js:68:23)\n at Object.Library (/server/node_modules/ffi-napi/lib/library.js:47:10)\n at loadLib (/server/node_modules/ibmmq/lib/mqi.js:290:18)\n at loadLibMulti (/server/node_modules/ibmmq/lib/mqi.js:417:13)\n at Object. (/server/node_modules/ibmmq/lib/mqi.js:436:1)\n at Module. (internal/modules/cjs/loader.js:999:30)\n at Module._compile (/server/node_modules/source-map-support/source-map-support.js:568:25)\n at internal/modules/cjs/loader.js:1027:10\n [ERROR] 07:40:21 Error: ENOENT: no such file or directory, open '/opt/mqm/lib/libmqm_r.so'When I go to check /opt/... there is no folder mqm. I'm not really sure when it would be created in the process.Here is my docker file:FROM node:12\n\n# Non-development values will be provided by Drone when\n# deploying to staging or production\nARG ENV=\"development\"\n\nWORKDIR /server\n\nCOPY package.json .\nCOPY yarn.lock .\n\nRUN yarn install --production=false\n\nCOPY . .\n\n# In non-dev environments, we need to build executable code\n# during image build time so that we're not doing it at\n# container startup (which would cause significant down-time)\nRUN if [ $ENV = \"staging\" ] || [ $ENV = \"production\" ]; \\\n then yarn build; \\\n fi\n\nCMD [\"yarn\", \"serve\"]The specific code that triggers the issue:import mq from 'ibmmq'\n\nconst MQC = mq.MQCI've tried a few things, including not letting the c library build but nothing is working. Any help would be appreciated, thanks in advance!### Assistant: Seehttps://github.com/ibm-messaging/mq-mqi-nodejs/tree/master/samplesfor a working Dockerfile example usingnpm install.The postinstall script for linux x64 will normally pull in the MQ Redist C client package. If the postinstall is not run for some reason, or cannot download the package, then you have to install the MQ C client manually.\n"} +{"text": "### Human: I am trying to wrap my head arround the following issue:TL;DR\nHow can I make sure a rollback occurs when connection is lost to the queue manager during the prepare of the 2PC.java: 8spring boot: 2.3.12.RELEASEspring-jms: 5.2.20.RELEASEmq-jms-spring-boot-starter: 2.6.5 (allclient: 9.2.5.0)narayana spring boot starter: 2.6.3 (narayana: 5.11.3.Final)sniffy: 3.1.12==========================================================Application is reading a persistent message (without expiry) from queue X in a transactionI set a breakpoint in theXAResouceRecord.topLevelPrepareand using Sniffy I cut the the connection to the queue manager during the 2PC prepareI wait more than the HBINT (300) time (or shutdown the VM to disconnect the TCP connections instantly)I expected the message to be available on the message queue X, it's back-out queue or a dead letter queueHowever, the message is not rolled back. I don\u2019t see any transaction logs (I believe this is to be expected since the prepare did not finish). No uncommitted messages on the queue or back-out queue.If I put a breakpoint inAbstractPollingMessageListenerContainer.receiveAndExecuteafter receiving the message but before the transaction is commited I can see that the message is no longer on the queue. So it appears if the session.commit has already happened. How can I make sure a rollback occurs when connection is lost to the queue manager during the prepare of the 2PC. I am probably missing something here but I can't seem what.### Assistant: After some more digging I believe I found the issue. The message is now rolledback when I break the connection to the queue manager during the prepare of 2PC. Hopefully this might help somebody else.In my question I mentioned putting a breakpoint in theAbstractPollingMessageListenerContainer.receiveAndExecute. In the spring version that I was using 5.2.20.RELEASE the code looked like this:if (this.transactionManager != null) {\n // Execute receive within transaction.\n TransactionStatus status = this.transactionManager.getTransaction(this.transactionDefinition);\n boolean messageReceived;\n try {\n messageReceived = doReceiveAndExecute(invoker, session, consumer, status);\n }\n catch (JMSException | RuntimeException | Error ex) {\n rollbackOnException(this.transactionManager, status, ex);\n throw ex;\n }\n this.transactionManager.commit(status);\n return messageReceived;\n }Which appeared a bit odd since thetransactionManager.commitwas not surrounded by a try catch. So what was happening if the commit failed?The try-catch was added in 5.3.16, seehttps://github.com/spring-projects/spring-framework/pull/1807if (this.transactionManager != null) {\n // Execute receive within transaction.\n TransactionStatus status = this.transactionManager.getTransaction(this.transactionDefinition);\n boolean messageReceived;\n try {\n messageReceived = doReceiveAndExecute(invoker, session, consumer, status);\n }\n catch (JMSException | RuntimeException | Error ex) {\n rollbackOnException(this.transactionManager, status, ex);\n throw ex;\n }\n try {\n this.transactionManager.commit(status);\n }\n catch (TransactionException ex) {\n // Propagate transaction system exceptions as infrastructure problems.\n throw ex;\n }\n catch (RuntimeException ex) {\n // Typically a late persistence exception from a listener-used resource\n // -> handle it as listener exception, not as an infrastructure problem.\n // E.g. a database locking failure should not lead to listener shutdown.\n handleListenerException(ex);\n }\n return messageReceived;\n }\n"} +{"text": "### Human: I am quite new to this, and I am struggling with one issue.\nIn Java Compute Node, through IIB, I am checking if one field has one or more values, and for each additional value I am creating a new duplicate message, except for value, these additional values are overriding.\nThis is working fine as a expect, see example:Input :...2BMW AG 1111111;22222222;333333333Modified message 1:...2BMW AG 1111111Modified message 2:..2BMW AG 22222222Modified message3 :...2BMW AG 333333333But I am struggling to propagate this message out from the Java Compute node. I understand that I cant propagate messages of typeString, so I am trying to parse this as aMbMessageAssembleoutAssemble. This is my code:String newMessage = inData.replace(wholeValues, outData); // replace one value with another\n \nMbMessage outMessage = new MbMessage();\nMbMessageAssembly outAssembly = new MbMessageAssembly(inAssembly, outMessage);\ncopyMessageHeaders(inMessage, outMessage);\nMbElement outRoot = outMessage.getRootElement();\nMbElement outParser = outRoot.createElementAsLastChild(MbBLOB.PARSER_NAME);\nMbElement outBodyEl2 = outParser.createElementAsLastChild(MbElement.TYPE_NAME_VALUE, \"BLOB\", newMessage.getBytes()); \nalt.propagate(outAssembly);But this is propagate an empty message, so thenewMessageis not parsed tooutAssembly. Can anybody with this experience help me with this?### Assistant: I figured it out. For future, here is your answerString newMessage = \"this is some test\";\nMbMessage outMessage=new MbMessage();\noutMessage.getRootElement().createElementAsLastChild(MbBLOB.PARSER_NAME).createElementAsLastChild(MbElement.TYPE_NAME_VALUE, \"BLOB\", newMessage.getBytes());\nMbMessageAssembly outAssembly = new MbMessageAssembly(inAssembly, outMessage);\nout.propagate(outAssembly);\n"} +{"text": "### Human: I am using the following Maven dependency and class in my Spring Boot application to send messages to ActiveMQ:\n org.springframework.boot\n spring-boot-starter-activemq\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.jms.annotation.EnableJms;\nimport org.springframework.jms.core.JmsTemplate;\nimport org.springframework.stereotype.Component;\n\n@Component\n@EnableJms\npublic class MQSender {\n\n @Autowired\n private JmsTemplate jmsTemplate;\n\n public void sendMsgActiveMQ(String msg) {\n jmsTemplate.convertAndSend(\"DEV.QUEUE1\", msg);\n }\n \n/* public void sendMsgIBMMQ(String msg) {\n jmsTemplate.convertAndSend(\"DEV.QUEUE1\", msg);\n }*/\n \n}How could I use the same class or any other class within the same application to send messages to IBM MQ as well? If I add the add the below dependency how will the@AutowiredJmsTemplatebehave?\n com.ibm.mq\n mq-jms-spring-boot-starter\n 2.5.0\n### Assistant: You can get the IBM MQ client jars file with Maven dependency:\n com.ibm.mq\n com.ibm.mq.allclient\n 9.1.0.6\n As to your@Autowiredquestion, your problem is ambiguity by type. You will need JMS connections factories for the two brokers that have the same type. The articleherehas some good suggestions.I prefer to only@Autowirein test cases, where the application context is small. For a practical application, I prefer explicit initialization. (maybe I'm just used to it). In any event, have a look heregithubfor some examples that may have be useful.\n"} +{"text": "### Human: I am facing a scenario where the reply queue I connect to, runs out of handles. I have traced it to the fact that my JMS Producers are being cached but not my JMS consumers. I am able to send and receive messages just fine so there is no problem with connecting-sending-receiving to/from the queues. I am using the CachedConnectionFactory (SessionCacheSize = 10)with the target factory ascom.ibm.mq.jms.MQQueueConnectionFactorywhile instantiating the jmsTemplate. Code snippet is as follows:\n :\n String replyQueue = \"MyQueue\";// replyQueue which runs out of handles\n messageCreator.setReplyToQueue(new MQQueue(replyQueue));\n\n jmsTemplate.setReceiveTimeout(receiveTimeout);\n \n jmsTemplate.send(destination, messageCreator);// Send to destination queue\n Message message = jmsTemplate.receiveSelected(replyQueue, \n String.format(\"JMSCorrelationID = '%s'\", messageCreator.getMessageId()));\n :\n :From the logs (jms TRACE is enabled) Producer is cached, so thedestinationqueue \"handle count\" does not increase.// The first time around (for Producer)Registering cached JMS MessageProducer for destination[queue:///:com.ibm.mq.jms.MQQueueSender@c9x758b// Second time around, the cached producer is reusedFound cached JMS MessageProducer for destination [queue:///]: com.ibm.mq.jms.MQQueueSender@c9x758bHowever, the handles for the replyQueue keep increasing because for every call to that queue, I see a new JMS Consumer being registered. Ultimately the calls to open the replyQueue fail because of MQRC_HANDLE_NOT_AVAILABLE// First time aroundRegistering cached JMS MessageConsumer for destination [queue:///]:com.ibm.mq.jms.MQQueueReceiver@b3ytd25b// Second time around, another MessageConsumer is registered !Registering cached JMS MessageConsumer for destination [queue:///]:com.ibm.mq.jms.MQQueueReceiver@re25b### Assistant: My memory is a bit dim on this, but here is what is happening. You are receiving messages based on a message selector. This selector is always changing, however. As a test, either remove the selector or make it a constant and see what happens. So when you try to cache/pool based on connection/session/consumer, the consumer is always changing. This requires a new cache entry.After you go through your 10 sessions, a new connection will be created, but the existing one is not closed. Increase your session count to 100, for example, and your connection count on the MQ broker should climb 10 time slower.You need to create a new consumer for every message receive as your correlation ID is always changing. So just cache connection/session. No matter what you do, you will always have to round trip to the broker to ask for the new correlation ID.\n"} +{"text": "### Human: I want to deploy IBM-MQ to Kubernetes (Rancher) using helmfile. I've found this link and did everything as described in the guide:https://artifacthub.io/packages/helm/ibm-charts/ibm-mqadvanced-server-dev.But the pod is not starting with the error: \"ImagePullBackOff\". What could be the problem? My helmfile:...\nrepositories:\n - name: ibm-stable-charts\n url: https://raw.githubusercontent.com/IBM/charts/master/repo/stable\n\nreleases:\n - name: ibm-mq\n namespace: test\n createNamespace: true\n chart: ibm-stable-charts/ibm-mqadvanced-server-dev\n values:\n - ./ibm-mq.yamlibm-mq.yaml:- - - \nlicense: accept\nsecurity:\n initVolumeAsRoot: true/false // I'm not sure about this, I added it just because it wasn't working.\n// Both of the options don't work too \nqueueManager:\n name: \"QM1\"\n dev:\n secret:\n adminPasswordKey: adminPassword\n name: mysecretI've created the secret and seems like it's working, so the problem is not in the secret.\nThe full error I'm getting:Failed to pull image \"ibmcom/mq:9.1.5.0-r1\": rpc error: code = Unknown desc = Error response from daemon: manifest for ibmcom/mq:9.1.5.0-r1 not found: manifest unknown: manifest unknownI'm using helm 3, helmfile v.0.141.0, kubectl 1.22.2### Assistant: I will leave some things as an exercise to you, but here is what that tutorial says:helm repo add ibm-stable-charts https://raw.githubusercontent.com/IBM/charts/master/repo/stableYou don't really need to do this, since you are usinghelmfile.Then they say to issue:helm install --name foo \n ibm-stable-charts/ibm-mqadvanced-server-dev \n --set license=accept \n --set queueManager.dev.secret.name=mysecret \n --set queueManager.dev.secret.adminPasswordKey=adminPassword \n --tlswhich is targeted towardshelm2(because of those--nameand--tls), but that is irrelevant to the problem.When I install this, I get the same issue:Failed to pull image \"ibmcom/mq:9.1.5.0-r1\": rpc error: code = NotFound desc = failed to pull and unpack image \"docker.io/ibmcom/mq:9.1.5.0-r1\": failed to resolve reference \"docker.io/ibmcom/mq:9.1.5.0-r1\": docker.io/ibmcom/mq:9.1.5.0-r1: not foundI went to the docker.io pageof theirsand indeed such a tag :9.1.5.0-r1is not present.OK, can we update the image then?helm show values ibm-stable-charts/ibm-mqadvanced-server-devreveals:image:\n # repository is the container repository to use, which must contain IBM MQ Advanced for Developers\n repository: ibmcom/mq\n # tag is the tag to use for the container repository\n tag: 9.1.5.0-r1good, that means we can change it via an override value:helm install foo \n ibm-stable-charts/ibm-mqadvanced-server-dev \n --set license=accept \n --set queueManager.dev.secret.name=mysecret \n --set queueManager.dev.secret.adminPasswordKey=adminPassword \n --set image.tag=latest # or any other tagso this works.How to set-up that tag inhelmfileis left as an exercise to you, but it's pretty trivial.\n"} +{"text": "### Human: In which library can we find layout of IBM supplied Mq copybooks(like CMQV, CMQODV) in COBOL.By compilation am able to see the expanded copybooks but would like to know the library.### Assistant: You don't say which platform.Windows: %MQ_INSTALLATION_PATH%\\Tools\\cobol\\copybookUNIX: $MQ_INSTALLATION_PATH/inc/z/OS: hlq.SCSQCOBC\n"} +{"text": "### Human: When deploying and executing my aplication in WebSphere Application server the following error message is presented.[6/1/21 17:44:24:958 CDT] 0000004e webapp E com.ibm.ws.webcontainer.webapp.WebApp notifyServletContextCreated SRVE0283E: Exception caught while initializing context: {0}\n java.lang.ExceptionInInitializerError\n at java.lang.J9VMInternals.ensureError(J9VMInternals.java:141)\n at java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:130)\n at java.lang.Class.forNameImpl(Native Method)\n at java.lang.Class.forName(Class.java:278)\n at com.transform.cartridge.volpayreferencedatautil.VolPayReferenceDataUtilFunctions.addTimeLog(VolPayReferenceDataUtilFunctions.java:204)\n at com.transform.flow.logaudit.LogAudit.Custom3Activity(LogAudit.java:100)\n at com.transform.flow.logaudit.LogAudit.executeInternal(LogAudit.java:152)\n at com.transform.flow.logaudit.LogAudit.run0(LogAudit.java:115)\n at com.tplus.transform.runtime.AbstractMessageFlow.run(AbstractMessageFlow.java:157)\n at com.tplus.transform.runtime.volante.MessageFlowVolante$1.run(MessageFlowVolante.java:75)\n at com.tplus.transform.runtime.volante.DeclarativeTransactionalExecutor.start0(DeclarativeTransactionalExecutor.java:137)\n at com.tplus.transform.runtime.volante.DeclarativeTransactionalExecutor.start(DeclarativeTransactionalExecutor.java:113)\n at com.tplus.transform.runtime.volante.MessageFlowVolante.run(MessageFlowVolante.java:73)\n at com.tplus.transform.runtime.proxy.MessageFlowProxy.run(MessageFlowProxy.java:32)\n at com.transform.flow.logaudit_sys_debug_instr.LogAudit_Sys_Debug_Instr.Invoke1Activity(LogAudit_Sys_Debug_Instr.java:41)\n at com.transform.flow.logaudit_sys_debug_instr.LogAudit_Sys_Debug_Instr.executeInternal(LogAudit_Sys_Debug_Instr.java:82)\n at com.transform.flow.logaudit_sys_debug_instr.LogAudit_Sys_Debug_Instr.run0(LogAudit_Sys_Debug_Instr.java:53)\n at com.tplus.transform.runtime.AbstractMessageFlow.run(AbstractMessageFlow.java:157)\n at com.tplus.transform.runtime.volante.MessageFlowVolante$1.run(MessageFlowVolante.java:75)\n at com.tplus.transform.runtime.volante.DeclarativeTransactionalExecutor.start0(DeclarativeTransactionalExecutor.java:137)\n at com.tplus.transform.runtime.volante.DeclarativeTransactionalExecutor.start(DeclarativeTransactionalExecutor.java:113)\n at com.tplus.transform.runtime.volante.MessageFlowVolante.run(MessageFlowVolante.java:73)\n at com.tplus.transform.runtime.proxy.MessageFlowProxy.run(MessageFlowProxy.java:32)\n at com.transform.flow.volantepaymentenginestartofprocess.VolantePaymentEngineStartOfProcess.Invoke4Activity(VolantePaymentEngineStartOfProcess.java:77)\n at com.transform.flow.volantepaymentenginestartofprocess.VolantePaymentEngineStartOfProcess.executeInternal(VolantePaymentEngineStartOfProcess.java:325)\n at com.transform.flow.volantepaymentenginestartofprocess.VolantePaymentEngineStartOfProcess.run0(VolantePaymentEngineStartOfProcess.java:300)\n at com.tplus.transform.runtime.AbstractMessageFlow.run(AbstractMessageFlow.java:157)\n at com.tplus.transform.runtime.volante.MessageFlowVolante$1.run(MessageFlowVolante.java:75)\n at com.tplus.transform.runtime.volante.DeclarativeTransactionalExecutor.start0(DeclarativeTransactionalExecutor.java:137)\n at com.tplus.transform.runtime.volante.DeclarativeTransactionalExecutor.start(DeclarativeTransactionalExecutor.java:113)\n at com.tplus.transform.runtime.volante.MessageFlowVolante.run(MessageFlowVolante.java:73)\n at com.tplus.transform.runtime.proxy.MessageFlowProxy.run(MessageFlowProxy.java:32)\n at com.volantetech.volante.services.StartOfProcess.process(StartOfProcess.java:45)\n at com.volantetech.volante.services.ApplicationStartupListener.contextInitialized(ApplicationStartupListener.java:218)\n at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1837)\n at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:443)\n at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)\n at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:171)\n at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:904)\n at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:789)\n at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:427)\n at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:719)\n at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1249)\n at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1591)\n at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:708)\n at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:1162)\n at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:801)\n at com.ibm.ws.runtime.component.ApplicationMgrImpl$5.run(ApplicationMgrImpl.java:2325)\n at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5536)\n at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5662)\n at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)\n at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2330)\n at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:436)\n at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)\n at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:379)\n at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:127)\n at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:985)\n at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:524)\n at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1909)\nCaused by: java.lang.IllegalArgumentException: com.sun.management.OperatingSystemMXBean is not a valid MXBean interface.\n at java.lang.management.ManagementFactory.getPlatformMXBean(ManagementFactory.java:469)\n at com.volantetech.volante.services.performance.log.LogTime.(LogTime.java:23)\n at com.volantetech.volante.services.performance.log.LogTime.(LogTime.java:20)\n ... 57 moreThe server is a RHEL with WebSphere 9.0.5.5 and java openjdk version \"1.8.0_292\"\nThe application is developed so it takes a message from a message queue and processes them. The message queue being used is IBM MQ 9.1.1.0. The application is taking the messages but not processing them correctly. The error is presenting on startup and also on execution.Any guidance would be much valued.### Assistant: It looks like the AppServer is using OpenJ9 while your application is being compiled with openjdk 1.8. Perhaps you are getting mismatch in the WAS ManagementFactory. Try \"ps -fea\" and check the jvm being used.\n"} +{"text": "### Human: I have ejb message driven bean on was 8 java 6. every think work well.The message driver bean listened on mq queue .\nthe queue on MainFrameI migrated from WAS 8 to WAS 9 (java 8) .Some messages include characters that cannot converted and cause exception :JMSCMQ1049: The character set '424(IBM424) Unmappable Action: REPORTI found an article that talks about the problemhttps://www.ibm.com/docs/en/ibm-mq/8.0?topic=java-character-string-conversions-in-mq-classesCharacter string conversions in IBM MQ classes for JavaThe IBM\u00ae MQ classes for Java use CharsetEncoders and CharsetDecoders\ndirectly for character string conversion. The default behavior for\ncharacter string conversion can be configured with two system\nproperties. The handling of messages that contain unmappable\ncharacters can be configured through com.ibm.mq.MQMD.Before IBM MQ 8.0, string conversions in IBM MQ classes for Java was done by calling the java.nio.charset.Charset.decode(ByteBuffer)\nand Charset.encode(CharBuffer) methods.Using either of these methods results in a default replacement ( REPLACE) of malformed or untranslatable data. This behavior can\nobscure errors in applications, and lead to unexpected characters, for\nexample ?, in translated data.From IBM MQ 8.0, to detect such issues earlier and more effectively, the IBM MQ classes for Java use CharsetEncoders and\nCharsetDecoders directly and configure the handling of malformed and\nuntranslatable data explicitly. The default behavior is to REPORT such\nissues by throwing a suitable MQException.What I do not know, is how to implement the solution that the article\noffers within the JMS settings of the queue in webSphere admin console or in java implementationAnyone know how to solve the problem?### Assistant: The link provided has the information below:com.ibm.mq.cfg.jmqi.UnmappableCharacterAction Specifies the action to\nbe taken for untranslatable data on encoding and decoding. The value\ncan be REPORT, REPLACE, or IGNORE.\ncom.ibm.mq.cfg.jmqi.UnmappableCharacterReplacement Sets or gets the\nreplacement bytes to apply when a character cannot be mapped in an\nencoding operation The default Java replacement string is used in\ndecoding operations.If you wanted to mimic the prior behavior you would set the following system properties as generic JVM arguments the following link discusses how to set the arguments:Setting generic JVM arguments in WebSphere Application Server-Dcom.ibm.mq.cfg.jmqi.UnmappableCharacterAction=REPLACE\n-Dcom.ibm.mq.cfg.jmqi.UnmappableCharacterReplacement=63For a more detailed answer that is not specific to WAS see this:Special Character Issue : MQ message PUT error : java.nio.charset.UnmappableCharacterException\n"} +{"text": "### Human: I'm having some struggles getting a Java web-application running on IBM WebSphere Application Server 9.0.5.5 sending messages to an IBM MQ topic using log4j 1.2.17.In WAS we originally had aConnectionFactoryset up to use to communicate with the topic. This is what we do with other applications that use IBM MQ queues. However, this ends up giving me the following error:java.lang.ClassCastException: com.ibm.ejs.jms.JMSConnectionFactoryHandle incompatible with javax.jms.TopicConnectionFactoryI found an IBM article that discusses a similar issue with queues and the solution is to use aQueueConnectionFactory. So, similarly I switched from using aConnectionFactoryto aTopicConnectionFactory. Now I get this error:java.lang.ClassCastException: com.ibm.ejs.jms.JMSTopicConnectionFactoryHandle incompatible with javax.jms.TopicConnectionFactoryI have another Java web-application that uses log4j2 with queues. We have aConnectionFactoryset up in WAS in Resources > JMS as we did here with this application. It all works fine. The only difference here is that we are using log4j 1.2.17 and topics instead of queues.I cannot change the version of log4j because it is baked into the vendor platform we have.I checked the WAR file that is being deployed and there is only the onejms.jar(and fscontext, providerutil, mq, etc. JARs for IBM MQ Client 9.1.0.0) in there. So no other competingjms.jarthat might be of an older JMS version.Any ideas what could be wrong here?### Assistant: This took A LOT of back and forth with IBM to get it to work. I'd have to go through the case history, but for now I can just share what I see in our JMS configuration in WAS.In each environment, we are running with 2 WAS nodes.On each WAS node, we created a Topic connection factory with scope at the Node level.In the factory, we have both of our MQ servers for that environment listed in our Connection name listWe also set up a JAAS - J2C authentication resource as a user id is required to access our MQ servers.We also created a Topic object at the Node scope level.That's basically it. Now, we did have a lot of issues on the MQ side with permissions not being set up properly that IBM was able to identify in some traces we sent.I'd say if you are still stuck, open a case with IBM. It took a little while to get to the right resources, but after running some traces they were able to find our issues.Good luck @rajib-biswas!\n"} +{"text": "### Human: here is the Commit and back out from IBM Website:\nwhen a program gets a message from a queue within a unit of work, that message remains on the queue until the program commits the unit of work, but the message is not available to be retrieved by other programs. The message is permanently deleted from the queue when the program commits the unit of work.If the program backs out the unit of work, IBM MQ restores the queue by making the messages available to be retrieved by other programs.So,if our consumer dead without rollback instruction,how does the message to be handle?Is there any retention setting ofwaiting commit timefor message with SYNCPOINT enable in IBM MQ?### Assistant: When connecting to a non-z/OS queue manager, if the program terminates abnormally without a disconnect the message will roll back. If if it issues a disconnect without commit, the commit will be assumed in certain situations. For more details see Usage Notes 2a-c on the IBM MQ doc pageMQDISC - Disconnect queue manager:\n"} +{"text": "### Human: what kind of information does it gives after enabling activity trace on MQ? Does it have any impact on the performance?### Assistant: ChapterApplication activity traceexplains it like this:Application activity trace produces detailed information about the behavior of applications connected to a queue manager. It traces the behavior of an application and provides a detailed view of the parameters used by an application as it interacts with IBM\u00ae MQ resources. It also shows the sequence of MQI calls issued by an application.ChapterTuning the performance impact of application activity traceexplains it like this:Enabling application activity trace can incur a performance penalty. This can be reduced by only tracing the applications that you need, by increasing the number of applications draining the queue, and by tuning ActivityInterval, ActivityCount and TraceLevel in mqat.ini.I really recommend to consult the Knowledge Center to read about the features of IBM MQ.\n"} +{"text": "### Human: I need to connect to IBM MQ on cloud which is SSL enabled with mutual authentication from NodeJS. Because of some restrictions at MQ side I am unable to connect to this IBM MQ using Native keydb approach. When i try to connect i get error. My client confirmed that I wont be able to connect to MQ using keydb(native approach)MQ call failed in CONNX: MQCC = MQCC_FAILED [2] MQRC = MQRC_HOST_NOT_AVAILABLE [2538]I saw official documentation of ibmmq node library which mentions that MQI based client like Node, Python etc needs to use keydb. I am able to connect to this IBM MQ using Java (Keystore).I would like to know if there is a way to connect to IBM MQ from NodeJS using keystore which i used to connect from Java.### Assistant: You can't directly use the jks file with the ibmmq node library.You can convert the jks to a kdb using these commands:runmqckm -keydb -convert -db key.jks -new_format kdb\nrunmqckm -keydb -stashpw -db key.kdbThe first command will create two files:key.kdb\nkey.rdbThe second command will create the stash file:key.sthBoth commands will prompt you for the jks password.\n"} +{"text": "### Human: Trying to connect from a C application running as an IBM MQ client on a host to an MQ server running as a docker container.The client code taken from an IBM example is provided below.\nThe questions is which protocol is used when MQCONN is called as no IP/port is provided? I can only guess it is some kind of an IPC.\nFor this reason I'm running the docker container with --ipc=\"host\" option, but it still fails with CompCode=2, Reason=2058#include \n\u22ee\nstatic char Parm1[MQ_Q_MGR_NAME_LENGTH] ;\n\u22ee\nint main(int argc, char *argv[] )\n {\n /* */\n /* Variables for MQ calls */\n /* */\n MQHCONN Hconn; /* Connection handle */\n MQLONG CompCode; /* Completion code */\n MQLONG Reason; /* Qualifying reason */\n\u22ee\n /* Copy the queue manager name, passed in the */\n /* parm field, to Parm1 */\n strncpy(Parm1,argv[1],MQ_Q_MGR_NAME_LENGTH);\n\u22ee\n /* */\n /* Connect to the specified queue manager. */\n /* Test the output of the connect call. If the */\n /* call fails, print an error message showing the */\n /* completion code and reason code, then leave the */\n /* program. */\n /* */\n MQCONN(Parm1,\n &Hconn,\n &CompCode,\n &Reason);\n if ((CompCode != MQCC_OK) | (Reason != MQRC_NONE))\n {\n sprintf(pBuff, MESSAGE_4_E,\n ERROR_IN_MQCONN, CompCode, Reason);\n PrintLine(pBuff);\n RetCode = CSQ4_ERROR;\n goto AbnormalExit2;\n }\n\u22ee\n }### Assistant: If your program will be running on the same server as the queue manager then it is best to link it with 'mqm.lib' (bindings mode) rather than 'mqic.lib' (client mode).In theMQ KnowLedge Center, there are examples on how to compile and link your C program. The examples are listed as: 'C client application' (client mode) and 'C server application' (bindings mode).If in the future, your C program needs to connect to a remote queue manager then you need to link it for 'client mode'.To configure your C program to handle proper MQ security, change the MQCONN API call to MQCONNX API call.i.e.MQCNO cno = {MQCNO_DEFAULT};\nMQCD cd = {MQCD_CLIENT_CONN_DEFAULT};\nMQCSP csp = {MQCSP_DEFAULT};\n\nstrncpy(cd.ConnectionName, hostname, MQ_CONN_NAME_LENGTH);\nstrncpy(cd.ChannelName, channelName, MQ_CHANNEL_NAME_LENGTH);\n\ncsp.AuthenticationType = MQCSP_AUTH_USER_ID_AND_PWD;\n\ncsp.CSPUserIdPtr = &myUserId;\ncsp.CSPUserIdOffset = 0;\ncsp.CSPUserIdLength = strlen(myUserId);\n\ncsp.CSPPasswordPtr = &myPassword;\ncsp.CSPPasswordOffset = 0;\ncsp.CSPPasswordLength = strlen(myPassword);\n\ncno.cdPtr = &cd;\ncno.Version = MQCNO_CURRENT_VERSION;\ncno.SecurityParmsPtr = &csp;\ncno.SecurityParmsOffset = 0;\n\nMQCONNX(QMgrName, &cno, &Hcon, &CompCode, &Reason);A few years ago, I wrote a blog posting called:MQ API Verbs that IBM Forgot!!. I created wraps for MQCONN and MQCONNX that will allow the program to pass UserId & Password for MQCONN and MQCONNX API calls. You may find it easier to simply use the wrappers.\n"} +{"text": "### Human: How can i add max attempts for connection retry for message consumer using jmsOutboundGateway?I am using ibm mq. below is the configuration\n\n ### Assistant: If there is no such an option on thatkeyManagementConnectionFactory, then you can try to use awith the:https://docs.spring.io/spring-integration/docs/current/reference/html/messaging-endpoints.html#message-handler-advice-chain\n"} +{"text": "### Human: We are connecting java MQ client to customer IBM MQ server, To connect that we have one MQIPT instance at cloud premises , and one MQIPT instance at non cloud premises . Once disabled SSL security on non cloud premises then we are able to connect that. However , once SSL enabled by non cloud premises we are facing SSL handshake issue. Certificates are shared between us.We don't have access on that non cloud environment.We are connecting MQIPT by Java client . and below are the trace which we are getting in mqipt trace.When we are not setting cipher at mq java client then we are getting below errorIn that case MQIPT enabled for all cipher.Issuer: 'CN=********* TEST CA ****,OU=*****,O=******** AG,C=******'\n12:45:13.799 27 1414-2s Processing keyType: RSA\n12:45:13.800 27 1414-2s No RSA certificates in keyring\n12:45:13.800 27 1414-2s Processing keyType: DSA\n12:45:13.800 27 1414-2s No DSA certificates in keyring\n12:45:13.800 27 1414-2s Processing keyType: EC\n12:45:13.800 27 1414-2s No EC certificates in keyring\n12:45:13.800 27 1414-2s WARNING: No suitable certificate to send to the remote server\n12:45:13.800 27 1414-2s --------} IPTX509KeyManager.chooseClientAlias() rc=0\n12:45:14.184 27 1414-2s SSLHandshakeException handshaking:com.ibm.jsse2.k.a(k.java:7)But when we set CipherSuite in java MQ client then we are getting error logs in mqiptMQCPI014 Protocol eyecatcher (16030300) not recognizedMQIPT Version --> IBM MQ Internet Pass-Thru V9.2.0.1MQIPT conf as below[global]\nCommandPort=1884\nRemoteShutDown=true\nMinConnectionThreads=5\nMaxConnectionThreads=100\nIdleTimeout=20\nClientAccess=true\nQMgrAccess=true\nHTTP=true\nHTTPChunking=false\nTrace=5\nConnectionLog=true\nMaxLogFileSize=50\n\n[route]\nName=Route_1\nActive=true\nListenerPort=1414\nDestination=mq-dmz-************\nDestinationPort=********\nHTTP=true\nHTTPS=true\nSSLClient=true\nSSLClientProtocols=TLSv1.2\nSSLClientKeyRing=\"path of key ring PFX file\"\nSSLClientKeyRingPW=\"path of password file\"\nHTTPServer=\nHTTPServerPort=443\nURIName=\nSSLClientCAKeyRing=\"same as SSLClientKeyRing\"\nSSLClientCAKeyRingPW=\"same as SSLClientKeyRingPW\"\nSSLClientCipherSuites=SSL_ECDHE_RSA_WITH_AES_256_GCM_SHA384### Assistant: Setup for accepting the connection from the MQ client, decrypting, and then re-encrypting and sending on to the next hop should look something like the following:[route]\nName=Route_1\nActive=true\nListenerPort=1414\nDestination=mq-dmz-************\nDestinationPort=********\nHTTP=true\nHTTPS=true\nSSLClient=true\nSSLClientProtocols=TLSv1.2\nSSLClientKeyRing=\"path of key ring PFX file\"\nSSLClientKeyRingPW=\"path of password file\"\nHTTPServer=\nHTTPServerPort=443\nURIName=\nSSLClientCAKeyRing=\"same as SSLClientKeyRing\"\nSSLClientCAKeyRingPW=\"same as SSLClientKeyRingPW\"\nSSLClientCipherSuites=SSL_ECDHE_RSA_WITH_AES_256_GCM_SHA384\nSSLServer=true\nSSLServerProtocols=TLSv1.2\nSSLServerKeyRing=\"path of key ring PFX file\"\nSSLServerKeyRingPW=\"path of password file\"\nSSLServerCAKeyRing=\"same as SSLServerKeyRing\"\nSSLServerCAKeyRingPW=\"same as SSLServerCAKeyRing\"\nSSLServerCipherSuites=SSL_ECDHE_RSA_WITH_AES_256_GCM_SHA384What you are missing is that the route is configured from the standpoint of the TLS session, you are either:TLS Server (you are receiving the inbound connection and decrypting it)TLS Client (you are connecting out to another queue manager or MQIPT and encrypting)To accept a TLS connection from your MQ client application you need to configure theSSLServer*equivalents to the already configuredSSLClient*settings.\n"} +{"text": "### Human: Jboss EAP 7.1,standalone.xml, using IBM MQ, no outbound / no outgoing messageIs it right thatstandalone.xml/urn:jboss:domain:resource-adapters-sectioncan be empty, if my application has no outgoing messages (only reads messages from MQ) ?### Assistant: Is it right that standalone.xml / urn:jboss:domain:resource-adapters-section can be empty, if my application has no outgoing messages (only reads messages from MQ) ?-> No, wmq.jmsra.rar has to be configured:\n \n \n \n wmq.jmsra.rar\n \n LocalTransaction\n \n \n \n \n \n \n \n"} +{"text": "### Human: Use-Case:I'm sending a request to IBM MQ Listener from Spring Boot App with Apache camel, while sending I have to change the MQ JMS Property JMS_IBM_Character_Set=UTF-8 but these changes are not reflecting at Listener sideCould anyone please help me how to change the property value for IBM MQ with Apache Camel// Request Queue - one direction@Component\npublic class RequestRouter extends RouteBuilder {\n\n @Override\n public void configure() throws Exception {\n\n from(\"direct:request\").\n setProperty(\"JMS_IBM_Character_Set\", constant(\"true\")).\n to(\"jms:REQUEST.Q1?disableReplyTo=true\")\n .log(\"Received Body is ${body} and header info is ${headers} \"); \n }\n}// Below one Request-Reply Queue@Component\npublic class RequestReplyRouter extends RouteBuilder {\n\n @Override\n public void configure() throws Exception {\n\n from(\"direct:request-reply\").setProperty(\"JMS_IBM_Character_Set\", constant(\"true\"))\n .to(\"log:like-to-see-all?level=INFO&showAll=true&multiline=true\")\n .to(\"jms:REQUEST.Q1?ReplyTo=REPLY.Q1&exchangePattern=InOut\")\n .log(\"Request-reply Body is ${body} and header info is ${headers} \");\n\n from(\"jms:REPLY.Q1\")\n .log(\"Received Body is ${body} and header info is ${headers} \");\n }\n\n}### Assistant: When I put a message on IBM MQ with JMS client in 2017 i could not make it. I changed jms client to IBMMQ.jar in order to put a message with header. I suggest you that you can read JMS document on Apache camel site. Also, try to use \"allowAdditionalHeaders\"\n"} +{"text": "### Human: I have the following Spring JMS factory configuration:@Bean(name = \"jmsListenerFactory\")\npublic DefaultJmsListenerContainerFactory jmsListenerFactory() throws Exception {\n DefaultJmsListenerContainerFactory container = new DefaultJmsListenerContainerFactory();\n container.setErrorHandler(new MqErrorHandler());\n container.setConnectionFactory(connectionFactory);\n container.setTransactionManager(transactionManager);\n container.setConcurrency(\"5-10\");\n return container;\n}Listener setup:@JmsListener(destination = ACK_QUEUE, containerFactory = \"jmsListenerFactory\")\n@Transactional\npublic void receive(String response) throws Exception {\n try {\n logger.debug(response);\n Msg ackNack = (Msg) unmarshaller.unmarshal(new StringReader(response));\n ... and so on\n ... should acknowledge JMS and commit DB update\n}JTA Transaction Manager:public JtaTransactionManager jbossTransactionManager() throws Exception {\n JtaTransactionManager transactionManager = new JtaTransactionManager();\n transactionManager.setTransactionManagerName(\"java:/TransactionManager\");\n return transactionManager;\n}I have an Oracle database and a JMS connection factory resource included via JNDI, both XA compatible.Problem is that some JMS messages are not making it to the listener. They are 100% provided to the queue but like they just \"disappear\". No logging or errors are reported in the logs even to TRACE level.Nothing else is listening to this queue and similar transactions are getting processed successfully from the same queue. I cannot reproduce it in any guaranteed way and it is completely intermittent.Any thoughts?### Assistant: The lesson to be learned here is never to assume the following:\"Nothing else is listening to this queue..\"There are ways to try and verify this:Check how many processes currently have the queue open for INPUT:DIS QL(QUEUENAME) IPPROCSDisplay all connections that have the queue currently open withOPENOPTSthat includeMQOO_INPUT*, this will show both IP address (if it is a client connection), and the application name (APPLTAG) presented by the client.DIS CONN(*) TYPE(ALL) WHERE(OBJNAME EQ QUEUENAME)Both of the above only show a point in time view, if you are trying to find a app that is connecting reading messages from the queue and then disconnecting, then you may not see it.As @MoragHughson mentioned in a comment, start an activity trace and look for connections to this queue and see if the IPs/application names connecting are what is expected, this has the advantage that you can see over a period of time all of the things that have connected to the queue.Below is an example of one way to do this using the amqsevt from IBM MQ v9.1 or later and targeting a IBM MQ v9.0 or later queue manager (this relies on a opensource JSON processor calledjq). The example below will run until there is no activity for 5 minutes (300 seconds) or until a key is pressed (you can increase the time by increasing the-wvalue):#Replace the string _REPLACE_WITH_QMGR_NAME_ with your queue manager name in both places.\n#Replace the string _REPLACE_WITH_QUEUE_NAME_ with your queue name.\n\namqsevt -m _REPLACE_WITH_QMGR_NAME_ -t '$SYS/MQ/INFO/QMGR/_REPLACE_WITH_QMGR_NAME_/ActivityTrace/ConnectionId/#' -w 300 -o json | jq -r '\n.eventData\n| [.channelName, .channelType, .connectionName, .applName, .remoteProduct, .remoteVersion] as $x\n| ( .activityTrace[]\n | select(.objectName == \"_REPLACE_WITH_QUEUE_NAME_\") | [.operationTime]\n + $x\n + [.operationId, .objectName, .resolvedQueueName, .reasonCode.value, .putDate, .putTime] )\n| @csv\n'\n"} +{"text": "### Human: I ve created 2 hosts (1local and 1 on windows VM). Set everything according to screen to create cluster with goal to make clustered topic:So i added 2 FR and 6 PR queue mamangers and facing 2 problems:I dont see FR2 in cluster directory, just system.tempqmgr which means its not connectedSender channels keep retrying, as u can seei can remote connect to other managers without problem. Firewall is off, authentication type is none, no authentication records are created, managers are full repository. i tried recreate managers, authentications, clusters, turn on/off channels, nothing worked. Any ideas?EDIT: I found out that even basic sender-receiver channels are not working. What can be problem?In chat found out from OP the following error being reported:9. 3. 2020 17:27:20 - Process(7292.1) User(MUSR_MQADMIN) Program(runmqchl.exe)\nHost(DESKTOP-630J3C2) Installation(Installation1)\nVRMF(9.1.0.0) QMgr(CTHFR1)\nTime(2020-03-09T16:27:20.542Z)\nArithInsert1(852) ArithInsert2(437)\n\nAMQ6047E: Conversion not supported.\n\nEXPLANATION:\nIBM MQ is unable to convert string data tagged in CCSID 852 to data in CCSID\n437.### Assistant: After further discussion in chat the SO provided info fromCTHFR1'sAMQERR01.LOGfile.The key info from this was the error below directly after the entry showing that the channelTO.CTHRF2started:AMQ6047E: Conversion not supported.\n\nEXPLANATION:\nIBM MQ is unable to convert string data tagged in CCSID 852 to data in CCSID\n437.CCSID 852 is a code page used under DOS to write Central European languages that use Latin script.CCSID 437 is the character set of the original IBM PC.This means thatCTHFR1on the local PC is running with CCSID 852 andCTHFR2on the VM is running with CCSID 437. I am not sure I understand why conversion is required since both theCLUSSDRandCLUSRCVRdefinitions provided in the chat hadCONVERT(NO)set but I suspect it has to do with both queue managers being full repositories for the cluster. In any case apparently IBM MQ on Windows can not convert from 852 to 437. The suggested resolution to this problem is to set the CCSID ofCTHFR1to 437 and restart.ALTER QMGR CCSID(437)The OP confirmed this resolved the issue.\n"} +{"text": "### Human: My mule application is comprised of 2 nodes running in a cluster, and it listens to IBM MQ Cluster (basically connecting to 2 MQ via queue manager). There are situations where one mule node pulls or takes more than 80% of message from MQ cluster and another mule node picks rest 20%. This is causing CPU performance issues.\nWe have double checked that all load balancing is proper, and very few times we get CPU performance problem. Please can anybody give some ideas what could be possible reason for it.Example: last scenario was created where there are 200000 messages in queue, and node2 mule server picked 92% of message from queue within few minutes.### Assistant: This issue has been fixed now. Got into the root cause - our mule application running on MULE_NODE01 reads/writes to WMQ_NODE01, and similarly for node 2. One of the mule node (lets say MULE_NODE02) reads from linux/windows file system and puts huge messages to its corresponding WMQ_NODE02. Now, its IBM MQ which tries to push maximum load to other WMQ node to balance the work load. That's why MULE_NODE01 reads all those loaded files from WMQ_NODE01 and causes CPU usage alerts.@JoshMc your clue helped a lot in understanding the issues, thanks a lot for helping.Its WMQ node in a cluster which tries to push maximum load to other WMQ node, seems like this is how MQ works internally.To solve this, we are now connecting our mule node to MQ gateway, rather making 1-to-1 connectivity\n"} +{"text": "### Human: I have a customized version of amqmdnet.dll which is referenced in my project locally AND which is deployed with the application.This is in the logs of the server where our application runs and which interacts with IBM queuesSystem.IO.FileLoadException: Could not load file or assembly '' or one of its dependencies. \n General Exception (Exception from HRESULT: 0x80131500)\n File name: 'amqmdnet, Version=7.5.0.0, Culture=neutral, PublicKeyToken=dd3cb1c9aae9ec97'\n at IBM.WMQ.MQDestination.Put(MQMessage message)However, the project file (.csproj) references a totally different version of amqmdnet.dll\n False\n IBM\\amqmdnet.dll\n We are wrestling with a number of questions hereIn the server logs why is the version number of amqmdnet dll showing up as 7.5.0.0 with the same public Key token even though we have version 9.0.3.0 deployed ? There is no IBM client installed on the server (it is a barebones Azure container).The exception is thrown ONLY when the Put method is called. Before that a whole lot of initialization happens without a problem eg. initialization of MQQueue objects and so on. Why is the Put method of the correct assembly (9.0.3.0) trying to call a method from a different assembly version (7.5.0.0) ?UpdateThis was due to a system issue and a restart seems to fix it. It still does not tell us why the problem occurred but it has nothing to do with amqmdnet or possibly, even the code.### Assistant: Create aapp.configwith contents like the following to make sure the program uses a specific version of theamqmdnet.dll.\n\n \n \n \n \n \n \n \n \n \n \n \n\n"} +{"text": "### Human: I have a \"blackbox\" application written in Java that connects to MQ. On unix server there is MQ Client installation version 7.5.0. Java application is using 1.7.0_79. I have to useSSL_RSA_WITH_AES_256_CBC_SHA256to make the connection.I cannot upgrade to MQ Client v8. I am not entirely sure if I can connect having MQ Client version 7.5.0 and for instance useSSL_RSA_WITH_AES_256_CBC_SHA256.Would be that even possible to establish connection having these components ?### Assistant: IBM added support for non-IBM Java cipher suite names via APAR IV66840, this was included in MQ v7.5.0.5.What you are asking should be possible if you have the following:Set this java system property-Dcom.ibm.mq.cfg.useIBMCipherMappings=falseorSystem.setProperty(\"com.ibm.mq.cfg.useIBMCipherMappings\", \"false\")Use cipher suite valueTLS_RSA_WITH_AES_256_CBC_SHA256.Note does not start withSSL_for Oracle java.Make sure the strong cryptographic provider is enable in java to support ciphersuites with AES256 encryption. It appears that if you upgrade to a higher level of java 7 (1.7.0_161 for example) this will be included and enabled by default.Use a JKS keyStore.\n"} +{"text": "### Human: Need to get the complete list of authorizations for MQ object (typically a queue), like the one returned bydspmqautcommand, but with PCF.Any idea how this could be done?I believe this should be possible, as soon as MQ Explorer, supposed to operate with PCF, enables such function.UPDATENeed to do that in java, the regular attributes of the queue are already received without a problem (MQCMD_INQUIRE_Q, MQCMD_INQUIRE_Q_STATUS, etc.)FOLLOW UP to Josh comment, finally worked with the code belowPCFMessage request = new PCFMessage(MQConstants.MQCMD_INQUIRE_AUTH_RECS);\nrequest.addParameter(MQConstants.MQIACF_AUTH_OPTIONS, MQConstants.MQAUTHOPT_ENTITY_EXPLICIT+MQConstants.MQAUTHOPT_NAME_ALL_MATCHING+MQConstants.MQAUTHOPT_NAME_AS_WILDCARD);\nrequest.addParameter(MQConstants.MQIACF_OBJECT_TYPE, MQConstants.MQOT_Q);\nrequest.addParameter(MQConstants.MQCACF_AUTH_PROFILE_NAME, \"*\");\nrequest.addParameter(MQConstants.MQIACF_AUTH_PROFILE_ATTRS, MQConstants.MQIACF_ALL);### Assistant: The documentation is located in the IBM MQ Knowledge Center. You can find the v9.0 KC pageReference > Administration reference > Programmable command formats reference > Definitions of the Programmable Command Formats > Inquire Authority Records on Multiplatforms.For examples of usage I did a git search forMQCMD_INQUIRE_AUTH_RECS for Javawhich brings up brings up a couple of examples. Take away the language restriction and you will have more examples, the PCF concept is the same across all languages.\n"} +{"text": "### Human: I'm usinghttps://github.com/ibm-messaging/kafka-connect-mq-sourceproject to build the connector to pull the data from IBM MQ to Kafka topic.\nI'm seeing an issue where the suppliedused-idis getting modified to thesystem userand authentication failed with the following error :The MQ Admin reported that I'm supplying different user id.\nI've configured to sendMQUseras userid(I'm executing this connector on linux server). But when it reaches MQ, the userid is modified towljay(which is the user I logged in on server)ERROR MQ error: CompCode 2, Reason 2035 MQRC_NOT_AUTHORIZED \n (com.ibm.eventstreams.connect.mqsource.JMSReader:413)\n INFO Polling for records \n (com.ibm.eventstreams.connect.mqsource.MQSourceTask:120)\n ERROR JMS exception {} (com.ibm.eventstreams.connect.mqsource.JMSReader:362)\n\ncom.ibm.msg.client.jms.DetailedJMSSecurityRuntimeException: JMSWMQ2008: Failed to open MQ queue 'LOC.E.KAFKA.QUEUE'.\nJMS attempted to perform an MQOPEN, but IBM MQ reported an error.\nUse the linked exception to determine the cause of this error. Check that the specified queue and queue manager are defined correctly.\n at com.ibm.msg.client.jms.DetailedJMSSecurityException.getUnchecked(DetailedJMSSecurityException.java:270)\n at com.ibm.msg.client.jms.internal.JmsErrorUtils.convertJMSException(JmsErrorUtils.java:173)\n at com.ibm.msg.client.jms.internal.JmsContextImpl.createConsumer(JmsContextImpl.java:416)\n at com.ibm.eventstreams.connect.mqsource.JMSReader.connectInternal(JMSReader.java:342)\n at com.ibm.eventstreams.connect.mqsource.JMSReader.receive(JMSReader.java:225)\n at com.ibm.eventstreams.connect.mqsource.MQSourceTask.poll(MQSourceTask.java:124)\n at org.apache.kafka.connect.runtime.WorkerSourceTask.poll(WorkerSourceTask.java:244)\n at org.apache.kafka.connect.runtime.WorkerSourceTask.execute(WorkerSourceTask.java:220)\n at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:175)\n at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:219)\n at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n at java.util.concurrent.FutureTask.run(FutureTask.java:266)\n at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n at java.lang.Thread.run(Thread.java:748)\nCaused by: com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED').\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:203)\n at com.ibm.msg.client.wmq.internal.WMQMessageConsumer.checkJmqiCallSuccess(WMQMessageConsumer.java:222)\n at com.ibm.msg.client.wmq.internal.WMQMessageConsumer.checkJmqiCallSuccess(WMQMessageConsumer.java:156)\n at com.ibm.msg.client.wmq.internal.WMQConsumerShadow.initialize(WMQConsumerShadow.java:1176)\n at com.ibm.msg.client.wmq.internal.WMQSyncConsumerShadow.initialize(WMQSyncConsumerShadow.java:133)\n at com.ibm.msg.client.wmq.internal.WMQMessageConsumer.(WMQMessageConsumer.java:486)\n at com.ibm.msg.client.wmq.internal.WMQSession.createConsumer(WMQSession.java:918)\n at com.ibm.msg.client.jms.internal.JmsSessionImpl.createConsumer(JmsSessionImpl.java:1032)\n at com.ibm.msg.client.jms.internal.JmsSessionImpl.createConsumer(JmsSessionImpl.java:1116)\n at com.ibm.msg.client.jms.internal.JmsContextImpl$SessionWrapper.createConsumer(JmsContextImpl.java:1991)\n at com.ibm.msg.client.jms.internal.JmsContextImpl.createConsumer(JmsContextImpl.java:403)IS there something I've to change the way the username passed?\nAny help is greatly appreciated.\nThanks!!### Assistant: The following line means that the user and password you provide will be sent in the MQCSP structure.mqConnFactory.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, true);The user the process is running as will be sent in theMQCDRemoteUserfield. The fact that your Queue Manager is denying the connection based on the user the process is running under means that it is not authenticating you, instead it is letting you assert a username.If the queue manager is at a supported version of MQ then the admin could configure it to turn on CONNAUTH and require that you send a valid username and password. If it is already configured to require CONNAUTH then they would need to make sure to setADOPTCTX(YES)to have MQ used the authenticated username for authority checks.MQ 7.1 does not support CONNAUTH and is not a currently supported version from IBM. The options to authenticate on that version are:Use client side certs that the queue manager maps to a MCAUSER on the channel or via CHLAUTH SSLPEERMAP rules.Use security exits.If the MQ Admins really do not care about authenticating your application they canhard code a MCAUSER on the channeluse a CHLAUTH USERMAP rule to mapwljaytoMQUser.\n"} +{"text": "### Human: Last year I developed a queue monitor that's using System.Reactive.Linq to check if there was a message on the IBM MQ busThe code is the followingpublic class QueueMonitor : IObservable, IDisposable\n{\n private string queueName;\n private readonly MQQueue mqQueue;\n private readonly MQQueueManager queueManager;\n\n private readonly IDisposable timer;\n private readonly object lockObj = new object();\n private bool isChecking;\n\n private readonly List> observers;\n\n public QueueMonitor(MQQueueManager queueManager, string queueName)\n {\n this.queueName = queueName;\n this.queueManager = queueManager;\n\n observers = new List>();\n\n mqQueue = queueManager.AccessQueue(queueName,\n MQC.MQOO_INPUT_AS_Q_DEF // open queue for input\n + MQC.MQOO_FAIL_IF_QUIESCING); // but not if MQM stopping\n\n timer = Observable.Interval(TimeSpan.FromSeconds(5)).Subscribe(_ =>\n {\n lock (lockObj)\n {\n if (!isChecking)\n {\n isChecking = true;\n\n var mqMsg = new MQMessage();\n var mqGetMsgOpts = new MQGetMessageOptions {WaitInterval = 1};\n\n // 15 second limit for waiting\n mqGetMsgOpts.Options |= MQC.MQGMO_WAIT;\n try\n {\n mqQueue.Get(mqMsg, mqGetMsgOpts);\n if (mqMsg.Format.CompareTo(MQC.MQFMT_STRING) == 0)\n {\n var text = mqMsg.ReadString(mqMsg.MessageLength);\n System.Console.WriteLine(text);\n\n Message message = new Message { Content = text };\n foreach (var observer in observers)\n observer.OnNext(message);\n }\n else\n {\n System.Console.WriteLine(\"Non-text message\");\n }\n }\n catch (MQException ex)\n {\n if ((ex.Message == \"MQRC_NO_MSG_AVAILABLE\"))\n {\n //nothing to do, emtpy queue\n }\n else\n {\n //log\n }\n }\n finally\n {\n isChecking = false;\n }\n }\n }\n });\n\n }\n\n public IDisposable Subscribe(IObserver observer)\n {\n if (!observers.Contains(observer))\n observers.Add(observer);\n\n return new Unsubscriber(observers, observer);\n }\n\n public void Dispose()\n {\n ((IDisposable)mqQueue)?.Dispose();\n ((IDisposable)queueManager)?.Dispose();\n\n timer?.Dispose();\n }\n}\n\npublic class Unsubscriber : IDisposable\n{\n private readonly List> _observers;\n private readonly IObserver _observer;\n\n public Unsubscriber(List> observers, IObserver observer)\n {\n this._observers = observers;\n this._observer = observer;\n }\n\n public void Dispose()\n {\n if (_observer != null) _observers.Remove(_observer);\n }\n}This worked for almost a year, but now 2 things need to be fixed, and hope you can help me getting it done right.1) If the IBMMQ is restarted, currently the QueueMonitor doesn't get new incoming message, it needs to be re-started.How should I handle it? I don't know if there's a restart of the IBM MQ on the Monitor side.2) More complicated. We're migrating to a new balanced IBMMQ cluster. It has 4 active nodes configured as active. They are all behind a load balancer so when I put a message on the bus I send it to a single address.For sending a message, it's simple. The problem I've is when I need to read from the queue. Since there're 4 different IBMMQ nodes, with 4 IPs. How do I know that a message has been sent on the bus? I can't simply listen on the balancer since it won't have a notification. Should I ping the 4 nodes?The balancer is netscaler.Thanks in advance### Assistant: In IBM MQ cluster, you can connect to any queue manager in the cluster and push a message, MQ ensures that the message reaches to its destination queue even if the queue wasn't locally defined on the queue manager you connected to while performing the put action. While performing a get message action by an application from a queue, you have to connect to the queue manager which locally has the destination queue defined to pick the message. So, yes in your case you'll have to connect to each individual 4 queue managers to pick message.Since you are migrating to new MQ architecture, I would suggest you to look at IBM MQ v9.1 Advanced which has a concept of RDQM. RDQM (replicated data queue manager) is a high availability solution that is available on Linux platforms as of now.Find below the link:https://www.ibm.com/support/knowledgecenter/SSFKSJ_9.1.0/com.ibm.mq.con.doc/q130280_.htm\n"} +{"text": "### Human: Hava a Java client application that can connect to a Kubernetes cluster over SSL usingio.kubernetes.client.ApiClientokay on its own. The same Java client application can also connect to an MQ cluster over SSL on its own. The same application however cannot connect to both Kubernetes cluster over SSL and MQ cluster over SSL all at once.I believe this may be due to the fact that only one SSL key/trust store can be configured on a JVM at any one time? But do not know what the best way forward is in order to resolve this.What would be the simplest way to allow a Java client to connect to both a Kubernetes cluster and an MQ cluster each over SSL?The two configurations shown in this post result in the following error being thrown when both are run together:WARN io.kubernetes.client.util.credentials.ClientCertificateAuthentication - Could not create key manager for Client Certificate authentication.\njava.security.UnrecoverableKeyException: Cannot recover keyThe Kubernetes part of the client application connects to the Kubernetes cluster by configuring as follows:String kubeConfigPath = \"~/.kube/config\";\napiClient = ClientBuilder.kubeconfig(\n KubeConfig.loadKubeConfig(new FileReader(kubeConfigPath))).build();\napiClient.getHttpClient().setReadTimeout(0, TimeUnit.SECONDS);\n Configuration.setDefaultApiClient(apiClient);The Mq part of the client application connects to the MQ cluster by configuring as follows:System.setProperty(\"javax.net.ssl.trustStore\", \"C:\\\\tmp\\\\ssl\\\\dev\\\\mgr_mq.jks\");\nSystem.setProperty(\"javax.net.ssl.trustStorePassword\", \"password\");\nSystem.setProperty(\"javax.net.ssl.keyStore\", \"C:\\\\tmp\\\\ssl\\\\dev\\\\mgr_mq.jks\");\nSystem.setProperty(\"javax.net.ssl.keyStorePassword\", \"password\");\nSystem.setProperty(\"com.ibm.mq.cfg.useIBMCipherMappings\", \"false\");\n\njava.net.URL ccdt = new URL(\"file:./config/qmgrs/mgr/AMQCLCHL.TAB\");\nMQQueueManager mqQueueManager = new MQQueueManager(\"*mgr\", ccdt);### Assistant: TheKubernetes java client API codeseems to force adding the certificate referenced in.kube/configto a new truststore that it creates new each time before adding the certificate to it.This seems to take place inClientCertifiacteAuthentication.javaclass'provide(ApiClient client)method:final KeyManager[] keyManagers = SSLUtils.keyManagers(certificate, key, algo, \"\", null, null);Where the twonullvalues which arekeyStoreFileandkeyStorePassphrasethen force a new truststore to be created within.So for now and to prove that a solution is possible I have overriden this class to be:final KeyManager[] keyManagers = SSLUtils.keyManagers(certificate, key, algo, \"password\", \"C:\\\\tmp\\\\ssl\\\\dev\\\\mgr_mq.jks\", \"password\");With this overriden code, both Kubernetes cluster and MQ cluster can be successfully connected to over SSL within the same JVM.\n"} +{"text": "### Human: I am working on an application where I read from a IBM MQ queue, process the message, and then send that message to a Kafka Topic. I am trying to handle the case where my Kafka broker goes down. In that case, I want my application to rollback the transaction and try to write to the Kafka topic again for X number of retries after which I will send the message to a back up queue. However, i am having trouble throwing an exception on the messageChannel.send call. I am unable to make it timeout. The application is infinitely blocked on the messageChannel.send call. Here is my code:@Component\npublic class MainQueueListener {\n\n @Value(\"${mq.queueName}\")\n String queueName;\n private ExecutionFlow executionFlow;\n\n public MainQueueListener(final ExecutionFlow executionFlow ) {\n this.executionFlow= executionFlow;\n }\n\n /**\n * Receive message from main queue.\n * The containerFactory is defined in infrastructure.jms.JmsComfig\n * @param byteMessage JMSBytesMessage \n */\n @JmsListener(containerFactory = \"jmsFactory\", destination = \"${mq.queueName}\")\n public void receiveMessage(JMSBytesMessage byteMessage) {\n executionFlow .execute(byteMessage, queueName);\n }\n}Configs for the transaction manager and listener container.public class JmsConfig {\n\n private JmsErrorHandler errorHandler = new JmsErrorHandler();\n\n /**\n * Default JmsListenerContainer could be modified if needed\n * @param connectionFactory \n */\n\n @Bean\n public JmsListenerContainerFactory jmsFactory(ConnectionFactory connectionFactory,\n DefaultJmsListenerContainerFactoryConfigurer configurer) {\n DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();\n factory.setErrorHandler(errorHandler);\n configurer.configure(factory, connectionFactory);\n return factory;\n }\n\n /**\n * Instanciating a JmsTransactionManager: a local transaction manager. It will receive the ConnectionFactory\n */\n @Bean\n public PlatformTransactionManager platformTransactionManager(ConnectionFactory connectionFactory) {\n JmsTransactionManager jmsTransactionManager = new JmsTransactionManager(connectionFactory);\n jmsTransactionManager.setTransactionSynchronization(AbstractPlatformTransactionManager.SYNCHRONIZATION_ON_ACTUAL_TRANSACTION);\n jmsTransactionManager.setRollbackOnCommitFailure(true);\n return jmsTransactionManager;\n }\n}The execution flow will call the messageChannel.send :public void sendMessage(MessageTarget messageTarget) {\n\n MessageChannel messageChannel;\n String topicName = messageTarget.getDestination();\n switch (topicName) {\n case \"A\":\n messageChannel = MessageStreams.outboundMessageA();\n break;\n case \"B\":\n messageChannel = MessageStreams.outboundMessageB();\n break;\n default:\n throw new RuntimeException(\"Invalid destination: \" + topicName);\n }\n\n Message message = MessageBuilder\n .withPayload(messageTarget.getResponse())\n .build();\n System.out.println(messageChannel.send(message,3000)); //stuck here no timeout\n }And finally my application config file:spring:\n cloud:\n stream:\n kafka:\n binder:\n brokers: localhost:9092\n transaction:\n transaction-id-prefix: txn.\n producer:\n sync: true\n configuration:\n acks: all\n enable:\n idempotence: true\n retries: 10\n max:\n block:\n ms: 5000\n bindings:\n AResponseOutputStreamChannel:\n destination: topicA\n BResponseOutputStreamChannel:\n destination: topicB\n\n mustache:\n check-template-location: false\n\n\nibm:\n mq:\n queue-manager: QM1\n conn-name: localhost(1414)\n channel: DEV.ADMIN.SVRCONN\n user: xxx\n password: xxx\n\nmq.queueName: Q1\nbo-queue: Q2Here is the output when the listener receives a message and i kill my local kafka docker container before calling the messageChannel.send. None of the timeot in the send call or the max.block.ms parameter seems to make a difference.2019-08-15 20:47:02,365 WARN [kafka-producer-network-thread | producer-1] org.apache.kafka.clients.NetworkClient: [Producer clientId=producer-1, transactionalId=txn.0] Connection to node 1001 could not be established. Broker may not be available.\n2019-08-15 20:47:04,371 WARN [kafka-producer-network-thread | producer-1] org.apache.kafka.clients.NetworkClient: [Producer clientId=producer-1, transactionalId=txn.0] Connection to node 1001 could not be established. Broker may not be available.\n2019-08-15 20:47:06,281 WARN [kafka-producer-network-thread | producer-1] org.apache.kafka.clients.NetworkClient: [Producer clientId=producer-1, transactionalId=txn.0] Connection to node 1001 could not be established. Broker may not be available.\n2019-08-15 20:47:08,391 WARN [kafka-producer-network-thread | producer-1] org.apache.kafka.clients.NetworkClient: [Producer clientId=producer-1, transactionalId=txn.0] Connection to node 1001 could not be established. Broker may not be available.\n2019-08-15 20:47:10,399 WARN [kafka-producer-network-thread | producer-1] org.apache.kafka.clients.NetworkClient: [Producer clientId=producer-1, transactionalId=txn.0] Connection to node 1001 could not be established. Broker may not be available.\n2019-08-15 20:47:12,408 WARN [kafka-producer-network-thread | producer-1] org.apache.kafka.clients.NetworkClient: [Producer clientId=producer-1, transactionalId=txn.0] Connection to node 1001 could not be established. Broker may not be available.\n2019-08-15 20:47:14,419 WARN [kafka-producer-network-thread | producer-1] org.apache.kafka.clients.NetworkClient: [Producer clientId=producer-1, transactionalId=txn.0] Connection to node 1001 could not be established. Broker may not be available.\n2019-08-15 20:47:16,425 WARN [kafka-producer-network-thread | producer-1] org.apache.kafka.clients.NetworkClient: [Producer clientId=producer-1, transactionalId=txn.0] Connection to node 1001 could not be established. Broker may not be available.\n2019-08-15 20:47:18,434 WARN [kafka-producer-network-thread | producer-1] org.apache.kafka.clients.NetworkClient: [Producer clientId=producer-1, transactionalId=txn.0] Connection to node 1001 could not be established. Broker may not be available.\n2019-08-15 20:47:20,342 WARN [kafka-producer-network-thread | producer-1] org.apache.kafka.clients.NetworkClient: [Producer clientId=producer-1, transactionalId=txn.0] Connection to node 1001 could not be established. Broker may not be available.\n2019-08-15 20:47:22,556 WARN [kafka-producer-network-thread | producer-1] org.apache.kafka.clients.NetworkClient: [Producer clientId=producer-1, transactionalId=txn.0] Connection to node 1001 could not be established. Broker may not be available.\n2019-08-15 20:47:24,565 WARN [kafka-producer-network-thread | producer-1] org.apache.kafka.clients.NetworkClient: [Producer clientId=producer-1, transactionalId=txn.0] Connection to node 1001 could not be established. Broker may not be available.\n2019-08-15 20:47:26,470 WARN [kafka-producer-network-thread | producer-1] org.apache.kafka.clients.NetworkClient: [Producer clientId=producer-1, transactionalId=txn.0] Connection to node 1001 could not be established. Broker may not be available.\n2019-08-15 20:47:28,377 WARN [kafka-producer-network-thread | producer-1] org.apache.kafka.clients.NetworkClient: [Producer clientId=producer-1, transactionalId=txn.0] Connection to node 1001 could not be established. Broker may not be available.\n2019-08-15 20:47:30,386 WARN [kafka-producer-network-thread | producer-1] org.apache.kafka.clients.NetworkClient: [Producer clientId=producer-1, transactionalId=txn.0] Connection to node 1001 could not be established. Broker may not be available.\n2019-08-15 20:47:32,289 WARN [kafka-producer-network-thread | producer-1] org.apache.kafka.clients.NetworkClient: [Producer clientId=producer-1, transactionalId=txn.0] Connection to node 1001 could not be established. Broker may not be available.\n2019-08-15 20:47:34,397 WARN [kafka-producer-network-thread | producer-1] org.apache.kafka.clients.NetworkClient: [Producer clientId=producer-1, transactionalId=txn.0] Connection to node 1001 could not be established. Broker may not be available.\n2019-08-15 20:47:36,408 WARN [kafka-producer-network-thread | producer-1] org.apache.kafka.clients.NetworkClient: [Producer clientId=producer-1, transactionalId=txn.0] Connection to node 1001 could not be established. Broker may not be available.\n2019-08-15 20:47:38,518 WARN [kafka-producer-network-thread | producer-1] org.apache.kafka.clients.NetworkClient: [Producer clientId=producer-1, transactionalId=txn.0] Connection to node 1001 could not be established. Broker may not be available### Assistant: It's a bug; I see this...org.apache.kafka.common.errors.TimeoutException: Timeout expired after 5000milliseconds while awaiting EndTxn(COMMIT)After the failure, we are attempting to close the producer, but we call theclose()method with no timeout, so it hangs until the broker comes back up.\n"} +{"text": "### Human: I currently have an XMIT queue with a SDR channel pointed to a QREMOTE. In a scenario where either the local or remote channels are down, I would like to forward the messages on the XMIT queue to the DLQ. It appears that in this scenario, messages remain on the XMIT queue until the channel is reestablished. Is it possible to do this?### Assistant: I'm thinking not. From an ibm red paper:http://www.redbooks.ibm.com/redpapers/pdfs/redp0021.pdfA transmission queue is a local queue with the USAGE(XMITQ) attribute\n configured. It is a staging point for messages that are destined for a\n remote queue manager. Typically, there is one transmission queue for\n each remote queue manager to which the local queue manager might\n connect directly. If the destination is unavailable, messages build up\n on the transmission queue until the connection can be successfully\n completed. Transmission queues are transparent to the application.\n When an application opens a remote queue, the queue manager\n internally creates a reference to the relevant transmission queue and\n messages are put there.\n"} +{"text": "### Human: I am running a Spring Cloud Stream application where I read transactions from a Kafka topic, process the transaction and then send them to a IBM MQ. I am trying to deal with the error when there is no connection with IBM MQ to prevent transaction loss. In this case the jms template will throw an exception and the stream listener won't commit the transaction. The expected behavior is for the transaction to stay in the Kafka topic and for the stream listener to read it again. However the message seems to be consumed only once and there is no \"rollback\" taking place. To do so here are my configs :spring:\n cloud:\n stream:\n kafka:\n bindings:\n input:\n consumer:\n auto-commit-offset: false\n bindings:\n input:\n destination: kafka_topic\n brokers: localhost:9092And here is the code :public void handleMessage(Message request, @Header(KafkaHeaders.ACKNOWLEDGMENT) Acknowledgment acknowledgment) {\n TransactionMessage message = request.getPayload();\n System.out.println(\"Consumed a message\");\n try {\n executionFlow.execute(message); // here the jmsTemplate throws an exception\n System.out.println(\"doing the ack\");\n acknowledgment.acknowledge();\n }\n catch (RuntimeException e) {\n System.out.println(\"did not send to MQ\");\n }\n }The code of the jmsTemplate which is called by the executionFlow :public void sendMessage(String messageTarget) {\n\n System.out.println(\"i am trying to send to MQ\");\n try {\n jmsTemplate.convertAndSend(destinationTopicQueue, messageTarget);\n } catch (Exception e) {\n throw new RuntimeException(\"jmsTemplate failed to send to IBM MQ\");\n }\n }Here is the output when I close the connection to IBM MQ:Consumed a message\ni am trying to send to MQ\ndid not send to MQ### Assistant: catch (RuntimeException e) {\n System.out.println(\"did not send to MQ\");\n }You need to re-throw the exception to cause a rollback.You also need to enable Kafka transactions in the binder.SeeKafka Binder Properties.spring.cloud.stream.kafka.binder.transaction.transactionIdPrefixEnables transactions in the binder. See transaction.id in the Kafka documentation and Transactions in the spring-kafka documentation. When transactions are enabled, individual producer properties are ignored and all producers use the spring.cloud.stream.kafka.binder.transaction.producer.* properties.Default null (no transactions)If you also send data to kafka, you need a transactional producerspring.cloud.stream.kafka.binder.transaction.producer.*Global producer properties for producers in a transactional binder. See spring.cloud.stream.kafka.binder.transaction.transactionIdPrefix and Kafka Producer Properties and the general producer properties supported by all binders.Default: See individual producer properties.\n"} +{"text": "### Human: When using IBM PCF Messages to monitor a queue, getting values of Input Count (MQIA_OPEN_INPUT_COUNT), it works perfectly for MQ Servers installed in Windows environment, but not for Linux. Not sure if it is a code or environment issue.If we connect to a Windows service and perform que query there are more parameters in the response if compared to the Linux.Same code, different results. Not sure if it is a configuration on the Channel, permissions or any other environment issue. On both MQ Servers the queues are local.I've tried using IBM.WMQ.MQC.MQCMD_INQUIRE_Q_STATUS, with no success. Didn't find any workaround to get MQIA_OPEN_INPUT_COUNT.PCFMessages documentation is very limited, so I didn't find anything related to this problem at MQIA_OPEN_INPUT_COUNT documentation:https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_7.5.0/com.ibm.mq.ref.adm.doc/q087810_.htmAny idea of how to solve this?Public Function GetQtyQConnections(ByVal MQQueueName As String) As Integer\n\n Dim queueManager As IBM.WMQ.MQQueueManager = Nothing\n queueManager = New IBM.WMQ.MQQueueManager(AppSettings(\"MQQueueManagerName\"), AppSettings(\"MQChannelName\"), AppSettings(\"MQConnectionName\"))\n\n Dim oPCFMessageAgent As IBM.WMQ.PCF.PCFMessageAgent = New IBM.WMQ.PCF.PCFMessageAgent\n\n oPCFMessageAgent.Connect(queueManager)\n\n Dim pcfMsg As IBM.WMQ.PCF.PCFMessage = New IBM.WMQ.PCF.PCFMessage(IBM.WMQ.MQC.MQCMD_INQUIRE_Q)\n pcfMsg.AddParameter(IBM.WMQ.MQC.MQCA_Q_NAME, MQQueueName)\n\n Dim pcfResponse() As IBM.WMQ.PCF.PCFMessage = oPCFMessageAgent.Send(pcfMsg)\n\n Dim pcfResponseLen As Integer = pcfResponse.Length\n\n Dim inputcount As Integer = -1\n\n For i As Integer = 0 To pcfResponseLen - 1\n\n Dim oParams() As IBM.WMQ.PCF.PCFParameter = pcfResponse(i).GetParameters\n\n For Each oParam As IBM.WMQ.PCF.PCFParameter In oParams\n Select Case oParam.Parameter\n Case IBM.WMQ.MQC.MQIA_OPEN_INPUT_COUNT\n inputcount = Integer.Parse(oParam.GetValue())\n End Select\n Next\n\n Next\n\n Return inputcount\n\nEnd FunctionOn Windows:---------------\n2016-QUEUENAME \n20-1\n134--3\n2027-2018-03-12 \n2028-13.59.40\n2019- \n22-0\n2030- \n2029- \n2124- \n96-0\n95-0\n98--3\n2004-2018-03-12 \n2005-13.59.40\n3-0\n2119- \n61-0\n6-0\n5-1\n184-1\n188-0\n4-2\n7-1\n2013- \n34-0\n9-0\n8-1\n272-2\n2008- \n17-0\n15-5000\n13-104857600\n123--3\n16-0\n24-0\n78-0\n18-0\n2012- \n10-0\n190-0\n40-80\n41-20\n43-0\n44-0\n42-1\n46-0\n54-999999999\n21-999999999\n45-1\n23-1\n128--3\n2023- \n29-1\n26-0\n28-1\n12-0On Linux:---------------\n2016-QUEUENAME \n20-6\n2027-2019-03-11 \n2028-17.38.24\n2030- \n2029- \n96-0\n95-0\n2119- \n61-1\n6-0\n5-1\n184-1\n2013-QUEUEDESCRIPTION\n10-0\n2017-QUEUEMANAGER \n2018-QUEUENAME \n45-1\n2024-QUEUEMANAGER### Assistant: From your output I can see that the queue you have looked at on Windows is a local queue. The second parameter you display (20) is MQIA_Q_TYPE and it has a value of (1) MQQT_LOCAL.The queue you have looked at on Linux however is a remote queue. It's MQIA_Q_TYPE (20) parameter has a value of (6) MQQT_REMOTE.There are many differences between local queues and remote queues, and their attributes are quite different. Try using runmqsc and display a few local and remote queues to understand the differences. These differences have not occurred because of the different platform, just because of the different queue type.You say in your question that on both MQ Servers the queues are local, but I'm afraid that is not what your output is showing.Also, if you want to use the Inquire Queue command, please be sure you know that OpenInputCount and OpenOutputCount are only shown for local queues, not remote queues.\n"} +{"text": "### Human: The pip install py3mqi fails with the following error.(mq) C:\\Temp\\>pip install py3mqi\nCollecting py3mqi\n Downloading https://files.pythonhosted.org/packages/5a/b7/cbe684e6a2a7f00dee116392d38c17c03b8281a8b5a021b655833233de26/py3mqi-1.6.0.tar.gz (65kB)\n |\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 71kB 770kB/s\nBuilding wheels for collected packages: py3mqi\n Building wheel for py3mqi (setup.py) ... error\n ERROR: Complete output from command 'c:\\users\\dhdyk0\\envs\\mq\\scripts\\python.exe' -u -c 'import setuptools, tokenize;__file__='\"'\"'C:\\\\Users\\\\dhdyk0\\\\AppData\\\\Local\\\\Temp\\\\pip-install-jmsvk9ya\\\\py3mqi\\\\setup.py'\"'\"';f=getattr(tokenize, '\"'\"'open'\"'\"', open)(__file__);code=f.read().replace('\"'\"'\\r\\n'\"'\"', '\"'\"'\\n'\"'\"');f.close();exec(compile(code, __file__, '\"'\"'exec'\"'\"'))' bdist_wheel -d 'C:\\Users\\dhdyk0\\AppData\\Local\\Temp\\pip-wheel-3y2i7hfm' --python-tag cp36:\n ERROR: Building PyMQI client 32bits\n running bdist_wheel\n running build\n running build_py\n creating build\n creating build\\lib.win32-3.6\n creating build\\lib.win32-3.6\\pymqi\n copying pymqi\\__init__.py -> build\\lib.win32-3.6\\pymqi\n copying pymqi\\CMQC.py -> build\\lib.win32-3.6\\pymqi\n copying pymqi\\CMQCFC.py -> build\\lib.win32-3.6\\pymqi\n copying pymqi\\CMQXC.py -> build\\lib.win32-3.6\\pymqi\n copying pymqi\\CMQZC.py -> build\\lib.win32-3.6\\pymqi\n running build_ext\n building 'pymqi.pymqe' extension\n error: [WinError 3] The system cannot find the path specified: 'C:\\\\Program Files (x86)\\\\Microsoft Visual Studio 14.0\\\\VC\\\\PlatformSDK\\\\lib'I've tried to install both, pymqi and py3mqi and I'm getting the same error. I'm using Python 3.6, 32-bit.\nAlso, I have MQ Client installed as well as Visual Studio 15. There is the following path on my disk:C:\\\\Program Files (x86)\\\\Microsoft Visual Studio 14.0\\\\VC, butPlatformSDK\\\\libis missing.### Assistant: As JoshMC statespymqinow supports Python 3, and should be what you are using.pymqibinds to the MQI C Layer, and requires access to MQ C Header files as well as a C compiler / linker, when it installs.The error you are getting is a common Visual Studio error, when the Windows Platform SDK has not been installed. Essentially installing Visual Studio does not mean that you have installed the C / C++ compiler, and you need to do that also.\n"} +{"text": "### Human: We were trying to send MAP (java.util) using JMS template , but at the client side we are unable to read the message and during the server start up , spring boot @JMSListener complains with the following message , this works fine with WAS 7 but doesnt with WAS Liberty 8.5.5 , iam also including the code snippet and also the different message format's that we are receiving for the different versions of server . Did any thing changed in WAS Liberty ?WAS LIBERTY - 7 -at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:116) ~[spring-messaging-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]\n2019-07-05T13:07:14.357-05:00 [APP/PROC/WEB/0] [OUT] at org.springframework.jms.listener.adapter.MessagingMessageListenerAdapter.invokeHandler(MessagingMessageListenerAdapter.java:114) ~[spring-jms-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]\n2019-07-05T13:07:14.357-05:00 [APP/PROC/WEB/0] [OUT] ... 10 common frames omitted\n2019-07-05T13:07:14.393-05:00 [APP/PROC/WEB/0] [OUT] 2019-07-05 18:07:14.370 WARN 20 --- [enerContainer-1] o.s.j.l.DefaultMessageListenerContainer : Execution of JMS message listener failed, and no ErrorHandler has been set.\n2019-07-05T13:07:14.394-05:00 [APP/PROC/WEB/0] [OUT] org.springframework.jms.listener.adapter.ListenerExecutionFailedException: Listener method 'public void com.aa.amps.base.task.finalize.BaseBowUpdateListener.receiveMessage(javax.jms.MapMessage)' threw exception; nested exception is org.springframework.jms.support.converter.MessageConversionException: Could not find type id property [_type] on message [ID:414d51204d454d5154433120202020205ccc4b2725acdc4c] from destination [null]message is MAPjmsTemplate.convertAndSend(destination, message, new MessagePostProcessor() {\n @Override\n public Message postProcessMessage(Message message) throws JMSException {\n message.setJMSReplyTo(null);\n LOGGER.info(\"In BaseBowUpdateSender - send() message to AMPS-BASE QUEUE : {} \", message);\n return message;\n }\n });WAS - LIBERTY message formatJMSMessage class: jms_text\n JMSType: null\n JMSDeliveryMode: 2\n JMSDeliveryDelay: 0\n JMSDeliveryTime: 0\n JMSExpiration: 0\n JMSPriority: 4\n JMSMessageID: ID:414d51204d454d5154433120202020205ccc4b272634ce4d\n JMSTimestamp: 1562784513140\n JMSCorrelationID: null\n JMSDestination: null\n JMSReplyTo: null\n JMSRedelivered: true\n JMSXAppID: jar \n JMSXDeliveryCount: 193\n JMSXUserID: apmqstc \n JMS_IBM_Character_Set: UTF-8\n JMS_IBM_Encoding: 273\n JMS_IBM_Format: MQSTR \n JMS_IBM_MsgType: 8\n JMS_IBM_PutApplType: 28\n JMS_IBM_PutDate: 20190710\n JMS_IBM_PutTime: 18483314\n0307/10/2019\n -- removed this \n \n"} +{"text": "### Human: I would like to know if the Basic IBM MQ Server licence cost, covers also the IBM Websphere MQ web console and the REST API.### Assistant: AsJoshMcalready answered in the comments: The MQ Console and MQ REST API are part of the MQ product.These components are also not specifically mentioned on theIBM MQ licensing pageas a separate product, so it complies to the \"All other IBM MQ components from the install media not explicitly mentioned above\" rule.\n"} +{"text": "### Human: My employer has an application running on WAS server 8.5.5. It uses MQ client adapter to connect to a MQ setup on version 7. Now my employer is upgrading to version 9 on the MQ but want to retain the WAS server at 8.5.5. Is this possible? In one of the IBM articles I saw the following:The IBM MQ Version 9.0 resource adapter cannot be deployed into earlier versions of WebSphere Application Server, as these versions are not Java\u2122 EE 7 certified.### Assistant: If your question is specifically on traditional WAS (rather than Liberty profile), then the answer is yes.tWAS bundles alevel of MQ resource adapter, and this bundled RA inherits the support lifecycle of the application server. [This support does not apply to other versions of the MQ resource adapter that have been manually applied to the tWAS installation, and so using the bundled RA is generally recommended.]Any supported MQ client can communicate with any supported MQ queue manager, as either side will negotiate the version of MQ communication flows in use down to the mutually appropriate level. This means that the MQ 7.1 resource adapter can communicate with a version 9.0 queue manager, although of course any connections that this client makes will not be eligible to use functionality added to the product after 7.1.\n"} +{"text": "### Human: Recently I've been migrated to IBM MQ v8 to IBM MQ v9 (v9.1.2.0 specifically). I used SSL to communicate with the broker. So as perDeprecated CipherSpecsdocument, IBM has deprecated number of cipher suites that came up with MQ 8 and seems all of the cipher suites I've been using, have been deprecated with v9 upward. Therefore, I've implemented new TLS cipher suites to work with my application which runs on a Oracle JVM (version 1.8.0_211). Ever since I'm getting following exception in the application though;com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2400'.\n at com.ibm.mq.MQManagedConnectionJ11.constructMQCD(MQManagedConnectionJ11.java:1437)\n at com.ibm.mq.MQManagedConnectionJ11.constructCNO(MQManagedConnectionJ11.java:1537)\n at com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:221)\n ... (Omitted the rest)When I dig about the reason, found that's a problem with IBM MQ cipher suites and Oracle JRE cipher suite name mismatch. But I did referTLS CipherSpecs and CipherSuites in IBM MQ classes for JMSdocument to map cipher suite names. I used some ofEquivalent CipherSuite (Oracle JRE)column values in my application that already available in IBM MQ as well. But still getting the issue.After I foundthis answerthat advises to add this-Dcom.ibm.mq.cfg.useIBMCipherMappings=falseargument to IBM MQ's JRE (As I understand). This might allow IBM MQ to use Oracle complied cipher suite names. My question is,How to add this JVM argument-Dcom.ibm.mq.cfg.useIBMCipherMappings=falseto IBM MQ JRE?ThisProblem Connecting a Java Client (JMS) to a IBM MQquestion suggests that the same parameter needed to be added to the application as a system propertySystem.setProperty(\"com.ibm.mq.cfg.useIBMCipherMappings\", \"false\"), but it didn't make any different.Java connection to WMQ 8question also states the same solution, but doesn't mention how to add this JVM argument to IBM MQ.Update 1I did some research about how to add a JVM argument to IBM MQ. But I was only able to find a solutions for Websphere application server.CipherSuite I'm currently using in the application is;TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256(Oracle JRE complied)IBM MQ has respective;ECDHE_ECDSA_AES_128_CBC_SHA256(IBM MQ complied)Update 2After creating akey.kdbfile withikeymantool with thestashoption queue manager can successfully read the certificates in it. Also, I've included a self-signed certificate labeled withibmwebspheremq. But now I'm getting a different exception in the client side;Exception in thread \"main\" com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2059'.\n at com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:255)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnection(MQClientManagedConnectionFactoryJ11.java:450)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnection(MQClientManagedConnectionFactoryJ11.java:487)\n at com.ibm.mq.StoredManagedConnection.(StoredManagedConnection.java:97)and in the MQ log I can find this entry;AMQ9637E: Channel is lacking a certificate.with some explanation.### Assistant: After working for while, I was able resolve this issue. Since the beginning I had this certificate configuration issue in the application side. Even after creatingself-signedcertificate labeled afteribmwebspheremqand shared the extracted certificates with the client application usingikeymantool,AMQ9637E: Channel is lacking a certificate.occurred.In a nutshell, to resolve this issue entirely, I did the following;Update the client MQ dependency tocom.ibm.mq.allclient:v9.1.2.0. If you're using maven, use following dependency (MQC91: IBM MQ Clients).\n com.ibm.mq\n com.ibm.mq.allclient\n 9.1.2.0\nNow, if the application runs on an Oracle JVM, we should convince the MQ client lib to use Oracle JVM complied cipher suite names. To do that, either add this-Dcom.ibm.mq.cfg.useIBMCipherMappings=falseas a JVM flag or add thisSystem.setProperty(\"com.ibm.mq.cfg.useIBMCipherMappings\", \"false\")as a system property.Select a appropriate cipher suite to communicate with the MQ. ThisTLS CipherSpecs and CipherSuites in IBM MQ classes for JMSdocument would be helpful as IBM hasdeprecatednumber ofweakcipher specs IBMMQ 9 onwards.I would suggest to useECDHE_*cipher specs as they provideEphemeral Keysto maintainForward Secrecy.Then, usingikeymanGUI tool, I created aself-signedcertificate labeled afteribmwebspheremqname and instead of extracting the.armfile, I export the certificate as.jksfiles. Bothkeystore.jksandtruststore.jksfiles exported from the same certificate. After, attached them to the application using system properties;System.setProperty(\"javax.net.ssl.trustStore\", \"truststore.jks\");\nSystem.setProperty(\"javax.net.ssl.trustStorePassword\", \"\");\nSystem.setProperty(\"javax.net.ssl.keyStore\", \"keystore.jks\");\nSystem.setProperty(\"javax.net.ssl.keyStorePassword\", \"\");With this configuration, SSL handshake issue went away, but the IBM MQ was still asking for user authentication with a user name and password. In order to provide them, should add these properties toMQEnvironment,MQEnvironment.properties.put(com.ibm.mq.constants.CMQC.USER_ID_PROPERTY, \"\");\nMQEnvironment.properties.put(com.ibm.mq.constants.CMQC.PASSWORD_PROPERTY, \"\");These credentials were system credentials in my case.If you simply want to skip user authentication like this, you can update IBMMQ config to skip credential check usingrunmqscCLI tool like this (Refer thisTurning on connection authentication on a queue managerdocument),ALTER QMGR CONNAUTH(USE.PW)\nDEFINE AUTHINFO(USE.PW) +\nAUTHTYPE(IDPWOS) +\nFAILDLAY(10) +\nCHCKLOCL(OPTIONAL) +\nCHCKCLNT(OPTIONAL)\nREFRESH SECURITY TYPE(CONNAUTH)Note thatCHCKCLNTvalue needed to set asOPTIONALto ignore client user credential check. IBM MQ should start to work with the client application whilst SSL enabled after these configurations.Kudos to @JoshMc for the support to resolve this issue.\n"} +{"text": "### Human: I'm write a new program, and want to connect to queue manager. how do I configure in python program?### Assistant: PyMQIallows one to connect to queue managers to issue MQAI and PCF requests.Below code establishes a connection, puts a message on a queue and disconnects.import pymqi\n\n queue_manager = 'QM01'\n channel = 'SVRCONN.1'\n host = 'host.domain.com'\n port = '1434'\n queue_name = 'TEST.1'\n message = 'Hello from Python!'\n conn_info = '%s(%s)' % (host, port)\n\n qmgr = pymqi.connect(queue_manager, channel, conn_info)\n\n queue = pymqi.Queue(qmgr, queue_name)\n queue.put(message)\n queue.close()\n\n qmgr.disconnect()More details:https://github.com/dsuch/pymqi\n"} +{"text": "### Human: Have an issue with one of MQ queue, where multiple C++ program is trying to access the queue from different host and they receiving 2042 error. I can see they are opening the queue as exclusive INPUT \"INPUT(EXCL)\" and APPLTAG(mqmessage). \nFrom queue manager side queue is set to shareable and DEFSOPT(SHARED) all looks good.What are the changes required from C++ program not to open as EXCL input? So that multiple user can access?Thanks### Assistant: Openoptions of the C++ application have to be modified.If your c++ application is having \"MQOO_INPUT_EXCLUSIVE\" as one of the OpenOptions then it has to be removed.\nCheck thisMQOPEN options for removing messagesFollowing stackoverflow answer is also on the similar linesIBM WebSphere MQ 2042 error\n"} +{"text": "### Human: I have an MDB for consuming a message of a Queue, on Jboss EAP 7.0.6 GA, IBM MQ 9package com.ryzorbent.demo.jms;\n\n import javax.ejb.ActivationConfigProperty;\n import javax.ejb.MessageDriven;\n import javax.ejb.TransactionAttribute;\n import javax.jms.JMSException;\n\n import javax.jms.Message;\n import javax.jms.MessageListener;\n import javax.jms.TextMessage;\n\n import org.jboss.ejb3.annotation.ResourceAdapter;\n\n @MessageDriven(name=\"EFRSTestMDB\", activationConfig = {\n @ActivationConfigProperty(propertyName = \"destinationType\",propertyValue = \"javax.jms.Queue\"),\n @ActivationConfigProperty(propertyName = \"useJNDI\", propertyValue = \"false\"),\n @ActivationConfigProperty(propertyName = \"hostName\", propertyValue = \"localhost\"),\n @ActivationConfigProperty(propertyName = \"port\", propertyValue = \"1414\"),\n @ActivationConfigProperty(propertyName = \"channel\", propertyValue = \"SYSTEM.DEF.SVRCONN\"),\n @ActivationConfigProperty(propertyName = \"queueManager\", propertyValue = \"EFRS_UAT\"),\n @ActivationConfigProperty(propertyName = \"destination\", propertyValue = \"jms/queue/QUEUE\"),\n @ActivationConfigProperty(propertyName = \"transportType\", propertyValue = \"CLIENT\")\n })\n\n @ResourceAdapter(value = \"wmq.jmsra.rar\")\n //@TransactionAttribute(value = \"NoTransaction\")\n\n public class EFRSTestMDB implements MessageListener {\n\n\n @Override\n public void onMessage(Message inMessage) {\n TextMessage message = (TextMessage)inMessage;\n try {\n System.out.println(String.format(\"Hello, %s\", message.getText()));\n } catch (JMSException e) {\n e.printStackTrace();\n }\n }\n\n }I copied thewmq.jmsra.rarinto the ../standalone/deploymentsAdded the resource-adapters subsystem for the queues, channels, etc into the standalone-full.xmlBut i get the below errorjava.lang.NoClassDefFoundError: Failed to link com/ryzorbent/demo/jms/EFRSTestMDB (Module \"deployment.TestJbossMDB.jar:main\" from Service Module Loader): javax/jms/MessageListener### Assistant: Thewmq.jmsra.rardoes not contain the JMS API classes likejavax/jms/MessageListenerfrom your error. InLimitations and Known Problemsit says:The deployment of the IBM WebSphere\u00ae MQ 7.5 resource adapter does not load the javax.jms.api module for your deployment. It also does not provide support for the new Jave EE 7 annotations like @JMSConnectionFactoryDefinitions, @JMSDestinationDefinition. It is necessary to have the messaging-activemq subsystem in the configuration to enable it. If you do not want the JBoss EAP messaging server to be started, add an empty messaging-activemq subsystem.So you have to add the JMS api jars as well like described above.\n"} +{"text": "### Human: How can I export queue message in a readable format from MQJExplorer?I have a queue which has around 2000 messages and I tried to right click on the queue and using \"Backup Message to a file\" option exported it to a file, but the file has a lot of junk values along with the messages which make me difficult to read.Can anyone help me on how to export queue message in a readable format?Thanks for the help.### Assistant: Not an exact answer for you, as I'm not familiar with the MQJExplorer tool.But...IBM MQ ships with a program called 'dmpmqmsg', the purpose of this program is to allow you to move or copy messages into/out of MQ:https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.ref.adm.doc/q117660_.htmYou need to be on MQ 8.0 or later to use it, and you could use it like this:dmpmqmsg -m MYQUEUEMANAGER -i MYQUEUE -f /file/to/dump/messages/intoThis copies the contents of the messages on queue 'MYQUEUE' from queue manager 'MYQUEUEMANAGER' into a file named 'into' in the /file/to/dump/messages directory.\n"} +{"text": "### Human: I written a Java MQ client to write and read message after went to multiple sites learned a bit about MQ. When I run the client code it given error as below:MQJE001: Completion Code '2', Reason '2540'.I put a log statement in and it shows Exception in the below placeprivate void selectQMgr() throws MQException {\n logger.info(\"qMgrName in selectQMgr method: \"+ qMgrName); \n qMgr = new MQQueueManager(qMgrName, mqht);mqht is Hashtable reference which contains the Host Name,Port and channel propery which I passed from script.My system has v 7.5 MQ client and I used all the required jars for compile and run.Also I went to /opt/mqm/samp/bin and run the below command\u2022 $ amqsput TESTQ QMGR\n \u2022 Sample AMQSPUT0 start\n \u2022 MQCONN ended with reason code 2058\n \u2022 $ MQCONN ended with reason code 2058it given above error not sure whether I am trying correct or not.I am new to MQ and bit confused after I read from the IBM site mentioned as below:\n \u2022 Queue-manager groups are not supported.\n \u2022 There is no queue-manager group with the specified name.All the Required properties for MQ connection got from Support team not sure what is the issue. Is it my system not connecting or not.Please help on this. Thanks in Advance### Assistant: There are 2 types of connection models:Bindings mode - when an application connects to a queue manager in bindings mode, the application MUST be running on the same server as the queue manager. The application also does NOT specify the host, port # and channel name.Client mode - means that the application MUST specify the host, port # and channel name because the application is NOT on the same server as the queue manager.$ amqsput TESTQ QMGRIBM has a naming standard for executable files:If the executable file does NOT end with 'c' (i.e. amqsput) then it is is compiled and linked for bindings mode. i.e. local queue managerIf the executable file DOES end with 'c' (i.e. amqsputc) then it is is compiled and linked for client mode. Hence, you need to use either a CCDT file by settingMQCHLLIB & MQCHLTABenvironment variables or set theMQSERVERenvironment variable.Now on the remote server, there can be 1 or more queue managers running. Each queue manager will have its own MQ listener listening on a port. i.e. 1414. If there are 3 queue managers running on the server then the ports used could be 1414, 1415 & 1416 or 14001, 14002 & 14003. You will need to ask your MQAdmin for the correct port number for that particular queue manager.Reason Code of 2540 (MQRC_UNKNOWN_CHANNEL_NAME) means that you are using a channel name that is NOT defined on the queue manager. Note: All objects are case sensitive. i.e. \"Test.Chl\" is not the same as \"TEST.CHL\". Also, bookmark theMQ Reason Codepage because it is something you will need to reference often.Finally, since you are new to MQ, I would strongly suggest you attendMQ Technical Conference(MQTC). MQTC is the largest conference in the world solely dedicated to IBM MQ. It is 3 days of technical training at a super cheap price.\n"} +{"text": "### Human: Does anybody know how I can send SWIFT messages to MQ on a remote server?\nI need to generate Swift message and to send to MQ. Should it be in body of JMS message or there should be another structure?### Assistant: SWIFT (or for that matter any application specific) data must be part of the message body. The structure or format of the data is application specific, in your case it's SWIFT format.\n"} +{"text": "### Human: We are facing a difficult problem, I hope someone can give advice on how we can troubleshoot this.We encounter following XMSException in our logging:IBM.XMS.XMSException: CWSMQ0282E: A null value has been used for argument BUFFER = <> NULL within method ImportMQMDMesageBuffer(WmqSession, WmqDestination, MQMD,byte[],int,int). \nThe preceding method detected an invalid null argument. \nIf necessary, recode the application to avoid the error condition. \n at IBM.XMS.Client.WMQ.WmqReceiveMarshal.ImportMQMDMesageBuffer(MQMessageDescriptor mqmd, Byte[] buffer, Int32 dataStart, Int32 dataEnd) \n at IBM.XMS.Client.WMQ.WmqAsyncConsumerShadow.Consumer(Phconn hconn, MQMessageDescriptor mqmd, MQGetMessageOptions mqgmo, Byte[] pBuffer, MQCBC mqcbc) \n at IBM.WMQ.Nmqi.UnmanagedNmqiMQ.NmqiConsumerMethodUM(Int32 hconn, IntPtr structMqmd, IntPtr structMqgmo, IntPtr buffer, IntPtr structMqcbc)After this XMSException, the Windows Service crashes. The difficult part is that we can't reproduce this behavior on our dev environment. We are still troubleshooting, we couldn't find what's the root cause of this issue.Below you can find information on how we make connection:Used version: IBM.XMS 8.0.0.5A connection is created this way:XMSFactoryFactory factory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ); \nIConnectionFactory cf = factory.CreateConnectionFactory(); \ncf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT_UNMANAGED); \ncf.SetStringProperty(XMSC.WMQ_HOST_NAME, hostname); \ncf.SetStringProperty(XMSC.WMQ_PORT, port); \ncf.SetStringProperty(XMSC.WMQ_CHANNEL, channelname); \ncf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, qmname); \nIConnection connection = cf.CreateConnection();Session is created this way:ISession session = connection.CreateSession(false, AcknowledgeMode.AutoAcknowledge);Destination is created this way:destination = session.CreateQueue(\"queuename\"); \ndestination.SetIntProperty(XMSC.WMQ_MESSAGE_BODY, XMSC.WMQ_MESSAGE_BODY_MQ); \ndestination.SetBooleanProperty(XMSC.WMQ_MQMD_WRITE_ENABLED, true); \ndestination.SetBooleanProperty(XMSC.WMQ_MQMD_READ_ENABLED, true);Listener is created this way:IMessageConsumer consumer = session.CreateConsumer(destination); \nconsumer.MessageListener = listenerDelegate;The sameXMSExceptionis also askedherea few years ago. I see they have opened a PMR for this issue, but without any update...### Assistant: On March 28th 2019 IBM released an APAR that appears to be an exact match for the issue you reported.IT28062: While getting an empty message, XMS .Net applications reports CWSMQ0282E and crash.Unfortunately the APAR is not included in any current releases of MQ (As of March 29th). You will need to either wait for a release to come out which includes this APAR or get your client to open a PMR and ask them for a IFIX for this APAR against the version of MQ you are using.The APAR is targeted for the following maintenance levels, I also added the target date for each level fromIBM MQ planned maintenance release dates.Version Maintenance Level Planned Release Date\nv8.0 8.0.0.12 2Q 2019\nv9.0 LTS 9.0.0.7 2Q 2019\nv9.1 LTS 9.1.0.3 Not noted yet, 9.1.0.2 is targeted for 2Q 2019\nv9.1 CD 9.1.3 CD releases historically have been between\n 2 and 6 months apart.\n 9.1.2 was released March 21 2019.\n"} +{"text": "### Human: I have the following setup:Four MQ Queue managers in a cluster (QM1(full repo),QM2(full repo),QM3(partial repo),QM4(partial repo))All cluster sender/receiver channels have the same rank and priorityeach queue manager has a non-clustered alias queue (ALIAS.TO.CLQ)ALIAS.TO.CLQhas a base object ofALIAS.TO.FLOW, which is a clustered alias queueALIAS.TO.FLOWhas a base object ofL.TO.FLOW, which is a local queue.Each of the four queue managers are configured asCLWLUSEQ(ANY).The clustered alias queues have aDEFBINDofNOT FIXED. Messages are written by IIB (MQ Output Node), which I believe honours this - although I am seeing the same behaviour using MQ Explorer or RFHUtil also.Messages are put by the MQ Output Node without specifying a queue manager nameEach of the four cluster alias queues has a differentCLWLPRTY, but the sameCLWLRANK.The aim of this configuration is to force messages to be received by the same local queue, no matter which queue manager the message is initially put to. If that queue manager is unavailable, the second-highest priority should be used instead, etc.The issue I am finding is that, for three of the four queue managers theCLWLPRTYis being honoured and the message routed to the highest-priority queue manager. But, on the queue manager with the highest priority itself, the message is being routed to the second-highest priority; instead of using the queue on the same queue manager, which has the highest priority.If I change which queue manager has the second-highest priority, the message always gets routed there from the one with the highest priority - so it's not just coincidence. If two queue instances share the highest priority, it'll never select the one on the same queue manager as itself; it always seems to prefer to go out to the cluster.What's going on here, and how can I get it to always honour the priority no matter where the message is put? I have looked at the \"cluster workload management algorithm\" page in the IBM documentation (https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.ref.con.doc/q082390_.html) but I can't see where I'm going wrong.--Update--I have tried creating a new set of queues, in the same format, but only on one of the cluster queue managers - so,ALIAS.TEST->AL.TEST(cluster but only one instance exists) ->L.TEST. When I put toALIAS.TEST, I get an error message:An MQOPEN or MQPUT1 call was issued, specifying an alias queue as the target, but the BaseObjectName in the alias queue definition resolves to a queue that is not a local queue, or local definition of a remote queue. (AMQ4480)\n An MQOPEN or MQPUT1 call was issued, specifying an alias queue as the target, but the BaseObjectName in the alias queue definition resolves to a queue that is not a local queue, or local definition of a remote queue. (AMQ4480)Severity: 20 (Error)Response: Correct the queue definitions.But I can put to theAL.TESTqueue without any issue.--Edit--OK, the answer to why it happens appears here:https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.pro.doc/q003120_.htmlAn alias cannot directly resolve to another alias on the same queue manager.So how can I get the behaviour I'm wanting?### Assistant: Based on the following flow where each IIB instance is putting to a local queue manager:IIB1 -> QM1 -> QLOCAL(L.TO.FLOW) CLWLRANK(0) CLWLPRTY(4) CLWLUSEQ(ANY)\nIIB2 -> QM2 -> QLOCAL(L.TO.FLOW) CLWLRANK(0) CLWLPRTY(3) CLWLUSEQ(ANY)\nIIB3 -> QM3 -> QLOCAL(L.TO.FLOW) CLWLRANK(0) CLWLPRTY(2) CLWLUSEQ(ANY)\nIIB4 -> QM4 -> QLOCAL(L.TO.FLOW) CLWLRANK(0) CLWLPRTY(1) CLWLUSEQ(ANY)*Assuming theCLWLRANK,CLWLPRTY, andNETPRTYon allCLUSRCVRchannels is the same on all four queue managers.The messages PUT by any of the four IIB instances will always flow to the available queue with the highestCLWLPRTY.A queue instance can be unavailable from a cluster workload management algorithm perspective for a number of reasons. I have referenced the Knowledge center at the end of this post that provided a detailed explanation of the algorithm. Two common causes would be:The queue manager is downThe queue isPUT(DISABLED)Each IIB instance will onlyGETfrom the local queue on the same queue manager the IIB instance is connected too. In the setup depicted above this would mean under normal conditions if all four queue managers are up, only the IIB instance connected to QM1 would be receiving messages.What can make a instance of the queue not available is found in the IBM MQ v9.0 Knowledge center page \"Reference>Configuration reference>IBM MQ cluster commands>Workload balancing in clusters>The cluster workload management algorithm\", I have provided those that could apply to the setup described in your question:The algorithm steps through the following rules to eliminate\n destinations from the list of possible destinations.If a queue or topic name is specified:a. Queues that are not put enabled are eliminated as possible\n destinations.When choosing a queue, if the resulting set of queues contains the local instance of the queue, the local instance is typically used. The\n local instance of the queue is used if one of these three conditions\n are true:For locally defined queues that are defined with CLWLUSEQ(ANY), or\n which inherit that same setting from the queue manager, the following\n points are true, within the wider set of conditions that apply:a. The local queue is chosen, based on the status of the locally-defined CLUSRCVR channels in the same cluster as the queue.\n This status is compared to the status of the CLUSSDR channels that\n would take the message to remotely defined queues of the same name.For example, there is one CLUSRCVR in the same cluster as the queue. That CLUSRCVR has STOPPING status, whereas the other queues of\n the same name in the cluster have RUNNING or INACTIVE status.In this case the remote channels will be chosen, and the local queue is not used.b. The local queue is chosen based on the number of CLUSRCVR channels, in any comparison with CLUSSDR channels of the same status,\n that would take the message to remotely defined queues of the same\n name.For example, there are four CLUSRCVR channels in the same cluster as the queue, and one CLUSSDR channel. All the channels have the same\n status of either INACTIVE or RUNNING.Therefore there are five channels to choose from, and two instances of the queue. Four fifths (80 percent) of the messages go to\n the local queue.If only remote instances of a queue or topic remain, resumed queue managers are chosen in preference to suspended ones.If more than one remote instance of a queue or topic remains, all channels that are inactive or running are included. The state\n constants are listed:MQCHS_INACTIVEMQCHS_RUNNINGIf no remote instance of a queue or topic remains, all channels that are in binding, initializing, starting, or stopping state are\n included. The state constants are listed:MQCHS_BINDINGMQCHS_INITIALIZINGMQCHS_STARTINGMQCHS_STOPPINGIf no remote instance of a queue or topic remains, all channels that are being tried again are included. The state constant is listed:MQCHS_RETRYINGIf no remote instance of a queue or topic remains, all channels in requesting, paused, or stopped state are included. The state constants\n are listed:MQCHS_REQUESTINGMQCHS_PAUSEDMQCHS_STOPPED\n"} +{"text": "### Human: I am looking for a way to programmatically set client attributes inside an IBM MQ Java client application. I do realise IBM provides a way ofconfiguring MQ Clients using amqclient.inifile, however due to the nature of deployment and distribution of the application I'm working on it is not possible to use such a file. Hence, I want to set a stanza attribute that would normally be defined in the ini file, inside the connetion configuration block of my code.Furthermore, I am aware that certain properties can be set as environment variables or Java command line arguments, but that would not be a viable workaround due to the same reasons mentioned above.In particular I'm interested in the setting theKeepAliveattribute in the TCP stanza to YES.\nSo far I have attempted the following ways of achieving that using anMQQueueConnectionFactory:connectionFactory.setStringProperty(\"KeepAlive\", \"YES\");\n\nconnectionFactory.setStringProperty(\"com.ibm.mq.cfg.TCP.KeepAlive\", \"YES\");\n\nconnectionFactory.setBooleanProperty(\"KeepAlive\", true);\n\nconnectionFactory.setBooleanProperty(\"com.ibm.mq.cfg.TCP.KeepAlive\", true);However, none of those have had any effect.For the record I am using IBM MQ classes for JMS version 8.### Assistant: You can use Java system properties for this purpose.The following Java system property will be read by IBM MQ classes for JMS to tell it to use TCP KeepAlive:com.ibm.mq.cfg.TCP.KeepAlive=YESTo set this programmatically just useSystem.setPropertymethod for example:System.setProperty(\"com.ibm.mq.cfg.TCP.KeepAlive\",\"YES\");Oracle documents thesetPropertymethod in theClass System:setPropertypublic static String setProperty(String key,\n String value)Sets the system property indicated by the specified key.IBM \"loosly\" documents specifying a mqclient.ini setting as a system property in the IBM MQ v8 Knowledge center pageThe IBM MQ classes for JMS configuration file:Overriding properties specified in an IBM MQ MQI client configuration fileAn IBM MQ MQI client configuration file can also specify properties\n that are used to configure IBM MQ classes for JMS. However, properties\n specified in an IBM MQ MQI client configuration file apply only when\n an application connects to a queue manager in client mode.If required, you can override any attribute in a IBM MQ MQI client\n configuration file by specifying it as a property in a IBM MQ classes\n for JMS configuration file. To override an attribute in a IBM MQ MQI\n client configuration file, use an entry with the following format in\n the IBM MQ classes for JMS configuration file:com.ibm.mq.cfg. stanza. propName = propValueCopyThe variables in the entry have the following meanings:stanzaThe name of the stanza in the IBM MQ MQI client configuration file that contains the attributepropNameThe name of the attribute as specified in the IBM MQ MQI client configuration filepropValueThe value of the property that overrides the value of the attribute specified in the IBM MQ MQI client configuration fileAlternatively, you can override an attribute in an IBM MQ MQI client\n configuration file byspecifying the property as a system\n propertyon the java command. Use the preceding format to specify\n the property as a system property.\n"} +{"text": "### Human: I'm sending messages to ibm mq with some correlationId (unique for each message). Then I want to read from output queue this concrete message with specific correlationId, and i want it to be non-blocking to use it in java webflux controller.I'm wondering if there is a way to do it without lot of pain? Options like jmsTemplate.receiveSelected(...) is blocking, while creating a bean implementing interface MessageListener doesn't provide a way to select message by dynamic selector(i.e. correlationId is unique for each message).### Assistant: You could use springMessageListenerto retrieve all messages and connect it with controller byMono.create(...)and your own event listener which trigger result Mono// Consumes message and trigger result Mono\npublic interface MyEventListener extends Consumer {}Class to route incoming messages to correct MyEventListenerpublic class MyMessageProcessor {\n // You could use in-memory cache here if you need ttl etc.\n private static final ConcurrentHashMap REGISTRY\n = new ConcurrentHashMap<>();\n\n public void register(String correlationId, MyEventListener listener) {\n MyEventListener oldListeer = REGISTRY.putIfAbsent(correlationId, listener);\n if (oldListeer != null)\n throw new IllegalStateException(\"Correlation ID collision!\");\n }\n\n public void unregister(String correlationId) {\n REGISTRY.remove(correlationId);\n }\n\n public void accept(String correlationId, MyOutputMessage myOutputMessage) {\n Optional.ofNullable(REGISTRY.get(correlationId))\n .ifPresent(listener -> listener.accept(myOutputMessage));\n }\n}Webflux controllerprivate final MyMessageProcessor messageProcessor;\n\n.... \n\n@PostMapping(\"/process\")\nMono process(Mono inputMessage) {\n String correlationId = ...; //generate correlationId\n\n // then send message asynchronously\n\n return Mono.create(sink ->\n // create and save MyEventListener which call MonoSink.success\n messageProcessor.register(correlationId, sink::success))\n // define timeout if you don't want to wait forever\n .timeout(...)\n // cleanup MyEventListener after success, error or cancel\n .doFinally(ignored -> messageProcessor.unregister(correlationId));\n}And intoonMessageof your JMSMessageListenerimplementation you could callmessageProcessor.accept(correlationId, myOutputMessage);You could find similar example for Flux in thereactor 3 reference guide\n"} +{"text": "### Human: I am using the JMS connector in Mule for MQ operations. I am using direct JMS connection option in my codebase and noticed whenever Mule post message to MQ then that connection is not getting closed. Also noticed if i post bulk messages like 10K then connections got established more like 500 but not getting closed automatically.Below is the code snippet -\n \n \n \n \n \n \n \n \n\n\n\nCan anyone suggest how effectively we can close the connection once Mule post the message to MQ.### Assistant: You can set useCacheSessions=false to close the JMS connection after the MQ commit.\n"} +{"text": "### Human: QUESTION:What CDI annotations, tomee.xml configuration [,etc.] will allow successful deployment of this simple message driven bean?I'm attempting to deploy a MessageDriven bean usingCDIand IBM MQ - running on Tomee 7.1 Plume...After many iterations, I am still at a loss as to how to overcome the Exception below and would appreciate some help/guidance.--Are my \"ActivationConfigProperty\" values (in the \"ChatBean\" mdb example) correct, based on the tomee.xml file?Exception-\n -\n - \n 11-Oct-2018 19:20:27.427 INFO [localhost-startStop-1] org.apache.openejb.config.AutoConfig.logAutoCreateResource Auto-creating a Resource with id 'DEV.QUEUE.1' of type 'javax.jms.Queue for 'ChatBean'.\n 11-Oct-2018 19:20:27.427 INFO [localhost-startStop-1] org.apache.openejb.assembler.classic.Assembler.createRecipe Creating Resource(id=DEV.QUEUE.1)\n 11-Oct-2018 19:20:27.432 INFO [localhost-startStop-1] org.apache.openejb.config.ConfigurationFactory.configureService Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)\n 11-Oct-2018 19:20:27.432 INFO [localhost-startStop-1] org.apache.openejb.config.AutoConfig.createContainer Auto-creating a container for bean SimpleMDB.Comp263849086: Container(type=MANAGED, id=Default Managed Container)\n 11-Oct-2018 19:20:27.432 INFO [localhost-startStop-1] org.apache.openejb.assembler.classic.Assembler.createRecipe Creating Container(id=Default Managed Container)\n 11-Oct-2018 19:20:27.437 INFO [localhost-startStop-1] org.apache.openejb.core.managed.SimplePassivater.init Using directory /usr/local/tomee/temp for stateful session passivation\n 11-Oct-2018 19:20:27.445 INFO [localhost-startStop-1] org.apache.openejb.config.AutoConfig.processResourceRef Auto-linking resource-ref 'java:comp/env/imq_qcf' in bean SimpleMDB.Comp263849086 to Resource(id=imq_qcf)\n 11-Oct-2018 19:20:27.445 INFO [localhost-startStop-1] org.apache.openejb.config.AutoConfig.processResourceEnvRef Auto-linking resource-env-ref 'java:comp/env/imq.baq' in bean SimpleMDB.Comp263849086 to Resource(id=imq.baq)\n 11-Oct-2018 19:20:27.449 INFO [localhost-startStop-1] org.apache.openejb.config.AppInfoBuilder.build Enterprise application \"/usr/local/tomee/webapps/SimpleMDB\" loaded.\n 11-Oct-2018 19:20:27.449 INFO [localhost-startStop-1] org.apache.openejb.assembler.classic.Assembler.createApplication Assembling app: /usr/local/tomee/webapps/SimpleMDB\n 11-Oct-2018 19:20:27.471 INFO [localhost-startStop-1] org.apache.openejb.assembler.classic.JndiBuilder.bind Jndi(name=ChatBean) --> Ejb(deployment-id=ChatBean)\n 11-Oct-2018 19:20:27.489 INFO [localhost-startStop-1] org.apache.openejb.cdi.CdiBuilder.initSingleton Existing thread singleton service in SystemInstance(): org.apache.openejb.cdi.ThreadSingletonServiceImpl@340b9973\n 11-Oct-2018 19:20:27.554 INFO [localhost-startStop-1] org.apache.openejb.cdi.OpenEJBLifecycle.startApplication OpenWebBeans Container is starting...\n 11-Oct-2018 19:20:27.557 INFO [localhost-startStop-1] org.apache.webbeans.plugins.PluginLoader.startUp Adding OpenWebBeansPlugin : [CdiPlugin]\n 11-Oct-2018 19:20:27.699 INFO [localhost-startStop-1] org.apache.webbeans.config.BeansDeployer.validateInjectionPoints All injection points were validated successfully.\n 11-Oct-2018 19:20:27.703 INFO [localhost-startStop-1] org.apache.openejb.cdi.OpenEJBLifecycle.startApplication OpenWebBeans Container has started, it took 149 ms.\n 11-Oct-2018 19:20:27.838 INFO [localhost-startStop-1] org.apache.openejb.assembler.classic.Assembler.destroyApplication Undeploying app: /usr/local/tomee/webapps/SimpleMDB\n 11-Oct-2018 19:20:27.841 SEVERE [localhost-startStop-1] jdk.internal.reflect.NativeMethodAccessorImpl.invoke ContainerBase.removeChild: destroy: \n -\n -\n -\n 11-Oct-2018 19:20:27.926 SEVERE [localhost-startStop-1] jdk.internal.reflect.NativeMethodAccessorImpl.invoke ContainerBase.addChild: start: \n org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/SimpleMDB]]\n at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)\n at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754)\n at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)\n at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)\n at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:985)\n at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)\n at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)\n at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)\n at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)\n at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)\n at java.base/java.lang.Thread.run(Thread.java:844)\n Caused by: org.apache.tomee.catalina.TomEERuntimeException: org.apache.openejb.OpenEJBException: Creating application failed: /usr/local/tomee/webapps/SimpleMDB: Error deploying 'ChatBean'. Exception: class org.apache.openejb.OpenEJBException: com.ibm.mq.connector.DetailedResourceAdapterInternalException: MQJCA1011: Failed to allocate a JMS connection. An internal error caused an attempt to allocate a connection to fail. See the linked exception for details of the failure.: MQJCA1011: Failed to allocate a JMS connection.: com.ibm.mq.connector.DetailedResourceAdapterInternalException: MQJCA1011: Failed to allocate a JMS connection. An internal error caused an attempt to allocate a connection to fail. See the linked exception for details of the failure.: MQJCA1011: Failed to allocate a JMS connection.\n at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1315)\n at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1125)\n at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:133)\n at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)\n at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154)\n at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)\n ... 10 more\n Caused by: org.apache.openejb.OpenEJBException: Creating application failed: /usr/local/tomee/webapps/SimpleMDB: Error deploying 'ChatBean'. Exception: class org.apache.openejb.OpenEJBException: com.ibm.mq.connector.DetailedResourceAdapterInternalException: MQJCA1011: Failed to allocate a JMS connection. An internal error caused an attempt to allocate a connection to fail. See the linked exception for details of the failure.: MQJCA1011: Failed to allocate a JMS connection.: com.ibm.mq.connector.DetailedResourceAdapterInternalException: MQJCA1011: Failed to allocate a JMS connection. An internal error caused an attempt to allocate a connection to fail. See the linked exception for details of the failure.: MQJCA1011: Failed to allocate a JMS connection.\n at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:1096)\n at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:757)\n at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1303)\n ... 15 more\n Caused by: org.apache.openejb.OpenEJBException: Error deploying 'ChatBean'. Exception: class org.apache.openejb.OpenEJBException: com.ibm.mq.connector.DetailedResourceAdapterInternalException: MQJCA1011: Failed to allocate a JMS connection. An internal error caused an attempt to allocate a connection to fail. See the linked exception for details of the failure.: MQJCA1011: Failed to allocate a JMS connection.: com.ibm.mq.connector.DetailedResourceAdapterInternalException: MQJCA1011: Failed to allocate a JMS connection. An internal error caused an attempt to allocate a connection to fail. See the linked exception for details of the failure.: MQJCA1011: Failed to allocate a JMS connection.\n at org.apache.openejb.assembler.classic.Assembler.startEjbs(Assembler.java:1686)\n at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:997)\n ... 17 more\n Caused by: org.apache.openejb.OpenEJBException: com.ibm.mq.connector.DetailedResourceAdapterInternalException: MQJCA1011: Failed to allocate a JMS connection. An internal error caused an attempt to allocate a connection to fail. See the linked exception for details of the failure.: MQJCA1011: Failed to allocate a JMS connection.\n at org.apache.openejb.core.mdb.MdbContainer.deploy(MdbContainer.java:250)\n at org.apache.openejb.assembler.classic.Assembler.startEjbs(Assembler.java:1673)\n ... 18 more\n Caused by: com.ibm.mq.connector.DetailedResourceAdapterInternalException: MQJCA1011: Failed to allocate a JMS connection. An internal error caused an attempt to allocate a connection to fail. See the linked exception for details of the failure.\n at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:174)\n at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:135)\n at com.ibm.mq.connector.inbound.ConnectionHandler.allocateConnection(ConnectionHandler.java:394)\n at com.ibm.mq.connector.inbound.MessageEndpointDeployment.acquireConnection(MessageEndpointDeployment.java:289)\n at com.ibm.mq.connector.inbound.MessageEndpointDeployment.(MessageEndpointDeployment.java:229)\n at com.ibm.mq.connector.ResourceAdapterImpl.endpointActivation(ResourceAdapterImpl.java:558)\n at org.apache.openejb.core.mdb.MdbContainer$MdbActivationContext.start(MdbContainer.java:641)\n at org.apache.openejb.core.mdb.MdbContainer.deploy(MdbContainer.java:232)\n ... 19 more\n Caused by: com.ibm.msg.client.jms.DetailedJMSException: JMSFMQ6312: An exception occurred in the Java(tm) MQI.\n The Java(tm) MQI has thrown an exception describing the problem. \n See the linked exception for further information.\n at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\n at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)\n at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\n at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488)\n at com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:319)\n at com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:226)\n at com.ibm.msg.client.wmq.factories.WMQXAConnectionFactory.createV7ProviderConnection(WMQXAConnectionFactory.java:172)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:7815)\n at com.ibm.msg.client.wmq.factories.WMQXAConnectionFactory.createProviderXAConnection(WMQXAConnectionFactory.java:98)\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createXAConnectionInternal(JmsConnectionFactoryImpl.java:354)\n at com.ibm.mq.jms.MQXAConnectionFactory.createXAConnection(MQXAConnectionFactory.java:104)\n at com.ibm.mq.connector.inbound.ConnectionHandler.allocateConnection(ConnectionHandler.java:268)\n ... 24 more\n Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2195;AMQ9546: Error return code received. [1=java.lang.NoSuchMethodException[com.ibm.mq.jmqi.remote.api.RemoteFAP.(com.ibm.mq.jmqi.JmqiEnvironment, int)],3=Class.getConstructor0]\n at com.ibm.mq.jmqi.JmqiEnvironment.getInstance(JmqiEnvironment.java:831)\n at com.ibm.mq.jmqi.JmqiEnvironment.getMQI(JmqiEnvironment.java:676)\n at com.ibm.msg.client.wmq.factories.WMQXAConnectionFactory.createV7ProviderConnection(WMQXAConnectionFactory.java:164)\n ... 29 more\n Caused by: java.lang.NoSuchMethodException: com.ibm.mq.jmqi.remote.api.RemoteFAP.(com.ibm.mq.jmqi.JmqiEnvironment, int)\n at java.base/java.lang.Class.getConstructor0(Class.java:3302)\n at java.base/java.lang.Class.getConstructor(Class.java:2110)\n at com.ibm.mq.jmqi.JmqiEnvironment.getInstance(JmqiEnvironment.java:738)\n ... 31 more\n\n 11-Oct-2018 19:20:27.926 SEVERE [localhost-startStop-1] jdk.internal.reflect.NativeMethodAccessorImpl.invoke Error deploying web application archive [/usr/local/tomee/webapps/SimpleMDB.war]\n java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/SimpleMDB]]\n at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:758)\n at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)\n at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)\n at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:985)\n at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)\n at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)\n at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)\n at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)\n at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)\n at java.base/java.lang.Thread.run(Thread.java:844)\n\n 11-Oct-2018 19:20:27.927 INFO [localhost-startStop-1] jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke Deployment of web application archive [/usr/local/tomee/webapps/SimpleMDB.war] has finished in [1,926] ms\n 11-Oct-2018 19:20:27.927 INFO [localhost-startStop-1] jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke Deploying web application directory [/usr/local/tomee/webapps/ROOT]\n 11-Oct-2018 19:20:27.928 INFO [localhost-startStop-1] org.apache.tomee.catalina.TomcatWebAppBuilder.init ------------------------- localhost -> /\n -\n -\n -Note, my example (CDI annotated) MDB was derived from this link:http://tomee.apache.org/examples-trunk/simple-mdb-and-cdi/...Unfortunately (for me) I could not locate the tomee.xml or resources.xml upon which the example - \"simple-mdb-and-cdi\" - annotations are based...conf/tomee.xml\n\n \n ResourceAdapter=imq_ra\n MessageListenerInterface=javax.jms.MessageListener\n ActivationSpecClass=com.ibm.mq.connector.inbound.ActivationSpecImpl\n \n\n \n connectionConcurrency=5\n maxConnections=10\n logWriterEnabled=false\n reconnectionRetryCount=5\n reconnectionRetryInterval=300000\n traceEnabled=false\n traceLevel=3\n \n\n \n TransactionSupport=none\n ResourceAdapter=imq_ra\n HostName=172.17.0.3\n Port=1414\n QueueManager=QM1\n Channel=DEV.ADMIN.SVRCONN\n TransportType=CLIENT\n UserName=admin\n Password=passw0rd\n \n\n \n TransactionSupport=xa\n ResourceAdapter=imq_ra\n \n\n \n arbitraryProperties\n baseQueueManagerName=QM1\n baseQueueName=DEV.QUEUE.1\n CCSID=1208\n encoding=NATIVE\n expiry=APP\n failIfQuiesce=true\n persistence=APP\n priority=APP\n readAheadClosePolicy=ALL\n targetClient=JMS\n \n\n \n arbitraryProperties\n baseQueueManagerName=QM1\n baseQueueName=DEV.QUEUE.2\n CCSID=1208\n encoding=NATIVE\n expiry=APP\n failIfQuiesce=true\n persistence=APP\n priority=APP\n readAheadClosePolicy=ALL\n targetClient=JMS\n \n\n ChatBean.javapackage org.superbiz.mdb;import javax.annotation.Resource;\n import javax.ejb.ActivationConfigProperty;\n import javax.ejb.MessageDriven;\n import javax.inject.Inject;\n import javax.jms.Connection;\n import javax.jms.ConnectionFactory;\n import javax.jms.DeliveryMode;\n import javax.jms.JMSException;\n import javax.jms.Message;\n import javax.jms.MessageListener;\n import javax.jms.MessageProducer;\n import javax.jms.Queue;\n import javax.jms.Session;\n import javax.jms.TextMessage;\n\n @MessageDriven(activationConfig = {\n @ActivationConfigProperty(propertyName = \"destination\", propertyValue = \"DEV.QUEUE.1\"),\n @ActivationConfigProperty(propertyName = \"destinationType\", propertyValue = \"javax.jms.Queue\")\n })\n public class ChatBean implements MessageListener {\n\n @Resource(name = \"java:comp/env/imq_qcf\")\n private ConnectionFactory connectionFactory;\n\n @Resource(name = \"java:comp/env/imq.baq\")\n private Queue answerQueue;\n\n @Inject\n private ChatRespondCreator responder;\n\n @Override\n public void onMessage(Message message) {\n try {\n final TextMessage textMessage = (TextMessage) message;\n final String question = textMessage.getText();\n respond(\"...the question was: \" + question);\n } catch (JMSException e) {\n throw new IllegalStateException(e);\n }\n }\n\n private void respond(String text) throws JMSException {\n\n Connection connection = null;\n Session session = null;\n\n try {\n connection = connectionFactory.createConnection();\n connection.start();\n\n // Create a Session\n session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);\n\n // Create a MessageProducer from the Session to the Topic or Queue\n MessageProducer producer = session.createProducer(answerQueue);\n producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);\n\n // Create a message\n TextMessage message = session.createTextMessage(text);\n\n // Tell the producer to send the message\n producer.send(message);\n } finally {\n // Clean up\n if (session != null) {\n session.close();\n }\n if (connection != null) {\n connection.close();\n }\n }\n }\n }src/main/resources/beans.xmlIBM MQ 9.1 jars were extracted from wmq.jmsra-9.1.0.0.rar, and added to tomee/lib folder (as per: tomee.apache.org/tomee-and-webspheremq.html)bcpkix-jdk15on.jar\n bcprov-jdk15on.jar\n com.ibm.mq.connector.jar\n com.ibm.mq.headers.jar\n com.ibm.mq.jar\n com.ibm.mq.jmqi.jar\n com.ibm.mqjms.jar\n com.ibm.mq.pcf.jarpom.xml\n \n 4.0.0\n aaa.bbb.ccc\n SimpleMDB\n 1\n war\n \n UTF-8\n ${maven.build.timestamp}\n yyyyMMdd.HHmmss\n true\n \n \n \n junit\n junit\n 4.11\n test\n \n \n javax\n javaee-api\n 8.0\n provided\n \n \n commons-io\n commons-io\n 2.5\n \n \n org.glassfish.jaxb\n jaxb-runtime\n 2.3.0.1\n \n \n com.ibm.mq\n com.ibm.mq.allclient\n 9.1.0.0\n \n \n org.apache.tomee\n openejb-core\n 7.1.0\n test\n \n \n \n ${project.artifactId}\n \n \n org.apache.maven.plugins\n maven-compiler-plugin\n 3.8.0\n \n 10\n true\n /usr/local/jdkv10/bin/javac\n \n \n\n \n org.apache.maven.plugins\n maven-war-plugin\n 3.2.2\n \n false\n \n \n ${project.version}-${timestamp}\n \n \n \n \n \n \n FWIW, to provide some more context: the \"sendMessage\" and \"receiveMessage\" methods in this stateless bean (below) work fine with the tomee.xml configuration and the tomee/lib MQ jars.the issues seems to be related (indirectly?) to the CDI annotations/\"wiring\" of the message driven bean(MDB)... I though that perhaps my annotations may be improperly wired to the tomee.xml configuration(?)package org.superbiz.mdb;\n\n import javax.annotation.Resource;\n import javax.ejb.Stateless;\n import javax.jms.Connection;\n import javax.jms.ConnectionFactory;\n import javax.jms.DeliveryMode;\n import javax.jms.JMSException;\n import javax.jms.MessageConsumer;\n import javax.jms.MessageProducer;\n import javax.jms.Queue;\n import javax.jms.Session;\n import javax.jms.TextMessage;\n\n @Stateless\n public class Messages {\n\n @Resource(name = \"imq_qcf\")\n private ConnectionFactory connectionFactory; \n\n\n @Resource(name = \"imq.bar\")\n private Queue devQueue1; \n\n\n public void sendMessage(String text) throws JMSException {\n\n System.out.println(\"\\n\\n...........................Messages/sendMessage............................\\n\\n\");\n\n Connection connection = null;\n Session session = null;\n\n try {\n connection = connectionFactory.createConnection();\n connection.start();\n\n // Create a Session\n session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);\n\n // Create a MessageProducer from the Session to the Topic or Queue\n MessageProducer producer = session.createProducer(devQueue1);\n producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);\n\n // Create a message\n TextMessage message = session.createTextMessage(text);\n\n // Tell the producer to send the message\n producer.send(message);\n } finally {\n // Clean up\n if (session != null) session.close();\n if (connection != null) connection.close();\n }\n }\n\n public String receiveMessage() throws JMSException {\n\n System.out.println(\"\\n\\n...........................Messages/receiveMessage............................\\n\\n\"); \n\n Connection connection = null;\n Session session = null;\n MessageConsumer consumer = null;\n try {\n connection = connectionFactory.createConnection();\n connection.start();\n\n // Create a Session\n session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);\n\n // Create a MessageConsumer from the Session to the Topic or Queue\n consumer = session.createConsumer(devQueue1);\n\n // Wait for a message\n TextMessage message = (TextMessage) consumer.receive(1000);\n\n return message.getText();\n } finally {\n if (consumer != null) consumer.close();\n if (session != null) session.close();\n if (connection != null) connection.close();\n }\n }\n }Environment:Java 10\nIBM MQ Version 9.0\nTomee 7.1.0 Plume### Assistant: Can now deploy working MDB on apache tomee plume 7.x connecting to IBM MQ queue, etc.Love Apache Tomee, so far - but, had to research/google to piece together info from various posts and/or documentation fragments to arrive this poc/solution below... -Not clear whether this solution is recommended(or, ill-advised), but, it is what I'm looking for, in that I did NOT want to include the IBM MQ \".rar\" file in my war (or ear) file... -but, rather wanted to deploy to a \"pre-configured\" (lib, config files) tomee server, etc. (in my case, residing in a Docker container)first placed jar files from \"wmq.jmsra-9.1.0.0.rar\" into tomee/lib folder-rw-r--r--. 1 1000 1000 464030 Jul 5 21:38 com.ibm.mq.connector.jar\n-rw-r--r--. 1 1000 1000 359297 Jul 5 21:37 com.ibm.mq.headers.jar\n-rw-r--r--. 1 1000 1000 397171 Jul 5 21:37 com.ibm.mq.jar\n-rw-r--r--. 1 1000 1000 3374322 Jul 5 21:38 com.ibm.mq.jmqi.jar\n-rw-r--r--. 1 1000 1000 127566 Jul 5 21:37 com.ibm.mq.pcf.jar\n-rw-r--r--. 1 1000 1000 3999810 Jul 5 21:38 com.ibm.mqjms.jar\n-rw-r--r--. 1 1000 1000 792825 Jul 5 21:37 bcpkix-jdk15on.jar\n-rw-r--r--. 1 1000 1000 4092400 Jul 5 21:37 bcprov-jdk15on.jar\n\n(note: this seemed adequate for non-MDB, IBM MQ connectivity)created folder called \"ibm_rar\" and placed \"wmq.jmsra-9.1.0.0.rar\" file into itroot@c2865c04748a:/usr/local/tomee# ls -l\ntotal 120\n-rw-r--r--. 1 root staff 52711 Jul 10 11:41 LICENSE\n-rw-r--r--. 1 root staff 7692 Jul 10 11:22 NOTICE\n-rw-r--r--. 1 root staff 7316 Jun 20 19:51 RELEASE-NOTES\n-rw-r--r--. 1 root staff 16722 Jun 20 19:51 RUNNING.txt\ndrwxr-xr-x. 2 root staff 4096 Oct 15 17:55 bin\ndrwxr-xr-x. 4 root staff 4096 Oct 15 20:57 conf\ndrwxr-x---. 3 root root 19 Sep 20 14:33 data\ndrwxr-xr-x. 3 root root 58 Oct 15 17:55 ibm_rar <== contains \".rar\" file\ndrwxr-xr-x. 2 root staff 8192 Oct 15 17:37 lib\ndrwxr-xr-x. 2 root staff 4096 Oct 16 14:11 logs\ndrwxr-xr-x. 2 root staff 4096 Oct 16 14:11 temp\ndrwxr-xr-x. 7 root staff 4096 Oct 15 22:37 webapps\ndrwxr-xr-x. 3 root staff 21 Sep 20 14:33 work\nroot@c2865c04748a:/usr/local/tomee#contents of manually created folder - arbitrarily named: \"ibm_rar\"root@c2865c04748a:/usr/local/tomee/ibm_rar# ls -l\ntotal 12080\ndrwxr-x---. 3 root root 4096 Oct 15 17:55 wmq.jmsra-9.1.0.0\n-rw-rw-r--. 1 1000 1000 12361911 Oct 4 21:11 wmq.jmsra-9.1.0.0.rar\nroot@c2865c04748a:/usr/local/tomee/ibm_rar# \n\n(note: appears that on startup, the tomee server explodes the \".rar\" file into a corresponding folder)contents of tomee.xmlnote \"Deployments\" entry pointing to location of .rar fileroot@c2865c04748a:/usr/local/tomee/conf# cat tomee.xml\n\n \n \n \n connectionConcurrency=5\n maxConnections=10\n logWriterEnabled=false\n reconnectionRetryCount=5\n reconnectionRetryInterval=300000\n traceEnabled=false\n traceLevel=3\n \n \n TransactionSupport=none\n ResourceAdapter=wmqRA\n HostName=172.17.0.3\n Port=1414\n QueueManager=QM1\n Channel=DEV.ADMIN.SVRCONN\n TransportType=Client\n UserName=admin\n Password=passw0rd\n \n \n TransactionSupport=xa\n ResourceAdapter=wmqRA\n \n \n BrokerXmlConfig = \n ResourceAdapter=wmqRA\n MessageListenerInterface=javax.jms.MessageListener\n ActivationSpecClass=com.ibm.mq.connector.inbound.ActivationSpecImpl\n \n \n arbitraryProperties\n baseQueueManagerName=QM1\n baseQueueName=DEV.QUEUE.1\n CCSID=819\n encoding=NATIVE\n expiry=APP\n failIfQuiesce=true\n persistence=APP\n priority=APP\n readAheadClosePolicy=ALL\n targetClient=JMS\n \n \n arbitraryProperties\n baseQueueManagerName=QM1\n baseQueueName=DEV.QUEUE.2\n CCSID=819\n encoding=NATIVE\n expiry=APP\n failIfQuiesce=true\n persistence=APP\n priority=APP\n readAheadClosePolicy=ALL\n targetClient=JMS\n \nChatBean.java (MDB)package org.superbiz.mdb;\n\nimport javax.annotation.Resource;\nimport javax.ejb.ActivationConfigProperty;\nimport javax.ejb.MessageDriven;\nimport javax.jms.Connection;\nimport javax.jms.ConnectionFactory;\nimport javax.jms.DeliveryMode;\nimport javax.jms.JMSException;\nimport javax.jms.Message;\nimport javax.jms.MessageListener;\nimport javax.jms.MessageProducer;\nimport javax.jms.Queue;\nimport javax.jms.Session;\nimport javax.jms.TextMessage;\n\n@MessageDriven(activationConfig = {\n //...annotating \"ejb-jar.xml\" properties here...\n @ActivationConfigProperty(propertyName = \"destination\",propertyValue = \"DEV.QUEUE.1\"),\n @ActivationConfigProperty(propertyName = \"destinationType\",propertyValue = \"javax.jms.Queue\"),\n @ActivationConfigProperty(propertyName = \"channel\",propertyValue = \"DEV.ADMIN.SVRCONN\"),\n @ActivationConfigProperty(propertyName = \"hostName\",propertyValue = \"172.17.0.3\"),\n @ActivationConfigProperty(propertyName = \"port\",propertyValue = \"1414\"),\n @ActivationConfigProperty(propertyName = \"queueManager\",propertyValue = \"QM1\"),\n @ActivationConfigProperty(propertyName = \"transportType\",propertyValue = \"CLIENT\"),\n @ActivationConfigProperty(propertyName = \"username\",propertyValue = \"admin\"),\n @ActivationConfigProperty(propertyName = \"password\",propertyValue = \"passw0rd\")\n}\n)\npublic class ChatBean implements MessageListener {\n\n @Resource(name = \"wmqCF\") \n private ConnectionFactory connectionFactory;\n\n @Resource(name = \"devQueue2\")\n private Queue answerQueue;\n\n @Override\n public void onMessage(Message message) {\n try {\n final TextMessage textMessage = (TextMessage) message;\n final String msg = textMessage.getText();\n\n System.out.println(\"\\n\\n\\n..........ChatBean/onMessage..........incoming message: \" + String.valueOf(msg));\n\n respond(\"...the message received was: \" + String.valueOf(msg));\n\n } catch (JMSException e) {\n throw new IllegalStateException(e);\n }\n }\n\n private void respond(String text) throws JMSException {\n\n Connection connection = null;\n Session session = null;\n\n try {\n connection = connectionFactory.createConnection();\n System.out.println(\"\\n\\n\\n..........ChatBean/respond..........connection object:\" + String.valueOf(connection)); \n System.out.println(\"\\n\\n\\n..........ChatBean/respond..........responding with text:\" + String.valueOf(text)); \n connection.start();\n\n // Create a Session\n session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);\n\n // Create a MessageProducer from the Session to the Topic or Queue\n MessageProducer producer = session.createProducer(answerQueue);\n producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);\n\n // Create a message\n TextMessage textmessage = session.createTextMessage(text);\n System.out.println(\"\\n\\n\\n..........ChatBean/respond..........responding with textmessage:\" + String.valueOf(textmessage)); \n System.out.println(\"\\n\\n\\n\"); \n\n // Tell the producer to send the message\n producer.send(textmessage);\n } finally {\n // Clean up\n if (session != null) {\n session.close();\n }\n if (connection != null) {\n connection.close();\n }\n }\n }\n}pom.xml\n\n\n 4.0.0\n aaa.bbb.ccc\n SimpleMDB\n 1.11\n war\n\n \n UTF-8\n ${maven.build.timestamp}\n yyyyMMdd.HHmmss\n true\n \n\n \n\n \n junit\n junit\n 4.11\n test\n \n\n \n javax\n javaee-api\n 8.0\n provided\n \n\n \n commons-io\n commons-io\n 2.5\n \n\n \n org.glassfish.jaxb\n jaxb-runtime\n 2.3.0.1\n \n\n \n javax.xml.bind\n jaxb-api\n 2.3.0\n \n\n \n \n ${project.artifactId}\n \n \n org.apache.maven.plugins\n maven-compiler-plugin\n 3.8.0\n \n 10\n true\n /usr/local/jdkv10/bin/javac\n \n \n \n org.apache.maven.plugins\n maven-war-plugin\n 3.2.2\n \n false\n \n \n ${project.version}-${timestamp}\n \n \n \n \n\n \n \nwar file copied/deployed to tomee/webapps folderroot@c2865c04748a:/usr/local/tomee/webapps# ls -l\ntotal 1668\ndrwxr-xr-x. 3 root staff 4096 Sep 20 14:18 ROOT\ndrwxr-x---. 4 root root 53 Oct 15 22:37 SimpleMDB\n-rw-rw-r--. 1 1000 1000 1694696 Oct 15 22:36 SimpleMDB.war\ndrwxr-xr-x. 14 root staff 4096 Sep 20 14:18 docs\ndrwxr-xr-x. 5 root staff 82 Sep 20 14:18 host-manager\ndrwxr-xr-x. 5 root staff 4096 Sep 20 14:18 manager\nroot@c2865c04748a:/usr/local/tomee/webapps# \n\n(tomee server explodes into corresponding folder on startup)\n"} +{"text": "### Human: Is there any connection pool library for Websphere MQ in Java? I tried to implement connection pool for WebSphere MQ using Apache Commons Pool, but it didn't work.### Assistant: Checkouthttps://github.com/messaginghub/pooled-jms. It was forked from the mature ActiveMQ JMS Pool and enhanced to provide JMS 2.0 functionality. It is generic (i.e. no ties to ActiveMQ) so it will work with any JMS implementation.\n"} +{"text": "### Human: I am working on a spring boot JMS application which connects to IBM MQ to send and receive JMS message. I have used the following maven dependencies for the same\n com.fasterxml.jackson.core\n jackson-databind\n \n\n \n com.ibm.mq\n mq-jms-spring-boot-starter\n 0.0.3\n I deployed the wmq.jmsra.rar to the Payara 4 server, configured all the queue connection factory JNDI and Queue admin objects. After this when I deploy the war file of the application I am getting an errororg.springframework.jms.UncategorizedJmsException: Uncategorized exception occurred during JMS processing; nested exception is com.ibm.msg.client.jms.DetailedJMSException: MQJCA1011: Failed to allocate a JMS connection.\nAn internal error caused an attempt to allocate a connection to fail.\nSee the linked exception for details of the failure.\nat org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:316)With the root cause asCaused by: java.lang.NoSuchMethodException: com.ibm.mq.jmqi.remote.api.RemoteFAP.(com.ibm.mq.jmqi.JmqiEnvironment, int)\nat java.lang.Class.getConstructor0(Class.java:3082)\nat java.lang.Class.getConstructor(Class.java:1825)\nat com.ibm.mq.jmqi.JmqiEnvironment.getInstance(JmqiEnvironment.java:702)\n... 112 common frames omittedI am not sure what the issue could be. I checked many online forums however couldn't find any solution, it seems to be related to some JAR conflict but I am not sure.### Assistant: I replaced the maven dependencies to resolve the issue. There was a conflict with one of the jar files from mq-jms-spring-boot-starter dependency which was causing the problem\n com.fasterxml.jackson.core\n jackson-databind\n \n \n org.springframework\n spring-jms\n 4.3.12.RELEASE\n compile\n \n \n javax.jms\n javax.jms-api\n 2.0.1\n provided\n \n"} +{"text": "### Human: Followed this tutorialhttps://developer.ibm.com/messaging/2018/04/03/mq-jms-spring-boot/and developed a Spring Boot JMS applicatin which sends a message to IBM MQ. (used this dependency -mq-jms-spring-boot-starter).As per the tutorial, the configuration properties (Queue Manager, Channel, Port etc) can be given inapplication.yml/application.propertiesfile as below, andJmsTemplatewill automatically be configured with the properties.ibm.mq.queueManager=QM1\nibm.mq.channel=SYSTEM.DEF.SVRCONN\nibm.mq.connName=server.example.com(1414)\nibm.mq.user=user1\nibm.mq.password=passw0rdThe application works perfect and it sends message to the MQ now this way.But I want to set the properties inside the class, not from the properties file (reading from a database or something). How to set these values inside the class?### Assistant: You can use a customizer method on the CF after the initial properties have been populated.In the Application class, this code allows additional properties to be configured:@Bean\npublic MQConnectionFactoryCustomizer myCustomizer() {\n\n MQConnectionFactoryCustomizer c = new MQConnectionFactoryCustomizer() {\n @Override\n public void customize(MQConnectionFactory factory) {\n factory.setXXXX(property, value);\n }\n };\n return c;\n\n}\n"} +{"text": "### Human: How do you add theIBM MQ Correlation ID headerto a message in WSO2 Integrator?I have a scenario where I receive a message from MQ, transform the message using a few mediators and calls to backend services, and need to reply with the transformed message to another (MQ) queue using WSO2 Integrator (version 6.1.1). The client receiving the message is expecting to find the same Correlation ID in my reply as in his original message.IBM tells me the property is this one:The CorrelationId to be included in the MQMD of a message when put on\na queue.Defined in: MQMessage classData Type: String of 24 charactersSyntax: To get: correlid$ = MQMessage.CorrelationId To set: MQMessage.CorrelationId = correlid$https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q034650_.htm### Assistant: It turns out it was an easy solution. The JMS_COORELATION_ID property must be set specifically in theaxis2 scope.So while this works:Using any other scope, such as default or transport, does not:\nUnfortunately the WSO2 documentation is dreadful and does not mention that other scopes do not work. Hope this saves someone time in the future.\n"} +{"text": "### Human: I have a problem with connection in IBM MQ from javathis codeval cf: MQQueueConnectionFactory?\n var mqConnection: QueueConnection? = null\n var session: QueueSession? = null\n var sender: QueueSender? = null\n var value = \"\"\n try {\n cf = MQQueueConnectionFactory()\n cf.hostName = host\n cf.port = port\n cf.queueManager = queueManager\n cf.transportType = transport\n cf.channel = channelName\n cf.clientReconnectOptions = WMQConstants.WMQ_CLIENT_RECONNECT_Q_MGR\n cf.clientReconnectTimeout = 3600\n\n mqConnection = cf.createQueueConnection()drops exception \"JMSCMQ0001: WebSphere MQ call failed with compcode\n '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED')\"when I try create connectioncf.createQueueConnection()I don't understand what is a problem.I use ibmmq lib9.0.2.0version, but this code doesn't work with 7.5.0.1 version too### Assistant: MQRC 2035 means the user doesn't have the appropriate authorities to connect to the queue manager. The reason can be found in theAMQERR*.login the queue managererrorsdirectory.CHLAUTHis enabled by default. You need to addCHLAUTHrules. Following link provides details on create/modifyCHLAUTHIBM MQ 7.5.0 > WebSphere MQ > Reference > Administration reference > MQSC reference > The MQSC commands >SET CHLAUTHIf you want more details on CHLAUTH then go through the following link:CHLAUTH Made Simple: Common Scenarios and Examples and How to Verify them with RUNCHECK\n"} +{"text": "### Human: I am trying to get queue depth for remote IBM MQ using PowerShell script/commands. Seems it is not working correctly, please help.Powershell script:{\n$myremoteconns = New-WMQQmgrConnDef -Name T.test.TEST.QM1 -Hostname abcd_testhost01 -Port 1111 -Channel T.test.MQMQ.TESTCHN\n\n$qm = Get-WMQQueueManager -Connections $myremoteconns | where {$_.Name -like 'T.test.TEST.QM1'}Error message received:Error CategoryInfo : InvalidData: (:) [Get-WMQQueueManager], arameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationError,WebSphereMQ.GetWMQQueueManagerAlready installed WebSphere MQ - Windows PowerShell Library from below.http://www-01.ibm.com/support/docview.wss?uid=swg24017698Thanks### Assistant: To get remote queue manager information,you have to follow the following steps as stated in the powershellcookbook.pdf which comes along with MO74.PS C:\\> $qmconns = @()\nPS C:\\> $qmconns += New-WMQQmgrConnDef -Name DALEQM -Hostname dlane.hursley.ini.com -Channel SVRCN -Port 1414\nPS C:\\> $qmconns += New-WMQQmgrConnDef -Name CENTQM -Hostname sysserv.boulder.ini.com -Channel SVRCN -Port 1418\nPS C:\\>\nPS C:\\> $qmgrs = Get-WMQQueueManager \u2013Connections $qmconns\nPS C:\\> $remoteqmgrs = Get-WMQQueueManager \u2013Connections $qmconns | Where { $_.Hostname \u2013like \u201c*.hursley.ini.com\u201d }In your first command \"+\" is missing.\n"} +{"text": "### Human: We have an application that uses WebSphere MQ 7.0.1.3. During extensive testing in our stage environment, the disks became full.After this, the MQ is hanging. We removed the application logs (not related to MQ) and added more disk but it didn't solve the problem.We tried to restart the queue manager:$ endmqlsr\n$ endmqm XYZ\n$ strmqm XYZ\nWebSphere MQ queue manager 'XYZ' starting.\nWebSphere MQ was unable to display an error message 893.The logs from the time when the disk became full and the error occurred:----- amqxfdcx.c : 828 --------------------------------------------------------\n06/08/2018 03:36:44 AM - Process(8832.5) User(mqm) Program(amqzlaa0)\nAMQ6119: An internal WebSphere MQ error has occurred (Rc=28 from write)\n----- amqxfdcx.c : 783 --------------------------------------------------------\n06/08/2018 03:36:44 AM - Process(8832.5) User(mqm) Program(amqzlaa0)\nAMQ6184: An internal WebSphere MQ error has occurred on queue manager XYZ.\n----- amqxfdcx.c : 822 --------------------------------------------------------\n06/08/2018 03:36:46 AM - Process(8832.5) User(mqm) Program(amqzlaa0)\nAMQ6119: An internal WebSphere MQ error has occurred (Rc=28 from write)\n----- amqxfdcx.c : 783 --------------------------------------------------------\n06/08/2018 03:36:46 AM - Process(8832.5) User(mqm) Program(amqzlaa0)\nAMQ6184: An internal WebSphere MQ error has occurred on queue manager XYZ.\nAMQ6119: An internal WebSphere MQ error has occurred ('28 - No space left on device' from semget.)\n----- amqxfdcx.c : 783 --------------------------------------------------------\n06/14/2018 02:35:46 PM - Process(6794.1) User(mqm) Program(amqzxma0)\nAMQ6184: An internal WebSphere MQ error has occurred on queue manager XYZ.\n----- amqxfdcx.c : 822 --------------------------------------------------------\n06/14/2018 02:35:46 PM - Process(6794.1) User(mqm) Program(amqzxma0)\nAMQ6118: An internal WebSphere MQ error has occurred (20006037)When trying to connect with the IBM WebSphere MQ ExplorerQueue manager not available for connection - reason 2059. (AMQ4043)\nSeverity: 20 (Error)\nExplanation: The attempt to connect to the queue manager failed. This could be because the queue manager is incorrectly configured to allow a connection from this system, or the connection has been broken.\nResponse: Ensure that the queue manager is running. If the queue manager is running on another computer, ensure it is configured to accept remote connections.Is there a way of clearing all messages from the queues and resetting all flags so the queue manager will start and the queues will work again?There are only old test data in the queues, nothing of value.Or do you have any other suggestions on how to fix this?### Assistant: You can use themqrccommand to provide more information on errors. Most of the time MQ reports return codes as a four digit decimal number. In this case since the return code is three digits it usually (always?) means it is a HEX return code.$ mqrc 2195\n\n 2195 0x00000893 MQRC_UNEXPECTED_ERRORThis error is thrown when MQ hits an error condition that was not expected. Usually you will find a FDC file was created in the/var/mqm/errorsdirectory that could provide some more detail.The best course of action when you receive this type of error is to open a PMR with IBM and have them provide direction on recovery to ensure you have the best chance of preserving messages that may be present on your queues, however you are using a version of MQ (7.0) that has been out of support since September 30th 2015. The specific Fix Pack you are on (7.0.1.3) was released in August 2010. The last release of v7.0 from IBM was 7.0.1.14 in August 2016.If you pay IBM for extended support you may be able to open a PMR with them for futher support.The best path forward once you have resolved your issue would be to migrate to a supported version of IBM MQ. Currently v8.0 and v9.0 are the only supported versions of IBM MQ at this time.Assuming you do not have extended support and are unable to get assistance from IBM, the following are some suggested steps:Updating even to the latest Fix Pack (7.0.1.14) may help, and if it does not solve the problem it is still better by be at the latest Fix Pack of a unsupported version of IBM MQ.You could try to cold start your queue manager and see if that helps. This is documented starting on Page 4 of the presentation\"WebSphere MQ Disaster Recovery\" given by Mark Taylor at Capitalware's MQ Technical Conference v2.0.1.3.Create a queue manager EXACTLY like the one that failedUse qm.ini to work out parameters to crtmqm commandLog:\n LogPrimaryFiles=10\n LogSecondaryFiles=10\n LogFilePages=65535\n LogType=CIRCULARIssue the crtmqm commandcrtmqm -lc -lf 65535 -lp 10 -ls 10 \u2013ld /tmp/mqlogs TEMP.QMGRMake sure there is enough space for the new log files in that directoryName of the dummy queue manager is irrelevantOnly care about getting the log filesDon\u2019t start this dummy queue manager, just create itReplace old logs and amqhlctl.lfh with the new onescd /var/mqm/log\nmv QM1 QM1.SAVE\nmv /tmp/mqlogs/TEMP!QMGR QM1Note the \u201cmangled\u201d directory name \u2026 this is normalData in the queues is preserved if messages are persistentObject definitions are also preservedObjects contain their own definitions in their filesMapping between files and object names held inQMQMOBJCATOnce all the above is complete then try and start your queue manager.\n"} +{"text": "### Human: we plan to run IBM MQ 9.0.5 inside a Linux Docker container and I'm not sure how theIBM guidelines for Linux tuninghave to be applied in this case.\nThose tuning steps include modification of several System V IPC kernel parameters (e.g. increasing the max. number of threads), increasing maximum number of file handles, processes etc.\nDo those steps have to be applied to both the Docker host operating system and inside the container?The IBM documentation for setting up MQ on Docker doesn't mention OS tuning at all, so I hope someone in here could help me?Thanks in advanceDavid### Assistant: This is the (inofficial) response I got from an IBM Architect:I'm afraid I don't currently have a detailed list, but hopefully I can\n point you in the right direction.Most of the settings apply to the kernel, and pass through to the\n container automatically. Some of the settings are user-specific limits\n (ulimits), which you can set in Docker using the \"--ulimit\" parameter\n (see the Docker documentation).The networking settings can vary, based on your specific networking\n environment (for example, if you're running on an overlay network).\n"} +{"text": "### Human: I have a application that will be processing hundreds of thousands (500,000+) of JMS requests per day. The application is responsible for routing the message to a new destination based on the information received in the request.When processing the request, I also need the ability to modify some of the JMS attributes. For example, I need to set the persistence, time to live and priority of the messages. So, my listener picks up the messages, interrogates the request message, determines the destination, and then sets those properties on the JMS template.My question is in regards to concurrency and the setting of these properties. Let's say I am processing 2 concurrent requests. Request A set the persistence to be persistent and request B sets the persistence to non-persistence. Is there any danger her that request A would be set to non-persistent? Can the setting of these properties at the template level cause issues?Here is some sample code that is setting these properties:jmsTemplate.setExplicitQosEnabled(true);\n jmsTemplate.setDeliveryPersistent(isPersistent);\n jmsTemplate.setTimeToLive(timeToLive);\n jmsTemplate.setPriority(priority);\n\n jmsTemplate.send(createQueue(encoding));Thanks in advance for you help!### Assistant: Yes; it will cause issues; Spring Integration uses aDynamicJmsTemplatefor this exact reason (storing properties inThreadLocals).It doesn't support all the properties you need but you could use it as a model.Here's the codeandhere is how it is used.\n"} +{"text": "### Human: My application only reads messages from the IBM MQ. I am trying to understand, if one of the end is only reading messages from queue, do both sending and receiving ends need to setup JMS provider(IBM MQ)/Connection factories, Queue destination?What is the difference between JMS provide and Queue manager? Who needs to install JMS provider and Queue manager?### Assistant: You can think of the queue manager as the server where queues and other MQ objects live. Your application is the client that connects to the server and interacts with the objects there.IBM MQ server/queue manager IS your JMS provider. Your client application needs the IBM MQ implemented JMS libraries (IBM MQ Classes for JMS) and the JMS api which you can then use in your application to add parameters to your connection factory to connect to the queue manager. \nYou can see a basic tutorial for a JMS MQ client applicationhere.Depending on who is in charge of your queue manager and how they have set things up, you should probably not be hard coding the queue manager and queue details in your client application. You should be getting the connection details from the JNDI store if you have an administrator who has set one up for you. See more at the bottom of the JMS tutorial I linked to, for how JMS works.\n"} +{"text": "### Human: I'm using theMQCBfunction to add message consumer callback functions for queues that I'm reading from. I'm trying to read from two queues on the same connection, and it seems to work fine when receiving messages: my callback function gets the object handle for the queue that the message was received from.However, when I get anMQRC_NO_MSG_AVAILABLEevent (since I setMQGMO_WAITon my consumer), the object handle isMQHO_NONE, so I can't tell which queue the event refers to. I could solve that by putting the object handle in the callback context, but is that the way it's supposed to be done? Or am I missing something obvious here?I'm connecting to a queue manager running version 8.0.0.2 on Linux, using the C client library version 8.0.0.5, likewise on Linux. Here is the output from my sample program, showing object handles being 0:Opened queue 'AMQ.5A55ED982D616602 ' with handle 101\nOpened queue 'AMQ.5A55ED982D616603 ' with handle 102\nCompletion code MQCC_FAILED, reason MQRC_NO_MSG_AVAILABLE, object handle 0\nCompletion code MQCC_FAILED, reason MQRC_NO_MSG_AVAILABLE, object handle 0And the program itself:#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid my_message_consumer(MQHCONN, PMQMD, PMQGMO, PMQVOID, PMQCBC);\n\nvolatile unsigned events_received = 0;\n\nvoid\ncheck_fail(const char *action, MQLONG comp_code, MQLONG reason)\n{\n if (comp_code != MQCC_OK) {\n fprintf(stderr, \"%s failed with %s %s\\n\",\n action, MQCC_STR(comp_code), MQRC_STR(reason));\n exit(1);\n }\n}\n\nint\nmain()\n{\n MQHCONN hconn;\n MQHOBJ hobj1, hobj2;\n MQOD od = {MQOD_DEFAULT};\n char queue_name[MQ_Q_NAME_LENGTH + 1];\n MQLONG c, r;\n\n MQCONN(\"\", &hconn, &c, &r);\n check_fail(\"MQCONN\", c, r);\n\n /* Open two dynamic queues */\n strcpy(od.ObjectName, \"SYSTEM.DEFAULT.MODEL.QUEUE\");\n MQOPEN(hconn, &od, MQOO_INPUT_EXCLUSIVE, &hobj1, &c, &r);\n check_fail(\"MQOPEN\", c, r);\n\n strncpy(queue_name, od.ObjectName, MQ_Q_NAME_LENGTH);\n queue_name[MQ_Q_NAME_LENGTH] = '\\0';\n printf(\"Opened queue '%48s' with handle %d\\n\", queue_name, hobj1);\n\n strcpy(od.ObjectName, \"SYSTEM.DEFAULT.MODEL.QUEUE\");\n MQOPEN(hconn, &od, MQOO_INPUT_EXCLUSIVE, &hobj2, &c, &r);\n check_fail(\"MQOPEN\", c, r);\n\n strncpy(queue_name, od.ObjectName, MQ_Q_NAME_LENGTH);\n queue_name[MQ_Q_NAME_LENGTH] = '\\0';\n printf(\"Opened queue '%48s' with handle %d\\n\", queue_name, hobj2);\n\n /* Add a callback with zero WaitInterval for both queues */\n MQMD md = {MQMD_DEFAULT};\n MQGMO gmo = {MQGMO_DEFAULT};\n MQCBD cbd = {MQCBD_DEFAULT};\n gmo.Options = MQGMO_NO_SYNCPOINT | MQGMO_WAIT;\n gmo.WaitInterval = 0;\n cbd.CallbackType = MQCBT_MESSAGE_CONSUMER;\n cbd.CallbackFunction = &my_message_consumer;\n\n MQCB(hconn, MQOP_REGISTER, &cbd, hobj1, &md, &gmo, &c, &r);\n check_fail(\"MQCB\", c, r);\n MQCB(hconn, MQOP_REGISTER, &cbd, hobj2, &md, &gmo, &c, &r);\n check_fail(\"MQCB\", c, r);\n\n /* Start consuming */\n MQCTLO ctlo = {MQCTLO_DEFAULT};\n MQCTL(hconn, MQOP_START, &ctlo, &c, &r);\n check_fail(\"MQCTL start\", c, r);\n\n /* Wait until events received */\n while (events_received < 2)\n sleep(1);\n\n return 0;\n}\n\nvoid\nmy_message_consumer(MQHCONN hconn, PMQMD md, PMQGMO gmo,\n PMQVOID buffer, PMQCBC context)\n{\n printf(\"Completion code %s, reason %s, object handle %d\\n\",\n MQCC_STR(context->CompCode), MQRC_STR(context->Reason),\n context->Hobj);\n events_received++;\n}Compile it with:gcc -o mq-no-msg mq-no-msg.c -g -Wall -I/opt/mqm/inc -L/opt/mqm/lib64 -lmqic_r -Wl,-rpath=/opt/mqm/lib64and set theMQSERVERenvironment variable before running.### Assistant: I found information from a few sources on this topic that when put together paint the whole picture (unfortunately IBM's MQ KC does not document this very well to say the least).At Capitalware's MQ Technical Conference v2.0.1.3 Morag Hughson gave a presentationWebSphere MQ V7 Enhanced Application Programmingwhich has some useful information.On page six it states:Your message consumer can also be called with CallType set to MQCBCT_EVENT_CALL (this is also the only way an Event handler can be\n called). The message consumer will be given events that are pertinent\n to the queue it is consuming from, for example, MQRC_GET_INHIBITED\n whereas the event handler gets connection wide events.In the IBM MQ v8 KC pageMQCBC - Callback context > Fields for MQCBC > Hobj (MQHOBJ)it states:For an event handler, this value is MQHO_NONEThe IBM provided sampleamqscbf0.calso demonstrates checking thepContext->CallTypein theMessageConsumer, if it is typeMQCBCT_EVENT_CALLit prints the Reason, if it is typeMQCBCT_MSG_REMOVEDit prints the message.Based on the above information it appears the behavior you see is the expected behavior.A suggested work around would be to set theCallbackAreafield of each queue'sMQCBDwith a unique value that you can use to determine the which queue the event refers to.On page four of Morag's presentation \"WebSphere MQ V7 Enhanced Application Programming\" it states the following:MQGMO_WAIT with MQGMO.WaitInterval = 0 operates just like\n MQGMO_NO_WAIT when one uses on an MQGET, but in the case of\n asynchronous consumers we wish to avoid the consumer from polling in a\n busy loop in this case, so it operates more like a backstop marker to\n show when the end of a batch of messages has been reached.In the table on the same page it under the Asynchronous Consume column forMQGMO_WAIT with MQGMO.WaitInterval = 0it states:Only called with MQRC_NO_MSGS_AVAILABLE if just started or has had a\n message since last 2033Your consumer will not continuously get events notifying it that no messages are on the queue. An event is only generated if there are no messages when the call back is first started and/or after each time ALL messages have been read (GET) from the queue. Essentially it lets you know that currently no more messages are available after it had read at least one message. This may be useful if you expect batches of messages and want to perform some action after all messages in a batch have been read off the queue.Note that MQGMO_NO_WAIT, and MQGMO_WAIT with a WaitInterval of\n MQWI_UNLIMITED are quite different when passed to MQGET but with the\n MQCB call their behaviour is the same. The consumer will only be\n passed messages and events, it will never be passed the reason code\n indicating no messages. Effectively MQGMO_NO_WAIT will be treated as\n an indefinite wait. This is to prevent the consumer from endlessly\n being called with the no messages reason code.If you really do not need theMQRC_NO_MSG_AVAILABLEevent messages, thenMQGMO_NO_WAITis probably the way to go.\n"} +{"text": "### Human: I have both Visual Studio 2017 Community and TDM-GCC both installed on my Windows 10 box. Everything is 64-bit. I've been trying to pip install pymqi, but so far I haven't had much luck.Without going into too many irrelevant details, I'm trying to get it to use TDM-GCC instead of msvc to build the C components of this package. However, it keeps using msvc even though I don't have it set up in the command line environment I'm pip installing from (i.e. I didn't run the vcvars64.bat file). I do, however, have TDM-GCC in the PATH.How does pip find the compiler? Is there some command line option I can specify to force pip to use a specific compiler?### Assistant: You will need toconfigure it:\nCreatedistutils.cfgfile inPYTHONPATH\\Lib\\distutilswith this configuration:[build]\ncompiler=mingw32You can see famous issue#18for more info\n"} +{"text": "### Human: i want to know port number of Queue\u200b manager on my server.how to find it?\nWhat is the command to find it in message queueing### Assistant: If the two listed possible duplicate answers don't address your question, I assume that you do already have a listener running on your queue manager (i.e. someone else set it up) and you just need to know what port they used.Easiest way to find that is to use the following MQSC command:-DISPLAY LSSTATUS(*) ALLThis will show you all the running listeners (yes a queue manager can have more than one listening port) and will also show you the port number it is listening on. If you alternatively use the following MQSC command:-DISPLAY LISTENER(*) ALLyou may not find the actual port in use, because any definition with PORT(0) will use the default port number from the qm.ini file which is normally 1414 but might be another number. The first command always shows the actual port in use and thus is recommended for finding the port number for the queue manager.To do the same thing using MQ Explorer, from the right mouse-click context menu on the Listener object folder, select Status...This will bring up a window showing all the running listeners, (the equivalent of the MQSC commandDISPLAY LSSTTATUS). You can see the port number in the second column.\n"} +{"text": "### Human: I want to get the Queue details created for 7.0.1.6.\nI am running \u201cdmpmqcfg\u201d command\nBut the command is not found in my bin directory in IBM MQ 7.0.1.6.### Assistant: dmpmqcfg was added in V7.1 (previously, people used the MS03 saveqmgr SupportPac).The MS03 SupportPac can be downloaded from the following page:WITHDRAWN: MS03: WebSphere MQ - Save Queue Manager object definitions using PCFs (saveqmgr)The page also confirms the dmpmqcfg was added in v7.1Note: From MQ V7.1 onwards, the command dmpmqcfg is available in the\n product. This is recommended instead of the use of MS03.\n"} +{"text": "### Human: I am using MQ PCF to list authority records associated with a queue manager. Here is code.PCFMessageAgent agent = new PCFMessageAgent(queueManager);\n agent.setCheckResponses(false);\n PCFMessage[] responses;\n PCFMessage request = new PCFMessage(MQConstants.MQCMD_INQUIRE_AUTH_RECS);\n request.addParameter(MQConstants.MQIACF_AUTH_OPTIONS,\n MQConstants.MQAUTHOPT_NAME_ALL_MATCHING + MQConstants.MQAUTHOPT_ENTITY_EXPLICIT + MQConstants.MQAUTHOPT_NAME_AS_WILDCARD);\n\n request.addParameter(MQConstants.MQCACF_AUTH_PROFILE_NAME, \"*\");\n request.addParameter(MQConstants.MQIACF_OBJECT_TYPE, MQConstants.MQOT_ALL);\n responses = agent.send(request);This returns a huge number of authority records, most of these are standard/system records that MQ creates by default.How do I change the above code (filter out default records) so that only the application specific authority records are returned?### Assistant: request.addParameter(MQConstants.MQCACF_AUTH_PROFILE_NAME, \"*\");You used a wildcard, so the queue manager will give you everything. Use \"ABC*\" to get ABC* only related authority records.\n"} +{"text": "### Human: Hi I want to use XMS library without installing mq client to my local machine,but I got these error.When i check ibm feature set they said we fix it but how?I also tried 8.0.0.7 version but error is same.http://www-01.ibm.com/support/docview.wss?uid=swg1IC89514var factoryfactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\n var connectionfactory = factoryfactory.CreateConnectionFactory();\n\n connectionfactory.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, QueueManagerName);\n connectionfactory.SetStringProperty(XMSC.WMQ_HOST_NAME, HostName);\n connectionfactory.SetIntProperty(XMSC.WMQ_PORT, Port);\n connectionfactory.SetStringProperty(XMSC.WMQ_CHANNEL, channelName);\n connectionfactory.SetIntProperty(XMSC.WMQ_BROKER_VERSION, XMSC.WMQ_BROKER_V2);\n connectionfactory.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT_UNMANAGED);\n\n Console.WriteLine(\"Creating connection\");\n var connection = connectionfactory.CreateConnection();System.TypeLoadException: Could not load type 'IBM.WMQ.ManagedCommonServices' from assembly 'IBM.XMS.Client.WMQ, Version=8.0.0.6, Culture=neutral, PublicKeyToken=d2666ab12fca862b'.\n at System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type)### Assistant: You can try by adding the following in the app.config file \u2013 subbaraoc Oct 3 at 16:35Use amqmdnet.dll (IBM.WMQ.ManagedCommonServices) for common default\nuse IBM.XMS.Client.WMQ.dll (IBM.XMS.Client.WMQ.XmsManagedCommonServices) for XMS.This will force the client library to directly load the common service class. This class has to be present in one of the search locations. E.g.: current working directory, GAC, ...\n"} +{"text": "### Human: I am using camel to send message to an IBM MQQueue. \nThe MDB listening to this queue expects messages of the type com.ibm.jms.JMSMapMessage.When I use camel producerTemplate, an exception is thrown.\nI am doing this\nproducerTemplate.sendBody(\"wmq:queue\",hashMap);Exception data: java.lang.ClassCastException: com.ibm.jms.JMSMapMessage incompatible with javax.jms.ObjectMessageSo I tried Spring jmsTemplate, and it worked.jmsTemplate.send(new MessageCreator() {\n @Override\n public Message createMessage(Session session)\n throws JMSException {\n return session.createObjectMessage((Serializable) sctHmap);\n }\n });Question:\nThe jms component documentation saysIt uses Spring's JMS support for declarative transactions, including\n Spring's JmsTemplate for sending and a MessageListenerContainer for\n consuming.I tried with disabling camels auto conversion using mapJmsMessage=false.\nI realised it would not help as it would have sent a hash map, I still got the same exception. Is there any way I can get the producerTemplate to work in the same way as JMSTemplate? ProducerTemplate seems to be more elegant, atleast in terms of my unit tests### Assistant: It seems I misinterpreted the classcast exception message. Camel was correctly sending, com.ibm.jms.JMSMapMessage, the MDB at the consumer application was expecting javax.jms.ObjectMessage.\nI resolved it by settingjmsMessageType=objectin the endpoint URI. :)\n"} +{"text": "### Human: I have an application that is required to put a very simple message to a remote Queue.\nThe Queue used is provided by a 3rd party and its an IBM WebSphere MQ (Version 7.5).I tried to useamqmdnet.dllwith the example code below but I understood there should be an MQ Client installed on my server to do this.So my question:Is there any way to put a message in a queue without all these requirements? like a simple REST or SOAP client ?I am open to use different languages to implement such a component i just don't want to install a 3rd party application on the server (its a hosting environment)// ===========================================================================\n// Licensed Materials - Property of IBM\n// 5724-H72\n// (c) Copyright IBM Corp. 2003, 2005\n// ===========================================================================\nusing System;\nusing System.Collections;\n\nusing IBM.WMQ;\n\nclass MQSample\n{\n // The type of connection to use, this can be:-\n // MQC.TRANSPORT_MQSERIES_BINDINGS for a server connection.\n // MQC.TRANSPORT_MQSERIES_CLIENT for a non-XA client connection\n // MQC.TRANSPORT_MQSERIES_XACLIENT for an XA client connection\n // MQC.TRANSPORT_MQSERIES_MANAGED for a managed client connection\n const String connectionType = MQC.TRANSPORT_MQSERIES_CLIENT;\n\n // Define the name of the queue manager to use (applies to all connections)\n const String qManager = \"your_Q_manager\";\n\n // Define the name of your host connection (applies to client connections only)\n const String hostName = \"your_hostname\";\n\n // Define the name of the channel to use (applies to client connections only)\n const String channel = \"your_channelname\";\n\n\n\n /// \n /// Initialise the connection properties for the connection type requested\n /// \n /// One of the MQC.TRANSPORT_MQSERIES_ values\n static Hashtable init(String connectionType)\n {\n Hashtable connectionProperties = new Hashtable();\n\n // Add the connection type\n connectionProperties.Add(MQC.TRANSPORT_PROPERTY, connectionType);\n\n // Set up the rest of the connection properties, based on the\n // connection type requested\n switch(connectionType)\n {\n case MQC.TRANSPORT_MQSERIES_BINDINGS:\n break;\n case MQC.TRANSPORT_MQSERIES_CLIENT:\n case MQC.TRANSPORT_MQSERIES_XACLIENT:\n case MQC.TRANSPORT_MQSERIES_MANAGED:\n connectionProperties.Add(MQC.HOST_NAME_PROPERTY, hostName);\n connectionProperties.Add(MQC.CHANNEL_PROPERTY, channel);\n break;\n }\n\n return connectionProperties;\n }\n /// \n /// The main entry point for the application.\n /// \n [STAThread]\n static int Main(string[] args)\n {\n try\n {\n Hashtable connectionProperties = init(connectionType);\n\n // Create a connection to the queue manager using the connection\n // properties just defined\n MQQueueManager qMgr = new MQQueueManager(qManager, connectionProperties);\n\n // Set up the options on the queue we want to open\n int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT;\n\n // Now specify the queue that we want to open,and the open options\n MQQueue system_default_local_queue =\n qMgr.AccessQueue(\"SYSTEM.DEFAULT.LOCAL.QUEUE\", openOptions);\n\n // Define a WebSphere MQ message, writing some text in UTF format\n MQMessage hello_world = new MQMessage();\n hello_world.WriteUTF(\"Hello World!\");\n\n // Specify the message options\n MQPutMessageOptions pmo = new MQPutMessageOptions(); // accept the defaults,\n // same as MQPMO_DEFAULT\n\n // Put the message on the queue\n system_default_local_queue.Put(hello_world, pmo);\n\n\n\n // Get the message back again\n\n // First define a WebSphere MQ message buffer to receive the message\n MQMessage retrievedMessage =new MQMessage();\n retrievedMessage.MessageId =hello_world.MessageId;\n\n // Set the get message options\n MQGetMessageOptions gmo =new MQGetMessageOptions(); //accept the defaults\n //same as MQGMO_DEFAULT\n\n // Get the message off the queue\n system_default_local_queue.Get(retrievedMessage,gmo);\n\n // Prove we have the message by displaying the UTF message text\n String msgText = retrievedMessage.ReadUTF();\n Console.WriteLine(\"The message is: {0}\", msgText);\n\n // Close the queue\n system_default_local_queue.Close();\n\n // Disconnect from the queue manager\n qMgr.Disconnect();\n }\n\n //If an error has occurred in the above,try to identify what went wrong.\n\n //Was it a WebSphere MQ error?\n catch (MQException ex)\n {\n Console.WriteLine(\"A WebSphere MQ error occurred: {0}\", ex.ToString());\n }\n\n catch (System.Exception ex)\n {\n Console.WriteLine(\"A System error occurred: {0}\", ex.ToString());\n }\n\n return 0;\n }//end of start\n}//end of sample### Assistant: Instead of pickingMQC.TRANSPORT_MQSERIES_CLIENTwhich would cause theamqmdnet.dllto function in unmanaged mode and rely on other non-.NET dlls, you can selectMQC.TRANSPORT_MQSERIES_MANAGEDto cause it to function in managed mode which means it does not require any other dlls to function.At MQ v7.5 even in managed mode you can not use theamqmdnet.dllby itself, at that version IBM did not support this configuration. At IBM MQ v8 and later IBM does support using theamqmdnet.dllby itself. You can download the the MQ v8 or MQ v9 redistributable client from one of the links below. Just find theamqmdnet.dllfrom the zip file and use it.MQ is fully backward compatible, it should not be an issue for you to connect to a MQ 7.5 queue manager from a higher version client. Also note that MQ v7.5 goes out of support on April 30th 2018, to keep support from IBM the 3rd party will need to either upgrade or pay extra money for extended support.IBM MQ v8.0 ClientIBM MQ v9.0 Client\n"} +{"text": "### Human: How can I use WebSphere Message broker instance to route messages between queues residing in two queue managers. The message broker instance can only be associated with one queue manager during creation time. So I create an MQInputNode and put messages to the specific source queue. My concern is to route this message to second queue residing in another queue manager using the same broker instance. How? I am using WebSphere Message Broker version 8.0.0.8. Not yet into IIB.### Assistant: Below is a simple and efficient way of doing it.Suppose, your broker is on QM1. You have a local queue in QM2 named LQ_QM2.\nAnd you want the messages to go to LQ_QM2. Follow below steps:At QM1, create a local queue of usage 'Transmission'. Let us name this transmission queue as \"QM2\".At QM1, create a sender channel named \"QM1.QM2\" with proper connection name (Contains host(port) of target queue manager, for eg\n 10.1.5.2(1144)) and set transmission queue as QM2 (The one we created in step 1).Create a receiver channel at QM2 named \"QM1.QM2).Now create a remote queue definition at QM1. Let's name it as RQ_LQ_QM2. Set remote queue property as LQ_QM2 and transmission queue\n as QM2 and remote queue manager as QM2.The messages which you want to send to the queue LQ_QM2 can now be written by the broker to RQ_LQ_QM2 in QM1 itself.If you can't do the above MQ stuff and must use only Message broker capability then the way of doing it in WMB 8 would be to use Java and write an MQ client code using the MQ API libraries. You will then establish remote connection with the remote queue manager using SVRCONN channel and put messages on the remote queue manager's queue.\n"} +{"text": "### Human: I've got an web application (WebApi2 / c#) installed under an IIS Web Site that needs to use an IBM WebSphere MQmqclient.inifile.Where's the ini file supposed to reside? I've tried in the application'sbinfolder, as well as%system32%\\inetsvr, with no luck.Hoping someone can point out where this is supposed to reside, as I haven't been able to locate the correct location via IBM's documentation...### Assistant: The locations where MQ Client will look for themqclient.inifile are documented in the IBM MQ v7.5 (or later) Knowledge Center page \"Location of the client configuration file\":A MQ client app will look in locations below in order from 1 to 4 for the file. This is a summary of the above KC page with some additional notes from me:If you just want to set a global location you can set a server environment variable calledMQCLNTCFto point to the path and file name of your mqclient.ini file.mqclient.iniin the present working directory of the application. In our testing we could not get this to work for a IIS application.mqclient.iniin the Data directory where MQ is installed, you can check this location by looking at theMQ_FILE_PATHenvironment variable.mqclient.iniin the directory consisting of the concatenated values of theHOMEDRIVEandHOMEPATHenvironment variables.In addition if you are using Managed .NET client another option is to place settings in the application'sapp.configorweb.configfile. This is documented in the IBM MQ v7.5 (or later) Knowledge Center at the bottom of the page \"Configuration files for WebSphere MQ classes for .NET\". This page provides an example that you can use as a model for any of the settings that are honored by the Managed .Net client.\n"} +{"text": "### Human: I'm trying to set ccdturl with the ccdt file which located in a remote server. I tried to set ccdt url using ftp but it does not work out. Does anyone know what is the correct way to set url for ccdt file in remote server?\nThanks!I tried:String channelTablePath = \"ftp://user@host:/path-to-ccdt-file\";\nUrl url = new URL(channelTablePath );\nconnectionFactory.setCCDTURL(url);The error that I get is:Exception in thread \"main\" javax.jms.JMSException: JMSWMQ2020: Failed to connect to queue manager '*QQ' with connection mode 'Client' and supplied CCDT URL 'ftp://user@host:/path/ccdt.tab', see linked exception for more information.\nJMS Error code: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2278' ('MQRC_CLIENT_CONN_ERROR').\nEXPLANATION:\nThe filesystem returned error code 'java.net.ConnectException[Connection timed\nout]' for file 'ftp://user@host:/path/ccdt.tab'.\nACTION:\nRecord the name of the file 'ftp://user@host:/path/ccdt.tab'\nand tell the systems administrator, who should ensure that file 'ftp://user@host:/path/ccdt.tab'\nis correct and available.### Assistant: Summary:You should not have a colon (:) after the host in the URL. You should specify a password value in the URL if required. You also need to specify the name of the ccdt file. References to the IBM Knowlege center at at the end of this answer.Try the following value instead:String channelTablePath = \"ftp://user:pass@host/path-to-ccdt-file/AMQCLCHL.TAB\";The IBM MQ v9 Knowledge center page \"Using a client channel definition table with IBM MQ classes for JMS\" states:As another example, suppose the file ccdt2.tab contains a client\n channel definition table and is stored on a system that is different\n from the one on which the application is running. If the file can be\n accessed using the FTP protocol, the application can set the CCDTURL\n property in the following way:java.net.URL chanTab2 = new URL(\"ftp://ftp.server/admdata/ccdt2.tab\");\nfactory.setCCDTURL(chanTab2);The IBM MQ v9 Knowledge center page \"Web addressable access to the client channel definition table\" shows an example of a FTP URL with username and password:Authenticated connectionsexport MQCHLLIB=ftp://myuser:password@myhost.sample.com/var/mqm/qmgrs/QMGR/@ipcc\nexport MQCHLLIB=http://myuser:password@myhost.sample.com/var/mqm/qmgrs/QMGR/@ipcc...NoteIf you want to use authenticated connections you must,as with JMS, provide the user name and password encoded in the URL.\n"} +{"text": "### Human: I am trying to consume JMS messages (IBM Websphere MQ) using Apache Flume and storing the data to HDFS. While reading the message, i am only able to see the body of the message and not the header content of the message.Is it possible to read the jms message with the header property using Apache Flume?My configuration:# Source definition\nu.sources.s1.type=jms\nu.sources.s1.initialContextFactory=ABC\nu.sources.s1.connectionFactory=\nu.sources.s1.providerURL=ABC\nu.sources.s1.destinationName=r1\nu.sources.s1.destinationType=QUEUE\n# Channel definition\nu.channels.c1.type=file\nu.channels.c1.capacity=10000000\nu.channels.c1.checkpointDir=/checkpointdir\nu.channels.c1.transactionCapacity=10000\nu.channels.c1.dataDirs=/datadir\n# Sink definition\nu.sinks.r1.type=hdfs\nu.sinks.r1.channel=c1\nu.sinks.r1.hdfs.path=/message/%Y%m%d\nu.sinks.r1.hdfs.filePrefix=event_\nu.sinks.r1.hdfs.fileSuffix=.xml\nu.sinks.r1.hdfs.fileType = DataStream\nu.sinks.r1.hdfs.writeFormat=Text\nu.sinks.r1.hdfs.useLocalTimeStamp=TRUE### Assistant: There are quite a few types of JMS messages as in \"Table 30\u20132 JMS Message Types\"here.The FlumeDefaultJMSMessageConverterusesTextMessageas inhereand is given below for your reference:...\nelse if(message instanceof TextMessage) {\n TextMessage textMessage = (TextMessage)message;\n event.setBody(textMessage.getText().getBytes(charset));\n } \n...TextMessageoffers only body of the message.IMHO, you have two options:If at all possible, send the message-header, header-value pair in the body itself and use the \"DefaultJMSMessageConverter\" as is.Build your own \"flume-jms-source.jar\" by writing a custom JMSMessageConverter and type-cast the \"message\" tojavax.jms.Message, get the JMS headers, set them inSimpleEvent.Hope this gives some direction.\n"} +{"text": "### Human: jmeter (jms point-to-point) error while connecting IBM - MQ :javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.fscontext.RefFSContextFactory [Root exception is java.lang.ClassNotFoundException: com.sun.jndi.fscontext.RefFSContextFactoryNeed help in resolving the error. FYI:com.ibm.mq.allclient.jaris added in lib folder, 32 bit jdk 1.8jms point-to-point configuration in jemeterJNDI configuration in mq explorerAfter adding the jars (copied all the MQ Jars (that comes with a complete Websphere MQ installation) and placing them into JMeter/Lib) new error encountered:Error: Response message: java.lang.IllegalStateException: QueueConnectionFactory expected, but got com.ibm.mq.jms.MQConnectionFactoryBinding file is there in place (C:\\Users*****\\Downloads\\apache-jmeter-3.3\\apache-jmeter-3.3\\JNDI-Directory)### Assistant: You do not state which version of IBM MQ jar files you are using, however com.ibm.mq.allclient.jar was introduced in IBM MQ v8, so you must be using v8 or v9.The v9 Knowledge Center page \"What is installed for IBM MQ classes for JMS\" states the following:The fscontext.jar and providerutil.jar files are required if your application performs JNDI lookups using a file system context.In summary you need to include the following jar files:com.ibm.mq.allclient.jarjms.jarfscontext.jarproviderutil.jarSee my answer to \"Upgrade of Java 8 and MQ - NoClassDEfFoundErrorfor more information.UPDATE 2018-01-25Related to the secondary error:Error: Response message: java.lang.IllegalStateException: QueueConnectionFactory expected, but got com.ibm.mq.jms.MQConnectionFactoryIn the following answer Attila Repasi addresses the error you are receiving:JMeter 3.2 Point-to-Point configuration for IBM MQ 8 => Java ExceptionThe answer states:Create a MQQueueConnectionFactory in MQExplorer instead of the\n MQConnectionFactory you have now.In addition in the following answer Attila Repasi describes how to configure JMeter with IBM MQ v8 and addresses what to do in MQ Explorer.JMeter configuration for IBM MQ 8\n"} +{"text": "### Human: I want to use Apache Camel to send a message on IBM MQ and so I wrote a simple program, but I am getting error:Exception in thread \"main\" org.apache.camel.NoSuchEndpointException: No endpoint could be found for: queuename, please check your classpath contains the needed Camel component jar.\n at org.apache.camel.impl.DefaultProducerTemplate.resolveMandatoryEndpoint(DefaultProducerTemplate.java:499)\n at org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:167)My code:CamelContext context = new DefaultCamelContext();\n\n//added that line after some checks but didnt help\ncontext.addComponent(\"http\", new HttpComponent());\n\n context.addComponent(\"test-jms\",connFactory);\n\nProducerTemplate template = context.createProducerTemplate();\n\ncontext.start();\n\ntemplate.sendBody(\"testQueueName\", \"Test Message \");testQueueNameholdsqueuename.I have all necessary dependencies in mypom.xml.### Assistant: The first argument of sendBody() must be an Apache Camel Endpoint, for example \"activemq:MyQueue\". In other words, it must be one of these:http://camel.apache.org/uris.htmlIf you configured IBM MQ as your JMS provider, I guess this should work:template.sendBody(\"jms:queue:testQueueName\", \"Test Message \");\n"} +{"text": "### Human: I'm testing to bridge messages from WMQ in Solaris to Message Hub - Bluemix and vice versa using Secure Gateway.Since secure gateway client is not available for Solaris , what is the option for using secure gateway client in Solaris ?### Assistant: @Vignesh, you are correct. The Secure Gateway team does not support Secure Gateway on Solaris. Unfortunately, you are on your own here.If you aredesperateto get this working you can unpack the .deb or .rpm packages and see if you can replicate the installation yourself, but translated for Solaris.I would warn that I think this may also not be feasible as it looks like the application run time for Secure Gateway, NodeJS, may or may not be supported on Solaris.Your best bet would be to run on Ubuntu, or RHEL if possible.\n"} +{"text": "### Human: I am new to Mulesoft Anypoint Studio and have just started exploring it. My flow starts with reading messages from MQ and ends with putting it at the destination, to begin with just my local machine and would evolve later. I have run into an issue where the Queue has TSL which involves keystores and truststores. Now, in Anypoint I see WMQ and HTTPS/TSL connectors. I've setup a TSL context as global element but how do I set it as part of WMQ connector? The same queue &/or channel can be accessed by Java code with correct TLS settings (keystores, truststores etc.) but in the studion, I am currently getting this exception:Root Exception was: MQJE001: An MQException occurred: Completion Code 2, Reason 2009\n MQJE016: MQ queue manager closed channel immediately during connect\n Closure reason = 2009. Type: class com.ibm.mqservices.MQInternalExceptionI haven't come across any sample code for WMQ with TLS while searching on google. Any clues/insights are greatly appreciated.Thank you in advance!### Assistant: Create MQQueueConnectionFactory bean as below\n \n \n \n \n \n \n \n Create UserCredentialsConnectionFactoryAdapter bean and pass above created bean as reference to this.\n \n \n \n Create WMQ connector and pass the appropriate references and valuesSet keystore and truststore locations and passwords in VM arguments as below-Djavax.net.ssl.trustStore=keystore.jks -Djavax.net.ssl.trustStorePassword=xxxx -Djavax.net.ssl.keyStore=keystore.jks -Djavax.net.ssl.keyStorePassword=xxxxThat's it. This should solve WMQ with SSL integration in Mule.\n"} +{"text": "### Human: I would like to connect to the IBM MQ using a wmq jmsra resource adapter.\nAm trying to connect to the IBM MQ server that is on version 8.0.0.5, which adapter can I use ?Can I use adapter of version for example 7.5 ?Problem is that for example with change from adaper 7 to 8 I also need to change version of jboss from 6 to 7 based on this :https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/6.4/html/administration_and_configuration_guide/deploy_the_websphere_mq_resource_adapterMy cipher should not be a problem I think as I see that is supported by for example version 7.5http://www-01.ibm.com/support/docview.wss?rs=171&uid=swg1IV66840Also that I see that ibm is creating fixes for versions 7.5 etc### Assistant: An IBM MQ 7.5.0.8 jmsra resource adapter can connect to an IBM MQ queue manager at a higher level such as v8.0.0.5.IBM Technote \"MQ 7.x, MQ 8.0 and MQ 9.0 compatibility with previous versions - including usage of CCDT files, JMS .bindings, SSL/TLS\" states:Compatibility statement:WebSphere MQ V7.0, V7.1, V7.5, V8.0 and V9.0 queue managers and\n clients inter operate with queue managers and clients from any\n previous level of the WebSphere MQ or MQSeries products.This means that ...A 7.0, 7.1,7.5, 8.0 and 9.0 client can connect to all queue managers, non-version 7, as well as version 7.0, 7.1, 7.5,8.0and 9.0A 7.0, 7.1, 7.5, 8.0 and 9.0 queue manager can interact with all clients, non-version 7, as well as version 7.0, 7.1, 7.5, 8.0 and 9.0Note however that IBM MQ v7.5 has an end of service date of April 30th 2018. I would recommend you use either v8.0 or v9.0 which have not had end of service dates announced yet. Newer MQ client versions can connect to older MQ queue managers. You can download a java only install of MQ 8.0 or MQ 9.0 jar files at the links below:IBM MQ v8.0 ClientIBM MQ v9.0 ClientNote that to use TLS ciphersuites with a non-IBM JRE (ex: Oracle JRE) you will need to be at a minimum of the following levels of IBM MQ:Version Maintenance Level\nv7.5 7.5.0.5\nv8.0 8.0.0.2\nv9.0 9.0.0.0\n"} +{"text": "### Human: Is there a DOS or Windows scripting command to remove all MQ Series subscriptions to a given MQ topic? Currently we go directly to the MQ Explorer to manually remove subscriptions one by one for a given topic when testing our application.### Assistant: You can use therunmqsccommand to view and administer IBM MQ from the command prompt or a script (For example Powershell or a Batch file).To display all subscriptions to a topic:echo DIS SUB(*) WHERE(TOPICSTR EQ 'Some/Topic/String') | runmqsc QMGRNAMETo delete a subscription:echo DELETE SUB('SUBSCRIPTION.NAME') | runmqsc QMGRNAME\n"} +{"text": "### Human: we have facing error, application unable to connect to queue manager,with reason \ncode mqrc 2538,webspher MQ version v7.0.1.2.operating system \"Solaris\".I have started the listener manually throughrunmqlsr -m qmname -t tcp -p portafter i have checked status of listener through command,display lsstatus(listener name)\"listener is available but when I try to display the status of this listener it is showing MQ object not found.\"we have checked error logs but there is no information for related client fails we have started listener manually, listener information only available in error logs.Also we have checked \"/var/mqm/error\" we found the FDC files \"probe ID: XY132002\" we have contact with sysadmin they mount the disk space.\nAfter mounting /var/mqm/ disc space still we are facing the same issue.i have already given \"start lstr(lstr name)\" in script mode, but i its accepting the request, while I try to display the status of this listener it is showing MQ object not found.\"i have checked qmgr error logs and fdc error logs\"can you please find the below errors written in /var/mqm/errors/AMQERR01.LOGExplanation: 1. An attempt hasbeen made to run the brker(SFMSICREQMGR) but the brker has ended for reason '6119:xecF_E_UNEXPECTED_SYSTEM_RC'.error: AMQ6119:An internal WebSphere MQ error has occured(failed to get memory segment:shmget(0x00000000, 16384) [rc =1 errno=28] no space left on device.\n++below error written in queue manger level error:++AMQ5008: An essential websphere MQ process 10063 (amqfgpub) cannot be found is assumed to be terminated.these are errors written in queue manager level error logs and system level error logs:we have added below valuesprocess.max-file-descriptor=(basic,10000,deny)\nproject.max-sem-ids=(priv,1024,deny)\nproject.max-shm-ids=(priv,1024,deny)\nproject.max-shm-memory=(priv,4294967296,deny)after adding this parameters we restarted the queue manager's,we have four queue managers in server, three queue managers and listeners are in running state, fourth queue manager facing same error.we have stopped one queue manager and we have run the fourth queue manager,the fourth queue manager is running and listener also in running state.one queue manager is not allowing to start. we are facing same error for this queue manager.All queue managers and listeners running fine.we have created local queue, \n queue name(error_local_queue).but while application tried get msg from this queue his getting error\nMqrc 2033.Kindly help for this issuethank you so much to all issue got resolved.### Assistant: If you start a listener using the following command (as per your question):-runmqlsr -m qmname -t tcp -p portThen you have not specified a name for the listener anywhere (because this command does not have that capability).It will however still show up in aDISPLAY LSSTATUScommand with a system generated name. If you use the following command:-DISPLAY LSSTATUS(*)that will show all running listeners, and you will see that there is one with a name something likeSYSTEM.LISTENER.TCP.1which is yourrunmqlsrone.Alternatively, if you want to give your listener a specific name, then you must define a listener as follows (replacing nnnn with your port number):-DEFINE LISTENER(TCP.LSTR) TRPTYPE(TCP) CONTROL(QMGR) PORT(nnnn)Then you are able to start it as follows:-START LISTENER(TCP.LSTR)and show it's status as follows:-DISPLAY LSSTATUS(TCP.LSTR) ALLN.B. I used the nameTCP.LSTRbut you may choose any name you wish.The errors you mention at the end of your question are unrelated to listeners. Please open a separate question for those.\n"} +{"text": "### Human: I'm tasked with sending a test message to an (as yet) unknown MQ endpoint.I've stood a trial version of IBM WebSphere MQ (v8.0.0.5) on a server, which Ibelieveis configured correctly.However, given the code included below I get either the exception:An unhandled exception of type 'IBM.WMQ.MQException' occurred in\n amqmdnet.dllAdditional information: 2059Or if I am on the server itself usinglocalhostinstead of the remote server name, the constructor line hangs.This is C#:Hashtable connectionProperties = new Hashtable();\n\nstring connectionType = MQC.TRANSPORT_MQSERIES_MANAGED\nconnectionProperties.Add(MQC.TRANSPORT_PROPERTY, connectionType);\n\n// Set up the rest of the connection properties, based on the\n// connection type requested\nswitch (_connectionType)\n{\n case MQC.TRANSPORT_MQSERIES_BINDINGS:\n break;\n case MQC.TRANSPORT_MQSERIES_CLIENT:\n case MQC.TRANSPORT_MQSERIES_XACLIENT:\n case MQC.TRANSPORT_MQSERIES_MANAGED:\n connectionProperties.Add(MQC.HOST_NAME_PROPERTY, \"server.com\");\n connectionProperties.Add(MQC.CHANNEL_PROPERTY, \"SYSTEM.DEF.CLNTCONN\"); \n break;\n}\n\nMQQueueManager qMgr = new MQQueueManager(\"test\", connectionProperties);\nMqClientTest mqClientTest=new MqClientTest(\"TEST_QM\",\"localhost\", \"SYSTEM.DEF.CLNTCONN\");Is there anything we're missing in this?Update 1:In theamqerr01.logfile in theerrorsfolder, we now have the text:AMQ6183: An internal WebSphere MQ error has occurred.Update 2:The \"internal WebSphere MQ error\" was likely due to my probing the 1414 port to see if the port was \"up\" and listening. Seems it was and it obviously didn't like me doing that.Update 3:@Roger suggested I use127.0.0.1and capitals, which I've now applied - and changed the example above to reflect.@JoshMc kindly pointed to a second AMQERR01.LOG file within the Queue Manager folder. I now get the error:14/11/2017 15:35:08 - Process(336.6) User(xxxx)\n Program(amqrmppa.exe)\n Host(xxxx) Installation(xxxx)\n VRMF(8.0.0.5) QMgr(TEST_QM)\n AMQ9519: Channel 'SYSTEM.DEF.CLNTCONN' not found.EXPLANATION: The requested operation failed because the program could\n not find a definition of channel 'SYSTEM.DEF.CLNTCONN'.TEST_QMis my Queue Manager, with the default (?) channelSYSTEM.DEF.CLNTCONN### Assistant: With IBM MQ there are always a pair of channels that work together. For example if one MQ Queue Manager needs to send to message to another queue manager it would normally have aSDR(Sender) channel defined, which would point to aRCVR(Receiver) channel with the same name on the other queue manager.For a MQ client connection the client application side of thechannelis called aMQCD, and the MQ Queue Manager side is aSVRCONN(Server Connection) channel. The client sideMQCDcan be specified in a few different ways. The way you are demonstrating in the example you posted is programmatically specifying theMQCDinformation (channel name, hostname, etc).An alternate way to specify the information is by pointing to aCCDT(Client Channel Definition Table) which is commonly referred to as a Channel Table, this is where aCLNTCONNchannel would be used, since you are not using a Channel table I'll move on to why you are getting an error, but at the end of this answer I'll provide more details on Channel Tables.In summary your application shouldnotbe specifying aCLNTCONNchannel as theMQC.CHANNEL_PROPERTYit should be pointing to aSVRCONNchannel.Two things to note:You should not use the predefinedSYSTEM.*channels for this purpose (for exampleSYSTEM.DEF.SVRCONN), you should define a new channel for your application to use. The default channels are meant to hold parameters that you want to be the defaults when creating a new channel of the same type.MQ v7.1 and later come with a fewCHLAUTHrules enabled by default which will block access to theSYSTEM.*channels.If you want to define aSVRCONNchannel using the command line programrunmqscon Windows run the following on a CMD prompt:echo DEFINE CHL(TEST_QM_CHANNEL1) CHLTYPE(SVRCONN)|runmqsc TEST_QMFew more details about Channel Tables:Prior to MQ v8 the only supported method to generate a Channel Table was by definingCLNTCONNchannels on a queue manager which creates a file calledAMQCLCHL.TABunder the queue manager name folder in a directory called@ipcc. The reason a queue manager comes with a channel calledSYSTEM.DEF.CLNTCONNis to provide the default values when you create a newCLNTCONNchannel. With v8 and later you can create the channel table using only therunmqsc -nmode, this will directly edit the channel table vs needing to create aCLNTCONNchannel on a queue manager. The MQ Client for v8 and later now comes with a client version ofrunmqscthat can be used to create and alter channel tables.An application can point to the channel table file in a few different ways, a common way is by setting two environment variables (MQCHLLIBandMQCHLTAB). The app then does not specify channel name, host name, etc in the program, it only needs to specify the name of the queue manager to connect to.The order and where MQ looks for connection information is documented at the IBM v7.5 (or later) Knowledge Center page \"Connecting IBM WebSphere MQ MQI client applications to queue managers\". Note this link is for MQI clients, but the same basic order applies to .NET clients as well.\n"} +{"text": "### Human: Sample example is :\n \n \n \n \n \nI get following error:org.mule.module.launcher.DeploymentInitException: SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'wmq:inbound-endpoint'. One of '{\"http://www.mulesoft.org/schema/mule/core\":abstract-poll-override, \"http://www.mulesoft.org/schema/mule/core\":abstract-message-processor, \"http://www.mulesoft.org/schema/mule/core\":abstract-outbound-endpoint, \"http://www.mulesoft.org/schema/mule/core\":abstract-mixed-content-message-processor}' is expected. at org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:205)\n~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.artifact.ArtifactWrapper$2.execute(ArtifactWrapper.java:63)\n~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.artifact.ArtifactWrapper.executeWithinArtifactClassLoader(ArtifactWrapper.java:136)\n~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.artifact.ArtifactWrapper.init(ArtifactWrapper.java:58) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:25)\n~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DefaultArchiveDeployer.guardedDeploy(DefaultArchiveDeployer.java:324)\n~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DefaultArchiveDeployer.deployArtifact(DefaultArchiveDeployer.java:345)\n~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:163)\n~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:268)\n~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:83)\n~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DeploymentDirectoryWatcher.deployPackedApps(DeploymentDirectoryWatcher.java:275)\n~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DeploymentDirectoryWatcher.start(DeploymentDirectoryWatcher.java:150)\n~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.MuleDeploymentService.start(MuleDeploymentService.java:104)\n~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.MuleContainer.start(MuleContainer.java:170)\n~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.tooling.server.application.ApplicationDeployer.main(ApplicationDeployer.java:15)\n~[tooling-support-3.8.0.jar:?]### Assistant: You are using a Poll wrapped wmq:inbound-endpoint as your message source. If you are reading from the WebSphereMQ you will need to change this to a wmq:outbound-endpoint component else move it to the process flow section.\n"} +{"text": "### Human: Recently we were migrated our websphere application server v8.0.0.3 to 8.5.5.8. One application was running which is using IBM MQ java API to connect one third party machine through MQ server connection channel.Same application working good in v8.0.0.3, but same application is not connecting with MQ in v8.5.5.8. We are getting \"MQRC 2035\"(NOT AUTHORIZED).Exact Error:Could be configuarion, network or service availability issue. Root Cause: MQJE001: Completion Code '2', Reason '2035'Both older and newer version of application server running as \"SYSTEM\" user(Windows service).It can be solve by adding the setmqauth at third party side. but we need some clarification why same application is not working on v8.5.5.8### Assistant: WAS v8.0.0.3 comes with IBM MQ RA v7.0.1.7. WAS v8.5.5.8\ncomes with IBM MQ RA v7.1.0.6.The behavior of IBM MQ MQ changed in v7.1 to not flow a blank MCAUSER. This is documented in the IBM Technote \"Changes in the default user identifier between WebSphere MQ V7.0.1 classes for JMS and WebSphere MQ V7.1 classes for JMS\".AnswerWebSphere MQ access control is based on user identifiers. There is a\n deliberate change in the default behaviour between the WebSphere MQ\n V7.0.1 classes for JMS and the WebSphere MQ V7.1 (and later) classes\n for JMS regarding the default user identifier flowed to the queue\n manager. From the WebSphere MQ V7.1 classes for JMS onwards, a\n non-blank user identifier is always flowed to the queue manager when\n creating a connection to WebSphere MQ.If thethird party sideis allowing a blankMCAUSERwith WAS v8.0.0.3, it would indicate that third party side is not validating what you pass and worse is likely letting you connect as a MQ admin giving you access to all queues including SYSTEM queues on the queue manager.\n"} +{"text": "### Human: we recently upgraded our code to Java 8. As part of it MQ was also upgraded to MQ 9. We are using two components jms(7.0.1.6) and jmqi(7.0.1.6) earlier.\n Now we replaced both the jars with allclient and tracecontrol of MQ 9.0.0.0 JAR.2017-10-24 02:30:07 INFO server.SqlService - SQL\nException in thread \"main\" java.lang.NoClassDefFoundError: javax/jms/JMSRuntimeException\n at com.ibm.mq.jms.MQDestination.(MQDestination.java:71)\n at com.epo.core.server.config.LdapConfig.getQueue(LdapConfig.java:213)\n at com.epo.core.server.MqService.start(MqService.java:77)\n at com.epo.core.service.ServiceGroup.start(ServiceGroup.java:90)\n at com.epo.core.service.ServiceGroup.startAll(ServiceGroup.java:76)\n at com.epo.core.service.ServiceGroup.start(ServiceGroup.java:70)\n at com.epo.server.dispatcher.DispatcherProcess.initializeServices(DispatcherProcess.java:380)\n at com.epo.server.dispatcher.DispatcherProcess.run(DispatcherProcess.java:320)\n at com.epo.server.dispatcher.DispatcherProcess.main(DispatcherProcess.java:200)\nCaused by: java.lang.ClassNotFoundException: javax.jms.JMSRuntimeException\n at java.net.URLClassLoader.findCl`enter code here`ass(URLClassLoader.java:381)\n at java.lang.ClassLoader.loadClass(ClassLoader.java:424)\n at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)\n at java.lang.ClassLoader.loadClass(ClassLoader.java:357)\n ... 9 morePlease let me know why I am gettingNoClassDefFoundError.### Assistant: You're getting the exception:java.lang.ClassNotFoundException: javax.jms.JMSRuntimeExceptionbecause you don't have the JMS v2.0 jar on your classpath. You're probably still using the JMS v1.1 jar.Look at how your application configures its Java classpath to correct the issue.Note that if you didn't copy the MQ client libraries around, and just referenced the com.ibm.mq.allclient.jar file on the Java classapth from a real MQ client install, you wouldn't have this problem as the JMS v2.0 jar will exist alongside the allclient jar in the MQ_INSTALLATION_DIR/java/lib directory and would be pulled into auto-magically.\n"} +{"text": "### Human: I am trying to apply a Message Selector on an MQMD propertyApplIdentityDataI can see this property is set on the message:JMS_IBM_MQMD_ApplIdentityData=some_valueI have tried:dest.setBooleanProperty(WMQConstants.WMQ_MQMD_READ_ENABLED, true);\ndest.setIntProperty(WMQConstants.WMQ_MQMD_MESSAGE_CONTEXT, \n WMQConstants.WMQ_MDCTX_SET_ALL_CONTEXT);\n/*1*/qsess.createReceiver(dest, \"ApplIdentityData='some_value'\");\n/*2*/qsess.createReceiver(dest, \"Root.MQMD.ApplIdentityData='some_value'\");They are not pulling in the message.### Assistant: You will need to use the fully qualified message header key in the selector. You may want to try this instead.qsess.createReceiver(dest, \"JMS_IBM_MQMD_ApplIdentityData='some_value'\");Reference:https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q031980_.htm\n"} +{"text": "### Human: No matter what I do when I try to connect (to write to) an IBM WebSphere MQ v8 it always errors out (2035unauthorized) as MQQueueManager connection looks to be using the user the service of the application is running on (Windows x64 server 2012) rather than theMQC.PASSWORD_PROPERTYthat I have setup in the hash table.The MQ is the same version as my libraries (v8) and hasADOPTCTX(YES)and we have performedREFRESH SECURITY TYPE(CONNAUTH). Setting up my hashtable as follows for properties:MQ_PROPERTIES = New Hashtable()\nMQ_PROPERTIES.Add(MQC.HOST_NAME_PROPERTY, MQ_HOSTNAME)\nMQ_PROPERTIES.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED)\nMQ_PROPERTIES.Add(MQC.PORT_PROPERTY, MQ_PORT)\nMQ_PROPERTIES.Add(MQC.CHANNEL_PROPERTY, MQ_CHANNEL_NAME)\nMQ_PROPERTIES.Add(MQC.USER_ID_PROPERTY, MQ_USERNAME)\nMQ_PROPERTIES.Add(MQC.PASSWORD_PROPERTY, MQ_PASSWORD)\nMQ_PROPERTIES.Add(MQC.USE_MQCSP_AUTHENTICATION_PROPERTY, True)With starting it as:Using queueManager As New MQQueueManager(MQ_QUEUE_MANAGER, MQ_PROPERTIES)Edit/Update:{windows app user} = the account that the service of the app is running as.dlls all v 8.0.0.4Error in mq log (don't have direct access but as supplied):AMQ9557: Queue Manager User ID initialization failed for '{windows app user}'. \n\nEXPLANATION: \n\n Cause . . . . . : The call to initialize the User ID '{windows app user}' failed \nwith CompCode 2 and Reason 2035. \n Recovery . . . : Correct the error and try again. \n\n----- cmqxrsrv.c : 2356 ------------------------------------------------------- \n ************End of Data********************CONNAUTH was set to SYSTEM.DEFAULT.AUTHINFO.IDPWLDAP. Settings for both IDPWLDAP and IDPWOS were as follows:5 : dis AUTHINFO(SYSTEM.DEFAULT.AUTHINFO.IDPWLDAP) \n AMQ8566: Display authentication information details. \n AUTHINFO(SYSTEM.DEFAULT.AUTHINFO.IDPWLDAP) \n AUTHTYPE(IDPWLDAP) ADOPTCTX(YES) \n DESCR( ) CONNAME( ) \n CHCKCLNT(REQUIRED) CHCKLOCL(OPTIONAL) \n CLASSUSR( ) FAILDLAY(1) \n BASEDNU( ) LDAPUSER( ) \n LDAPPWD( ) SHORTUSR( ) \n USRFIELD( ) SECCOMM(NO) \n ALTDATE(2017-10-20) ALTTIME(16.38.55) \n\n 2 : dis AUTHINFO(SYSTEM.DEFAULT.AUTHINFO.IDPWOS) \n AMQ8566: Display authentication information details. \n AUTHINFO(SYSTEM.DEFAULT.AUTHINFO.IDPWOS) \n AUTHTYPE(IDPWOS) ADOPTCTX(YES) \n DESCR( ) CHCKCLNT(OPTIONAL)\n CHCKLOCL(OPTIONAL) FAILDLAY(1) \n ALTDATE(2017-10-23) ALTTIME(13.50.20)### Assistant: AUTHINFOobject that you are referencing hasAUTHTYPE(IDPWLDAP), but you do not have any of the required fields likeCONNAME,BASEDNU, etc. Double check the queue manager'sCONNAUTHsetting to make sure you are viewing the rightAUTHINFOobject, you can do this with the commandDIS QMGR CONNAUTH. \n Whatever value is displayed in the queue manager'sCONNAUTHfield is the name of theAUTHINFOobject you should be viewing.If you want to useAUTHTYPE(IDPWLDAP)you need to configure it to point to a LDAP server with the required values. If you want it to use Windows OS authentication, then you would useAUTHTYPE(IDPWOS).Per an update from the OP (Hub3rt), the queue manager'sCONNAUTHsetting was incorrectly pointing toSYSTEM.DEFAULT.AUTHINFO.IDPWLDAPand after updating the queue manager'sCONNAUTHsetting to point toSYSTEM.DEFAULT.AUTHINFO.IDPWOSwithADOPTCTX(YES)authentication was successful.\n"} +{"text": "### Human: I am trying to start queue manager on windows but getting error as AMQ6109 - An Internal WebSphere MQ has occurred.WebSphere MQ queue manager 'IIB9QMGR' starting.\nThe queue manager is associated with installation 'Installation1'.\nAMQ6109: An internal WebSphere MQ error has occurred.Verified FDC and I could see below detailsWebSphere MQ First Failure Symptom Report\nDate/Time:- Tue October 17 2017 20:31:24 India Standard Time\nUTC Time :- 1508252484.533000\nUTC Time Offset :- 330 (UNKNOWN))\nOperating System :- Windows 7 Enterprise x64 Edition, Build 7601:SP1\nPIDS :- 724H7220\nLVLS :- 7.5.0.1\nProduct Long Name :- WebSphere MQ for Windows\nVendor :-IBM\nInstallation Path :- C:\\Program Files (x86)\\IBM\\WebSphere MQ\nInstallation Name :- Installation1 (1)\nProbe Id :- ZC041040\nApplication Name :- MQM\nComponent :- zcsPipeCreate\nSCCS Info :- F:\\build\\slot1\\p750_P\\src\\libzc\\amqzcsbn.c,\nLine Number :1960\nBuild Date :- Mar8 2013\nBuild Level:-p750-001-130308\nBuild Type:- IKAP - (Production)\nUserID:- spotlapelli\nProcess Name:- C:\\Program Files (x86)\\IBM\\WebSphere MQ\\bin\\amqzxma0.exe\nAddressing mode :- 32-bit\nProcess :- 00007924\nThread :- 00000001\nQueueManager :- IIB9QMGR\nUserApp :- FALSE\nConnId(1) IPCC :- 2\nConnId(2) QM :- 2\nConnId(3) QM-P :- 2\nConnId(4) App :- 2\nLast HQC :- 2.0.0-575228\nLast HSHMEMB :- 4.0.0-22980\nMajor Errorcode :- STOP\nMinor Errorcode :- OK\nProbe Type :- HALT6109\nProbe Severity :- 1\nProbe Description :- AMQ6109: An internal WebSphere MQ error has occurred\nFDCSequenceNumber :- 0\n\nComment1 :- The filename, directory name, or volume label syntax is in incorrect \nComment2 :- \\\\.\\pipe\\1\\IIB9QMGR\\zsocketEC\\ZagentPerformed below steps to resolve but did not workedRestart PC and start queue managerUninstall and Install MQ### Assistant: Given the limited amount of information posted here (no version, platform, other details), its a real challenge (but fortunately I like a challenge...)!If I've calculated correctly, that probe comes out when a windows queue manager tries to create a named pipe and it fails (Probe 40 from zcsPipeCreate). It is quite rare of that call to fail, and not many causes - the only times it has been seen all turned out to be caused by external influences. A number of times stopping something called SWIFT application services avoided the problem (apparently there's a SWIFT update to it to fix this), although I have no idea what SWIFT Application Services are... If you are not running SWIFT, then you will need to open a PMR with IBM to debug further, although I would recommend updating this question with your full FDC header just in case anything else stands out.The test program referred to in the link @JoshMc gave is as follows - perhaps try this?#include \nmain()\n{\n\n HANDLE hnp;\n int rc=0;\n\n hnp = CreateNamedPipe(\"\\\\\\\\.\\\\pipe\\\\1\\\\TESTQMGR\\\\zsocketEC\\\\Zagent\",\n PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE|PIPE_WAIT, 1, 1024,1024,\n NMPWAIT_USE_DEFAULT_WAIT, NULL);\n\n rc=GetLastError();\n\n if( hnp == INVALID_HANDLE_VALUE )\n printf(\"CreateNamedPipe failed with %d \",rc );\n else\n printf(\"NamedPipe created successfully\");\n\n}\n"} +{"text": "### Human: Could you please help on how to roll back the MQ patch applied on windows.I have patched the system from MQ7.1.0.0 to MQ7.1.0.8. It is a MQ client.Plz suggest how to rollback to 7.1.0.0.dspmqver -i\nName: WebSphere MQ\nVersion: 7.1.0.8\nLevel: p710-008-161121\nBuildType: IKAP - (Production)\nPlatform: WebSphere MQ for Windows\nMode: 32-bit\nO/S: Windows Server 2008 R2 Server Enterprise Edition, Build 7601: SP1\nInstName: Installation1\nInstDesc:\nInstPath: C:\\Program Files (x86)\\IBM\\WebSphere MQ\nDataPath: C:\\Program Files (x86)\\IBM\\WebSphere MQ\nPrimary: Yes\nMaxCmdLevel: 711\n\nName: WebSphere MQ\nVersion: 7.1.0.0\nInstName: Installation2\nInstDesc:\nInstPath: C:\\Program Files (x86)\\IBM\\WebSphere MQ_1\nPrimary: NoAfter executing the below commandC:\\Program Files (x86)\\IBM\\WebSphere MQ\\bin>dspmqver -i\nName: WebSphere MQ\nVersion: 7.1.0.8\nLevel: p710-008-161121\nBuildType: IKAP - (Production)\nPlatform: WebSphere MQ for Windows\nMode: 32-bit\nO/S: Windows Server 2008 R2 Server Enterprise Edition, Build 7601: SP1\nInstName: Installation1\nInstDesc: InstPath: C:\\Program Files (x86)\\IBM\\WebSphere MQ\nDataPath: C:\\Program Files (x86)\\IBM\\WebSphere MQ\nPrimary: No\nMaxCmdLevel: 711\n\nName: WebSphere MQ\nVersion: 7.1.0.0\nInstName: Installation2\nInstDesc:\nInstPath: C:\\Program Files (x86)\\IBM\\WebSphere MQ_1\nPrimary: Yes### Assistant: The client software is distributed as a full install not a patch. In your case the roll back would consist of a uninstall of the7.1.0.8client package and a reinstall of7.1.0.0client package.Download links for each v7.1.0.x client package are located on the IBM page \"MQC71: WebSphere MQ V7.1 Clients\".NOTE that v7.1 of IBM MQ went out of support on April 30th 2017. Newer versions of IBM MQ client can connect to IBM MQ Queue Managers that are at a older version.You have two installations on the same server,Installation1is7.1.0.8andInstallation2is7.1.0.0. Because of the order of the installations, you probably upgradedInstallation1from7.1.0.0to7.1.0.8and the later installed7.1.0.0asInstallation2.This is possible because MQ v7.1 and higher supports multiple versions being installed in parallel. On Windows one installation will always be primary, in the original output you provided yourInstallation1at7.1.0.8was primary.You can run the command below to switch the primary install toInstallation2(your7.1.0.0installation).setmqinst -i -n Installation2The updated output you provided shows thatInstallation2at7.1.0.0is primary now.You can consider this as rolled back to7.1.0.0since the installation with that version is now the Primary installation. You could take it a step further and actually uninstall the7.1.0.8installation if you like or you could keep it in place to \"roll forward\" to in the future.\n"} +{"text": "### Human: I have MQ 7.5 installed on a ubuntu machine.From the terminal I can run therunmqsccommand this takes me into a shell.I run a few commands,then when I try to exitrunmqscby typingquit, i get a error message.Onlyendseems to work.Why is this happening?Have I changed some setting inadvertently?Update 1:\nBelow is the output of the dspmqver command.user1@ubuntuvm-5:~$ /opt/mqm/bin/dspmqver\nName: WebSphere MQ\nVersion: 7.5.0.2\nLevel: p750-002-130704\nBuildType: IKAP - (Production)\nPlatform: WebSphere MQ for Linux (x86-64 platform)\nMode: 64-bit\nO/S: Linux 4.4.0-96-generic\nInstName: Installation1\nInstDesc: \nPrimary: No\nInstPath: /opt/mqm\nDataPath: /var/mqm\nMaxCmdLevel: 750### Assistant: quitandexitwere added torunmqscat V8.0. Prior to that release there was onlyend.SeeKnowledge Center: runmqsc (V8.0.0)andIBM Tech note: New features added to the runmqsc command in IBM MQ Version 8.0.\n"} +{"text": "### Human: I had a quick question on the .bindings file used in IBM MQ. I remember the bindings file specify queue name. Does it work fine with bindings file if a queue name currently used as a local queue and later changed to a remote queue but the name of the queue remains same and permissions are also fine?### Assistant: If aQLOCALis deleted and replaced with aQREMOTEand all MQ permissions are retained or reinstated, the same .bindings file can be used.There is a slightly different case of replacing either aQLOCALorQREMOTEwith aQALIASwhere theQALIASresolves to a remotely defined Clustered queue. If the Q definition in the .bindings file specified aQMANAGER(or the shorter aliasQMGR) on the Q definition the resolution of the QALIAS to a remote clustered queue would not work, theTargetof theQALIASmust exist on the resolved queue manager that was specified in the Q definition. To fix this just blank out theQMANAGERattribute.\n"} +{"text": "### Human: I am working with IBM MQ. I managed to get a basic Handshake / Put Message(s) / Get Message(s) / Disconnect .net solution going on, a couple of days ago, but it only works on a local level, and I now need to update the solution so it works remotely as well.After reading and experimenting for a while, I decided to followIBM Knowledge Center's Point to Point scenariostep by step. However, I can't start the Sender Channel as instructed by theguide's last step; the Sender Channel's status ping-pongs between Binding and Retrying, and the logs come up with the following error codes;AMQ9002,AMQ9202andAMQ9999, meaning, as far as I can tell, there is some kind of trouble finding and/or connecting with the host, as explained by the error logs.I have looked through a lot of questions regarding these errors in particular, but while I have followed most of the proposed solutions (I made sure the Receiver's listener is running, I tried turning off Firewalls, I tried with different ports, I have performed tests Telnet, I have stopped/restarted/resolved the Sender channel a few times, and I have tried setting this up from both, the command line and MQ Explorer), I have yet to get a successful communication going on between two different PCs.I am aware the error could be either temporary, or the result of problems within the Network itself, but I have been trying to establish a successful connection for almost three days now, and before I pass this unto my bosses I would like to make sure I have exhausted every other possibility.How can I complete IBM's Point To Point set up guide, or is there anything that could point me towards a different / better approach to get two PCs talking with each other via IBM MQ v9?Although hastily translated from Japanese, you can find the detailed error logs below.2017/09/19 17:34:09 - Process (234212.1) User (MUSR_MQADMIN) Program\n (runmqchl.exe)\n Host (DESKTOP - UP 4 D 363) Installation (Installation 1)\n VRMF (9.0.3.0) QMgr (QM 1)\n Time (2017-09-19T08: 34: 09.201 Z)AMQ9002:Channel 'TO.QM2' is starting.Description: Channel 'TO.QM2' is starting.ACTION: None.2017/09/19 17:34:30 - Process (234212.1) User (MUSR_MQADMIN) Program\n (runmqchl.exe)\n Host (DESKTOP - UP4D363) Installation (Installation 1)\n VRMF (9.0.3.0) QMgr (QM 1)\n Time (2017-09-19T08: 34: 30.824Z)AMQ 9202:The remote host 'DESKTOP-1AV4LM3 (The correct ip address) (1415)' can not be used.Please try again later.Description: Using TCP / IP to host 'DESKTOP-1AV4LM3 (The correct ip\n address) of channel TO.QM2 (1415) 'trying to allocate a conversation,\n but it did not succeed. However, It is temporary and there is also the\n possibility that TCP / IP conversation can be allocated normally\n later.If the remote host can not be determined, '????' is displayed. .ACTION: Please try the connection later. If the failure persists,\n record the error value Please contact the stem administrator. The\n return code from TCP / IP is 10060 (X'274C ').The cause of this\n failure may be that the host can not reach the destination host.\n Alternatively, There is a possibility that the host 'DESKTOP-1AV4LM3\n (The correct ip address) (1415)' listener isn't running. If that is\n the case, start the listener and try again.2017/09/19 17:34:30 - Process (234212.1) User (MUSR_MQADMIN) Program (runmqchl.exe)\n Host (DESKTOP - UP 4 D 363) Installation (Installation 1)\n VRMF (9.0.3.0) QMgr (QM 1)\n Time (2017-09-19T08: 34: 30.825Z)AMQ9999:Channel 'TO.QM2' for host 'DESKTOP-1AV4LM3 (1415)' terminated abnormallyDescription: The host 'DESKTOP-1AV4LM3 (1415)' cannot be determined.ACTION: Check the error log for the preceding error message for\n this channel program Please determine the cause of failure....\n \".### Assistant: The 'interesting' bit of the error messages above is that the sender is attempting to start a channel to port 1415 on the destination and is getting a 10060 return code (WSAETIMEDOUT). This is different from an immediate rejection because the other end doesnt have a socket open, for example.You will also note its timing out after about 21 seconds if your times are to be believed. The only time I've seen this kind of things is DNS resolution - There was an APAR for example showing that reverse DNS can cause delays in channel startup, and this could be for a successful or unsuccessful startuphttp://www-01.ibm.com/support/docview.wss?uid=swg1IC96408A new attribute was added to MQ to disable reverse DNS lookups if its the cause - Seehttps://www.ibm.com/support/knowledgecenter/en/SSFKSJ_8.0.0/com.ibm.mq.pro.doc/q113120_.htm#q113120___chlauthIf this is the case, on the receiving end (or both!) try runmqsc , 'ALTER QMGR REVDNS(DISABLED)'. You might have to restart the qmgr for it to be effective (I'm not sure, sorry)I'd also echo the comment added to your question by JoshMc, to check the receiving end logs for messages (both global errors but more likely the qmgr specific AMQERR01.LOG files) when this occurs - I have a feeling that the timeout is only part of your problem.\n"} +{"text": "### Human: I am trying to connect to MQIPT which is having 1 way SSL enabled. Below is my spring configuration\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n QM\n \n \n QUEUE\n \n I added the certs to truststore and set the flag -Dcom.ibm.mq.cfg.useIBMCipherMappings=false in tomcat start up. In the MQIPT ciphersuite is set as SSL_RSA_WITH_AES_256_CBC_SHA. I am getting the below errorMQ Exception:: Uncategorized exception occured during JMS processing; nested exception is com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0018: Failed to connect to queue manager 'QM' with connection mode 'Client' and host name 'null'. .... Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2400' ('MQRC_UNSUPPORTED_CIPHER_SUITE').I am using JDK 8 and MQ client jars version 8.### Assistant: If you are using an Oracle JRE, then you need to specify the SSLCipherSuite per the table in the IBM MQ V8 Knowledge Center page \"SSL/TLS CipherSpecs and CipherSuites in IBM MQ classes for JMS\"CipherSpec |Equivalent CipherSuite (IBM JRE)|Equivalent CipherSuite (Oracle JRE)\n-------------------------------------------------------------------------------------------------\nTLS_RSA_WITH_AES_256_CBC_SHA| SSL_RSA_WITH_AES_256_CBC_SHA |TLS_RSA_WITH_AES_256_CBC_SHABased on the above, if MQIPT which uses the IBM JRE is specifyingSSL_RSA_WITH_AES_256_CBC_SHA, that means the SVRCONN channel on the queue manager should be specifyingTLS_RSA_WITH_AES_256_CBC_SHAand an Oracle JRE with-Dcom.ibm.mq.cfg.useIBMCipherMappings=falseshould be specifyingTLS_RSA_WITH_AES_256_CBC_SHAas well.Summary, change your Spring configuration to:\n"} +{"text": "### Human: I have a 2 installations of MQ on my machine. Installation1 and Installation2.I have not set the default installation usingsetmqinstbut when i run thedspmqcommand i get a list of queue managers from both the installations.I have qualified the dspmq command with the full path. i.e./opt/mqm/bin/dspmq, even with this the list contains all the queue managers from both the installations.How do I run these commands only against only one of the installations?Is it by setting and changing the default installation usingsetmqinst?### Assistant: Thedspmqcommand is documented in the IBM MQ Knowledge centerdspmqpage.If you add-o installationto the dspmq command it with show the installation name along with the queue manager name, but will always show all queue mangers on the server.You can grep the installation name to limit the output to one of the two installations, for example:Installation1:dspmq -o installation|grep Installation1Installation2:dspmq -o installation|grep Installation2\n"} +{"text": "### Human: I have an application using apache-camel solution, and would like to send message to Websphere MQ Server through jms, convert jms propertyJMS_IBM_MQMD_MsgIdto MQMD fieldMQMD.MsgId, so that I set this value on message through camelexchange.getIn().setHeader(WMQConstants.JMS_IBM_MQMD_MSGID, \"XXXXXXXXXXXXXXXXXXXXXXXX\".getBytes());According toApache Camel - IBM MQ integration, seems we need another properties setting on destination object. ReferenceSetting JMS Provider Options on the Destinationonhttp://camel.apache.org/jms.html, I provide a custom DestinationResolver for camel jms component, setmdWriteEnabled,mdReadEnabledfor destination object.\n \n \nandpublic class WMQDestinationResolver implements DestinationResolver {\n @Override\n public Destination resolveDestinationName(Session session, String destinationName, \n boolean pubSubDomain) throws JMSException {\n MQSession mqSession = (MQSession) session;\n MQQueue queue = (MQQueue) mqSession.createQueue(\"queue:///\" + destinationName);\n queue.setBooleanProperty(WMQConstants.WMQ_MQMD_WRITE_ENABLED, true);\n queue.setBooleanProperty(WMQConstants.WMQ_MQMD_READ_ENABLED, true);\n queue.setIntProperty(WMQConstants.WMQ_MQMD_MESSAGE_CONTEXT, WMQConstants.WMQ_MDCTX_SET_ALL_CONTEXT);\n return queue;\n }\n}I can getJMS_IBM_MQMD_MsgIdon receiver while settingmdReadEnabledequals true. However,mdWriteEnabledseems not works for me, and I getJMS_IBM_MQMD_MsgIdas an unexpected valueAMQ CS.QA.CBSA.Q\ufffdY\ufffdb(been parsed from byte[], totally 24 bytes).The receivedJMSMessageIDisID:414d512043532e51412e434253412e511987055902cc6222, which can be parsed to the messy string above.### Assistant: I drill down camel code and find the root casueWhile setting jms property, it will run methodgetValidJMSHeaderValueoforg.apache.camel.component.jms.JmsBindingprotected Object getValidJMSHeaderValue(String headerName, Object headerValue) {\n if (headerValue instanceof String) {\n return headerValue;\n } else if (headerValue instanceof BigInteger) {\n return headerValue.toString();\n } else if (headerValue instanceof BigDecimal) {\n return headerValue.toString();\n } else if (headerValue instanceof Number) {\n return headerValue;\n } else if (headerValue instanceof Character) {\n return headerValue;\n } else if (headerValue instanceof CharSequence) {\n return headerValue.toString();\n } else if (headerValue instanceof Boolean) {\n return headerValue;\n } else if (headerValue instanceof Date) {\n return headerValue.toString();\n }\n return null;\n}Seems camel reject byte array value and return null, so that jms provider cannot apply property ofJMS_IBM_MQMD_MsgId. I override this method to sovle it.Note: I simply create the same classorg.apache.camel.component.jms.JmsBindingin source foldersrc/main/java, class loader would default load this class instead of the class from maven library.\n"} +{"text": "### Human: I have written a simple web service as a sample to work with IBM ESB but getting attached error at the time of sending message... seems that ESB is not able to connect to WMQ.Please let me know if you have any idea or solution.### Assistant: The pertinent error here seems to be:'sc' is not recognized as an internal or external command, operable program or batch file.The 'sc' command is part of the Windows operating system, you should investigate why it wasn't found. Perhaps it isn't installed, or perhaps the command isn't on the PATH you've got configured in your environment?On my system 'sc' can be found here:C:\\Windows\\System32\\sc.exe\n"} +{"text": "### Human: I have two clustersCLUSMESandCLUSHUBS. Each cluster has two queue managers.ClusterCLUSMEShas QMGRS:QMGR1AandQMGR1BClusterCLUSHUBShas QMGRS:QMGR3AandQMGR3BThere is a Gateway QMGR:QMGR2, which forms the overlap and is a partial repository in each MQ cluster.Request messages are sent out from eitherQMGR1A/Bto eitherQMGR3A/BviaQMGR2which acts as a cluster Load balance toQMGR3A/B(This works fine) and a reply is expected back to the sending QMGR.All channel connectivity is in place and fully functional. The problem is how to return the message from where it came from. The replying QMGR connects to QMGR3A/B and issues a put. I will either get a REMOTE_QMGR not found (MQRC 2087) or a MQ Object not found (MQRC 2085) depending on how I have it configured. The message header of the message contains theReplytoQueueandReplyToQMgrproperly. I would like to have the replying application just issue a put and have it delivered to the proper queue inCLUSMES, but this is proving to be extremely difficult. I have played with Remote QMGR Alias and QAlias on the GateWay Qmgr:QMGR2, but no luck. There is got to be a simple trick to this and there are plenty of examples, but I have not been able to implement one successfully. A clear cut example of what my return path should be would be most helpful. Keep in mind, that theReplyToQMgris in theMQMDand resolution needs to occur from that. I need resolution to occur at theQMGR2level, where both clusters are known. Concrete full suggestions appreciated.MQ Definitions on the QMGR1A/B, where the REPLY is expected:DEFINE QLOCAL('SERVER.REPLYQ') CLUSTER('CLUSMES')On QMGR2 ( The Gateway for message hoping)DEFINE NAMELIST(CLUSTEST) NAMES(CLUSMES,CLUSHUBS)\n\nDEFINE QALIAS(SERVER.ALIAS.REPLYQ) TARGQ(SERVER.REPLYQ) CLUSTER(CLUSTEST) DEFBIND(NOTFIXED)\n\nDEFINE QREMOTE(QMGR1A) RNAME(' ') RQMNAME(QMGR1A) XMITQ('') CLUSTER(CLUSHUBS)\nDEFINE QREMOTE(QMGR1B) RNAME(' ') RQMNAME(QMGR1B) XMITQ('') CLUSTER(CLUSHUBS)On MQMGR3A/B QALIAS(SERVER.ALIAS.REPLYQ) cluster queue. The Gateway QMGR could not resolve the baseQ: mqrc_unknown_alias_base_q 2082This was the configuration when trying to resolve it using the cluster.### Assistant: When the request message is sent by the application it would specifyReplyToQMgrof eitherQMGR1AandQMGR1BandReplytoQueuewith the name of the queue that is present onQMGR1AandQMGR1B, the reply queue need not be clustered.On gateway queue managerQMGR2you would define the following objects:DEFINE QREMOTE(QMGR1A) RNAME('') RQMNAME(QMGR1A) XMITQ('') CLUSTER(CLUSHUBS)\nDEFINE QREMOTE(QMGR1B) RNAME('') RQMNAME(QMGR1B) XMITQ('') CLUSTER(CLUSHUBS)This would allows any queue manager in the clusterCLUSHUBSto route reply messages back toQMGR1AandQMGR1Bvia gateway queue managerQMGR2.If you want to limit queues onQMGR1AandQMGR1Bthat queue managers in theCLUSHUBScluster can put to you would need to take a different approach. Let me know if that is what you need and I will update my answer with some suggestions.\n"} +{"text": "### Human: Scenario: MQIPT is used in between a MQ client and MQ server version 8.Is it possible to validate the credentials sent along with the channel connection at MQIPT. I checked the documentation and it seems it cannot be done unless some kind of security exit is written for it.Just wanted to get views on this, as to how it can be achived if at all possible.Thank you.### Assistant: The MQIPTcom.ibm.mq.ipt.exit.SecurityExitandcom.ibm.mq.ipt.exit.CertificateExitclasses do not expose the username and password information for a client channel. Below is the documentation from IBM on these two types of exits.The com.ibm.mq.ipt.exit.SecurityExit classis documented in the IBM v9.0 Knowledge center with the following information:public SecurityExitResponse validate(IPTTrace)The following properties are available:listener portdestinationdestination porttimeoutclient IP addressclient port addresschannel namequeue manager nameThe validate method will be called by MQIPT when it receives a\n connection request to validate. The channel name and queue manager\n name will not be available if the SSLProxyMode property has been\n enabled, as this feature is only used to tunnel SSL/TLS data and\n therefore the data usually obtained from the initial data flow will be\n unreadable.The com.ibm.mq.ipt.exit.CertificateExit classis is documented in the IBM v9.0 Knowledge center with the following information:Supported methods for obtaining properties:public int getListenerPort()retrieves the route listener port - as defined by the ListenerPort\n propertypublic String getDestination()retrieves the destination address - as defined by the Destination\n propertypublic int getDestinationPort()retrieves the destination listener port address - as defined by the \n DestinationPort propertypublic String getClientIPAddress()retrieves the IP address of the client making the connection requestpublic int getClientPortAddress()retrieves the port address used by the client making the connection\n requestpublic boolean isSSLClient()used to determine if the exit is being called as an SSL/TLS client or\n SSL/TLS server. If this returns true, the exit is on the client side\n of the connection, validating the certificate obtained from the\n server. If this returns false, the exit is on the server side of the\n connection, validating the certificate sent by the client. It is valid\n for a route to act as both an SSL/TLS server and an SSL/TLS client,\n decrypting and re-encrypting traffic. In this situation, although\n there is a single exit class, some instances of the class will be\n called as clients and some as servers. You can use isSSLClient to\n determine the situation for a given instance.public int getConnThreadID()used to retrieve the ID of the worker thread that is handling the\n connection request, which can be useful for debugging.public String getChannelName()retrieves the IBM\u00ae MQ channel name that is used in the connection\n request. This is available only when the incoming request is not using\n SSL/TLS and MQIPT is acting as an SSL/TLS client.public String getQMName()retrieves the name of the IBM MQ queue manager used in the connection\n request. This is available only when the client request is not using\n SSL/TLS and MQIPT is acting as an SSL/TLS client.public boolean getTimedout()used by the exit to determine if the timeout has expired.public IPTCertificate getCertificate()retrieves the SSL/TLS certificate that needs to be validated.public String getExitData()retrieves the exit data, as defined by the SSLExitData property.public String getExitName()retrieves the exit name, as defined by the SSLExitName property.\n"} +{"text": "### Human: We are looking to use MQ clustering in order to better distribute workloads across two different sites. One of our requirements is to keep traffic geographically local in order to avoid messages routing between sites unecessarily (unless no local MQ managers are available). To achieve this, we are currently looking to use Queue Aliases as shown on Page 26 (Smarter Routing section) of thispresentation.To test, we have setup a mini cluster using three MQ Managers (MQ version 9) with queues just as in the presentation slide and, when all managers and queues are available, we can see that messages route within the same region as expected but, if we for example apply a put inhibit on NEWYORK's NYQ Alias Queue, we don't see any new messages route to LONDON's alternative NYQ Alias Queue. Instead, the Client application which tries to write messages to AppQ Alias Queue gets aMQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2268' ('MQRC_CLUSTER_PUT_INHIBITED').. Also, if we endmqm NEWYORK altogether, the client app is able to write messages to AppQ Alias Queue but, the messages just queue up in the AppQ Manager's SYSTEM.CLUSTER.TRANSMIT.QUEUE instead of routing to LONDON MQ Manager's alternative NYQ Alias Queue. Why could this be?### Assistant: In the above test scenarios, we have managed to get messages to route to the lower priority MQ Manager (i.e. LONDON) by altering the cluster queues' Default bind type to \"Not fixed\" (e.g.ALT QL(QUEUE_NAME) DEFBIND(NOTFIXED)).\n"} +{"text": "### Human: Following this post:Get Active QM Instance from Multi Instance Queue Manager and connectI have created a connectionXMSFactoryFactory factory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\nIConnectionFactory connectionProperties = factory.CreateConnectionFactory();\n\nconnectionProperties.SetIntProperty(XMSC.WMQ_CLIENT_RECONNECT_OPTIONS, XMSC.WMQ_CLIENT_RECONNECT_Q_MGR);\nconnectionProperties.SetStringProperty(XMSC.WMQ_CONNECTION_NAME_LIST, String.Format(\"{0}({1}),{2}({3})\", element.Host1, element.Port1, element.Host2, element.Port2));\nconnectionProperties.SetIntProperty(XMSC.WMQ_CLIENT_RECONNECT_TIMEOUT, XMSC.WMQ_CLIENT_RECONNECT_TIMEOUT_DEFAULT);\nconnectionProperties.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, element.QueueManager);\nconnectionProperties.SetStringProperty(XMSC.WMQ_CHANNEL, element.Channel);\nconnectionProperties.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);\nconnectionProperties.SetIntProperty(XMSC.WMQ_BROKER_VERSION, XMSC.WMQ_BROKER_V1);\nconnectionProperties.SetBooleanProperty(XMSC.WMQ_USE_CONNECTION_POOLING, true);then followed bytry\n {\n using (IConnection connection = _connectionProperties.CreateConnection())\n {\n connection.Start();\n using (ISession session = connection.CreateSession(true, AcknowledgeMode.AutoAcknowledge))\n {\n using (var scope = new TransactionScope(TransactionScopeOption.RequiresNew))\n {\n using (IDestination responseQueue = session.CreateQueue(replyToRequestQueue ? _requestQueueName : _responseQueueName))\n {\n using (IMessageProducer producer = session.CreateProducer(responseQueue))\n {\n IMessage response = session.CreateTextMessage(message);\n if (!string.IsNullOrEmpty(correlationId))\n {\n response.JMSCorrelationID = correlationId;\n }\n producer.Send(response);\n }\n }\n scope.Complete();\n }\n }\n }\n }\n catch (XMSException xmse)\n {\n if (xmse.LinkedException != null)\n {\n Trace.TraceError(string.Format(MQTraceMessageFormat,\n DateTime.Now,\n TraceMessageType.Error,\n Thread.CurrentThread.ManagedThreadId,\n Thread.CurrentThread.IsThreadPoolThread ? \"Threadpool \" + Name : Thread.CurrentThread.Name,\n null, null,\n \"XMSException.LinkedException on (SendTextMessage) sending message to \" + this + \n \" / xmse.LinkedException.Message : \" + xmse.LinkedException.Message +\n \" / xmse.Message : \" + xmse.Message +\n \" / xmse.LinkedException.StackTrace: \" + xmse.LinkedException.StackTrace,\n \" / xmse.StackTrace: \" + xmse.StackTrace,\n null));\n }\n else\n {\n Trace.TraceError(string.Format(MQTraceMessageFormat,\n DateTime.Now,\n TraceMessageType.Error,\n Thread.CurrentThread.ManagedThreadId,\n Thread.CurrentThread.IsThreadPoolThread ? \"Threadpool \" + Name : Thread.CurrentThread.Name,\n null, null,\n \"XMSException on (SendTextMessage) sending message to \" + this +\n \" / xmse.Message : \" + xmse.Message +\n \" / xmse.StackTrace: \" + xmse.StackTrace,\n null));\n }\n }\n catch (MQException mqex)\n {\n Trace.TraceError(string.Format(MQTraceMessageFormat,\n DateTime.Now,\n TraceMessageType.Error,\n Thread.CurrentThread.ManagedThreadId,\n Thread.CurrentThread.IsThreadPoolThread ? \"Threadpool \" + Name : Thread.CurrentThread.Name,\n null, null,\n \"MQException cc on (SendTextMessage) sending message to \" + this +\n \" Exception: \" + mqex.Message +\n \" CompletionCode: \" + mqex.CompletionCode +\n \" ReasonCode: \" + mqex.ReasonCode +\n \" Stack Trace: \" + mqex.StackTrace,\n null));\n }\n catch (IOException ioex)\n {\n Trace.TraceError(string.Format(MQTraceMessageFormat,\n DateTime.Now,\n TraceMessageType.Error,\n Thread.CurrentThread.ManagedThreadId,\n Thread.CurrentThread.IsThreadPoolThread ? \"Threadpool \" + Name : Thread.CurrentThread.Name,\n null, null,\n \"IOException ioex on (SendTextMessage) sending message to \" + this +\n \" Exception: \" + ioex.Message +\n \" Stack Trace: \" + ioex.StackTrace,\n null));\n }\n catch (Exception ex)\n {\n Trace.TraceError(string.Format(MQTraceMessageFormat,\n DateTime.Now,\n TraceMessageType.Error,\n Thread.CurrentThread.ManagedThreadId,\n Thread.CurrentThread.IsThreadPoolThread ? \"Threadpool \" + Name : Thread.CurrentThread.Name,\n null, null,\n \"Exception ex on (SendTextMessage) sending message to \" + this +\n \" Exception: \" + ex.Message +\n \" Stack Trace: \" + ex.StackTrace,\n null));\n }\n }to send message, however it threw exception at the last line producer.Send(response):renamed.exe Error: 0 : |8/15/2017 10:17:49 AM|Error|25|Threadpool XYZ|||XMSException.LinkedException on (SendTextMessage) sending message to Queue handler ABC:(In ABC.XYZ.REQUEST / Out XYZ.ABC.RESPONSE) / xmse.LinkedException.Message : 2012 / xmse.Message : Failed to send a message to destination XYZ.ABC.RESPONSE.\nXMS attempted to perform an MQPUT or MQPUT1; however WebSphere MQ reported an error.\nUse the linked exception to determine the cause of this error. / xmse.LinkedException.StackTrace: | / xmse.StackTrace: at IBM.XMS.Client.WMQ.ProducerShadow.CheckNmqiCallSuccess(String messageid, WmqDestination destination, String probeid, Int32 cc, Int32 rc)\n at IBM.XMS.Client.WMQ.SpiIdentifiedProducerShadow.SendInternal(MQMessageDescriptor md, Byte[] buffers, Int32 msgLength)\n at IBM.XMS.Client.WMQ.ProducerShadow.Send(WmqDestination destAtSendCall, WmqMessage message)\n at IBM.XMS.Client.WMQ.WmqMessageProducer.Send(ProviderDestination destAtSendCall, ProviderMessage message)\n at IBM.XMS.Client.Impl.XmsMessageProducerImpl.SendMessage(IMessage message, XmsDestinationImpl dest)\n at IBM.XMS.Client.Impl.XmsMessageProducerImpl.Send_(Boolean inIdentifiedContext, XmsDestinationImpl dest, IMessage message, DeliveryMode deliveryMode, Int32 priority, Int64 timeToLive, Boolean explicitDlvModePriorityAndTimeToLive)\n at IBM.XMS.Client.Impl.XmsMessageProducerImpl.Send(IMessage message)\n at DVS.Services.Common.MQHandler.QueueHandler.SendTextMessage(String message, String correlationId, Boolean replyToRequestQueue)From the trace I can see the producer has my two active/standby host in the connection name list, but also \"localhost\" as host_name and 1414 as port, is that why I cannot connect to it?producer: XMSC_WMQ_BROKER_PUBQ_QMGR : \nXMSC_CONNECTION_TYPE_NAME : IBM.XMS.Client.WMQ\nXMSC_DISABLE_MSG_ID : False\nXMSC_WMQ_RESOLVED_QUEUE_MANAGER_ID : QM1_2017-08-02_15.25.10 \nXMSC_WMQ_CLEANUP_INTERVAL : 3600000\nXMSC_WMQ_BROKER_PUBQ : SYSTEM.BROKER.DEFAULT.STREAM\nXMSC_WMQ_BROKER_SUBQ : SYSTEM.JMS.ND.SUBSCRIBER.QUEUE\nXMSC_WMQ_PUB_ACK_INTERVAL : 25\ntargetClient : 0\nXMSC_WMQ_CLEANUP_LEVEL : 1\nXMSC_WMQ_MESSAGE_RETENTION : 1\nXMSC_WMQ_PORT : 1414\nXMSC_WMQ_PROVIDER_VERSION : 7\nCCSID : 1208\ndeliveryMode : 2\nXMSC_ADMIN_OBJECT_TYPE : 20\nbrokerVersion : 0\nXMSC_WMQ_USE_CONNECTION_POOLING : True\nXMSC_WMQ_TEMP_Q_PREFIX : \nXMSC_ACKNOWLEDGE_MODE : 4\nXMSC_WMQ_BROKER_CONTROLQ : SYSTEM.BROKER.CONTROL.QUEUE\nfailIfQuiesce : 1\nXMSC_WMQ_MESSAGE_SELECTION : 0\nXMSC_ASYNC_EXCEPTIONS : -1\ntimeToLive : 0\nXMSC_WMQ_CONNECTION_MODE : 1\nXMSC_WMQ_RESOLVED_QUEUE_MANAGER : QM1\nXMSC_WMQ_CONNECTION_NAME_LIST : host1(11111),host2(11111)\nXMSC_WMQ_QMGR_CCSID : 819\nXMSC_WMQ_SHARE_CONV_ALLOWED : 1\nXMSC_WMQ_CLIENT_RECONNECT_TIMEOUT : 1800\nXMSC_WMQ_MAP_NAME_STYLE : True\nXMSC_PASSWORD : ********\npriority : 4\nXMSC_WMQ_LOCAL_ADDRESS : \nXMSC_WMQ_MAX_BUFFER_SIZE : 1000\nXMSC_WMQ_CONNECT_OPTIONS : 0\nXMSC_DISABLE_MSG_TS : False\nXMSC_WMQ_BROKER_QMGR : \nXMSC_WMQ_CLIENT_RECONNECT_OPTIONS : 16777216\nversion : 7\nXMSC_WMQ_CONNECTION_TAG : System.Byte[]\nencoding : 546\nXMSC_WMQ_POLLING_INTERVAL : 5000\nXMSC_WMQ_RESCAN_INTERVAL : 5000\nXMSC_WMQ_TEMPORARY_MODEL : SYSTEM.DEFAULT.MODEL.QUEUE\nXMSC_WMQ_CHANNEL : MY.SVC.SVRCONN.P\nXMSC_CONNECTION_TYPE : 1\nXMSC_WMQ_SYNCPOINT_ALL_GETS : False\nXMSC_WMQ_HOST_NAME : localhost\nXMSC_WMQ_QUEUE_MANAGER : QM1\nwildcardFormat : 0\nXMSC_WMQ_BROKER_DUR_SUBQ : SYSTEM.JMS.D.SUBSCRIBER.QUEUE\nXMSC_TRANSACTED : True\nXMSC_WMQ_MSG_BATCH_SIZE : 10### Assistant: Automatic Client Reconnection with Distributed Transactions are not supported that is the reason you see|XMSException.LinkedException on (SendTextMessage) sending message to Queue handler ABC:(In ABC.XYZ.REQUEST / Out XYZ.ABC.RESPONSE) / xmse.LinkedException.Message : **2012** / xmse.Message : Failed to send a message to destination XYZ.ABC.RESPONSE.2012 is MQRC_ENVIRONMENT_ERROR.Following link talks about it :https://www.ibm.com/support/knowledgecenter/SSFKSJ_9.1.0/com.ibm.mq.con.doc/q018380_.htm\n"} +{"text": "### Human: I am using MQ Java PCF API to retrieve information from an MQ installation. There are several constructors for the class PCFMessageAgent. There is one that accepts the host, port and channel name. I have shown an extract from the documentation.public PCFMessageAgent(String host,\n int port,\n String channel)\n throws MQException\nInitialises a new PCFMessageAgent with a client connection to a queue manager.The code I have isPCFMessageAgent agent = new PCFMessageAgent(host, port, \"SYSTEM.DEF.SVRCONN\");\n PCFMessage pcfCmd = new PCFMessage(MQConstants.MQCMD_INQUIRE_CHANNEL);\n pcfCmd.addParameter(MQConstants.MQCACH_CHANNEL_NAME, channelName);\n PCFMessage[] pcfResponse = agent.send(pcfCmd);but I get a MQRC_NOT_AUTHORIZED errorException in thread \"main\" com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2035'.\n at com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:249)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnection(MQClientManagedConnectionFactoryJ11.java:450)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnection(MQClientManagedConnectionFactoryJ11.java:487)\n at com.ibm.mq.StoredManagedConnection.(StoredManagedConnection.java:97)\n at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:194)\n at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:868)Why do I get this error? How do I fix this.I found this in the error logs. Any help will be much appreciated.07/08/17 15:42:51 - Process(3294.15) User(user1) Program(amqrmppa)\n Host(ubuntuvm-2) Installation(Installation1)\n VRMF(8.0.0.7) QMgr(QM_FR2_2)\n\nAMQ9777: Channel was blocked\n\nEXPLANATION:\nThe inbound channel 'SYSTEM.DEF.SVRCONN' was blocked from address\n'192.168.56.101' because the active values of the channel matched a record\nconfigured with USERSRC(NOACCESS). The active values of the channel were\n'CLNTUSER(user1)'.\nACTION:\nContact the systems administrator, who should examine the channel\nauthentication records to ensure that the correct settings have been\nconfigured. The ALTER QMGR CHLAUTH switch is used to control whether channel\nauthentication records are used. The command DISPLAY CHLAUTH can be used to\nquery the channel authentication records.\n----- cmqxrmsa.c : 1462 -------------------------------------------------------\n07/08/17 15:42:51 - Process(3294.15) User(user1) Program(amqrmppa)\n Host(ubuntuvm-2) Installation(Installation1)\n VRMF(8.0.0.7) QMgr(QM_FR2_2)\n\nAMQ9999: Channel 'SYSTEM.DEF.SVRCONN' to host '192.168.56.101' ended\nabnormally.\n\nEXPLANATION:\nThe channel program running under process ID 3294 for channel\n'SYSTEM.DEF.SVRCONN' ended abnormally. The host name is '192.168.56.101'; in\nsome cases the host name cannot be determined and so is shown as '????'.\nACTION:\nLook at previous error messages for the channel program in the error logs to\ndetermine the cause of the failure. Note that this message can be excluded\ncompletely or suppressed by tuning the \"ExcludeMessage\" or \"SuppressMessage\"\nattributes under the \"QMErrorLog\" stanza in qm.ini. Further information can be\nfound in the System Administration Guide.\n----- amqrmrsa.c : 930 --------------------------------------------------------### Assistant: The issue is that you are attempting to connect to the channelSYSTEM.DEV.SVRCONN. By default there is aCHLAUTHrule that blocks access to channels namedSYSTEM.*.You can create a newSVRCONNchannel that does not have a name that starts withSYSTEMand it would get past this check.\n"} +{"text": "### Human: I need to write a piece of code to put a message into MQ using C++. When I test it on localhost, using the default port (1414) it works. However, in the actual environment, which uses specific channel definition and different port (1420), it fails with reason code 2058 / MQRC_Q_MGR_NAME_ERROR. \nThere is no problem connecting to the remote MQ using Websphere MQ Explorer. There is also no problem connecting to the same remote server in a C# app to prove connectivity. Any ideas what could be causing it?Some sample code extract: C++ which fails when.connect()is called...ImqChannel * pChannel_ = 0; // Channel definition which is at class level\nImqQueueManager queueManager_; // Queue Manager, also declared at class level\n\n\n// extract from the MQHelper::Connect() method... \nint MQClient::Connect() {\n pChannel_ = new ImqChannel;\n pChannel_->setChannelName(\"CLCHL.QM\");\n pChannel_->setTransportType(MQXPT_TCP);\n pChannel_->setConnectionName(\"10.2.3.4(1420)\");\n // Should we set this???! pChannel_->setModeName(\"to what?\");\n\n queueManager_.setName(\"QM\");\n queueManager_.setChannelReference(pChannel_);\n\n if (!queueManager_.connect()) {\n // ERROR IS HERE: _lastCompletionCode is 2, _lastReasonCode is 2058\n _lastCompletionCode = queueManager_.completionCode();\n _lastReasonCode = queueManager_.reasonCode();\n return (int)_lastReasonCode;\n }\n // If we get here, we're all good:\n return 0;\n}In C#, there is no such problem: the following code will connect fine..queueManager = new MQQueueManager(\"QM\", \"CLCHL.QM\", \"10.2.3.4(1420)\");Other info:Server MQ installation is 7.0.1.0 Websphere MQ Explorer version:7.5.0.1 (no problem connecting here) In the C# app, I am only referencing amqmdnet.dll... all fine.In the C++ app, I have the external dependencies set up for the 26 various mq .h or .hpp files.Also I have included the appropriate libs etc... again - I know it is\ncapable of working as it the same code will work pointing to a\nlocalhost queue manager.I am using VS 2017Any ideas?### Assistant: ImqChannel * pChannel_ = 0; // Channel definition which is at class level\nImqQueueManager queueManager_; // Queue Manager, also declared at class levelWhat's with the extra underscore in the variable names?queueManager_.setName(\"QM\");Is that the ACTUAL queue manager name of the remote queue manager? It needs to be the correct value. Note: MQ is case sensitive. ie. \"QM\" is not the same as \"qm\".Each queue manager's listener listens on a different port.pChannel_->setConnectionName(\"10.2.3.4(1420)\");Are you sure queue manager \"QM\" is actually listening on port 1420 and not 1414 or 1419 or 1421 etc..\n"} +{"text": "### Human: I am publishing JMS text message to topic and consumer is able to consumer ( MDB ) the text message. But not able to get Message Object and String property. it is null in MDB consumer side. I have defined MDB in ejb-jar.xml under META-INF folder. I am usingTomEE plus 7.0.2 \nJMS 2.0 \nIBM MQ 8 \nJDK 1.8 \nTopicI refereed below mentioned Tomee official example. In example they used tomee.xml instead i used resource.xml and don't use web.xmlConsumer is MessageDrivenBeanConsumer is able to get Text or Object Message. But Message property is null.http://tomee.apache.org/tomee-and-webspheremq.html@Resource(name = \"qcf\") \n private ConnectionFactory connectionFactory; \n @Resource(name = \"wmq-javax.jms.Topic\") \n private Topic topic; \n Connection connection = connectionFactory.createConnection(); \n Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); \n MessageProducer producer = session.createProducer(topic); \n TextMessage message = session.createTextMessage(); \n message.setText(\"Test Message\"); \n message.setObjectProperty(\"a\",\"b\"); \n message.setStringProperty(\"c\",\"D\"); \n connection.start(); \n producer.send(message); \n session.close(); \n connection.close();Consumer\n\n SampleTransactionMDB\n \n \n SampleTransactionMDB\n SampleTransactionMDB\n com.example.SampleTransactionMDB\n Container\n \n \n destinationType\n javax.jms.Queue\n \n \n destination\n openejb:Resource/projectname/topicname\n \n \n\n \n useJNDI\n true\n \n\n \n HostName\n x.x.x.x\n \n\n \n Port\n 123\n \n \n QueueManager\n xxxxx\n \n \n Channel\n xxxx\n \n \n TransportType\n CLIENT\n \n \n subscriptionName\n xxxxxx\n \n \n sharedSubscription\n true\n \n\n\n \n \n \n \nGuide me why message property is null in MDB consumer.### Assistant: I found the root cause of the problem. it is my mistake. TopicProxy'stargetClientshould beJMS. I wrongly configured as MQ. so I was able to get message but not property.After changing targetClient value to JMS. I am able to get message and propertyhttp://tomee.apache.org/tomee-and-webspheremq.html\n"} +{"text": "### Human: Could any one let me know how can we check if we havevalid licenses for IBM MQ.Need to check it in LINUX, AIX and SunOS.### Assistant: The IBM Technote \"Upgrade the MQ trial version to a production version\" states the following:Verify that the new license was applied by checking that the correct\n license file (amqpcert.lic) is in the /opt/mqm/lib.The license is named amqXcert.lic, where X is the license type.amqtcert.lic - is a trial licenseamqbcert.lic - is a beta licenseamqpcert.lic - is a full production licenseThe IBM MQ v7.1 Knowledge center page \"Converting a trial license on UNIX, Linux, and Windows\" states the following:Obtain the full license from the fully licensed installation media.Based on the above statements if you have the fileamqpcert.licin the lib directory of the IBM MQ installation it only indicates your software was installed from fully licensed installation media or was upgraded from a trial or beta license to a full production license using fully licensed installation media.The presence of this file however doesnotindicate you have a valid license. A valid license would be based on what you have purchased. If you purchased a license for one server and then used that installation media to install IBM MQ on 100 servers, the license file would be present on all the servers but you would only have a valid license for one server.The following discussion on the MQSERIES Listserv has some good information on distributed licensing \"Re: License cost MQ - any overview?\".\n"} +{"text": "### Human: I'm Getting errorAMQ8101: WebSphere MQ error (10806228) has occurredwhen trying to start the command server inMQ.TheMQversion which we are using is7.1.0.6and the environment isSunOS.Please need your suggestions.Below is the FDC file created:+-----------------------------------------------------------------------------+\n| |\n| WebSphere MQ First Failure Symptom Report |\n| ========================================= |\n| |\n| Date/Time :- Sun July 09 2017 15:15:37 MEST |\n| UTC Time :- 1499606137.840536 |\n| UTC Time Offset :- 120 (MET) |\n| Host Name :- abcd |\n| Operating System :- SunOS 5.10 |\n| PIDS :- 5724H7223 |\n| LVLS :- 7.1.0.6 |\n| Product Long Name :- WebSphere MQ for Solaris (SPARC platform) |\n| Vendor :- IBM |\n| Installation Path :- /opt/mqm |\n| Installation Name :- Installation1 (1) |\n| Probe Id :- ZT160001 |\n| Application Name :- MQM |\n| Component :- zusStartManager |\n| SCCS Info :- lib/zu/amqzupt0.c, 1.54.1.2 |\n| Line Number :- 1887 |\n| Build Date :- Nov 14 2014 |\n| CMVC level :- p710-006-141112 |\n| Build Type :- IKAP - (Production) |\n| Effective UserID :- 325 (mqm) |\n| Real UserID :- 0 (root) |\n| ProjectID :- 0 |\n| Program Name :- strmqcsv |\n| Arguments :- QM.XYZ. |\n| Addressing mode :- 64-bit |\n| LANG :- |\n| Process :- 9398 |\n| Thread :- 1 |\n| QueueManager :- QM.XYZ |\n| UserApp :- FALSE |\n| ConnId(1) IPCC :- 280898 |\n| ConnId(3) QM-P :- 72653 |\n| Last HQC :- 3.0.0-18240 |\n| Last HSHMEMB :- 1.0.0-4454576 |\n| Major Errorcode :- xecX_W_DAEMON_UNAVAILABLE |\n| Minor Errorcode :- OK |\n| Probe Type :- INCORROUT |\n| Probe Severity :- 3 |\n| Probe Description :- AMQ6125: An internal WebSphere MQ error has occurred. |\n| FDCSequenceNumber :- 0 |\n| Arith1 :- 9495 (0x2517) |\n| Arith2 :- 50 (0x32) |\n| Comment1 :- Timed-out waiting for process manager to start. |\n| |\n+-----------------------------------------------------------------------------+### Assistant: I'll start off by mentioning that IBM MQ v7.1 went out of support on April 30th 2017. I would recommend that you move to a supported level of IBM MQ. Keep in mind that IBM MQ v7.5 goes out of support on April 30th 2018. Dates have not been announced for v8 or v9 yet, but IBM commits to at least 5 years of support which would give them support until at least June 2019 for v8 and June 2021 for v9.The IBM MQ Technote \"Common WebSphere MQ messages and most likely causes\" indicates a FDC may be created in /var/mqm/errors when a AMQ8101 is returned. If a FDC is created can you please edit your question and add the top portion of the FDC file?If you run mqrc against that error code as a hex error code it comes back with the following:$ mqrc 0x10806228\n\n 276849192 0x10806228 xecX_W_DAEMON_UNAVAILABLEIBM has stated to me in past PMRs that IBM MQ \"... traditionally dumps out the hex value for return codes that it does not know about. When this happens then it normally means we have hit an error path that we didn't expect and so we should try to fix this by adding a new message.\"In APAR IT16270 they described a different unexpected error being returned as \"a coding error resulted in an internal undocumented error code ... being returned to the application.\"Based on this if it reproducible in a supported version of IBM MQ or if you have a extended support contract for v7.1 I would suggest opening a PMR with IBM to troubleshoot the issue.UPDATE 2017-07-10Based on the FDC indicatingTimed-out waiting for process manager to startand further information from the OP that a restart of the queue manager solved the problem, I believe theamqzmur0process was hung and not responding, this is the \"Restartable process manager\". Restarting the queue manager would have restarted this process.\n"} +{"text": "### Human: Is there any way to get IBM WebSphere MQ version and patch level, both client and manager side? I am looking for the same data that is shown by dspmqver but through the C/C++ API.### Assistant: You callMQINQ, passing the Queue Manager handle, with the selectors forMQIA_COMMAND_LEVELandVersionis an attribute of theMQCFSTstructure.https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_7.5.0/com.ibm.mq.ref.dev.doc/q101840_.htm\n"} +{"text": "### Human: I am trying to connect to IBM MQ using a Java client.I have setup the necessary keydatabase,keystore and truststore files following the below tutorial.https://qadeer786.wordpress.com/2013/10/08/using-ssl-support-for-java-clients-websphere-mq/When I run the Java client it gives me the following error.com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2397'.\n at com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:249)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnection(MQClientManagedConnectionFactoryJ11.java:450)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnection(MQClientManagedConnectionFactoryJ11.java:487)\n at com.ibm.mq.StoredManagedConnection.(StoredManagedConnection.java:97)\n at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:194)\n at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:868)\n at com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:816)\n at com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:758)\n at com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:200)\n at com.ibm.mq.MQQueueManager.(MQQueueManager.java:682)\n at esb.wso2.org.client.MQConnectionBuilder.(MQConnectionBuilder.java:52)\n at esb.wso2.org.client.MQConnectionBuilder.getInstance(MQConnectionBuilder.java:60)\n at esb.wso2.org.client.MQProducer.(MQProducer.java:20)\n at esb.wso2.org.client.MQClient.main(MQClient.java:7)\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2397;AMQ9204: Connection to host '127.0.0.1(1414)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2397;AMQ9771: SSL handshake failed. [1=javax.net.ssl.SSLHandshakeException[Remote host closed connection during handshake],3=localhost/127.0.0.1:1414 (localhost),4=SSLSocket.startHandshake,5=default]],3=127.0.0.1(1414),5=RemoteTCPConnection.protocolConnect]\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:2282)\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1294)\n at com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.jmqiConnect(InterceptedJmqiImpl.java:376)\n at com.ibm.mq.ese.jmqi.ESEJMQI.jmqiConnect(ESEJMQI.java:560)\n at com.ibm.mq.MQSESSION.MQCONNX_j(MQSESSION.java:916)\n at com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:235)\n ... 13 more\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2397;AMQ9771: SSL handshake failed. [1=javax.net.ssl.SSLHandshakeException[Remote host closed connection during handshake],3=localhost/127.0.0.1:1414 (localhost),4=SSLSocket.startHandshake,5=default]\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:1329)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnection.connect(RemoteConnection.java:863)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSessionFromNewConnection(RemoteConnectionSpecification.java:409)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSession(RemoteConnectionSpecification.java:305)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionPool.getSession(RemoteConnectionPool.java:146)\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1730)\n ... 18 more\nCaused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake\n at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:992)\n at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)\n at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)\n at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection$6.run(RemoteTCPConnection.java:1298)\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection$6.run(RemoteTCPConnection.java:1290)\n at java.security.AccessController.doPrivileged(Native Method)\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:1290)\n ... 23 more\nCaused by: java.io.EOFException: SSL peer shut down incorrectly\n at sun.security.ssl.InputRecord.read(InputRecord.java:505)\n at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)\n ... 30 more\ncom.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2397'.\n at com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:249)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnection(MQClientManagedConnectionFactoryJ11.java:450)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnection(MQClientManagedConnectionFactoryJ11.java:487)\n at com.ibm.mq.StoredManagedConnection.(StoredManagedConnection.java:97)\n at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:194)\n at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:868)\n at com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:816)\n at com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:758)\n at com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:200)\n at com.ibm.mq.MQQueueManager.(MQQueueManager.java:682)\n at esb.wso2.org.client.MQConnectionBuilder.getQueueManager(MQConnectionBuilder.java:68)\n at esb.wso2.org.client.MQProducer.(MQProducer.java:22)\n at esb.wso2.org.client.MQClient.main(MQClient.java:7)\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2397;AMQ9204: Connection to host '127.0.0.1(1414)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2397;AMQ9771: SSL handshake failed. [1=javax.net.ssl.SSLHandshakeException[Remote host closed connection during handshake],3=localhost/127.0.0.1:1414 (localhost),4=SSLSocket.startHandshake,5=default]],3=127.0.0.1(1414),5=RemoteTCPConnection.protocolConnect]\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:2282)\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1294)\n at com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.jmqiConnect(InterceptedJmqiImpl.java:376)\n at com.ibm.mq.ese.jmqi.ESEJMQI.jmqiConnect(ESEJMQI.java:560)\n at com.ibm.mq.MQSESSION.MQCONNX_j(MQSESSION.java:916)\n at com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:235)\n ... 12 more\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2397;AMQ9771: SSL handshake failed. [1=javax.net.ssl.SSLHandshakeException[Remote host closed connection during handshake],3=localhost/127.0.0.1:1414 (localhost),4=SSLSocket.startHandshake,5=default]\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:1329)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnection.connect(RemoteConnection.java:863)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSessionFromNewConnection(RemoteConnectionSpecification.java:409)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSession(RemoteConnectionSpecification.java:305)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionPool.getSession(RemoteConnectionPool.java:146)\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1730)\n ... 17 more\nCaused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake\n at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:992)\n at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)\n at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)\n at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection$6.run(RemoteTCPConnection.java:1298)\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection$6.run(RemoteTCPConnection.java:1290)\n at java.security.AccessController.doPrivileged(Native Method)\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:1290)\n ... 22 more\nCaused by: java.io.EOFException: SSL peer shut down incorrectly\n at sun.security.ssl.InputRecord.read(InputRecord.java:505)\n at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)\n ... 29 moreBelow you get the queue manager (qmanager) log file.2017-06-24 11:31:11 - Process(25266.5) User(root) Program(amqrmppa)\n Host(hasitha-HP-Pavilion-g6-Notebook-PC) Installation(Installation1)\n VRMF(8.0.0.4) QMgr(qmanager)\n\nAMQ9660: SSL key repository: password stash file absent or unusable.\n\nEXPLANATION:\n\nThe SSL key repository cannot be used because MQ cannot obtain a password to access\n it. Reasons giving rise to this error include: \n\n(a) the key database file and password stash file are not present in the\n location configured for the key repository, \n\n(b) the key database file exists in the correct place but that no password\n stash file has been created for it, \n\n(c) the files are present in the correct place but the userid under which MQ is\n running does not have permission to read them, \n\n(d) one or both of the files are corrupt. \n\n\nThe channel is '????'; in some cases its name cannot be determined and so is\nshown as '????'. The channel did not start.\nACTION:\nEnsure that the key repository variable is set to where the key database file\nis. Ensure that a password stash file has been associated with the key database\nfile in the same directory, and that the userid under which MQ is running has\nread access to both files. If both are already present and readable in the\ncorrect place, delete and recreate them. Restart the channel.\n----- amqccisa.c : 6283 -------------------------------------------------------\n2017-06-24 11:31:11 - Process(25266.5) User(root) Program(amqrmppa)\n Host(hasitha-HP-Pavilion-g6-Notebook-PC) Installation(Installation1)\n VRMF(8.0.0.4) QMgr(qmanager)\n\nAMQ9999: Channel '????' to host 'localhost (127.0.0.1)' ended abnormally.\n\nEXPLANATION:\nThe channel program running under process ID 25266 for channel '????' ended\nabnormally. The host name is 'localhost (127.0.0.1)'; in some cases the host\nname cannot be determined and so is shown as '????'.\nACTION:\nLook at previous error messages for the channel program in the error logs to\ndetermine the cause of the failure. Note that this message can be excluded\ncompletely or suppressed by tuning the \"ExcludeMessage\" or \"SuppressMessage\"\nattributes under the \"QMErrorLog\" stanza in qm.ini. Further information can be\nfound in the System Administration Guide.\n----- amqrmrsa.c : 930 --------------------------------------------------------\n2017-06-24 11:33:54 - Process(25266.6) User(root) Program(amqrmppa)\n Host(hasitha-HP-Pavilion-g6-Notebook-PC) Installation(Installation1)\n VRMF(8.0.0.4) QMgr(qmanager)\n\nAMQ9660: SSL key repository: password stash file absent or unusable.\n\nEXPLANATION:\nThe SSL key repository cannot be used because MQ cannot obtain a password to\naccess it. Reasons giving rise to this error include: \n(a) the key database file and password stash file are not present in the\n location configured for the key repository, \n(b) the key database file exists in the correct place but that no password\n stash file has been created for it, \n(c) the files are present in the correct place but the userid under which MQ is\n running does not have permission to read them, \n(d) one or both of the files are corrupt. \n\nThe channel is '????'; in some cases its name cannot be determined and so is\nshown as '????'. The channel did not start.\nACTION:\nEnsure that the key repository variable is set to where the key database file\nis. Ensure that a password stash file has been associated with the key database\nfile in the same directory, and that the userid under which MQ is running has\nread access to both files. If both are already present and readable in the\ncorrect place, delete and recreate them. Restart the channel.\n----- amqccisa.c : 6283 -------------------------------------------------------\n2017-06-24 11:33:54 - Process(25266.6) User(root) Program(amqrmppa)\n Host(hasitha-HP-Pavilion-g6-Notebook-PC) Installation(Installation1)\n VRMF(8.0.0.4) QMgr(qmanager)\n\nAMQ9999: Channel '????' to host 'localhost (127.0.0.1)' ended abnormally.\n\nEXPLANATION:\nThe channel program running under process ID 25266 for channel '????' ended\nabnormally. The host name is 'localhost (127.0.0.1)'; in some cases the host\nname cannot be determined and so is shown as '????'.\nACTION:\nLook at previous error messages for the channel program in the error logs to\ndetermine the cause of the failure. Note that this message can be excluded\ncompletely or suppressed by tuning the \"ExcludeMessage\" or \"SuppressMessage\"\nattributes under the \"QMErrorLog\" stanza in qm.ini. Further information can be\nfound in the System Administration Guide.\n----- amqrmrsa.c : 930 --------------------------------------------------------\n2017-06-24 11:33:55 - Process(25266.7) User(root) Program(amqrmppa)\n Host(hasitha-HP-Pavilion-g6-Notebook-PC) Installation(Installation1)\n VRMF(8.0.0.4) QMgr(qmanager)\n\nAMQ9660: SSL key repository: password stash file absent or unusable.\n\nEXPLANATION:\nThe SSL key repository cannot be used because MQ cannot obtain a password to\naccess it. Reasons giving rise to this error include: \n(a) the key database file and password stash file are not present in the\n location configured for the key repository, \n(b) the key database file exists in the correct place but that no password\n stash file has been created for it, \n(c) the files are present in the correct place but the userid under which MQ is\n running does not have permission to read them, \n(d) one or both of the files are corrupt. \n\nThe channel is '????'; in some cases its name cannot be determined and so is\nshown as '????'. The channel did not start.\nACTION:\nEnsure that the key repository variable is set to where the key database file\nis. Ensure that a password stash file has been associated with the key database\nfile in the same directory, and that the userid under which MQ is running has\nread access to both files. If both are already present and readable in the\ncorrect place, delete and recreate them. Restart the channel.\n----- amqccisa.c : 6283 -------------------------------------------------------\n2017-06-24 11:33:55 - Process(25266.7) User(root) Program(amqrmppa)\n Host(hasitha-HP-Pavilion-g6-Notebook-PC) Installation(Installation1)\n VRMF(8.0.0.4) QMgr(qmanager)\n\nAMQ9999: Channel '????' to host 'localhost (127.0.0.1)' ended abnormally.\n\nEXPLANATION:\nThe channel program running under process ID 25266 for channel '????' ended\nabnormally. The host name is 'localhost (127.0.0.1)'; in some cases the host\nname cannot be determined and so is shown as '????'.\nACTION:\nLook at previous error messages for the channel program in the error logs to\ndetermine the cause of the failure. Note that this message can be excluded\ncompletely or suppressed by tuning the \"ExcludeMessage\" or \"SuppressMessage\"\nattributes under the \"QMErrorLog\" stanza in qm.ini. Further information can be\nfound in the System Administration Guide.\n----- amqrmrsa.c : 930 --------------------------------------------------------Any ideas on how to resolve this.I have the user group mqm and both root and $USER(hasitha) are users of that group.### Assistant: The tutorial you followed appears to be on Windows, but from your final comment I think you are on a Unix system.You need to check the ownership of the queue manager's key database file.Your queue manager error log hints at this when it says:-(c) the files are present in the correct place but the userid under which MQ is\n running does not have permission to read them,Go into the directory which contains the queue manager key database file, C:\\temp\\ssldemo1\\ in the tutorial, and change the ownership of the four files in there to mqm with the following command:-chown mqm TEST.QM1.*\n"} +{"text": "### Human: I have several camel microservices deployed to tomcat as individual war files. Each war file contains a unique camel route. One of the services accepts soap requests and puts a message onto a queue on IBM MQ. This works without a problem. The services which get these messages don't appear to pull the messages off the queue and forward them on. Each war file has the following as its IBM MQ configuration\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n \n \n\n \n \n An example of one of the camel routes which pulls a message of a queue looks like\n \n \n \n ...\nThe route starts but does not pull messages off the queue.### Assistant: I resolved the truncation issue by doing before sending the message to the queue. I suspect it is because the message is an UTF-8 ecoded xml message.\n"} +{"text": "### Human: I try to get all channel names by connecting to a server connection channel using java api. I set permission to all channels with the following command.setmqaut -m local -t channel -n SYSTEM.** -p test +allThe java code,pcfMessageAgent = new PCFMessageAgent(host, port, channelName);\nPCFMessage request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_CHANNEL);\nrequest.addParameter(CMQCFC.MQCACH_CHANNEL_NAME, \"*\");\ntry {\n queueResponses = pcfMessageAgent.send(request);But I get 2035 error code with the below logs and I am unable seeSYSTEM.DEF.CLNTCONNon explorer and unable to set the permission with the setmqaut command,AMQ8077: Entity 'test@mysystem' has insufficient authority to access\nobject 'SYSTEM.DEF.CLNTCONN'.\n\nEXPLANATION:\nThe specified entity is not authorized to access the required object. The\nfollowing requested permissions are unauthorized: dsp### Assistant: This is becauseCLNTCONNchannels are a different object type, they are of typeclntconn, all other channels types are included in typechannel.If you wanted to provide the same permission you would use:setmqaut -m local -t clntconn -n SYSTEM.** -p test +allSee my answer to your question \"IBM MQ - Permissions - Read perspective\" for more detail on how to set read only permissions.\n"} +{"text": "### Human: I everybody,I'm trying to migrate our MQ interface from IBM-Websphere 7.0.0.5 to version 8.0.0.6. As an EJB container we are using Apache Servicemix 7.0.0. \nWhen switching to the 8.0.0.6 libraries I receive the following error stack:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ibmmq' defined in URL [bundle://231.0:0/META-INF/spring/mq-test.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'com.ibm.mq.jms.MQQueueConnectionFactory' to required type 'javax.jms.ConnectionFactory' for property 'connectionFactory'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.ibm.mq.jms.MQQueueConnectionFactory] to required type [javax.jms.ConnectionFactory] for property 'connectionFactory': no matching editors or conversion strategy found\n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:529)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1]\n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1]\n at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1]\n at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1]\n at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1]\n at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1]\n at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:636)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1]\n at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:938)[150:org.apache.servicemix.bundles.spring-context:3.2.17.RELEASE_1]\n at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)[217:org.springframework.osgi.core:1.2.1]\n at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)[217:org.springframework.osgi.core:1.2.1]\n at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)[217:org.springframework.osgi.core:1.2.1]\n at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)[217:org.springframework.osgi.core:1.2.1]\n at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)[218:org.springframework.osgi.extender:1.2.1]\n at java.lang.Thread.run(Thread.java:745)[:1.8.0_102]\nCaused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'com.ibm.mq.jms.MQQueueConnectionFactory' to required type 'javax.jms.ConnectionFactory' for property 'connectionFactory'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.ibm.mq.jms.MQQueueConnectionFactory] to required type [javax.jms.ConnectionFactory] for property 'connectionFactory': no matching editors or conversion strategy found\n at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:464)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1]\n at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:495)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1]\n at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:489)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1]\n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1465)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1]\n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1424)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1]\n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1160)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1]\n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1]\n ... 13 more\nCaused by: java.lang.IllegalStateException: Cannot convert value of type [com.ibm.mq.jms.MQQueueConnectionFactory] to required type [javax.jms.ConnectionFactory] for property 'connectionFactory': no matching editors or conversion strategy found\n at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:267)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1]\n at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:449)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1]\n ... 19 moreThe following line is strange for me, and I have no conclusion for it:Failed to convert property value of type 'com.ibm.mq.jms.MQQueueConnectionFactory' to required type 'javax.jms.ConnectionFactory' for property 'connectionFactory'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.ibm.mq.jms.MQQueueConnectionFactory] to required type [javax.jms.ConnectionFactory] for property 'connectionFactory': no matching editors or conversion strategy foundTo install the the features, I used the following features-xml file:\n \n file:o:/tools/IBM/Websphere MQ 75/java/lib/OSGi/com.ibm.mq.osgi.directip_7.5.0.0.jar\n file:o:/tools/IBM/Websphere MQ 75/java/lib/OSGi/com.ibm.mq.osgi.java_7.5.0.0.jar\n file:o:/tools/IBM/Websphere MQ 75/java/lib/OSGi/com.ibm.msg.client.osgi.commonservices.j2se_7.5.0.0.jar\n file:o:/tools/IBM/Websphere MQ 75/java/lib/OSGi/com.ibm.msg.client.osgi.jms_7.5.0.0.jar\n file:o:/tools/IBM/Websphere MQ 75/java/lib/OSGi/com.ibm.msg.client.osgi.nls_7.5.0.0.jar\n file:o:/tools/IBM/Websphere MQ 75/java/lib/OSGi/com.ibm.msg.client.osgi.wmq.nls_7.5.0.0.jar\n file:o:/tools/IBM/Websphere MQ 75/java/lib/OSGi/com.ibm.msg.client.osgi.wmq.prereq_7.5.0.0.jar\n file:o:/tools/IBM/Websphere MQ 75/java/lib/OSGi/com.ibm.msg.client.osgi.wmq_7.5.0.0.jar \n \n\n \n file:o:/tools/IBM/Websphere MQ 80/java/lib/OSGi/com.ibm.mq.osgi.java_8.0.0.6.jar\n file:o:/tools/IBM/Websphere MQ 80/java/lib/OSGi/com.ibm.msg.client.osgi.commonservices.j2se_8.0.0.6.jar\n file:o:/tools/IBM/Websphere MQ 80/java/lib/OSGi/com.ibm.msg.client.osgi.jms.prereq_8.0.0.6.jar\n file:o:/tools/IBM/Websphere MQ 80/java/lib/OSGi/com.ibm.msg.client.osgi.jms_8.0.0.6.jar\n file:o:/tools/IBM/Websphere MQ 80/java/lib/OSGi/com.ibm.msg.client.osgi.nls_8.0.0.6.jar\n file:o:/tools/IBM/Websphere MQ 80/java/lib/OSGi/com.ibm.msg.client.osgi.wmq.nls_8.0.0.6.jar\n file:o:/tools/IBM/Websphere MQ 80/java/lib/OSGi/com.ibm.msg.client.osgi.wmq.prereq_8.0.0.6.jar \n file:o:/tools/IBM/Websphere MQ 80/java/lib/OSGi/com.ibm.msg.client.osgi.wmq_8.0.0.6.jar\n \nThe example route looks like followed:\n\n\n \n\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n\n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n\nAs described before, using feature:ibm-mq-75everything is wokring, changeing this toibm-mq-80displays the error.\nCan anybody help?Thanks, \nJ\u00f6rg### Assistant: Performing the following steps seem to solve my issue:switching mq-package from camel-jms to camel-sjmsforcing servicemix to clean the cache on each startup.\n"} +{"text": "### Human: I used the Spring JMS cachingconnectionfactory to improve the performance of the my application based on Spring Integration and IBM MQ. I put sessioncachesize as 10 as we have the max of 10 concurrent threads working (ThreadPoolTaskExecutor) on consume/sending messages.When I looked at the number of connections opened in MQ explorer (open output count for queue), it shows 10 and it stays on for days and never getting closed.Is there a way to programatically to detect connections which are\npotentially stale - say idle for half a day - I checked the\nresetConnection() but not sure how to get the last used time for the\nsession.Does Spring provides any connection time out parameter for\ncacheconnection factory? or How to release these idle connections?Also, the heartbeat/keepalive mechanism will not work for us as we want to physical close the cached connections based on last used time.### Assistant: If the timeout is a property of theSessionobject returned by IBM, you could subclass the connection factory, overridecreateSession(); callsuper.createSession(...)then set the property before returning it.You might also have to overridegetSession(...)and keep calling it until you a get a session that is not closed. I don't see any logic to check the session state in the standard factory. (getSession()callscreateSession()when the cache is empty).\n"} +{"text": "### Human: I am currently working on a project to set up spring cachedConnectionFactory sessionCahceSize, please provide answers as to why a sessionCacheSize of 1 (for 3 destinations) registers 1+ (around 3) JMS cached message producers per destination?The application is running in transacted mode with concurrent thread size as 1Should I have to look into the strategy of identifying the idle cached producers and evicting the cached producers for optimization?### Assistant: You don't show the thread names in your trace, which makes it harder to debug. However...The producer/consumer cache is at theSessionlevel. If you are sending messages on multiple threads you can end up with a cached producer for each cached session.Thread 1 checks out a session does a send (caching a new producer); checks the session back in.Thread 2 checks out the same session; does a send (using the cached producer).Thread 1 checks out a different session (because the first one is in use); does a send (caching a new producer for that dest/session).Thread 2 checks in the sessionsessionCacheSize of 3 (for 3 destinations)It doesn't work that way; sessions are not tied to destinations; they are general sessions that will cache a producer for each destination it is used for.\n"} +{"text": "### Human: Queue is not able to accept message greater than 4 MB even though MAXMSGL set to 100 MB on the Queue Manager, Queue, DLQ, SVRCONN and CLNTCONN and provided updated channel tab to application team. This didn't resolved the issue (restarted queue manager as well).Application team is posting the messages using service/job.Whereas same job is able to connect and post 4+ MB of message to different queue manager running on different server.MQ Client Version: 7.5.0.2\nMQ Server Version: 7.5.0.3I tried to post 4+ MB message to the queue using RFHUtil it is successful. But somehow it is failing to send message from application/job.### Assistant: Issue found once we enabled trace on the client machine. It is observed application is using old channel tab even though entries in environment variables referring to new channel tab. \nRestarted MQ Client machine and tested flow by enabling trace and this time it worked as expected and application/job able to post the message greater than 4 MB.\n"} +{"text": "### Human: I was using Java 6 to connect to IBM MQ. In Java 6 as SSL V3 is not disable we are able to connect to IBM MQ.Now I want to migrate to Java 8 where SSL V3 is in the list of disabled algorithms. which gives me an error\"WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2397' ('MQRC_JSSE_ERROR')\".If I remove the SSL V3 from the list of disabled algorithms it works but I do not want to do that. I want TLS to be supported when connecting to IBM MQ.\nAny help is appreciated.### Assistant: Please see [1]. You will have to generate the appropriate keys in your keystore/truststore for the desired cipher. You will have to change the desired cipher in your code. From an MDBs activation spec:@ActivationConfigProperty(propertyName = \"sslCipherSuite\", propertyValue = \"SSL_RSA_WITH_3DES_EDE_CBC_SHA\"),In some configuration for your IBM artifacts, you will have \"sslCipherSuite\". This needs to be set accordingly.[1]https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_8.0.0/com.ibm.mq.dev.doc/q113220_.htm\n"} +{"text": "### Human: I am facing issue while publishing messages to the IBM Websphere MQ Queue via PublishJMS processor.Configuration of PublishJMS processor & JMS Controller Service, I have verified there is no problem with the MQ connection. I believe there is some additional property I need to set in either the PublishJMS or Controller Service.Below is the error message stack.Caused by: com.ibm.msg.client.jms.DetailedMessageFormatException: JMSCC0051: The property 'JMS_IBM_MsgType' should be set using type 'java.lang.Integer', not 'java.lang.String'.\n at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_102]\n at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_102]\n at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_102]\n at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_102]\n at com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:314) ~[na:na]\n at com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:228) ~[na:na]\n at com.ibm.msg.client.jms.internal.JmsErrorUtils.createException(JmsErrorUtils.java:104) ~[na:na]\n at com.ibm.msg.client.jms.internal.JmsMessageImpl.checkSettablePropertyName(JmsMessageImpl.java:2197) ~[na:na]\n at com.ibm.msg.client.jms.internal.JmsMessageImpl.setStringProperty(JmsMessageImpl.java:1690) ~[na:na]\n at com.ibm.jms.JMSMessage.setStringProperty(JMSMessage.java:1491) ~[na:na]\n at org.apache.nifi.jms.processors.JMSPublisher$1.createMessage(JMSPublisher.java:87) ~[nifi-jms-processors-1.1.0.2.1.2.0-10.jar:1.1.0.2.1.2.0-10]\n at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:603) ~[spring-jms-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at org.springframework.jms.core.JmsTemplate$4.doInJms(JmsTemplate.java:584) ~[spring-jms-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:494) ~[spring-jms-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n ... 17 common frames omitted### Assistant: It looks like you are hitting a known defect: APARIT02814(JMSCC0051: THE PROPERTY 'JMS_IBM_REPORT_PASS_CORREL_ID' SHOULD SET USING TYPE 'JAVA.LANG.INTEGER', NOT 'JAVA.LANG.STRING'.)It states that pre-v7.0 IBM MQ Classes for JMS allowed passing a non-INT, v7.0 and higher are more strict. IBM has added a fix to v7.5.0.5 and to v8.0.0.2 to allow this to continue to work, the APAR also has suggestions on how to change the application to work without the fix.\n"} +{"text": "### Human: As per our configuration, we have WAS version is 8.5.5.11, IBM MQ version 7.5.0.3. We are using 2 channels to connect to WMQ, one with MAXINST set to 250 and one with 500. SHARECNV is set to 10 for both. Now we have an upper limit of making maximum 2000 connections in a queue manager but we end up crossing that limit after 3-4 days of continuous running of WAS Server.\nAfter doing some analysis we can see that at any point of time we have only 120-160 active connections. DIS CONN command gives shows a lot of connections with OBJNAME, OBJTYPE empty and ASTATE \"NONE\". Even these connections are made from our WAS Server IP but it seems they are not created by queues as OBJTYPE is not Queue for these connections. These connections keep on growing over a period of time and ultimately we reach our limit of 2000 connections.Can somebody help in identifying why these connections are getting created and make sure they get closed like normal idle connections.\nThis is how connection are made and closed in the application: We have an abstrack bean class which is extended by all MDB's.@MessageDriven(activationConfig = {\n@ActivationConfigProperty(propertyName = \"acknowledgeMode\", propertyValue = \"Auto-acknowledge\"),\n@ActivationConfigProperty(propertyName = \"destinationType\", propertyValue = \"javax.jms.Queue\") })\npublic class TrackBeanV2 extends AbstractServiceBean implements MessageListener {//code}The abstrack bean handles creation and closing of connections in following manner:public abstract class AbstractServiceBean {\n@Resource(name = \"myQCF\", type = QueueConnectionFactory.class, shareable = true, description = \"Reply Connection Factory\")\nprivate ConnectionFactory replyCF; \n\n@PostConstruct\nprivate void postConstruct() {\n replyConnection = replyCF.createConnection();\n\n} catch (JMSException e) {\n throw new RuntimeException(\"Failed to create JMS Connection\");\n}\n\n}\n@PreDestroy\nprivate void preDestroy() {\ntry {\n replyConnection.close();\n} catch (JMSException e) {\n throw new RuntimeException(\"Failed to close JMS connection\", e);\n}\n}\n\nprivate void sendResponseMessage(String outputMessageText, String jmsMessageID , Destination replyDestination) {\nTextMessage replyMessage = null;\ntry { \n createSession(); \n createProducer();\n replyMessage = createReplyMessage(outputMessageText , jmsMessageID); \n sendReply(replyMessage, replyDestination); \n closeProducer();\n closeSession();\n} catch (JMSException exp) {\n handleException(exp);\n}\n}\nprivate void createSession() throws JMSException{\nreplySession = replyConnection.createSession(true, 0); \n}`\nprivate void createProducer() throws JMSException{ \nreplyProducer = replySession.createProducer(null); \n}\n\nprivate void closeSession() throws JMSException {\nif (replySession != null) {\n replySession.close();\n}\n}\n\nprivate void closeProducer() throws JMSException{\nif (replyProducer != null) { \n replyProducer.close(); \n}\n} \nprivate void sendReply(TextMessage replyMessage, Destination replyDestination) throws JMSException { \nlogMessages(replyMessage.getText(), \"RESPONSE MESSAGE\");\nreplyProducer.send(replyDestination, replyMessage);\n}An output of below commandecho \"DIS CONN(*) TYPE(*) CONNAME CHANNEL OBJNAME OBJTYPE\" | mqsc -e -m QPDC1GC2 -p width=1000 | grep -o '^\\w\\+:\\|\\w\\+[(][^)]\\+[)]' | awk -F '[()]' -v OFS=\",\" 'function printValues() { if (\"CHANNEL\" in p) { print p[\"CHANNEL\"], p[\"CURSHCNV\"], p[\"CONNAME\"],p[\"CHSTADA\"],p[\"CHSTATI\"],p[\"LSTMSGDA\"],p[\"LSTMSGTI\"],p[\"OBJNAME\"],p[\"OBJTYPE\"],p[\"ASTATE\"],p[\"APPLDESC\"],p[\"APPLTAG\"] } } /^\\w+:/ { printValues(); delete p; next } { p[$1] = $2 } END { printValues() }' | grep MYCHANNELlooks like thisA.QMGR1.MYCHANNEL,,10.217.278.15,,,,,VALIDATE_GET_01,QUEUE,ACTIVE,WebSphere MQ Channel,WebSphere MQ Client for Java\nA.QMGR1.MYCHANNEL,,10.217.278.15,,,,,,,NONE,WebSphere MQ Channel,WebSphere MQ Client for Java\nA.QMGR1.MYCHANNEL,,10.217.278.15,,,,,,,NONE,WebSphere MQ Channel,WebSphere MQ Client for Java\nA.QMGR1.MYCHANNEL,,10.217.278.15,,,,,,,NONE,WebSphere MQ Channel,WebSphere MQ Client for Java\nA.QMGR1.MYCHANNEL,,10.217.278.15,,,,,,,NONE,WebSphere MQ Channel,WebSphere MQ Client for Java\nA.QMGR1.MYCHANNEL,,10.217.278.15,,,,,,,NONE,WebSphere MQ Channel,WebSphere MQ Client for Java\nA.QMGR1.MYCHANNEL,,10.217.278.15,,,,,VALIDATE_GET_01,QUEUE,ACTIVE,WebSphere MQ Channel,WebSphere MQ Client for Java\nA.QMGR1.MYCHANNEL,,10.217.278.15,,,,,GETDETAILSGET_01,QUEUE,NONE,WebSphere MQ Channel,WebSphere MQ Client for JavaThis is Config in qm.ini.Channels:\nMaxChannels=2000\nMaxActiveChannels=2000Output of the command provided in the comments:\"841DD95801B5DC20\",\"A.QMGR1.MYCHANNEL\",\"10.217.278.15\",\"GETDETAILSGET_01\",\"QUEUE\",\"ACTIVE\",\"WebSphere MQ Channel\",\"WebSphere MQ Client for Java\",\"MQOO_INPUT_SHARED,MQOO_BROWSE,MQOO_INQUIRE,MQOO_SAVE_ALL_CONTEXT,MQOO_FAIL_IF_QUIESCING\"\n \"841DD958AB2CF820\",\"A.QMGR1.MYCHANNEL\",\"10.217.278.15\",\"GETDETAILSGET_01\",\"QUEUE\",\"NONE\",\"WebSphere MQ Channel\",\"WebSphere MQ Client for Java\",\"MQOO_INPUT_SHARED,MQOO_INQUIRE,MQOO_SAVE_ALL_CONTEXT,MQOO_FAIL_IF_QUIESCING,MQOO_NO_READ_AHEAD\"### Assistant: The symptoms point to your application connections not getting closed properly. I have a IBM MQ administrator background not a Java development background, but based on what you have posted so far it appears to me that you are attempting to close the connections properly. Hopefully someone with more IBM MQ classes for JMS development background can take a look. @Roger?The following script will display the number of channel instances for a specific channel name. It will also show the total shared conversations across that channel's instances, the number of unique CONNs, and the total number of objects opened by the CONNs including CONNs with no objects open. Note that when a IBM MQ client process connects to the queue manager a unique CONN to the queue manager will be created, if the process opens a object such as the queue manager, a queue, or a topic, DIS CONN will display those open objects as well.This may help to observer the increase in these numbers over time to help you understand the connection/channel leak you are experiencing.Example output:./mq-info.ksh MQ.CHANNEL.NAME QMGR.NAME\nTotal Number of channel instances: 53\nTotal shared conversations: 94\nUnique CONNs: 94\nObjects opened by CONNs:\n 15 \"\"\n 45 \"QMGR\"\n 120 \"QUEUE\"Note that if the channel is configured with SHARECNV of at least 1, the value ofTotal shared conversationsandUnique CONNsshould always match.In the example output 15 of the shared conversations have no objects open. The remaining 70 shared conversations have the queue manager itself open 45 times and queue objects open 120 times.mq-info.ksh is below:#!/bin/ksh\n\nCHL=${1}\nQMGR=${2}\necho \"Total Number of channel instances: $(echo \"DIS CHS(${CHL}) ALL\"|runmqsc $QMGR| grep -o '^\\w\\+:\\|\\w\\+[(][^)]\\+[)]' | awk -F '[()]' -v OFS=\",\" 'function printValues() { if (\"CHANNEL\" in p) { print p[\"CHANNEL\"], p[\"CURSHCNV\"], p[\"CONNAME\"] } } /^\\w+:/ { printValues(); delete p; next } { p[$1] = $2 } END { printValues() }'|wc -l)\"\necho \"Total shared conversations: $(expr $(echo $(echo \"DIS CHS(${CHL}) ALL\"|runmqsc $QMGR| grep -o '^\\w\\+:\\|\\w\\+[(][^)]\\+[)]' | awk -F '[()]' -v OFS=\",\" 'function printValues() { if (\"CHANNEL\" in p) { print p[\"CHANNEL\"], p[\"CURSHCNV\"], p[\"CONNAME\"] } } /^\\w+:/ { printValues(); delete p; next } { p[$1] = $2 } END { printValues() }'|awk -F, '{print $2}')|sed -e 's/ / + /g'))\"\necho \"Unique CONNs: $(echo \"dis conn(*) type(all) where(channel eq ${CHL})\"|runmqsc $QMGR|grep -o '^\\w\\+:\\|\\w\\+[(][^)]\\+[)]' | awk -F '[()]' -v OFS='\",\"' 'function printValues() { if (\"CONN\" in p) { print p[\"CONN\"], p[\"CHANNEL\"], p[\"CONNAME\"], p[\"OBJNAME\"], p[\"OBJTYPE\"], p[\"ASTATE\"], p[\"APPLDESC\"], p[\"APPLTAG\"], p[\"OPENOPTS\"] } } /^\\w+:/ { if (x !~ /YES/) {printValues()}; x = \"NO\"; delete p; next } { p[$1] = $2 } { if (\"OPENOPTS\" in p) { printValues() ; delete p[\"OPENOPTS\"]; x = \"YES\"} } END { if (x !~ /YES/) {printValues()} }'|sed -e 's/^/\"/g' -e 's/$/\"/g'|awk -F, '{print $1}'|sort -u|wc -l)\"\necho \"Objects opened by CONNs:\"\necho \"dis conn(*) type(all) where(channel eq ${CHL})\"|runmqsc $QMGR|grep -o '^\\w\\+:\\|\\w\\+[(][^)]\\+[)]' | awk -F '[()]' -v OFS='\",\"' 'function printValues() { if (\"CONN\" in p) { print p[\"CONN\"], p[\"CHANNEL\"], p[\"CONNAME\"], p[\"OBJNAME\"], p[\"OBJTYPE\"], p[\"ASTATE\"], p[\"APPLDESC\"], p[\"APPLTAG\"], p[\"OPENOPTS\"] } } /^\\w+:/ { if (x !~ /YES/) {printValues()}; x = \"NO\"; delete p; next } { p[$1] = $2 } { if (\"OPENOPTS\" in p) { printValues() ; delete p[\"OPENOPTS\"]; x = \"YES\"} } END { if (x !~ /YES/) {printValues()} }'|sed -e 's/^/\"/g' -e 's/$/\"/g'|awk -F, '{print $5}'|sort|uniq -c\n"} +{"text": "### Human: Below commands done for Authorization in Unix + MQ9. Want to review(is this a correct approach or not?) as well as How below commands can be achieved in Windows server?setmqaut -m TLSTEST.QM -t qmgr -p clientadmin +connect +dsp +inq\nsetmqaut -m TLSTEST.QM -t queue -p clientadmin -n '**' +put +get +browse +dsp +inq\nrunmqsc TLSTEST.QM\nALTER AUTHINFO(SYSTEM.DEFAULT.AUTHINFO.IDPWOS) AUTHTYPE(IDPWOS) CHCKCLNT(OPTIONAL)\nALTER QMGR CHLAUTH(DISABLED)\nREFRESH SECURITY TYPE(CONNAUTH)Update on 29-Mar-2017is setmqaut can be used as only to required is fine as below ,instead of '**'?setmqaut -m TLSTEST.QM -t qmgr -p clientadmin +connect +dsp +inq\nsetmqaut -m TLSTEST.QM -t queue -p clientadmin -n RECEIVE +put +get +browse +dsp +inq\nsetmqaut -m TLSTEST.QM -t queue -p clientadmin -n SEND +put +get +browse +dsp +inqbelow commands are required for me , because my jms-client will not pass user details on connection request.Is good approach to pass as below in client code or externalize these values?MQEnvironment.userID = \"mqm\";MQEnvironment.password = \"password\";runmqsc TLSTEST.QM\nALTER AUTHINFO(SYSTEM.DEFAULT.AUTHINFO.IDPWOS) AUTHTYPE(IDPWOS) CHCKCLNT(OPTIONAL)\nALTER QMGR CHLAUTH(DISABLED)\nREFRESH SECURITY TYPE(CONNAUTH)### Assistant: The commands you provided in your question would work equally as well in windows as they do in Unix.NOTEThe commands you propose turn off security which is not a good thing to do and also authorized the user \"clientadmin\" to all queues on the queue manager including SYSTEM* queues which allows that user to leverage MQ administrative authority.Commands from your 29-Mar-2017 update look fine for providing specific permissions to queues SEND and RECEIVE.In my opinion it would be a good approach to externalize the values for userID and password so that you do not need to recompile things if these change in the future.Having an application connect as mqm is not a good approach since mqm has full administrative authority.Setting CHLAUTH(DISABLED) does not prevent password checking it just turns off the normal out of the box CHLAUTH rules which prevent MQ admins from connecting to SVRCONN channels, as well as preventing usage of SYSTEM.* channels.Setting CHCKCLNT(OPTIONAL) from the default of CHCKCLNT(REQDADM) configures MQ to check that a password is valid only if a password is supplied to MQ.The default value CHCKCLNT(REQDADM) is the same as CHCKCLNT(OPTIONAL) with the additional requirement that that accounts with MQ admin authority are required to supply a valid password. Accounts without MQ admin authority are not required to present a valid password but if a password is supplied it must be valid.If your configuration only works with CHCKCLNT(OPTIONAL) it would indicate that you are connecting as an account that has MQ admin authority.There is a security issue with setting MQ to not enforce that a valid password is sent unless you use SSLCIPH and SSLPEER to restrict a SVRCONN to allow only specific client certs to connect and you make sure all other channels are locked down. The default CHLAUTH rules lock down all channels by not allowing users with MQ admin authority to connect, and they block connections to all SYSTEM* channels.Setting SSLCAUTH(OPTIONAL) configures MQ to not require that the client have a certificate, if the client does have a certificate MQ will validate it is trusted, and if you have a SSLPEER set will make sure the client certificate DN value matches.SSLCAUTH(REQUIRED) configures MQ to require that the client have a cert. You would also want to pair this with the channels SSLPEER setting to ensure the cert is the one that you expect not just a cert that is trusted by the queue manager, you also want to set the MCAUSER to a low privileged user.Setting CHLAUTH(DISABLED) likely is making the SYSTEM.* channels insecure.If you have no other mitigating controls the configuration presented is insecure.\n"} +{"text": "### Human: There are similar questions to this one, but not quite the same...I have a C# program that is using amqmdnet.dll (from 9.0.1.0 MQC Redist)\nThe code to connect is:Hashtable mqProperties = new Hashtable(); \nmqProperties.Add(MQC.CHANNEL_PROPERTY, channelName); \nmqProperties.Add(MQC.HOST_NAME_PROPERTY, hostname); \nmqProperties.Add(MQC.PORT_PROPERTY, port); \nqueueManager = new MQQueueManager(strQueueManagerName, mqProperties);It works fine and writes to the queue. I assume it picks up my current login id from Windows.When I run the same code on IIS, it connects but fails with an auth error 2035 when trying to write to the Queue.I assume this is because IIS is running as a different user-id.I tried adding:mqProperties.Add(MQC.USER_ID_PROPERTY, \"myuserid\");\nmqProperties.Add(MQC.PASSWORD_PROPERTY, \"mypassword\");and it did not work. Trying \"mydomain\\myuserid\" did not work either. Some other posts mentioned that MQ needs the Windows SID. I tried using that string, but that did not work either.At this point, I am playing with this, so I'd prefer not to ask the admins to set up a new userid on the MQ server side. With this in mind, is there any way I can login when running under the IIS user, but pass in my userid/password or some other credential to make this work?### Assistant: If the queue manager is v8.0 or later and is configured to use CONNAUTH and has ADOPTCTX(YES) set you can present an id and password. If it does not have this set then the value presented in the UserId and Password property of a .NET client will be ignored.A IBM developerWorks MQdev blog post \"MQCSP Password Protection in MQ V8has details on how to do this in various languages.\"For .NET you should be able to use what you have with the addition of theMQC.USE_MQCSP_AUTHENTICATION_PROPERTYset totrue:mqProperties.Add(MQC.USER_ID_PROPERTY, \"myuserid\");\nmqProperties.Add(MQC.PASSWORD_PROPERTY, \"mypassword\");\nmqProperties.Add(MQC.USE_MQCSP_AUTHENTICATION_PROPERTY, true);The queue manager will then authenticate this ID. If the queue manager is set with ADOPTCTX(YES) then it will always use the authenticated ID for OAM checks. If it is set to ADOPTCTX(NO) it will still use the ID the process is running under to perform OAM checks. It is highly recommended that this be set to ADOPTCTX(YES).Update 2017/02/20:Related to the comment \"I can see that it might be turned off by admins so that MQ relies on the larger organizational SSO infrastructure.\". Without setting up CONNAUTH and ADOPTCTX(YES) you can assertanyid you want to over the channel. If a CHLAUTH rule is not in place to block administrative users then you can obtain full MQ administrative authority without any form of authentication.\n"} +{"text": "### Human: I have a question,I new in ESB so I used the manual to create connection with my ESB and IBM MQhttps://docs.wso2.com/display/ESB460/Configure+with+IBM+WebSphere+MQon the end I create .bindings file and used. Everything worked fine. So Im able to read messages from Queues that exist in QueueManager.QUESTION:Am I need to rebuild .binding file every time when I create new Queue?\nis there a way to use/see newly created Queues without rebuild a .binding file?For connection in \\repository\\conf\\axis2.xml I used> locked=\"false\">queue\n> **myname**\n> **mypassword**I see this onhttp://nandikajayawardana.blogspot.com/search/label/WSo2%20ESBbut maybe I should use this> locked=\"false\">**topic**\n> ivtT### Assistant: After I tried every single combination. Working solution in my case is :WMQInitialContextFactoryis not recommended... starting from version 8 IBM MQ they using ONLYRefFSContextFactoryso after creating .binding file the repository\\conf\\axis2.xml should look like\n com.sun.jndi.fscontext.RefFSContextFactory\n file:/home/wso2admin/wso2esb-5.0.0/jndi\n GSTQueueConnectionFactory\n queue\n userName\n userPassword\n .....whereGSTQueueConnectionFactoryis ConectionFactory name that is defined in .binding fileSo proxy server looks like : \n\n \n \n \n \n \n \n \n \n \nqueue \nTMSALease\n \n \n contectType\n application/xml\n \n \nesbMngr \nSoesbMngris name of section defined in axis2.xml whileTMSALeaseis your message queue that you are reading from IBM MQI hope is this is going to save some time someone ... Any feedback is welcomeNOTE: communication can be tricky. Be sure that you check that your userName have access to queue, read more in IBM Technote \"2035 MQRC_NOT_AUTHORIZED Connecting to WebSphere MQ from WebSphere Application Server via CLIENT Bindings\"To check MQ OAM permissions us thedspmqautcommand, for example:dspmqaut -m WS02ESBManager -n TMSALease -t queue -p userNameTo set MQ OAM permissions us thesetmqautcommand, for example:setmqaut -m WS02ESBManager -n TMSALease -t queue -p userName+putAlso sometimes help if you :DisableChannel authentication recordsinCommunicationinPropertiesof queue manager ...\n"} +{"text": "### Human: I need to backup the queue and delete the first message in the queue. I have used the below code./qload -m qmgr SYSTEM.CLUSTER.TRANSMIT.QUEUE -r 1Also I need to display first message has been deleted### Assistant: I have found the answer.It works for meqload -m $qmgr -I $qname -f __.log -r 1\n"} +{"text": "### Human: There is acamelroute, which is transacted and exceptions are handled by aTransactionErrorHandler. The code looks something like this:...\n\n\n...\n\n ...\n \n java.lang.Exception\n \n true\n \n \n \n\n \n \n \n \n \nIt works and there is a commit for the transaction after the error has been handled:Transaction commit (0xfab75a3a) redelivered(true) for ..., but then the message is placed in the input queue again and the transaction starts from the beginning (endless loop).We are usingIBM MQand I think this rollback is performed by MQ and not from the camel route. So the question is: Can I tell MQ that I handled the exception and that it should not rollback again?### Assistant: IBM MQ is resending the message to the consumer by design. To have the broker stop after X number of tries, configure a 'backout threshold' and a 'blackout queue' for IBM MQ to move the messages out of the way after failed delivery attempts.\n"} +{"text": "### Human: ` I need to restore clustered queues to its pre-cluster state which was previously removed from cluster. Is there any option to restore those removed queue to its cluster state. Thanks in advance### Assistant: You can restore queues to the cluster that were previously part of the cluster using a backup created with thedmpmqcfgprogram prior to removing the queues from the cluster. This backup is only as current as of the date of your backup.This command will output all queues:dmpmqcfg -m -n TEST.QUEUE -t queue -a -x all -o 1lineThis command will output only queues that have eitherCLUSTERorCLUSNLset to any value:dmpmqcfg -m -t queue -a -z all -o 1line | grep \"^DEFINE\" | egrep -v \"CLUSNL\\(' '\\) CLUSTER\\(' '\\)|^DEFINE QMODEL\"Running the commands generated prior to removing the queue(s) from the cluster would put them back into the cluster.Note that this assumes that if you are usingCLUSNLthat you did not delete theNAMELIST\n"} +{"text": "### Human: ` I need to check MQ queue is already exists in cluster. dspmq command and \ndis q(TEST.QUEUE) CLUSTER. which command is used to check IBM MQ queue is already exists in cluster### Assistant: dspmqis used to display the Queue Manager status.\nIf you want to find out whether a Cluster already has a Queue in it you want to execute the following MQSC commandDISPLAY QCLUSTER() WHERE (CLUSTER EQ )However, the response will only be valid if the Queue Manager knows about the Queue:If you execute the command on a full repository then you can trust the response as the Full repositories always know everything about the cluster.If you execute the command on a partial repository, the Queue Manager will only be able to tell you about the Queue if an application has already attempted to make use of the Queue. Otherwise it won't know whether it exists or not.\n"} +{"text": "### Human: `I have used MQ_INSTALLATION_PATH in linuxwhen i execute above in the path/opt/mqm/binvia root it cannot display nothing but when i execute it in the path/opt/mqm/samp/binit displays MQ_INSTALLATION_PATH .. before i should execute crtmqenv -p commandSo what a solution to get installation path of IBM MQ?### Assistant: MQ v7.1 and higher support multiple installations on the same server. The commandsetmqenvwhen sourced will setup some environment variables to allow you to use a specific installation. One of the variables that is set bysetmqenvis$MQ_INSTALLATION_PATH. You can display the value of this variable with the commandecho $MQ_INSTALLATION_PATH.$ echo $MQ_INSTALLATION_PATH\n/opt/mqmIf the installation has been setup as default using thesetmqinstcommand, then various symlinks will be created under/usr/binpointed back to the mq installation directory. You can display the installation directory by running the/usr/bin/dspmqvercommand and looking forInstPathin the output.You can also directly call the commanddspmqver -f 128to have it return just the installation path:InstPath: /opt/mqmIf the install is not setup as the default install and you do not know which directory MQ is installed in you can look at the/etc/opt/mqm/mqinst.inifile which will have a stanza for each installation on the server. The installation path is listed afterFilePath=under eachInstallationstanza.$ cat /etc/opt/mqm/mqinst.ini\nInstallation:\n Name=Installation1\n Description=\n Identifier=1\n FilePath=/opt/mqm\n"} +{"text": "### Human: I am trying to implement a connection between my application (Spring integration) with IBM-MQ, I did see the questionspring-integration-support-for-clustered-high-availability-ibm-mq-manager, but in my case each host has different \"queueManager\" and \"channels\", it means I will have must have a configuration like follows but, the queueManager and channels properties support a String not a list values:\n \n \n \n \n \n### Assistant: The simplest thing would be to define a channel with the same name on both hosts and let the client try host1 first and then host2 usingconnectionNameList. In this setup it would always prefer host1. You would need to specify aqueueManagerthat is blank so that the client will accept the queue manager it connects to. Example follows:Another option that was pointed out in a comment from Morag on the other post you linked to is to use a CCDT (Client channel definition table).SeeUsing a client channel definition table with IBM WebSphere MQ classes for JMS. The property name isCCDTURLThe CCDT can have multipleCLNTCONNchannel entries with different channel names all having the same QMNAME, this is called aQueue Manager Group, you would then specify thequeueManagerproperty as*QMNAME, this will allow the app to connect to which ever queue manager you are directed to with out regard to the actual queue manager name. There are other parameters of the CLNTCONN listed at the bottom of the link I provided that can help you to control if one queue manager is preferred over the other(s) as well as which queue manager to connect to if a reconnect is required.\n"} +{"text": "### Human: MQ8. I created two channels, FOO and SYSTEM.ADMIN.SVRCONN in a new queue manager MYQMGR.I created a TCP listener on port 1414.I created a kdb and associated files in /var/mqm/qmgrs/MYQMGR/ssl, with a server certificate for the qmgr.I checked SSLKEYR on the qmgr is set to the right value: /var/mqm/qmgrs/MYQMGR/ssl/key in my case.I set SSLCIPH on both channels to TLS_RSA_WITH_AES_128_CBC_SHA256.I stopped and started the queue manager.This being an SSL connection, I'd expect to be able to useopenssl s_client -connect localhost:1414to check if it works at all. However I just get:CONNECTED(00000003)\n140512696194912:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:184:\n---\nno peer certificate available\n---\nNo client certificate CA names sent\n---\nSSL handshake has read 0 bytes and written 249 bytes\n---\nNew, (NONE), Cipher is (NONE)\nSecure Renegotiation IS NOT supported\nCompression: NONE\nExpansion: NONE\n---Which sounds to me like there's no one speaking SSL on the port. What am I missing?See below for output ofDISPLAY LISTENER(*) ALL,DISPLAY QMGRandDISPLAY CHANNEL(*) ALL:DISPLAY LISTENER(*) ALL\n 4 : DISPLAY LISTENER(*) ALL\nAMQ8630: Display listener information details.\n LISTENER(ADEP.DEV.LISTENER) CONTROL(QMGR)\n TRPTYPE(TCP) PORT(1414)\n IPADDR( ) BACKLOG(0)\n DESCR( ) ALTDATE(2017-01-17)\n ALTTIME(12.00.31) \nAMQ8630: Display listener information details.\n LISTENER(SYSTEM.DEFAULT.LISTENER.TCP) CONTROL(MANUAL)\n TRPTYPE(TCP) PORT(0)\n IPADDR( ) BACKLOG(0)\n DESCR( ) ALTDATE(2017-01-17)\n ALTTIME(12.00.31) \nDISPLAY QMGR\n 1 : DISPLAY QMGR\nAMQ8408: Display Queue Manager details.\n QMNAME(MYQMGR) ACCTCONO(DISABLED)\n ACCTINT(1800) ACCTMQI(OFF)\n ACCTQ(OFF) ACTIVREC(MSG)\n ACTVCONO(DISABLED) ACTVTRC(OFF)\n ALTDATE(2017-01-17) ALTTIME(12.00.31)\n AUTHOREV(DISABLED) CCSID(1208)\n CERTLABL(ibmwebspheremqfoo) CERTVPOL(ANY)\n CHAD(DISABLED) CHADEV(DISABLED)\n CHADEXIT( ) CHLEV(DISABLED)\n CHLAUTH(DISABLED) CLWLDATA( )\n CLWLEXIT( ) CLWLLEN(100)\n CLWLMRUC(999999999) CLWLUSEQ(LOCAL)\n CMDEV(DISABLED) CMDLEVEL(800)\n COMMANDQ(SYSTEM.ADMIN.COMMAND.QUEUE) CONFIGEV(DISABLED)\n CONNAUTH(SYSTEM.DEFAULT.AUTHINFO.IDPWOS)\n CRDATE(2017-01-17) CRTIME(12.00.30)\n CUSTOM( ) DEADQ(DLQ)\n DEFCLXQ(SCTQ) DEFXMITQ( )\n DESCR( ) DISTL(YES)\n INHIBTEV(DISABLED) IPADDRV(IPV4)\n LOCALEV(DISABLED) LOGGEREV(DISABLED)\n MARKINT(5000) MAXHANDS(256)\n MAXMSGL(4194304) MAXPROPL(NOLIMIT)\n MAXPRTY(9) MAXUMSGS(10000)\n MONACLS(QMGR) MONCHL(OFF)\n MONQ(OFF) PARENT( )\n PERFMEV(DISABLED) PLATFORM(UNIX)\n PSMODE(ENABLED) PSCLUS(ENABLED)\n PSNPMSG(DISCARD) PSNPRES(NORMAL)\n PSRTYCNT(5) PSSYNCPT(IFPER)\n QMID(MYQMGR_2017-01-17_12.00.30) REMOTEEV(DISABLED)\n REPOS( ) REPOSNL( )\n REVDNS(ENABLED) ROUTEREC(MSG)\n SCHINIT(QMGR) SCMDSERV(QMGR)\n SPLCAP(ENABLED) SSLCRLNL( )\n SSLCRYP( ) SSLEV(DISABLED)\n SSLFIPS(NO) \n SSLKEYR(/var/mqm/qmgrs/MYQMGR/ssl/key)\n SSLRKEYC(0) STATACLS(QMGR)\n STATCHL(OFF) STATINT(1800)\n STATMQI(OFF) STATQ(OFF)\n STRSTPEV(ENABLED) SUITEB(NONE)\n SYNCPT TREELIFE(1800)\n TRIGINT(999999999) VERSION(08000004)\n XRCAP(YES) \nDISPLAY CHANNEL(*) ALL\n 2 : DISPLAY CHANNEL(*) ALL\nAMQ8414: Display Channel details.\n CHANNEL(FOO) CHLTYPE(SVRCONN)\n ALTDATE(2017-01-18) ALTTIME(02.36.46)\n CERTLABL( ) COMPHDR(NONE)\n COMPMSG(NONE) \n DESCR(Channel to Put and Get from AL)\n DISCINT(0) HBINT(300)\n KAINT(AUTO) MAXINST(999999999)\n MAXINSTC(999999999) MAXMSGL(4194304)\n MCAUSER( ) MONCHL(QMGR)\n RCVDATA( ) RCVEXIT( )\n SCYDATA( ) SCYEXIT( )\n SENDDATA( ) SENDEXIT( )\n SHARECNV(10) SSLCAUTH(OPTIONAL)\n SSLCIPH(TLS_RSA_WITH_AES_128_CBC_SHA256)\n SSLPEER( ) TRPTYPE(TCP)\nAMQ8414: Display Channel details.\n CHANNEL(SYSTEM.ADMIN.SVRCONN) CHLTYPE(SVRCONN)\n ALTDATE(2017-01-18) ALTTIME(02.39.40)\n CERTLABL( ) COMPHDR(NONE)\n COMPMSG(NONE) DESCR( )\n DISCINT(0) HBINT(300)\n KAINT(AUTO) MAXINST(999999999)\n MAXINSTC(999999999) MAXMSGL(4194304)\n MCAUSER( ) MONCHL(QMGR)\n RCVDATA( ) RCVEXIT( )\n SCYDATA( ) SCYEXIT( )\n SENDDATA( ) SENDEXIT( )\n SHARECNV(10) SSLCAUTH(OPTIONAL)\n SSLCIPH(TLS_RSA_WITH_AES_128_CBC_SHA256)\n SSLPEER( ) TRPTYPE(TCP)\nAMQ8414: Display Channel details.\n CHANNEL(SYSTEM.AUTO.RECEIVER) CHLTYPE(RCVR)\n ALTDATE(2017-01-17) ALTTIME(12.00.31)\n BATCHSZ(50) CERTLABL( )\n COMPHDR(NONE) COMPMSG(NONE)\n DESCR(Auto-defined by) HBINT(300)\n KAINT(AUTO) MAXMSGL(4194304)\n MCAUSER( ) MONCHL(QMGR)\n MRDATA( ) MREXIT( )\n MRRTY(10) MRTMR(1000)\n MSGDATA( ) MSGEXIT( )\n NPMSPEED(FAST) PUTAUT(DEF)\n RCVDATA( ) RCVEXIT( )\n RESETSEQ(NO) SCYDATA( )\n SCYEXIT( ) SENDDATA( )\n SENDEXIT( ) SEQWRAP(999999999)\n SSLCAUTH(REQUIRED) SSLCIPH( )\n SSLPEER( ) STATCHL(QMGR)\n TRPTYPE(TCP) USEDLQ(YES)\nAMQ8414: Display Channel details.\n CHANNEL(SYSTEM.AUTO.SVRCONN) CHLTYPE(SVRCONN)\n ALTDATE(2017-01-17) ALTTIME(12.00.31)\n CERTLABL( ) COMPHDR(NONE)\n COMPMSG(NONE) DESCR(Auto-defined by)\n DISCINT(0) HBINT(300)\n KAINT(AUTO) MAXINST(999999999)\n MAXINSTC(999999999) MAXMSGL(4194304)\n MCAUSER( ) MONCHL(QMGR)\n RCVDATA( ) RCVEXIT( )\n SCYDATA( ) SCYEXIT( )\n SENDDATA( ) SENDEXIT( )\n SHARECNV(10) SSLCAUTH(REQUIRED)\n SSLCIPH( ) SSLPEER( )\n TRPTYPE(TCP) \nAMQ8414: Display Channel details.\n CHANNEL(SYSTEM.DEF.CLUSRCVR) CHLTYPE(CLUSRCVR)\n ALTDATE(2017-01-17) ALTTIME(12.00.31)\n BATCHHB(0) BATCHINT(0)\n BATCHLIM(5000) BATCHSZ(50)\n CERTLABL( ) CLUSNL( )\n CLUSTER( ) CLWLPRTY(0)\n CLWLRANK(0) CLWLWGHT(50)\n COMPHDR(NONE) COMPMSG(NONE)\n CONNAME( ) CONVERT(NO)\n DESCR( ) DISCINT(6000)\n HBINT(300) KAINT(AUTO)\n LOCLADDR( ) LONGRTY(999999999)\n LONGTMR(1200) MAXMSGL(4194304)\n MCANAME( ) MCATYPE(THREAD)\n MCAUSER( ) MODENAME( )\n MONCHL(QMGR) MRDATA( )\n MREXIT( ) MRRTY(10)\n MRTMR(1000) MSGDATA( )\n MSGEXIT( ) NETPRTY(0)\n NPMSPEED(FAST) PROPCTL(COMPAT)\n PUTAUT(DEF) RCVDATA( )\n RCVEXIT( ) RESETSEQ(NO)\n SCYDATA( ) SCYEXIT( )\n SENDDATA( ) SENDEXIT( )\n SEQWRAP(999999999) SHORTRTY(10)\n SHORTTMR(60) SSLCAUTH(REQUIRED)\n SSLCIPH( ) SSLPEER( )\n STATCHL(QMGR) TPNAME( )\n TRPTYPE(TCP) USEDLQ(YES)\nAMQ8414: Display Channel details.\n CHANNEL(SYSTEM.DEF.CLUSSDR) CHLTYPE(CLUSSDR)\n ALTDATE(2017-01-17) ALTTIME(12.00.31)\n BATCHHB(0) BATCHINT(0)\n BATCHLIM(5000) BATCHSZ(50)\n CLUSNL( ) CLUSTER( )\n CLWLPRTY(0) CLWLRANK(0)\n CLWLWGHT(50) COMPHDR(NONE)\n COMPMSG(NONE) CONNAME( )\n CONVERT(NO) DESCR( )\n DISCINT(6000) HBINT(300)\n KAINT(AUTO) LOCLADDR( )\n LONGRTY(999999999) LONGTMR(1200)\n MAXMSGL(4194304) MCANAME( )\n MCATYPE(THREAD) MCAUSER( )\n MODENAME( ) MONCHL(QMGR)\n MSGDATA( ) MSGEXIT( )\n NPMSPEED(FAST) PASSWORD( )\n PROPCTL(COMPAT) RCVDATA( )\n RCVEXIT( ) RESETSEQ(NO)\n SCYDATA( ) SCYEXIT( )\n SENDDATA( ) SENDEXIT( )\n SEQWRAP(999999999) SHORTRTY(10)\n SHORTTMR(60) SSLCIPH( )\n SSLPEER( ) STATCHL(QMGR)\n TPNAME( ) TRPTYPE(TCP)\n USEDLQ(YES) USERID( )\nAMQ8414: Display Channel details.\n CHANNEL(SYSTEM.DEF.RECEIVER) CHLTYPE(RCVR)\n ALTDATE(2017-01-17) ALTTIME(12.00.31)\n BATCHSZ(50) CERTLABL( )\n COMPHDR(NONE) COMPMSG(NONE)\n DESCR( ) HBINT(300)\n KAINT(AUTO) MAXMSGL(4194304)\n MCAUSER( ) MONCHL(QMGR)\n MRDATA( ) MREXIT( )\n MRRTY(10) MRTMR(1000)\n MSGDATA( ) MSGEXIT( )\n NPMSPEED(FAST) PUTAUT(DEF)\n RCVDATA( ) RCVEXIT( )\n RESETSEQ(NO) SCYDATA( )\n SCYEXIT( ) SENDDATA( )\n SENDEXIT( ) SEQWRAP(999999999)\n SSLCAUTH(REQUIRED) SSLCIPH( )\n SSLPEER( ) STATCHL(QMGR)\n TRPTYPE(TCP) USEDLQ(YES)\nAMQ8414: Display Channel details.\n CHANNEL(SYSTEM.DEF.REQUESTER) CHLTYPE(RQSTR)\n ALTDATE(2017-01-17) ALTTIME(12.00.31)\n BATCHSZ(50) CERTLABL( )\n COMPHDR(NONE) COMPMSG(NONE)\n CONNAME( ) DESCR( )\n HBINT(300) KAINT(AUTO)\n LOCLADDR( ) MAXMSGL(4194304)\n MCANAME( ) MCATYPE(PROCESS)\n MCAUSER( ) MODENAME( )\n MONCHL(QMGR) MRDATA( )\n MREXIT( ) MRRTY(10)\n MRTMR(1000) MSGDATA( )\n MSGEXIT( ) NPMSPEED(FAST)\n PASSWORD( ) PUTAUT(DEF)\n RCVDATA( ) RCVEXIT( )\n RESETSEQ(NO) SCYDATA( )\n SCYEXIT( ) SENDDATA( )\n SENDEXIT( ) SEQWRAP(999999999)\n SSLCAUTH(REQUIRED) SSLCIPH( )\n SSLPEER( ) STATCHL(QMGR)\n TPNAME( ) TRPTYPE(TCP)\n USEDLQ(YES) USERID( )\nAMQ8414: Display Channel details.\n CHANNEL(SYSTEM.DEF.SENDER) CHLTYPE(SDR)\n ALTDATE(2017-01-17) ALTTIME(12.00.31)\n BATCHHB(0) BATCHINT(0)\n BATCHLIM(5000) BATCHSZ(50)\n CERTLABL( ) COMPHDR(NONE)\n COMPMSG(NONE) CONNAME( )\n CONVERT(NO) DESCR( )\n DISCINT(6000) HBINT(300)\n KAINT(AUTO) LOCLADDR( )\n LONGRTY(999999999) LONGTMR(1200)\n MAXMSGL(4194304) MCANAME( )\n MCATYPE(PROCESS) MCAUSER( )\n MODENAME( ) MONCHL(QMGR)\n MSGDATA( ) MSGEXIT( )\n NPMSPEED(FAST) PASSWORD( )\n PROPCTL(COMPAT) RCVDATA( )\n RCVEXIT( ) RESETSEQ(NO)\n SCYDATA( ) SCYEXIT( )\n SENDDATA( ) SENDEXIT( )\n SEQWRAP(999999999) SHORTRTY(10)\n SHORTTMR(60) SSLCIPH( )\n SSLPEER( ) STATCHL(QMGR)\n TPNAME( ) TRPTYPE(TCP)\n USEDLQ(YES) USERID( )\n XMITQ( ) \nAMQ8414: Display Channel details.\n CHANNEL(SYSTEM.DEF.SERVER) CHLTYPE(SVR)\n ALTDATE(2017-01-17) ALTTIME(12.00.31)\n BATCHHB(0) BATCHINT(0)\n BATCHLIM(5000) BATCHSZ(50)\n CERTLABL( ) COMPHDR(NONE)\n COMPMSG(NONE) CONNAME( )\n CONVERT(NO) DESCR( )\n DISCINT(6000) HBINT(300)\n KAINT(AUTO) LOCLADDR( )\n LONGRTY(999999999) LONGTMR(1200)\n MAXMSGL(4194304) MCANAME( )\n MCATYPE(PROCESS) MCAUSER( )\n MODENAME( ) MONCHL(QMGR)\n MSGDATA( ) MSGEXIT( )\n NPMSPEED(FAST) PASSWORD( )\n PROPCTL(COMPAT) RCVDATA( )\n RCVEXIT( ) RESETSEQ(NO)\n SCYDATA( ) SCYEXIT( )\n SENDDATA( ) SENDEXIT( )\n SEQWRAP(999999999) SHORTRTY(10)\n SHORTTMR(60) SSLCAUTH(REQUIRED)\n SSLCIPH( ) SSLPEER( )\n STATCHL(QMGR) TPNAME( )\n TRPTYPE(TCP) USEDLQ(YES)\n USERID( ) XMITQ( )\nAMQ8414: Display Channel details.\n CHANNEL(SYSTEM.DEF.SVRCONN) CHLTYPE(SVRCONN)\n ALTDATE(2017-01-17) ALTTIME(12.00.31)\n CERTLABL( ) COMPHDR(NONE)\n COMPMSG(NONE) DESCR( )\n DISCINT(0) HBINT(300)\n KAINT(AUTO) MAXINST(999999999)\n MAXINSTC(999999999) MAXMSGL(4194304)\n MCAUSER( ) MONCHL(QMGR)\n RCVDATA( ) RCVEXIT( )\n SCYDATA( ) SCYEXIT( )\n SENDDATA( ) SENDEXIT( )\n SHARECNV(10) SSLCAUTH(REQUIRED)\n SSLCIPH( ) SSLPEER( )\n TRPTYPE(TCP) \nAMQ8414: Display Channel details.\n CHANNEL(SYSTEM.DEF.CLNTCONN) CHLTYPE(CLNTCONN)\n AFFINITY(PREFERRED) ALTDATE(2017-01-17)\n ALTTIME(12.00.31) CERTLABL( )\n CLNTWGHT(0) COMPHDR(NONE)\n COMPMSG(NONE) CONNAME( )\n DEFRECON(NO) DESCR( )\n HBINT(300) KAINT(AUTO)\n LOCLADDR( ) MAXMSGL(4194304)\n MODENAME( ) PASSWORD( )\n QMNAME( ) RCVDATA( )\n RCVEXIT( ) SCYDATA( )\n SCYEXIT( ) SENDDATA( )\n SENDEXIT( ) SHARECNV(10)\n SSLCIPH( ) SSLPEER( )\n TPNAME( ) TRPTYPE(TCP)\n USERID( )### Assistant: Does theCERTLABLvalueibmwebspheremqfoomatch the label of the cert in thekey.kdbfile? If it does not then then update the CERTLABL value to match or rename the cert label in the key.kdb to match.Does thekey.kdbfile contain the full chain of issuing certs (ex: root and intermediate)? If it does not make sure the full chain is included in the key.kdb. Make sure you issue the commandREFRESH SECURITY TYPE(SSL)following any updates to the key.kdb, this will force MQ to re-read the file.\n"} +{"text": "### Human: In my Vb.net application I'm using IBM MQ v7.5 Managed client connection to connect to a queue manager. Until now I have provided channel name and host name in a .Config file and call the following:MQQueueManager(Qmanagername, Channel, Host)But Now I have a AMQCLCHL.TAB file with the channel details. How can I have my Vb.net application use the channel name and host name from the AMQCLCHL.TAB file.### Assistant: You need to let the application know the location of the channel table file. TheIBM Knowledge centershows this can be done in three ways with managed client connection type:Using the .NET application configuration file. In the CHANNELS section, use the keys ChannelDefinitionDirectory to specify the directory where the table is located, and ChannelDefinitionFile to specify the file name.Using the environment variables MQCHLLIB to specify the directory where the table is located, and MQCHLTAB to specify the file name of the table.Using the client configuration file. In the CHANNELS stanza, use the attributes ChannelDefinitionDirectory to specify the directory where the table is located, and ChannelDefinitionFile to specify the file name.You can then change your call to drop the channel and hostname and it will pickup the channel table that you specified using one of the three ways described above.New MQQueueManager(Qmanagername)Update to include additional information from the commentsIf your application runs on the same server as the queue manager it will by default connect in unmanaged mode using server bindings if you do not force it to use client mode. This is described in detail in theKnowledge Center.You can force it to a client mode by setting the environment variable NMQ_MQ_LIB.For unmanaged MQ client mode useNMQ_MQ_LIB=mqic.dllFor managed client mode useNMQ_MQ_LIB=managedTheMQC.TRANSPORT_PROPERTYhashtable property can also used to force it to use client mode.Unmanaged MQ client mode example:Hashtable properties = new Hashtable();\nproperties.Add(MQC.TRANSPORT_PROPERTY, \"MQC.TRANSPORT_MQSERIES_CLIENT\");\nreturn new MQQueueManager(queueManagerName, properties);Managed MQ client mode example:Hashtable properties = new Hashtable();\nproperties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED\");\nreturn new MQQueueManager(queueManagerName, properties);\n"} +{"text": "### Human: I have tried saveqmgr and dmpmqcfg. i cannot get expected output.dmpmqcfg -m qm.apple -t all -a -x all -o setmqautI am using MQ_7.5 version. Which command is used to take backup of MQ Message queue in linux### Assistant: You can use a command similar to the following to backup the details of a specific queue (TEST.QUEUE in this example). The output will include both theDEFINE Qcommand along withSET AUTHRECcommands to restore any OAM permissions granted to that specific queue. Note that this command will not backup OAM for any other queue or wild carded permissions.dmpmqcfg -m qm.apple -n TEST.QUEUE -t queue -a -x all -o 1lineTo backup the data in the queue you can use theMO03 SupportPac (aka QLOAD)from IBM. This SupportPac from IBM has been withdrawn because at v8 of the product it was integrated and renamed to dmpmqmsg. For versions of MQ prior to v8 you can still download the MQ03 SupportPac at the above link. The original author of the SupportPac also now maintains a version of the program calledQLOAD.Example command below will backup a queue called TEST.QUEUE with out removing the messages from the queue (change the -i to capital -I to also remove them from the queue).qload -m qm.apple -i TEST.QUEUE -f TEST.QUEUE.qloadOutput will show how many messages were read and written, example output is below:Read - Files: 0 Messages: 3 Bytes: 4\nWritten - Files: 1 Messages: 3 Bytes: 4Example command below will put the messages from the file back onto the queue.qload -m qm.apple -f TEST.QUEUE.qload -o TEST.QUEUE\n"} +{"text": "### Human: I have installed IBM MQ (version: 8.0.0.5) in in my local windows machine (Windows 7 professional x64). I did following steps to enable the AMQP service.Went trough the default configuration setup wizard and post card test is also done to check whether the installation is successful or not. All went as expected.Then I went through the following steps to enable the AMQP service.End the queue manager. (endmqm QMAN_NAME)Enable the command level. (strmqm -e CMDLEVEL=801 QMAN_NAME)Run queue manager. (runmqsc QMAN_NAME)Afterwards i tried to bring up the AMQP service using MQ Explorer. Status field of the service changed to \"Running\" andimmediately automatically changed back to \"Stopped\"(As shown in the below image)Output of the start service attempt from the MQ ExplorerThen tried using command line (As shown in the following lines)runmqdc QMAN_NAME (Start the command line)START SERVICE (SYSTEM.AMQP.SERVICE)Output of the start service commandI tried with few different windows machines (Including a VM) and with a linux machine as well. Same result occurred in every attempt.I wasted more than two days to find out a solution for this matter. I would be really grateful if you could give me a clue.### Assistant: I have installed IBM Websphere application server (version: 8.0.0.5)You mean WAS v8.0.0.5 or MQ 8.0.0.5? If you mean MQ 8.0.0.5 did you read this IBM blog posting:https://www.ibm.com/developerworks/community/blogs/messaging/entry/MQ_support_for_MQ_Light_released_in_8_0_0_4?lang=enIn particular it says:If you have installed MQ fixpack 8.0.0.2, 8.0.0.3, or 8.0.0.4 on top\n of an existing MQ 8 installation and upgraded the queue manager to\n command level 801 or higher you will see some of the new AMQP-related\n objects appear. They cannot be used without performing a fresh install\n of 8.0.0.4 or later.So, did you do a fresh install of MQ 8.0.0.4 or higher?\n"} +{"text": "### Human: I want to set the MQConstants.USE_MQCSP_AUTHENTICATION_PROPERTY and JMSConstants.USER_AUTHENTICATION_MQCSP in WAS console > Resources > JMS > Queue connection factories > QueueConnFactoryDEV > Custom properties, does anyone know the property values? Thank you in advance.In IBM MQ classes for Java, set the property MQConstants.USE_MQCSP_AUTHENTICATION_PROPERTY to true in the properties hashtable passed to the com.ibm.mq.MQQueueManager constructor.Is the property value USE_MQCSP_AUTHENTICATION_PROPERTY?In IBM MQ classes for JMS, set the property JMSConstants.USER_AUTHENTICATION_MQCSP to true, on the appropriate connection factory prior to creating the connection.Is the property value USER_AUTHENTICATION_MQCSP?Globally, set the System Property com.ibm.mq.cfg.jmqi.useMQCSPauthentication to a value indicating true, for example, by adding -Dcom.ibm.mq.cfg.jmqi.useMQCSPauthentication=Y to the command line.How to set this in websphere?EDIT:Instead ofcf.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, true);I want to setcf.setBooleanProperty(\"USER_AUTHENTICATION_MQCSP\", true);since I will be putting it in custom properties.### Assistant: These constants appear in theWMQConstantsAPI. Seems to have been areorgin later releases.However, are you sure you're taking the right approach given that you're accessing WMQwithinWebSphere Application Server (rather than through a standalone Java program)?WMQ in particular and JMS providers in general are managed resources within the app server, so along with connection pooling you get a set of server-integrated authentication options like an auth alias. Seehereandhereandherefor more reading on authentication and WMQ in the app server in general.\n"} +{"text": "### Human: Recently I attended an interview, he asked this question\nI am putting messages in Q. Manager, but client unable to get that messages, what is the problem can you explain it?\n(All permission are ok, and put and get are enable state).### Assistant: There are a 101 possible reasons. That is why MQ provides an MQRC back to the application, and further information in the AMQERR01.LOG. Without either of those you cannot even begin to guess. (P.S. I suspect that would have been a suitable reply in an interview!!)But, since you ask for us to guess, here's a few more different from those Valerie suggested.Perhaps the client channel max message length is shorter than the messages on the queue.The codepage between client and queue manager may be such that data cannot be converted.Client application get buffer isn't big enoughHasn't specified accept truncated and the message was bigger than the bufferAMS is in use and he's not the intended recipient (different from permissions)\n"} +{"text": "### Human: It is mentioned in the documentation ofDefaultMessageListenerContainerclass that it is not recommended to useCachingConnectionFactorywith dynamic scaling. While searching, I have encountered following link:Why DefaultMessageListenerContainer should not use CachingConnectionFactory?Here found a comment from Gary Russell thatthe problem is with caching consumers when using variable concurrency in the container; we can end up with a live consumer \"stuck\" in the cache\".We have usedDefaultMessageListenerContainerandCachingConnectionFactorytogether so this is surely a problem from above link.We are encountering problems with our application having following behaviour:TCP ZeroWindow network congestionTCP RESET from application server to MQDB connection grows during the issue while different transactions haltMessages in certain queues gets built upWe have following code configuration :In ibmmq-context.xml file:\n\n \n ${ibmmq.ip}\n \n \n ${ibmmq.port}\n \n \n ${ibmmq.queuemanager}\n \n \n${ibmmq.channel} \n\n \n \n\n\n\n\n\n \n \n \n \n\n \n\n\ncom.ibm.mq.jms.JMSC.MQJMS_TP_CLIENT_MQ_TCPIP\n\nIn jms-context file:\n \n \n \n \n \n \nThere are 6 such listeners like bankListener and each of the listeners has concurrency value, varies from 10-40\n \n \n \n \n \nandjms-context.xmlfile usesibmmq-context.xmlfile.And to note, we have used IBM MQ 7.1, Spring 4.2.8, spring-integration-core as 4.3.1.RELEASE and JBoss EAP 6.4.10We are planning to fix this by following way:\n \n \n \n \n \n \nMy request:Please review the configuration and let me know is there anything else to be changed.Could you please also explain our application behaviour(above 4 points - a to d) with our current configuration withCachingConnectionFactoryandDefaultMessageListenerContainerThanks in advance for your help.### Assistant: Try setting:cachingConnectionFactory.setCacheConsumers(false);Or in Spring it should be:\n ...\n \n ...\n\n"} +{"text": "### Human: IBM WS MQ7.5, windows MQMFT agent, linux MQ manager.I am trying to run a powershell script as defined in the xml of a MQ mft ant script.I configured the path to the powershell scripts in commandPath of the agent.properties files.The managed call starts but fails\n \n The error readscannot run program createprocess error=193 MoveFileToArchive.ps1 is not a valid win32 applicationI tried to add the path to powershell with powershell.exe defined like so\n \n This doesnt work either.### Assistant: As can be seen from the error, MFT agent is usingCreateProcessAPI to start a program.CreateProcessAPI can run only executable file. ThePowershellscript you are using is a non executable. Hence the error.If you want to be able to open any file with its associated application then you needShellExecuteinstead ofCreateProcess. But this is not under your control. So need to look for alternative?Try using a batch file sayps.cmdand in the batch file you run the PowerShell script likePowershell -executionpolicy bypass -File C:\\IBM\\MFT\\script\\MoveFileToArchive.ps1 %1Where %1 would be the argument for PS script.The Ant script also needs bit of a change.\n \n I am sure you have already set thecommandPathproperty to a suitable value in agent.properties.Give it a try.\n"} +{"text": "### Human: I am trying to execute the following 2 commands in python one after another.runmqsc \nDisplay QL ()I can execute the rumqsc command using subprocess.subprocess.call(\"runmqsc \", shell= True)Now this commands seems like taking the control from python. If i try to execute the next command using subprocess its not working as expected.\nI am not even sure how to execute the second(for which i have to pass an argument).Adding the code snippet:subprocess.call(\"runmqsc Qmgrname\", shell= True)\nsubprocess.call(\"DISPLAY QL()\",shell=True)Now the first line executes fine and as mentioned by tdelaney in the comment runmqsc waits for input from stdin. And after executing the first line the program hangs without even executing the second line.Any help or references to any of the related document would help.\nThanks### Assistant: You don't want to run to subprocess commands sequentially. When you runrunmqscon the command line, it takes overstdin, executes the commands you enter and then finally exits when you tell it to. Fromthe docs:By taking stdin from the keyboard, you can enter MQSC commands interactively.\n By redirecting the input from a file, you can run a sequence of\n frequently used commands contained in the file. You can also redirect\n the output report to a file.But I think there's a third way. Startrunmqsc, write your command(s) tostdinthen closestdin. It should execute the commands and exit. It turns out thatPopen.communicatedoes this for you. I don't know if you want to capture the output but in this example I'm letting it go to the screen.# start msg queue manager\nmqsc = subprocess.Popen([\"runmqsc\", \"QMAGTRAQ01\"], stdin=subprocess.PIPE,\n stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n# pass command(s) to manager and capture the result\nout, err = mqsc.communicate(\"DISPLAY QL(BP.10240.012.REQUEST)\")\n# wait for command to complete and deal with errors\nretcode = mqsc.wait()\nif retcode != 0:\n print(\"-- ERROR --\") # fancy error handling here\nprint(\"OUTPUT: \", out)\nprint()\nprint(\"ERROR: \", err)In python3,outanderrarebytesobjects, not strings. Similar to using an encoding when you read a text file, you may have to decode them based on whatever language your program uses. Lets say the file was UTF8, then you wouldout = out.decode('utf-8')\n"} +{"text": "### Human: I have a requirement where I have to copy value of MessageID, correlationID, persistence, Expiry and Priority from request MQ message to response. I put the request message in the queue using RFHUtil . but as the message is consumed by the Session beans the messageID of MQMD header changes to some different value -HEXADECIMAL, which is different from the MessageID I put in RFHUTIL.then I copy the above values from request to response message using set methods,- setJMSMessageID etc. but the values are different once I view the response message.\nis this due to MQ to JMS conversion? what can be the solution to this.Earlier I was using MQ Message and was able to copy all fields from request to response.### Assistant: MessageID in IBM MQ is always hexadecimal, no matter from which API it is set, Base MQ or MQ JMS.You don't need to set the MessageID while sending the request message. Let MQ do that for you. MQ will generate a unique message id for the request message. In your session beans, you simply copy the MessageID of the request message to CorrelationID of response message. This way you can correlate request and response messages.SeeIBM WebSphere MQ request/reply scenariofor more details.UPDATEAny value set usingsetMessageIDmethod is ignored when the message is sent, but the method can be used to change the value in a received message.As the message ID set bysetMessageIDmethod is ignored when a message is sent, an application cannot specify the message ID of an outgoing message. As a consequence, an application cannot receive a message and then forward the same message, or send a different message, with the same message ID as that of the message it has received. See thelink:\n"} +{"text": "### Human: I have used MQ Accounting & Statistics many times without a problem, but recently enabled both in order to do some capacity planning.I now find that on a particular queue manager, even though I have disabled them both, I still get messages generated toSYSTEM.ADMIN.ACCOUNTING.QUEUEandSYSTEM.ADMIN.STATISTICS.QUEUE.I'm running MQ V8.0.0.3 and used the following commands to disable the features.ALTER QMGR STATMQI(OFF)\n\nALTER QMGR STATQ(OFF)\n\nALTER QMGR STATCHL(OFF)\n\nALTER QMGR ACCTMQI(OFF)\n\nALTER QMGR ACCTQ(OFF)Any thoughts?### Assistant: You should use NONE instead of OFF.OFF works only if objects has \"Queue Manager\" value of monitoring attributes. \nRead Online Monitoring section:http://www.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.explorer.doc/e_properties_qmanager.htm\n"} +{"text": "### Human: I have the following code for querying authority records from MQ.PCFMessageAgent agent = new PCFMessageAgent(queueManager);\nagent.setCheckResponses(false);\nPCFMessage[] responses;\nPCFMessage request = new PCFMessage(MQConstants.MQCMD_INQUIRE_AUTH_RECS);\nrequest.addParameter(MQConstants.MQIACF_AUTH_OPTIONS,\nMQConstants.MQAUTHOPT_NAME_ALL_MATCHING + MQConstants.MQAUTHOPT_ENTITY_EXPLICIT + MQConstants.MQAUTHOPT_NAME_AS_WILDCARD);\nrequest.addParameter(MQConstants.MQCACF_AUTH_PROFILE_NAME, \"*\");\nrequest.addParameter(MQConstants.MQIACF_OBJECT_TYPE, MQConstants.MQOT_ALL);\nresponses = agent.send(request);When I process the response I get a value of1017for the parameterMQIACF_OBJECT_TYPE.The documentation show only the following values forMQIACF_OBJECT_TYPEMQOT_ALIAS_Q 1002\nMQOT_ALL 1001\nMQOT_AUTH_INFO 7\nMQOT_CF_STRUC 10\nMQOT_CHANNEL 6\nMQOT_CLNTCONN_CHANNEL 1014\nMQOT_CURRENT_CHANNEL 1011\nMQOT_LOCAL_Q 1004\nMQOT_MODEL_Q 1003\nMQOT_NAMELIST 2\nMQOT_PROCESS 3\nMQOT_Q 1\nMQOT_Q_MGR 5\nMQOT_RECEIVER_CHANNEL 1010\nMQOT_REMOTE_Q 1005\nMQOT_REQUESTER_CHANNEL 1009\nMQOT_RESERVED_1 999\nMQOT_SAVED_CHANNEL 1012\nMQOT_SENDER_CHANNEL 1007\nMQOT_SERVER_CHANNEL 1008\nMQOT_STORAGE_CLASS 4\nMQOT_SVRCONN_CHANNEL 1013Why am I getting a value1017?Could this be a combination of various other values?If yes how do I know which ones?, because I can arrive at the number1017through several combination of the above values.### Assistant: As perhttps://www.ibm.com/support/knowledgecenter/SSFKSJ_9.0.0/com.ibm.mq.ref.dev.doc/q092140_.htm1017 is MQOT_REMOTE_Q_MGR_NAMEFor completeness, here's the list of MQOT_ constants from a 9.0.0.0 installation#define MQOT_NONE 0\n#define MQOT_Q 1\n#define MQOT_NAMELIST 2\n#define MQOT_PROCESS 3\n#define MQOT_STORAGE_CLASS 4\n#define MQOT_Q_MGR 5\n#define MQOT_CHANNEL 6\n#define MQOT_AUTH_INFO 7\n#define MQOT_TOPIC 8\n#define MQOT_COMM_INFO 9\n#define MQOT_CF_STRUC 10\n#define MQOT_LISTENER 11\n#define MQOT_SERVICE 12\n#define MQOT_RESERVED_1 999\n#define MQOT_ALL 1001\n#define MQOT_ALIAS_Q 1002\n#define MQOT_MODEL_Q 1003\n#define MQOT_LOCAL_Q 1004\n#define MQOT_REMOTE_Q 1005\n#define MQOT_SENDER_CHANNEL 1007\n#define MQOT_SERVER_CHANNEL 1008\n#define MQOT_REQUESTER_CHANNEL 1009\n#define MQOT_RECEIVER_CHANNEL 1010\n#define MQOT_CURRENT_CHANNEL 1011\n#define MQOT_SAVED_CHANNEL 1012\n#define MQOT_SVRCONN_CHANNEL 1013\n#define MQOT_CLNTCONN_CHANNEL 1014\n#define MQOT_SHORT_CHANNEL 1015\n#define MQOT_CHLAUTH 1016\n#define MQOT_REMOTE_Q_MGR_NAME 1017\n#define MQOT_PROT_POLICY 1019\n#define MQOT_TT_CHANNEL 1020\n#define MQOT_AMQP_CHANNEL 1021\n#define MQOT_AUTH_REC 1022\n"} +{"text": "### Human: I am using IBM.XMS .NET library to write messages to the message queue. I need to set up \"last message in group\" flag to true.textMessage.SetBooleanProperty(\"JMS_IBM_LAST_MSG_IN_GROUP\", true);I got following error message in this line of code: \"The property name JMS_IBM_LAST_MSG_IN_GROUP is reserved and cannot be set.\nThe supplied property name begins with the JMS prefix, but is not one of the supported, settable properties.\nCheck the property name and correct errors.\"\nDo I have any possibility to change this flag from the code? Thanks.### Assistant: You are using a property whose name begins with \"JMS\". As per section 3.5.10 of JMS specification \"JMS reserves the \u2018JMS_\u2019 property name prefix for provider specific properties. Each provider defines their own value of . This is the mechanism a JMS provider uses to make its special per message services available to a JMS client.I suggest you use the XMS defined names or your property with name not beginning with \"JMS\". Below is a working snippet.var msg = session.CreateTextMessage();\n msg.SetStringProperty(XMSC.JMSX_GROUPID, \"ABCDEFGKILDD\");\n msg.SetBooleanProperty(XMSC.JMS_IBM_LAST_MSG_IN_GROUP, true);\n msg.Text = \"Message in group\";\n prod.Send(msg);\n"} +{"text": "### Human: I'm trying to connect to MQ Series 8 using c#.\nI'm using the next code :try{\nMQEnvironment.Hostname = \"xxx\";\nMQEnvironment.Channel = \"xxx\";\nMQEnvironment.Port = 111;\nMQEnvironment.properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);\n\nMQQueueManager mqmm = new MQQueueManager(queueManagerName);\n\n}catch(Exception e){Console.WriteLine(\"Error : \"+e);}How can i set a timeOut connection in this case ?Thanks in advance.### Assistant: You can set the socket time out via theConnect_Timeoutparameter under the TCP stanza in mqclient.ini file. Since socket is a machine resource, connection timeout needs to be set in mqclient.ini file and the change will affect all MQ connections originating from that machine.See here:http://www.ibm.com/support/knowledgecenter/SSFKSJ_9.0.0/com.ibm.mq.con.doc/q016910_.htm\n"} +{"text": "### Human: We are using Spring JMS to connect IBM MQ in that the MQ open input count keep on increase.is there any solution can we reduce the open input count. we are using concurrent connection as 1 only.### Assistant: The IBM MQ connection handle behaves differently with Spring configuration. If you are using the CachingConnectionFactory that spring provides, please read my answer in the below thread.JMS connections exhausted using WebSphere MQPlease add more details to better understand the issue. The Apache camel will dynamically scale up and down the open input counts based on the load. Hope this helps!\n"} +{"text": "### Human: I am new to Spring Integration and new to Stack Overflow. I am looking for some help in understanding Spring Integration as it relates to a request-reply pattern. From reading on the web, I am thinking that I should be using a Service Activator to enable this type of use case.I am using JMS to facilitate the sending and receiving of XML based messages. Our underlining implementation is IBM Websphere MQ.I am also using Spring Boot (version 1.3.6.RELEASE) and attempting to use a pure annotation based configuration approach (if that is possible). I have searched the web and see some example but nothing that so far I can see that helps me understand how it all fits together. The Spring Integration documentation is excellent but I am still struggling with how all the pieces fit together. I apologize in advance if there is something out there that I missed. I treat posting here as a last alternative.Here is what I have for my configuration:package com.daluga.spring.integration.configuration\n\nimport com.ibm.mq.jms.MQConnectionFactory;\nimport com.ibm.mq.jms.MQQueue;\nimport com.ibm.msg.client.wmq.WMQConstants;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.beans.factory.annotation.Qualifier;\nimport org.springframework.beans.factory.annotation.Value;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.integration.annotation.InboundChannelAdapter;\nimport org.springframework.integration.annotation.IntegrationComponentScan;\nimport org.springframework.integration.annotation.Poller;\nimport org.springframework.integration.channel.QueueChannel;\nimport org.springframework.integration.config.EnableIntegration;\nimport org.springframework.jms.annotation.EnableJms;\nimport org.springframework.jms.connection.CachingConnectionFactory;\nimport org.springframework.jms.core.JmsTemplate;\n\nimport javax.jms.ConnectionFactory;\nimport javax.jms.DeliveryMode;\nimport javax.jms.Destination;\nimport javax.jms.JMSException;\n\n//import com.ibm.msg.client.services.Trace;\n\n@Configuration\npublic class MQConfiguration {\n\n private static final Logger LOGGER = LoggerFactory.getLogger(MQConfiguration.class);\n\n @Value(\"${host-name}\")\n private String hostName;\n\n @Value(\"${port}\")\n private int port;\n\n @Value(\"${channel}\")\n private String channel;\n\n @Value(\"${time-to-live}\")\n private int timeToLive;\n\n @Autowired\n @Qualifier(\"MQConnectionFactory\")\n ConnectionFactory connectionFactory;\n\n @Bean(name = \"jmsTemplate\")\n public JmsTemplate provideJmsTemplate() {\n JmsTemplate jmsTemplate = new JmsTemplate(connectionFactory);\n jmsTemplate.setExplicitQosEnabled(true); \n jmsTemplate.setTimeToLive(timeToLive);\n jmsTemplate.setDeliveryMode(DeliveryMode.NON_PERSISTENT); \n return jmsTemplate;\n }\n\n @Bean(name = \"MQConnectionFactory\")\n public ConnectionFactory connectionFactory() {\n CachingConnectionFactory ccf = new CachingConnectionFactory();\n\n //Trace.setOn();\n\n try {\n MQConnectionFactory mqcf = new MQConnectionFactory();\n mqcf.setHostName(hostName);\n mqcf.setPort(port);\n mqcf.setChannel(channel);\n mqcf.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n ccf.setTargetConnectionFactory(mqcf);\n ccf.setSessionCacheSize(2); \n } catch (JMSException e) {\n throw new RuntimeException(e);\n }\n\n return ccf;\n }\n\n @Bean(name = \"requestQueue\")\n public Destination createRequestQueue() {\n\n Destination queue = null;\n\n try {\n queue = new MQQueue(\"REQUEST.QUEUE\");\n } catch (JMSException e) {\n throw new RuntimeException(e);\n }\n\n return queue;\n }\n\n @Bean(name = \"replyQueue\")\n public Destination createReplyQueue() {\n\n Destination queue = null;\n\n try {\n queue = new MQQueue(\"REPLY.QUEUE\");\n } catch (JMSException e) {\n throw new RuntimeException(e);\n }\n\n return queue;\n }\n\n @Bean(name = \"requestChannel\")\n public QueueChannel createRequestChannel() {\n\n QueueChannel channel = new QueueChannel();\n\n return channel;\n }\n\n @Bean(name = \"replyChannel\")\n public QueueChannel createReplyChannel() {\n\n QueueChannel channel = new QueueChannel();\n\n return channel;\n }\n\n}And here is my Service class:package com.daluga.spring.integration.service\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.integration.annotation.ServiceActivator;\nimport org.springframework.stereotype.Service;\n\n\n@Service\npublic class MyRequestReplyService {\n\n private static final Logger LOGGER = LoggerFactory.getLogger(MyRequestReplyService.class);\n\n @ServiceActivator(inputChannel = \"replyChannel\")\n public void sendAndReceive(String requestPayload) {\n // How to get replyPayload\n }\n\n}So, at this point, I am not quite sure how to glue all this together to make this work. I don't understand how to glue together my request and reply queues to the service activator to make this all work.The service I am calling (JMS/Webshere MQ based) is using the typical message and correlation id so that I can properly tied the request to the corresponding response.Can anyone provide me any guidance on how to get this to work? Please let me know what additional information I can provide to make this clear.Thanks in advance for your help!Dan### Assistant: Gateways provide request/reply semantics.Instead of using a JmsTemplate directly, you should be usingSpring Integration's built-in JMS Support.@Bean\n@ServiceActivator(inputChannel=\"requestChannel\")\npublic MessageHandler jmsOutGateway() {\n JmsOutboundGateway outGateway = new JmsOutboundGateway();\n // set properties\n outGateway.setOutputChannel(replyChannel());\n return outGateway;\n}If you want to roll your own, change the service activator method the return a reply type and use one of the templatesendAndReceive()orconvertSendAndReceive()methods.Thesample appuses XML configuration but should provide some additional guidance.\n"} +{"text": "### Human: I am implementing an IBM MQ client using java class as follows;import javax.jms.JMSException;\n\n import com.ibm.msg.client.jms.JmsConnectionFactory;\n import com.ibm.msg.client.jms.JmsFactoryFactory;\n import com.ibm.msg.client.wmq.WMQConstants;\n\n import javax.jms.JMSContext;\n import javax.jms.Topic;\n import javax.jms.Queue;\n import javax.jms.JMSConsumer;\n import javax.jms.Message;\n import javax.jms.JMSProducer;\n\n /*\n * Implements both Subscriber and Publisher\n */\n class SharedNonDurableSubscriberAndPublisher implements Runnable {\n private Thread t;\n private String threadName;\n\n SharedNonDurableSubscriberAndPublisher( String name){\n threadName = name;\n System.out.println(\"Creating Thread:\" + threadName );\n }\n\n /*\n * Demonstrates shared non-durable subscription in JMS 2.0\n */\n private void sharedNonDurableSubscriptionDemo(){\n JmsConnectionFactory cf = null;\n JMSContext msgContext = null;\n\n try {\n // Create Factory for WMQ JMS provider\n JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\n // Create connection factory\n cf = ff.createConnectionFactory();\n // Set MQ properties\n cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, \"QM3\");\n cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_BINDINGS);\n // Create message context\n msgContext = cf.createContext();\n\n // Create a topic destination\n Topic fifaScores = msgContext.createTopic(\"/FIFA2014/UPDATES\");\n\n // Create a consumer. Subscription name specified, required for sharing of subscription.\n JMSConsumer msgCons = msgContext.createSharedConsumer(fifaScores, \"FIFA2014SUBID\");\n\n // Loop around to receive publications\n while(true){\n\n String msgBody=null;\n\n // Use JMS 2.0 receiveBody method as we are interested in message body only.\n msgBody = msgCons.receiveBody(String.class);\n\n if(msgBody != null){\n System.out.println(threadName + \" : \" + msgBody);\n }\n }\n }catch(JMSException jmsEx){\n System.out.println(jmsEx);\n }\n }\n\n /*\n * Publisher publishes match updates like current attendance in the stadium, goal score and ball possession by teams.\n */\n private void matchUpdatePublisher(){\n JmsConnectionFactory cf = null;\n JMSContext msgContext = null;\n int nederlandsGoals = 0;\n int chileGoals = 0;\n int stadiumAttendence = 23231;\n int switchIndex = 0;\n String msgBody = \"\";\n int nederlandsHolding = 60;\n int chileHolding = 40;\n\n try {\n // Create Factory for WMQ JMS provider\n JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\n\n // Create connection factory\n cf = ff.createConnectionFactory();\n // Set MQ properties\n cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, \"QM3\");\n cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_BINDINGS);\n\n // Create message context\n msgContext = cf.createContext();\n\n // Create a topic destination\n Topic fifaScores = msgContext.createTopic(\"/FIFA2014/UPDATES\");\n\n // Create publisher to publish updates from stadium\n JMSProducer msgProducer = msgContext.createProducer();\n\n while(true){\n // Send match updates\n switch(switchIndex){\n // Attendance\n case 0:\n msgBody =\"Stadium Attendence \" + stadiumAttendence;\n stadiumAttendence += 314;\n break;\n\n // Goals\n case 1:\n msgBody =\"SCORE: The Netherlands: \" + nederlandsGoals + \" - Chile:\" + chileGoals;\n break;\n\n // Ball possession percentage\n case 2:\n msgBody =\"Ball possession: The Netherlands: \" + nederlandsHolding + \"% - Chile: \" + chileHolding + \"%\";\n if((nederlandsHolding > 60) && (nederlandsHolding < 70)){\n nederlandsHolding -= 2;\n chileHolding += 2;\n }else{\n nederlandsHolding += 2;\n chileHolding -= 2;\n }\n break;\n }\n\n // Publish and wait for two seconds to publish next update\n msgProducer.send (fifaScores, msgBody);\n try{\n Thread.sleep(2000);\n }catch(InterruptedException iex){\n\n }\n\n // Increment and reset the index if greater than 2\n switchIndex++;\n if(switchIndex > 2)\n switchIndex = 0;\n }\n }catch(JMSException jmsEx){\n System.out.println(jmsEx);\n }\n }\n\n /*\n * (non-Javadoc)\n * @see java.lang.Runnable#run()\n */\n public void run() {\n // If this is a publisher thread\n if(threadName == \"PUBLISHER\"){\n matchUpdatePublisher();\n }else{\n // Create subscription and start receiving publications\n sharedNonDurableSubscriptionDemo();\n }\n }\n\n // Start thread\n public void start (){\n System.out.println(\"Starting \" + threadName );\n if (t == null)\n {\n t = new Thread (this, threadName);\n t.start ();\n }\n }\n }I am new to IBM MQ and can't understand how to resolve following imports.import com.ibm.msg.client.jms.JmsConnectionFactory;\nimport com.ibm.msg.client.jms.JmsFactoryFactory;\nimport com.ibm.msg.client.wmq.WMQConstants;Just resolved other dependencies through jars. Please help on this.### Assistant: You want 'com.ibm.mq.allclient.jar'. You can find this on disk if you have a queue manager installed or MQC8 support pac under INSTALL_DIR/java/lib.\n"} +{"text": "### Human: I have a requirement to convert different text formats into XML object and send to IBM MQ. But for testing purpose I am planning to use Active mq. But my final integration will be IBM MQ. How to make JMS template to be more generic to send across to two different message queuing platforms ?? What would be the best way make JMS as independent module??### Assistant: I suggest you to take a look in to Spring Boot and its JMSauto-configuration.All what you need areapplication.propertiesto be configured externally.spring.activemq.broker-url=tcp://192.168.1.210:9876For ActiveMQ or:spring.jms.jndi-name=java:/MyConnectionFactoryFor IBM WebSphere MQ JMS adapter.By the way you can find Spring Batch auto-configuration in Boot as well.\n"} +{"text": "### Human: I am facing a strange problem with IBM MQ 8.0.0.4. My command line application (Java 8) connects to MQ server installed in linux server from windows environment. The application reads messages from a particular queue as it arrives. I use following jars as client library (8.0.0.4-WS-MQ-Install-Java-All.jar):-com.ibm.mq.allclient.jar\ncom.ibm.mq.traceControl.jar\nfscontext.jar\njms.jar\nJSON4J.jar\nproviderutil.jarThe application runs as usual without any problem. It can be stopped by \"control+c\". When that is done, ThreadGroup.interrupt() is called and the application stops as expected.\nWhat is not expected is:-1) the following stack trace[2016-05-26 14:13:14,023]-[DEBUG]-[ Thread-7]-[com.xyz.app.inf.DecoratorBase.invoke(){106}]-not overridden\n[2016-05-26 14:13:14,316]-[ERROR]-[ Thread-7]-[com.xyz.app.inf.console.launcher.ServiceRunnerBase.serviceInternal(){230}]-Unhanled exception\ncom.ibm.msg.client.jms.DetailedJMSException: JMSWMQ2002: Failed to get a message from destination 'QNAME'.\nWebSphere MQ classes for JMS attempted to perform an MQGET; however WebSphere MQ reported an error.\nUse the linked exception to determine the cause of this error.\n at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:595)\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:215)\n at com.ibm.msg.client.wmq.internal.WMQMessageConsumer.checkJmqiCallSuccess(WMQMessageConsumer.java:213)\n at com.ibm.msg.client.wmq.internal.WMQMessageConsumer.checkJmqiCallSuccess(WMQMessageConsumer.java:261)\n at com.ibm.msg.client.wmq.internal.WMQConsumerShadow.getMsg(WMQConsumerShadow.java:1835)\n at com.ibm.msg.client.wmq.internal.WMQSyncConsumerShadow.receiveInternal(WMQSyncConsumerShadow.java:231)\n at com.ibm.msg.client.wmq.internal.WMQConsumerShadow.receive(WMQConsumerShadow.java:1471)\n at com.ibm.msg.client.wmq.internal.WMQMessageConsumer.receive(WMQMessageConsumer.java:659)\n at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl.receiveInboundMessage(JmsMessageConsumerImpl.java:1036)\n at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl.receive(JmsMessageConsumerImpl.java:671)\n at com.ibm.mq.jms.MQMessageConsumer.receive(MQMessageConsumer.java:209)\n at com.xyz.app.inf.XQueueReceiver.receive(XQueueReceiver.java:141)\n at com.xyz.app.inf.XQueueReceiver.receive(XQueueReceiver.java:100)\n at com.xyz.app.cli.services.impl.MessageRunner.read(MessageRunner.java:440)\n at com.xyz.app.cli.services.impl.MessageRunner.task(MessageRunner.java:201)\n at com.xyz.app.inf.console.launcher.ServiceRunnerBase.serviceInternal(ServiceRunnerBase.java:227)\n at com.xyz.app.inf.console.launcher.ServiceRunnerBase.run(ServiceRunnerBase.java:127)\n at java.lang.Thread.run(Thread.java:745)\nCaused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2195' ('MQRC_UNEXPECTED_ERROR').\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:203)\n ... 16 more\nCaused by: com.ibm.mq.jmqi.local.LocalMQ$4: CC=2;RC=2495;AMQ8598: Failed to load the WebSphere MQ native JNI library: 'mqjbnd'.\n at com.ibm.mq.jmqi.local.LocalMQ.loadLib(LocalMQ.java:1268)\n at com.ibm.mq.jmqi.local.LocalMQ$1.run(LocalMQ.java:309)\n at java.security.AccessController.doPrivileged(Native Method)\n at com.ibm.mq.jmqi.local.LocalMQ.initialise_inner(LocalMQ.java:259)\n at com.ibm.mq.jmqi.local.LocalMQ.initialise(LocalMQ.java:221)\n at com.ibm.mq.jmqi.local.LocalMQ.(LocalMQ.java:1350)\n at com.ibm.mq.jmqi.local.LocalServer.(LocalServer.java:230)\n at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\n at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)\n at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\n at java.lang.reflect.Constructor.newInstance(Constructor.java:422)\n at com.ibm.mq.jmqi.JmqiEnvironment.getInstance(JmqiEnvironment.java:706)\n at com.ibm.mq.jmqi.JmqiEnvironment.getMQI(JmqiEnvironment.java:640)\n at com.ibm.msg.client.wmq.factories.WMQComponent.getImplementationInfo(WMQComponent.java:251)\n at com.ibm.msg.client.commonservices.trace.Trace.getVersion(Trace.java:2092)\n at com.ibm.msg.client.commonservices.trace.Trace.createFFSTString(Trace.java:2050)\n at com.ibm.msg.client.commonservices.trace.Trace.ffstInternal(Trace.java:1935)\n at com.ibm.msg.client.commonservices.trace.Trace.ffst(Trace.java:1736)\n at com.ibm.mq.jmqi.remote.impl.RemoteProxyQueue.proxyMQGET(RemoteProxyQueue.java:2540)\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiGetInternalWithRecon(RemoteFAP.java:7169)\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiGetInternal(RemoteFAP.java:7054)\n at com.ibm.mq.jmqi.internal.JmqiTools.getMessage(JmqiTools.java:1217)\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiGet(RemoteFAP.java:7001)\n at com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.jmqiGet(InterceptedJmqiImpl.java:1325)\n at com.ibm.mq.ese.jmqi.ESEJMQI.jmqiGet(ESEJMQI.java:600)\n at com.ibm.msg.client.wmq.internal.WMQConsumerShadow.getMsg(WMQConsumerShadow.java:1775)\n ... 13 more\nCaused by: java.lang.UnsatisfiedLinkError: no mqjbnd in java.library.path\n at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1864)\n at java.lang.Runtime.loadLibrary0(Runtime.java:870)\n at java.lang.System.loadLibrary(System.java:1122)\n at com.ibm.mq.jmqi.local.LocalMQ.loadLib(LocalMQ.java:1240)\n ... 38 more\n[2016-05-26 14:13:14,326]-[INFO ]-[ Thread-5]-[com.xyz.app.startup.Application.destroy(){433}]-Application shutting down\n[2016-05-26 14:13:14,326]-[INFO ]-[ Thread-5]-[com.xyz.app.startup.Application.cleanup(){608}]-Application.cleanup() called------2) a folder named FFDC is created which contains files named JMSCC0001.FDC, JMSCC0002.FDC etc.The reason why I am saying the stack trace is unexpected is it says that \"no mqjbnd in java.library.path\" which means the application\nis connecting MQ server in bindings mode. But I am connecting in client mode as you can see:com.ibm.mq.jms.MQQueueConnectionFactory@c79b6829 :- \n| | XMSC_ADMIN_OBJECT_TYPE :- 17\n| | XMSC_ASYNC_EXCEPTIONS :- 1\n| | XMSC_CLIENT_ID :- \n| | XMSC_CONNECTION_TYPE :- 1\n| | XMSC_CONNECTION_TYPE_NAME :- com.ibm.msg.client.wmq\n| | XMSC_RTT_DIRECT_AUTH :- 0\n| | XMSC_RTT_PROXY_HOSTNAME :- \n| | XMSC_RTT_PROXY_PORT :- 443\n| | XMSC_WMQ_BROKER_CC_SUBQ :- SYSTEM.JMS.ND.CC.SUBSCRIBER.QUEUE\n| | XMSC_WMQ_BROKER_CONTROLQ :- SYSTEM.BROKER.CONTROL.QUEUE\n| | XMSC_WMQ_BROKER_PUBQ :- SYSTEM.BROKER.DEFAULT.STREAM\n| | XMSC_WMQ_BROKER_QMGR :- \n| | XMSC_WMQ_BROKER_SUBQ :- SYSTEM.JMS.ND.SUBSCRIBER.QUEUE\n| | XMSC_WMQ_CCDTURL :- \n| | XMSC_WMQ_CF_DESCRIPTION :- \n| | XMSC_WMQ_CHANNEL :- NSICHL\n| | XMSC_WMQ_CLEANUP_INTERVAL :- 3600000\n| | XMSC_WMQ_CLEANUP_LEVEL :- 1\n| | XMSC_WMQ_CLIENT_RECONNECT_OPTIONS :- 0\n| | XMSC_WMQ_CLIENT_RECONNECT_TIMEOUT :- 1800\n| | XMSC_WMQ_CLONE_SUPPORT :- 0\n| | XMSC_WMQ_CONNECTION_MODE :- 1\n| | XMSC_WMQ_CONNECTION_NAME_LIST_INT :- \n| | | 0 :- 172.16.31.29(1414)\n| | XMSC_WMQ_CONNECTION_TAG :- [B@161c410\n| | XMSC_WMQ_CONNECT_OPTIONS :- 0\n| | XMSC_WMQ_HEADER_COMP :- \n| | | 0 :- 0\n| | XMSC_WMQ_LOCAL_ADDRESS :- \n| | XMSC_WMQ_MAP_NAME_STYLE :- true\n| | XMSC_WMQ_MAX_BUFFER_SIZE :- 1000\n| | XMSC_WMQ_MESSAGE_RETENTION :- 1\n| | XMSC_WMQ_MESSAGE_SELECTION :- 0\n| | XMSC_WMQ_MSG_BATCH_SIZE :- 10\n| | XMSC_WMQ_MSG_COMP :- \n| | | 0 :- 0\n| | XMSC_WMQ_OPT_PUB :- false\n| | XMSC_WMQ_OUTCOME_NOTIFICATION :- true\n| | XMSC_WMQ_POLLING_INTERVAL :- 5000\n| | XMSC_WMQ_PROCESS_DURATION :- 0\n| | XMSC_WMQ_PROVIDER_VERSION :- unspecified\n| | XMSC_WMQ_PUB_ACK_INTERVAL :- 25\n| | XMSC_WMQ_QMGR_CCSID :- 819\n| | XMSC_WMQ_QUEUE_MANAGER :- NSI\n| | XMSC_WMQ_RECEIVE_EXIT :- \n| | XMSC_WMQ_RECEIVE_EXIT_INIT :- \n| | XMSC_WMQ_RECEIVE_ISOLATION :- 0\n| | XMSC_WMQ_RESCAN_INTERVAL :- 5000\n| | XMSC_WMQ_SECURITY_EXIT :- \n| | XMSC_WMQ_SECURITY_EXIT_INIT :- \n| | XMSC_WMQ_SEND_CHECK_COUNT :- 0\n| | XMSC_WMQ_SEND_EXIT :- \n| | XMSC_WMQ_SEND_EXIT_INIT :- \n| | XMSC_WMQ_SHARE_CONV_ALLOWED :- 1\n| | XMSC_WMQ_SPARSE_SUBSCRIPTIONS :- false\n| | XMSC_WMQ_SSL_CERT_STORES_COL :- \n| | XMSC_WMQ_SSL_CERT_STORES_STR :- \n| | XMSC_WMQ_SSL_CIPHER_SUITE :- \n| | XMSC_WMQ_SSL_FIPS_REQUIRED :- false\n| | XMSC_WMQ_SSL_KEY_RESETCOUNT :- 0\n| | XMSC_WMQ_SSL_PEER_NAME :- \n| | XMSC_WMQ_SSL_SOCKET_FACTORY :- \n| | XMSC_WMQ_STATUS_REFRESH_INTERVAL :- 60000\n| | XMSC_WMQ_SUBSCRIPTION_STORE :- 1\n| | XMSC_WMQ_SYNCPOINT_ALL_GETS :- false\n| | XMSC_WMQ_TARGET_CLIENT_MATCHING :- true\n| | XMSC_WMQ_TEMPORARY_MODEL :- SYSTEM.DEFAULT.MODEL.QUEUE\n| | XMSC_WMQ_TEMP_Q_PREFIX :- \n| | XMSC_WMQ_TEMP_TOPIC_PREFIX :- \n| | XMSC_WMQ_USE_CONNECTION_POOLING :- true\n| | brokerVersion :- -1\n| | failIfQuiesce :- 1\n| | multicast :- 0\n| | version :- 7\n| | wildcardFormat :- 0The above stack trace is not encountered when I use the client library belonging to Websphere MQ 7.0. Please help.### Assistant: The fact that you have an MQRC_UNEXPECTED_ERROR and FDC files means you should really open a PMR with IBM for this one. This is not meant to happen.\n"} +{"text": "### Human: I have a requirement to send xml messages to IBM MQ.Receiving messages from source system and converting into xml and send that to IBM MQ using JMS.Receiving xml messages from source system and sending directly to IBM MQ.For the second requirement, the xml needs to be converted as JMS message using spring batch or else it can be directly send to IBM MQ?Please give me an advise on this.### Assistant: If you're using JMS, then any message you attempt to send to a JMS provider (such as MQ) needs to be wrapped into a class implementing javax.jms.Message:http://docs.oracle.com/javaee/5/api/index.html?javax/jms/Message.htmlIn your instance it really depends how you're storing your XML. I'm not aware of any such thing as an 'XML Message'. I should imagine you're either storing it at a String or an Object of some type.One option is to use a javax.jms.TextMessage with a String representation of your XML.Or if your XML object is serialiseable and the receiving entity can deserialise the Object you could consider a javax.jms.ObjectMessage.\n"} +{"text": "### Human: Can the same files used as certificates for SSL authentication in a C\u266f program be used within Java, or do the certificate files have to be regenerated specifically for the JDK?### Assistant: Yes and no. :-)The C program needs a KDB and the Java program uses a JKS. You can convert between these formats. The result is different files but they represent the same certificate.Therunmqakmprogram does not handle a JKS so you need to use therunmqckmprogram. Type in the command and it will tell you which parms you left out. You want the-convertoption:$runmqckm -keydb\n5724-H72 (C) Copyright IBM Corp. 1994, 2014.\n\nAn action must be specified for this object.\n\n-Command usage-\nObject Action Description\n------ ------ -----------\n-keydb -changepw Change the password for a key database\n -convert Convert the format of a key database\n -create Create a key database\n -delete Delete a key database\n -expiry Display password expiry\n -list Currently supported types of key database.\n -stashpw Stash the password of a key database into a filePLEASE be sure to take a copy of the KDB first. There is at least one bug, depending on the version and Fix Pack you have, in which a syntax error in the command destroys the KDB.\n"} +{"text": "### Human: I am trying to connect toWebsphereMQusingJMS.The following configuration is defined:properties.put(Context.INITIAL_CONTEXT_FACTORY, \"com.ibm.websphere.naming.WsnInitialContextFactory\");\nproperties.put(Context.URL_PKG_PREFIXES, \"com.ibm.ws.naming\");\nproperties.put(Context.PROVIDER_URL, \"iiop://localhost:2809\");\nproperties.put(Context.SECURITY_PRINCIPAL, \"user\")\nproperties.put(Context.SECURITY_CREDENTIALS, \"password\")The following dependencies are included in the Maven POM file:\n com.ibm \n com.ibm.mqjms\n 7.0.1.4\n\n\n com.ibm\n com.ibm.mq.jmqi\n 7.0.1.4\n\n\n com.ibm\n com.ibm.dhbcore\n 7.0\n\n\n\n com.ibm.mq\n com.ibm.mq.jar\n 7.0.1.4\n runtime\nWhen trying to instantiate the context (new InitialContext(properties)), the following exception is thrown:javax.naming.NoInitialContextException: Cannot instantiate class: com.ibm.websphere.naming.WsnInitialContextFactory [Root exception is java.lang.ClassNotFoundException: com.ibm.websphere.naming.WsnInitialContextFactory]\n at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:674)\n at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)\n at javax.naming.InitialContext.init(InitialContext.java:242)\n at javax.naming.InitialContext.(InitialContext.java:216)Is there a maven dependency missing?Thanks### Assistant: Not sure what the maven coordinates are, since I don't think these libraries are in any public repos, so coordinates will be repo specific, but according tothis post, the jar files required are:wssec.jarnaming.jarnamingclient.jarlmproxy.jarsas.jarecutils.jar\n"} +{"text": "### Human: I'm working on a error queue monitoring tool for a company I work for and I have got this thing up and running using Spring Boot doing all my bean set up using annotations (as opposed to using any xml). The tool works (so far) as intended except for the fact that on our error queue (which is IBM's MQ series) some xml messages contain a new line which my JMS listener picks up as its own thing. In fact it would seem it exclusively processes xml message line by line as opposed as a whole message (though it processes entire HL7 messages just fine). This functionality is beyond my knowledge but that's its own question.-When my JMS Listener grabs this newline character it tosses an exception stating that message payload cannot be empty and then rabbles about something at index zero. It initiates a rollback and calls myJMSErrorhandler, problem is though it stays in this loop (forever...). From the debugger it looks like this exception happens somewhere in the Spring code right before it steps into myprocessOrder()method as it never gets to my breakpoints. I'm not on the worksite so I don't have access to the code, nor a stacktrace (hopefully my terrible explanation of the error is sufficient), but I can say the listener is modeled directly from this, from the Spring site:@Component\npublic class MyService {\n\n @JmsListener(destination = \"myDestination\")\n public void processOrder(String data) { ... }\n}So is there anything I have access to; to prevent the rollback from occurring should something like a newline character be picked up? Also, just as a general statement, the newline character could be caused by another application that puts these messages onto the queue, but I want to cover all my bases, and gain some knowledge.EDIT: To clarify an exception is thrown somewhere in the Spring code before my listener is able to handle the message. I get this:Caused by: org.springframework.messaging.converter.MessageConversionException: No converter found to convert to class java.lang.String, message=GenericMessage [payload=\n JMSMessage class: jms_none\n JMSType: null\n JMSDeliveryMode: 2\n JMSExpiration: 0\n JMSPriority: 5\n JMSMessageID: ID:414d5120514d5f4445565f595731202056d7ea6b28797f6b\n JMSTimestamp: 1460469585820\n JMSCorrelationID: null\n JMSDestination: null\n JMSReplyTo: null\n JMSRedelivered: false\n JMSXAppID: perl \n JMSXDeliveryCount: 1\n JMSXUserID: cisadm \n JMS_IBM_Character_Set: ISO-8859-1\n JMS_IBM_Encoding: 273\n JMS_IBM_Format: MQSTR \n JMS_IBM_MsgType: 8\n JMS_IBM_PutApplType: 6\n JMS_IBM_PutDate: 20160412\n JMS_IBM_PutTime: 13594582, headers={JMS_IBM_Character_Set=ISO-8859-1, JMS_IBM_MsgType=8, JMSXUserID=cisadm , jms_priority=5, JMS_IBM_Encoding=273, jms_timestamp=1460469585820, JMSXAppID=perl , JMS_IBM_PutApplType=6, JMS_IBM_Format=MQSTR , jms_redelivered=false, JMS_IBM_PutDate=20160412, jms_deliveryMode=2, JMSXDeliveryCount=1, JMS_IBM_PutTime=13594582, id=1dfefda3-49cb-dfcc-1a31-b8087e3d6ebd, jms_expiration=0, jms_messageId=ID:414d5120514d5f4445565f595731202056d7ea6b28797f6b, timestamp=1460469638210}]\n at org.springframework.messaging.handler.annotation.support.PayloadArgumentResolver.resolveArgument(PayloadArgumentResolver.java:118) ~[spring-messaging-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:77) ~[spring-messaging-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:139) ~[spring-messaging-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:108) ~[spring-messaging-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at org.springframework.jms.listener.adapter.MessagingMessageListenerAdapter.invokeHandler(MessagingMessageListenerAdapter.java:90) ~[spring-jms-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n ... 10 moreNot sure how to resolve this. Suggestions?### Assistant: This has enough views to incline me to post this answer. I basically re-asked this question in a more direct manner with this post:Spring JMSListener - How should it handle empty payloads?, and came to a conclusion. Took someone else's suggestion from the comments and simply changed the parameter type fromStringtojavax.jms.Message. This allows messages with an otherwise empty payload (i.e. empty strings, and even newline characters), to not affect the flow of the listener and it will just process them.Now all you have to do is extract the string from the incomingMessageand then you can check its contents and decide what to do with it. So the listener ends up looking like this: (or at least what I did)@JmsListener\npublic void processOrder(Message message) throws JMSException {\n String convertedMessage = ((TextMessage) message).getText();\n :\n :\n}duffymo was correct in that there is no magic going on. And as you can see in the other post, if you didn't want to use a solution such as this, you could implement your own message converter to do what you want with the message.\n"} +{"text": "### Human: While trying to extract the message from a Queue, I am getting the below error,Original thrown object message: com.ibm.msg.client.wmq.v6.jms.internal.ConfigEnvironment$1: MQJMS2002: failed to get message from MQ queue.\nStack trace:com.ibm.msg.client.wmq.v6.jms.internal.ConfigEnvironment$1: MQJMS2002: failed to get message from MQ queue.\n at com.ibm.msg.client.wmq.v6.jms.internal.ConfigEnvironment.newException(ConfigEnvironment.java:379)\n at com.ibm.msg.client.wmq.v6.jms.internal.MQMessageConsumer.getMessage(MQMessageConsumer.java:3082)\n at com.ibm.msg.client.wmq.v6.jms.internal.MQMessageConsumer.receiveInternal(MQMessageConsumer.java:4544)\n at com.ibm.msg.client.wmq.v6.jms.internal.MQMessageConsumer.receive(MQMessageConsumer.java:4032)\n at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl.receiveInboundMessage(JmsMessageConsumerImpl.java:787)\n at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl.receive(JmsMessageConsumerImpl.java:487)\n at com.ibm.mq.jms.MQMessageConsumer.receive(MQMessageConsumer.java:217)\n at com.myproject.mqqueue.JMSMQTest.extractMessages(JMSMQTest.java:220)I could see the connection has been established properly and getting struck when i try to extract the messages. the current depth is also 20 and I wasn't able to extract the same.Someone could you please let me know, If I am doing something wrong or some configuration needs to be made.Also, Is it mandatory to have a Mq reason code if it is a server side problem like MQRC zzzz?Added more info on the trace:Caused by: java.lang.NullPointerException\n at com.ibm.msg.client.wmq.v6.jms.internal.JMSMessage._parseMcdFolder(JMSMessage.java:3486) \n at com.ibm.msg.client.wmq.v6.jms.internal.JMSMessage._parseMcdFolderUtf8(JMSMessage.java:3627) \n at com.ibm.msg.client.wmq.v6.jms.internal.MQJMSMessage.createJMSMessage(MQJMSMessage.java:607) \n at com.ibm.msg.client.wmq.v6.jms.internal.MQMessageConsumer.isMessageSelected(MQMessageConsumer.java:3712) \n at com.ibm.msg.client.wmq.v6.jms.internal.MQMessageConsumer.getMessage(MQMessageConsumer.java:2745)In regarding with the code, I don't do anything different there, Below are few partsQueueReceiver qReceiver;\n Message message;\n\n message=qReceiver.receive(3000); //Having problem while calling over here### Assistant: I would say that the message on the queue is not an MQRFH2 message.It is a really good idea to also dump out the LinkedException. i.e.catch (JMSException e)\n{\n System.err.println(\"getLinkedException()=\" + e.getLinkedException());\n System.err.println(e.getLocalizedMessage());\n e.printStackTrace();\n}The LinkedException will contain the MQ Reason Code.\n"} +{"text": "### Human: I have a asynchronous method that is responsible for only connecting to the queue and reading from the queue. While trying to read I get an error from the WebSphere dll 'amqmdnet.dll' that says \"Thread was being aborted\". I get this error every time I try to modify the queue in any way, and only when I try to modify from an asynchronous method. I've also tried implementing the IBM.XMS.net dll as this was said to be used for asynchronous messaging, although I get the same error. Is it possible to read a queue from inside an async method? If so, is the implementation for reading/writing different for synchronous and asynchronous when it comes to modifying the queue itself? I can connect to the queue manager just fine, its modifying the queue that's giving me issues.Main:private async Task ReadAsync()\n{\n await MqMessanger.ConnectAsync(); // connects fine\n await MqMessanger.StartReadingAsync(); // errors out\n}MqMessanger: (IBM.XMS.net dll)private XMSFactoryFactory factoryFactory; //used for connection\nprivate IConnectionFactory cf; //used for connection\nprivate ISession sessionWMQ;\nprivate IDestination destination;\nprivate IMessageConsumer consumerAsync;\nprivate MessageListener messageListener;\npublic IConnection QueueManager { get; set; }\n\n//QueueManager has been connected prior to this\nprivate void StartReadingAsync()\n{\n try\n {\n //Creates a session where an Ack is sent to the server to delete the message as soon the message is received. \n sessionWMQ = QueueManager.CreateSession(false, AcknowledgeMode.AutoAcknowledge);\n destination = sessionWMQ.CreateQueue(queueName);\n\n // Create consumer object to read messages from the queue\n consumerAsync = sessionWMQ.CreateConsumer(destination);\n\n // Create a message listener to fire when a message is put on the queue and assign it to consumer\n messageListener = new MessageListener(OnMessageCallback);\n consumerAsync.MessageListener = messageListener; \n }\n catch (Exception ex)\n {\n throw new Exception($\"Error reading from '{destination.Name}'.\", ex);\n }\n}MqMessanger: (amqmdnet dll)//QueueManager has been connected prior to this\nprivate void StartReadingAsync()\n{\n try\n {\n queue = queueManager.AccessQueue(queueName, MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING);\n queueMessage = new MQMessage();\n queueMessage.Format = MQC.MQFMT_STRING;\n queueGetMessageOptions = new MQGetMessageOptions();\n queue.Get(queueMessage, queueGetMessageOptions);\n string message = queueMessage.ReadString(queueMessage.MessageLength);\n //Do something with this message\n }\n catch (Exception ex)\n {\n throw new Exception($\"Error reading from '{destination.Name}'.\", ex);\n }### Assistant: I think there is some confusion here between Asynchronous messaging pattern of IBM MQ and Asynchronous programming concept of .NET Framework.IBM MQ enables application to application connectivity in an asynchronous way through queuing. In a typical client-server pattern, both client and server applications need to be up and running always for data exchange. This is synchronous pattern. In asynchronous pattern, client application and server application arenotrequired to be running always. Client can send a message to MQ and go away. The message will be residing in a MQ queue. If the server application is running, that message will be delivered to server application. The server will process that message and put a reply message into MQ queue and go away. The client application can come back after some time and read the reply message. As you can see client and server applications are not simultaneously but still they are able to communicate in a asynchronous way via MQ.I am not an expert in the newer .NET Framework concepts. Theasyncprogramming concept in .NET Framework is for offloading short tasks that can be independently by the CPU without blocking a thread. For example when the main thread is busy displaying contents of a web page, the job of connecting to a database could be offloaded to a .NET task so that the user is able to interact with the web page.IBM MQ .NET (amqmdnet and XMS) use multiple threads for communicating with a queue manager. I am unsure if 'async' programming technique is suitable when multiple threads are involved. This could be the reason for \"Thread was being aborted\" error.\n"} +{"text": "### Human: I've made a simple websphere client in the past, to connect to our client's websphere mq server - it works.Now, I want to use it to play around and test my own webspehere mq server (trial edition).\nI've downloaded the 8.0.0.4 websphere MQ server for windows, installed it,but now I have issues connecting to it. I've tried a couple of things, manually configuring everything according to some online tutorial but then i tried a simpler approach, uninstalled everything and reinstalled again, and used websphere's default configuration tool.It went smooth, I could use the postcard application quick and easy.\nHowever, now I'm trying to access it via my own client (c#, using the IBM client libraries).\nIt appears I can connect to the listener.\nBy default, there are two channels created in MQ.\nS_SomeName and TO_QM_SomeName.\nIf I connect to S_SomeName, I get error \"2035 MQRC_NOT_AUTHORIZED\" - which seems a good indication that everything is working, as that is some server connection, and it uses admin user, which is by default blocked from accessing it as a client. (that's how i understand that. I'm quite new to this).So I went to try the TO_QM_SomeName hoping it would give me access to any of the queues made by default or made by me.\nBut now, I get error \"2059 MQRC_Q_MGR_NOT_AVAILABLE\" or \"2539 MQRC_CHANNEL_CONFIG_ERROR\" - i've been playing with library versions/server settings, don't remember on which one i got which error. Well...I'm kind of lost now. I cannot find any settings for enabling some user permissions or anything to make it work.\nWhat am I missing? What steps are necessary to make the default configuration work also for clients connecting from localhost/somewhere on the network?### Assistant: Ok, I found the answer thanks to a suggestion in the comments to take a look into logs. (I'm completely new to mq server :)\nSo, first thing was locating the logs, which were C:\\ProgramData\\IBM\\MQ\\qmgrs\\\\errors rather than in program files (which the documentation pointed me to at first).\nNext, simply reading and analyzing the logs gave me a clue as to what was wrong.\nI was accessing the incorrect channel TO_QM_SomeName (as also commented) instead of S_SomeName. However, to access S_SomeName I had to either add user/password combination to the client, or remove user/password validation on the server. I chose the second option.\nTo do that, I had to enter this:\nALTER AUTHINFO(SYSTEM.DEFAULT.AUTHINFO.IDPWOS) AUTHTYPE(IDPWOS) CHCKCLNT(OPTIONAL)REFRESH SECURITY TYPE(CONNAUTH)\nin the runmqsc program, and then in mq explorer remove the blocking rule in channels that blocks all connections. And voila, I can connect to my server now. Thanks for the tips.\n"} +{"text": "### Human: While taking backup of remote queue manager using dmpmqcfg command I am getting MQSC timed out waiting for a response from command server. Below is the command I am using.dmpmqcfg -m -r -x all -a -o mqsc > D:\\RemoteQueueManagerBackup\\RemoteQmgr.txtBefore running this command I created a server and requester channel at both queue manager ends and when executed the above command channels are coming into running state but not able to take backup.For few queue managers its working fine and for few its not working. I checked all the properties between running qmgr and other both looks same.UpdateXmitq queue with the name queue manager is defined both ends eg: Queue Manager A Xmitq as B, For Queue Manager B Xmitq as A. Server and Requester channels are created. When the command is triggered channel are coming into Running state.Any Errors returned from dmpmqcfg? --- No.Whether DLQ is enabled and a queue of the specified name defined? - YesPresence or absence of messages on the DLQ at either end? - Messages are getting stored in Remote Queue Manager Dead Letter Queue.Whether channels between the two QMgrs run when manually started (this can be a triggering problem instead of name resolution)? - Channels are running automatically ( triggering is enabled) NoAuth related errors? The only error we are seeing isAMQ9544: Messages not put to destination queue.Explanation: During the processing of channel \"x.Y\" one or more\n messages could not be put to the destination queue and attempts were\n made to put them to a dead-letter queue. The location of the queue is\n 2, where 1 is the local dead-letter queue and 2 is the remote\n dead-letter queueAction: Examine the contents of the DLQ. Each message is contained in\n a structure that describes why the message was put to the queue, and\n to where it was originally addressed. Also look at previous error\n messages to see if the attempt to put messages to a dlq failed. The\n program identifier (PDI) of the processing program was '5608(10796)'Examined Remote Dead Letter Queue Reason:MQRC_PERSISTENCE_NOT_ALLOWED### Assistant: You do not mention the details of the channels and their XMitQs. In order for the messages to get to the remote machine and the replies to get back each QMgr needs to be able to resolve a path to the other. That meanssomethingmust have the name of the remote QMgr. That something must either be the XMitQ itself or a QMgr alias that points to the XMitQ.For example you haveand. The local QMgr may have a transmit queue namedwhich resolves that destination. Since you do not report any errors from dmpmqcfg, I will assume the messages are getting sent out OK.That means the messages are not getting back. This may be because the remote QMgr's XMitQ has a name like.XMITQinstead of. This can be solved by defining a QMgr alias:DEF QREMOTE('') +\n XMITQ('.XMITQ') +\n RNAME(' ') +\n RQMNAME('') + \n REPLACEIf this is in fact what's wrong, you should see some messages in the DLQ on the remote QMgr - assuming that one is defined and specified in the QMgr attributes.If this does not solve the problem, please provide additional information including:Any errors returned fromdmpmqcfgWhether DLQ is enabled and a queue of the specified name definedPresence or absence of messages on the DLQ at either endWhether channels between the two QMgrs run when manually started (this can be a triggering problem instead of name resolution)Platforms of the QMgrs involvedAny relevant entries from the error logs, including auths errors (for example,mqmis a valid ID on Linux but not on Windows so would generate auths errors in this scenario if the sending QMgr were Linux and the remote QMgr Windows)Update responding to additional info in questionSo it looks like you have at least a couple of issues. The one that you have discovered is that temporary dynamic queues do not take persistent messages. If you think about it, this makes perfect sense. If a message is persistent, this tells MQ to take all precautions against losing it. But a temporary dynamic queue is deleted when the last input handle is released, discarding any messages that it holds.Any attempt to put a persistent message onto a temporary dynamic queue sends conflicting signals to MQ. Should it accept a persistent message that it knows will be implicitly deleted? Or should it not delete the temporary dynamic queue in order to preserve the messages? Rather than try to guess the user's intent, it simply disallows the action. Thus, your persistent reply messages arrive at the local QMgr, find a temporary dynamic queue, and then are diverted to a DLQ.You have already found the solution to this problem. Well, one of the solutions to this problem, anyway -- alterDEFPSISTso that the messages are non-persistent. Another solution would be to use the client connection capabilities ofdmpmqcfgto connect directly to the remote QMgrs rather than routing through a local QMgr.As to the remaining few QMgrs, you need to run the same diagnostic again. Check for error messages, depth in DLQ at both ends, channels running, auth errors. Remember that the resource errors, auth errors, routing problems, etc. can occur at either end so look for error messages and misrouted messages at both QMgrs. Also, verify channels by sending messages to and from both QMgrs to a known queue such asSYSTEM.DEFAULT.LOCAL.QUEUEor an application queue.Another useful technique when playing a game of \"where's my message\" is to trace the message flow by stopping the channels in both directions prior to sending the commands. You can then rundmpmqcfgand see depth on the outbound XMitQ to verify the commands were sent. (You will have to GET-enable the XMitQ if you want to browse the messages since the channel agent GET-disables it. This will let you verify their persistence, expiry values, etc.)Assuming the commands look OK you start the outbound channel only and let the messages flow to the remote QMgr where they are processed. Since the return channel is still stopped, the replies stack up in the return XMitQ. You can view them there to determine things like their persistence, expiry, and return codes/results of the command. If they look OK, start the channel and then look for them on the local QMgr.For the few QMgrs where you still have issues, you should easily be able to find out where the messages are getting lost or being discarded. Keep in mind that non-persistent messages are sent across a channel outside any units of work so if there is no valid destination (or they aren't authorized to it) they are discarded silently. This diagnostic method of trapping them on XMitQs isolates each step so that if they are being discarded you can find out where and why.\n"} +{"text": "### Human: I am trying to setup message channel on IBM MQ v8.I am running IBM MQ Server 8.x on Ubuntu Linux.I have 2 queue managers QM1, and QM2.On QM1, I have created a Sender Channel, and on QM2, I have created a Receiver channel.On QM1:Remote queue definitionDEFINE QREMOTE(RMQ1) DESCR('Remote queue for QM2') REPLACE +\nPUT(ENABLED) XMITQ(QM2) RNAME(Q_ON_QM2) RQMNAME(QM2)Transmission queue definitionDEFINE QLOCAL(QM2) DESCR('Transmission queue to QM2') REPLACE +\nUSAGE(XMITQ) PUT(ENABLED) GET(ENABLED) TRIGGER TRIGTYPE(FIRST) +\nTRIGDATA(QM1.TO.QM2) INITQ(SYSTEM.CHANNEL.INITQ)Sender channel definition for a TCP/IP connection:DEFINE CHANNEL(QM1.TO.QM2) CHLTYPE(SDR) TRPTYPE(TCP) +\nREPLACE DESCR('Sender channel to QM2') XMITQ(QM2) +\nCONNAME('127.0.0.1(**1491**)') //-- QM2's listener is on 1490On 2nd Queue manager (QM2)Local queue definitionDEFINE QLOCAL(Q_ON_QM2) REPLACE PUT(ENABLED) GET(ENABLED) +\nDESCR('Local queue ')Receiver channel definitionFor a TCP/IP connection:DEFINE CHANNEL(QM1.TO.QM2) CHLTYPE(RCVR) TRPTYPE(TCP) +\nREPLACE DESCR('Receiver channel from QM1')At the end of configuration, my sender channel remains in \"Retrying\" state, and Receiver channel remains in \"inactive\" state.How do I get this channel running?### Assistant: At first glance, it appears the problem is with your port. \nThe conname for connection should specify the port where the listener is actually running. Is it 1491 or 1490?CONNAME('127.0.0.1(1491)') //-- QM2's listener is on 1490Verify the listener is running for the receiving qmgr and specify that port in your conname.\n"} +{"text": "### Human: I am working on prototyping a new web service for my company and we are considering Apache Camel as our integration framework. Here is a quick run-down of the high-level architecture:-IBM Websphere MQ as the queuing solution1) we receive http request2) asynchronously persist this request3a) do some processing on the request3b) send to another tier for further processing4) asynchronously update the request record in DB5) respond to callerWhat I want to do is:When a http request comes in, put it on a queue to be processed and wait n seconds. If the web handler doesn't get a response in n seconds, reply to the caller with a custom message\nOnce the request is on the processing queue, a camel route is listening to this queue to process. When it pulls a message from queue, put a copy of the request on a different queue to be persisted asynchronously. Do some processing on the request. Then send it to another queue to be further processed and wait for a response. Then put it back on the persist queue to be asynchronously updated.\nThen respond to web listener. Then web listener responds to web caller.I am reading everything I can about Apache Camel and there is a lot of information about there. I might be on a little bit of information overload, and any help on the following concerns would be greatly appreciated:1)\nIf the web listeners use an InOut exchange (with the first processing tier) without a replyTo queue defined, it will create a temporary queue for the response. What happens if this request times out? I understand I can set a requestTimeout on the exchange and, if it times out, catch that exception and set a custom message. But, will that temporary queue be killed? Or will they build up over time as requests time out?2) \nWhen it comes to scaling the processing tiers (adding more instances of those same routes on different machines), is it customary that if the instance that picks up the response (using a fixed reply to queue) is different than the instance that picked up the request, all the information about the original request is inside the message, so there is no need to share data across instances (unless of course there is data that is shared, like aggregrates and such)?Any other tips and tricks when building a system like this would be very helpful.Thanks!### Assistant: I would say this solution is too complicated and there are too many areas which are hard both in terms of maintenance and also complexity. There is too much many steps mixing async and sync communication.Why not simply the solution to the following steps:Synchronously http requestPut message on MQ with reply to headerMessage is picked up and sent to backendIf reply is not received within a given time transaction is terminated.The reply to queue is removedRequestor is notified.\n"} +{"text": "### Human: We are using WebLogic 10.3.6.0 and IBM MQ 7.5.\nApplication design is to send messages to a dead letter queue (in WebLogic) on re-delivery. The re-delivery happens as the first delivery has failed due to some network issue or database data source failure.My Client wants a way to browse the messages in the dead letter queue from the application GUI and pull them for processing when the network issue or data source issue has been resolved.What is the best way to go about this?I cam across QueueBrowser coupled with activemq or some other implementation. Is QueueBrowser possible with WebLogic? Please suggest on best ways to achieve this requirement.\nKindly pardon if my question is too naive. I am only a PL/SQL programmer.### Assistant: Valerie is referring to the SYSTEM DLQ and application should never ever write to it. Application's should have there own DLQ.i.e. If your application queue is called 'TEST.Q1' then your application DLQ should be called 'TEST.Q1.DLQ'.There is a whole long list of MQ toolshereto view messages and manage your MQ environment.\n"} +{"text": "### Human: 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.\nNow 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.\ncan somebody help me?\nCurrent XSLT:\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n### Assistant: 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 fromMQXQH.MsgDescfield and set it as MQMD request header. Also, you should set MQOD header withMQOD.ObjectQMgrName = MQXQH.RemoteQMgrName\nMQOD.ObjectName = MQXQH.RemoteQNameAt last, you should remove MQXQH header.\nNow 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).\n"} +{"text": "### Human: I am trying to connect to Websphere MQ from Wildfly 9, For this I have added a resource adapter in standalone-full.xmlI am getting this error:16:03:58,387 WARN [org.jboss.as.connector.deployers.RADeployer] (MSC\n service thread 1-1) IJ020017: Invalid archive:\n file:/C:/JAVA/WF9/wildfly-9.0.0.Final/standalone/tmp/vfs/temp/temp755b6e876dab356a/\n content-5c7db729978cd59e/contents/ 16:03:58,389 INFO \n [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread\n 1-4) IJ020001: Required license terms for\n file:/C:/JAVA/WF9/wildfly-9.0.0.Final/standalone/tmp/vfs/temp/temp755b\n 6e876dab356a/content-5c7db729978cd59e/contents/ 16:03:58,395 WARN \n [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread\n 1-4) IJ020009: Invalid connection definition with class-name:\n javax.jms.ConnectionFactory 16:03:58,399 WARN \n [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread\n 1-4) IJ020009: Invalid connection definition with class-name:\n javax.jms.ConnectionFactory 16:03:58,400 WARN \n [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread\n 1-4) IJ020009: Invalid connection definition with class-name:\n javax.jms.ConnectionFactory 16:03:58,448 INFO \n [org.jboss.as.connector.deployment] (MSC service thread 1-4)\n WFLYJCA0006: Registered admin object at java:jboss/contm/ToConTM\n 16:03:58,451 INFO [org.jboss.as.connector.deployment] (MSC service\n thread 1-4) WFLYJCA0006: Registered admin object at\n java:jboss/contm/FromConTM 16:03:58,452 WARN \n [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread\n 1-4) IJ020017: Invalid archive:\n file:/C:/JAVA/WF9/wildfly-9.0.0.Final/standalone/tmp/vfs/temp/temp755b6e876dab35\n 6a/content-5c7db729978cd59e/contents/ 16:03:58,454 INFO \n [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread\n 1-4) IJ020002: Deployed:\n file:/C:/JAVA/WF9/wildfly-9.0.0.Final/standalone/tmp/vfs/temp/temp755b6e876dab356a/cont\n ent-5c7db729978cd59e/contents/ 16:03:58,455 INFO \n [org.jboss.as.connector.deployment] (MSC service thread 1-4)\n WFLYJCA0002: Bound JCA AdminObject [java:jboss/contm/ToConTM]\n 16:03:58,455 INFO [org.jboss.as.connector.deployment] (MSC service\n thread 1-5) WFLYJCA0002: Bound JCA AdminObject\n [java:jboss/contm/FromConTM]my resource adpater looks like this:\n \n wmq.jmsra.rar\n \n \n \n\n \n \n \n \n \n devel.queue.manager\n \n \n NewQueue2\n \n \n \n \n devel.queue.manager\n \n \n NewQueue1\n \n \n \n I have added config properties and removed them added differen properties that might seem useful like use-java-context=\"true\" pool-name=\"jmsConnectionFactory\" use-ccm=\"true\" removed them or made them false, changed the jndi name but it keeps on giving me the same . i have other connection definitions in the standalone-full.xml but they are all bound correctly without issues.Can any one see what I am missing in this case. If i use XATransaction and class-name=\"com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl\"It is fine.. but not with the one above.Thanks in advance### Assistant: The original configs i was given were old and perhaps worked at that time. with WF9 my setup needs to be as belowtested this and it works fine as previously some how they were using javax.jms.ConnectionFactory\n"} +{"text": "### Human: I created certificate request posted this request to authority, got back signed cert. using iKeyman I have added all signers certificates and successfully received signed certificate into my key database. I saw how request was removed when personal cert was added. I closed iKeyman, and when I opened it again Personal cert. was no longer listed? and of cause I cannot received again, because request does not exists anymore. How I can recreate same request, or there any other way of adding personal cert to my key database.Update from comments 15 Sept 2015runmqakm -cert -listshowed list of certificatesOS - Windows Server 2008 R2IKeyman version 8.0.382.CMS provider version 2.45.Account under which all operations where performed is a local admin.My output:C:\\ProgramData\\IBM\\MQ\\ssl>runmqakm -cert -list all -db key.kdb \n5724-H72 (C) Copyright IBM Corp. 1994, 2014. \nSource database password : ****** \nCertificates found \n* default, - personal, ! trusted, # secret key \n! XXX-Root-CA \n! XXX-Intermediate-CA \n! XXX-Issuing-CA \n! ibmwebspheremqusapp1u \n\nC:\\ProgramData\\IBM\\MQ\\ssl>runmqakm -certreq -list all -db key.kdb \n5724-H72 (C) Copyright IBM Corp. 1994, 2014. \nSource database password : ****** \nNo certificate requests were found### Assistant: You are correct that the KDB has no personal cert and no outstanding CSR. However, if the cert with the labelibmwebspheremqusapp1uis the one that is supposed to be the personal cert, it is now loaded as a trusted cert. There is no way to recover the private key from the KDB as described and if there's no backup file, that cert is irrecoverable. The best you can hope for is that the CA is one which allows customers to re-key a certificate.It is not possible to arrive at this state without having issued arunmqakm -cert -add. The expected command would have been arunmqakm -cert -receivewhich would combine the response from the CA with the original outstanding CSR and create a complete personal certificate. Either that was done, or else this isn't the KDB in which that CSR was created, because as you point out, there are no outstanding CSRs.Assuming there's no GSKit bug causing this and that this is the same KDB in which the CSR was created, then at some point after successfully receiving the CSR the personal cert was deleted and the response from the CA re-added usingrunmqakm -cert -add. The alternatives are that the CSR was explicitly deleted (which I'm guessing you'd remember if that was the case) or else GSKit has a nasty and dangerous bug which you are so far the only person to discover.It's difficult from this side of the screen to definitively determine GSKit bug or user error, however it is possible from your end to a) prevent this from ever happening again; and b) possibly make that definitive determination. \"How do I do that,\" you ask?Always back up a KDB or JKS before issuing commands against it once it has a private key, CSR or a personal certificate in it. You can always restore the trusted certs but a private key or anything that contains one is one-of-a-kind and irreplaceable. Don't risk losing it by operating against the only copy in existence.For example, after submitting the CSR and on receipt of the response from the CA, copy thekey.*files tokey.[timestamp].*and mark the backup files as read-only before receiving the CSR back in. If thereceivesucceeds then you are good to go. If not, you can copy the backups over the bad kdb, or into a new set of kdb files (never operate on the backups!) and attempt to recreate the problem to determine whether it's a bug or user error.The backup KDB with the outstanding CSR will always get you back to the state you were in right after creating the CSR so you can retrace your steps as many times as necessary. If you can reliably recreate the error and believe it's a GSKit bug, open a PMR with IBM. It's an unlikely scenario but I know it happens because I once discovered a GSKit bug that blows away the entire keystore. Hence my slavish adherence to a backup-before-changing strategy. Like you, I too learned it the hard way.\n"} +{"text": "### Human: How to get Websphere MQ Queue depth in case of Multi Instanced environment.For a single instance we are getting a queue depth using the MQManager like this:@SuppressWarnings(\"unchecked\")\n private MQQueueManager createQueueManager() throws MQException {\n MQEnvironment.channel = channel;\n MQEnvironment.port = port;\n MQEnvironment.hostname = host;\n MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES);\n return new MQQueueManager(manager);\n }For Websphere MQ in multi-instancing environment how to perform the same ?### Assistant: You can do it either of these ways:Use a load balancer which is capable of routing the TCP connections based on the availability of the queue manager instances behind it, and connect to the address of the load balancer instead of directly to the queue manager.Use a Client Channel Definition Table to specify the parameters for the queue manager connection. You will need to configure a queue manager group containing the instances of your queue manager and connect using the CCDT:https://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.1.0/com.ibm.mq.doc/ja11090_.htm\n"} +{"text": "### Human: I am working on a High Availability solution using multi-instance queue managers and F5 BigIP/LTM host which holds the pool of active and passive MQ nodes. The BigIP configuration will have a health check script which will identify the active and passive nodes for the MI queue manager and redirect the client connections to the active node all the time. In order to achieve this I like to know all the internal checks performed by a multi-instance queue manager before switching from Active node to passive node so that I can apply the same logic on our health check scripts. Also I like to know whether BigIP configuration supports a MQ health check?### Assistant: Multi-instance queue managers compete for leased file locks on an NFS4 file system. The passive node activates when it acquires the lock. F5 willnotbe able to use the same method to check on QMgr health.The best advice is to use the functionality built into MQ. As of the end of next month (September 2015) all versions of MQ in support by IBM can use a multi-instanceCONNAME. So if you need F5 to find the active QMgr as of next month, the only possible reason is that the clients are on an unsupported version of MQ. Hopefully, that's a higher priority issue than configuring F5 to duplicate native MQ functionality - assuming your company is paying for IBM support and expects to receive it when a PMR is opened.That said, to configure F5 with MQ you should set it up for TCP half-connect and then to poll the MQ listener port on each of the two IP addresses. If it can connect, then the live IP is the active QMgr and the other IP in the pair is a QMgr that has failed or is in standby. There are cases in which the MQ listener is up but the application cannot connect, for example when the QMgr is quiescing, but it's the app's job to deal with those types of connection issues. F5 cannot shield the app from that.\n"} +{"text": "### Human: I'm using the following code for returning handles of a queue, if the queue does not have any handle (open input/output count would be 0) it return MQRCCF_Q_STATUS_NOT_FOUND but when it has some open handle, it returns \"Unknown type\" exception.public void getQueue(string Name)\n {\n PCFMessage reqeuestMessage = new PCFMessage(MQC.MQCMD_INQUIRE_Q_STATUS);\n reqeuestMessage.AddParameter(MQC.MQCA_Q_NAME, Name);\n reqeuestMessage.AddParameter(CMQCFC.MQIACF_Q_STATUS_TYPE, CMQCFC.MQIACF_Q_HANDLE);\n PCFMessage[] response = agent.Send(reqeuestMessage);\n foreach (PCFMessage st in response)\n {\n ...\n }\n }### Assistant: MQ PCF support in C# is limited , so it may not support some parameters. It's possible that the parameter that you are trying to inquire is not in the list of supported parameters. Please note MQ PCF in .NET is not officially supported by IBM MQ.If your intention is to inquire the number of applications have opened a queue for input & output, you can use the INQUIRE_Q command and filter out input/output count. Sample snippet is here:PCFMessage reqeuestMessage = new PCFMessage(MQC.MQCMD_INQUIRE_Q);\n reqeuestMessage.AddParameter(MQC.MQCA_Q_NAME, \"Q1\");\n\n // Send request and receive response\n PCFMessage[] pcfResponse = messageAgent.Send(reqeuestMessage);\n\n // Process and print response.\n int pcfResponseLen = pcfResponse.Length;\n for (int pcfResponseIdx = 0; pcfResponseIdx < pcfResponseLen; pcfResponseIdx++)\n {\n PCFParameter[] parameters = pcfResponse[pcfResponseIdx].GetParameters();\n foreach (PCFParameter pm in parameters)\n {\n // We just want to print current queue depth only\n if ((pm.Parameter == MQC.MQIA_OPEN_OUTPUT_COUNT) || (pm.Parameter == MQC.MQIA_OPEN_INPUT_COUNT))\n Console.WriteLine(\"Parameter: \" + pm.Parameter + \" - Value: \" + pm.GetValue());\n }\n }Hope this helped\n"} +{"text": "### Human: Although documented as tested against Glassfish, use of the IBM native MQ resource adapter (wmq.jmsra.rar) by Message Driven Beans in Glassfish is far from being obvious. There are numerous standard configuration facilities defined by EJB and JCA standards that actually do not work, especially regarding activation specifications.I know three MQ adapters for glassfish: one is theGenericJMSRAfrom Oracle:hereandhere. The second iswmq.jmsrafrom IBM (installation notes) and available from * IBM Fix Central*. To use it, you must indeed own a MQ licence for the queue manager you will connect to but you can download with a free IBM ID. I am using this second Resource Adapter from IBM because it provides access to native MQ API in java which I need in order to address precisely crafted MQ messages to some pure MQ (non-JMS) destinations.There exists a third--legacy--alternative:JMSJCAhere, once my favorite, but support stopped at MQ V6 in Glassfish 3 and JRE6. My attemps to upgrade the source code to MQ v7.5 (or V8 = JMS2.0) with JRE7 in Glassfish 4 (=JMS2.0) or even down to glassfish 3.1 (=JMS1.1) have been defeated on classloader issues and, once that was solved, class cast exceptions / incompatible connection object versions, etc.I finally got the IBM RA working in a narrow configuration that I document in the reply post. If anyone found alternate remedies and configurations that work too, notably avoiding some pitfalls evoked below, that will be much welcome.here is a quick listing of the major problems encountered:admin objects once created yield: RAR8029:Resource [ jms/MyAdminObj ] of type [ aor ] is not enabled: solvedhereMQException: JMSCMQ0001: ... ('MQRC_HOST_NOT_AVAILABLE')caused byJMSWMQ0018: Failed to connect to queue manager '' with connection mode 'Client' and host name 'localhost(1414)'... although you can sware it the relevant remote_host-port-channel-queueManager details are well in place in the created connection pools or even as default values in the ra.xml of the RA being deployedException during endpoint activation for ra [ jmsra ], activationSpecClass [ com.sun.messaging.jms.ra.ActivationSpec ]... revealing that your activation specs actually gets routed to the internal JMS Resource adapter and not the MQ Resource adapter as you believe it shouldWARN j.e.r.r.com.sun.enterprise.connectors.util - RAR8000 : The method setConnectionFactoryLookup is not present in the class : com.sun.messaging.jms.ra.ActivationSpecandWARN j.e.r.r.com.sun.enterprise.connectors.util - RAR8000 : The method setConnectionFactoryLookup is not present in the class : com.sun.messaging.jms.ra.ActivationSpecfollowed by successful deployment of your Message Driven Bean, possibly making you believe, unless you keep an eye on server logs, that your MDB is now listening to the right destination... but will actually not consume a single messageFinding the places where the relevant documentation is stored was also a messy endeavor. Here is:Clues on the meaning of all parameters in the wmq.jmsra ra.xml in MQ v7.5 can be found in MQ Websphere 7.5 infocenter > Reference >\u2026Properties of WebSphere MQ classes for JMS objectsand use of the resource adapter is documented in MQ Websphere 7.5 infocenter > ...The WebSphere MQ resource adapterbut will not work strictly as documented### Assistant: Here is the one sequence of steps I presently found to get a pair of respectively input and output message driven beans to work with the IBM MQ wmq.jmsra adapter.First, be sure to install compatible releases, for instance:GF3 (GlassFish v3.1.2 precisely) with IBM MQ 7.5 Resource adapter and JRE7, altogether supporting JMS1.1. This is the configuration I do refer to in the following.GF4 with MQ 8 RA and JRE7 or JRE8... should work too under JMS2.0, but personally not yet testedFor the outbound side, follow these steps:Install Glassfish 3 (docs here)download the IBM MQ 7.5 Resource adapter fromIBM fix central, search key == \"resource adapter\" under \"Websphere MQ\" product, v7.5 and follow installation procedurehere(you get a jar that you must execute with java -jar ...); docshereand ra.xml configuration propertiesherestart the glassfish web console and under \"applications\" deploy the IBM RAwmq.jmsra.rar; no need to update any ra.xml configuration properties.still in the console, create a Resources > Connector > connection pool to whom you can attach the usual set of MQ parameters for a Queue manager like: port 1414, localAddress 10.0.0.66, failIfQuiesce true, hostName bhdev, queueManager QM_BHDEV, channel BRK.SVRCONN. Be sure to select the needed type of factory, e.g. javax.jms.QueueConnectionFactorythen create a Resources > Connector > Resources and give a JNDI name to your just created pool, e.g. jms/QM_BHDEV_QCFthat is enough to try outbound connections. Using EJB3.1 annotations, the following code pieces do the job:in your class scope:@Resource(mappedName = \"jms/QM_BHDEV_QCF\")\nprivate QueueConnectionFactory brokerQCF;then under a method scope:QueueConnection queueConn = null; \nQueueSession queueSession = null;\nQueueSender sender = null;\nString queueUrl = \"queue:///TEST.Q4?persistence=-1\"; // cf. url-open MQ URL IBM format, or use a plain MQ queue name and set parameters via java API.\ntry {\n queueConn = brokerQCF.createQueueConnection();\n queueSession = queueConn.createQueueSession(true, queueSession.SESSION_TRANSACTED);\n sender = queueSession.createSender(queueSession.createQueue(queueUrl));\n TextMessage txtMsg = queueSession.createTextMessage();\n txtMsg.setText(\"helllo world\");\n sender.send(txtMsg);\n sender.close();\n queueSession.close();\n queueConn.close();\n} catch (JMSException e) {\n // error handling ...\n}On the inbound side, you need an activation spec. The wmq.jmsra connection factories will not allow you to specify the relevant MQ connection pool using annotations (e.g. \"connectionFactoryLookup\" Activation config property in EJB3.1 specs). You must instead combine a glassfish-ejb-jar.xml deployment descriptor with your EJB annotations. Moreover, I noted that all queue manager definition parameters in the referenced connection pool are ignored and you must explicitlyre-specifythem either in the Activation config properties (as illustrated below), or in theejb-jar.xmldeployment descriptor. Last but not least, you shall not forget that the needed administered objects (for the MQ destination to listen to) will (mysteriously) not be enabled and a extra step is required to fix this.Follow these steps:in glassfish admin console, create a Resources > Connector > Admin object for the destination queue to listen to. Do not much care about properties like the physical queue name which will be overloaded! give it a name, e.g. 'jms/testq1'glassfish will complain about the 'aor' (admin object resource) not enabled even if you checked the relevant enabled checkbox; moreover, if you inspect the jndi tree, your admin object is not present.Stop glassfish, and edit the domain.xml for\n\n \n \n connectorMQin\n jms/testq1\n \n jms/QM_BHDEV_QCF\n \n \n wmq.jmsra\n \n \n \nYou may then use the following activation spec and code extract to listen to an MQ queue:@MessageDriven(name=\"connectorMQin\",\nactivationConfig = {\n @ActivationConfigProperty(propertyName=\"destination\", propertyValue=\"TEST.Q1\"), \n @ActivationConfigProperty(propertyName=\"hostName\", propertyValue=\"10.0.0.66\"), \n @ActivationConfigProperty(propertyName=\"port\", propertyValue=\"1414\"), \n @ActivationConfigProperty(propertyName=\"queueManager\", propertyValue=\"QM_BHDEV\"),\n @ActivationConfigProperty( propertyName =\"destinationType\", propertyValue = \"javax.jms.Queue\"),\n @ActivationConfigProperty( propertyName =\"clientId\", propertyValue = \"wmq.jmsra.id\") }, \nmappedName = \"jms/testq1\")\n@TransactionManagement(TransactionManagementType.BEAN)\npublic class MqIn implements MessageListener {\n\n public void onMessage(Message in_msg) {\n // ...\n try {\n if (in_msg instanceof TextMessage) {\n in_bodyText = ((TextMessage) in_msg).getText();\n // ... etc\n }\n } catch ( // ... etc... that worked for me.The pitfall is: the entire configuration details are now hard-wired into the source code. With dozen connections, and because (to my knowledge) EL expressions will not work in this source code, you may want to relocate all activation properties (inclusive of the mapped name pointing to the queue to listen to) into corresponding ejb-jar.xml elements, and then you will be able to build connector instances with variant ejb-jar.xml templates...? Has any one a better suggestion or alternative that avoids this unnecessary complexity? (reminding that I observed that connection pool properties handled ok in the outbound/factory side are ignored on the inbound/activation side...)\n"} +{"text": "### Human: My app is running on a server with MQ Client installed. I want to issue create and delete queue commands on a queue manager running on a different server.I know this is possible by issuingrunmqsc -w commands on a local queue manager, but we don't have a local queue manager running (only MQ Client).Is this possible?### Assistant: If you are using MQ v8, then you can administer remote queue manager without the need of a local queue manager. Just the MQ Client installation is required. The-coption makes the runmqsc to connect to remote queue manager using a client connection.runmqsc -c You will need to set eitherMQSERVERorMQCHLLIB and MQCHLTABenvironment variable for runmqsc to find the queue manager connection information.More detailshereYou can also use MQ Explorer GUI to administer a remote queue manager.\n"} +{"text": "### Human: I am facing above error while connecting to queue manager. Let me first explain you what I'm doing.I have created a new user on Linux machine(test) and then created a server connection channel(xystest.SVRCONN) with MCAUSER as test on XHUB queue manager.Later i have granted access with the below commands.setmqaut -m XHUB -t qmgr -p test +connect\n\nsetmqaut -m XHUB -n '**' -t q -p test +dsp +inq\n\nsetmqaut -m XHUB -n '**' -t channel -p test +dspWhen i try connecting to XHUB using the xystest.SVRCONN I am facing above error.Can you please help me in understand where i have made mistake while allowing test user to access WMQ ?### Assistant: I think you should add +inq +dsp permissions for the queue manager too:setmqaut -m XHUB -t qmgr -p test +connect +inq +dsp\n"} +{"text": "### Human: We are using WebSphere MQ client adapters on an AIX box to send messages via MQ. We send them to the outbound remote queue on the same box and find it quite slow to get to their destination - a 27mb file takes 3 minutes to run the MQQueue.put command.Bizarrely we can change the send parameters to send to an outbound remote queue on an entirely different box and it will send the file in 2 seconds. Similarly coming back to this box from elsewhere will be quick. And sending from another box to the outbound remove queue on that same box is also slow.So in summary the problem appears to be when sending to the outbound remote queue on the same box - we have tried specifying the destination by dns name, ip address, 127.0.0.1 etc, but no luck.Would be grateful for any advice.### Assistant: Try see if tcp_nodelayack makes a difference on the box. If you are at a new enough MQ level (which one are you at?) then you can just set MQ_SET_NODELAYACK to affect just MQ or alternatively (or for a quick test) just set it system wide on AIX with the 'no' command listed in the first link below.Seehttp://www-01.ibm.com/support/docview.wss?uid=swg21320862FYI apar which adds the MQ specific env var optionhttp://www-01.ibm.com/support/docview.wss?uid=swg1IZ43635As an aside I'd also recommend trying MQ v8 client to stop MQ playing with the buffer sizes and let the o/s default them, but from the sounds of your problem I would not be surprised if the above helps.\n"} +{"text": "### Human: I have a java application, which can send and receive messages to/from queues, and I'm trying to set it up to useMQ AMSonLinux.It is first time I'm settingMQ AMSup at all, so I'm trying the examples provided in theMQ distribution(JmsProvider/JmsConsumer).Initially, I triedWebSphere MQ 7.5, which comes withjava 6prepacked, and I could set it up, created a queue, used the attached samples to send and receive encoded messages.However, my application is not compatible withjava 6.I downloadedibm jdk 8, and tried to set that up.It works if the messages are not encoded; however if security policy is enabled, I can send messages to the queue using WebSphere's ownJmsProducer, but can't get messages using their ownJmsConsumer- getting a genericMQRC_NOT_AUTHORISEDerror (same as the one below, except for java version). I've turned offchannel authorisation, and made sure the user I'm using to create messages is specified asMCAUSERon the queue manager. My user is not in themqm group, however, because the group doesn't exist (and my Linux distribution doesn't react toaddgroupwith anything other thanunknown command).I then thought that may be thejava 8distribution I have is missing something vital toMQ, so I downloadedWebSphere MQ 8, which containsjava 7, and tried runningJmsProducer/JmsConsumeragain using this newjava 7, against my oldMQ 7.5queue. The results are the same - the producer successfully produces and places the message on the queue, but the consumer falls over withnot authorised.[userName@machineName ~]$ /opt/mqm/java/jre64/jre/bin/java -showversion -classpath $CLASSPATH JmsConsumer -m QM_TEST_AMS -d TEST.Q -h hostName -p 1616 -l CHANNEL > JmsConsumer.output\njava version \"1.7.0\"\nJava(TM) SE Runtime Environment (build pxa6470_27sr2-20141026_01(SR2))\nIBM J9 VM (build 2.7, JRE 1.7.0 Linux amd64-64 Compressed References 20141017_217728 (JIT enabled, AOT enabled)\nJ9VM - R27_Java727_SR2_20141017_1632_B217728\nJIT - tr.r13.java_20141003_74587.01\nGC - R27_Java727_SR2_20141017_1632_B217728_CMPRSS\nJ9CL - 20141017_217728)\nJCL - 20141004_01 based on Oracle 7u71-b13\n\ncom.ibm.msg.client.jms.DetailedJMSSecurityException: JMSWMQ2008: Failed to open MQ queue 'TEST.Q'.\nJMS attempted to perform an MQOPEN, but WebSphere MQ reported an error.\nUse the linked exception to determine the cause of this error. Check that the specified queue and queue manager are defined correctly.\nInner exception(s):\ncom.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED').\nFAILUREThese messages can still be received if I switch to java 6 though.\nCould please somebody point me in the direction of what I might be missing, that prevents java 7/8 applications from receiving encoded messages from the queue, while java 6 applications continue to work as normal? Does WebSphere MQ 7.5 work with java 7/8 at all?### Assistant: According to theWMQ System Requirements page for v7.5 on Linux, JTE 8.0 is not yet supported.For what its worth, v8.0 has the same requirements as you can seehere. The top-level System requirements page for all versionsis here.That said, it sounds like you have a policy or cert issue, not a JRE issue. When sending messages that are encrypted, the sender has to have the public key of the recipient's certificate. The recipient has to have the public key of the sender. Both have to have their own personal certificates, of course. The AMS policy must specify all possible recipients, even if one of them is the sender.You haven't posted your policy settings or keystore details. Those would be required to debug this (and probably posted in a different question since this one is on JRE versions). Also, a 2035 would throw an event message. Enable Authorization events and install theMS0P SupportPacinto MQ Explorer to view them in theSYSTEM.ADMIN.QMGR.EVENTqueue.\n"} +{"text": "### Human: I need to send multiple messages at once to N topics. The messages know how to route themselves. If any of the publications fails, all of the prior publications need to rollback. Is this possible on Websphere MQ and, if so, how?### Assistant: If by \"any of the publications fails\" you mean the delivery of the publication to the QMgr, then put all the messages under a single unit of work and then issue aCOMMIT.If by \"any of the publications fails\" you mean the final delivery of the messages to the subscribers then no. This is asynchronous messaging. The basic idea of async messaging is the decoupling of the apps sending and receiving the messages. It is by design that the sending app doesn't know atPUTtime whether the receiving app can get the message or not. Pub/Sub takes that one step further by allowing publishers and subscribers to dynamically join or leave without affecting existing message distribution.In an async messaging design if there is a need to account for delivery to some number of recipients, one would generally use a distribution list instead of Pub/Sub (because if you know in advance who the subscribers are and it doesn't change a list is sufficient), conformation messages to acknowledge receipt, and compensating transactions to back out error conditions.\n"} +{"text": "### Human: We have been using jms point-to-point sampler in jmeter to post an xml based request to the MQ. Since then our application has changed and now the messages that are posted to the MQ are Serialable objects created with spring integration. To have a test around this, we tried using jms publisher/subscriber. All the online support we tried is pointing to connection to ActiveMQ. Has anyone tried using jms published to post object message to and IBM MQ?### Assistant: The online approach gives you all the elements to switch to IBM MQ.You would need to:put IBM MQ jars in lib folder of jmeterFind the infos needed for :http://jmeter.apache.org/usermanual/component_reference.html#JMS_Subscriberhttp://jmeter.apache.org/usermanual/component_reference.html#JMS_PublisherThis will help you:http://leakfromjavaheap.blogspot.com/2014/07/jmeter-and-websphere-mq-series.html?_sm_au_=iVV5P5vR626sDt7V\n"} +{"text": "### Human: Without SSL i am able to connect but with SSL it throws below error in MQ logAMQ9660: SSL key repository: password stash file absent or unusable.\n\nEXPLANATION:\nThe SSL key repository cannot be used because MQ cannot obtain a password to\naccess it. Reasons giving rise to this error include: \n(a) the key database file and password stash file are not present in the\n location configured for the key repository, \n(b) the key database file exists in the correct place but that no password\n stash file has been created for it, \n(c) the files are present in the correct place but the userid under which MQ is\n running does not have permission to read them, \n(d) one or both of the files are corrupt. \n\nThe channel is '????'; in some cases its name cannot be determined and so is\nshown as '????'. The channel did not start.\nACTION:\nEnsure that the key repository variable is set to where the key database file\nis. Ensure that a password stash file has been associated with the key database\nfile in the same directory, and that the userid under which MQ is running has\nread access to both files. If both are already present and readable in the\ncorrect place, delete and recreate them. Restart the channel. \n----- amqccisa.c : 5577 -------------------------------------------------------\n6/30/2015 12:15:33 - Process(14120.5) User(locahost) Program(amqrmppa.exe)\n Host(localhost) Installation(Installation1)\n VRMF(7.5.0.2) QMgr(QM1)\n\nAMQ9492: The TCP/IP responder program encountered an error.Here is the code which produces the error:import javax.jms.JMSException;\nimport javax.jms.Session;\n\nimport com.ibm.mq.*;\nimport com.ibm.jms.JMSMessage;\nimport com.ibm.jms.JMSTextMessage;\nimport com.ibm.mq.jms.JMSC;\nimport com.ibm.mq.jms.MQQueue;\nimport com.ibm.mq.jms.MQQueueConnection;\nimport com.ibm.mq.jms.MQQueueConnectionFactory;\nimport com.ibm.mq.jms.MQQueueReceiver;\nimport com.ibm.mq.jms.MQQueueSender;\nimport com.ibm.mq.jms.MQQueueSession;\n\nimport java.io.*;\n\nimport javax.net.ssl.*;\n\nimport java.net.ServerSocket;\nimport java.net.Socket;\nimport java.security.KeyStore;\n/**\n * simple testcase for Point-to-point messaging .\n */\npublic class MQTEST {\n /**\n * Main method\n *\n * @param args\n */\n public static void main(String[] args) {\n try {\n SSLContext context = SSLContext.getDefault();\n System.setProperty(\"javax.net.ssl.trustStore\",\"D:\\\\IBM\\\\CERT\\\\truststore.jks\");\n System.setProperty(\"javax.net.ssl.keyStore\",\"D:\\\\IBM\\\\Websphere\\\\Qmgrs\\\\QM1\\\\ssl\\\\key.kdb\");\n System.setProperty(\"javax.net.ssl.keyStorePassword\",\"password\");\n\n\n\n\n\n MQQueueConnectionFactory cf = new MQQueueConnectionFactory();\n\n // Config\n cf.setHostName(\"localhost\");\n cf.setPort(1414);\n cf.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);\n cf.setQueueManager(\"QM1\");\n cf.setChannel(\"SYSTEM.SSL.SVRCONN\");\n // cf.setChannel(\"SYSTEM.DEF.SVRCONN\");\n\n cf.setSSLCipherSuite(\"TLS_RSA_WITH_AES_128_CBC_SHA\");\n\n\n\n MQQueueConnection connection = (MQQueueConnection) cf.createQueueConnection();\n\n\n MQQueueSession session = (MQQueueSession) connection.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE);\n MQQueue queue = (MQQueue) session.createQueue(\"queue:///LQ1\");\n MQQueueSender sender = (MQQueueSender) session.createSender(queue);### Assistant: The error log format and wording of the question suggest that it is the queue manager which is unable to access its KDB keystore.(Note: When providing an error log, please let us know if you got it from the QMgr or the client! \"MQ log\" could go either way.)With this in mind, you should run through the setup procedure for provisioning the queue manager's certificate. This includes:Generate an empty KDB file specifying the \"stash password\" optionGenerate a self-signed certifiate or Cert Signing Request (CSR)If this is for a CA-signed certificate...Get the CSR signedImport the Certificate Authority's signer certs into the QMgr's KDB and client keystoreReceive the signed CSR into the keystoreIf this is for self-signed certificate...Extract the public portion of the self-signed certImport the self-signed cert into the client's keystoreIf you omitted any of these steps, pick up where you left off.If you forgot to stash the password or the stash file is damaged, recreate it using the iKeyman GUI or the appropriate option of therunmqakmcommand.Note that if the KDB is completely absent the QMgr still throws the error above. This is because the very first thing it does is to try to open the stash file. If it cannot find it thepassword stash file absent or unusableerror is thrown. This is true even when no KDB has ever been created.\n"} +{"text": "### Human: I have installed IBM MQ 7.5.0.5 client and adding ALL the jars under C:\\Program Files (x86)\\IBM\\WebSphere MQ\\java\\lib to the classpath of my Java application. But when writing to the queue using my Java program I get following exception:java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key MQJE001b\n at java.util.ResourceBundle.getObject(Unknown Source)\n at java.util.ResourceBundle.getString(Unknown Source)\n at com.ibm.mq.MQException.getMessage(MQException.java:1638)\n at com.ibm.mq.ReasonCodeInfo.getResourceException(ReasonCodeInfo.java:191)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnection(MQClientManagedConnectionFactoryJ11.java:600)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnection(MQClientManagedConnectionFactoryJ11.java:630)\n at com.ibm.mq.StoredManagedConnection.(StoredManagedConnection.java:107)\n at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:205)\n at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:911)\n at com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:799)\n at com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:750)\n at com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:157)\n at com.ibm.mq.MQQueueManager.(MQQueueManager.java:681)The exception occurs when executing following statement:MQQueueManager manager = new MQQueueManager(queueManagerName);I checked all the points mentionedhere, but didn't get any clue yet.Can anyone help please? What am I missing here? I use JDK7u79.### Assistant: Oh! I figured out the reason now. I was using the old mqji.properties file. The new file is already there in com.ibm.mq.jar, but was being ignored as old file was still available in my classpath. Now it works fine.\n"} +{"text": "### Human: I want to read messages from JMS MQ or In-memory message store based on count.Like I want to start reading the messages when the message count is 10, until that i want the message processor to be idle.I want this to be done using WSO2 ESB.Can someone please help me?Thanks.### Assistant: I'm not familiar with wso2, but from an MQ perspective, the way to do this would be to trigger the application to run once there are 10 messages on the queue. There are trigger settings for this, specificallyTRIGTYPE(DEPTH).\n"} +{"text": "### Human: I am trying to use \"nan\" module to call MQ_CONNECT() from node.jsSeeNode.js and C/C++ integration: how to properly implement callbacks?andhttps://github.com/nodejs/nanWhen I use \"node-gyp\" it says it can not find \"imqi.hpp\", the MQ headerAs far as I can see, the path to MQ includes has to be provided in \"binding.gyp\", and I have tried this without success:{\n \"targets\": [\n {\n \"target_name\": \"mqconn\",\n \"sources\": [\n \"initall.cc\",\n \"mqconn.cc\"\n ],\n \"include_dirs\": [\n \"dir c:\\MQ\\tools\\cplus\\include\\imqi.hpp\nVolume in drive C is OS\nVolume Serial Number is 12AA-0601\n\nDirectory of c:\\MQ\\tools\\cplus\\include\n\n27/06/2013 02:00 1.538 imqi.hpp### Assistant: Because binding.gyp is in JSON, the String\"c:\\MQ\\tools\\cplus\\include\"is a standard JavaScript String, and therefore the\\needs to be escaped to\\\\.So you should replace\"c:\\MQ\\tools\\cplus\\include\"into\"c:\\\\MQ\\\\tools\\\\cplus\\\\include\".I hope that fixes the problem...\n"} +{"text": "### Human: I have create a .Net Windows Service to connect to MQ Queue usingXMSFactory. I am trying to implement reconnect functionality but I cannot find the properties inXMS.dll:'IBM.XMS.XMSC' does not contain a definition for 'WMQ_CLIENT_RECONNECT_Q_MGRI am using the following versions:MQ Server 7.5.0.2MQ Client 7.5.0.4Message Service Client for .Net 2.0.0.12Please Help### Assistant: MQ Client v7504 ships Message Service Client for .NET (XMS) v2.5 and automatic client reconnection feature is available in that version. So it is bit surprising how you are got XMS .NET 2.0.0.12 with MQ client v7504. XMS 2.0.0.12 does not support automatic client reconnection. This feature was implemented in XMS version 2.0.1.0.It appears that you have downloaded XMS from supportpacwebsite. Since you have installed MQ client v7504, you don't need to install supportpac. XMS comes bundled with MQ client. So you need to uninstall XMS supportpac and instead use the XMS that comes with MQ Client.UpdateAfter un-installing XMS .NET support pack, do the following:1) Check the GAC to confirm if it has XMS .NET assembly version 2.5. If assemblies are not there, then open a command prompt and move to WebSphere MQ\\bin directory and run \"amqiregisterdotnet.cmd\" command. This will install XMS (and also MQ) .NET assemblies to GAC.2) Your application might still be referencing IBM.XMS v2.0.1.0 assembly. Since this version of assembly will no longer be available, remove that reference and add IBM.XMS v2.5 reference from WebSphere MQ\\bin directory.Recompile your application.\n"} +{"text": "### Human: According to this:IBM MQ issue with cluster queuewe cant get message from a queue hosted on another queue manager with this code:mqQueue = mqQueueMgr.AccessQueue(\"queue name\", MQC.MQOO_INPUT_SHARED);Is there any way to get message without connecting to that queue manager?### Assistant: It is not the problem with your code. It is by MQ design that only applications directly connected to queue manager can get messages.It would be useful if you can explain your scenario a little more to see if there are any alternatives.\n"} +{"text": "### Human: I want to use XA complaint IBM Websphere MQ. What is the minimum version of Websphere MQ supporting this feature of distributed transaction?.Additionally I will be using IBM MQ classes for JMS### Assistant: It's not clear if you are asking just about an XA MQ client or a queue manager that can act as an XA resource manager. In either case, any MQ version older than v7 is no longer supported by IBM so at a minimum you should be using MQ v7.0.1, preferably one even more recent because that version has end of support September this year.All versions of MQ can act as an XA transaction coordinator or use the services of an external XA transaction coordinator. For details of which implementations of XA are compatible with MQ, please see theDetailed System Requirementspage for your version of MQ and drill down.As of 24 April 2012, all versions of IBM MQ client are licensed for XA transactionality and include that functionality built in. However, it is necessary to download and use the client software posted by IBM after that date to qualify because that process includes agreeing to the new license terms.Also, any transactional client installation which pre-dates the new release will show up on most license audit tools as requiring a full MQ Server license. So if you are using IBM Tivoli License Manager or other compliance tool and it flags the client as unlicensed, just download a fresh copy and reinstall.This linkexplains how the Extended Transactional Client (XA) has been incorporated into the base client and provides XA functionality free of charge at MQ clients of version v7.x and higher.\n"} +{"text": "### Human: I am using springCachingConnectionFactoryas in the below configuration to cache MQ sessions. I can see that the caching is working as expected:it opens a single MQ connectioncreates new sessions as needed and reuses themMy application has short lived peaks in message traffic. So when there is a peak, the session size bloats and remains there long after the peak. I am looking for a way of reaping these idle sessions after a specific period of inactivity. Is there anyway to achieve this?\n\n\n \n\n\n \n \n \n \n \n### Assistant: You can reduce thesessionCacheSize; any sessions that are closed when the cache size is exceeded will be physically closed the next time they are used.\n"} +{"text": "### Human: I am very new toIBM WebSphere MQ.I have a new mission to connect remote Queue in Java using MQ. I have IBM WebSphere MQ client installed in my local, and I have two information which areQueue Manager NameandQueue NameCan anyone walk me through the steps to connect remote queue in java code? Or could you provide me any instruction/sample code that I can use as reference?Appreciate for your help### Assistant: Can anyone walk me through the steps to connect remote queue in java\n code?Sure. Have a look atIBM WebSphere Developer Technical Journal: Running a standalone Java application on WebSphere MQ V6.0. Although this was written for MQ v6.0, the code still works on later versions of MQ. The article includes downloadable code and extensive explanations of how it works.Or could you provide me any instruction/sample code that I can use as\n reference?As opposed to the code IBM provides? ;-) As Shashi notes in the comments, have a look in the\\tools\\jms\\samplesand\\tools\\wmqjava\\samplesfolders if you are on Windows. If you are on *NIX then look under/samp.Of course, these are not the only samples available. Roger over at Capitalware has amassed one of the largest (if notthelargest) collections of source code samples and an index of 3rd party products for MQ anywhere. Within that vast trove, you want to check out theJava Applicationscategory in the Downloads section.\n"} +{"text": "### Human: I have a scenario where I need to implement a server farm (say 5 servers) which will run 4 instances of a calculation engine:Server 1: E1 E2 E3 E4\nServer 2: E1 E2 E3 E4\nServer 3: E1 E2 E3 E4\nServer 4: E1 E2 E3 E4\nServer 5: E1 E2 E3 E4I'd like to utilize a message queue solution whereby each engine is listening on the same queue (eg WORK.QUEUE) for incoming work. In the initial state if work is added then I'd like it to go to Server-1/E1. Then, if more work arrives whilst that instance is busy I'd like it to go to Server-2/E1 and so on. I only want work to go to an E2 instance if all the E1 instances are available.This sounds to me like a form of round-robin load balancing, but I suspect that this isn't the correct terminology in the message queuing space.Is this architecture possible using either MSMQ or MQ Series, or does it require some sort of load balancer running on each server to farm out work on a server level?### Assistant: Round-robin load balancing of messages is certainly a term in the messaging space. In the IBM WebSphere MQ (aka MQSeries) case, it means that each new message will go to a new instance of the queue, i.eMessage 1 -> Server-1/E1\nMessage 2 -> Server-2/E1\nMessage 3 -> Server-3/E1\nMessage 4 -> Server-4/E1i.e. it's not based on the busy-ness of the consumer on each server.\n"} +{"text": "### Human: Can websphere MQ cluster route messages to different Queues based on some MQMD characteristic?Today we are using an application program to read messages from an MQ and load them to multiple MQs for parallel processing (based on DB2 table partitions to avoid contention).We are interested in MQ functionality to transfer messages arriving in an MQ/ cluster to be routed to different destinations.### Assistant: Can websphere MQ cluster route messages to different Queues based on\n some MQMD characteristic?No. That is the job of the Integration Bus (Message Broker).There is an open source project called Message Router (MRTR) (http://www.capitalware.com/mrtr_overview.html) that will route messages based on a keyword in the message data. It would be very simple to modify it to look for value in an MQMD field.\n"} +{"text": "### Human: I need to build a java standalone application with ability to send messages to MQSeries specifying reply-to queue and reply-to MQMgr.\nI was able to use the code in SimpleP2P example to send a message, but unable to specify the reply-to queue and reply-to MQMgrpublic static void main(String[] args) {\n try {\n MQQueueConnectionFactory cf = new MQQueueConnectionFactory();\n\n\n cf.setHostName(\"xyz.com\");\n cf.setPort(141600);\n cf.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);\n cf.setQueueManager(\"QMG\");\n cf.setChannel(\"CHANNEL\");\n\n\n MQQueueSession session = (MQQueueSession) connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\n MQQueue queue = (MQQueue) session.createQueue(\"queue:///A.QUEUE\");\n MQQueueSender sender = (MQQueueSender) session.createSender(queue);\n\n long uniqueNumber = System.currentTimeMillis() % 1000;\n String fileText = convertXMLFileToString(\"test.xml\");\n System.out.println(\"fileText \" + fileText);\n\n JMSTextMessage message = (JMSTextMessage) session.createTextMessage(fileText);\n\n\n connection.start();\n\n System.out.println(\"before Sent message:\\\\n\" + message);\n\n sender.send(message);\n System.out.println(\"Sent message:\\\\n\" + message);\n\n sender.close();\n\n session.close();\n connection.close();\n\n System.out.println(\"\\\\nSUCCESS\\\\n\");\n } catch (JMSException jmsex) {\n System.out.println(jmsex);\n System.out.println(\"\\\\nFAILURE\\\\n\");\n } catch (Exception ex) {\n System.out.println(ex);\n System.out.println(\"\\\\nFAILURE\\\\n\");\n }\n}### Assistant: Try this:-MQQueue replyToQ = new MQQueue(QMgrName, ReplyQueue);\nDestination replyTo = (Destination) replyToQ;\nmessage.setJMSReplyTo(replyTo);\n"} +{"text": "### Human: First: the issueI am unable to successfully do these steps on an asynchronous durable subscriber against ibm's mq topics.IMessageConsumer.MessageListener = null;\nIMessageConsumer.Close();\nIMessageConsumer.Dispose();\nISession.Unsubscribe(topicPath);I get IBM.WMQ.MQException {\"2428\"}\n\"Failed to unsubscribe from topic X using MQCLOSE.\nThere might have been a problem removing the subscription because it is being used by a message consumer.\nMake sure any message consumers using this subscription are closed before unsubscribing. Please see the linked exception for more information.\"Second: SpecificsSo I'm using IBMs MQ infrastructure. Specifically their Topic implementation for distributed publisher/subscriber implementation. I'm wrapping the whole thing in a .NET WEB API (MVC5) project to abstract from the rest of the organization all the MQ specifics.\nFor the moment ignore all fail over, etc stuff. When a client calls in I first see if we have an ISession for the caller. If we do I use the existing, if not I make a new from a shared connection factory. Then I create a new destination for consumer. Next I create durable subscription for the specific topic path. Then I add a MessageListener and add the whole mess to an in memory cache. Other tracking also occurring but not important to this discussion.using IBM.XMS;\n\n// Subscribe\nMQConnectionFactory f = (MQConnectionFactory)fact;\nSessionClass newSession = new SessionClass(); // Contains an ISession, IDestination, IMessageConsumer\n\nnewSession.Session = f.CreateSession();\nnewSession.Destination = newSession.Session.CreateTopic(MQConnectionFactory.FormatTopic(path));\nnewSession.Consumer = newSession.Session.CreateDurableSubscriber(newSession.Destination, subId.ToString());\nnewSession.Consumer.MessageListener = new MessageListener(MessageHandler);\n\n\n// Message Handler - Some \"details\" removed\nprivate void MessageHandler(IMessage msg)\n{\n string topic = msg.GetStringProperty(MQConstants.TOPIC);\n DateTime timestamp = DateTime.FromBinary(msg.GetLongProperty(MQConstants.DATETIME));\n List> parms = msg.GetStringProperty(MQConstants.PARAMETERS).FromBase64();\n object payload = msg.GetObjectProperty(MQConstants.PAYLOAD);\n\n Publication publication = new Publication()\n {\n MessageTimestamp = timestamp,\n Topic = topic,\n Parameters = parms\n };\n\n Callback.Notify(publication))\n _log.DebugFormat(\"Message delivered to {0}\", msg.JMSMessageID);\n msg.Acknowledge();\n}\n\n// And for unsubscribe\nSessionClass s = _destinations[fullPath];\ns.Consumer.MessageListener = null;\ns.Consumer.Close();\ns.Consumer.Dispose();\ns.Session.Unsubscribe(s.Destination.Name);\n_destinations.Remove(fullPath);So all the subscribe and message handling works fine. The UnSubscribe always fails when I hit thes.Session.Unsubscribe(s.Destination.Name)saying it's \"in use\" basically. I've attempted Stopping the connection prior to the unsubscribe to no effect as well.Anyone have any ideas? I'm completely unable to remove any subscriptions from MQ after creating them as a result.thanks### Assistant: So after reviewing documentation more and consulting more with other people it's a matter of not the most clear MQ documentatin.What needs passed to the Unsubscribe method is the ID passed to the CreateDurableSubscriber methodSo....using the code above the only change is to the Unsubscribe call.s.Session.Unsubscribe(subId.ToString());And then all is good.\n"} +{"text": "### Human: I want to check if a JMS-Connection to a remote queuing is working. As this should be kind of J-Unit Test I can't use a Server (in my case would be Websphere. Is there any driver implementation or API I could use to initialize the connection ?### Assistant: No; without a backend Queuemanager there's nothing to respond to the connection. Messaging is inherently a distributed / networked product. There isn't something like a 'mock' QueueManager. In order for the connection to be properly created the mock would need to implement a lot of real function.\n"} +{"text": "### Human: Steps I have done :\n\n 1) In the Server, I have installed IBM WebSphere MQ v7.5.0.2 with AMS component enabled. \n\n 2) In the Server, i have configured the below : \n a) Created New Queue Manager and Queue.\n b) Created Listener.TCP\n c) Created required Server-Connection Channel and Client-Connection Channel. \n d) Configured Server-Connection Channel to accept SSL(TLS_RSA_WITH_AES_128_CBC_SHA256).\n e) Created the Self-Signed Certificate at Client and Server.\n f) Using the below c# code, i am able to connect to the Remote Queue Manager using CCDT.\n g) I am able to connect successfully to the Remote Queue Manager (AND) I am able to put a \n message to the queue. \n h) I am able to Browse the message in the WebSphere MQ Explorer in Server.\n i) I believe now my Transport Level Security is done. \n j) But now i need to enable Message Level Security to all the incoming/outgoing messages from \n that Server-Connection Channel which is configured with SSL.\n\n 3) I have the below few questions, please help to clarify : \n a) How and where to configure the keystore.conf using .net environment ? \n b) How and where to configure the Message Level Security for every message that is incoming/outgoing from the SSL \n Connection configured channel ? \n c) How and where to configure Online Certificate Status Protocol (OCSP)\n d) How and where to configure Certificate Revocation List (CRL) for certificates validationSample C# Code:public void TestSSLConnectionWithCCDT()\n {\n try\n {\n Environment.SetEnvironmentVariable(MQCHLLIB, @C:\\Program Files (x86)\\IBM\\WebSphere MQ\\ssl);\n Environment.SetEnvironmentVariable(MQCHLTAB, AMQCLCHL.TAB);\n\n Hashtable props = new Hashtable();\n props.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);\n props.Add(MQC.SSL_CERT_STORE_PROPERTY, sslKeyRepository);\n MQQueueManager qMgr = new MQQueueManager(QM1, props);\n MQQueue queue1 = qMgr.AccessQueue(Q1, MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING);\n MQMessage msg = new MQMessage();\n msg.WriteUTF(Test Message);\n queue1.Put(msg);\n }\n catch (MQException ex)\n {\n Console.WriteLine(A WebSphere MQ error occurred: {0}, ex.ToString());\n }\n catch (System.Exception ex)\n {\n Console.WriteLine(A System error occurred: {0}, ex.ToString());\n }\n }Appreciate the help/suggestions.Thanks In Advance.### Assistant: Follow the steps outlined in theQuick Start Guide for WebSphere MQ AMS on Windows. To use AMS from C#, you will be dropping through to the C Client for the AMS capabilities, so the set up will be the same.\n"} +{"text": "### Human: I'm getting strange ImportError exception while importing to my script pymqi.I installed WebSphere MQ for windows 7.5, both user and client versions.I tried to run pip install pymqi, but there was problems at C++ compiling.I moved headers fromC:\\Program Files (x86)\\IBM\\WebSphere MQ\\tools\\c\\includetoC:\\Python27\\includeand tried to run, there were linking problem.I moved some.libfiles fromC:\\Program Files (x86)\\IBM\\WebSphere MQ\\tools\\LibtoC:\\Python27\\libsand it compiled well.Then I tried this code:import pymqi\nqueue_manager = \"QM\"\nchannel = \"SVRCONN\"\nhost = \"192.168.1.252\"\nport = \"1434\"\nconn_info = \"%s(%s)\" % (host, port)\nqmgr = pymqi.connect(queue_manager, channel, conn_info)\nqmgr.disconnect()And at import library I got:File \"build\\bdist.win32\\egg\\pymqe.py\", line 7, in \n File \"build\\bdist.win32\\egg\\pymqe.py\", line 6, in __bootstrap__\nImportError: DLL load failed: \ufffd\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd.Where after some manipulations I got that...\ufffd\ufffd...means: it can't find module.I decide that done something wrong. Downloadedpymqi-1.3and donesetup.py build+setup.py install, that finished successfully. But problem still was there.I moved all DLL files fromC:\\Program Files (x86)\\IBM\\WebSphere MQ\\bintoC:\\Python27And got another ImportError exception with text, that may be translated as \"Bad try to access to memory address\".I tried springpython library, but it uses pymqi inside, so falls with same exceptions.How can I finally solve this problem? I guess there may be problem at WebSphere side, but how to check it? \"WS Explorer\" runs well.### Assistant: I had the same problem. Re-installing the client seemed to fix it. Ensure that you have the following items in your PATH variable:C:\\Program Files (x86)\\IBM\\WebSphere MQ\\bin64;\nC:\\Program Files (x86)\\IBM\\WebSphere MQ\\bin;\nC:\\Program Files (x86)\\IBM\\WebSphere MQ\\tools\\c\\samples\\bin\n"} +{"text": "### Human: I have a Use Case where we receive a payload via a web service which may contain a single business message or many business messages within.In our SI flow, we are using aSplitterto breakdown the received payload into its different business messages (could be up to 5000 business messages within) and, where the payload contains more than one business message, we use theSplitterto also include a response business message at the beginning of the split List. After the split, we then have aRouterto route the first message in the List (the response business message) to one channel (response.ch) which flows back to the web serviceEndpointas the response, and all other business messages to another channel (request.jms.ch) which flow to aJMSOutboundAdapterfor delivery into an MQ Queue for processing elsewhere.Simplified, the SI flow looks a bit like this:-> ->Splitter->Router->JmsOutboundAdapter (to MQ Queue)\nWsEndpoint Gateway |\n <- <-----------------The idea here is that, the client receives an immediate business message response before all other broken down business request messages are written to the MQ Queue.When I test this flow, the first response business message is placed in theresponse.chchannel before all other business messages begin to be placed in therequest.jms.ch channel(as expected) but, theGatewayand web serviceEndpointdo NOT pick up the response message before other business messages begin to be written to the MQ Queue...Any ideas why might this be? And how can I ensure that the response is sent back to the client before the split messages begin to be written to the MQ Queue?Working with:o.s.i:spring-integration-java-dsl:1.0.0.RC1\no.s.i:spring-integration-jms:4.0.4.RELEASECheers,\nPM### Assistant: Make the channel after the splitter anExecutorChannel; that way, as soon as all the split messages have been dispatched to the executor, the original thread will return to the gateway and wait for the reply.Please note that thedsl 1.0.0.RELEASEis now available.See the newline-by-line DSL tutorial(line 15 in the cafe demo does exactly what you need - adds anExecutorChannel).\n"} +{"text": "### Human: Hi I am having the following error when I run the a .NET appD:\\Program Files\\AscentSS\\AscentSV\\Staging\\SimplePut>SimplePut -q ESB.BAT1.SERVICES.KOFAX.DOC.METADATA -h 10.49.97.31 -p 1417 -l BLI1.KOFAX.CLIENT\nStart of SimplePut Application\n\nException caught: System.IO.FileNotFoundException: Could not load file or assembly 'amqmdnet, Version=7.5.0.1, Culture=neutral, publicKeyToken=dd3cb1c9aae9ec97' or one of its dependencies. The system cannot find the file specified. File name: 'amqmdnet, Version=7.5.0.1, Culture=neutral, PublicKeyToken=dd3cb1c9aae9ec97'\n at SimplePut.SimplePut.PutMessages()\n at SimplePut.SimplePut.Main(String[] args) in C:\\Users\\youngj\\Documents\\Visual Studio 2010\\Projects\\SimplePut\\SimplePut.cs:line 102\n\nWRN: Assembly binding logging is turned OFF.\nTo enable assembly bind failure logging, set the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog] (DWORD) to 1.\nNote: There is some performance penalty associated with assembly bind failure logging.\nTo turn this feature off, remove the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog].\n\nSample execution FAILED!\n\nEnd of SimplePut ApplicationHowever, the file with the same public token does exist:D:\\Program Files\\IBM\\WebSphere MQ\\bin>\"C:\\Program Files\\Microsoft SDKs\\Windows\\v\n7.0A\\bin\\sn\" -T amqmdnet.dll\n\nMicrosoft (R) .NET Framework Strong Name Utility Version 3.5.30729.1\nCopyright (c) Microsoft Corporation. All rights reserved.\n\nPublic key token is dd3cb1c9aae9ec97Any ideas? App was compiled on x64 Win7. Trying to run it on x32 Win2003 server. Thanks.### Assistant: MQs .NET layer isnt one dll, it is a number of them (amqmdxcs, amqmdnet, amqmdmsg etc) - especially since about 7.0.1. Have you actually installed the MQ server/client software or did you try to deploy an application with a reference to MQ and expect it to deploy with the MQ parts included?Try running your code on a machine with the MQ product properly installed - if 7.1 or higher, you need to make it primary (defaults to being) in order to get the MQ parts registered in the GAC, or you need a config file pointing to what the MQ dlls are on the file system. Take a look at Tools\\dotnet\\samples\\cs\\base and try to get the basic samples working first.If all else fails, do what the instructios tell you and enable logging and see what it shows :-)\n"} +{"text": "### Human: I am getting below error while connecting to SSL enabled queue in Websphere MQ using 7.1 jars through JMS.Code :public MQMessageSender(String channelName, String hostName,\n String portNumber, String queueManagerName, String queueName) {\n // Create a MQQueue Factory Object\n try {\n mqConnectionFact = new MQQueueConnectionFactory();\n mqConnectionFact.setChannel(\"xxx.SVRCONN\");\n mqConnectionFact.setPort(Integer.parseInt(\"xxxx\"));\n mqConnectionFact.setHostName(\"host1\");\n //mqConnectionFact.setConnectionNameList(\"host2(port2)\"); \n mqConnectionFact.setClientReconnectOptions(JMSC.MQCNO_RECONNECT_Q_MGR);\n mqConnectionFact.setQueueManager(\"XXXXX\");\n mqConnectionFact.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);\n mqConnectionFact.setSSLCipherSuite(\"SSL_RSA_WITH_RC4_128_SHA\");\n qConnection = mqConnectionFact.createQueueConnection();\n\n qConnection.start();\n qSession = qConnection.createQueueSession(false,\n Session.AUTO_ACKNOWLEDGE);\n\n requestQueue = qSession.createQueue(queueName);\n } catch (Exception exception) {\n exception.printStackTrace();\n }\n}Error :Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with\ncompcode '2' ('MQCC_FAILED') reason '2399' ('MQRC_SSL_PEER_NAME_ERROR').\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:209)\n ... 8 more\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2399;\nAMQ9204: Connection to host 'host1' rejected.\n[1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2399;\nAMQ9640: SSL invalid peer name, channel '?', attribute 'OID.2.5.4.17 (x2)'.\n[5=OID.2.5.4.17 (x2)]],3=host1(port1),5=RemotePeerName.setValue]### Assistant: reason '2399' ('MQRC_SSL_PEER_NAME_ERROR')is reporting that is the error. See2399 (095F) (RC2399): MQRC_SSL_PEER_NAME_ERROR. Additionally, you have the following error message:AMQ9640: SSL invalid peer name, channel '?', attribute 'OID.2.5.4.17 (x2)'.\n[5=OID.2.5.4.17 (x2)]],3=host1(port1),5=RemotePeerName.setValue]which is telling you which part of the peerName was not recognised. It says,OID.2.5.4.17which is Postal Code.A brief Internet search reveals an APAR for this very problem,IC83494: WMQ V7.1: JMS CLIENT CONNECTION VIA SSL ENABLED CHANNEL FAILS WITH RC 2399 MQRC_SSL_PEER_NAME_ERROR.This APAR is included in V7.1 FixPac 3.\n"} +{"text": "### Human: We are creating new application, which is going to use IBM's MQ as a JMS provider for a short term and switch to Tibco EMS within a year.\nMy question is how involving the changes would be from the Application code perspective.So far reading from JMS documentation, my impression is it should only require minimal changes. Does anyone have experience with it and provide some input on the work involved in switching between JMS provider.### Assistant: I've done POCs where I swapped out connection factories and used WMQ JMS Classes to send to various providers (TIBCO, ActiveMQ, etc), to prove out the interchangeability. I've also done full swaps from one vendors JMS to another. In theory, it should be very simple.The biggest change will be with the connection factories. Everything JMS specific will be the same between providers. The more tightly coupled the code is to the connection factories, the more complex it will be to change the app itself. Outside of this, you may need to change vendor specific implementation of objects, such as MQQueue vs Queue.One addition thing to keep in mid is dependent on the IBM endpoints. If you are using \"target queue managers\" on any producers, these will need to change. WMQ has a specific URI to reach queues on specific Queue Managers in a cluster ( \"queue://target_qm/queue_name/\" ). If any application uses this URI it will need to ensure it makes the proper changes here as well.\n"} +{"text": "### Human: Recently I started getting the following problem which results in messages not being delivered to:\"PollThread\" prio=10 tid=0x00007f0a2cf86000 nid=0x76b8 in Object.wait() [0x00007f09eb6bf000]\n java.lang.Thread.State: WAITING (on object monitor)\n at java.lang.Object.wait(Native Method)\n at java.lang.Object.wait(Object.java:503)\n at com.ibm.mq.jmqi.remote.api.RemoteHconn.checkUsable(RemoteHconn.java:2121)\n - locked <0x000000048f040a10> (a com.ibm.mq.jmqi.remote.api.RemoteHconn$ReconnectMutex)\n at com.ibm.mq.jmqi.remote.api.RemoteHconn.enterCall(RemoteHconn.java:1787)\n at com.ibm.mq.jmqi.remote.api.RemoteHconn.enterCall(RemoteHconn.java:1764)\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiPutMessageWithProps(RemoteFAP.java:7804)\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiPut(RemoteFAP.java:7254)\n at com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.jmqiPut(InterceptedJmqiImpl.java:496)\n at com.ibm.mq.ese.jmqi.ESEJMQI.jmqiPut(ESEJMQI.java:385)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer$SpiIdentifiedProducerShadow.sendInternal(WMQMessageProducer.java:812)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer$ProducerShadow.send(WMQMessageProducer.java:531)\n at com.ibm.msg.client.wmq.internal.WMQMessageProducer.send(WMQMessageProducer.java:1178)\n at com.ibm.msg.client.jms.internal.JmsMessageProducerImpl.sendMessage(JmsMessageProducerImpl.java:927)\n at com.ibm.msg.client.jms.internal.JmsMessageProducerImpl.send_(JmsMessageProducerImpl.java:783)\n at com.ibm.msg.client.jms.internal.JmsMessageProducerImpl.send(JmsMessageProducerImpl.java:446)Entire client application is unresponsive. How do I troubleshoot this type of problems with IBM MQ classes for JMS? Is it connection setup problems? There are no error in MQ log file. MQ version is 7.5.2. Thanks in advance for any help.### Assistant: The lock is being held on the ReconnectMutex meaning that a reconnection to the queue manager is currently in progress and so waits until it is notified that the reconnection has been successful. Is there another thread that looks like it is attempting to reconnect to the queue manager and is not moving? Do you know if the queue manager is up and running at this time?\n"} +{"text": "### Human: I just want to know what is the best transference (schedule, using trigger files, using transfer templates) to configure if the directory that has the source files is constantly getting new files:\n - A schedule transfer could be good, but what amount of time must be set in order to grant that the files will not be overwritten or will be transferred again?\n - A trigger file could be useful too, but how do you do when you always have new files? do you need to write an external program to help you with that?In this case the size of the files is variable.Thanks in advance### Assistant: The best functionality to start a transfer (fteCreateTransfer command, the WebSphere MQ Explorer Managed File Transfer plug-in GUI, Apache ANT script, scheduled transfer, resource monitor, etc) depends entirely on what your needs are and the environment in which your running.In answer to your first question, a scheduled transfer willnotbeing another instance if an existing instance of that scheduled transfer has not completed. However, if you plan to overwrite the source files when you want to transfer new ones and want to know how long to wait before doing so to ensure they have already been transferred, well, how long is a piece of string? If the network goes down between the agents and the transfer enters recovery it could take any amount of times for the network connection to be reestablished and for the transfer to recover and continue.In terms of resource monitoring and trigger files, you need to design you resource monitor and solution appropriately for what you want to achieve. If you have filenames that adopt a certain naming convention, you might like to try triggering on the files you want to transfer, and using a feature called \"Variable Substitution\" offered by the resource monitor to ensure the file that triggered the monitor is the one that is then transferred. How to do this is documented in the WebSphere MQ FTE Information Center.\n"} +{"text": "### Human: I was looking for something to enable me to do this but couldn't find much.I followed the steps described in the following answer to another question -https://stackoverflow.com/a/23920904/3299246but that isn't working. I get a lot of errors saying the files/dependencies were not found.Is there any way I can connect to the MQ without having the client installed?Thanks.### Assistant: Adding a new answer in light of the revelation that this is for mobile. You don't say whether this is for Windows Phone or Surface. I am not familiar enough with Surface, but IBM might even have a version of the MQ client that will work on it. Or maybe not.Whether you are using Windows Phone for mobile or a Surface device, the device should not have a problem connecting to a WCF Service which connects to WMQ.James the Integration Guyhas done a bit of work with this, and here's a blog post that might contain some ideas for you:Using .NET WCF to connect to WebSphere MQUnfortunately, the blog appears to be inactive, so there may be no update on his progress.ETA: Just to expand on my comment, Android can be made to connect to a WCF Service. Some links:Lessons Learned: Getting Android to Connect to a WCF ServiceHow to connect to a wcf Service with Android - Stack OverflowConnect to WCF service through android - Android Forums\n"} +{"text": "### Human: I would like to put a message to mq with rfh2 header along with jms and usr folder. As a starting point checked thislinkand came up with the code below. However after putting the message using the below code, I got a MQ error code'2142'(stands for incorrect header values). Could some one help on this. Also how do i modify the code to include jms and usr contents?pubCommand = \"PublishStock\" + \n\n\"QFLEXT1QFLEXT1.A\"; \n\nint folderLength = pubCommand.length(); \nMQMessage sendmsg = new MQMessage();\n//sendmsg.format = MQC.MQFMT_STRING;\nsendmsg.format = MQC.MQFMT_RF_HEADER_2; // Msg Format\nsendmsg.feedback = MQC.MQFB_NONE;\nsendmsg.messageType = MQC.MQMT_DATAGRAM;\nsendmsg.replyToQueueName = \"MY.TEST.Q\";\nsendmsg.replyToQueueManagerName = qManager;\nsendmsg.writeString(MQC.MQRFH_STRUC_ID); // StrucId \nsendmsg.writeInt4(MQC.MQRFH_VERSION_2); // Version \nsendmsg.writeInt4(MQC.MQRFH_STRUC_LENGTH_FIXED_2 + folderLength + 4); \nsendmsg.writeInt4(MQC.MQENC_NATIVE); // Encoding \nsendmsg.writeInt4(MQC.MQCCSI_DEFAULT); // CodedCharacterSetId \nsendmsg.writeString(MQC.MQFMT_NONE); // Format (content) \nsendmsg.writeInt4(MQC.MQRFH_NO_FLAGS); // Flags \nsendmsg.writeInt4(1208); // NameValueCCSID = UTF-8 \nsendmsg.writeInt4(folderLength); \nsendmsg.writeString(pubCommand);\nMQPutMessageOptions pmo = new MQPutMessageOptions(); // accept the defaults, same\n// as MQPMO_DEFAULT constant\n\nString line = \"test message\";\nsendmsg.clearMessage();\nsendmsg.messageId = MQC.MQMI_NONE;\nsendmsg.correlationId = MQC.MQCI_NONE;\nsendmsg.writeString(line);\n\n// put the message on the queue\nqueue.put(sendmsg, pmo);### Assistant: Thecorrectanswer is that the provider consuming the messages should be using a modern, supported version of WebSphere MQ. In any current version, the consumer of a message can specify whether they want to see RFH2 headers or message properties. It doesn't matter which approach the producer of the messages uses, MQ does the necessary conversion.But if you must do this the hard way, please consider the following:// many lines to prepare the message body are executed here \nString line = \"test message\";\nsendmsg.clearMessage();\n// WTF?? ^^^^^^^^^^ Doesn't this wipe out the RFH2 headers you just added?\n// Any reason NOT to expect incorrect header values error?\nsendmsg.writeString(line);\nqueue.put(sendmsg, pmo);According to theclearMessage pagein the Knowledge Center \"This method clears the data buffer portion of the MQMessage object. Any Message Data in the data buffer is lost, because MessageLength, DataLength, and DataOffset are all set to zero.\"So by the time you get around to writing \"test message\" into the message body, all the RFH2 headers you just added are gone and the message length reset to zero. Considering that there are no RFH2 headers for the QMgr to parse, the error received seems appropriate.Regarding the ability for the message consumer to have MQ provide the RFH2 headers, please see:PROPCTL queue optionsin the MQ Knowledge center, and in particular theFORCEoption.\n"} +{"text": "### Human: Have a PRD box of W2K8, facing issue to bring up MQ service in it.Error : DCOM got error \"1326\" and was unable to logon .\\MUSR_MQADMIN in order to run the server: {4576E163-FA1A-11D1-ABB8-0004ACF79B59} The machine wide Default Launch and Activation security descriptor is invalid. It contains Access Control Entries with permissions that are invalid. The requested action was therefore not performed. This security permission can be corrected using the Component Services administrative tool.Faced similar kind of issue before in same env and after adding MUSR_MQADMIN in below groups & administrators, it was working fine. Again after a month, MQ services are stopped and facing issue.\n- Logon as batch job\n- Logon as service\n- Shut down the system\n- Debug programs\n- Increase quotas\n- Act as part of the operating system\n- Bypass traverse checking\n- Replace a process level tokenI have checked pemrission in DCOM and Component services as well. Everything is fine.Kindly let me know what can be the cause of this error and will not be able to do trial and error since it is PRD env.### Assistant: Try \"amqmsrvn -regserver\" (you may need to change to the mq bin directory to run this). I'd also strongly suggest you look at 7.1 or higher which bins the dcom object and uses security on the service instead. If this fails, manually set the password to the musr_mqadmin account (assuming thats what in use), run dcomcnfg and change the password on the identity page.Note if you are running on a machine in a domain, you may need to configure MQ as a domain userid which is a different set of issues\n"} +{"text": "### Human: I have to connect to IBM MQ using C# in .NET 4.0 using SSL. I have the 4 file of the key and also the .TAB file. But I also know the channel details.\nCan someone provide me with a clear example ?\nKind Regards,### Assistant: From the mention of .TAB in your question, I am assuming that you are asking how to set up SSL using the Client Channel Definition Table (CCDT) which is often a file called AMQCLCHL.TAB. The knowledge center contains information about how to do this in this page:-Using a client channel definition table with .NETThere are some differences depending on whether you are using unmanaged .NET or fully managed .NET. If the latter, please also read:-CipherSpec support for the managed .NET clientspecifcally the very last sub-section about CCDT usage.\n"} +{"text": "### Human: Please find the below scenarios or camel routefrom(\"wmq:queue:eventQueue + \"?useMessageIDAsCorrelationID=true\") \n .transacted() \n .bean(orchestrator, \"processMessage(${body}, ${headers})\");and for transaction i am maintaining JmsTransactionManager. please find the same. actually i have gone through Chapter 9 in the Camel in Action book. based on that I configured txn.\n \n \n\n\n \nNow in Chapter 9 in the Camel in Action book, author mentioned about ACTIVEMQ.DLQ, but what will happen in case of Websphere MQ. \nMy requirement is if at all processMessage(${body}, ${headers}) fails to process and throws exception , camel should not acknowledge and message should be there as it is inside WMQ.Could you please help me for the same.Thanks \nSatyajit### Assistant: As you have transacted JMS, I assume bycamel should not acknowledgeyou want the transaction to roll back and not commit.It's very problematic to simply roll back to WMQ \"as it is\". If you won't take precaution, Camel will find the message again and try to reprocess it. The second attempt will very likely fail again and the process repeats. The logs will fill up very quickly.You should specifiy the \"BONAME\" and \"BOTRESH\" properties on the WMQ queue and have the rolled back message to a dead letter queue after a few retries. I think the default WMQ DLQ isSYSTEM.DEAD.LETTER.QUEUE.\n"} +{"text": "### Human: When I want to get mq depth, and I usegetCurrentDepthI notice it doesn't work on a stored/cached mq queue object.I need a 'fresh' queue object and I need to do anaccessQueuemethod call, get the queue and the use thegetCurrentDepthmethod on that object. Otherwise, the depth is always zero.I didn't find any open questions/documentation around this behavior.I'm using the MQ client for java version 7.0 on linux.\nMy open options are: MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_INQUIRE | MQC.MQOO_FAIL_IF_QUIESCING\nand I use an SSL connection.Thanks !### Assistant: I notice it doesn't work on a stored/cached mq queue object.There is no such thing as stored/cached MQ queue object. The queue types are: local, remote, alias cluster.I need a 'fresh' queue objectThere is no such concept of fresh (refresh) the queue object.The getCurrentDepth method belongs to the MQQueue class. Therefore, you need to access the queue using the accessQueue method of the MQQueueManager class.Finally, there should NEVER be a need to use the getCurrentDepth method in an MQ application. You either get a single message or loop until an MQException is thrown with MQRC_NO_MSG_AVAILABLE (2033) reason code.\n"} +{"text": "### Human: I have Webshpere Cluster with 4 JVM. JVM1 , JVM2 , JVM3 and JVM4 , all are using single Queue MGR1 with Single Queue.If a message put on queue using jvm1 bootstrup address, Is it available to to other JVMs as well for processing.What if a load balancer put on front of JVM1 , JVM2 , JVM3 and JVM4 , Is it make any difference from point1.Should a MQ cluster with Gateway Mgr3 and sub queue mgr Mgr1 and Mgr 2 should be used to process the message parally.### Assistant: Yes. The message will be available to the first consumer that recevies it. A queue works like a load balancer when multiple consumers are reading from it.Not sure how a load balancer is going to affect MQ at all. You are talking about a HTTP load balancer right?MQ cluster and multiple QMGRS have other reasons, such as distributing load across several physical machines, separating security and business level domains as well as administrational purposes.\n"} +{"text": "### Human: I'm using RAD 9.0 and trying to configure Queue connection factories in WebSphere Application Server 8.5. I have IBM MQ 7.0 (32-bit) installed on the same machine (Win7 64-bit).After configuring Queue connection factories when I click on Test Connection it give an error :A connection could not be made to WebSphere MQ for the following reason: CC=2;RC=2495;AMQ8568: The native JNI library 'mqjbnd' was not found. For a client installation this is expected. [3=mqjbnd]Native library path (under JMS>WebSphere MQ messeging provider) is set toC:/Program Files (x86)/IBM/WebSphere MQ\\java\\lib.I also tried to set it toC:/Program Files (x86)/IBM/WebSphere MQ\\java\\lib64but still I'm getting the same error.Also is it necessary to configure Queue Connection Factory for configuring Listener Port for MDB?### Assistant: The error message means you have configured the connection factory to have a transport type of Bindings and so the WMQ Resource Adapter within WAS needs to load the native libraries located in the MQ installation (note the MQ client installation does not come with these libraries).Assuming you want to connect in Bindings mode AND you have a full local MQ Server installation on the same box as the WAS server then you will need to configure the 'Native Library Path' on the WebSphere MQ messaging provider panel in WAS (Resources > JMS > JMS Providers). You should alter the provider that is at the same scope as the defined queue connection factory.The MQ_INSTALL_ROOT property is an old property used in WAS 6.0 and WAS 6.1 and is only intended to be used for migration reasons in WAS 7 and onwards.Note: If you have an ND environment then the 'Test Connection' operation could potentially run on the dMgr process rather than the server. If your dMgr is on a different host then the libraries will not be found. In this case you should ensure that the application server is running before selecting the 'Test Connection' button.\n"} +{"text": "### Human: I am setting uuid field as JMSCorrelationID to my outbound message. I also set the reply to Queue and reply to Quemanger for getting COD. After setting correct user Identifier I am able to receive the COD message in the set ReplyTo Q. But the correlationID received in the COD message has truncated the bytes of my UUID field to 32 bytes. Due to this I cannot reconcile the message to which COD was received. Please find below code while sending the message. I have omitted the ReplyToQ and ReplytoQm part but it works as expected.if(msgUuidId != null){\n msg.setJMSCorrelationID(msgUuidId);\n}\nlogger.info(\"Setting IBM_REPORT_COD\");\nmsg.setIntProperty(JmsConstants.JMS_IBM_REPORT_COD, MQC.MQRO_COD);\nlogger.info(\"Setting JMS_IBM_MQMD_USERIDENTIFIER to :: \"+ userid );\nmsg.setStringProperty(JmsConstants.JMS_IBM_MQMD_USERIDENTIFIER, userid);I am also setting the MQMD Context on destination((MQDestination) destination).setTargetClient(WMQConstants.WMQ_CLIENT_NONJMS_MQ); \n ((JmsDestination) destination).setBooleanProperty(WMQConstants.WMQ_MQMD_READ_ENABLED, true);\n ((JmsDestination) destination).setBooleanProperty(WMQConstants.WMQ_MQMD_WRITE_ENABLED, true); \n ((MQDestination) destination).setMQMDMessageContext(WMQConstants.WMQ_MDCTX_SET_IDENTITY_CONTEXT);While receiving the message I am reading as follows:. I am using Mule APIString correlationID = (String)eventContext.getMessage().getInboundProperty(\"JMSCorrelationID\");So here I am observing that the value is truncated hex portion of uuid which I had set. Can someone please help me with this?### Assistant: Shashi's comment rang a bell. As can beread here, MQ truncatesJMSCorrelationIdto 48 hex digits/24 bytes:Note 1: The MQMD CorrelId field can hold a standard WebSphere MQ Correlation ID of 48 hexadecimal digits (24 bytes). The JMSCorrelationID can be a byte[] value, a string value containing hexadecimal characters and prefixed with \"ID:\", or an arbitrary string value not beginning \"ID:\". The first two of these represent a standard WebSphere MQ Correlation ID and map directly to or from the MQMD CorrelId field (truncated or padded with zeros as applicable); they do not use the MQRFH2 jms.Cid field. The third (arbitrary string) uses the MQRFH2 jms.Cid field; the first 24 bytes of the string, in UTF-8 format, are written into the MQMD CorrelID.Does that correlate (pun intended) to the truncation you're seeing? If so, the pragmatic solution would be to use a 24 byte correlation ID.Cheers,\n"} +{"text": "### Human: How can I print a IBMMQ MQLONG value in c++ code. It gives a segmentation fault when I try to printprintf(\"Queue Persistance-> %s\\n \", pMsgDesc -> Persistence );Thanks### Assistant: The persistence field in the MQMD is not a string. You are telling printf to treat it as a string with the %s. In your question you do appear to be aware that it is an MQLONG though. Try using %d instead of %s.\n"} +{"text": "### Human: I am dealing with belowOutOfMemoryexception inWAS 6.1.Exception in thread \"UnitHoldingsPolicySummary\" java.lang.OutOfMemoryError: unable to create new native thread.I have done a lot of research on this to prevent this. After Googling, I have found that, this happens when the Native memory gets exhausted due to creation of lots of threads concurrently.Now, after analysing the below logs, we can figure out that, inside the application, the threads are created explicitely, which I read is a very very bad practice. (Can experts please confirm this?)07/07/14 08:50:38:165 BST] 0000142c SystemErr R Exception in thread \"xxxxxx\" java.lang.OutOfMemoryError: unable to create new native thread\n at java.lang.Thread.start0(Native Method)\n at java.lang.Thread.start(Thread.java:574)\n at com.fp.sv.controller.business.thread.xxxxxxxxxexecute(Unknown Source)\n at com.fp.sv.controller.business.thread.xxxxxxxxx.run(Unknown Source)\n at java.lang.Thread.run(Thread.java:595)I am more into WAS administration and doesn't possess much knowledge on Java and thread creation in Java. Now I need to discuss this with developer, but before that I want to be 100% confirmed that my findings are correct and developers should correct the code by not explicitely creating the threads.What all things that I need to check on application server side before blaming this on code?On solaris, I am firing the commandpmap -x 9547|grep -i stack|wc -lto check how many threads are getting created on that instance of time. I could see during the 'OutOfMemory' issue, this number is very high.Could you please confirm whether this command is the good way to checknumber of threads currently active?Editing the question with my latest findingsAlso, when this issue happens, at the same one of the MQ queue gets piled up as WAS doesn't pick up the messages from the queue. I could see below error in the application specific logs.Non recoverable Exception detected whilst connecting to queue manager or response queue\n Underlying reason = MQJE001: Completion Code 2, Reason 2102Can this issue related to MQ as well?Which in turn causesOutOfMemoryissue?Regards,\nRahul### Assistant: There are different possibilities of implementing a threading system for a virtual machine. The two extreme forms are:Green threads: All JavaThreadinstances are managed within one native OS thread. This can cause problems if a method blocks within anativeinvocation what makes this implementation complex. In the end, implementers need to introducerenegade threadsfor holding native locks to overcome such limitations.Native threads: Each JavaThreadinstance is backed by a native OS thread.For the named limitations of green threads, all modern JVM implementations, including HotSpot, choose the later implementation. This implies that the OS needs to reserve some memory for each created thread. Also, there is some runtime overhead for creating such a thread as it needs direct interaction with the underlying OS. At some point, these costs accumulate and the OS refuses the creation of new threads to prevent the stability of your overall system.Threads should therefore be pooled for resue. Object pooling is normally considered bad practice as many programers used it to ease the JVM's garbage collector. This is not longer useful as modern garbage collectors are optimized for handling short-living objects. Today, by pooling objects you might in contrary slow down your system. However, if an object is backed by costly native resources (as aThread), pooling is still a recommended practice. Look into theExecutorServicefor a canonical way of pooling threads in Java.In general, consider that context switches of threads are expensive. You should not create a new thread for small tasks, this will slow your application down. Rather make your application less concurrent. You only have a number of cores which can work concurrently in the first place, creating more threads than your (non-virtual) cores will not improve runtime performance. Are you implementing some sort of divide-and-conquer algorithm? Look into Java'sForkJoinPool.\n"} +{"text": "### Human: I am configuring WAS to connect to MQ via CCDT, and should be using a Queue Manager Name with wild cards, i.e *QMan.It is accepted in the Queue Connection Factory Screen and in the Activation Spec Screen, but it is not accepted in the Queue Configuration Screen. As shown on the below image, I am forced to leave the Queue Manager field blank. And my application is not received MQ messages. I am suspecting this might be the reason.Any ideas why I cannot configure the Queue Manager in Queue screen? And what is the common problem if message listener is not receiving, even if the MQPUT is working.I had double checked my CCDT configuration in Activation Spec, and have check the jndi names, everything is configured correctly.Also note that it is working if I connected directly to the MQ via host/port etc. But I have to use CCDT to utilize our MQ cluster.### Assistant: The Queue Manager (or Queue Sharing Group) name on the JMS Queue panel defineswherethe queue is located and nothowyou connect to it. It is the Queue Manager name in the JMS connection factory or activation specification that defines which queue manager your application connections to.So it is correct that you can't enter a * in this box.If the connection is not working when using a CCDT then it is likely to be another problem that this Queue Manager name box. Note: you can't use an XA connection with CCDTs due to the fact that a CCDT won't guarantee you will connect back to the same queue manager in the event of XA recovery.\n"} +{"text": "### Human: I want to get theQueue Depthfor aTransmission Queue(XMITqueue) usingWebSphere MQClasses for .Net , can someone kindly help me giving a specific link/Pseudocode or .Net Classes/API to identify the XMIT queue depth. I have gone through the .Net API but didn't find any info on XMIT queue.### Assistant: You can use the MQ .NET PCF interface to query queue attributes. Below is the sample code snippet.Note: MQ .NET PCF interface is undocumented interface and may not be supported. You will need to consult IBM.public static void InquireQueue()\n {\n PCFMessageAgent messageAgent = null;\n try\n {\n // Create connection to queue manager\n messageAgent = new PCFMessageAgent(\"QM3\");\n\n // Build Inquire command to query attributes a queue\n PCFMessage pcfMsg = new PCFMessage(MQC.MQCMD_INQUIRE_Q);\n pcfMsg.AddParameter(MQC.MQCA_Q_NAME, \"TO.QM2\");\n\n // Send request and receive response\n PCFMessage[] pcfResponse = messageAgent.Send(pcfMsg);\n\n // Process and print response.\n int pcfResponseLen = pcfResponse.Length;\n for (int pcfResponseIdx = 0; pcfResponseIdx < pcfResponseLen; pcfResponseIdx++)\n {\n PCFParameter[] parameters = pcfResponse[pcfResponseIdx].GetParameters();\n foreach (PCFParameter pm in parameters)\n {\n // We just want to print current queue depth only\n if (pm.Parameter == MQC.MQIA_CURRENT_Q_DEPTH) \n Console.WriteLine(\"Queue Depth\" + \" - \" + pm.GetValue());\n }\n }\n }\n catch (PCFException pcfEx)\n {\n Console.Write(pcfEx);\n }\n catch (MQException ex)\n {\n Console.Write(ex);\n }\n finally\n {\n if (messageAgent != null)\n messageAgent.Disconnect();\n }\n }\n"} +{"text": "### Human: I am using WebSphere MQ version 8.0 to create a remote queue.But it asks for MCA User ID. I am not sure what to enter here. Please help me how to retrieve this.### Assistant: There is no field on the definition of a QREMOTE object for MCAUSER. Are you perhaps creating a channel definition instead?If you are creating a channel definition then the MCAUSER field can be used in the following ways:-Left blank and allowed to adopt the user ID from the client (not recommended unless you can trust your network setup and thus the client machines).Left blank, and assigned by a CHLAUTH rule (preferred because you can set it dependent on other criteria allowing you to be more convinced a client machine is allowed to connect at all).Left blank, and then set by a security exit (consider if you are pre-V7.1) and can't use the previous bullet).Set to a user ID known to the O/S of the queue manager's machine (again not recommended because now all connections to that channel will run with that user ID).If this doesn't answer, perhaps you can provide a screenshot of exactly what you were doing?\n"} +{"text": "### Human: I have been working with WebSphere MQ since last few days. I have only tested this with creating local queue managers and sending/receiving messages from queues that works fine as expected.but I am not able to create remote queue manager. I am using WebSphere 8.0 for windows.This is what I have tried in websphere explorer:1) QueueManagers --> Add Remote Queue Managers --> Queue name2) provide details like :host(remote):localhost\nport: 1424\nserver connection channel : SYSTEM.ADMIN.SVRCONN3) next next and finish.It gives me error as :Could not establish a connection to the queue manager - reason 2538.\n (AMQ4059)any pointer on this why I am getting this error will be really appreciated.thanks\nYashu### Assistant: Remote queue manager is a queue manager running on a remote host (ie another machine than your localhost). Create a queue manager is another machine abc and connect it through the MQ Explorer.I suggest reading this primer to understand MQ and its featureshttp://www.redbooks.ibm.com/redpapers/pdfs/redp0021.pdf\n"} +{"text": "### Human: currently I am working with Apache Camel. What I want to do is configuring request reply. Here is my routes:\n \n \n \n \n queue:///LSMH.ZKSEAP.SERVICEBUS?targetClient=1 \n \n \n ISO8859_1 \n \n \n cid \n \n \n \n \n \n \n \n IN: ${headers}\n \n On those reoutes, we can see that I have http endpoint used for input and 2 wmq endpoint, 1 for write and 1 for read.What I want is:Receive a request from the http, process it, and write request message to Queue.Write wmq.After the request message has writen in the Queue.Write wmq, I would like to read the response from Queue.Read wmq, then send it back to the first route, and do some data transformationAfter all the proceed has been done, then I would like to send back the response to the http endpoint.I have read following documentation from Apache Camel and tried to do as suggested:http://camel.apache.org/request-reply.htmlhttp://camel.apache.org/jms.htmlAnd some other related resourcesBut nothing is working for me.The InOut exchange pattern is not working, because I used different endpoint for the request-replyI tried to declare the JMSCorrelationID and JMSReplyTo on my Queue.Read endpoint by adding:\n \n cid \n \n \n queue:///LSMH.ZKSEAP.SERVICEBUS?targetClient=1\n \n But it also did not work, moreover, I just got following error continously:org.apache.camel.ExchangeTimedOutException: The OUT message was not\n received within: 20000 millis due reply message with correlationID:\n cid not received. Exchange[Message:http://security.fraport.de/zks-eap/uebermittleAusweisdatenurn:uuid:ID-FRA000000085404-55438-1402901836300-0-2esbp://services.fraport.de/lsmh/mobakoesbp://services.fraport.de/lsmh/zks-eapesbp://services.fraport.de/lsmh/mobako11.2]\n at\n org.apache.camel.component.jms.reply.ReplyManagerSupport.processReply(ReplyManagerSupport.java:133)\n at\n org.apache.camel.component.jms.reply.TemporaryQueueReplyHandler.onTimeout(TemporaryQueueReplyHandler.java:61)\n at\n org.apache.camel.component.jms.reply.CorrelationTimeoutMap.onEviction(CorrelationTimeoutMap.java:53)\n at\n org.apache.camel.component.jms.reply.CorrelationTimeoutMap.onEviction(CorrelationTimeoutMap.java:30)\n at\n org.apache.camel.support.DefaultTimeoutMap.purge(DefaultTimeoutMap.java:212)\n at\n org.apache.camel.support.DefaultTimeoutMap.run(DefaultTimeoutMap.java:162)\n at java.util.concurrent.Executors$RunnableAdapter.call(Unknown\n Source) at java.util.concurrent.FutureTask.runAndReset(Unknown\n Source) at\n java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown\n Source) at\n java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown\n Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown\n Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown\n Source) at java.lang.Thread.run(Unknown Source)Just for your information, I have tried to do so on Mule ESB and successfully implement it by using:and addingafter my Queue.Read on second flow.But, for now I need to do it in Apache Camel. Is there any ways to do so in Camel? Or do you have some idea about how to solve my problem (without change the wmq endpoint). Thanks for your help.### Assistant: Because you set the JMSDestiantion haderqueue:///LSMH.ZKSEAP.SERVICEBUS?targetClient=1then Camel sends the message to the queueLSMH.ZKSEAP.SERVICEBUSso you need a listener on that queue, that processes the message, and send back the reply message defined by the standardJMSReplyToheader.And because you did not set any special replyTo, then Camel uses a temporary queue. Not sure if IBM WebSphere support this. So you may want to set a fixed JMSReplyTo header. See more details at that Camel JMS doc as it talks about that.The 2nd route you have is likely not in use because its reading fromQueue.Readwhich you did not send a message to.But read that JMS page again, and pay attention to different kinds of reply over JMS with a shared / temporary or exclusive reply queue.\n"} +{"text": "### Human: currently I am working with apache camel to write and read from Websphere MQ.On my project, I have 2 WMQ: 1 for write (Queue.W) and 1 for read (Queue.R). Here is how I configure my apps:\n\n \n\n \n\n \n \n \n\n \n \n \n \n \n queue:///Queue.W?targetClient=1 \n \n \n ISO8859_1 \n \n \n \n \n \n \n \n \n \n\n \n\nWhat I want to do is: send back the response from read queue (Queue.R) to http endpoint on my first flow.To achieve that, I tried to use InOut pattern. However, it seems the InOut pattern only worked when I have same endpoint (For example if the outbound on my first flow is Queue.W, then the inbound on my second flow should be Queue.W too). But, since I used different WMQ for write and read, I can not make it work.As can be seen in my configuration, I tried to solve it by adding inOnly pattern to my Queue.W and then addingAfter that on my second flow, I tried to send back the response from Queue.R by addingBut it also did not work! Moreover, after I do so, I got following error:org.apache.camel.component.direct.DirectConsumerNotAvailableException:\n No consumers available on endpoint: Endpoint[direct://result].\n Exchange[Message:http://security.fraport.de/zks-eap/uebermittleAusweisdatenurn:uuid:ID-FRA000000085404-64407-1402571267690-0-2esbp://services.fraport.de/lsmh/mobakoesbp://services.fraport.de/lsmh/zks-eapesbp://services.fraport.de/lsmh/mobako12.1]\n at\n org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:47)\n at\n org.apache.camel.processor.SendProcessor.process(SendProcessor.java:113)\n at\n org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)\n at\n org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)\n at\n org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)\n at org.apache.camel.processor.Pipeline.process(Pipeline.java:118) at\n org.apache.camel.processor.Pipeline.process(Pipeline.java:80) at\n org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)\n at\n org.apache.camel.component.jetty.CamelContinuationServlet.service(CamelContinuationServlet.java:149)\n at javax.servlet.http.HttpServlet.service(HttpServlet.java:668) at\n org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)\n at\n org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1496)\n at\n org.eclipse.jetty.servlets.MultiPartFilter.doFilter(MultiPartFilter.java:136)\n at\n org.apache.camel.component.jetty.CamelFilterWrapper.doFilter(CamelFilterWrapper.java:44)\n at\n org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1467)\n at\n org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)\n at\n org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)\n at\n org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)\n at\n org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)\n at\n org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)\n at\n org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)\n at org.eclipse.jetty.server.Server.handle(Server.java:370) at\n org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)\n at\n org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971)\n at\n org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033)\n at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)\n at\n org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)\n at\n org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)\n at\n org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)\n at\n org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)\n at\n org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)\n at\n org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)\n at java.lang.Thread.run(Unknown Source)Any sugestion about how to solve my problem? Thanks so much. Your help is so much appreciated!### Assistant: I don't know if theInOutpattern is designed to be used withdirect:routes.As you noted,InOutis designed to be used with (for example, with JMS messages) where you send and expext a response from the same endpoint (for example, JMS Queue).In the case ofInOutwith JMS messages, there is a lot of functionality regarding correlation ID's under the hood to make that work - that's why I can't see how this would work cleanly with adirect:xyzendpoint.Instead, why don't you separate your two routes, and if you need to synchronize them (so that you verify you got a response) use a third route with a completion timeout.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n I hope this helps! Good luck.\n"} +{"text": "### Human: We use JmsTemplate to send PCF commands to an MQ Queue manager admin queue.We need this in order to switch on a QUEUE DEPT triggering on a bunch of queues. This is because after firing up the QUEUE DEPT trigger MQ manager turns off the triggering on that queue.I know that messaging processing should by its nature be an asynchronous thing. However in this particular case it would make sense to wait for a response back informing the caller of whether the trigger was switched back on or not.By looking at the JmsTemplate API I could not spot anywhere something like this. Did I miss anything or it is not possible to achieve a functionality like the one described by javax.jms.QueueRequestor.request(Message message)?### Assistant: You are right,JmsTemplatedoes not offer such feature. You can look atSPR-332for the whole history.The last comment hasa link to a projectthat shows how you can very easily implement that with Spring Integration.\n"} +{"text": "### Human: I am making a small program to put and get messages from queues. I have implemented a client version easily with no errors.However when i attempt to make a server version i get a number of errors complaining about the MQ Calls i am using:Error 1 error LNK2019: unresolved external symbol _MQCLOSE referenced in function \"public: virtual bool __thiscall CImbMq::Disconnect(void)\" (?Disconnect@CImbMq@@UAE_NXZ)i have#include \n#include included and have included the MQSERIES_SRV_LIBRARIES located in my IBM/Tools/Lib64 folderAny idea's why i continue to get these errors ?Thanks### Assistant: That linking error is telling you that it cannot resolve the MQ calls. If you have already successfully linked a client version of the application, that tells me that you do not have MQ server installation, and so the libraries for linking a server (or local bindings) version of your application, are not installed on your machine.\n"} +{"text": "### Human: my question is about WebSphere MQ's Dead-letter.How I can view on ISPF the queue manager's dead-letter?Each queue manager has a default dead-letter queue or I need to define it?Thanks so much!### Assistant: A queue manager does not have a dead-letter queue by default. You must tell the queue manager where its dead-letter queue is. The CSQINP2 samples (if you use them) define a QLOCAL called ++qmgr++.DEAD.QUEUE - see sample CSQ4INYG. If you use that sample and do the search and replace on the ++qmgr++ text, you may have the queue defined. But, you still need to tell the queue manager to use that queue as its dead-letter queue.To view whether a queue manager has a dead-letter queue, you need to issue the following command:-DISPLAY QMGR DEADQAlternatively you can view the same information on the MQ ISPF panels byChosing option 1. List or DisplayFor Object type MANAGERHit enter, and view the first page of queue manager details. Just below 'Description' and 'Default transmission queue' you will see 'Dead-letter queue'To alter it, use option 3. from the ISPF panels or issue the following command:-ALTER QMGR DEADQ(CSQ1.DEAD.QUEUE)Changing the above queue name to be correct for your queue manager.You can use any named queue you wish, you do not have to follow the convention used in the CSQ4INYG sample, but I would recommend having a name that indicates the purpose of the queue clearly.\n"} +{"text": "### Human: I have WAS MQ 7.1 Server installed in windows. My application running on unix is trying to connect to this server during which it gives the error \"MQ Connect failed 2195\" in the application logs. On debugging the code , i found it is while connecting to the q manager that it is throwing this error.I tried to run a netstat on the MQ Server port no. and do a telnet to check if there is any connection being established . But I could not see any connection being established to the q manager .The possible issues could be \n1. Que Manager has not been started\n2. Listener not started\n3. Initiation queue not started or created or attached(usually optional depending on set up)\n4. Listening to the wrong Port or IP\n5. Firewall stopping traffic to Port or IP\n6. Queue Manager not created on destination\n7. Not authorized to Queue manager and/or channel and/or queue\n8. Trial MQ copy expired.\n9. Wrong Queue manager name\n10. Wrong channel name or password or queue or queue typeHave done the following to check if it is working fine . \n1. Tried to put a message from windows to the MQ Server which was successful. \n2. Gave auth(setmqaut) permission to Request queue that was created. \n3. There is no firewall between application and MQ Server.\n4. Channel name , q manager , IP and port no.s are correct.In my windows MQ Setup i have created the Server connection channel and Client connection Channel.export the mqm lib to SHLIB_PATH.Added the application user to mqm group and also the windows user through which I had created the MQ Server setupHad copied the AMQCLCHL.TAB to the unix machine containing the client program.\nexported MQCHLTAB to the table filename\nexported MQCHLLIB to the path containing the table name\nexported the MQSERVER=QMgrName/CHANNEL1/hostname from the client machine.Please let me know if I am missing anything w.r.t connection of the application(in Unix) to the MQ Server(in Windows).### Assistant: 2195 is MQRC_UNEXPECTED_ERROR. It implies something that should not have happened, even if you set it up wrong. It may well be accompanied with an FDC file in the errors directory. You should raise a PMR with IBM Service.\n"} +{"text": "### Human: I am Using IBM WebSphere MQ. Whenever simultaneous users log in to the IBM MQ, when the second user comes and try to access the getqueue they receive2100 0x00000834 MQRC_OBJECT_ALREADY_EXISTSerror. Kindly provide some suggestion.Connect to MQ Manager:mqQueueManager = new MQQueueManager(mqQueueManagerName);Open Put Queue:mqPutQueue = mqQueueManager.AccessQueue(mqRequestQueueName, MQC.MQOO_INQUIRE |\n MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING);Opening the ReplyTo Queue generates the error when the second user tries to connect. The First user's dynamic queue will be deleted when they disconnect. That Second user is unable to connect, until the first user closes the application:mqGetQueue = mqQueueManager.AccessQueue(mqModelQueueName, MQC.MQOO_INPUT_SHARED ,\n mqQueueManagerName, mqReplyQueueName, \"\");### Assistant: You are probably specifying the dynamic queue name incorrectly.To provide the greatest flexibility to developers, WebSphere MQ allows a choice between selecting the exact name you want for a dynamic queue or letting WebSphere MQ generate unique names automatically. If you want WebSphere MQ to generate the name for you, make sure the name you pass in is short enough to allow WMQ to append additional characters, and specify an asterisk as the last character in theDynamicQNamefield. This is explained in the docs in a section calledCreating Dynamic Queueswhich reads as follows:You can specify the name of the dynamic queue that you create in three ways:Give the full name that you want in theDynamicQNamefield of the\nMQOD structure.Specify a prefix (fewer than 33 characters) for the\nname, and allow the queue manager to generate the rest of the name.\nThis means that the queue manager generates a unique name, but you\nstill have some control (for example, you might want each user to use\na certain prefix, or you might want to give a special security\nclassification to queues with a certain prefix in their name). To use\nthis method, specify an asterisk () for the last non-blank character\nof theDynamicQNamefield. Do not specify a single asterisk () for\nthe dynamic queue name.Allow the queue manager to generate the full\nname. To use this method, specify an asterisk (*) in the first\ncharacter position of theDynamicQNamefield.Based on the behavior you are describing, I'm guessing there's no asterisk in the name that you are passing to WMQ. It therefore assumes you want to explicitly specify the name and does exactly what you specified, although perhaps not what you intended.To get the behavior you expect, make sure the value you pass formqReplyQueueNameis a single asterisk (the '*' character), or is a string of less than 33 characters that ends with an asterisk.\n"} +{"text": "### Human: This question is related to Websphere MQ. I have a requirement where in I have to route messages based on the content of the message.I know about the concept of selectors in WMQ subscriptions and I have also been successful in doing this based on the Message Headers (using MQRFH2 )I now need to filter messages based on the payload which are XMLNSC and have a valid namespace associated with it.Eg:\n\n Y\nIf I have to accept messages if the flag is 'Y' only, then how do I set the selector in my subscriptions?Please let me know.\nThanks in advance.### Assistant: Any WebSphere MQ selection information must either be in the message header or a message property. WMQ is tuned to move messages as far downstream as possible, as quickly as possible, and does not do anything with message payloads other than to deliver them. Any functionality based on data in the message body requires one of IBM's ESB solutions such as IIB, or else to write code to inspect the payload and take the appropriate action.If at all possible, the application creating the messages should place the selection field into a message property. If that isn't possible, a program can intercept the message, evaluate the payload and set the property, then re-queue the message.\n"} +{"text": "### Human: This may be simple beginner's question, but I would like to clarify it.There is no way receive WMQ's message without using MDB on JBoss using container's XA-transaction.\nAm I right?I mean, we can put message to MQ using AdminObject (com.ibm.mq.connector.outbound.MQQueueProxy) but only MessageListener is available to consume WMQ queue message.Merci and Gracias and Danke and Namaste, and Xiexie!### Assistant: I don't have experience on JBoss, but the usual practice is to use the TX monitor/application server's XA facility to coordinate the resource managers. The app server's XA facility should internally use the WMQ Java/JMS XA API to begin and commit/rollback the transaction. In turn the resource managers implement the X/Open XA interface specification or JTA in this case. So, I think you are right.MessageListener is pure JMS and I don't think it conforms to X/Open specification for resource manager coordination in a 2 phase transaction.If you are interested in re-inventing the wheel of what MDB has already done, check WMQ JMS API docs. Pay particular attention to interfaces starting with JmsXA...http://pic.dhe.ibm.com/infocenter/wmqv7/v7r5/index.jsp?topic=%2Fcom.ibm.mq.dev.doc%2Fq031500_.htmhttp://pic.dhe.ibm.com/infocenter/wmqv7/v7r5/index.jsp?topic=%2Fcom.ibm.mq.dev.doc%2Fq031500_.htmhttp://pic.dhe.ibm.com/infocenter/wmqv7/v7r5/index.jsp?topic=%2Fcom.ibm.mq.javadoc.doc%2FWMQJMSClasses%2Findex.htmlSorry, I dont have the exact answer you are looking for, but at least I can point in the direction for MQ. If you add JMS tag, may be the JMS folks can help better. Hope it helps.\n"} +{"text": "### Human: this is mykrb5.inifile.[libdefaults]\n default_realm = TEST.EXAMPLE.COM\n .....\n [realms]\n TEST.EXAMPLE.COM = {\n kdc = test.example.com:88\n master_kdc = test.example.com:88\n default_domain = example.com\n }\n [domain_realm]\n .example.com = EXAMPLE.COM\n example.com = EXAMPLE.COMI created a userUSERAon the domain, created a credential usingkinitand have my jaas.config file defined asexample_config {\n com.ibm.security.auth.module.Krb5LoginModule required\n useDefaultCcache=false\n principal=\"userA@TEST.EXAMPLE.COM\" \n useCcache=\"file:///c:/Users/userA/krb5cc_userA\"\n debug=true;\n };everything seems ok as it gets authenticated.[JGSS_DBG_CRED] Retrieving Kerberos creds from cache for principal=userA@TEST.EXAMPLE.COM\n [JGSS_DBG_CRED] Non-interactive login; no callbacks necessary.\n [JGSS_DBG_CRED] Done retrieving Kerberos creds from cache\n [JGSS_DBG_CRED] Login successful\n [JGSS_DBG_CRED] userA@TEST.EXAMPLE.COM added to Subject\n [JGSS_DBG_CRED] Kerberos ticket for userA@TEST.EXAMPLE.COM added to Subject\n [JGSS_DBG_CRED] No keys to add to Subject for userA@TEST.EXAMPLE.COMhowever now, I am trying to use a service principal name , instead of user principal. I usedktpassto create a keytab filektpass -out \"c:\\mytab.keytab\" -princ \"Installation1/test.example.com@TEST.EXAMPLE.COM\" -mapUser \"TEST\\userA\" -mapOp set -pass password -crypto DES-CBC-MD5 -pType KRB5_NT_PRINCIPAL +DesOnlyand then usesetspnto checkC:\\>setspn -l userA\nRegistered ServicePrincipalNames for CN=userA,CN=Users,DC=test,DC=example,DC=com:\n Installation1/test.example.comi change my config toexample_config{\n com.ibm.security.auth.module.Krb5LoginModule required\n credsType = both \n principal=\"userA/test.example.com\"\n useDefaultCcache = true \n useDefaultKeytab = false\n useKeytab = \"file:///c:/mytab.keytab\"\n debug=true; \n };now when i run my app, it gives[JGSS_DBG_CRED] Retrieving Kerberos creds from keytab for principal=Installation1/test.example.com\n [JGSS_DBG_CRED] Service name=Installation1/test.example.com@TEST.EXAMPLE.COM\n [JGSS_DBG_CRED] Check for Default keytab : \n [JGSS_DBG_CRED] No Kerberos creds in keytab for principal Installation1/test.example.com\n [JGSS_DBG_CRED] No service key in keytab; login failedWhat did i do wrong in the config file? or is there something i miss in thektpasscommand?Installation1is the service name (of Websphere MQ) when I go to check Control Panel -> Services. I want to autheticate userA to use Websphere MQ service. (like if i want to let user use HTTP I would put principal asHTTP/.....TEST.EXAMPLE.COMthanks### Assistant: There is nothing in MQ that performs authentication. MQ only performs authorization (permission lookup) via its OAM module.For a default install of MQ (on any platform including z/OS), there is no effective security in MQ. You can configure MQ to use MQ SSL between a client application and the queue manager (or between 2 queue managers).The other choice is to purchase a 3rd party MQ security solution like MQAUSX which handles authentication to various targets.\n"} +{"text": "### Human: I'm using this part of code for connect to a queue manager.jmsFactory = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\njcf = jmsFactory.createConnectionFactory();\n\n// Set the properties\njcf.setStringProperty(WMQConstants.WMQ_HOST_NAME, hostName);\njcf.setIntProperty(WMQConstants.WMQ_PORT, port);\njcf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\njcf.setStringProperty(WMQConstants.WMQ_CHANNEL, channel);\n\nconnection = jcf.createConnection();When everything is OK, there is no problem. But when host is unreachable; there is a long wait for get an exception. I meanjcf.createConnection()waiting and trying to get connection around 30 seconds and then raise an exception.Can I decrease this time? and how?\nwhen in another application I tried to send thousand of messages by thread to a queue manager and each thread waiting for 30 second to get connection, it caused serious problems.### Assistant: My suspicion is that yourreconnectionRetryIntervalis set at the default value, which I believe is 30 seconds.\n"} +{"text": "### Human: I am upgrading a Websphere v.7.0 C# client to v.7.5.2 primarily to take advantage of the new MSDTC feature. However my initial PoC'ing has revealed a number of issues, one of which is how transactions are committed and rolled back.In v.7.0 commits and rollbacks was done synchronously, however v.7.5.2 using MSDTC, commits and rollbacks are done asynchronously.This is a breaking change, so my question is:Is there some sort of WaitHandle so you can get, to wait for the Commit or Rollback to complete?Is there an option you can set, that will make the MSDTC commit and rollback synchrone?Thanks\nSlind### Assistant: At MQ v7.5, if you are using Global Transactions (XA), then the transactions are coordinated by MSDTC which decides when to commit or rollback a transaction. You may look atthislink that explains behavior further.Transaction completed event can be handled in your application to know when a transaction is completed. Please see thislinkfor an example.\n"} +{"text": "### Human: I have some messages flowing through the MQ cluster by using cluster and alias queues. Some queues are defined multiple times, though the loadbalancing mechanism is used.What is the propper way to extract one QM from the cluster without disturbing the whole message flow? Disabling the cluster-receiver channel, cluster-sender channels, or else?### Assistant: Use thesuspend qmgrcommand.This suspends the queue manager from the cluster.command reference\n"} +{"text": "### Human: I've been searching extensively for a description of how to set up JMS access from a remote client to a file based JNDI MQ Series provider without success.My JMS client works Ok on the same Linux machine as my MQSeries 7.5 server using file based JNDI.How does one set up a remote client to use file based JNDI? Is it even possible or must one use LDAP?I've seen hints that one should be able to have a remote client but nothing very clear.I'm using Spring JMSTemplate which uses a provider url. On the same machine my Tomcat context.xml file uses a file: fileName url which, as I say, works ok collocated with the MQSeries server.Thanks### Assistant: Not a problem. If you are using a File based JNDI then you just need to add a QCF that contains the appropriate information for the remote queue manager. i.e. hostname, port # and channel nameDEFINE QCF(myQCF) QMANAGER(MQWT1) CHANNEL(TEST.CHL) HOSTNAME(22.22.22.22) PORT(1414) TRANSPORT(CLIENT) FAILIFQUIESCE(YES)\n"} +{"text": "### Human: I have a need to put a XML Message in the MQ queue with the attachments. Is that possible?. Please share your thoughts/relevant documentation.### Assistant: You can put any type of message payload to a MQ queue. XML (which is of type Text/String), bytes, etc. MQ does not care about payload type.You will have to create a byte or text buffer containing your XML with attachments and put the message to a queue.\n"} +{"text": "### Human: I am connecting remotely to MQ on the server and i installed MQ client v6.0 on my machine.\nI am able to put the message into the queue but i am unable to get the message from the same queue the output is \"RC2033: MQRC_NO_MSG_AVAILABLE\"Can anyone please help me to find the issue?Will this be due to properties of the queue?The following is the code which i am using to pop the message :Pop Message:queue = mqQMgr.AccessQueue(\"queue_name\", MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_INPUT_SHARED);\nMQMessage queueMessage = new MQMessage();\nqueueMessage.Format = MQC.MQFMT_STRING;\nMQGetMessageOptions queueGetMessageOptions = new MQGetMessageOptions();\nqueueGetMessageOptions.Options = MQC.MQGMO_WAIT;\nqueueGetMessageOptions.MatchOptions = MQC.MQMO_NONE;\nqueueGetMessageOptions.WaitInterval = 1000;\nqueue.Get(queueMessage, queueGetMessageOptions);\ntbPoptxt.Text = \"Message No\" + count + \":\" + queueMessage.ReadString(queueMessage.MessageLength);PUSH CODEint optons = MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING;//Queue which opens with options output\n queue = mqQMgr.AccessQueue(\"queue_name\", optons);\n MQMessage queueMessage = new MQMessage();\n queueMessage.WriteString(tbPushtxt.Text.ToString());\n queueMessage.Format = MQC.MQFMT_STRING;\n MQPutMessageOptions queuePutMessageOptions = new MQPutMessageOptions();\n queuePutMessageOptions.Options = MQC.MQGMO_SYNCPOINT | MQC.MQGMO_FAIL_IF_QUIESCING;\n queue.Put(queueMessage, queuePutMessageOptions);mqQMgr.Commit();I am using same queue for putting a message and poping a message### Assistant: Look in the samples directory for the nmqsput and nmqsget c# examples - these do exactly what you are after and are good working examples.Looking at the code above, I do not think there is a problem getting the message, followed up by your comment that amqsputc failed to find a message as well. I think the problem is on the putting side.This may sound a silly question, but how do you know the message is there. What is the curdepth after the put? Look at the queue status - are there any uncommitted messages? (One thing I've seen before is putting under a unit of work (syncpoint) and then not committing and then another application trying to get it.\n"} +{"text": "### Human: I followed the post athttp://blog.phpdeveloper.org/?p=140to connect to a remote WebsphereMQ from PHP / Linux using the mqseries extension and was able to get the connection working.However, the request is being sent with the username of the apache user on the client and the MQ server is rejecting the messages with error 2035. The only way I found to work around the issue is to change the profile under which apache is running to a username that has access on the MQ server.Is there a way to pass a username when establishing connectivity to WebSphere MQ from php using mqseries? Following is the code I am using to connect://define connection parameters\n$mqcno['MQCD'] = array(\n 'ChannelName' => $options['channel'],\n 'ConnectionName' => \"$mq_host_ip($mq_host_port)\",\n 'TransportType' => MQSERIES_MQXPT_TCP\n );\n\n // Connect to the MQ server \n mqseries_connx($options['qmanager'], $mqcno, $this->_conn, $comp_code, $reason);\n\n if ($comp_code !== MQSERIES_MQCC_OK) {\n die (\"Cannot open connection to server $mq_host_ip($mq_host_port) : \".$comp_code. \" \" .$mq_server. \" \" .$reason. \" \" );\n }Thanks,\nBhaskar### Assistant: No, the PHP is just a wrapper around the C based MQI (see the instructions which talk about linking with mqm and mqic - the C libraries), and there's no way of supplying a username from the C client api, sorry.\n"} +{"text": "### Human: I am getting the error below when I startswebsphere. I really can not figure out what my problem is here. Any help and advicement would be appreciated. ThanksIndex Count Time of last Occurrence Exception SourceId ProbeId\n------+------+---------------------------+--------------------------\n 1 1 24.10.2013 06:35:41:080 GMT org.omg.CORBA.BAD_OPERATION com.ibm.ws.naming.jndicos.CNContextImpl.isLocal 3510\n------+------+---------------------------+--------------------------\n+ 2 1 24.10.2013 06:35:42:284 GMT java.io.IOException com.ibm.ws.management.discovery.DiscoveryService.sendQuery 165the log below is from dmgr_exception.log.------Start of DE processing------ = [24.10.2013 11:24:44:982 GMT] , key = org.omg.CORBA.BAD_OPERATION com.ibm.ws.naming.jndicos.CNContextImpl.isLocal 3510\nException = org.omg.CORBA.BAD_OPERATION\nSource = com.ibm.ws.naming.jndicos.CNContextImpl.isLocal\nprobeid = 3510\nStack Dump = org.omg.CORBA.BAD_OPERATION: The delegate has not been set! vmcid: 0x0 minor code: 0 completed: No\n at org.omg.CORBA.portable.ObjectImpl._get_delegate(ObjectImpl.java:80)\n at org.omg.CORBA.portable.ObjectImpl._is_local(ObjectImpl.java:381)\n at com.ibm.ws.naming.jndicos.CNContextImpl.isLocal(CNContextImpl.java:4901)\n at com.ibm.ws.naming.jndicos.CNContextImpl.(CNContextImpl.java:365)\n at com.ibm.ws.naming.util.WsnInitCtxFactory.getCosRootContext(WsnInitCtxFactory.java:1274)\n at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootContextFromServer(WsnInitCtxFactory.java:934)\n at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootJndiContext(WsnInitCtxFactory.java:824)\n at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:533)\n at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:117)\n at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:712)\n at com.ibm.ws.naming.util.WsnInitCtx.rebind(WsnInitCtx.java:247)\n at javax.naming.InitialContext.rebind(InitialContext.java:379)\n at com.ibm.ws.management.connector.rmi.RMIConnectorController.start(RMIConnectorController.java:88)\n at com.ibm.ws.management.component.JMXConnectors.startRMIConnector(JMXConnectors.java:664)\n at com.ibm.ws.management.component.JMXConnectors.started(JMXConnectors.java:1653)\n at com.ibm.ws.runtime.workloadcontroller.WorkloadController.startedWorkloads(WorkloadController.java:649)\n at com.ibm.ws.runtime.workloadcontroller.WorkloadController.started(WorkloadController.java:595)\n at com.ibm.ws.runtime.component.WLCImpl.start(WLCImpl.java:94)\n at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:977)\n at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:673)\n at com.ibm.ws.runtime.component.ServerImpl.start(ServerImpl.java:526)\n at com.ibm.ws.runtime.WsServerImpl.bootServerContainer(WsServerImpl.java:192)\n at com.ibm.ws.runtime.WsServerImpl.start(WsServerImpl.java:140)\n at com.ibm.ws.runtime.WsServerImpl.main(WsServerImpl.java:461)\n at com.ibm.ws.runtime.WsServer.main(WsServer.java:59)\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n at java.lang.reflect.Method.invoke(Method.java:615)\n at com.ibm.wsspi.bootstrap.WSLauncher.launchMain(WSLauncher.java:183)\n at com.ibm.wsspi.bootstrap.WSLauncher.main(WSLauncher.java:90)\n at com.ibm.wsspi.bootstrap.WSLauncher.run(WSLauncher.java:72)\n at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)\n at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)\n at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)\n at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)\n at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n at java.lang.reflect.Method.invoke(Method.java:615)\n at org.eclipse.core.launcher.Main.invokeFramework(Main.java:340)\n at org.eclipse.core.launcher.Main.basicRun(Main.java:282)\n at org.eclipse.core.launcher.Main.run(Main.java:981)\n at com.ibm.wsspi.bootstrap.WSPreLauncher.launchEclipse(WSPreLauncher.java:339)\n at com.ibm.wsspi.bootstrap.WSPreLauncher.main(WSPreLauncher.java:94)### Assistant: You should have a log file with the incident report in (at least something close to) :/WebSphere/AppServer/profiles/default/logs/ffdc/.It should contain more information (and a stacktrace).EDIT :Websphere 6.1 is qui old already, in fact IBM doesnot support it anymore since 30 sept 2013.Since to problem seems to beknown and fixedin later release, I suggest you update to a more recent version, at least to a recentfixpack of 6.1. You can learn more about the process inthis page.6.1.0.47 FixPackis the last one. You simply need to download the PAK file and run the installer.\n"} +{"text": "### Human: I have recently stated working on MQ. I'm using C# 3.5 to read and write messages.\nI have requirement, need to read messages from one of the queue after sometime or may be next day. And this queue might contain other messages too. So i need to find only those messages which is created by me. So Any option is there, i can set while creating new messages and filter out my messages only after some time or next day when i try to read this queue.it is possible i can read message without message or corelationids.If you have any example/Sample , please send it me.Thanks in advance### Assistant: MQ is optimized to get by correlId. Most common use patterns involve getting by that but you can also get by msgId. (and there's one or two other options). There is also the option from MQ 7 onwards to set message properties and then you could use selectors to achieve what you want but they are not supported in the basic .net interface but are through the XMS (IQueueBrowser for example).I'd also think about your design - generally speaking you want to process all the messages, or use a different queue where you can get just the ones you want. Also, filtering messages has a performance hit, (especially if you go to selectors) so you dont want to be walking down long lists of messages.\n"} +{"text": "### Human: I am trying to create a JMS connection from WebSphere App Server 7, but keep getting JMSWMQ2013 (with MQ reason code 2035). Clearly this is an authentication problem, and I canseemanyothersimilarreportsso I have a rough idea of the general problem.I'm awaiting feedback from our operations team as to the exact configuration of the channel, however, in the meantime I have one observation that is quite puzzling. If I use WebSphere's JAAS authentication to provide the userid, then I always get theJMSWMQ2013error. , however, if explicitly pass thesameuserid to the JMS queue connection factory's call tocreateQueueConnection(), then I don't get the authentication error.To be honest, I would have expected both techniques to behave consistently. Is there some subtlety that I am missing with using JAAS to provide the credentials for a JMS queue connection factory?Edit:I turned on JMS tracing in WAS using*=info: JMSApi=all: JMSServer=all: Messaging=all: JMS_WASTraceAdapter=all: com.ibm.mq.*=all: jmsApi=all, and compared the output line by line.When using JAAS I can can see that deep in the bowels ofJmsXAQueueConnectionImplit is actually callingWMQConnection.getProcessUserId()which returns the userid that my WAS instance is running under (which is definitelynotthe user that is defined in the channel'sMCAUSER).It is all quite odd... it doesn't seem to be picking up the JAAS authentication entry at all. My QCF definitely is using CLIENT transport with a mapping configuration alias of DefaultPrincipalMapping, but for some reason it is still using the process's userid instead of the JAAS userid.Thanks.\nCraig### Assistant: Run IBM WebSphere MQ Explorer as administrator of OS.\nDisable identification record of a channel at queue manager properties (menu link/connection or smth like that).\n"} +{"text": "### Human: I want to save the CURDEPTH as a variable in my bash script? Is there a way to run this and save the curdepth ammount as a variable?runmqsc QMGR\ndis ql (##############) where(curdepth gt 1)\n 3 : dis ql (##############) where(curdepth gt 1)\nAMQ8409: Display Queue details.\n QUEUE(#############) TYPE(QLOCAL)\n CURDEPTH(71514)\nend### Assistant: Instead ofgrep 'CURDEPTH(' | sed 's/.*CURDEPTH//' | tr -d '()'You can do this if you have GNU grepgrep -oP '(?<=CURDEPTH\\()\\d+'Otherwise, with one sed commandsed -n '/[[:blank:]]*CURDEPTH(\\([[:digit:]]\\+\\))/s//\\1/p'\n"} +{"text": "### Human: I am trying to use JMeter to work with IBM MQ.As per thearticleI created the JNDI Bindings.Now I am trying to connect JMeter using the JNDI Bindings. I give the QCF (Queue Connection Factory), but it is throwing an error\"Response message: java.lang.IllegalStateException: QueueConnectionFactory expected, but got javax.naming.Reference\"I searched around a lot, but didnt find anything. I looked at source code for Sampler and it looks like it is not able to find the Connection Factory from the JNDI.Any idea what could i be missing? I Didnt know if the Configuration details would help, if it would i can provide that.Thanks in Advance!### Assistant: I was able to resolve this by copying all the MQ Jars (that comes with a complete Websphere MQ installation) and placing them into JMeter/Lib.Now it works fine.Thanks for anyone who viewed this. Hope my answer may provide some light to others who may encounter the same problem.\n"} +{"text": "### Human: We are currently implementing a security exit for our SVRCONN channels. This exit will authenticate to our LDAP(AD or UNIX). Our current implementation of the exit is working for only connections coming from MQ EXPLORER.When we write a code to connect and pass the userID/PWD, the security exit is picking up the user account login on the client machine.Here is a snippet on how we connect to MQCode:MQCNO ConnectOptions = {MQCNO_DEFAULT};\nMQCD ClientConn = {MQCD_CLIENT_CONN_DEFAULT}; \nMQCSP mqCSP = {MQCSP_DEFAULT}; \nMQHCONN HConn; \nMQLONG CompCode; \nMQLONG Reason; \nchar QMName[MQ_Q_MGR_NAME_LENGTH+1]=\"QMGRNAME\"; \nchar channelName[MQ_CHANNEL_NAME_LENGTH+1]=\"MY_CHANNEL\"; \nchar hostname[1024]=\"MQSERVER(PORT)\"; \nchar UserId[32+1]=\"MyID\"; \nchar Password[32+1]=\"MyPWD\"; \nstrncpy(ClientConn.ConnectionName, hostname, MQ_CONN_NAME_LENGTH); \nstrncpy(ClientConn.ChannelName, channelName, MQ_CHANNEL_NAME_LENGTH); \nmqCSP.AuthenticationType = MQCSP_AUTH_USER_ID_AND_PWD; \nmqCSP.Version = MQCSP_VERSION_1; \nmqCSP.CSPUserIdPtr = &UserId; \nmqCSP.CSPUserIdOffset = 0; \nmqCSP.CSPUserIdLength = strlen(UserId); \nmqCSP.CSPPasswordPtr = &Password; \nmqCSP.CSPPasswordOffset = 0; \nmqCSP.CSPPasswordLength = strlen(Password); \nConnectOptions.SecurityParmsPtr = &mqCSP; \nConnectOptions.SecurityParmsOffset = 0; \nConnectOptions.ClientConnPtr = &ClientConn; \nConnectOptions.Version = MQCNO_VERSION_5; \nMQCONNX (QMName, &ConnectOptions, &HConn, &CompCode, &Reason);Then we use this code to retrieve the userID/PWD on the security exit. \nCode:memset (User, 0, pChDef->LongRemoteUserIdLength);\nmemset (Pass, 0, MQ_PASSWORD_LENGTH); \nMakeCString(User,pChDef->LongRemoteUserIdPtr,pChDef->LongRemoteUserIdLength); \nMakeCString(Pass,pChDef->RemotePassword,MQ_PASSWORD_LENGTH);MQ Server->7.1.0.2### Assistant: Why in the world would you re-invent the wheel when there is a cheap product that does authentication against an LDAP server? If you spent more than a day programming this, you instead could have purchased a license for MQ Authenticate Security Exit and done something else.MQ only flows the password in plain text. Very easy to grab that password if you are familiar with MQ or just use WireShark since it knows/understands MQ protocol.MQ uses 2 different styles of flowing the UserID and Password between a client and server: \"old\" and \"new\" style. Different platforms support different styles. Some support both directly and some support both indirectly and some platforms do a conversion and flow both at the same time (very weird!).It is fine if all of your applications can be rebuilt to use MQCONNX by what if the application cannot be rebuilt? Or the application team does not want to do it or the source code is lost. What about 3rd party applications that do not support MQCONNX? What are you going to do?What about MQ JNDI or CCDT (Client Channel Table Definitions) or the new \"MQClient.ini\" file? Have you thought about how you are going to handle these implementations?You are going to easily spend 6 months (i.e. 1000 hours) building a working prototype that covers some of the issues I have highlighted. You are in for a world of hurt. I know, I've been there done that.\n"} +{"text": "### Human: I have the following error showing up in AMQERR01.LOGAMQ9999: Channel 'MGATESrvChannel' to host 'Mgate (127.0.0.1)' ended\nabnormally.\n\nEXPLANATION:\nThe channel program running under process ID 1060(4364) for channel\n'MGATESrvChannel' ended abnormally. The host name is 'Mgate (127.0.0.1)'; in\nsome cases the host name cannot be determined and so is shown as '????'.This error is preceded with following message:AMQ9508: Program cannot connect to the queue manager.\n\nEXPLANATION:\nThe connection attempt to queue manager 'MGATE.QM' failed with reason code\n2059.\nACTION:\nEnsure that the queue manager is available and operational.According to what I have been told this can be caused by an application that is using queue manager, however, it seems to me that this has more to do with the way that manager was set up or similar. Can anyone please shed some light on this?Thanks in advance!### Assistant: The 2059 says that a connection request was received and refused because the QMgr was not available. We used to see this a lot when the listener was run as a separate process or when inetd was used to start channels. This is because the listener was there to accept the connection but the QMgr processes were not.Now that the listener is run as a child process of the QMgr, it is quite rare to see this on the WMQ error logs though clients commonly see it. This is because when the listener is run as a child process of the QMgr, there is nothing listening to receive the connection request and it bounces off of the host's IP stack before ever getting to MQ code.The AMQ9999 message says that a channel program, one of the QMgr's child processes, died or was killed and this caused the channel to terminate. There are many reasons for a channel process to die including being killed by the OS if resources are short, or being killed by a human operator. Other than that the most common way they can die due to running in trusted or fastpath mode and the attached program corrupts them.It would help to narrow down the field to know the details of the QMgr in question - version and fix pack, how the listeners are started, channel settings, etc.\n"} +{"text": "### Human: Does the MQ client provide the ability to define multiple MQ Server hosts in the client configuration? I have not been able to find anything about it. I wanted to have multiple MQ Servers available with the same queue and if one of them is unavailable, have the client then try to connect to the other server. I was hoping, like some db instances, you could define numerous hosts and the client driver would route to one that is available.I know we could add logic that would connect to a different server on connection error, but wanted to use the driver, if possible, to perform this operation.Using .Net 4.0 WCF / WebSphere MQ 7.1Any information / comments would be greatly appreciated.### Assistant: Shashi is the WMQ .Net master so I'll defer to his link in the comments as to the .Net specific answer.The architecture answer is that you may be complicating this too much. If the queue in question is advertised to the cluster and the app is sending messages to it, then the app need only connect to any QMgr in the cluster and put to that queue. It can dynamically create a reply-to queue and use that handle to specify the reply-to address of the request message. Ideally, service requestor apps are a network hop away from the target queue specifically so that they can utilize WMQ clustering for the purpose you describe.There is a slightly less ideal scenario in which the client is connected to one of the QMgr instances that hosts an instance of the target queue. It is possible to configure the queue'sCLWLUSEQattribute so that messages are distributed between the local and remote queue instances.In any of the scenarios where the app is sending request messages, it can be provided with aCONNAMEcontaining a comma-separated list of eligible QMgrs to which it can connect. Modern versions of WMQ let you specify multiple connection points in theCONNAMEusing theMQCONNXAPI. Both current and older clients can use aCCDTfile that contains multiple connection definitions and allows the client to switch between them.If the app islisteningon the queue for requests, this is a different story. If that app is transactional, it cannot be configured to fail over to another QMgr. This is because the XA transaction can only be resolved on the same QMgr instance. But even setting aside the question of transactions, you usually don't want an app that listens for requests to fail over. To do so would leave the local instance of the queue un-served and messages would pile up there. The better answer is to run multiple instances of the server-side app such that each queue instance has at least two app instances serving it. That way you can take an outage of one of the app instances without having an un-served queue. Similarly, if a QMgr goes down, messages are automatically routed to the remaining queue instances in the cluster which are served by the other app instances.There are a number of other architectural reasons which apply to request/reply scenarios and which lead toward a clustered solution. Other considerations apply to different types of messaging but in general, the answer is that yes, the clients can be configured in several ways to fail over to another queue manager. All of these are based on the QMgr becoming unavailable, not the queue itself. If the event you are trying to capture is the queue fills or someone PUT(DISABLE) it, the best answer is instrumentation and monitoring, the second best answer is application logic.\n"} +{"text": "### Human: We are trying to publish messages on a topic using multiple connection handles for a queue manager. We are using threads for this.\n However when we use fifty threads the messages are properly pulbished on to the topic but as we go on increasing the threads, to say 500, we get the following reason codes 2071,2012,2538 for some threads and then the program crashes giving reason code as 2059 for remaining threadsI thought that may be due to restriction on the number of connection handle we are getting these errors. So I tried\n1. adding channels stanza to qm.ini file\n CHANNELS:\n MaxChannels=\n MaxActiveChannels= \n\n2. altering MAXHANDS of my queuemanager to 2000\n\n\nBut found no luck in the above approaches.\nKindly help me in solving this issue.\n\nPS. We have created our own Library for calling websphere MQ API.\n\nThanks,\nMandar.### Assistant: Suggest you try increasing the Shared Conversation (SHARECNV) value on the server connection channel you are using for connecting to queue manager.In runmqsc shell run the following command to alter the SHARECNV for the channel.alter channel chltype(SVRCONN) sharecnv()\n"} +{"text": "### Human: Can we write a code in Java to start/stop a queue manager? I haven't come across any Java API which can be used for this.### Assistant: You can executestrmqm command from your Java program to start the queue manager.Example:Runtime.getRuntime().exec(\"C:\\Program Files (x86)\\IBM\\WebSphere MQ\\bin\\strmqm QM1\");\n"} +{"text": "### Human: This is a discussion point I'd like to raise, regarding how folks position the administration of MQ. Is it seen as a resource/utility function, like networks, databases, or servers, or is it rather identified as being closely linked to applications, and therefore, integrated closely in application development/sustainment? Or rather, might it only be kept separate from applications, if there is enough demand for MQ admin activities in multiple projects/applications, so as to not be too aligned with anyone application?### Assistant: I have seen it both ways. \nThe larger the organization, the demand for MQ services will be high and hence a separate team of MQ admins. They maintain the MQ network as well as work on various projects that involve MQ.In small companies MQ is aligned with either infrastructure administration team or application support team especially the middleware support team.\n"} +{"text": "### Human: Our process needs to read messages from a topic on the local Q manager and also write to a different topic on the same local Q manager.To read messages we have usedMQCB. The messages reach the callback function of the process. However, while the callback remains registered, we are not able toMQPUTmessages to a different topic.We get an error that says:2500 : MQRC_HCONN_ASYNC_ACTIVEAn attempt to issue an MQI call has been made while the connection is startedApparently, a single connection handle cannot be used to both read and write. We have to Suspend theMQCB,MPUTthe message and Resume theMQCBto get it to work.Is there a way to avoid having to suspend and resume?Thanks in advance### Assistant: Yes, that is the expected behavior when using MQCB. Two approaches you can take:1) Create another connection to the same queue manager to publish messages.2) If your design is to publish messages whenever you receive a message on the callback function, then publish messages from callback function itself.UpdateMQRC_ALREADY_CONNECTED (2002) issue: What MQCNO_HANDLE_SHARE_* option have you used? Suggest you to use MQCNO_HANDLE_SHARE_BLOCK option to get around this problem. I wrote a sample program and created two connections on the same thread by using MQCNO_HANDLE_SHARE_BLOCK option.\n"} +{"text": "### Human: I'm trying to write a simple Java program to inject an MQ message onto a queue. I'm very inexperienced with writing to MQ queues using Java and have a couple of questions.Can I connect to the unix queue on the unix box from my windows machine?When I try to run the application I get a ....\njava.lang.UnsatisfiedLinkError: no mqjbnd05 in java.library.pathFrom the sounds of what I could find in google I am missing some sort of resource. I'm thinking I'm getting this error possibly bc I'm not allowed to connect to the queue from windows?Any good examples of how to achieve what I'm doing or help would be appreciated.public class MQInject {\n\n private MQQueueManager _queueManager = null;\n private Hashtable params = null;\n\n public int port = 1414;\n public static final String hostname = \"UQMYPOSIS1\";\n public static final String channel = \"MQTX1012.MQTX1013\";\n public static final String qManager = \"MQTX1013\";\n public static final String outputQName = \"IIS.TLOG.5\";\n\n public MQInject(){\n super();\n }\n\n public void init(){\n\n //Set MQ connection credentials to MQ Envorinment.\n MQEnvironment.hostname = hostname;\n MQEnvironment.channel = channel;\n MQEnvironment.port = port;\n //MQEnvironment.userID = \"\";\n //QEnvironment.password = password;\n //set transport properties.\n MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);\n\n try {\n //initialize MQ manager.\n _queueManager = new MQQueueManager(qManager);\n } catch (MQException e) {\n e.printStackTrace();\n }\n } \n\n public static void main(String[] args)\n {\n\n MQInject write = new MQInject();\n try\n {\n write.selectQMgr();\n write.write();\n }\n catch (IllegalArgumentException e)\n {\n System.out.println(\"Usage: java MQWrite <-h host> <-p port> <-c channel> <-m QueueManagerName> <-q QueueName>\");\n System.exit(1);\n }\n catch (MQException e)\n {\n System.out.println(e);\n System.exit(1);\n }\n }\n\n private void selectQMgr() throws MQException\n {\n _queueManager = new MQQueueManager(qManager);\n } \n\n\n private void write() throws MQException{\n String line;\n int lineNum=0;\n int openOptions = MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING;\n\n try {\n MQQueue queue = _queueManager.accessQueue( outputQName,\n openOptions,\n null, // default q manager\n null, // no dynamic q name\n null ); // no alternate user id\n\n DataInputStream input = new DataInputStream(System.in);\n\n System.out.println(\"MQWrite v1.0 connected\");\n System.out.println(\"and ready for input, terminate with ^Z\\n\\n\");\n\n // Define a simple MQ message, and write some text in UTF format..\n MQMessage sendmsg = new MQMessage();\n sendmsg.format = MQC.MQFMT_STRING;\n sendmsg.feedback = MQC.MQFB_NONE;\n sendmsg.messageType = MQC.MQMT_DATAGRAM;\n sendmsg.replyToQueueName = \"ROGER.QUEUE\";\n sendmsg.replyToQueueManagerName = qManager;\n\n MQPutMessageOptions pmo = new MQPutMessageOptions(); // accept the defaults, same\n // as MQPMO_DEFAULT constant\n while ((line = input.readLine()) != null){\n sendmsg.clearMessage();\n sendmsg.messageId = MQC.MQMI_NONE;\n sendmsg.correlationId = MQC.MQCI_NONE;\n sendmsg.writeString(line);\n // put the message on the queue\n queue.put(sendmsg, pmo);\n System.out.println(++lineNum + \": \" + line);\n }\n\n queue.close();\n _queueManager.disconnect();\n\n }catch (com.ibm.mq.MQException mqex){\n System.out.println(mqex);\n }\n catch (java.io.IOException ioex){\n System.out.println(\"An MQ IO error occurred : \" + ioex);\n }\n } \n}### Assistant: For your first question, yes you can have a queue manager running on a UNIX host which is accessed by a client running on a Windows host.For your second question, the mqjbnd05 library is only used to connect to the queue manager in binding mode (i.e. when the queue manager and the program accessing the queues are on the same host) and is not part of the MQ client installation. Seehttp://www-01.ibm.com/support/docview.wss?uid=swg21158430for more details. Looking through your code I can see that theinit()function is specifyingMQC.TRANSPORT_MQSERIES_CLIENTalthough I cannot see that theinit()function is being called. Also it might be worth checking whether mqjbnd05 is specified in the library path and if so removing it.Whilst probably not related to the error your getting, one other thing that might be worth checking is that the channelMQTX1012.MQTX1013is a server connection channel as opposed to a sender or receiver channel.\n"} +{"text": "### Human: I'm new in MDB and EE. Please tell me there is i'm wrong.\nMy app must interaction with Websphere MQ (wait a messaege in queue, do something and reply).\nI'm using NetBeans 7.3 ,GlassFish 3.1, Websphere MQ 6.2, resorce adapter wmq.jmsra.rar. Interaction must be not in jms format is, only Web MQ nature.\nI'm deploy adapter and create Connecton pool and Administrated Object.\nIn domain.xml\n \n \n \n \n \n \n\n\n\n\n \n \n \n \n \n \n \n \n \n'\nIn netbeans i'm create EE project and message driven bean. i'm gett this code '@MessageDriven(mappedName = \"wmqJmsAOR\", activationConfig = {\n @ActivationConfigProperty(propertyName = \"acknowledgeMode\", propertyValue = \"Auto- \n acknowledge\"),\n @ActivationConfigProperty(propertyName = \"destinationType\", propertyValue = \"javax.jms.Queue\")\n\n })\npublic class NewMessage implements MessageListener {\npublic NewMessage() {\n super();\n System.out.println(\"I created\");\n}\n\n@Override\npublic void onMessage(Message message) {\n\n System.out.println(\"I'm getting message\");\n\n}\n`Please tell me why this MDB is not listenig a queue (i'm put test message in Websphere MQ console). May be i'm must write something in config (now project as default netbeans created).Alexei### Assistant: I have a solution that works. It is not the best solution but it does work extremely well.What we have done is to create a very simpleActivationSpecWrapperclass to extend the IBMcom.ibm.mq.connector.inbound.ActivationSpecImplclass. This wrapper class has one public set/get property (asJNDI). The purpose if the class is to read via JNDI context the Properties class defined in the App server that contains all the properties to be assigned in the activation of the MDB.First, create the newActivationSpecWrapperclass. you can put this in any package of your choosing.import java.lang.reflect.Field;\nimport java.lang.reflect.Method;\nimport java.util.Properties;\nimport java.util.logging.Level;\nimport java.util.logging.Logger;\nimport javax.naming.InitialContext;\nimport com.ibm.mq.connector.inbound.ActivationSpecImpl;\n\npublic class ActivationSpecWrapper extends ActivationSpecImpl\n{\n\n private static final long serialVersionUID = -529716553593856979L;\n\n private static final String sourceClass = ActivationSpecWrapper.class.getName();\n private static final Logger log = Logger.getLogger(sourceClass);\n\n private String asJNDI = null;\n\n public void setAsJNDI(String asJNDI)\n {\n log.config(\"asJNDI = \" + asJNDI);\n this.asJNDI = asJNDI;\n\n try\n {\n final InitialContext ctx = new InitialContext();\n final Properties properties = (Properties) ctx.lookup(asJNDI);\n\n for (final Object key : properties.keySet())\n {\n try\n {\n final String value = properties.getProperty((String) key);\n final Object field = getSetter((String) key);\n if (field != null)\n {\n if (field instanceof Field)\n {\n log.fine(\"Setting \" + key + \" via Field \" + (String) key + \" = \" + value);\n ((Field) field).set(this, value);\n\n }\n else\n {\n log.fine(\"Setting \" + key + \" via Method \" + (String) key + \" = \" + value);\n ((Method) field).invoke(this, value);\n }\n log.config(key + \" = \" + value);\n }\n else\n {\n log.warning(\"Invalid ActivationSpec Field: \" + key);\n }\n }\n catch (final NoSuchFieldException e)\n {\n log.throwing(sourceClass, \"setAsJNDI\", e);\n }\n\n }\n\n }\n catch (final Exception e)\n {\n log.log(Level.SEVERE, \"Error looking up \" + asJNDI, e);\n return;\n }\n\n }\n\n public String getAsJNDI()\n {\n return asJNDI;\n }\n\n private static Object getField(String fieldName) throws NoSuchFieldException\n {\n return ActivationSpecWrapper.class.getField(fieldName);\n }\n\n private static Object getSetter(String fieldName) throws NoSuchFieldException\n {\n try\n {\n final StringBuilder sb = new StringBuilder(fieldName.length() + 3).append(\"set\").append(fieldName);\n sb.setCharAt(3, Character.toUpperCase(sb.charAt(3)));\n\n return ActivationSpecWrapper.class.getMethod(sb.toString(), String.class);\n }\n catch (final NoSuchMethodException e)\n {\n return getField(fieldName);\n }\n }\n}To implement the class you just need to modify theMETA-INF/ra.xmlfile inside thewmq.jmsra.rarfile. Change the one occurrence of the ActivationSpecImpl class to your class. This will be your new incoming connection factory'sActivationSpecWrapperclass that it uses. So now your wrapper class can look to the app server for the properties to use.I do this as follows:: jar -xvf wmq.jmsra.rar META-INF/ra.xml\n: perl -pi -e 's/com\\.ibm\\.mq\\.connector\\.inbound\\.ActivationSpecImpl/your.new.package.ActivatonSpecWrapper/g' META-INF/ra.xml\n: jar -uvf wmq.jmsra.rar META-INF/ra.xmlBefore modifying theMETA-INF/ra.xmllooks like:\n \n com.ibm.mq.connector.inbound.ActivationSpecImpl\n \n \n destination\n \n \n destinationType\n \nAfter the change, theMETA-INF/ra.xmlshould like like:\n \n your.new.package.ActivatonSpecWrapper\n \n \n destination\n \n \n destinationType\n \nNow you will need to add your new package to the RAR file. It should be in standard directory structure. like this:: jar -uvf wmq.jmsra.rar your/new/package/ActivationSpecWrapper.classThe problem stems from IBM placing the host/port/queue manager/channel (etc.) into the activation spec instead of the administration object. It belongs in the administration object since that is the connection factory for MDB queues. IBM only allows two properties there.Also if you are using glassfish, oracle really botched things up for MDB classes that need resource adapters, because the glassfish@MessageDrivenannotation assumes the app containers default resource adapter (OpenMQ) for JMS. This means the vendor specificActivationSpecImpldoes not work, and thus IMB's custom parameters for host/port and other activation config properties are not supported via annotations until after the resource adaptor is switch via theglassfish-ejb-jar.xml.JBoss allows for the@ResourceAdapterannotation to change the resource adapter but Glassfish only allows this via theglassfish-ejb-jar.xmlfile. And when this is used, you only need to annotate your MDB with three activation config properties (thedestinationType). Everything else you will place in your JNDI published Properties.Theglassfish-ejb-jar.xmlshould look like this:\n\n\n \n 1\n \n MyMDB\n \n wmq.jmsra\n \n \n asJNDI\n mq/InboundMessages\n \n \n \n \n \nThe MDB@MessageDrivenannotation will look something like this:@MessageDriven(activationConfig =\n {\n @ActivationConfigProperty(propertyName = \"destinationType\", propertyValue = \"javax.jms.Queue\"),\n @ActivationConfigProperty(propertyName = \"destination\", propertyValue = \"jms/InboundMessage_queue\"),\n @ActivationConfigProperty(propertyName = \"useJNDI\", propertyValue = \"true\") })\npublic class MyMDB implement MessageListener\n{\n public void onMessage(Message message)\n {\n // message handler code goes here...\n }\n}The last step to make this work, is to add themq/InboundMessagesproperties to JDNI, to define the factory properties for the MQ listener resource. This is how it is defined in thedomain.xmlfile:\n \n \n \n \n \nI hope this helps. This isn't the easiest solution but it is simple enough, and once it has been established, it is very portable, and allows the app server administrator to manage the connection details to the MQ, instead of the developer.\n"} +{"text": "### Human: How can i changeJMS_IBM_MQMD_Format: MQHRF2toJMS_IBM_MQMD_Format: MQSTRin WebsphereMQ Message?I need JMS_IBM_MQMD_Format: MQSTRi got output like:JMSMessage class: jms_text\n JMSType: null\n JMSDeliveryMode: 2\n JMSExpiration: 0\n JMSPriority: 4\n JMSMessageID: ID:010203040506070801020304050607080102030405060708\n JMSTimestamp: 1365655482749\n JMSCorrelationID: null\n JMSDestination: queue:///MYQUEUE?mdMessageContext=1&mdWriteEnabled=true\n JMSReplyTo: null\n JMSRedelivered: false\n JMSXAppID: WebSphere MQ Client for Java\n JMSXDeliveryCount: 1\n JMSXUserID: \n JMS_IBM_Character_Set: UTF-8\n JMS_IBM_Encoding: 273\n JMS_IBM_Format: MQSTR \n JMS_IBM_MQMD_AccountingToken: 0000000000000000000000000000000000000000000000000000000000000000\n JMS_IBM_MQMD_ApplIdentityData: \n JMS_IBM_MQMD_ApplOriginData: \n JMS_IBM_MQMD_BackoutCount: 0\n JMS_IBM_MQMD_CodedCharSetId: 1208\n JMS_IBM_MQMD_CorrelId: 000000000000000000000000000000000000000000000000\n JMS_IBM_MQMD_Encoding: 273\n JMS_IBM_MQMD_Expiry: -1\n JMS_IBM_MQMD_Feedback: 0\n JMS_IBM_MQMD_Format: MQHRF2 \n JMS_IBM_MQMD_GroupId: 000000000000000000000000000000000000000000000000\n JMS_IBM_MQMD_MsgFlags: 0\n JMS_IBM_MQMD_MsgId: 010203040506070801020304050607080102030405060708\n JMS_IBM_MQMD_MsgSeqNumber: 1\n JMS_IBM_MQMD_MsgType: 8\n JMS_IBM_MQMD_Offset: 0\n JMS_IBM_MQMD_OriginalLength: -1\n JMS_IBM_MQMD_Persistence: 1\n JMS_IBM_MQMD_Priority: 4\n JMS_IBM_MQMD_PutApplName: WebSphere MQ Client for Java\n JMS_IBM_MQMD_PutApplType: 28\n JMS_IBM_MQMD_PutDate: 20130411\n JMS_IBM_MQMD_PutTime: 04444315\n JMS_IBM_MQMD_ReplyToQ: \n JMS_IBM_MQMD_ReplyToQMgr: MYQM \n JMS_IBM_MQMD_Report: 0\n JMS_IBM_MQMD_UserIdentifier: \n JMS_IBM_MsgType: 8\n JMS_IBM_PutApplType: 28\n JMS_IBM_PutDate: 20130411\n JMS_IBM_PutTime: 04444315SimpleMQMDWrite: Your lucky number today is 733### Assistant: Destination producerDestination = producerSession.createQueue(\n messagingQueueDetail.getRequestQueueName()\n);\n\n((MQQueue) producerDestination).setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ);\n\n// MessageProducer is used for sending messages\nproducer = producerSession.createProducer(producerDestination);\n"} +{"text": "### Human: I read the messages from one queue to another queue. However my correlation ids are not preserved.If the correlation id is \"ABC12345\" for a message in the import queue, when i put it into the export queue, the value of the correlation id is different.How do i keep the same correlation id between the 2 queues and always\n have a unique message id?Get:mqQueue.Get(mqMsg);\nstring messageID = Convert.ToString(mqMsg.MessageId);\nstring correlationID = Convert.ToString(mqMsg.CorrelationId);If for example if the correlation id is \"000123456789\", then after read, while putting it back , the value gets changed for the same message.Put:mqMsg.CorrelationId = System.Text.Encoding.UTF8.GetBytes(correlationID);\n mqQueue.Put(mqMsg, mqPutMsgOpts);I am using MQ PUT and GET options via MQ.NET classes.### Assistant: The code snippet below preserves the correlation id when I put message to another queue. In my sample I do the following:1) Put a message toimportQwith unique correlation ID.2) Get that message fromimportQ.3) Put the received message toexportQpublic static void preserveCorreLid()\n {\n Hashtable mqProps = new Hashtable();\n MQQueueManager qm = null;\n String strCorrelId = \"00123456789\";\n\n try\n {\n mqProps.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\n mqProps.Add(MQC.CHANNEL_PROPERTY, \"NET.CLIENT.CHL\");\n mqProps.Add(MQC.HOST_NAME_PROPERTY, \"localhost\");\n mqProps.Add(MQC.PORT_PROPERTY, 2099);\n\n qm = new MQQueueManager(\"QM\", mqProps);\n\n MQQueue importQ = qm.AccessQueue(\"IMPORTQ\", MQC.MQOO_INPUT_SHARED |MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING );\n\n MQMessage mqPutMsg = new MQMessage();\n mqPutMsg.WriteString(\"This is an import message\");\n mqPutMsg.CorrelationId = System.Text.Encoding.UTF8.GetBytes(strCorrelId);\n MQPutMessageOptions mqpmo = new MQPutMessageOptions();\n importQ.Put(mqPutMsg,mqpmo);\n\n MQMessage respMsg = new MQMessage();\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.WaitInterval = 3000;\n gmo.Options = MQC.MQGMO_WAIT;\n\n try\n {\n importQ.Get(respMsg, gmo);\n }\n catch (MQException ex)\n {\n Console.Write(ex);\n\n Console.WriteLine(\"Queue Name : \" + importQ.Name + \":\");\n }\n importQ.Close();\n\n MQQueue exportQ = qm.AccessQueue(\"EXPORTQ\", MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING);\n exportQ.Put(respMsg);\n exportQ.Close();\n qm.Disconnect();\n }\n catch (Exception ex)\n {\n Console.WriteLine(ex);\n }\n }\n"} +{"text": "### Human: For using XA transactions with WebSphere MQ in standalone Java I am doing below step and getting error asxlc not foundstep 1- Prepare the XA switch filesFor linking object files to their corresponding database libraries. I am executing below commandinstall path of websphere MQ/java/lib/jdbc>make oracleI am getting below errorxlc: not foundI am not sure if xlc is installed in my machine.\nMy machine is AIX 6.1.\nBut I can find xlcpp in my machine.\nhow to proceed?Is there any way to create switch file?If I execute \n$ /usr/ccs/lib/cpp -helpI am getting1506-173 (W) Option help is not valid. Enter xlc for list of valid options.Reference:http://www.ibm.com/developerworks/websphere/library/techarticles/0601_ritchie/0601_ritchie.html### Assistant: Dwayne has it mostly right but I believe xlc++ also has a version of xlc. I see in your other question that you have xlcpp so perhaps what you need to do is add /usr/vacpp/bin to your PATH.I also tend to use grep with lslpp:lslpp -ch | grep vacshould tell you which xlc, xlcpp, etc you have installed.HTH\n"} +{"text": "### Human: Hi I created two queue managers, I put the message in remote queue(PVN.TO.NAG) in qmgr(pvn)\nbut when I get the message from the other qmgr(nag) localqueue(LQ.NAG) . but it shown no more messages?-bash-3.00$ /opt/mqm/samp/bin/amqsput PVN.TO.NAG pvn\n Sample AMQSPUT0 start\n target queue is PVN.TO.NAG\n hi this is pvn\n\n Sample AMQSPUT0 end\n -bash-3.00$ /opt/mqm/samp/bin/amqsget LQ.NAG nag\n Sample AMQSGET0 start\n no more messages### Assistant: 1) Have you linked bothpvnandnagqueue managers using sender & receiver channels and transmit queue?2) Verify the remote queue definitionPVN.TO.NAGis correct, i.e it points toLQ.NAG3) Check ifnagqueue manager has a dead letter queue(DLQ) set. If it is already set, check if your message is ending up there because thenagqueue manager is not able to route the message to a queue on remote queue manager. If the message is there, then it will contain reason why the message ended up in DLQ.\n"} +{"text": "### Human: I have a simple WSO2 ESB Axis2 JMS transport pulling a message from an ActiveMQ queue and pushing it to a Websphere MQ Queue.When the message is sent I get the following errorcom.ibm.msg.client.jms.DetailedMessageFormatException: JMSCC0050: The property name 'JMS_DESTINATION' is reserved and cannot be setI'm not setting any properties explicitly but I wonder if this is the way the WSO2 ESB Axis2 JMS transport sends a message to Websphere MQ?This works fine the other way Websphere MQ to ActiveMQ.I am using Client Mode on the JNDI Websphere MQ connection factory and connecting to this via an LDAP server also using the default SYSTEM.DEF.SVRCONN channel.Could it be a permissions issue in Websphere MQ?I ran ALTER QMGR CHLAUTH(DISABLED) to rule out any permissions issues (I hoped).Proxy Service\n \n \n \n \n \n \n
\n \n 5\n \n
\n
\n
\n
\n \n \n \n \n
\n activeMQQueueConnectionFactory\n QUEUE.IN\n \n
axis2 jms transportReceiver config\n \n org.apache.activemq.jndi.ActiveMQInitialContextFactory\n tcp://localhost:61616\n QueueConnectionFactory\n queue\n \n\n \n com.sun.jndi.ldap.LdapCtxFactory\n ldap://localhost:7777/dc=example,dc=com\n cn=ConnectionFactoryLdap\n queue\n \n axis2 jms transportSender config\n \n org.apache.activemq.jndi.ActiveMQInitialContextFactory\n tcp://localhost:61616\n QueueConnectionFactory\n queue\n \n\n \n com.sun.jndi.ldap.LdapCtxFactory\n ldap://localhost:7777/dc=example,dc=com\n cn=ConnectionFactoryLdapCM\n queue\n \n Full Stack Tracecom.ibm.msg.client.jms.DetailedMessageFormatException: JMSCC0050: The property name 'JMS_DESTINATION' is reserved and cannot be set.\nThe supplied property name begins with the JMS prefix, but is not one of the supported, settable properties.\nCheck the property name and correct errors.\n at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\n at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)\n at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)\n at java.lang.reflect.Constructor.newInstance(Constructor.java:513)\n at com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:319)\n at com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:233)\n at com.ibm.msg.client.jms.internal.JmsErrorUtils.createException(JmsErrorUtils.java:109)\n at com.ibm.msg.client.jms.internal.JmsMessageImpl.checkSettablePropertyName(JmsMessageImpl.java:2125)\n at com.ibm.msg.client.jms.internal.JmsMessageImpl.setStringProperty(JmsMessageImpl.java:1560)\n at com.ibm.jms.JMSMessage.setStringProperty(JMSMessage.java:1496)\n at org.apache.axis2.transport.jms.JMSUtils.setTransportHeaders(JMSUtils.java:278)\n at org.apache.axis2.transport.jms.JMSSender.createJMSMessage(JMSSender.java:441)\n at org.apache.axis2.transport.jms.JMSSender.sendOverJMS(JMSSender.java:172)\n at org.apache.axis2.transport.jms.JMSSender.sendMessage(JMSSender.java:154)\n at org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:112)\n at org.apache.axis2.engine.AxisEngine$TransportNonBlockingInvocationWorker.run(AxisEngine.java:626)\n at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)\n at java.lang.Thread.run(Thread.java:662)\n[2013-03-15 10:25:35,306] ERROR - AsyncCallback Error creating a JMS message from the message context\norg.apache.axis2.AxisFault: Error creating a JMS message from the message context\n at org.apache.axis2.transport.base.AbstractTransportSender.handleException(AbstractTransportSender.java:226)\n at org.apache.axis2.transport.jms.JMSSender.sendOverJMS(JMSSender.java:174)\n at org.apache.axis2.transport.jms.JMSSender.sendMessage(JMSSender.java:154)\n at org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:112)\n at org.apache.axis2.engine.AxisEngine$TransportNonBlockingInvocationWorker.run(AxisEngine.java:626)\n at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)\n at java.lang.Thread.run(Thread.java:662)\nCaused by: com.ibm.msg.client.jms.DetailedMessageFormatException: JMSCC0050: The property name 'JMS_DESTINATION' is reserved and cannot be set.\nThe supplied property name begins with the JMS prefix, but is not one of the supported, settable properties.\nCheck the property name and correct errors.\n at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\n at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)\n at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)\n at java.lang.reflect.Constructor.newInstance(Constructor.java:513)\n at com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:319)\n at com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:233)\n at com.ibm.msg.client.jms.internal.JmsErrorUtils.createException(JmsErrorUtils.java:109)\n at com.ibm.msg.client.jms.internal.JmsMessageImpl.checkSettablePropertyName(JmsMessageImpl.java:2125)\n at com.ibm.msg.client.jms.internal.JmsMessageImpl.setStringProperty(JmsMessageImpl.java:1560)\n at com.ibm.jms.JMSMessage.setStringProperty(JMSMessage.java:1496)\n at org.apache.axis2.transport.jms.JMSUtils.setTransportHeaders(JMSUtils.java:278)\n at org.apache.axis2.transport.jms.JMSSender.createJMSMessage(JMSSender.java:441)\n at org.apache.axis2.transport.jms.JMSSender.sendOverJMS(JMSSender.java:172)\n ... 6 more\n[2013-03-15 10:25:35,310] WARN - AsyncCallback Executing fault handler due to exception encountered\n[2013-03-15 10:25:35,311] WARN - FaultHandler ERROR_CODE : 0\n[2013-03-15 10:25:35,311] WARN - FaultHandler ERROR_MESSAGE : Error creating a JMS message from the message context\n[2013-03-15 10:25:35,311] WARN - FaultHandler ERROR_DETAIL : org.apache.synapse.SynapseException: Error creating a JMS message from the message context\n at org.apache.synapse.core.axis2.AsyncCallback.onError(AsyncCallback.java:67)\n at org.apache.axis2.engine.AxisEngine$TransportNonBlockingInvocationWorker.run(AxisEngine.java:643)\n at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)\n at java.lang.Thread.run(Thread.java:662)\nCaused by: org.apache.axis2.AxisFault: Error creating a JMS message from the message context\n at org.apache.axis2.transport.base.AbstractTransportSender.handleException(AbstractTransportSender.java:226)\n at org.apache.axis2.transport.jms.JMSSender.sendOverJMS(JMSSender.java:174)\n at org.apache.axis2.transport.jms.JMSSender.sendMessage(JMSSender.java:154)\n at org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:112)\n at org.apache.axis2.engine.AxisEngine$TransportNonBlockingInvocationWorker.run(AxisEngine.java:626)\n ... 3 more\nCaused by: com.ibm.msg.client.jms.DetailedMessageFormatException: JMSCC0050: The property name 'JMS_DESTINATION' is reserved and cannot be set.\nThe supplied property name begins with the JMS prefix, but is not one of the supported, settable properties.\nCheck the property name and correct errors.\n at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\n at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)\n at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)\n at java.lang.reflect.Constructor.newInstance(Constructor.java:513)\n at com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:319)\n at com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:233)\n at com.ibm.msg.client.jms.internal.JmsErrorUtils.createException(JmsErrorUtils.java:109)\n at com.ibm.msg.client.jms.internal.JmsMessageImpl.checkSettablePropertyName(JmsMessageImpl.java:2125)\n at com.ibm.msg.client.jms.internal.JmsMessageImpl.setStringProperty(JmsMessageImpl.java:1560)\n at com.ibm.jms.JMSMessage.setStringProperty(JMSMessage.java:1496)\n at org.apache.axis2.transport.jms.JMSUtils.setTransportHeaders(JMSUtils.java:278)\n at org.apache.axis2.transport.jms.JMSSender.createJMSMessage(JMSSender.java:441)\n at org.apache.axis2.transport.jms.JMSSender.sendOverJMS(JMSSender.java:172)\n ... 6 more\n\n[2013-03-15 10:25:35,313] WARN - FaultHandler ERROR_EXCEPTION : org.apache.synapse.SynapseException: Error creating a JMS message from the message contextCheers\nSteve### Assistant: WebSphere MQ JMS library does not allow setting most of transport scope properties.Therefore you have to remove those before sending to JMS queue.We need to add following properties before .\n\n \n\n\n\n\n\n\n\nBut I guess you have already found the solution! :)\n"} +{"text": "### Human: I am using MQexplorer to handle queue manager, and when I connect to MQ using JMS with JNDI lookup, usingqcf.createQueueConnection();I am gettingJMSWMQ2013: The security authentication was not valid that was supplied for QueueManagererror. All posts/blogs mention about this error, but they say to remove CHAUTH for queuemanager and so on... How do I work this out using MQExplorer? Please help me on this!I am using MQ client(with JNDI on LDAP) connection which can connect remote machine(not bindings).### Assistant: Actually disabling CHLAUTH is NOT advised as doing so opens up your queue manager to the world. It's OK if this is a test queue manager. Using runmqsc you can disable channel authentication. In runmqsc issue \"ALTER QMGR CHLAUTH(DISABLED)\" command to disable channel authentication.Please read WMQ InfoCenter or Chapter 20 of thisredbookor just search for T.Rob's posts in this forum on CHLAUTH. Few linkshere, thisone\n"} +{"text": "### Human: I am trying to pick up a message off an ActiveMQ Queue and pass it to a Websphere MQ Queue.I'm using WSO2 as eventually we will want to use all the capabilities it gives us.The problem seems to be that WSO2 attempts to pass the ActiveMQ MessageId directly to Websphere MQ as the Correlation Id - which is in the wrong format.I have tried to remove the TRANSPORT_HEADERS but I must be doing something wrong.I added a dummy property JMS_CORRELATION_ID (as per thispost) to the inSequence to see if I could verify this but Websphere MQ does not recognise this header it seems.Happily enough passing a message from Websphere MQ to ActiveMQ works fine in another Proxy service I have created. In that case The Websphere MQ Message Id gets passed to the Active MQ correlation id.This is the exception[2013-03-08 12:18:23,414] ERROR - JMSSender Error creating a JMS message from the message context\ncom.ibm.msg.client.jms.DetailedJMSException: JMSCMQ1044: String is not a valid hexadecimal number - 'dolguldur-51590-1362693989456-3:4:1:1:4'.\nEither an attempt was made to specify a group ID or correlation ID which starts with the prefix ID but is not followed by a well-formed hexadecimal value, or an attempt was made to receive a message w\nhich contains an MQRFH2 property of type bin.hex that does not have a well-formed hexadecimal value.\nEnsure that a valid hexadecimal value always follows the ID prefix when setting group ID or correlation ID values. Ensure that any MQRFH2 headers generated by non-JMS applications are well-formed.\n at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\n at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)\n at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)\n at java.lang.reflect.Constructor.newInstance(Constructor.java:513)\n at com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:319)\n at com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:233)\n at com.ibm.msg.client.wmq.common.internal.WMQUtils.hexToBin(WMQUtils.java:414)\n at com.ibm.msg.client.wmq.common.internal.WMQUtils.stringToId(WMQUtils.java:496)\n at com.ibm.msg.client.wmq.common.internal.messages.WMQMessageHeader.setJMSCorrelationID(WMQMessageHeader.java:314)\n at com.ibm.msg.client.jms.internal.JmsMessageImpl.setJMSCorrelationID(JmsMessageImpl.java:610)\n at com.ibm.jms.JMSMessage.setJMSCorrelationID(JMSMessage.java:1133)\n at org.apache.axis2.transport.jms.JMSSender.createJMSMessage(JMSSender.java:428)\n at org.apache.axis2.transport.jms.JMSSender.sendOverJMS(JMSSender.java:172)\n at org.apache.axis2.transport.jms.JMSSender.sendMessage(JMSSender.java:154)\n at org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:112)\n at org.apache.axis2.engine.AxisEngine$TransportNonBlockingInvocationWorker.run(AxisEngine.java:626)\n at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)\n at java.lang.Thread.run(Thread.java:662)\n[2013-03-08 12:18:23,417] INFO - AxisEngine [MessageContext: logID=a7a3184cd19f3b5ab7a012af40cd7840329dd8fc40d0e9c3] Error creating a JMS message from the message contextWSO2 Proxy Service Configuration\n \n \n \n \n \n \n \n
\n \n \n activeMQQueueConnectionFactory\n TESTJMS.IN\n \naxis2.xml transport receiver\n \n org.apache.activemq.jndi.ActiveMQInitialContextFactory\n tcp://localhost:61616\n QueueConnectionFactory\n queue\n \n\n \n com.sun.jndi.fscontext.RefFSContextFactory\n file:/E:/work/MQ-JNDI-Directory\n ConnectionFactoryTest\n queue\n \n\n axis2.xml transport senderorg.apache.activemq.jndi.ActiveMQInitialContextFactory\n tcp://localhost:61616\n QueueConnectionFactory\n queue\n com.sun.jndi.fscontext.RefFSContextFactory\n file:/E:/work/MQ-JNDI-Directory\n ConnectionFactoryTest\n queue\nCheers,\nSteve11/3 More informationSo it looks like when I put a correlation ID such as a simple string in the ActiveMQ message I do not get the error 'JMSCMQ1044: String is not a valid hexadecimal number'.So the mapping from active MQ to Websphere MQ correlation Id is problematic.But this is the error I get now - looks like the class org.apache.axis2.transport.jms.JMSUtils is trying to set a JMS_DESTINATION header and Websphere MQ does not allow this?I've verified this by writing a simple java client and tried to set the header JMS_DESTINATION, I get the same error from Websphere MQ.Can I make Websphere MQ handle these headers? or get the JMSSender to post messages in a different way? or does the org.apache.axis2.transport.jms.JMSSender just not work with Websphere MQ at all?Incidentally I'm using the latest Websphere MQ 7.5.[2013-03-11 09:33:20,378] DEBUG - JMSMessageReceiver Received new JMS message for service :TestService\nDestination : queue://TESTJMS.IN\nMessage ID : ID:dolguldur-50398-1362951749472-3:2:1:1:24\nCorrelation ID : NONE\nReplyTo : null\nRedelivery ? : false\nPriority : 0\nExpiration : 0\nTimestamp : 1362958400374\nMessage Type :\nPersistent ? : false\n[2013-03-11 09:33:20,380] TRACE - JMSMessageReceiver\nMessage : Enter some text here for the message body...\n[2013-03-11 09:33:20,381] INFO - LogMediator To: , WSAction: urn:mediate, SOAPAction: urn:mediate, MessageID: ID:dolguldur-50398-1362951749472-3:2:1:1:24, Direction: request, Envelope: Enter some tex\nt here for the message body...\n[2013-03-11 09:33:20,388] DEBUG - JMSConnectionFactory Creating a new JMS Session from JMS CF : ibmMQQueueConnectionFactory\n[2013-03-11 09:33:20,392] DEBUG - JMSConnectionFactory Creating a new JMS MessageProducer from JMS CF : ibmMQQueueConnectionFactory\n[2013-03-11 09:33:20,393] ERROR - JMSSender Error creating a JMS message from the message context\ncom.ibm.msg.client.jms.DetailedMessageFormatException: JMSCC0050: The property name 'JMS_DESTINATION' is reserved and cannot be set.\nThe supplied property name begins with the JMS prefix, but is not one of the supported, settable properties.\nCheck the property name and correct errors.\n at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\n at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)\n at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)\n at java.lang.reflect.Constructor.newInstance(Constructor.java:513)\n at com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:319)\n at com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:233)\n at com.ibm.msg.client.jms.internal.JmsErrorUtils.createException(JmsErrorUtils.java:109)\n at com.ibm.msg.client.jms.internal.JmsMessageImpl.checkSettablePropertyName(JmsMessageImpl.java:2125)\n at com.ibm.msg.client.jms.internal.JmsMessageImpl.setStringProperty(JmsMessageImpl.java:1560)\n at com.ibm.jms.JMSMessage.setStringProperty(JMSMessage.java:1496)\n at org.apache.axis2.transport.jms.JMSUtils.setTransportHeaders(JMSUtils.java:278)\n at org.apache.axis2.transport.jms.JMSSender.createJMSMessage(JMSSender.java:441)\n at org.apache.axis2.transport.jms.JMSSender.sendOverJMS(JMSSender.java:172)\n at org.apache.axis2.transport.jms.JMSSender.sendMessage(JMSSender.java:154)\n at org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:112)\n at org.apache.axis2.engine.AxisEngine$TransportNonBlockingInvocationWorker.run(AxisEngine.java:626)\n at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)\n at java.lang.Thread.run(Thread.java:662)\n[2013-03-11 09:33:20,399] ERROR - AsyncCallback Error creating a JMS message from the message context\norg.apache.axis2.AxisFault: Error creating a JMS message from the message context\n at org.apache.axis2.transport.base.AbstractTransportSender.handleException(AbstractTransportSender.java:226)\n at org.apache.axis2.transport.jms.JMSSender.sendOverJMS(JMSSender.java:174)\n at org.apache.axis2.transport.jms.JMSSender.sendMessage(JMSSender.java:154)\n at org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:112)\n at org.apache.axis2.engine.AxisEngine$TransportNonBlockingInvocationWorker.run(AxisEngine.java:626)\n at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)\n at java.lang.Thread.run(Thread.java:662)\nCaused by: com.ibm.msg.client.jms.DetailedMessageFormatException: JMSCC0050: The property name 'JMS_DESTINATION' is reserved and cannot be set.\nThe supplied property name begins with the JMS prefix, but is not one of the supported, settable properties.\nCheck the property name and correct errors.\n at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\n at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)\n at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)\n at java.lang.reflect.Constructor.newInstance(Constructor.java:513)\n at com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:319)\n at com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:233)\n at com.ibm.msg.client.jms.internal.JmsErrorUtils.createException(JmsErrorUtils.java:109)\n at com.ibm.msg.client.jms.internal.JmsMessageImpl.checkSettablePropertyName(JmsMessageImpl.java:2125)\n at com.ibm.msg.client.jms.internal.JmsMessageImpl.setStringProperty(JmsMessageImpl.java:1560)\n at com.ibm.jms.JMSMessage.setStringProperty(JMSMessage.java:1496)\n at org.apache.axis2.transport.jms.JMSUtils.setTransportHeaders(JMSUtils.java:278)\n at org.apache.axis2.transport.jms.JMSSender.createJMSMessage(JMSSender.java:441)\n at org.apache.axis2.transport.jms.JMSSender.sendOverJMS(JMSSender.java:172)\n ... 6 more### Assistant: This is because WebSphere MQ honors the JMS specification which states that the message ID is always set by the transport provider. Please see theJMS 1.1 specification:3.4.3 JMSMessageIDThe JMSMessageID header field contains a value that uniquely identifies each\nmessage sent by a provider.When a message is sent, JMSMessageID is ignored. When the send method\nreturns, the field contains a provider-assigned value.This is confirmed in the WMQ Infocenter topicMapping JMS header fields at send() or publish()which says:All messages sent from JMS have unique message identifiers assigned by\n WebSphere\u00ae MQ. The value assigned is returned in the MQMD.MessageId\n field after the MQPUT call, and is passed back to the application in\n the JMSMessageID field. The WebSphere MQ messageId is a 24-byte binary\n value, whereas the JMSMessageID is a string. The JMSMessageID is\n composed of the binary messageId value converted to a sequence of 48\n hexadecimal characters, prefixed with the characters ID:. JMS provides\n a hint that can be set to disable the production of message\n identifiers. This hint is ignored, and a unique identifier is assigned\n in all cases. Any value that is set into the JMSMessageId field before\n a send() is overwritten.You can either cache the message IDs and correlate them as they pass through the broker, or else it could be done by dropping out of the JMS API and using the Java native API to send the message. Assuming that you are using a modern version of WebSphere MQ, the JMS message no longer requires RFH2 headers and instead carries JMS properties as native WMQ message properties. This means that JMS apps can read native WMQ messages as though they were JMS messages in most cases, assuming the app uses a modern QMgr and modern version of the JMS classes.The latest WMQ client and JMS classes are atSupportPac MQC75if you need to update.\n"} +{"text": "### Human: we have a situation where, we already have a working setup with a vendor that sends us messages over a remote queue. We have only one consumer today that consumes these messages from the queue.We would like to add another consumer on our side, to consume the same message. Our goal is to achieve this without impacting the vendor that is sending us the messages (or may be least possible impact.).In this situation,can you please help suggest how the new configuration (using distribution list on our side possibly) would look like. Can this be achieved without the vendor having to do any changes on their side.Current configuration is simple. The transmission Q has been setup on the vendor side (under their Q MGR) that sends it to the MCA sender - which in turn is received by the MCA receiver on our side that puts it in the final destination Q. This is where we are looking to make the change to be able to be received by second consumer.Update:Hi Rob, thanks for the answer. To be on the same page. Here is the current topology.Vendor Side Producer --> Proxy QA inside Q Mgr MAGR1 --> \nSender MCA (with a channel defined) --> (Over the Internet) --> (Receiver MCA) --> \nQA inside Q Mgr MAGR2 --> Consumer.You suggestion is we do this ..Vendor Side Producer --> Proxy QA inside Q Mgr MAGR1 -->\nSender MCA (with a channel defined) --> (Over the Internet) --> (Receiver MCA) --> \nNEW_TOPIC inside Q Mgr MAGR2 --> \nTwo subscribers before the Two queues QA.1 and QA.2 --> to two consumers.Can you please elaborate what is Sub1 and Sub2?Just trying to make sure that there is no code to be written on our side. Also no code changes on vendor side. Just that the channel on vendor side needs to be bounced. We are on the receiving side. Again appreciate your feedback. I am going to take this as a recommendation to the MQ team on Monday.Rob thanks a lot - really appreciate your help.\nOne last question. I can see that we are changing the original QA into a type topic now.\nDo you think there is no change to vendor code (whether MQ code / JMS code) to reflect that.### Assistant: This is fairly easy with WebSphere MQ although not as straightforward as defining a bridge.To illustrate, assume that the destination queue currently is QA such that...Producer --> QA --> Consumer1To do what you want, convert QA to an alias of the same name, pointing to a topic, then set up administrative subscriptions to two new endpoints:(Receiver MCA) --> QA --> TopicA --> Sub1 --> QA.1 --> Consumer1\n |\n +------> Sub2 --> QA.2 --> Consumer2You'll need to disconnect the apps that are locally attached to the queue, or shut down any RCVR/RQSTR/CLUSRCVR channel that may have it open. But once it's converted to a topic, you can add or remove subscriptions at will without disrupting anything.Response to updateBased on the response, this will be easy to do. No need to stop the channel on the vendor side, or even coordinate with the vendor. No need to write code on your side or change an app.runmqsc MAGR1\n\n\nSTOP CHL(RCVRMCA) \nDEFINE QL(QA1)\nDEFINE QL(QA2)\nDELETE QL(QA)\nDEFINE QALIAS(QA) TARGTYPE(TOPIC) TARGET(QA.TOPIC)\nDEF TOPIC(QA.TOPIC) TOPICSTR(QA)\nDEFINE SUB(QA1) TOPICSTR(QA) DEST(QA1)\nDEFINE SUB(QA2) TOPICSTR(QA) DEST(QA2)\nSTART CHL(RCVRMCA) \nEND\n\nC:\\>AMQSPUT QA JMSDEMO\nSample AMQSPUT0 start target queue is QA\nHello world!\n\nSample AMQSPUT0 end\n\nC:\\>AMQSGET QA1 JMSDEMO\nSample AMQSGET0 start\nmessage \nno more messages\nSample AMQSGET0 end\n\nC:\\>AMQSGET QA2 JMSDEMO\nSample AMQSGET0 start \nmessage \nno more messages\nSample AMQSGET0 end\n\nC:\\Setting up the security is a bit more advanced than defining subs and topics so I'm guessing that your queue manager may need to be locked down. Please seeSecure Messaging Scenarios With WebSphere MQ, and in particular the chapters on hardening your queue manager to protect administrative access and for B2B use. Note that if the QMgr is not locked down, it is possible for anyone who has a TCP route to it to anonymously administer it and to remotely execute code on the underlying server.\n"} +{"text": "### Human: I have an existing XMS .Net client application and I am trying to add the Automatic client reconnect feature to it. This is to fix the application disconnect issue from queue manager often and require application services recycle to restore connection with queue manager.\nThe client version is \nVersion: 7.0.1.1\nThe XMS Client Product version is\n1.2.7.0But I found the XMS .Net client version 1.2.7 does not support the property XMSC_WMQ_CLIENT_RECONNECT_OPTIONS.\nError getting \n'IBM.XMS.XMSC' does not contain a definition for\n 'WMQ_CLIENT_RECONNECT_OPTIONS'To overcome this I believe the XMS client has to be at least v2.1.0.\nAnd for making use of XMS client version 2.1.0 I have to update the MQ client itself to v7.1 but I will be still connecting with MQ v7.0.1 Queue Manager. Will there be any issues connecting to a lower version queue manager from a higher version client or I need to upgrade queue manager to version 7.1 to make use of automatic client reconnect feature in XMS client?Is there any other better solutions for this issue?Please find the code changespublic class MQConnectionFactory\n{\n private static IConnectionFactory cf = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ).CreateConnectionFactory();\n\n public string WMQ_HOST_NAME { set { cf.SetStringProperty(XMSC.WMQ_HOST_NAME, value); } }\n public int WMQ_PORT { set { cf.SetIntProperty(XMSC.WMQ_PORT, value); } }\n public string WMQ_QUEUE_MANAGER { set { cf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, value); } }\n public string WMQ_CHANNEL { set { cf.SetStringProperty(XMSC.WMQ_CHANNEL, value); } }\n\n//Adding Client Reconnecting Parameters\n public int WMQ_CLIENT_RECONNECT { set { cf.SetIntProperty(XMSC.WMQ_CLIENT_RECONNECT_OPTIONS, XMSC.WMQ_CLIENT_RECONNECT);} }\n public int WMQ_CLIENT_RECONNECT_TIMEOUT { set { cf.SetIntProperty(XMSC.WMQ_CLIENT_RECONNECT_TIMEOUT, 150);} }\n\n public int WMQ_CONNECTION_MODE\n {\n set\n {\n if (value < 0)\n value = XMSC.WMQ_CM_CLIENT_UNMANAGED;\n cf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, value);\n //set to non RFH header\n //cf.SetIntProperty(XMSC.WMQ_TARGET_CLIENT, XMSC.WMQ_TARGET_DEST_MQ);\n }\n }\n\n public IConnection CreateConnection()\n {\n //try\n //{\n return cf.CreateConnection();\n //}\n //catch (Exception e)\n //{\n // Console.WriteLine(e);\n // return null;\n //}\n\n }\n}### Assistant: Yes, you will need to upgrade the MQ client to v7.1. And this level of MQ client will work with MQ v701 queue manager.\n"} +{"text": "### Human: I'm trying to connect to a channel for pub/sub by topic. I'm running in unmanaged mode because that's the only mode that supports SSL. I've specified theCIPHER SPECandKEY_REPOwhere the key iskey.kdbin the same directory as the application (I've also tried the full path to the key store but that doesn't work either). There is an associatedkey.sthin there contaning the password (encrypted) for using the certificate. Below is the code snippet, less connection strings and other sensitive info.XMSFactoryFactory factoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\nIConnectionFactory connectionFactory = factoryFactory.CreateConnectionFactory();\n\nconnectionFactory.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT_UNMANAGED);\n\nconnectionFactory.SetStringProperty(XMSC.WMQ_HOST_NAME, \"hostName\");\nconnectionFactory.SetIntProperty(XMSC.WMQ_PORT, 1234);\nconnectionFactory.SetStringProperty(XMSC.WMQ_CHANNEL, \"Channel\");\nconnectionFactory.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, \"QueueManager\");\n\nconnectionFactory.SetStringProperty(XMSC.WMQ_SSL_CIPHER_SPEC, \"NULL_SHA\");\nconnectionFactory.SetStringProperty(XMSC.WMQ_SSL_KEY_REPOSITORY, @\"key\");\n\nconnection = connectionFactory.CreateConnection();I get the following exception in Visual Studio, which just tells me that the MQ Client has thrown an error.CWSMQ0006E: An exception was received during the call to the method \nConnectionFactory.CreateConnection: CompCode: 2, Reason: 2393. During \nexecution of the specified method an exception was thrown by another \ncomponent. See the linked exception for more information.I can see the specific error thrown by the MQ Client through the event log, below.No SSL certificate for channel 'SECUREQUEUE.SVRCONN'. \n\nThe channel 'SECUREQUEUE.SVRCONN' did not supply a certificate to use during \nSSL handshaking, but a certificate is required by the remote queue manager. \nThe channel did not start. \n\nEnsure that the key repository of the local queue manager or MQ client contains an \nSSL certificate which is associated with the queue manager or client. Alternatively,\nif appropriate, change the remote channel definition so that its SSLCAUTH attribute \nis set to OPTIONAL and it has no SSLPEER value set. &P If you have migrated from \nWebSphere MQ V5.3 to V6, it is possible that the missing certificate is due to a \nfailure during SSL key repository migration. Check the relevant error logs. If \nthese show that an orphan certificate was encountered then you should obtain the \nrelevant missing certification authority (signer) certificates and then import \nthese and the orphan certificate into the WebSphere MQ V6 key repository, and then\nre-start the channel.I can't seem to figure out what's wrong with this set up.. Any ideas?### Assistant: The error would seem to indicate that the QMgr's certificate was validated by the client. That means it's found the KDB and STH files. Now it's trying to validate the client-side certificate. That probably means that...a) It can't find the client certificate, probably because of the labelb) the QMgr doesn't have the client's public key (self-signed) or CA rootI usually validate the TLS channel testing by following the procedure outlined inthis other SO answer.If you successfully test withSSLCAUTH(OPTIONAL)then it would tend to confirm my guess. If that doesn't work then you'll need to provide details about whether you used self-signed certs, what's in the QMgr's KDB, whether you runREFRESH SECURITY TYPE(SSL)on the QMgr after updating its keystore, and the cert label name in the client's keystore.\n"} +{"text": "### Human: I am trying to create a communications class which will send request to MQ and get response from them.Following is the code I have written.TextMessage inputMsg = session.createTextMessage(message);\n inputMsg.setJMSReplyTo(responseQueue);\n try {\n\n connection.start();\n sender.send(inputMsg);\n messageId = inputMsg.getJMSMessageID();\n reciever = session.createConsumer(responseQueue,\"JMSMessageID = '\"+messageId+\"'\");\n Message mess=reciever.receive(10000);\n TextMessage outputMsg = (TextMessage) mess;\n\n if(outputMsg == null)\n logger.error(\" Error while recieving the message\");\n else\n replyMsg= outputMsg.getText();This code is giving me the following object wait whenever the code is executed.java.lang.Object.wait(Native Method)\nat java.lang.Object.wait(Object.java:167)\nat com.ibm.mq.jmqi.remote.internal.system.RemoteProxyQueue.proxyMQGET(RemoteProxyQueue.java:2667)\nat com.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiGetMessageWithRecon(RemoteFAP.java:6219)\nat com.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiGetMessage(RemoteFAP.java:6112)\nat com.ibm.mq.jmqi.internal.JmqiTools.getMessage(JmqiTools.java:1090)\nat com.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiGet(RemoteFAP.java:6080)\nat com.ibm.msg.client.wmq.internal.WMQConsumerShadow.getMsg(WMQConsumerShadow.java:1305)\nat com.ibm.msg.client.wmq.internal.WMQSyncConsumerShadow.receiveInternal(WMQSyncConsumerShadow.java:239)\nat com.ibm.msg.client.wmq.internal.WMQConsumerShadow.receive(WMQConsumerShadow.java:1058)\nat com.ibm.msg.client.wmq.internal.WMQMessageConsumer.receive(WMQMessageConsumer.java:469)\nat com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl.receiveInboundMessage(JmsMessageConsumerImpl.java:879)\nat com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl.receive(JmsMessageConsumerImpl.java:431)\nat com.ibm.mq.jms.MQMessageConsumer.receive(MQMessageConsumer.java:228)But if I change the createConsumer line to,reciever = session.createConsumer(responseQueue,\"JMSMessageID = '\"+messageId+\"'\");Problem with the above line is my response messages are getting mixed up during more concurrent requests which lead to session mix up.Can someone please guide me on how I can resolve this problem?Thanks in advance.### Assistant: There is a small problem with your code. In yourcreateConsumercallJMSMessageIDis being used as selector. ThisJMSMessageIDis actually the message id of the that you want to receive. It's not the message id of the request message sent earlier in your code.You should use theJMSCorrelIdinstead ofJMSMessageIDin yourcreateConsumercall.reciever = session.createConsumer(responseQueue,\"JMSCorrelId = '\"+messageId+\"'\");And then your server application that is processing request messages must takeJMSMessageIDfrom the request message and put into theJMSCorrelIdfield and send the response. This way using theJMSCorrelIdrequest and response messages are correlated.\n"} +{"text": "### Human: I have a message flow exposed as a Web Service. In that flow we are invoking another web service. Flow is mostly generated by dragging a wsdl from a message set to the designer of IBM Websphere Message Broker Tool Kit.\nHere is my Flow:SoapInput-->SubFlow to Expose Service-->Subflow to invoke Service-->SoapReplySubFlow to Expose Serviceis generated by dragging the WSDL and selecting \"Expose as a service\".Subflow to invoke Serviceis generated by dragging the WSDL and selecting \"Invoke as a service\".Getting invalid param error from service end. I have not received the same error with all services i tried to invoke. This happens only with one service.\nAm I doing anything wrong with flow?### Assistant: I was having issues when invoking WebServices (outside Broker) from a message flow, where the cause was a missing Namespace declaration. Try to addTracenodesin your flow to get better error diagnose.\n"} +{"text": "### Human: We are in the process of upgrading IBM Websphere MQ Series from V6.x to V7.x.Currently our BizTalk application servers are integrated to IBM Websphere MQSeries server to read messages from remote queue through BizTalk 2009 MQSeries adapter.We would like to know whether our current BizTalk 2009 MQSeries adapter needs any updates to connect to new 7.x version of IBM Websphere MQ Series server.Below are our BizTalk and IBM MQ series Server configurationsBizTalk 2009 (Windows 2003 64 bit) with MQ Series Adapter.IBM Websphere MQSeries Server (V6.0.2.7 with Windows 2003 32 bit)### Assistant: In the Infocenter for each of the releases, there is a section on version-to-version changes. There are several related to Windows. Please see the Infocenter for the appropriate version:V6.0 to V7.5 ChangesV6.0 to V7.1 ChangesThere is a V7.0 Infocenter but at this point, everyone should be migrating to V7.5 preferably, or V7.1 at the earliest, due to the security enhancements and other features.\n"} +{"text": "### Human: Using WMQ7.0 with WMB 6.1I have one flow where I am transforming a message and usingMQRFH2.usrfor holding some data.But, I am facing the issue where theMQRFH2.usris coming in the main message body.I have deployed the same code in different environments, but I am getting this issue only in one environment.So, itdoesn't seems to be a code issue. It has something to do withconfigurations.Kindly, suggest what could be the possible cause.### Assistant: Check the queue'sPROPCTLsetting. If this is set toNONEthen the behavior is as follows:If the application does not create a message handle, all the message\n properties are removed from the MQRFH2. Name/value pairs in the MQRFH2\n headers are left in the message.Be sure to read thedoc pagethrough a couple of times and maybe test with different settings to understand fully howPROPCTLmodifies the message content your app receives.\n"} +{"text": "### Human: I want to know if it is possible to connect to a IBM MQ 5.2 queue using a remote queue in IBM MQ 7. \nI want to achieve this since I have to connect to two different queue managers in different machines in the same application. I read about using CCDT file as well. But I don't have access to those files as well. Therefore I need to know above mentioned operation is possible or not.### Assistant: Yes, any version of WMQ QMgr can talk to any other version of WMQ QMgr. However, V5.2 has been out of support on most platforms for about a decade. That means V7.1 was never tested against it and there is no official support for this configuration.That said, there is nothing preventing you from using the CCDT files. If you downloadSupportPac MO72, that tool is capable of defining CCDT files at different versions. I don't know if it goes as far back as V5.2, however if not you can try the oldest version it can define and specify the bare minimum of channel features - QMgr, IP address, port, channel name.Incidentally, there is no need to worry about using SSL channels for a connection to a V5.2 QMgr because it never received patches for security vulnerabilities discovered since it went out of support. Among these were vulnerabilities to the SSL protocol itself, as well as MD5 and SHA-1, all of which are fixed in any current version of WMQ. If you take SSL out of the picture, connecting to a v5.2 QMgr is like connecting to any other QMgr. Set theMQSERVERenvironment variable and make a connection. Your client app should handle it fine without a CCDT.\n"} +{"text": "### Human: I am installing MQSeries-1.33 Perl module through CPAN shell but it's failing. I am using windows 7 and Strawberry perl v5.16.2.I also have IBM Websphere MQ v7.5 installed with me.The module is failing while make.\nBelow is the error.Cannot add determine value for 'MQENC_TNS', unknown constant 'MQENC_INTEGER_NORMAL '\nCannot add determine value for 'MQGMO_BROWSE_HANDLE', unknown constant 'MQGMO_MARK_BROWSE_HANDLE '\nCannot add determine value for 'MQENC_NORMAL', unknown constant 'MQENC_INTEGER_NORMAL '\nCannot add determine value for 'MQENC_S390', unknown constant 'MQENC_INTEGER_NORMAL '\nCannot add determine value for 'MQENC_REVERSED', unknown constant 'MQENC_INTEGER_REVERSED '\nCannot add determine value for 'MQGMO_BROWSE_CO_OP', unknown constant 'MQGMO_MARK_BROWSE_CO_OP '\ntypemap.PL: warning: type MQIEP.MQHMSG (MQINT64) not supported\nC:\\strawberry\\perl\\bin\\perl.exe C:\\strawberry\\perl\\lib\\ExtUtils\\xsubpp -typemap C:\\strawberry\\perl\\lib\\ExtUtils\\typemap -typemap typemap MQSeries.xs > MQSeries.xsc && C:\\strawberry\\perl\\bin\\perl.exe\n -MExtUtils::Command -e mv -- MQSeries.xsc MQSeries.c\ngcc -c -I\"C:/Mqm/Tools/C/include\" -I../include -s -O2 -DWIN32 -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -mms-bitfields -s -O2 -DVERSION=\\\"1.\n33\\\" -DXS_VERSION=\\\"1.33\\\" \"-IC:\\strawberry\\perl\\lib\\CORE\" MQSeries.c\nIn file included from MQSeries.xs:66:0:\nC:/Mqm/Tools/C/include/cmqc.h:3584:2: error: unknown type name 'int64'\nC:/Mqm/Tools/C/include/cmqc.h:3585:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'MQUINT64'\nC:/Mqm/Tools/C/include/cmqc.h:3610:2: error: unknown type name 'MQUINT64'\ndmake: Error code 129, while making 'MQSeries.o'\ndmake.exe: Error code 255, while making 'subdirs'\n MQSERIES/MQSeries-1.33.tar.gz\n C:\\strawberry\\c\\bin\\dmake.exe -- NOT OK\nRunning make test\n Can't test without successful make\nRunning make install\n Make had returned bad status, install seems impossible\nStopping: 'install' failed for 'MQSeries'.\nFailed during this command:\n MQSERIES/MQSeries-1.33.tar.gz : make NO### Assistant: First off, why don't you download and use the prebuilt MQSeries v1.33 Perl binaries for Windows?gcc -c -I\"C:/Mqm/Tools/C/include\" -I../includeIBM does not support GCC on Windows (32-bit nor 64-bit). You need to use a supported compiler i.e. MS Visual C++.C:/Mqm/Tools/C/include/cmqc.h:3584:2: error: unknown type name 'int64'An unsupported work around is to add the following define at the very top of your code:#define _int64 __int64This will get you by the compile errors but remember, it is not supported by IBM.\n"} +{"text": "### Human: I have a Topic that has two subscribers. However, one of the subscribers will be deployed in a cluster. So, in effect (I think?) the cluster will be seen as multiple subscribers.\nI need to make sure only one message is consumed by the cluster.I do not know the options to do this.\nIs it possible to insert a queue in between the cluster and the topic, and then have the clustered application only work with the inserted queue?If this is possible, how, in general, to make the queue \"subscribe\" to the Topic?Another idea I heard is to make cloned subscribers in the cluster, anyone hear of this before to solve this issue?Another idea is to do away with the Topic and just use two queues in its place, this seems to be a safe solution?Using WebSphere MQ### Assistant: You can use a durable subscription to achieve this.Administratively create a durable subscription and specify a destination, basically a queue, which will receive the publications that are published on the specified topic. Your clustered application can then get messages from that destination. Since the publications are being received from a queue, only one instance of your application will get message(s).The command below creates durable subscription for topic \"/SPORTS/HOCKEY\" with destination queue as Q1.DEFINE SUB(SPORTSUB) TOPICSTR(/SPORTS/HOCKEY) TOPICOBJ(SPORT) DESTQ(Q1)\n"} +{"text": "### Human: I'm facing problem in transaction rollback(unable to push the back the message to original queue).MDB(Container managed TX) deployed in WAS v7 which is listening to remote queue configured in WebSphere MQ v7.When I'm marking the MessageDrivenContext.setRollbackOnly() i can see the below details in the ffdc WAS logscom.ibm.websphere.csi.CSITransactionRolledbackException: Transaction marked rollbackonly\n at com.ibm.ejs.csi.TranStrategy.postInvoke(TranStrategy.java:222)\n at com.ibm.ejs.csi.TransactionControlImpl.postInvoke(TransactionControlImpl.java:561)\n at com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:4512)\n at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:107)\n at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:132)\n at com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java:496)\n at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)it looks like transaction is getting rolled back successfully but i'm unable to see the same message in the Queue.(Queue is empty/message is deleted).Can some one tell how do i retain the message in the Queue and process it again ???### Assistant: I found out that message which are rolled back are placed in SYSTEM.DEAD.LETTER.QUEUE.I check the following properties of websphere mq queue manager1) BOTHRESH(5)2) BOQNAME(ERROR QUEUE NAME).even before backout count could reach max BOTHRESH the messaged are placed in default queue instead of configured error queue.Can some one tell whats wrong in the configuration?\n"} +{"text": "### Human: I found in certain codes that given to me is message.getStringProperty(MESSAGE_TYPE)but my question is where the property is set in rfhUtil toolplease guide me..thanks in advance### Assistant: You can set message type using MsgType combo box on MQMD tab of RFHUTIL.\n"} +{"text": "### Human: I need to connect to a remote queue in my application,but when security enabled in MQ farm it hits Authentication Error (RC 2035),i have been informed that when i use spring configuration its trying to access some default queue which it shouldn't ,i came across setDirectAuth property,would it solve this issue?please advise if i miss out any property that causes the error?Error:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connectionFactory' defined in class path resource [META-INF/spring.xml]: Invocation of init method failed; nested exception is javax.naming.ServiceUnavailableException: Unable to connect to the target queue manager XXXX.XXX.XXX.com:1415/xxx.SVRCONN [Root exception is com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2035'.]\norg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connectionFactory' defined in class path resource [META-INF/spring.xml]: Invocation of init method failed; nested exception is javax.naming.ServiceUnavailableException: Unable to connect to the target queue manager xxxx.xxx.xxx.com:1415/xxx.SVRCONN [Root exception is com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2035'.]\n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)\n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)\n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)\n at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)\n at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)\n at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)\n at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)\n at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567)\n at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)\n at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)\n at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)\n at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:83)Context.xml \n\n \n\nproperty file:#JMS Provider\njms.factory.initial=com.ibm.mq.jms.context.WMQInitialContextFactory\njms.provider.url=xx.xxx.xxx.com:1415/xxx.CHANNEL\ndestination.factory=java:/comp/env/jms/MQConnectionFactory\nbm.queue=java:/comp/env/jms/QueueBM\nsu.queue=java:/comp/env/jms/QueueSUSpring.xml \n \n \n \n \n \n ${jms.factory.initial}\n ${jms.provider.url}\n \n \n \n \n \n \n \n \n ${destination.factory}\n \n \n \n \n \n \n \n ${bm.queue}\n \n \n \n \n \n \n \n ${su.queue}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ### Assistant: When your app opens a local queue, the authorization profiles match the name of the queue that was opened. In other words, if the app connected toLOCALQMGRopensSYSTEM.DEF.LOCAL.QUEUE@LOCALQMGRthe authorization control list entry onLOCALQMGRmust grant the app access toSYSTEM.DEF.LOCAL.QUEUE.However, when the app opensSOME.QUEUE@REMOTEQMGRthe QMgr resolvesREMOTEQMGRand finds a transmission queue leading to that QMgr. The queue it opens in this case is the transmission queue therefore it looks for an authorization profile that matches the transmission queue. Authorizing an app to the XMitQ can be OK but it allows the app to address messages toanyqueue on that QMgr including, for example, the command queue.Many times, administrators do not wish to grant access to transmission queues directly because it allows access to any queue on that QMgr and they'd rather restrict that. So in a point-to-point interface, it is common to set up a QRemote locally and authorize the app to that. In a cluster, it is common to set up a local QAlias over a clustered queue and attach the authorization profile to that.The only thing that will affect this is the user ID the app uses for the connection request. If the QMgr is secure, there is NOTHING the app can do to affect this connection ID. The MQ admin will have either set the ID in the channel definition or mapped it from the IP address or the SSL certificate distinguished name. If for some reason the QMgr is not secure, the app can specify the ID to use on the connection as part of the API call:connection = ConnectionFactory.createConnection(userID, password);If the MQ admin has not set or mappedMCAUSERon the channel, the QMgr will accept the ID you provide and the password is not checked. If the MQ admin configures a channel exit, the exit can validate the password against LDDAP, AD, local OS, etc. But if not exit is installed, the password is not checked.Now that you know this, you may be able to answer your question about the effect ofsetDirectAuth(because I can't). If that parameter is inherited by the connection factory and is asserted by the channel request it would be passed to MQ and, if the channel isn't secure, would be accepted. Similarly, if you used the Connection object constructor that takes ID and password, you can DEFINITELY assert an ID which, if the channel is not secure, will be accepted by the QMgr.You can test this using the following:connection = ConnectionFactory.createConnection('mqm', 'doesntmatter');If the QMgr is on UNIX/Linux and not secure, the app will run asmqm. I would not suggest running like this, the correct response would be to secure it. But this is one way to test and see whether it is secure or not.\n"} +{"text": "### Human: is it possible to establish bi-directional replication on webspehre mq queues so it would work like the db clusters where data is replicated to all of the member instances\nimagine following scenario:queue managersQM1 \nDESTINATION.QUEUE \nRESPONSE.QUEUE \n\nQM2 \nDESTINATION.QUEUE \nRESPONSE.QUEUEapplicationsapplication A issues **put** on DESTINATION.QUEUE@QM1 \n\napplication B issues **get** on DESTINATION.QUEUE@QM2\n\napplication B sends response **put** RESPONSE.QUEUE@QM2\n\napplication A gets response **get** RESPONSE.QUEUE@QM1I am not asking about transmission queues but rather about bi-directional replication where all of the queues are local but constantly updated like db clusters I have mentioned above.### Assistant: WMQ does no provide this level of replication. There are implementations where replication is performed to a secondary site for disaster recovery but these are not bi-directional. The primary and secondary sites cannot both be active at the same time.It is possible for an application to publish across multiple QMgrs and to subscribe on any QMgr to receive that publication. The reply is either addressed directly to the requestor or is published on a topic where the requestor is subscribed.\n"} +{"text": "### Human: We are trying to write a message to a broker queue. But the whole request fails when it tries to commit the JMS transaction & then it tries to rollback each subsequent time. We use oracle XA drivers. Not sure where to post this issue: MQ forums or Oracle forum. So thought would give a try here. Can someone help resolve this please.Error:[9/25/12 17:10:06:871 EDT] 0000003e XATransaction E J2CA0027E: An exception occurred while invoking commit on an XA Resource Adapter from dataSource JMS$QCF$JMSManagedConnection@23, within transaction ID {XidImpl: formatId(57415344), gtrid_length(36), bqual_length(54), data(00000139ff43ef2500000001000043106c82332ef6bc723402e84f341fb357080ddd4d1b00000139ff43ef2500000001000043106c82332ef6bc723402e84f341fb357080ddd4d1b000000010000000000000000000000000001)}: javax.transaction.xa.XAException: The method 'xa_commit' has failed with errorCode '-7'.\n at com.ibm.mq.jmqi.JmqiXAResource.commit(JmqiXAResource.java:407)\n at com.ibm.ejs.jms.JMSManagedSession$JMSXAResource.commit(JMSManagedSession.java:1702)\n at com.ibm.ejs.j2c.XATransactionWrapper.commit(XATransactionWrapper.java:463)\n at com.ibm.ws.Transaction.JTA.JTAXAResourceImpl.commit_one_phase(JTAXAResourceImpl.java:305)\n at com.ibm.ws.Transaction.JTA.RegisteredResources.flowCommitOnePhase(RegisteredResources.java:2916)\n at com.ibm.ws.Transaction.JTA.TransactionImpl.commitXAResources(TransactionImpl.java:2533)\n at com.ibm.ws.Transaction.JTA.TransactionImpl.stage1CommitProcessing(TransactionImpl.java:1687)\n at com.ibm.ws.Transaction.JTA.TransactionImpl.processCommit(TransactionImpl.java:1647)\n at com.ibm.ws.Transaction.JTA.TransactionImpl.commit(TransactionImpl.java:1582)\n at com.ibm.ws.Transaction.JTA.TranManagerImpl.commit(TranManagerImpl.java:247)\n at com.ibm.ws.Transaction.JTA.TranManagerSet.commit(TranManagerSet.java:168)\n at com.ibm.ws.Transaction.JTA.UserTransactionImpl.commit(UserTransactionImpl.java:293)\n at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1009)\n at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)\n at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)\n at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:255)\n at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1002)\n at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:901)\n at org.springframework.scheduling.commonj.DelegatingWork.run(DelegatingWork.java:61)\n at com.ibm.ws.asynchbeans.J2EEContext$RunProxy.run(J2EEContext.java:264)\n at java.security.AccessController.doPrivileged(Native Method)\n at com.ibm.ws.asynchbeans.J2EEContext.run(J2EEContext.java:1137)\n at com.ibm.ws.asynchbeans.WorkWithExecutionContextImpl.go(WorkWithExecutionContextImpl.java:195)\n at com.ibm.ws.asynchbeans.CJWorkItemImpl.run(CJWorkItemImpl.java:187)\n at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1560)\n.\n[9/25/12 17:10:06:880 EDT] 0000003e RegisteredRes W WTRN0052E: An attempt by the transaction manager to call one phase commit on a transactional resource has resulted in an XAER_RMFAIL error. The resource was com.ibm.ws.Transaction.JTA.JTAXAResourceImpl@1d07bf1#{XidImpl: formatId(57415344), gtrid_length(36), bqual_length(54), data(00000139ff43ef2500000001000043106c82332ef6bc723402e84f341fb357080ddd4d1b00000139ff43ef2500000001000043106c82332ef6bc723402e84f341fb357080ddd4d1b000000010000000000000000000000000001)}\n[9/25/12 17:10:06:887 EDT] 0000003e DefaultMessag W org.springframework.jms.listener.DefaultMessageListenerContainer handleListenerSetupFailure Setup of JMS message listener invoker failed for destination 'queue:///RANDOM QUEUE?targetClient=1' - trying to recover. Cause: Heuristic completion: outcome state is mixed; nested exception is javax.transaction.HeuristicMixedException### Assistant: Here's the cause and resolutionQuote-The cause of these errors is usually the result of a WebSphere MQ\n messaging provider JMS Connection being closed off by WebSphere\n Application Server because the Aged timeout for the Connection has\n expired.Resolution-To resolve this issue, ensure that the JMS Connection Factory being\n used by the application has the Connection Pool propertyAged timeoutset to zero. This will prevent JMS Connections being closed when they\n are returned to the Free Pool, and so ensures that any outstanding\n transactional work can be completedIt is sometimes also caused by the faulty DataDirect Driver and is reported and fixed by IBM, seethis.\n"} +{"text": "### Human: We upgraded MQ to V7 from V6. after the we are facing this error on executing mq commands.retrieving local queue manager\nCould not load program dspmq:\n Dependent module /usr/lib/libmqmcs_r.a(shr.o) could not be loaded.\n The module has an invalid magic number.Referring to IBM site,http://www-01.ibm.com/support/docview.wss?uid=swg21233269By no where i specify LIBPATH to /usr/mqm/lib in my AIX machine. But on setting the LIBPATH to \"\" this issue is resolved.Could you help me to understand how LIBPATH is set for using MQ Libraries ? Will it be set during installation?### Assistant: You have not mentioned what release of MQ v7 you migrated to. MQ v7.1 installation does not create any symbolic links under /usr directory. This is because from v7.1, MQ started supporting multi version installations. One has to use SETMQENV command setup MQ environment.Please follow thislink.Edit: My suspicion is that LIBPATH might have been pointing to some incorrect mq libraries.\n"} +{"text": "### Human: i've got a question with channel propertyHeartbeat Interval(HBINT). According to the information center, it would lead channel disconnect when interval condition matures and MCA is unblocked. I made a little test in local QMGR, but i found that channel (sender-receiver) didn't change toinactiveas expected. So what's the problem here? please help me out.\n channel definition detail is as below:CHANNEL(EDISONQM.GRACEQM.C1) CHLTYPE(SDR)\n ALTDATE(2012-09-09) ALTTIME(11.50.52)\n BATCHHB(0) BATCHINT(0)\n BATCHLIM(5000) BATCHSZ(50)\n COMPHDR(NONE) COMPMSG(NONE)\n CONNAME(localhost(1414)) CONVERT(NO)\n DESCR( ) DISCINT(300)\n HBINT(30) KAINT(AUTO)\n LOCLADDR( ) LONGRTY(999999999)\n LONGTMR(1200) MAXMSGL(4194304)\n MCANAME( ) MCATYPE(PROCESS)\n MCAUSER( ) MODENAME( )\n MONCHL(QMGR) MSGDATA( )\n MSGEXIT( ) NPMSPEED(FAST)\n PASSWORD( ) PROPCTL(COMPAT)\n RCVDATA( ) RCVEXIT( )\n RESETSEQ(NO) SCYDATA( )\n SCYEXIT( ) SENDDATA( )\n SENDEXIT( ) SEQWRAP(999999999)\n SHORTRTY(10) SHORTTMR(60)\n SSLCIPH( ) SSLPEER( )\n STATCHL(QMGR) TPNAME( )\n TRPTYPE(TCP) USEDLQ(YES)\n USERID( ) XMITQ(EDISONQM.GRACEQM.X1)\n\n CHANNEL(EDISONQM.GRACEQM.C1) CHLTYPE(RCVR)\n ALTDATE(2012-09-09) ALTTIME(11.51.42)\n BATCHSZ(50) COMPHDR(NONE)\n COMPMSG(NONE) DESCR( )\n HBINT(30) KAINT(AUTO)\n MAXMSGL(4194304) MCAUSER( )\n MONCHL(QMGR) MRDATA( )\n MREXIT( ) MRRTY(10)\n MRTMR(1000) MSGDATA( )\n MSGEXIT( ) NPMSPEED(FAST)\n PUTAUT(DEF) RCVDATA( )\n RCVEXIT( ) RESETSEQ(NO)\n SCYDATA( ) SCYEXIT( )\n SENDDATA( ) SENDEXIT( )\n SEQWRAP(999999999) SSLCAUTH(REQUIRED)\n SSLCIPH( ) SSLPEER( )\n STATCHL(QMGR) TRPTYPE(TCP)\n USEDLQ(YES)\n\n\n C:\\windows\\system32>dspmqver\n Name: WebSphere MQ\n Version: 7.1.0.1\n Level: p710-001-120524\n BuildType: IKAP - (Production)\n Platform: WebSphere MQ for Windows\n Mode: 32-bit\n O/S: Windows 7 Home Premium x64 Edition, Build 7600\n InstName: Installation1Thanks### Assistant: You may wish to have a look at the Infocenter topicChecking that the other end of the channel is still availablewhich goes into a little more detail about the algorithm that decides whether to close the channel. Specifically, at least two heartbeats must flow before the channel will disconnect so HBINT must be well less than half of DISCINT for this to take effect. Also, the channel negotiation must complete such that neither MCA derives a value of zero for HBINT.Your post did not include a listing of the matching RCVR channel. I suspect that you did not update the HBINT there? If you display the status of the running channel you will see that on startup the channel agents negotiate thelargerof their two HBINT values. So if you didn't update HBINT at the the RCVR then the running channel will have an HBINT of 300 even though you set it to 30 on the SDR.Also, the actual timing is not exact. The intent is that the channel will time out innot less thantwo HBINT intervals but the actual timeout will be more than this amount. For example I set HBINT to 10 and saw the channel disconnect after about 40 seconds. Channel timeout and disconnect are intended to improve reliability of the channels and to reap orphan channels but exact timing is not as important as it would be for message or transaction processing. The idea is that if you have tons of orphan channels you would address this by fixing the broken program or by tuning timeout at a firewall rather than setting HBINT to a really low value and expecting precision. If you have a need for exact timings on channel disconnect then there's a root cause somewhere else that needs to be addressed.\n"} +{"text": "### Human: i've got a problem with processamqrmppashowingdefunctstatus, please see detail as below:mqm 2055 2912 0 Sep01 ? 00:00:31 [amqrmppa] \nmqm 2524 2912 0 Sep02 ? 00:00:23 [amqrmppa] \nmqm 2570 2912 0 Sep03 ? 00:00:21 [amqrmppa] \nmqm 4754 2912 0 Sep03 ? 00:00:19 [amqrmppa] \nmqm 5628 2912 0 Sep02 ? 00:00:23 [amqrmppa] i checked the error log file but got nothing clue there. can you help me figure it out? how to handle this?ThanksWebSphere MQ for Linux (x86-64 platform) \n 7.0.1.5 \n Linux 2.6.32.12-0.7-default### Assistant: Those are the channel pooling processes. There are several reasons for this state, the most common of which being that channels were preemptively killed or that the parent process for these was killed. Other less common errors include improperly coded channel exits or the occasional bug. (Yes, amqrrmpa shows up in the APAR list from time to time.) It is really difficult to provide any more specific response than this without seeing the channel configurations. If it is not possible to post them for security reasons, you'll need to open a PMR and let IBM look at them. Specifically, I'd be looking to see whether the channels run in FASTPATH or trusted mode, whether exits are defined, etc. I'd also look at the version and fix pack level, then look at the APAR list for the later fixes to see if any address the problem. If these do not point to potential issues, then it's time to run through theMustGatherprocedure and open a PMR.For what its worth, it is usually a good idea to go to the MustGather page and drill down by platform and problem category to get some really helpful diagnostic advice.\n"} +{"text": "### Human: Normally, we have two ways to recover QMGR. One isbackup and restore QMGR data&log, and the other iscreate backup QMGR. My question is which one is better for QMGR recovery situation? Or they both have their own usage scenarios? Please help answer this.Thanks### Assistant: Recovery from what exactly? With whatrecovery time objectiveor whatrecovery point objective?The optimum answer answer depends these requirements and also on how your applications are written. Thebestway from an architectural perspective is to treat messaging like a transport. When you back up your network routers, you don't back up messages that happen to be in-flight on the routers, you just back up the router configurations. Same thing with a Queue Manager. If you back up the object definitions, authorizations, ini files, exits and exit parms you can recreate an empty version of the QMgr and resume where the old one left off.Unfortunately, most applications are designed as if the messaging layer were a database rather than a transport. This means they wish to recover messages from a downed QMgr. That is what theBackup QMgris used for. The way it works is that the primary QMgr uses linear log files. Over time the active log files advance and old files that are no longer required for restoration \"roll off\" the end of the log set. These files are then shipped to where the backup QMgr lives and applied. The backup QMgr will then have an exact copy of the messages that were in the queueswhen that log file was last active.There will always be a lag between the messages on the primary queue manager and those on the backup queue manager that lag is represented by the space consumed by the primary and secondary active log extents. If the primary and secondary log extents are kept small in size and number, the number of messages lost in the failover can be minimized. A recovery point of zero cannot be achieved this way, however it is a LOT better than point-in-time backups.Which leads us to the other backup methodology you mentioned. Point-in-time backups (i.e. backing up the QMgr's queue and log files) cannot work if the backup is taken while the QMgr is running. On a busy QMgr the logs and queues are constantly written to and must be in synch. But backing up these files while active pretty much guarantees that the backed up logs won't synch with the backed up queues. It is possible the QMgr will be restored with damaged queues or that the QMgr will not even start after restoration.Theonlytime this backup strategy works is if the QMgr is stopped and then it is best used for a recovery option after upgrade rather than for an active system. For example, say you take a valid point-in-time backup Sunday morning at 1am. Then during the week somebody deletes a queue file out from under the QMgr and you need to restore it. Restoring the onbe file won't work because it will be out of synch with the log and show as a damaged object. You must restore the entire QMgr. What you get back is all of the messages that were on all the queues as of 1am last Sunday. Worse, if the QMgr participates in a cluster, restoring it to a prior point in time resets the sequence numbers on the cluster command messages so even though itlookslike the QMgr is restored and healthy , the cluster may ignore it or any changes you make to it.The one backup strategy that is most common but not mentioned in your post is to back up the QMgr configuration. This includes:Object definitionsAuthorizationsExit directoriesExit parmsini filesFrom these you would be able to recreate the queue manager configuration, and all of these backups can be done while the QMgr is running. When restoring it generates an empty QMgr to which the applications can connect just as before. The main requirement is that the applications (or human processes) must reconcile any missing messages.There is one disaster recovery approach in which to achieve a zero recovery point - i.e. not lose any messages. That uses synchronous disk replication under the QMgr's files. Each update to a queue or log file is replicated in real time to the disaster recovery site so the DR QMgr has an exact copy of the primary QMgr. When the primary goes down you break the replication and fire up the DR QMgr. Assuming your DNS is configured to also fail over, all remote QMgrs and programs will use the DR QMgr as if it were the primary.There are a couple of HA options as well. Using a hardware cluster such as PowerHA or Veritas Cluster Server can fail over a QMgr from one server to another provided the QMgr's files are hosted on highly available disk such as SAN. The Multi-Instance QMgr can perform a similar failover without hardware cluster software and is based on highly available NFS storage. These are both HA solutions rather than DR solutions because both QMgr instances see the same disk storage. They must therefore be close to the same distance (in network terms) from that disk storage or else performance on the most distant QMgr will suffer from latency and throughput may not be acceptable.Additional info is available in theAvailability, recovery and restarttopic of the Infocenter.\n"} +{"text": "### Human: I am writing to an IBM WebSphere MQ Queue using an SSIS Script task written in C#. At the moment we use a couple simple loops to gather the information we need into a Dictionary object and then place the items, one by one, into the queue. We are now pulling from an SQL database, however, and I need to make these updates atomic.Here is the code used to add the info to the Dictionary//add to list so we can weed out the duplicates\n if (!qContents.ContainsKey(retrievedMessage.Substring(0, 13)))\n {\n qContents.Add(retrievedMessage.Substring(0, 13), retrievedMessage);\n }And here is where they are added to the queue. The MqPut method is used to post each item to the queue individually.//write out unique agent ids to consolidated queue\n foreach (string agentItem in qContents.Values)\n {\n MqPut(agentItem, _outputQueue);\n }The whole block of code is wrapped in a try/catch/finally block, so I'm sure I will have to utilize that somehow, however I'm very new to WebSphere MQ and not sure how. Thx!EDIT\nUsing the code from the answer below causes an exception to be thrown. Once the program gets to the MQMessage object's \"put\" method the MQ Exception \"MQRC_FUNCTION_NOT_SUPPORTED\" is thrown. This is _COMPlusExceptionCode = -532459699### Assistant: My suggestion to you:Read up a little bit about Messaging and then WebSphere MQ.Look at the WebSphere MQ C# samples (found under\\tools\\dotnet\\samples\\cs\\basefolder).Write some samples to make yourself comfortable.To make it atomic you can use XA transaction feature of WebSphere MQ. You basically need to wrap your work in a Transaction scope. Sample pseudo snippet.// Open queue\nMQQueue q = MQQueueManager.AccessQueue( ...);\n\nusing (CommittableTransaction transScope = new CommittableTransaction())\n{\n CommittableTransaction.Current = transScope;\n\n try\n {\n MQMessage mqMsg = new MQMessage();\n\n // Add message contents\n mqMsg.Write();\n q.Put(mqMsg);\n\n transScope.Commit();\n }\n catch (Exception ex)\n {\n transScope.Rollback();\n Console.Write(ex);\n }\n CommittableTransaction.Current = null;\n }BTW, I am interested to know onMqPutmethod? Is this your own method or provided by some library?\n"} +{"text": "### Human: We have a process which runs regularly whenever we shut down our iSeries server. It performs the following (iSeries specific, but you can tell what the MQSC commands are) commands:RCDMQMIMG OBJ(*ALL) OBJTYPE(*ALL) DSPJRNDTA(*YES)\nENDMQMCSVR MQMNAME(IA001.QUEUE.MANAGER)\nENDMQM MQMNAME(IA001.QUEUE.MANAGER)\nDLYJOB DLY(120) \nENDMQMLSR MQMNAME(IA001.QUEUE.MANAGER)Normally this runs without problems, however on the last occasion, five out of six channels ended normally and immediately and the sixth one ended abnormally approximately 75 seconds later.From the log of the channel job, these two messages were consecutive (i.e. no intervening issues):23/07/12 08:26:44.033529 LIBMQMCS_R QMQM *STMT QCMD QSYS 01C8\nFrom module . . . . . . . . : AMQXEIMX_R \nFrom procedure . . . . . . : xcsSendMessage \nStatement . . . . . . . . . : 38 \nMessage . . . . : Channel 'IA001.TO.ISPRO' is starting. \nCause . . . . . : Channel 'IA001.TO.ISPRO' is starting. Recovery . . . : \nNone. Technical Description . . . . . . . . : None. \n\n04/08/12 21:11:28.872098 QWTPITP2 QSYS 061A *EXT *N \nMessage . . . . : Job ended abnormally. \nCause . . . . . : A SIGKILL signal was received for the job. The action for \nthe signal was to terminate the job.Note that the ENDMQM does not use *WAIT to wait for the queue manager to end (the default *CNTRLD is in play), but I do not think that would have helped in this case, as I cannot find any evidence that any other process could have called a halt to proceedings. The forced end of the channel job occurred within the 120 second delay that has been manually inserted in the code (I know, we should use *WAIT, but this code is very old).I think it is reasonable, perhaps, to assume the channel was processing messages when the queue manager was ended - otherwise why would 75 seconds elapse before the next action? It seems like the *CNTRLD option has an implied timeout, although I cannot see this discussed anywhere in documentation. Either that, or something else intervened. But what?An ENDSBS *ALL did follow but I have proven that was several minutes after the channel died.The interesting scenario this created for later was when the queue manager was restarted, there was an error issued saying the channel was already running, but the channel job appears exactly as it normally would, showing 'Channel starting' in the log and indeed it is running fine.Any suggestions as to what external force may be involved or if there is a timeout would be greatly appreciated.### Assistant: There are a couple of likely reasons for this. The channel appears to be an outbound channel and it can be in a blocking network call when the QMgr is shut down. Alternatively, it can be in the middle of a batch and waiting on the other side to respond. If the other side is paused or the connection is broken, the channel may appear to hang while waiting on a response.An inbound channel is often hard to stop if the listener is still running. If the other side has messages to send and is enabled for triggering, it will immediately try to restart the channel. This request hits the listener which starts the process. Since the QMgr is shutting down, the channel cannot complete itsCONNECTbut for a brief time there's a channel process running.Whether inbound or outbound, the QMgr will eventually kill processes that don't come down on their own. This should not be a problem since the channels will negotiate an orderly restart, although it does leave some errors in the log.Tuning which factors into all of this includes TCP Keepalive,HBINT,DISCINT, channel retry parameters and the Adopt MCA parameters.\n"} +{"text": "### Human: I'm working on something which could be described as custom WMQ message router/forwarder. At the moment I have some very confusing issue with processing JMS messages send over MQ. I'm able to receive message send from Java application over JMS (with MQ as transport) but I'm not able to send message to Java application listening on JMS endpoint.I have a testing servlet and message driven bean - both hosted in WebSphere Application Server 7.0 (with WebSphere MQ 7.0 used for message transport). Servlet is able to communicate with the bean but if I put my forwarder between them (by reconfiguring the servlet to communicate with forwarder which will reconstruct messages and forward them to bean) the bean is not able to process the request. I have this error in WAS log:[8/2/12 14:38:51:359 CEST] 00000031 SibMessage W [:] CWSJY0003W: JMSCC0110: An exception '\n Message : java.lang.NullPointerException\n Class : class java.lang.NullPointerException\n Stack : com.ibm.msg.client.wmq.internal.messages.WMQMessageBase._parseMcdFolder(WMQMessageBase.java:445)\n : com.ibm.msg.client.wmq.internal.messages.WMQReceiveMarshal.constructProviderMessageFromRFH2(WMQReceiveMarshal.java:341)\n : com.ibm.msg.client.wmq.internal.messages.WMQReceiveMarshal.createProviderMessage(WMQReceiveMarshal.java:447)\n : com.ibm.msg.client.wmq.internal.messages.WMQReceiveMarshal.exportProviderMessage(WMQReceiveMarshal.java:607)\n : com.ibm.msg.client.wmq.internal.WMQConsumerShadow.getMsg(WMQConsumerShadow.java:1115)\n : com.ibm.msg.client.wmq.internal.WMQSyncConsumerShadow.receive(WMQSyncConsumerShadow.java:334)\n : com.ibm.msg.client.wmq.internal.WMQSession.loadMessageReference(WMQSession.java:1082)\n : com.ibm.msg.client.jms.internal.JmsSessionImpl.consume(JmsSessionImpl.java:2847)\n : com.ibm.msg.client.jms.internal.JmsSessionImpl.run(JmsSessionImpl.java:2549)\n : com.ibm.mq.jms.MQSession.run(MQSession.java:860)\n : com.ibm.mq.connector.inbound.WorkImpl.run(WorkImpl.java:172)\n : com.ibm.ejs.j2c.work.WorkProxy.run(WorkProxy.java:399)\n : com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1604)\n[8/2/12 14:38:51:781 CEST] 00000031 SibMessage W [:] CWSJY0003W: MQJCA4004: Message delivery to an MDB 'XXX' failed with exception: 'null'The message endpoint is automatically paused after this error.I used RFHUtils to get messages send by both JMS and my app and compared them - there is no real difference in UI (except different delivery mode but that is another story) but when I saved messages to file and compared them I saw this difference (just first RFH2 folder):Send by JMS directly:jms_textSend by my app:jms_textAll elements in RFH2 also contains type. Elements fromjmsfolder are in different order but according to exception the problem should be directly withmcdfolder. I'm not sure how to better diagnose the issue - I've tried to configuretracingfor JMS but I don't know how to do that for WAS (I used WAS on Tuesday for the first time). Standard MQ trace doesn't provide any more information.My .NET code (WMQ API using MQ Client 7.5 - amqmdnet.dll 7.5.0.0) is quite complex but it generally does:ReceiverReceiveMQMessagemessage by standardGetcall onMQQueueaccessed withMQOO_INPUT_AS_Q_DEF(no special get options)Read all message headers from receivedMQMessageUsesGetPropertyNames(\"%\")to get names of all message propertiesUsesGetObjectPropertyto get values for every propertyIf message format isMQSTRreads body byReadStringotherwise byReadBytesSenderCreatesMQMessageSets all meaningful message headers from receivedMQMessage- for exampleMessageId,ReplyToQueuename and some other are not copied - new or correct values are used insteadSets all properties from receivedMQMessageby usingSetObjectProperty- this step contains some magic because .NET API is inconsistent and the type of value returned fromGetObjectPropertyis not always accepted bySetObjectProperty- typically I receiveStringbut I must passintorlong(examples: JmsDeliveryMode, JmsPriority or JmsTimestamp). This step also overrides destinations for JmsDestination and JmsReplyToWrite body of the message either byWriteStringorWriteBytesPutmessage toMQQueueaccessed withMQOO_OUTPUT(no special put options)I don't create RFH2 structure manually - I let MQ infrastructure to deal with it. So my question: How to create valid JMS message from .NET which will be accepted by message driven bean?Note: I don't want to use IBM.XMS - this decision was made long time ago because of some article in IBM knowledge base describing pros and cons of both XMS and WMQ. I need to support both JMS and non-JMS messaging.### Assistant: After enablingWebSphere tracingand usingJava Decompilerto check some WebSphere .jar packages I found the reason for the error by a pure chance.The tracing has shown what values are passed to the failing_parseMcdFoldermethod:[8/3/12 12:16:00:199 CEST] 0000003a > UOW= source=com.ibm.msg.client.wmq.internal.messages.WMQMessageBase method=_parseMcdFolder(String,String,String) (com.ibm.msg.client.wmq.internal.messages.WMQMessageBase) [:] org=IBM prod=WebSphere component=Application Server thread=[WMQJCAResourceAdapter : 0]\n Entry parm0=jms_text parm1=jms_text parm2=\n[8/3/12 12:16:00:199 CEST] 0000003a 3 UOW= source=com.ibm.msg.client.jms.internal.JmsSessionImpl org=IBM prod=WebSphere component=Application Server thread=[WMQJCAResourceAdapter : 0]\n (com.ibm.msg.client.jms.internal.JmsSessionImpl) [:/50d450d4] Caught exception: java.lang.NullPointerException in class: com.ibm.msg.client.jms.internal.JmsSessionImpl method: run() \n[8/3/12 12:16:00:199 CEST] 0000003a 1 UOW= source=com.ibm.msg.client.jms.internal.JmsSessionImpl org=IBM prod=WebSphere component=Application Server thread=[WMQJCAResourceAdapter : 0]\n (com.ibm.msg.client.jms.internal.JmsSessionImpl) [:/50d450d4] Tracing exception:\njava.lang.NullPointerException\n at com.ibm.msg.client.wmq.internal.messages.WMQMessageBase._parseMcdFolder(WMQMessageBase.java:445)\n at com.ibm.msg.client.wmq.internal.messages.WMQReceiveMarshal.constructProviderMessageFromRFH2(WMQReceiveMarshal.java:341)\n at com.ibm.msg.client.wmq.internal.messages.WMQReceiveMarshal.createProviderMessage(WMQReceiveMarshal.java:447)\n at com.ibm.msg.client.wmq.internal.messages.WMQReceiveMarshal.exportProviderMessage(WMQReceiveMarshal.java:607)\n at com.ibm.msg.client.wmq.internal.WMQConsumerShadow.getMsg(WMQConsumerShadow.java:1115)\n at com.ibm.msg.client.wmq.internal.WMQSyncConsumerShadow.receive(WMQSyncConsumerShadow.java:334)\n at com.ibm.msg.client.wmq.internal.WMQSession.loadMessageReference(WMQSession.java:1082)\n at com.ibm.msg.client.jms.internal.JmsSessionImpl.consume(JmsSessionImpl.java:2847)\n at com.ibm.msg.client.jms.internal.JmsSessionImpl.run(JmsSessionImpl.java:2549)\n at com.ibm.mq.jms.MQSession.run(MQSession.java:860)\n at com.ibm.mq.connector.inbound.WorkImpl.run(WorkImpl.java:172)\n at com.ibm.ejs.j2c.work.WorkProxy.run(WorkProxy.java:399)\n at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1604)So parameters passed to_parseMcdFolderwere:parm0=jms_text parm1=jms_text parm2=I decompiled the WMQ resource adapter package stored in%WAS_INSTALL%\\lib\\WMQ\\ra\\wmq.jmsra.rarand checked the_parseMcdFoldermethod. Surprisingly the reported line from exception and the method code didn't correspond (there was another method). Also the code of the method should correctly parse the passed parameter.After a while I checked whole WAS installation directory and I found two occurrences of unpacked resource adapter - one was in rootInstalledComponentsdirectory and second was inInstalledComponentsdirectory of the server profile.These resource adapters had different versions:Global: 7.0.1.4-k701-104-110104Profile: 7.0.0.0-k700-L080820After decompiling the code for version 7.0.0.0-k700-L080820 I found that there is really a bug - accessing not initialized message:static WMQMessage _parseMcdFolder(String s, String fbClass, String forcedMessageClass)\n throws JMSException\n{\n WMQMessage newMessage = null;\n\n // 350+ lines of code trying to parse s and initialize newMessage\n // but no fallback so newMessage could be null after the processing\n\n newMessage.isNullMessage = isNullMsgFlag; // Line 445 - BOOM!\n return newMessage;\n}This bug was fixed in some following version of the adapter but it was not communicated because I didn't find any documentation related to this issue.After using the newer adapter version the problem was resolved (actually I have moved just to another problem).\n"} +{"text": "### Human: I have a queue manager QM_TEST created using the following MQSC command:SET AUTHREC OBJTYPE(QMGR) GROUP('mq-user') AUTHADD(INQ,DSP,CONNECT,SET,SETALL)\n SET AUTHREC PROFILE(SYSTEM.MQEXPLORER.REPLY.MODEL) OBJTYPE(QUEUE) GROUP('mq-user') AUTHADD(INQ,DSP,GET)\n SET AUTHREC PROFILE(SYSTEM.ADMIN.COMMAND.QUEUE) OBJTYPE(QUEUE) GROUP('mq-user') AUTHADD(INQ,DSP,PUT)\n DEFINE CHANNEL ($cname) CHLTYPE (SVRCONN) TRPTYPE (TCP) MCAUSER('tcs-mq-user') REPLACE\n SET CHLAUTH($cname) TYPE(ADDRESSMAP) ADDRESS(*) MCAUSER('tcs-mq-user')\n DEFINE QLOCAL ($dlqname) REPLACE\n SET AUTHREC PROFILE($dlqname) OBJTYPE(QUEUE) GROUP('mq-user') AUTHADD(ALL)\n ALTER QMGR DEADQ($dlqname) FORCE\n DEFINE LISTENER ($lname) TRPTYPE (TCP) CONTROL (QMGR) PORT ($port)\n START LISTENER ($lname)I have two queues TEST1 and TEST2 created using:DEFINE QLOCAL ($qname) GET(ENABLED) PUT(ENABLED) MAXDEPTH($maxdepth) REPLACE\nSET AUTHREC PROFILE($qname) OBJTYPE(QUEUE) GROUP('mq-user') AUTHADD(ALL)I am trying to copy messages from TEST1 to TEST2 using the q program utility:q -xb -mQM_TEST -iTEST1 -mQM_TEST -oTEST2 -p20However I get this error:MQSeries Q Program by Paul Clarke [ V6.0.0 Build:May 2 2012 ]\n Connecting ...failed. MQCONNX on object 'QM_TEST' returned 2035 Not\n authorized..I am running WebSphere MQ v7.1.qSupportPac is installed on the server and I am executing the q command on the server. I can't figure out a way to pass the channel name TEST_CHANNEL and port number 1414, is that the issue?### Assistant: The program is connecting to the QMgr in bindings mode via shared memory rather than using the SVRCONN channel. You can verify this byALTER QMGR AUTHOREV(ENABLED)then looking at the authorization event that is produced in the QMgr event queue. If you have installedSupportPac MS0Pyou can right-click on the queue and select \"Format event messages\" to see it in human-readable format. Either way, you should see that the ID being used to connect is nottcs-mq-userbut rather whatever ID you are using to run the Q program. Try:q -lmqic -xc -iTEST1 -oTEST2 -p20The program will prompt you for the channel details when run with-xc.The Q program can dump queues to files but it is not designed for that. The QLoad program fromSupportPac MO03isdesigned for that and will capture all aspects of the message and, if you are suitably authorized, also restore them intact. This includes message ID, timestamp, etc.Finally, a quick note about theAUTHRECstatements in your post. Since you have bothered to create a low-privlegedMCAUSERand set authorities for it, I presume that you would like that ID not to have administrative privileges. Please be aware that granting a user+setor+setallon the QMgr allows them to manage authorization records using WMQ Explorer or anything else that uses PCF commands. Consider restricting authorities on the QMgr to+dsp +inq +connect.Generally, the applications don't get access to the DLQ but rather get access to an application-specific backout queue. If the app is granted access to the DLQ it is usually only to put messages there and not to get them back out. This is because the DLQ is a system-wide resource and if the QMgr is shared, the messages from multiple apps might land in the DLQ. As a security precaution, restrict delete access on that queue to administrators. This way someone cleaning up after their app can't accidentally (or otherwise) delete the messages belonging to another app.UPDATE:Reviewing your post, I noticed another discrepancy. I had assumed that you were getting the 2035 Authorization Error because you were connecting in bindings mode with an ID other thanmqmortcs-mq-user. After looking again, I realized that you never authorized themq-usergroup to the queues you are trying to access. You authorized it to the Command Queue and the reply model which aren't used in this scenario. (WMQ Explorer uses them.) So, add the following rules:SET AUTHREC PROFILE(TEST1) OBJTYPE(QUEUE) GROUP('mq-user') AUTHADD(PUT,GET,INQ,BROWSE)\nSET AUTHREC PROFILE(TEST2) OBJTYPE(QUEUE) GROUP('mq-user') AUTHADD(PUT,GET,INQ,BROWSE)This will solve the auths problem if in fact you are connecting astcs-mq-user.There isn't a way to pass the channel to Q on the command line, as far as I know, but it does accept the standardMQSERVER variable. For example:export MQSERVER=\"$cname/TCP/localhost($port)\"...where$cnameis the channel name and$portis the port. Here's my test:tcs-mq-user:~> export MQSERVER=\"TEST.SVRCONN/TCP/localhost(1414)\"\ntcs-mq-user:~> q -xb -iTEST1 -mQMTEST -lmqic\nMQSeries Q Program by Paul Clarke [ V6.0.0 Build:May 2 2012 ]\nConnecting ...connected to 'JMSDEMO'.\nNo more messages.\ntcs-mq-user:~>As to why its not finding the client libs, do you have them installed?tcs-mq-user:~> rpm -qa | grep MQSeriesClient\nMQSeriesClient-7.5.0-0\n"} +{"text": "### Human: suppose I have the following JMS queues\"doc/queue1\"\"home/queue2\"\"someOtherQueue\"added in a websphere process server, how can I write a script to clear and/or delete them? looking around the web I haven't found a solution to my problem yet unfortunately, what i found though is that it's probably gonna be a JYthon script which i wouldn't know how to writethanks in advance for the help guys### Assistant: I have written a script that already does most of what you need in the articleMission:Messaging: Easing administration and debugging with circular queues. The script uses the Q program fromSupportPac MA01to clear messages. You could use the client version of the Q program to do the same thing remotely. Although I've written my script in Perl I have seen versions of it in Korn Shell and Windows Batch as well.\n"} +{"text": "### Human: I am trying to consume messages in onMessage method, because I want several messages in one transaction to improve performance.ButMessage message = consumer.receive();returns null. It doesn't even block. Buy why? It must be blocked until it gets message, isn't it?@TransactionAttribute(TransactionAttributeType.REQUIRED)\npublic void onMessage(Message message) {\n\n QueueConnection queueConnection = null; \n queueConnection = qcf.createQueueConnection();\n queueConnection.start();\n queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\n Queue queue = queueSession.createQueue(sessionConnParams.toString());\n consumer = queueSession.createConsumer(queue);\n\n // it works in cycle\n System.out.println(\"before receive\");\n Message message = consumer.receive();\n System.out.println(\"after receive\");\n if (message == null) {\n System.out.println(\"no messages\");\n return;\n }\n\n // process message\n\n } catch (Exception e) {\n // process exception\n } finally {\n // close objects\n }\n}### Assistant: In my opinion creating another receiver in onMessage() is not a good idea. EJB specifications does not recommend starting threads in OnMessage methods.Receiving multiple messages in one transaction will not improve performance. Performance depends on multiple factors1) Time taken byonMessagemethod to process a message.2) How fast the messaging provider is delivering messages3) Network4) HardwareTo improve performance you can consider running multiple MDBs in parallel. Also look at the performance tuning of the messaging provider you are using.Here is one useful link fromIBM\n"} +{"text": "### Human: I am trying to connect to a remote queue using c#. \nI tried many ways to connect to the remote queue but it always fails with common errors like:MQRC_CHANNEL_CONFIG_ERRORorMQRC_HOST_NOT_AVAILABLE.What I am doing is this:string channel = \"QM_TEST.SVRCONN\"; \n string hostname = \"\"; \n string queueName = \"QM_TEST\"; \n string port = 1414; \n\n props.Add(MQC.HOST_NAME_PROPERTY, hostname); \n props.Add(MQC.CHANNEL_PROPERTY, channel); \n props.Add(MQC.PORT_PROPERTY, port ); \n props.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED); \n\n MQQueueManager mqQueue = new MQQueueManager(queueName, props);I have tried changing this but all failed.I think that my problem is the server configurations.. \ncan you point me to a full guide to how to configure a server and connect to it with .net?My problem is connecting to a REMOTE server using .net and not to a local server.Thank you!### Assistant: The problem was that the CCSID between the client and the server were different.http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=%2Fcom.ibm.mq.csqzaf.doc%2Fcs12480_.htmOn the client side I had to putEnvironment.SetEnvironmentVariable(\"MQCCSID\", \"437\");Thats why I got:MQRC_CHANNEL_CONFIG_ERROR\n"} +{"text": "### Human: While trying to intialize the ConnectionFactory from a jobScheduler (running in jboss-5), to websphere queue, I get the below exceptionjava.lang.VerifyError: Cannot inherit from final class\n at java.lang.ClassLoader.defineClass1(Native Method)\n at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)\n at java.lang.ClassLoader.defineClass(ClassLoader.java:616)\n at org.jboss.classloader.spi.base.BaseClassLoader.access$200(BaseClassLoader.java:67)\n at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:633)\n at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:592)\n at java.security.AccessController.doPrivileged(Native Method)\n at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:591)\n at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:568)\n at org.jboss.classloader.spi.base.BaseDelegateLoader.loadClass(BaseDelegateLoader.java:135)\n at org.jboss.classloader.spi.filter.FilteredDelegateLoader.loadClass(FilteredDelegateLoader.java:131)\n at org.jboss.classloader.spi.base.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:455)\n at org.jboss.classloader.spi.base.ClassLoaderManager.nextTask(ClassLoaderManager.java:267)\n at org.jboss.classloader.spi.base.ClassLoaderManager.process(ClassLoaderManager.java:166)\n at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:276)\n at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1138)\n at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:862)\n at org.jboss.classloader.spi.base.BaseClassLoader.doLoadClass(BaseClassLoader.java:502)\n at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:447)\n at java.lang.ClassLoader.loadClass(ClassLoader.java:248)\n at com.ibm.ws.naming.util.WsnInitCtxFactory.parseIiopUrl(WsnInitCtxFactory.java:1781)\n at com.ibm.ws.naming.util.WsnInitCtxFactory.parseBootstrapURL(WsnInitCtxFactory.java:1525)\n at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:389)\n at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:113)\n at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:428)\n at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:144)\n at javax.naming.InitialContext.lookup(InitialContext.java:392)\n at com.test.testBatch.jms.JMSUtil.initialize(JMSUtil.java:57)\n at com.test.testBatch.jms.JMSUtil.send(JMSUtil.java:90)\n at com.test.testBatch.job.OutboundChangesPollingJob.execute(OutboundChangesPollingJob.java:76)\n at org.quartz.core.JobRunShell.run(JobRunShell.java:195)\n at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)\n2012-03-29 09:47:11,775 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) Exception in thread \"DefaultQuartzScheduler_Worker-0\"\n2012-03-29 09:47:11,776 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) java.lang.NoClassDefFoundError: com/ibm/rmi/corba/NamedValueImpl\n2012-03-29 09:47:11,777 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at com.ibm.ws.naming.util.WsnInitCtxFactory.parseIiopUrl(WsnInitCtxFactory.java:1781)\n2012-03-29 09:47:11,777 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at com.ibm.ws.naming.util.WsnInitCtxFactory.parseBootstrapURL(WsnInitCtxFactory.java:1525)\n2012-03-29 09:47:11,777 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:389)\n2012-03-29 09:47:11,777 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:113)\n2012-03-29 09:47:11,777 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:428)\n2012-03-29 09:47:11,777 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:144)\n2012-03-29 09:47:11,778 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at javax.naming.InitialContext.lookup(InitialContext.java:392)\n2012-03-29 09:47:11,778 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at com.test.testBatch.jms.JMSUtil.initialize(JMSUtil.java:57)\n2012-03-29 09:47:11,778 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at com.test.testBatch.jms.JMSUtil.send(JMSUtil.java:90)\n2012-03-29 09:47:11,778 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at com.test.testBatch.job.OutboundChangesPollingJob.execute(OutboundChangesPollingJob.java:76)\n2012-03-29 09:47:11,778 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at org.quartz.core.JobRunShell.run(JobRunShell.java:195)\n2012-03-29 09:47:11,778 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)\n2012-03-29 09:47:11,779 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) Caused by: java.lang.ClassNotFoundException: Unexpected error during load of: com.ibm.rmi.corba.NamedValueImpl, msg=Cannot inherit from final class\n2012-03-29 09:47:11,779 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at org.jboss.classloader.spi.base.ClassLoaderManager.process(ClassLoaderManager.java:181)\n2012-03-29 09:47:11,779 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:276)\n2012-03-29 09:47:11,779 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1138)\n2012-03-29 09:47:11,779 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:862)\n2012-03-29 09:47:11,779 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at org.jboss.classloader.spi.base.BaseClassLoader.doLoadClass(BaseClassLoader.java:502)\n2012-03-29 09:47:11,779 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:447)\n2012-03-29 09:47:11,779 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at java.lang.ClassLoader.loadClass(ClassLoader.java:248)\n2012-03-29 09:47:11,780 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) ... 12 more\n2012-03-29 09:47:11,780 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) Caused by: java.lang.VerifyError: Cannot inherit from final class\n2012-03-29 09:47:11,780 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at java.lang.ClassLoader.defineClass1(Native Method)\n2012-03-29 09:47:11,780 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)\n2012-03-29 09:47:11,780 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at java.lang.ClassLoader.defineClass(ClassLoader.java:616)\n2012-03-29 09:47:11,780 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at org.jboss.classloader.spi.base.BaseClassLoader.access$200(BaseClassLoader.java:67)\n2012-03-29 09:47:11,780 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:633)\n2012-03-29 09:47:11,780 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:592)\n2012-03-29 09:47:11,780 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at java.security.AccessController.doPrivileged(Native Method)\n2012-03-29 09:47:11,781 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:591)\n2012-03-29 09:47:11,781 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:568)\n2012-03-29 09:47:11,781 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at org.jboss.classloader.spi.base.BaseDelegateLoader.loadClass(BaseDelegateLoader.java:135)\n2012-03-29 09:47:11,781 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at org.jboss.classloader.spi.filter.FilteredDelegateLoader.loadClass(FilteredDelegateLoader.java:131)\n2012-03-29 09:47:11,781 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at org.jboss.classloader.spi.base.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:455)\n2012-03-29 09:47:11,781 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at org.jboss.classloader.spi.base.ClassLoaderManager.nextTask(ClassLoaderManager.java:267)\n2012-03-29 09:47:11,781 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) at org.jboss.classloader.spi.base.ClassLoaderManager.process(ClassLoaderManager.java:166)\n2012-03-29 09:47:11,781 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) ... 18 moreSince it is throwing classNotFound, i went and checked the lib folder and the class is present in the jar named \"ibmorb.jar\". (Not sure why ClassNotFound is thrown)This is the naming factory which is getting initliazed in the IntialContextcom.ibm.websphere.naming.WsnInitialContextFactoryPlease help me on this### Assistant: The jar and context factory mentioned would tend to indicate that the WMQ client was borrowed from a WebSphere Application Server install rather than using the stand-alone WMQ client installer. If that is the case you can likely fix this quite easily by installing the stand-alone client. You can obtain this free (with registration) as a SupportPac. These are by version so you have your choice of:V7.1 client isSupportPacMQC71(Preferred)V7.0 client isSupportPacMQC7V6.0 client isSupportPacMQC6(Out of support as of September 2012)Note that installing the client from the IBM-supplied installer provides a number of additional features such as diagnostics for tracing, version display, initial verification test code, sample source code, etc. This is the method of install that IBM will support so even though you can get it to work by copying the jars from the WMQ server install, using IBM's media is recommended.Note also that the packaging of the Java and JMS classes has changed between versions. It is important to know which version that you are using and refer to the corresponding docs forCLASSPATHand other config options. The v7.1 implementation has many functional improvements and is the only version that will take advantage of the features on a v7.1 QMgr. However it will connect toanyversion QMgr so if this is new development, try to use the v7.1 client now so that you don't end up needing to upgrade down the road.The Infocenter links for each version of the client are:V7.1 InfocenterEnvironment Varariables for JMS&Installing classes for JMSV7.0 InfocenterClientsandUsing JavamanualsV7.0 InfocenterClientsandUsing JavamanualsOne of the utilities supplied with the IBM installer is thesetmqjmsenvscript (andsetmqjmsenv64when installing the 64-bit client) in thejava/bindirectory. You can look here to determine theCLASSPATHand other environment variables needed for your version of WMQ Client Classes for Java.\n"} +{"text": "### Human: The status of the MQFTE agent is in problem state. What is the reason for it and how can this be rectified ?### Assistant: The \"problem\" status is seen when the agent is publishing status information but the publications are out of date when received by the tool.Such a condition indicates the command handler thread is no longer\nprocessing the agent command queue. This means either there is an\ninternal problem or more likely the agent has been flooded with transfer\nrequests that have a large source wildcard/recursive component. If this\nis case then additional command handlers can be allocated using agent\npropertiesmaxCommandHandlerThreads.\n"} +{"text": "### Human: I want to use the Q program fromSupportPac MA01to move messages between two different queues. It works without any issue on a Windows box.I am trying to run this on an AIX box and I receive the2035 - Not Authorizederror message.I specify the flag-u when i execute the copy command and yet it keeps statingMQOPEN on Object 'queue name' returned 2035 Not authorized..My command line looks like the one below:q -u -xb -m sourceQMgr -I sourceQueue -m TargetQMgr -oDestinationQueue -p20The userdoes have the relavent permissions to read and write from the queue.Appreciate any pointers or assistance.### Assistant: In the Q program, the-Uparameter sets the user ID in the messagebut not the ID used to connect to the QMgr. If you look at the connection handle on the queue while you are connected on the Windows box you will see that the ID associated with the handle is your login ID and notmyuserid. However, the message'sMQMD.UserIDwillcontainmyuseridafter aPUT.When you use administrative privileges, this authorization is automatically granted. In this case you mentioned that on the Windows box you are logged on as the administrator which would allow that option. If on the AIX box you are not using an ID in the mqm group then the+setidauthority would need to be explicitly granted in order to use the-Uoption.For example, assume thatmyuseridbelongs tomygroup. To make the-Uoption work you would need to do this:# +setid must be granted at both the QMgr *and* the queue\nsetmqaut -m TargetQMgr -t qmgr -g mygroup +connect +inq +setid\nsetmqaut -m TargetQMgr -n DestinationQueue -t queue -g mygroup +put +inq +setidNote that+setidonly applies to putting messages and not getting them. However, because the Q program may specify thesetIDoption on the connect to the first QMgr it's possible the errors you see are generated there. If that is the case, run the same commands on the source QMgr:# +setid must be granted at both the QMgr *and* the queue\nsetmqaut -m SourceQMgr -t qmgr -g mygroup +connect +inq +setid\nsetmqaut -m SourceQMgr -n SourceQueue -t queue -g mygroup +browse +get +inq +setidFor reference, please see the help for the Q program which states:-U Sets the user ID in the message....and the Infocenter section onGranting authority to set context.Incidentally, I couldn't find a-u(lowercase) option so I'm assuming it's just a typo in your post and you are actually using-U. That option produces the desired message when I tried it on my workstation.\n"} +{"text": "### Human: I havehermesJMSsetup andsoapUI. I'd like a small script that can go in either viahermesJMSor another way to retrieve the queue depth of a particular queue.Is there a way to do this easily?Thanks### Assistant: The JMS specification does not provide an API for object inquiry, however IBM provides one using native Java classes and the C API using Programmable Command Formats, or PCF for short. The PCF reference docs arehere.If you have installed the WMQ client code (free download with registration) you will have the sample programs on your laptop. By default, these reside inC:\\Program Files (x86)\\IBM\\WebSphere MQ\\tools\\pcf\\samplesfor Windows or in/opt/mqm/samp/for UNIX/Linux. Take a look atPCF_ListQueueNames.javafor a starting point. If you were to substituteMQCMD_INQUIRE_QforMQCMD_INQUIRE_Q_NAMESin that program you'd be very close to what you require.Alternatively since you requested alternatives, you might look atSupportPac MO72. This SupportPac can be used as a client version ofrunmqscso that you can, from a central server, write scripts that query your entire WMQ network. Of course, it also works in local bindings mode. Among the other features that make MO72 great for scripting is an option to format output to one line per object. This lets you grep out the line of interest, then strip out the value of interest.\n"} +{"text": "### Human: Is there any environment to test sending of mqseries messages without installing WebSphere MQ?\nWe are developing some application which will be cooperate with WebSphere MQ system and we are wondering how to test it without buying one. We just want to know whether we send are messages correctly.### Assistant: I don't know of anything that simulates a QMgr. On the other hand, there are options for development using WebSphere MQ at low or no cost.There is a free 90-day trialhere.You can run anAmazon Machine Imageon which the IBM licenses are free for development use. (You still pay Amazon for the image usage, just not for the IBM licensing.)If your company owns a current license and support of WebSphere Message Broker, you are entitled to put all of it's components, including WebSphere MQ, onto all developer desktops in your organization as described in the Infocenterhere.If you are developing software for resale, you can register as an IBM Business partner and gain access to WebSphere, Rational, Tivoli and InfoSphere software through theSoftware Access Catalogoffering for $795 a year. That'sper enterprise, not per person, by the way.If your company is an IBM Business Partner and is planning to obtain IBM certification for many developers, theValue Plan Optioncosts $2k but reimburses up to $6k of testing fees and includes the Software Access Catalog.I am a product manager for WebSphere MQ so I'm always interested in whether potential users are able to get access to WebSphere products that they need for trial or development purposes. If none of the options here meets your needs, and this goes for anyone reading this post, I'd invite you to contact me directly using the address in my profile.\n"} +{"text": "### Human: I am running queue manager QM1 on am-wmq-ux01:1414, mq client is running on am-wmqc-ux01. I would be interested how can I create new mq objects on QM1 using mq client connection from am-wmqc-ux01?### Assistant: Have a look atSupportPac MO72. It is a client-based version of runmqsc called mqsc. If you are suitably authorized (or if nobody bothered to secure the QMgr) then you can do anything with mqsc that you can with runmqsc.\n"} +{"text": "### Human: My application is listening to Tibco RV, now I am required to switch to WebSphere MQ. I found the code like thisTibrv.open(Tibrv.IMPL_NATIVE);\nrvdTransport = new TibrvRvdTransport(...);\nTibrvQueue queue = new TibrvQueue();\ncmqTransport = new TibrvCmQueueTransport(...);\nqueueListener = new TibrvCmListener(...);\ndisp = new TibrvDispatcher(...)In the MQ side, do we have similar concepts?Thanks### Assistant: Short answer - Yes.When you download and install the WMQ client (SupportPac MQC71) you get, in addition to the Java classes, diagnostic utilities and lots of sample code. Among the sample programs you will findMQSample.javawhich looks like this:import com.ibm.mq.MQException;\nimport com.ibm.mq.MQGetMessageOptions;\nimport com.ibm.mq.MQMessage;\nimport com.ibm.mq.MQPutMessageOptions;\nimport com.ibm.mq.MQQueue;\nimport com.ibm.mq.MQQueueManager;\nimport com.ibm.mq.constants.MQConstants;\n\npublic class MQSample {\n public static void main(String args[]) {\n try {\n // Create a connection to the QueueManager\n System.out.println(\"Connecting to queue manager: \" + qManager);\n MQQueueManager qMgr = new MQQueueManager(qManager);\n\n // Set up the options on the queue we wish to open\n int openOptions = MQConstants.MQOO_INPUT_AS_Q_DEF | MQConstants.MQOO_OUTPUT;\n\n // Now specify the queue that we wish to open and the open options\n System.out.println(\"Accessing queue: \" + qName);\n MQQueue queue = qMgr.accessQueue(qName, openOptions);\n\n // Define a simple WebSphere MQ Message ...\n MQMessage msg = new MQMessage();\n // ... and write some text in UTF8 format\n msg.writeUTF(\"Hello, World!\");\n\n // Specify the default put message options\n MQPutMessageOptions pmo = new MQPutMessageOptions();\n\n // Put the message to the queue\n System.out.println(\"Sending a message...\");\n queue.put(msg, pmo);\n\n // Now get the message back again. First define a WebSphere MQ\n // message\n // to receive the data\n MQMessage rcvMessage = new MQMessage();\n\n // Specify default get message options\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n\n // Get the message off the queue.\n System.out.println(\"...and getting the message back again\");\n queue.get(rcvMessage, gmo);\n\n // And display the message text...\n String msgText = rcvMessage.readUTF();\n System.out.println(\"The message is: \" + msgText);\n\n // Close the queue\n System.out.println(\"Closing the queue\");\n queue.close();\n\n // Disconnect from the QueueManager\n System.out.println(\"Disconnecting from the Queue Manager\");\n qMgr.disconnect();\n System.out.println(\"Done!\");\n }\n catch (MQException ex) {\n System.out.println(\"A WebSphere MQ Error occured : Completion Code \" + ex.completionCode\n + \" Reason Code \" + ex.reasonCode);\n ex.printStackTrace();\n for (Throwable t = ex.getCause(); t != null; t = t.getCause()) {\n System.out.println(\"... Caused by \");\n t.printStackTrace();\n }\n\n }\n catch (java.io.IOException ex) {\n System.out.println(\"An IOException occured whilst writing to the message buffer: \" + ex);\n }\n return;\n }\n}There are of course also samples for JMS, C, C#, etc. The sample shown uses synchronous (blocking)GETcalls but there are async listener methods if you want to implement with a callback mechanism.I would also recommend looking over the application development sections of the Infocenter.Theseare the v7.0 docs andtheseare the v7.1 docs.\n"} +{"text": "### Human: I am working on a j2ee project, which is a public website. The application has a lot of security built in.It makes a call over MQs to a mainframe DB, i believe its a secure conversation. Everything works fine till this place.My job is to make a call to a third party secure webservice, the url for the webservice is a https url.When i make the first call from the application to the webservice, everything works well but if i place this call after the mainframe call, I get the following error.the trust store located at \"mynode\" cannot be loaded. DerInputstream.getlength length tag=127 too bigPlease pardon me, I cannot paste the code or config here, as its a client project.\nThe environment used is: IBM WAS 6.1 with webservices feature pack 6.0.15 & Spring Webservices 1.5.4Any help would be appreciated. Thanks in advance### Assistant: By default, there's only one keystore per JVM. Once you load the WMQ one, the web service will fail and vice versa. You can write code to manage multiple keystoresas described in this post. In that case I suspect WMQ will need to use the JVM keystore while your app can select the alternate keystore through code.\n"} +{"text": "### Human: I have a problem withSetBytesProperty/GetBytesPropertymethods pair onMQMessageclass (I'm using WebSphere MQ Client 7.0.1.6). I can successfully sendsbytearray in property to queue but once I try to get it back in read message I always getnull.Here is the simplest code I use to reproduce the issue.[TestFixture]\npublic class MQQueueTests {\n\n public const string MessageContent = \"This is test message\";\n\n [Test]\n public void PutAndGetMessage() {\n Environment.SetEnvironmentVariable(\"MQCCSID\", \"437\");\n var properties = new Hashtable\n {\n {MQC.HOST_NAME_PROPERTY, \"TestServer\"},\n {MQC.CHANNEL_PROPERTY, \"Test.Channel\"},\n {MQC.PORT_PROPERTY, 1415} \n };\n\n using (var manager = new MQQueueManager(\"Test.Queue.Manager\", properties)) {\n using (MQQueue queue = manager.AccessQueue(\"Test.Queue\", \n MQC.MQOO_OUTPUT | MQC.MQOO_INPUT_AS_Q_DEF)) {\n\n MQMessage message = new MQMessage();\n message.SetBytesProperty(\"testBytesValue\", \n new sbyte[] { 8, 12, 22, 48, 68, 71, 92, 104 });\n message.WriteUTF(MessageContent);\n queue.Put(message);\n\n MQMessage readMessage = new MQMessage();\n queue.Get(readMessage);\n\n sbyte[] array = readMessage.GetBytesProperty(\"testBytesValue\");\n Assert.IsNotNull(array); // <-- FAILS!\n\n Assert.AreEqual(MessageContent, readMessage.ReadUTF());\n\n queue.Close();\n }\n manager.Disconnect();\n }\n }\n}Something is passed in message property to queue - I can see something in WebSphere MQ Explorer on the server but it doesn't look like my passed array (it even change over time when new messages are received):When I turn on tracing (strmqtrc) on MQ Client I can see the same value wrote and read by the client:This is present in log when putting message to the queue:Data:-\n 0x00000000 026B5878 3C 75 73 72 3E 3C 74 65 73 74 42 79 74 65 73 56 : 080c163044475\n 0x00000000 026B58A8 63 36 38 3C 2F 74 65 73 74 42 79 74 65 73 56 61 : c68This is present in log when getting message from the queue (I removed some data to make it shorter but significant part is exactly as in log):Receiving Data:-\n\n 0x00000000 1D2A5090 20 20 20 20 20 20 20 20 00 00 00 00 B8 04 00 00 : ....\u00b8...\n 0x00000000 1D2A50A0 4C 00 00 00 3C 75 73 72 3E 3C 74 65 73 74 42 79 : L...080c16304\n 0x00000000 1D2A50D0 34 34 37 35 63 36 38 3C 2F 74 65 73 74 42 79 74 : 4475c68 \n 0x00000000 1D2A50F0 00 21 3C 74 65 73 74 3E 54 68 69 73 20 69 73 20 : .!This is \n 0x00000000 1D2A5100 74 65 73 74 20 6D 65 73 73 61 67 65 3C 2F 74 65 : test message4TSHM...4....So in both sending and receiving I see the same correct byte array. But in .NET code the value of the property isnull:Every otherGetXXXPropertyandSetXXXPropertymethod pair works without any problem.Edit:I validated that it doesn't work on multiple computers running same version of WebSphere MQ clients and I also validated that it doesn't work with another code. It works if I rewrite the test to Java and use Java API instead!I also have problems with sending any property in message targeted toMQTopic- I getMQException : MRQC_HEADER_ERROR. Again it works in Java without problem.### Assistant: I am able to get the value. I can see the returned array has the same values as the ones in the sent message. Here is the C# snippet I used.MQMessage message = new MQMessage();\n message.SetBytesProperty(\"testBytesValue\", new sbyte[] { 8, 12, 22, 48, 68, 71, 92, 104 });\n message.WriteUTF(MessageContent);\n queue.Put(message);\n\n MQMessage readMessage = new MQMessage();\n queue.Get(readMessage);\n\n sbyte[] array = readMessage.GetBytesProperty(\"testBytesValue\");\n Console.Write(array);\n"} +{"text": "### Human: MQFTE picks the files and copies in the destination by alphabetical order (if I am not wrong). Is it possible to pick the files from the source path by file size or by file extension or any other order. If not can it be customized by any other means?### Assistant: You can customize your transfer with ANT script. I tried & it works.\n"} +{"text": "### Human: I wish to use IBM WebSphere Message Broker (probably V6) to consume some CSV files, perform some validation and then populate some Java objects for consumption by a Java application. I believe that much of this can be achieved by using the FileInputNode for the consumption of the csv files and the JavaCompute node for the java related stuff. However, what I would like to know is how can I connect the two? One way that I see possible is to consume the csv file, then create a message that will be consumed by the Java node.Any advice would be appreciated. My familiarity with Message Broker is minimal so please excuse my ignorance. Incidentally the decision to use WebSphere Message Broker is not mine (corp standards) so although there may be other (simpler) ways to achieve this, I am stuck with using MQ Broker.Any advice is appreciated.Thanks in advance.Baz### Assistant: Your question is very generic and it is not clear what you need to achieve. My 1st answer will be very generic too ;-)Open WMB Toolkit, go to Help - Samples Galery - Technology samples - Message Broker - Message formats - Comma Separated Value (CSV) Message Set. Import this example into your WMB workspace and read 'Read about the sample' - 'Exploring the CSV sample' section as well as other linked pages. Then you can run the example to see what it does and how it fits your scenatio.Then update your question to be less generic.\n"} +{"text": "### Human: I have a MDB reading from a MQ Queue through local binding. Sometimes we notice that the messages from the MQ Queue is not picked up Queue depth increases to 50000 and the number of instances become zero. Total number of execute threads is 25. There are 8 managed servers in a physical machine.### Assistant: That sounds like a poison message problem. If a message in the queue cannot be delivered (for example invalid headers or unknown format) then the WMQ JMS classes will try to requeue it. First, they will look for a value in the BOQNAME and BOQTHRESH attributes of the queue. If these are present the message will be placed on the queue named in BOQNAME once the backout count exceeds BOQTHRESH. If there are problems requeuing to this queue then the message will be placed on the Dead Letter Queue. If this cannot be completed, the MDB stops receiving messages.There are several possible problems with requeueing messages:The BOQNAME queue or DLQ does not existThe requeue destination queue exists but the ID consuming messages has no authority to itThe requeue destination queue is fullNo value in BOQNAME or BOQTHRESHIf you do not already have a backout queue defined, define one and place its name in the BOQNAME attribute of the input queue. Next, place a value (often \"10\" is used) in the BOQTHRESH attribute of the input queue. Make sure the application consuming messages is authorized to the new backout queue and restart the application after making these changes. If the issue is a poison message, you should now see the poison message landing in the backout queue and the primary input queue should then drain normally.\n"} +{"text": "### Human: While trying to invoke a transfer using ANT script I received the below error :\"An internal error has occurred. Product failure data was captured in file \"FFDC.FTE.log\".\"\"Attempt to create a reply queue to receive the transfer result has failed.\"Can you please find what is the reason for this?com.ibm.wmqfte.wmqiface.WMQApiFailureException: \n cc=2 rc=2100 op=openTemporaryQueue - MQOPEN (Queue Manager: QUEUEK, \n Temporary Queue Model: SYSTEM.DEFAULT.MODEL.QUEUE, \n Dynamic Queue Prefix: REPLY., \n Open Options: 8196)### Assistant: The mnemonic for the error isMQRC=2100 MQRC_OBJECT_ALREADY_EXISTSwhich means that when the model queue was opened, the name that was resolved was to a queue that is already defined. There are a couple of possibilities here.First question is what queue manager were you connected to when the attempt to open the reply queue was made? If you were not connected to a QMgr calledQUEUEKthen the open will have resolved to the transmit queue that goes toQUEUEK, and which would already exist.Another possibility is thatSYSTEM.DEFULT.MODEL.QUEUEhas been set toDEFTYPE(PERMDYN)in which case the queues may not be deleted and, because there are a finite number of possible temporary queue names and the namespace would be constantly shrinking, a collision has occurred.The other possibility, which is a distant second to the first two, is that there's a bug in WMQ that caused a collision on the name of two temporary queues.In order to figure this out, it will be necessary to know which QMgr you are connecting to when this event occurs. Also,DIS Q(SYSTEM.DEFAULT.MODEL.QUEUEon that same QMgr. Then,DIS Q(REPLY*)to see how many permanent dynamic queues (if any) are laying about. Finally, look at the FDC file that was cut to find out the name of the dynamic queue and see if it exists in the output from the previous step. If after all of this you still do not have a root cause then it's time to open a support ticket with IBM.\n"} +{"text": "### Human: Does anyone know if BizTalk 2006 MQSeries adapter (server version) supports MQ 7.0 on W2k3? I know R2 does but none of the documentation specifically mentions it.### Assistant: From a purely WMQ perspective, the answer is \"yes.\" IBM has published asupport statementthat WMQ Server V7 is compatible with all previous WMQ clients. Assuming the BizTalk 2006 client is either bundling the IBM client or at least is compatible with it, then it should work fine.\n"} +{"text": "### Human: I have to substitute the letter \"A\" with letter \"C\" in the content of a txt file.Let test.txt be a txt file. The content is as follows:Ace AppleI need the content in the destination folder to be as :Cce Cpple.Is this possible in mqfte using ant tasks?### Assistant: The short answer is \"yes.\"The longer answer is that you can do anything with Ant that can be scripted, including calling other scripts. The approach would be to use a post-destination call that would edit the file after it arrives. This call won't fire if the file transfer fails. If the transfer succeeds the post-destination call does fire and will run your task or script to edit the file. Just remember that if you configure this to run as a monitor, it will fire on every file transfer. If you want to run it as an ad-hoc transfer you will need to submit it from the command line since the GUI does not support the pre/post calls.\n"} +{"text": "### Human: I need to create a custom stamp for the day of the week, which is to be appended to the filename.Suppose If it is sunday , the value of the stamp must be \"1\",\n same way if its monday the value of the stamp must be \"2\".Is this possible in MQFTE using Ant Script???### Assistant: You can't do this directly with standardTStamptask. That allows you to format your timestamp using patterns defined inSimpleDateFormat, and there is no format symbol for day of week as a number.I guess you could write a custom TStamp task.However, this works.Create a set of properties files, named using 3-letter day name:$ find daysOfWeek/\ndaysOfWeek/\ndaysOfWeek/Fri.properties\ndaysOfWeek/Mon.properties\ndaysOfWeek/Sat.properties\ndaysOfWeek/Sun.properties\ndaysOfWeek/Thu.properties\ndaysOfWeek/Tue.properties\ndaysOfWeek/Wed.propertiesIn each file, define a single property for the corresponding day number, e.g.$ cat daysOfWeek/Thu.properties\nday.num=5In your build script, first get a property matching today's day name, then load the corresponding properties file, then you can reference the day.num property.\n\n\n \n\n\n\n\n\n\n\nOutput today (Thursday) is$ ant\nBuildfile: build.xml\n [echo] Thu\n [echo] 5\n\nBUILD SUCCESSFUL\nTotal time: 0 seconds\n"} +{"text": "### Human: We use IBM WebSphere MQ for SWIFT messages. When a SWIFT message is received, it is processed and put into Local Queues as the processing goes on. Its like the follows :Outside World > Q1 > App > Q2 > App > Q3 > AppThe queues are local queues. But there has been considerable delay when the message reaches the Application from Q1/Q2/Q3 ... like days. And this happens arbitrarily. We have no clue as to why this is happening. Most of the messages get thru pretty quick but there are a couple of them in 3-4 days which arrive late.All this happens in a transaction and we use Atomikos as our Transaction Manager.Has anybody faced a similar issue before ? Any help is appreciated.Thanks,\nMidhun.### Assistant: There are a number of ways in which WebSphere MQ messages can be delayed and diagnosing may take a little detective work. Here are a few of the more common causes:Message stuck under syncpoint. Although it would be unusual for a message to sit under syncpoint for days, I've seen it happen. The issue is that some applications are designed to batch up several messages in a single transaction and when messages do not arrive in a batch multiple, the remainder of the messages sit and wait for another message(s) to arrive and close the batch.Message stuck under syncpoint. In another case, the program logic does not commit a syncpoint until the next message is read. When several threads are processing messages, distribution of load is not necessarily uniform across all threads and one can be starved for messages if the load is light.Message orphaned by browse. In this scenario, a message arrives at a higher priority than the current browse cursor. If the rescan interval is set extremely high and traffic volume also high, it may take a while before the browse cursor is reset to the top of the queue.Program error. You didn't mention which version of WMQ client and server you are using (hopefully both at 7.0!) but occasionally there are issues that cause threads to hang. These can tie up a message under syncpoint. It is always a good idea to go to thelatest FixPack for your versionand check the link called \"Problems fixed in...\" to see if an APAR addresses your specific issue. If so, apply the latest Fix Pack.To start diagnosing this, use theDIS QSTATUScommand to display the number of input and output handles on the queue, the message age and any outstanding units of work. You can also use the exit inSupportPac MA0Wto get a human-readable trace of all API calls on a given queue. This can be an extremely valuable diagnostic tool because you can tell exactly how long a message sat under syncpoint, whether it is being continuously backed out and re-read, what options are used for the API call, etc. You can even limit the trace to specific queues or specific threads which is helpful if you need to let it run for a while.\n"} +{"text": "### Human: When I run the following command on AIX 6.1 to build PyMQI 1.2:python setup.py build serverI get the following error:Building PyMQI server 32bitsrunning buildrunning build_pyrunning build_extbuilding 'pymqe' extensioncc_r -qlanglvl=extc89 -DNDEBUG -O3 -qstrict -qtune=pwr4 -qarch=pwr4 -qcpluscmt -D_LARGE_FILES -DPYQMI_SERVERBUILD=1 -I/usr/mqm/inc -I/opt/freeware/include/python2.6 -c pymqe.c -o build/temp.aix-6.1-2.6/pymqe.o\nunable to execute cc_r: No such file or directoryerror: command 'cc_r' failed with exit status 1How do I force the Python build scipt to use my GCC compiler instead of cc_r ?### Assistant: Thesetup.py buildcommand has the following two options--compiler (-c) specify the compiler type\n --help-compiler list available compilersUse those to specify the compiler which you want to use.\n"} +{"text": "### Human: I manage to retrieve one message from the given topic, but when I try to retrieve another one, it just fails, even though there are messages on the topic. The code is the same as IBM provided sample code, except thatdestForGet.Get(messageForGet);is in a while loop with some time to wait set in the options. Another client puts messages to the topic, and that works. The first message is received, but all others are not. The sample code snippet is given hereafter:// bool RunThread is managed from some other thread; irrelevant for this snippet\n// MQTopic destForGet is initialized earlier; irrelevant for this snippet\nMQMessage messageForGet = new MQMessage();\nMQGetMessageOptions mgo = new MQGetMessageOptions();\nmgo.Options = MQC.MQGMO_WAIT | MQC.MQGMO_FAIL_IF_QUIESCING | MQC.MQGMO_SYNCPOINT;\nmgo.WaitInterval = 500;\nstring subName = \"SampleSubscription\";\n\nwhile (RunThread)\n{\n try\n {\n DestForGet.Get(messageForGet, mgo);\n }\n catch (MQException mqE)\n {\n Console.WriteLine(\"MQException caught. \" + mqE.ToString());\n }\n}If I instantiate messageForGet within the while loop, then it works, but that seems to be very ineffective (to constantly allocate/deallocate memory). Also,messageForGet.ClearMessage()does not help in the matter. Is there a way to retrieve multiple messages from the topic, without instantiating each individual message?### Assistant: What do you mean by \"even though there are messages on the topic\"? Topics do not have depth. The closest MQ comes to having messages on the topic is the concept of a retained publication. This is where the last published message is retained so that it can be retrieved by a new subscriber. If you publish 10 messages and then subscribe, the behavior matches what you are describing - one message will be received.\n"} +{"text": "### Human: Hi I am new to IBM MQ. Here my requirement is to get the oldest MQMessage from the MQQueue regardless of priority they set and display it in JSP for some monitoring purpose. In the existing code,qMgr = new MQQueueManager(qManager);\n\n int openOptions = MQC.MQOO_INQUIRE | MQC.MQOO_BROWSE|MQC.MQOO_INPUT_SHARED;\n MQQueue eventQueue = qMgr.accessQueue(qName, openOptions, null, null, null);\n MQMessage retrievedMessage = new MQMessage(); \n MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.options = MQC.MQGMO_BROWSE_FIRST;\n eventQueue.get(retrievedMessage, gmo);Here i am able to get the MQMessage, but that may not be the oldest one in the queue. I have no idea about this. Please help me out is there any way to get that one.### Assistant: If the queue is FIFO then your browse will return the oldest message. But if the queue is set for priority delivery then you would have to browse the queue until you found the first message of the lowest priority. Your code snippet indicates this is an event queue. If that refers to the SYSTEM.*.EVENT queues then they should always be in FIFO mode. Even if an administrator changes them to priority delivery, all system event messages are produced at the same priority.The difficulty you face with priority-ordered messages is that you can ignore lower priorities but not higher priorities. For example, if you specify a priority of 5 on your browse and any messages exist at priority 4 or lower they will not be returned. But messages or higher priority will be returned and not just Priority 5 messages but rather Priority 9 messages followed by Priority 8 messages and so on. So you will not be able to selectively browse the first message in each priority but instead will be obliged to browse until you find the first Priority 0 message to know that you have seen the oldest message on the queue if the queue delivery order is set to Priority.It may be worthwhile to review the methods incom.ibm.mq.pcfto see how to inquire on the queue attributes. If the queue is FIFO, just browse the first message. If not, browse the length of the queue saving the first message you get from each priority, compare the timestamp to any message from a higher priority and discard the newer one.Please note that transactions will affect your ability to browse the messages. Any message held under syncpoint will be unavailable to your browse. The oldest message not under syncpoint will be returned.Finally, if you are trying to determine the health of the queueQueue Service Intervalevents orQStatusstatistics may provide what you need and avoid the overhead of browsing down deep queues.\n"} +{"text": "### Human: I am trying to unit test the MQ-Series implementation of my project, and need to mock the connection to the MQ-Series server to test my implementation isolated and avoid sending messages/retrieving messages from the actual queue.Here is the code:using IBM.WMQ;\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\nusing Moq;\n\nnamespace Test\n{\n [TestClass]\n public class MQTest\n {\n [TestMethod]\n public void SendMessage_MoqUnitTest()\n {\n //create a mock MQ manager\n var mqManMock = new Mock();\n\n //test by calling the send method\n MyMQhandler.MQSender mqsender = new MyMQhandler.MQSender();\n //error happens when trying to access the moq object here\n mqsender.Send(\"test message\", mqManMock.Object); \n }\n }\n}I am aware that I am not doing any setup on the moq yet, but the problem appears before any code is actually run against it.The problem is that when I do this I get an exception.\nStack trace from the inner exception with message \"I/O error occurred\":at IBM.WMQ.MQChannelTable.CreateChannelEntryLists(MQChannelListEntry nameList)\n at IBM.WMQ.Nmqi.ManagedNmqiMQ.CreateNameListEntryFromCCDT(String qMgrName, String ccdtFile)\n at IBM.WMQ.Nmqi.ManagedNmqiMQ.CreateNameListEntryFromCCDT(String qMgrName)\n at IBM.WMQ.Nmqi.ManagedNmqiMQ.GetNameList(String qMgrName)\n at IBM.WMQ.Nmqi.ManagedNmqiMQ.DoConn(String qMgrName, MQConnectOptions cno, ManagedHconn manHconn, Int32& hConn, Int32& compCode, Int32& reason)\n at IBM.WMQ.Nmqi.ManagedNmqiMQ.MQCONNX(String pQMgrName, MQConnectOptions pConnectOpts, Phconn phconn, Int32& pCompCode, Int32& pReason)\n at IBM.WMQ.MQQueueManager.Connect(String queueManagerName)\n at IBM.WMQ.MQQueueManager..ctor()\n at Castle.Proxies.MQQueueManagerProxy..ctor(IInterceptor[] )Most of the time I run it though I just get \"Function evaluation timed out\" og the MQManMock.Object.Does this mean that I can't mock the MQ??### Assistant: Looks like you are actually hitting the MQQueueManager.What you need to do it put the MQQueueManager behind your own interface (assuming the class itself doesn't already implement an interface) and use Mock to build that interface.so create an IMQQueueManager with a send method and in your implementation actually do the work with MQQueueManager your consuming classes should then have this interface passed into them usually by through the constructor in order to use the MQQueueManager.so you could write an implementation like thispublic interface IMQQueueManager \n{\n void Send(string message, MQManMock obj);\n}\n\npublic interface ConcreteMQQueueManager : IMQQueueManager\n{\n public void Send(string message, MQManMock obj)\n {\n //create a mock MQ manager\n var MQManMock = new MQQueueManager();\n\n //test by calling the send method\n MyMQhandler.MQSender mqsender = new MyMQhandler.MQSender();\n //error happens when trying to access the moq object here\n mqsender.Send(\"test message\", MQManMock.Object); \n }\n}then you would be writing your unit tests against the class belowpublic class myclass\n{\n\n IMQQueueManager _manager\n public myclass(IMQQueueManager queueManager)\n {\n _manager = queueManager;\n }\n\n public void AddItemToQueue(string MyItem)\n {\n\n _manager.Send(\"Hello\",MQManMock.Object);\n }\n\n}And using Moq to verify that send was called\n"} +{"text": "### Human: I configured a queue and a QueueConnectionFactory using the V5 Messaging provider in WebSphere Application Server 6.1.I also have aListenerPortconfigured for this destination.It throws an exception when I try to connect to this queue using the queue connection factory or when the Message Listener listening to this ListenerPort starts up.javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager \n for 'localhost:WAS_Node01_server1'and the nested exception iscom.ibm.mq.MQException: MQJE001: An MQException occurred: Completion Code 2, Reason 2059\nMQJE011: Socket connection attempt refusedCan someone please point me to what possibily could have gone wrong in configuring the queue and queue connection factory?### Assistant: The error indicates that the WebSphere MQ transport is being used. Per the clarification in your comments, no queue manager is present so a 2059 is expected. It will be necessary to configure a WAS messaging Engine to provide the native transport or to point to a queue manager.\n"} +{"text": "### Human: We use IBM MQ6.1. And use IBM API to send Messages to Queue.\nAs we need to send huge number of messages, was wondering if we can use multithreading and send messages to the same Queue.\nAny suggestions?### Assistant: Absolutely. You can have as many threads as memory and CPU will allow. Each thread requires it's own connection handle if you want to see a performance improvement. If you use a single connection handle, all GET and PUT activity from multiple threads is synchronized through the connection handle. If you use many connection handles, the GET and PUT activity can occur in parallel. Please seeMultithreaded programsin the WMQ Using Java manual for additional details.Just make sure that OS kernel settings like MAXUPROCS are set to allow WMQ to run sufficient threads to receive the connections and that WMQ settings likeMAXHANDSandMAXCHANNELSare bumped up to accommodate the load. Keep in mind that units of work are thread-scoped so each thread is independent of the others for syncpoint - for example, when you issue COMMIT inside a thread it only commits the messages put by that particular thread assuming it has a dedicated connection. The queues have an attribute forDEFSOPT(default share options) but this relates to how many input handles can be active. Even if you open the queue for exclusive input, you can have many threads writing to it.Also, v6.x of WMQ will be end-of-life as of September 2011. Start planning now to get to v7 to remain on a supported version. If you are using WMQ Client connections, upgrade the client as well as the QMgr. The v7 Client works fine with a v6 QMgr and can be upgraded independently. Of course it supports only the v6 functionality when used with a v6.x QMgr. You can download the v7 client asSupportPac MQC7.\n"} +{"text": "### Human: I am using .net client to post mesages to MQ server which is hosted on Unix. It is added some control character before the messages. Like below**^CD**The Queue connection is through SSL Table channel connection. \nThe code i am using isMQQueueManager queueManager = new MQQueueManager ; \nint openOptions = MQC.MQOO_OUTPUT + MQC.MQOO_BIND_NOT_FIXED + MQC.MQOO_FAIL_IF_QUIESCING; \nMQQueue Queue = queueManager.AccessQueue(\"TestQueue\", openOptions); \nMQMessage queueMessage = new MQMessage(); \nqueueMessage.WriteUTF(\"\"); \n\nMQPutMessageOptions MessageOptions = new MQPutMessageOptions(); \nQueue.Put(queueMessage, MessageOptions);please let me know what cause this special chars### Assistant: From IBM's owndocoonWriteUTF:This method takes an ActiveX string and writes it into the message data buffer at the current position in UTF format. The data writtenconsists of a 2-byte length followed by the character data. DataOffset is incremented by the length of the string if the method succeeds.If you don't want that length, consider usingWriteStringinstead (follow that doco link above and just go up a couple of lines in the navigation pane)..\n"} +{"text": "### Human: We are using security exits in WebsphereMQ 6.0 to provide security in java clients connecting to MQ and MQ - MQ connectivity. We use security exits to provide secure way to connect to Queue managers , Queue , channel.IS there any change in security mechanism in latest version so that we can completely avoid using security exits ?This is what our requirement/goal in MQ securityQueuemanagers should be only accessible with providing proper username and password (I know this is not possible in 6.0 without security exits )A legal user after authenticating queuemanager connection should be able to access only his queue / channel.Thanks### Assistant: Short answer - no.WMQ v7.0 made some significant changes to security such as adding topics as first-class WMQ objects that you can apply security to. However, authentication of remote connections in WMQ v7.0 uses the same mechanisms as in v6.0 which is SSL, exits or some combination of these. Although WMQ Explorer now has a place to put the user ID and password, the user ID is simply accepted by the QMgr at face value (same as in v6.0 and prior) and the password is ignored unless an exit is used to verify it.I should also mention that any time an ID and password are sent from a WMQ client to an exit on the server side for validation, there is nothing that protects the credentials in transmission by default. If using an exit pair, it is possible that the client side and server side exits could set up per-session encryption in which to send the credentials. More often though, a server-side-only exit is used in combination with SSL channels with a ciphersuite other than NULL_SHA or NULL_MD5. This provides for per-session protection of the credentials without requiring an exit pair.Some shops I've worked with used exits that encrypt the credentials using a static key and salt. While this method does prevent an eavesdropper from learning the actual password, the encrypted strings can simply be replayed in a new connections request so that level of security is worse than none at all - it gives theimpressionof security while not actually enhancing security.The real trick here is in getting the password validated. If an SSL certificate is sufficient, it is possible to use SSLPEER on the channel to filter by Distinguished Name or else use an exit to map the SSL certificate to a local user ID. This latter method is possible using the free BlockIP2 exit fromhttp://mrmq.dk(an IBMer runs the site but the exit code is community-maintained).\n"} +{"text": "### Human: I am in the process of testing MQ calls over the SSL. I woul like to know where i can get some demo SSL certificates. That i can use them for testing.I also would like to know if there any code sample which i can use to pass SSL kind of connection. The exaple i am looking is in C#### Assistant: You can use a self-signed certificate to test MQ connectivity. As far as example code goes, you can refer to the IBM docs. Both of the documents below have sections containing example code for connecting to a queue manager using ssl.XMS Message Service API(I don't believe that this is supported in MQ7 yet, but I may be wrong about that.)WebsphereMQ Classes for .NET\n"} +{"text": "### Human: I can get the event messages from the queue. I get the message properties. I am pretty sure the MQEVENT type is in PCF format but I cannot seem to find any good documentation on how to take that message and convet it into human readable format.AccountingTokenApplicationIdDataApplicationOriginDataBackoutCount 0BackoutCount 0CharacterSet 437CompletionCode 0CorrelationId System.Byte[]DataLength 236DataOffset 0Encoding 546Expiry -1Feedback 0Format MQEVENTGroupId System.Byte[]MessageFlags 0MessageId System.Byte[]MessageLength 236MessageSequenceNumber 1MessageType 8Offset 0OriginalLength -1Persistence 0Priority 0PutApplicationName NTPMFG01PutApplicationType 7PutDateTime 3/19/2010 10:29:08 PMReasonCode 0ReasonName MQRC_OKReplyToQueueManagerNameNTPMFG01ReplyToQueueNameReport 0TotalMessageLength 236UserIdVersion 1And here is the message.$ ? - ? ? ? ? D \u00af 0 MFG01 ? D - 0 MF\nG.CUST.CAT ? ? # \u00a4 ? ? $ ? ? ? % ? ? & ?### Assistant: if (myMQMessage.Format.CompareTo(MQC.MQFMT_EVENT) == 0)\nI think it needs to be processed twice.\nFirst process the PCF header with MQCFHBuildMQCFH(new IBM.WMQ.PCF.MQCFH(myMQMessage));\n\npublic void BuildMQCFH(IBM.WMQ.PCF.MQCFH eventMessageHeader) {\n int reasonForEvent = eventMessageHeader.Reason;\n}Then you MUST reset the DataOffset to 0myMQMessage.DataOffset = 0;Second process the PCF parameters with PCFParameter.\nBuildPcfMessage(new IBM.WMQ.PCF.PCFMessage(myMQMessage));public void BuildPcfMessage(IBM.WMQ.PCF.PCFMessage pcfMessage) {\n IBM.WMQ.PCF.PCFParameter[] pcfParameters = pcfMessage.GetParameters();\n afflictedQueueManager = pcfParameters[0].GetValue().ToString();\n afflictedQueue = pcfParameters[1].GetValue().ToString();\n}MQMessage, PCF.PCFMessage and MQCF each do a readbyte(s) moving the offset with out resetting afterwards.\n"} +{"text": "### Human: We are currently building an application that needs to communicate to some IBM WebSphere queues. At the other end of the queues there is another world. Due to some unknown circumstances (for me), connecting to the MQQueueManager takes 17 seconds every time, but sending and receiving messages afterwards through the queues is not a time consuming job. As we are placing now a web service in front of the WebSphere, we came up with the idea of decorating and caching the MQQueueManagers and the MQQueues and verifying before each message sending if they are connected, respectively open; if not, we try connecting to the MQQueueManager, repectively opening the MQQueue (once again, connectiong to the MQQueueManager takes 17 seconds, opening the MQQueue is \"instant\"). So we are expecting that every once in the while WebSphere would disconnect the MQQueueManager (I cannot tell for sure as we cannot heavily test this for now, but we should be cautious) and the unlucky calling program would wait 17 seconds to reconnect. As things stand now, we cannot predict the occurence of this thing to happen.\nOur current implementation uses the WebSphere MQ classes for .NET. Is there any possibility for us to receive a callback notification when the MQQueueManager gets disconnected or the associated queues are closed?### Assistant: Yes! If you use the latest WMQ .Net classes and the latestIA9H SupportPacyou get an asynchronous callback method. (This comes with .Net sample code showing how to register and use the callback.) It is my understanding that this method will pass your callback routine a message when one is available or else pass an exception to the registered exception listener if the connection is lost or queue is set toGET(DISABLED).Get the latest WMQ Clienthere. Look for SupportPacs with names like MQC*. The v8.0 client is MQC8, the v9 client is MQC9, etc.If you have an older version of .Net WMQ classes and can't upgrade for some reason you can always keep a separate thread open and periodically poll the queue. Don't poll too frequently, though. In the past I've seen people use a class variable as a countdown timer. Each time a message is successfully retrieved or put to the queue, the timer is reset to its max. When the timer reaches zero, poll the queue. This way you only poll the queue when no other traffic is on the connection.\n"} +{"text": "### Human: I am using spring 2.5.6 and spring-integration 1.0.3 and MQ client 6.0.2.2I have had to add a message selector to my message-driven-channel-adapter, but now I am getting the following error:MQJMS2008: failed to open MQ queue ; nested exception is com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2085It works when I used ActiveMQ as a test harness.My configuration:\n\n\n \n \n \n \nIf I revert to my previous configuration it's all good (except I don't have a message selector!)### Assistant: Ah!Where I hadI should have hadSkaffman was right, the queue didn't actually exist.P\n"} +{"text": "### Human: I have an IBM WebSphere MQ queue (running on Windows) containing many items of varying priority.I currently get a total depth count usingmqQueue.CurrentDepthbut I'd like to get a count of the number of items of each priority level within the queue.Any idea how to achieve this?### Assistant: You could use a JMS QueueBrowser to browse the messages in the queue and build up totals for each priority levels.QueueBrowser browser = session.createBrowser(someQueue);\nfor (Enumeration iter = browser.getEnumeration(); iter.hasMoreElements()) {\n Message message = (Message) iter.nextElement();\n int priority = message.getJMSPriority();\n // update counters...\n}\n"} +{"text": "### Human: This question's answers are acommunity effort. Edit existing answers to improve this post. It is not currently accepting new answers or interactions.What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?### Assistant: There are two overarching types of variables in Java:Primitives: variables that contain data. If you want to manipulate the data in a primitive variable you can manipulate that variable directly. By convention primitive types start with a lowercase letter. For example variables of typeintorcharare primitives.References: variables that contain the memory address of anObjecti.e. variables thatreferto anObject. If you want to manipulate theObjectthat a reference variable refers to you mustdereferenceit. Dereferencing usually entails using.to access a method or field, or using[to index an array. By convention reference types are usually denoted with a type that starts in uppercase. For example variables of typeObjectare references.Consider the following code where you declare a variable ofprimitivetypeintand don't initialize it:int x;\nint y = x + x;These two lines will crash the program because no value is specified forxand we are trying to usex's value to specifyy. All primitives have to be initialized to a usable value before they are manipulated.Now here is where things get interesting.Referencevariables can be set tonullwhich means \"I am referencingnothing\". You can get anullvalue in a reference variable if you explicitly set it that way, or a reference variable is uninitialized and the compiler does not catch it (Java will automatically set the variable tonull).If a reference variable is set to null either explicitly by you or through Java automatically, and you attempt todereferenceit you get aNullPointerException.TheNullPointerException(NPE) typically occurs when you declare a variable but did not create an object and assign it to the variable before trying to use the contents of the variable. So you have a reference to something that does not actually exist.Take the following code:Integer num;\nnum = new Integer(10);The first line declares a variable namednum, but it does not actually contain a reference value yet. Since you have not yet said what to point to, Java sets it tonull.In the second line, thenewkeyword is used to instantiate (or create) an object of typeInteger, and the reference variablenumis assigned to thatIntegerobject.If you attempt to dereferencenumbeforecreating the object you get aNullPointerException. In the most trivial cases, the compiler will catch the problem and let you know that \"num may not have been initialized,\" but sometimes you may write code that does not directly create the object.For instance, you may have a method as follows:public void doSomething(SomeObject obj) {\n // Do something to obj, assumes obj is not null\n obj.myMethod();\n}In which case, you are not creating the objectobj, but rather assuming that it was created before thedoSomething()method was called. Note, it is possible to call the method like this:doSomething(null);In which case,objisnull, and the statementobj.myMethod()will throw aNullPointerException.If the method is intended to do something to the passed-in object as the above method does, it is appropriate to throw theNullPointerExceptionbecause it's a programmer error and the programmer will need that information for debugging purposes.In addition toNullPointerExceptions thrown as a result of the method's logic, you can also check the method arguments fornullvalues and throw NPEs explicitly by adding something like the following near the beginning of a method:// Throws an NPE with a custom error message if obj is null\nObjects.requireNonNull(obj, \"obj must not be null\");Note that it's helpful to say in your error message clearlywhichobject cannot benull. The advantage of validating this is that 1) you can return your own clearer error messages and 2) for the rest of the method you know that unlessobjis reassigned, it is not null and can be dereferenced safely.Alternatively, there may be cases where the purpose of the method is not solely to operate on the passed in object, and therefore a null parameter may be acceptable. In this case, you would need to check for anull parameterand behave differently. You should also explain this in the documentation. For example,doSomething()could be written as:/**\n * @param obj An optional foo for ____. May be null, in which case\n * the result will be ____.\n */\npublic void doSomething(SomeObject obj) {\n if(obj == null) {\n // Do something\n } else {\n // Do something else\n }\n}Finally,How to pinpoint the exception & cause using Stack TraceWhat methods/tools can be used to determine the cause so that you stop\nthe exception from causing the program to terminate prematurely?Sonar with find bugs can detect NPE.Can sonar catch null pointer exceptions caused by JVM DynamicallyNow Java 14 has added a new language feature to show the root cause of NullPointerException. This language feature has been part of SAP commercial JVM since 2006.In Java 14, the following is a sample NullPointerException Exception message:in thread \"main\" java.lang.NullPointerException: Cannot invoke \"java.util.List.size()\" because \"list\" is nullList of situations that cause aNullPointerExceptionto occurHere are all the situations in which aNullPointerExceptionoccurs, that are directly* mentioned by the Java Language Specification:Accessing (i.e. getting or setting) aninstancefield of a null reference. (static fields don't count!)Calling aninstancemethod of a null reference. (static methods don't count!)throw null;Accessing elements of a null array.Synchronising on null -synchronized (someNullReference) { ... }Any integer/floating point operator can throw aNullPointerExceptionif one of its operands is a boxed null referenceAn unboxing conversion throws aNullPointerExceptionif the boxed value is null.Callingsuperon a null reference throws aNullPointerException. If you are confused, this is talking about qualified superclass constructor invocations:class Outer {\n class Inner {}\n}\nclass ChildOfInner extends Outer.Inner {\n ChildOfInner(Outer o) { \n o.super(); // if o is null, NPE gets thrown\n }\n}Using afor (element : iterable)loop to loop through a null collection/array.switch (foo) { ... }(whether its an expression or statement) can throw aNullPointerExceptionwhenfoois null.foo.new SomeInnerClass()throws aNullPointerExceptionwhenfoois null.Method references of the formname1::name2orprimaryExpression::namethrows aNullPointerExceptionwhen evaluated whenname1orprimaryExpressionevaluates to null.a note from the JLS here says that,someInstance.someStaticMethod()doesn't throw an NPE, becausesomeStaticMethodis static, butsomeInstance::someStaticMethodstill throw an NPE!* Note that the JLS probably also says a lot about NPEsindirectly.\n"} +{"text": "### Human: Where should I set MQMD message context in client WebsphereMQ?MQQueueConnectionFactory mqConnectionFactory = new MQQueueConnectionFactory();\nmqConnectionFactory.setHostName(producerProperties.getProperty(\"wmq.host\"));\nmqConnectionFactory.setPort(Integer.valueOf(producerProperties.getProperty(\"wmq.port\")));\nmqConnectionFactory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);\nmqConnectionFactory.setQueueManager(producerProperties.getProperty(\"wmq.manager\"));\nmqConnectionFactory.setChannel(\"MyChannel\");\n\n/**\n * Producer Section\n */\n// Getting producer connection from the MQ server and starting it\nConnection producerConnection = mqConnectionFactory.createConnection();\nSystem.out.println(\"Going to start the producer connection...\");\nproducerConnection.start();\n\n// JMS messages are sent and received using a Session.\nSession producerSession = producerConnection.createSession(false,\n Session.AUTO_ACKNOWLEDGE);\n// Destination represents here our queue(testQ) on the MQ server.\nDestination producerDestination = producerSession.createQueue(producerProperties.getProperty(\"wmq.queue.name\"));\n\n// MessageProducer is used for sending messages\nMessageProducer producer = producerSession.createProducer(producerDestination1);\n//create text message going to send\n\nTextMessage sendingMessage = producerSession.createTextMessage(\"Hi Welcome\");\nsendingMessage.setJMSType(queueName);\nSystem.out.println(\"Sending the message...\");\n\n\n\n//sending the message\nproducer.send(sendingMessage);### Assistant: See the sample program. If you installed to the default location on Windows, it's at:\"C:\\Program Files (x86)\\IBM\\WebSphere MQ\\tools\\jms\\samples\\simple\\SimpleMQMDWrite.java\"Or on *NIX platforms at:/opt/mqm/samp/jms/samples/simple/SimpleMQMDWrite.java\n"} +{"text": "### Human: My application communicates with another system via IBM Websphere MQ. Sometimes no message comes into my queue but the other system said They already sent to me. So I want to know how to keep a history for all messages that arriving on my queue.### Assistant: The only other way I can think of would be to use a channel exit.\n"} +{"text": "### Human: I am accessing anMQ8server using HermesJms.The latter has the following configuration:However, when I am trying to \"Discover\" via the relevant option provided by Hermes, I get an2035with the following message appearing on the queue manager error logs:AMQ9557: Queue Manager User ID initialization failed for 'pkaramol'.\n\nEXPLANATION:\nThe call to initialize the User ID 'pkaramol' failed with CompCode 2 and Reason\n2035.Note thatpkaramolis my local OS user I am logged in as, in the linux machine running Hermes.Questions:1) Why I get the following error despite the fact that I have disabled bothCHLAUTHandCONNAUTH:ALTER QMGR CHLAUTH(DISABLED) CONNAUTH(' ')\n\nREFRESH SECURITY TYPE(CONNAUTH)2) Why is the server perceivingpkaramolas the user trying to access the queue manager, although I am explicitly providingmquserin bothClientIDanduserfields of HermesJMS?### Assistant: I cannot find much documentation on HermesJMS, but through some trial and error I found out that it does not honor theUserandPasswordsettings if you click Discover, it will always send the user you are logged in as to the queue manager, this is why you do not see the usermquser. Because you are running it as the userpkaramolwhich does not exist on the server where your queue manager is running you receive the following error:AMQ9557: Queue Manager User ID initialization failed for 'pkaramol'.I also found that to perform the discover it opens a temporary dynamic queue using the model queueSYSTEM.DEFAULT.MODEL.QUEUEand puts PCF messages to theSYSTEM.ADMIN.COMMAND.QUEUE. In addition for it to discover any queue details you must have at minimum+inqand+dspon the queues.In your comment you stated you added the userpkaramolto the server and put it in themqmgroup. While this is a quick way to get this to work, it does provide that user full MQ Admin access. You could provide your actual user with the following permissions and still be able to Discover all of the objects on the queue manager. Please replace the wordgroupbelow with a group your user is a member of on the server:setmqaut -m DMSQM -t qmgr -g group +connect +inq +dsp\nsetmqaut -m DMSQM -n SYSTEM.ADMIN.COMMAND.QUEUE -t queue -g group +inq +put +dsp\nsetmqaut -m DMSQM -n SYSTEM.DEFAULT.MODEL.QUEUE -t queue -g group +get +dsp\nsetmqaut -m DMSQM -n '**' -t queue -g group +inq +dspI also noted that once you have queues populated either through Discover or manually adding them, it will use the User that you specified.Note that withCHLAUTHandCONNAUTHdisabled the queue manager is taking whatever user is presented and using it. You could leaveCONNAUTHenabled and specify a valid user and password and MQ would authenticate it.Another option since Discover does not honor the User setting would be to set aMCAUSERon the SVRCONN channel ofmquser.\n"} +{"text": "### Human: I am using IBM Websphere MQ. I have the queue manager and queue name. Now, I want to check whether the queue has any messages in it?I did not work on this before. Pleas helpPlease let me know if you need further information!Thanks### Assistant: The below code is .NET / amqmdnet - but you might try and convert this in the meantime until a Java dev sees your post.To see if there is a message on the queue, without actually taking it off the queue, useMQC.MQOO_BROWSEon the Queue andIBM.WMQ.MQC.MQGMO_BROWSE_FIRSTas the option\nYou'll getMQRC_NO_MSG_AVAILABLEif the queue is empty.MQMessage queueMessage = new MQMessage();\n\nMQQueueManager queueManager = new MQQueueManager(qmName, channelName, connName);\nMQQueuequeue = queueManager.AccessQueue(qName, \n MQC.MQOO_BROWSE + MQC.MQOO_FAIL_IF_QUIESCING);\n\nMQGetMessageOptions opt = new MQGetMessageOptions();\nopt.Options = IBM.WMQ.MQC.MQGMO_BROWSE_FIRST;\nqueueMessage.CorrelationId = IBM.WMQ.MQC.MQMI_NONE;\nqueueMessage.MessageId = IBM.WMQ.MQC.MQMI_NONE;\nqueue.Get(queueMessage, opt);\nString sMessage = queueMessage.ReadString(queueMessage.DataLength);To peek the next message useIBM.WMQ.MQC.MQGMO_BROWSE_NEXT;To actually read the message OFF the queue, useMQC.MQOO_INPUT_SHAREDon the AccessQueue.\n"} +{"text": "### Human: I am connecting to an IBM Websphere MQ server in my .Net code and I wanted to make sure that I am following best practice when using \"finally\".I currently have the below code block which I believe can be modified to just have the close portion in the finally clause. Is that correct? (I am catching errors in the calling portion of the application).Hashtable properties = new Hashtable();\n properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);\n properties.Add(MQC.CHANNEL_PROPERTY, channel);\n properties.Add(MQC.HOST_NAME_PROPERTY, host);\n properties.Add(MQC.PORT_PROPERTY, port);\n\n MQQueueManager qmgr = new MQQueueManager(queueManager, properties);\n\n try\n {\n var queueDepth = qmgr.AccessQueue(userQueue,\n MQC.MQOO_INPUT_AS_Q_DEF +\n MQC.MQOO_FAIL_IF_QUIESCING +\n MQC.MQOO_INQUIRE).CurrentDepth;\n if (qmgr.IsOpen)\n qmgr.Close();\n\n return queueDepth;\n }\n finally\n {\n if (qmgr.IsOpen)\n qmgr.Close();\n }Is now thisHashtable properties = new Hashtable();\n properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);\n properties.Add(MQC.CHANNEL_PROPERTY, channel);\n properties.Add(MQC.HOST_NAME_PROPERTY, host);\n properties.Add(MQC.PORT_PROPERTY, port);\n\n MQQueueManager qmgr = new MQQueueManager(queueManager, properties);\n\n try\n {\n var queueDepth = qmgr.AccessQueue(userQueue,\n MQC.MQOO_INPUT_AS_Q_DEF +\n MQC.MQOO_FAIL_IF_QUIESCING +\n MQC.MQOO_INQUIRE).CurrentDepth;\n\n return queueDepth;\n }\n finally\n {\n if (qmgr.IsOpen)\n qmgr.Close();\n }EDIT:Renan made a good suggestion. I didn't think the MQQueueManger was disposable. Sounds like I could potentially do this:using(MQQueueManager qmgr = new MQQueueManager(queueManager, properties))\n {\n var queueDepth = qmgr.AccessQueue(userQueue,\n MQC.MQOO_INPUT_AS_Q_DEF +\n MQC.MQOO_FAIL_IF_QUIESCING +\n MQC.MQOO_INQUIRE).CurrentDepth;\n\n return queueDepth;\n }Edit:I did some research after reading Renan's suggestion and found the below. Sounds like they did in fact make it disposable.MQ.Net### Assistant: You are right. The finally clause will execute even if the code in the try block returns an exception.You could also use the \"using\" construct for the connection (if it implements IDisposable, which it should).using(qmgr){\n //do stuff\n}\n"} +{"text": "### Human: I have the MQConsumerClass that retrieves the messages from the queue as follows.while (running)\n{\n try\n {\n MQMessage rcvMessage = new MQMessage();\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n\n gmo.options = MQConstants.MQGMO_WAIT;\n gmo.waitInterval = 60000; \n queue.get(rcvMessage, gmo);\n\n if(rcvMessage.getTotalMessageLength() > 0)\n {\n String msgText = rcvMessage.readUTF();\n }\n }\n catch blocks{}\n}But the problem is when there is no message in the queue, the 2033 exception is thrown.I think 2033 NO_MSG_AVAILABLE exception is NOT serious exception that probably can stop the operation.However, I want to callonMessage(Message msg)function whenever there is a new message in the queue.I want to create this class with MessageListener but I cannot find MessageListener or any example related to it.So, please tell me if there is any MessageListener function in WMQ Java API.orany way to do this?### Assistant: The 2033 'error' is really not an error, it is more of an MQSeries return status: MQRC_NO_MSG_AVAILABLE 2033 The MQTester program is polling a queue looking for a message, but there are no messages available.You can exclude it withMQException.logExclude(new\n Integer(MQException.MQRC_NO_MSG_AVAILABLE));\n"} +{"text": "### Human: I am working on reading large MQ messages in Java and processing + writing the contents of MQ message to a file.The code I am writing is multi-threaded and can process multiple messages in parallel.The writing application writes (PUT) large MQ message to the queue using Segmentation+Grouping.Now, while reading below steps take place.Set appropriate values for MQGetMessageOptions.MQGetMessageOptions getGroupMsgOptions = new MQGetMessageOptions();\ngetGroupMsgOptions.options = MQC.MQGMO_LOGICAL_ORDER | MQC.MQGMO_SYNCPOINT \n| MQC.MQGMO_ALL_MSGS_AVAILABLE | MQC.MQGMO_COMPLETE_MSG;Initializing MQQueue - serverFileQueue and MQMessage - reqMessage.Invoking get method for MQQueue by passing reqMessage and getGroupMsgOptions.serverFileQueue.get(reqMessage, getGroupMsgOptions);Checking the MQ message flags in a while loop to identify last segment of last message in group.Write the message contents to a file using BufferedOutputStream.My question is, if the MQ message is too large, should the code be gettingjava.lang.OutOfMemoryError?I am trying to understand if step 3serverFileQueue.get(...)would load entire MQ Message in memory?OR only segments would be loaded hence no need to worry aboutjava.lang.OutOfMemoryError?### Assistant: The message will be retrieved in segments,so you need not worry about the OutofMemory error.But each segment should be a separate MQGET Call and you have to use the GroupStatus and SegmentStatus properties of MQGMO for retrieving all the segments of the message.\n"} +{"text": "### Human: I was try to send message to the MQ Server using the MQ ClientThe error is:- A WebSphere MQ Error occurred : Completion Code 2 Reason Code 2058.I know this reason code because of the wrong Queue Manager Name..But the Queue Manager Name is correct...After installed the WebSphere MQ Client I just run the command:\nSET MQSERVER=QM_ORANGE/TCP/IPADDRESS(PORT NUMBER)and run this program\n public class MQSample {// code identifier\n static final String sccsid = \"@(#) MQMBID sn=p750-002-131001_DE su=_FswqMCqGEeOZ3ui-rZDONA pn=MQJavaSamples/wmqjava/MQSample.java\";\n\n // define the name of the QueueManager\n private static final String qManager = \"QM_ORANGE\";\n // and define the name of the Queue\n private static final String qName = \"Q1\";\n\n /**\n * Main entry point\n * \n * @param args - command line arguments (ignored)\n */\n public static void main(String args[]) {\n try {\n // Create a connection to the QueueManager\n System.out.println(\"Connecting to queue manager: \" + qManager);\n MQQueueManager qMgr = new MQQueueManager(qManager);\n\n // Set up the options on the queue we wish to open\n //int openOptions = MQConstants.MQOO_INPUT_AS_Q_DEF | MQConstants.MQOO_OUTPUT;\n int openOptions = MQConstants.MQOO_OUTPUT;\n // int openOptions1 = MQConstants.MQOO_INPUT_AS_Q_DEF;\n // Now specify the queue that we wish to open and the open options\n System.out.println(\"Accessing queue: \" + qName);\n MQQueue queue = qMgr.accessQueue(qName, openOptions);\n //MQQueue queue1 = qMgr.accessQueue(qName, openOptions1);\n // Define a simple WebSphere MQ Message ...\n MQMessage msg = new MQMessage();\n // ... and write some text in UTF8 format\n msg.writeUTF(\"Hello, World!\");\n\n // Specify the default put message options\n MQPutMessageOptions pmo = new MQPutMessageOptions();\n\n // Put the message to the queue\n System.out.println(\"Sending a message...\");\n queue.put(msg, pmo);\n\n\n //\n\n\n\n openOptions = MQC.MQOO_INQUIRE + MQC.MQOO_FAIL_IF_QUIESCING\n + MQC.MQOO_INPUT_SHARED;\n\n queue = qMgr.accessQueue(\"QM_APPLE\", openOptions,\n null, // default q manager\n null, // no dynamic q name\n null); // no alternate user id\n\n System.out.println(\"MQRead v1.0 connected.\\n\");\n\n int depth = queue.getCurrentDepth();\n System.out.println(\"Current depth: \" + depth + \"\\n\");\n if (depth == 0) {\n return;\n }\n\n MQGetMessageOptions getOptions = new MQGetMessageOptions();\n getOptions.options = MQC.MQGMO_NO_WAIT + MQC.MQGMO_FAIL_IF_QUIESCING\n + MQC.MQGMO_CONVERT;\n while (true) {\n\n MQMessage message = new MQMessage();\n try {\n queue.get(message, getOptions);\n\n byte[] b = new byte[message.getMessageLength()];\n message.readFully(b);\n System.out.println(new String(b));\n message.clearMessage();\n } catch (IOException e) {\n System.out.println(\"IOException during GET: \" + e.getMessage());\n break;\n } catch (MQException e) {\n if (e.completionCode == 2\n && e.reasonCode == MQException.MQRC_NO_MSG_AVAILABLE) {\n if (depth > 0) {\n System.out.println(\"All messages read.\");\n }\n } else {\n System.out.println(\"GET Exception: \" + e);\n }\n break;\n }\n }\n queue.close();\n //_queueManager.disconnect();\n\n // Disconnect from the QueueManager\n System.out.println(\"Disconnecting from the Queue Manager\");\n qMgr.disconnect();\n System.out.println(\"Done!\");\n }\n catch (MQException ex) {\n System.out.println(\"A WebSphere MQ Error occured : Completion Code \" + ex.completionCode\n + \" Reason Code \" + ex.reasonCode);\n ex.printStackTrace();\n for (Throwable t = ex.getCause(); t != null; t = t.getCause()) {\n System.out.println(\"... Caused by \");\n t.printStackTrace();\n }\n\n }\n catch (java.io.IOException ex) {\n System.out.println(\"An IOException occured whilst writing to the message buffer: \" + ex);\n }\n return;\n }\n}### Assistant: You have set theMQSERVERenvironment variable.MQ C Clientunderstands this environment variable and accordingly connects to queue manager running on the machine specified in IP address. MQ Java does not behave in the same way.In your application you have specified just the queue manager name inMQQueueManagerconstructor. This mean application wants to connect to queue manager running on the same machine via server bindings connection.You could do as below to connect to queue manager: (change the host, port, channel and queue manager name). Note the sample is written with MQ v8 Java client.Hashtable properties = new Hashtable();\n properties.put(MQConstants.HOST_NAME_PROPERTY, \"qm.mycomp.com\");\n properties.put(MQConstants.PORT_PROPERTY, 1414); \n properties.put(MQConstants.CHANNEL_PROPERTY, \"APP.SVRCONN\"); \n properties.put(MQConstants.USE_MQCSP_AUTHENTICATION_PROPERTY,\"true\");\n properties.put(MQConstants.USER_ID_PROPERTY, \"myuserid\");\n properties.put(MQConstants.PASSWORD_PROPERTY, \"passw0rd\");\n\n /**\n * Connect to a queue manager \n */\n MQQueueManager queueManager = new MQQueueManager(\"QM\", properties);UpdateSo you don't want to hard code connection parameters in your program? You can use the MQSERVER environment variable it self, get it, parse it and the connection parameters. You can also use a configuration file or a LDAP server to pull the connection information.Update IIYou have not read the MQ documentation at all. MQ Client is a set of libraries/jars/.net assemblies etc which expose APIs in different languages. You develop application using these APIs to communicate with queue manager. That is what you have done in your program above. Without these libraries you can't connect to a queue manager (many people think queue manager as server). When your application runs on the same machine as the queue manager, it is possible to communicate with queue manager over shared memory. But when running on different machine the communication is over TCP/IP (or SNA).Hope this clears the confusion.\n"} +{"text": "### Human: We are trying to use IBM MQ manager as XA Transaction manager with spring-jms and spring transaction support. \nDoes IBM MQ manager play well with spring-jta support?### Assistant: You can't use the WMQ JMS client (which is what spring-jms would use) with the MQ QueueManager acting as the XA transaction manager. The intention is that a JMS application would be controlled via a JTA implemented transaction manager (i.e. a Java EE application server).You can however use the WMQ Java client (i.e. non JMS) and have the MQ QueueManager act as the XA transaction manager (non JTA).As @COLINHY said you can use it the other way around. The Spring transaction manager will be the coordinator using JTA and the spring-jms can then be used to bring in the WMQ JMS client and MQ Queue Manager as a transactional resource.\n"} +{"text": "### Human: I am currently using a IBM MQ Advanced for Developers server for testing our client and was able to achieve around 1000 messages per second using the sample consumer written in jms, which seems to be pretty slow. Is this a limit for dev server, and if yes that what throughput can be achieved using a licensed production IBM MQ server.### Assistant: There is no artificial limit associated with IBM MQ Advanced for Developers. It is the same as the licensed production version of IBM MQ.You don't say what type of machine you were using, what persistence your messages were, what size they were, or any other qualifying criteria.You say client, but I don't know whether you mean \"network attached application\" or \"driving application\". Clearly if your program is running \"client-attached\" (MQ parlance for network attached), then the network performance will also come into this.On my Windows laptop, I get 4500 non-persistent msgs/sec, or 2000 persistent msgs/sec using a simple C-language locally bound program. Over client connection (just using localhost, not actually going out over a real network connection) I get 2700 non-persistent msgs/sec, or 1500 persistent msgs/sec.You should read theMQ Performance Reportsfor details of the expected rates you can get.\n"} +{"text": "### Human: Following thisexampleof sending messages to queue let's look at the part of setting connection factory propertiescf.setStringProperty(WMQConstants.WMQ_HOST_NAME, HOST);\n cf.setIntProperty(WMQConstants.WMQ_PORT, PORT);\n cf.setStringProperty(WMQConstants.WMQ_CHANNEL, CHANNEL);\n cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\n cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, QMGR);\n cf.setStringProperty(WMQConstants.WMQ_APPLICATIONNAME, \"JmsPutGet (JMS)\");\n cf.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, true);\n cf.setStringProperty(WMQConstants.USERID, APP_USER);\n cf.setStringProperty(WMQConstants.PASSWORD, APP_PASSWORD);When the linecf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, QMGR);is removed then nothing changes: the client still can successfully send and receive messages.What is the purpose of settingWMQConstants.WMQ_QUEUE_MANAGERproperty here?IBM MQ server is a container based on this Dockefile:FROM ibmcom/mq:9.2.2.0-r1\n\nENV LICENSE=accept\nENV MQ_DEV=true\nENV MQ_APP_PASSWORD=app-password\nENV MQ_ADMIN_PASSWORD=admin-pwd\nENV MQ_QMGR_NAME=KUPOL_DEV_QMAdditionally:In the same example we see the linedestination = context.createQueue(\"queue:///\" + QUEUE_NAME)and it does not break the app if the prefix\"queue:///\"is removed, leaving the line asdestination = context.createQueue(QUEUE_NAME).And I see similar things in multiple examples for IBM MQ across the web.What is going on with this code? Is it blind copy-pasting or is there an intention?### Assistant: If you leave queue manager unset or specify a value that is prefixed with a*you can connect to any queue manager name listening on the host and port you specify.If you specify a queue manager name that is not prefixed with a*then it must match the name of the queue manager listening on the host and port.You can also use a CCDT to hold the the connection details, in this case (in addition to the above points) the queue manager name you specify is used to look up the connection details in the CCDT. If it is prefixed with a*it will look up the name without the*in the CCDT.In addition to specifying queue names with thequeue:///prefix, you can also specify topics with the prefixtopic:///, my guess iscreateQueuedefaults to assume you are specifying a queue name.\n"} +{"text": "### Human: I have some example C code that I'm looking to adapt to suit my needs. Before then I'm trying to compile the example as it is. The C code contains a #include reference, and I can find the .h file in an 'inc' directory. There is also a corresponding 'lib' directory. I am struggling to find the command line I need to compile the code.So far I've managed to get to the following;gcc -o amqsinqa -I/opt/mqm/inc amqsinqa.c -L/opt/mqm/lib -lcmqcBut it 'cannot find -lcmqc'. I've looked in lib and quite correctly there is no cmqc. How do I determine what -l option I need here?The code looks fairly simple, there is the include reference;#include And the call itself;MQCONN(QMgrName,&Hcon,&CompCode,&CReason);If I omit the -l option from the command line I get;undefined reference to 'MQCONN'Which isn't a surprise. MQCONN is present in cmqc.h though.### Assistant: To try to help others, this reference is useful:64 bit apps:https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.1.0/com.ibm.mq.dev.doc/q028490_.htm32 bit apps:https://www.ibm.com/support/knowledgecenter/SSFKSJ_9.1.0/com.ibm.mq.dev.doc/q028480_.htmIn summary:-Iis for the product includes, which are (For Linux) usually in/opt/mqm/inc-Lis the path to the libraries in your example which are (For Linux) usually in/opt/mqm/lib(for 32 bit applications) and/opt/mqm/lib64(for 64 bit\napplications)-l(lower case L) is for the required library/libraries,and the actual library you need is either:mqm- server bound C applications (ie-lmqm, which links withlibmqm.so)mqic- client bound C applications (ie-lmqic, which links withlibmqic.so).. and a suffix of_rif you are building as a threaded application (ie you are linking with-lpthreadas well, ie providing-lmqm_ror-lmqic_rwhich in effect links withlibmqm_r.soorlibmqic.so)cmqc.his the name of the main header file, and there are othercmq*.hheaders you can optionally include as well.If you are using the (stabilized) C++ libraries there's other libraries to include on the command line but that's outside the scope for this answer - see the referenced links\n"} +{"text": "### Human: In our queue manager we have IBM MQ V7.0.1.3 is running.\nNow we need to install IBM MQ V8.0 as a second installation on the same queue manager where IBM MQ V7.0.1.3 is running. Both the product versions need to exist.\nHow can we ensure both versions will run without impacting each other?### Assistant: we have IBM MQ V7.0.1.3 is running.You do realize that MQ v7.0 is long out of support. Secondly, you need to be at a minimum of 7.0.1.6 for support for multi-install.Finally, the only supported versions (as of right now) of IBM MQ are v7.5, v8.0 and v9.0. See here for more information on end of service dates:http://www.capitalware.com/rl_blog/?p=4279\n"} +{"text": "### Human: This question already has answers here:java.lang.UnsatisfiedLinkError(6 answers)Closed6 years ago.I am tring to connect to IBM websphere Client with a Java Programme\nthe Following are the code:=import com.ibm.mq.MQException;\nimport com.ibm.mq.MQGetMessageOptions;\nimport com.ibm.mq.MQMessage;\nimport com.ibm.mq.MQPutMessageOptions;\nimport com.ibm.mq.MQQueue;\nimport com.ibm.mq.MQQueueManager;\n\n\n/**\n * Simple example program\n */\npublic class MQSample {\n\n // code identifier\n static final String sccsid = \"@(#) MQMBID sn=p750-002-131001_DE su=_FswqMCqGEeOZ3ui-rZDONA pn=MQJavaSamples/wmqjava/MQSample.java\";\n\n // define the name of the QueueManager\n private static final String qManager = \"QM_ORANGE\";\n // and define the name of the Queue\n private static final String qName = \"SYSTEM.DEFAULT.LOCAL.QUEUE\";\n // private static final String qName = \"QM_APPLE\";\n\n\n public static void main(String args[]) {\n try {\n\n System.out.println(\"Connecting to queue manager: \" + qManager);\n MQQueueManager qMgr = new MQQueueManager(qManager);\n int openOptions =1| 16;\n System.out.println(\"Accessing queue: \" + qName);\n MQQueue queue = qMgr.accessQueue(qName, openOptions);\n\n MQMessage msg = new MQMessage();\n msg.writeUTF(\"Hello, World!\");\n MQPutMessageOptions pmo = new MQPutMessageOptions();\n System.out.println(\"Sending a message...\");\n queue.put(msg, pmo);\n\n // Now get the message back again. First define a WebSphere MQ\n // message\n // to receive the data\n // MQMessage rcvMessage = new MQMessage();\n\n // Specify default get message options\n // MQGetMessageOptions gmo = new MQGetMessageOptions();\n\n // Get the message off the queue.\n // System.out.println(\"...and getting the message back again\");\n // queue.get(rcvMessage, gmo);\n\n // And display the message text...\n //String msgText = rcvMessage.readUTF();\n // System.out.println(\"The message is: \" + msgText);\n\n // Close the queue\n System.out.println(\"Closing the queue\");\n queue.close();\n\n // Disconnect from the QueueManager\n System.out.println(\"Disconnecting from the Queue Manager\");\n qMgr.disconnect();\n System.out.println(\"Done!\");\n }\n catch (MQException ex) {\n System.out.println(\"A WebSphere MQ Error occured : Completion Code \" + ex.completionCode\n + \" Reason Code \" + ex.reasonCode);\n ex.printStackTrace();\n for (Throwable t = ex.getCause(); t != null; t = t.getCause()) {\n System.out.println(\"... Caused by \");\n t.printStackTrace();\n }\n\n }\n catch (java.io.IOException ex) {\n System.out.println(\"An IOException occured whilst writing to the message buffer: \" + ex);\n }\n return;\n }\n}but right now i am getting following errorException in thread \"main\" java.lang.UnsatisfiedLinkError: no mqjbnd05 in java.library.path\n at java.lang.ClassLoader.loadLibrary(Unknown Source)\n at java.lang.Runtime.loadLibrary0(Unknown Source)\n at java.lang.System.loadLibrary(Unknown Source)\n at com.ibm.mq.MQSESSION.loadLib(MQSESSION.java:872)\n at com.ibm.mq.server.MQSESSION$1.run(MQSESSION.java:228)\n at java.security.AccessController.doPrivileged(Native Method)\n at com.ibm.mq.server.MQSESSION.(MQSESSION.java:222)\n at com.ibm.mq.MQSESSIONServer.getMQSESSION(MQSESSIONServer.java:70)\n at com.ibm.mq.MQSESSION.getSession(MQSESSION.java:492)\n at com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:168)\n at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11._createManagedConnection(MQBindingsManagedConnectionFactoryJ11.java:179)\n at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11.createManagedConnection(MQBindingsManagedConnectionFactoryJ11.java:215)\n at com.ibm.mq.StoredManagedConnection.(StoredManagedConnection.java:84)\n at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:168)\n at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:772)\n at com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:697)\n at com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:657)\n at com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:153)\n at com.ibm.mq.MQQueueManager.(MQQueueManager.java:451)\n at MQSample.main(MQSample.java:30)when i refered about this everyone saying to put mqjbnd.dll in java.library i put that file in that path also still not working### Assistant: IBM MQ CLIENT java.lang.UnsatisfiedLinkError: no mqjbnd05 in\n java.library.path exceptionYour title pretty much says it all. 'MQ Client' generally means that the queue manager is REMOTE to where you are running your application. But 'no mqjbnd05' means that you are attempting to connect to the queue manager in bindings mode, queue manager is running on the same server as your queue manager.99% of the time an application gets that errors is because the application and queue manager are running on separate servers and the application is not specifying: channel name, hostname/IP address & port #.Note: An application can connect in 2 ways to a queue manager:\n(1) client mode - meaning the application and queue manager are running on separate servers and the application is not specifying: channel name, hostname/IP address & port #.(2) bindings mode - meaning the application and queue manager are running on the same servers (no networking information is specified).Note: Don't use MQEnvironment class but rather put the connection information in a Hashtable and pass it to the MQQueueManager class. MQEnvironment is NOT thread safe.Here's a working sample MQ application that will connect (client mode) to a remote queue manager:import java.io.IOException;\nimport java.util.Hashtable;\n\nimport com.ibm.mq.*;\nimport com.ibm.mq.constants.CMQC;\n\n/**\n * Java class to connect to MQ. Post and Retrieve messages.\n * \n * Sample Command Line Parameters \n * -h 127.0.0.1 -p 1414 -c TEST.CHL -m MQA1 -q TEST.Q1 -u userid -x password\n */\npublic class MQClientTest\n{\n private Hashtable params = null;\n private Hashtable mqht = null;\n private String qManager;\n private String inputQName;\n\n /**\n * The constructor\n */\n public MQClientTest()\n {\n super();\n }\n\n /**\n * Make sure the required parameters are present.\n * \n * @return true/false\n */\n private boolean allParamsPresent()\n {\n boolean b = params.containsKey(\"-h\") && params.containsKey(\"-p\") &&\n params.containsKey(\"-c\") && params.containsKey(\"-m\") &&\n params.containsKey(\"-u\") && params.containsKey(\"-x\") &&\n params.containsKey(\"-q\");\n if (b)\n {\n try\n {\n Integer.parseInt((String) params.get(\"-p\"));\n }\n catch (NumberFormatException e)\n {\n b = false;\n }\n }\n\n return b;\n }\n\n /**\n * Extract the command-line parameters and initialize the MQ variables.\n * \n * @param args\n * @throws IllegalArgumentException\n */\n private void init(String[] args) throws IllegalArgumentException\n {\n params = new Hashtable();\n if (args.length > 0 && (args.length % 2) == 0)\n {\n for (int i = 0; i < args.length; i += 2)\n {\n params.put(args[i], args[i + 1]);\n }\n }\n else\n {\n throw new IllegalArgumentException();\n }\n\n if (allParamsPresent())\n {\n qManager = (String) params.get(\"-m\");\n inputQName = (String) params.get(\"-q\");\n\n mqht = new Hashtable();\n\n mqht.put(CMQC.CHANNEL_PROPERTY, params.get(\"-c\"));\n mqht.put(CMQC.HOST_NAME_PROPERTY, params.get(\"-h\"));\n\n try\n {\n mqht.put(CMQC.PORT_PROPERTY, new Integer(params.get(\"-p\")));\n }\n catch (NumberFormatException e)\n {\n mqht.put(CMQC.PORT_PROPERTY, new Integer(1414));\n }\n\n mqht.put(CMQC.USER_ID_PROPERTY, params.get(\"-u\"));\n mqht.put(CMQC.PASSWORD_PROPERTY, params.get(\"-x\"));\n\n // I don't want to see MQ exceptions at the console.\n MQException.log = null;\n }\n else\n {\n throw new IllegalArgumentException();\n }\n }\n\n /**\n * Method to put then get a message to/from a queue.\n */\n public void putAndGetMessage()\n {\n MQQueueManager qMgr = null;\n MQQueue queue = null;\n MQMessage putMessage = null;\n MQMessage getMessage = null;\n\n int openOptions = CMQC.MQOO_INPUT_AS_Q_DEF | CMQC.MQOO_OUTPUT + CMQC.MQOO_FAIL_IF_QUIESCING;\n\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.options = CMQC.MQGMO_NO_WAIT + CMQC.MQGMO_FAIL_IF_QUIESCING;\n\n MQPutMessageOptions pmo = new MQPutMessageOptions();\n pmo.options = CMQC.MQPMO_FAIL_IF_QUIESCING;\n\n String msg = \"Hello World, WelCome to MQ.\";\n\n try\n {\n qMgr = new MQQueueManager(qManager, mqht);\n queue = qMgr.accessQueue(inputQName, openOptions);\n\n putMessage = new MQMessage();\n putMessage.writeUTF(msg);\n\n // put the message on the queue\n queue.put(putMessage, pmo);\n\n System.out.println(\"Message is put on MQ.\");\n\n // get message from MQ.\n getMessage = new MQMessage();\n // assign message id to get message.\n getMessage.messageId = putMessage.messageId;\n\n /*\n * Tell the queue manager that we want a message with a specific MsgID.\n */\n gmo.matchOptions = CMQC.MQMO_MATCH_MSG_ID;\n\n // get message options.\n queue.get(getMessage, gmo);\n\n String retreivedMsg = getMessage.readUTF();\n System.out.println(\"Message got from MQ: \" + retreivedMsg);\n }\n catch (MQException e)\n {\n System.err.println(\"CC=\" + e.completionCode + \" : RC=\" + e.reasonCode);\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n finally\n {\n try\n {\n if (queue != null)\n queue.close();\n }\n catch (MQException e)\n {\n System.err.println(\"MQCLOSE CC=\" + e.completionCode + \" : RC=\"\n + e.reasonCode);\n }\n\n try\n {\n if (qMgr != null)\n qMgr.disconnect();\n }\n catch (MQException e2)\n {\n System.err.println(\"MQDISC CC=\" + e2.completionCode + \" : RC=\"\n + e2.reasonCode);\n }\n }\n }\n\n public static void main(String[] args)\n {\n System.out.println(\"Processing Main...\");\n MQClientTest clientTest = new MQClientTest();\n\n try\n {\n // initialize MQ.\n clientTest.init(args);\n // put and retrieve message from MQ.\n clientTest.putAndGetMessage();\n }\n catch (IllegalArgumentException e)\n {\n System.out.println(\"Usage: java MQClientTest -h host -p port -c channel -m QueueManagerName -q QueueName -u userid -x password\");\n System.exit(1);\n }\n\n System.out.println(\"Done!\");\n }\n}\n"} +{"text": "### Human: Why we use Transmission queue to store message in Sending a message to remote queue as we can also store the message in local queue.\nSo creating a transmission queue is taking memory and space.### Assistant: You need to learn more about MQ. A good place to start is theMQ Primer.You will learn that a transmission queue (aka XMITQ) is a local queue that is used by the MCA (Message Channel Agent) to transfer messages from the local queue manager to the remote queue manager. Messages should only be in the XMITQ very briefly.\n"} +{"text": "### Human: I am not familiar with MQ so forgive me if I'm not explaining myself properly. We have received a message on a queue that is failing when being read with a 2110 MQRC_FORMAT_ERROR. It would seem that the problem is it doesn't have a 'Format' specified, e.g. we are expecting 'MQSTR'. The client code (C#) is catching the MQException and doing a MQQueueManager.Backout() however the message is just going back onto the queue and being read and rejected again by the client.Looking at the queue I saw that it did not have a backout queue or backout threshold set. The queue manager also did not have a dead letter queue set. So what I've done is setup the DLQ and set the queue's backout queue to it with a backout threshold of 5. However the message is still stuck on the queue being continually read and put back. The backout count for the message is currently approaching 20 million.I would like to get the backout and DLQ working but if there is another method to just manually delete or move this message that would help for now. It is just a test message so it doesn't matter if we lose it.EDIT: I've had to clear the queue to get things moving so unfortunately might not be able to test any solutions until it happens again.### Assistant: MQ native clients do not automatically move erroneous message toBackoutQorDLQ. Application has to write additional code to move the messages toDLQorBackout queue. However XMS .NET and JMS clients do this job. XMS .NET is a JMS specification implementation in C# language. XMS .NET comes bundled with MQ Clients package.Coming to your case:MQRC_FORMAT_ERROR is not actually an error, it's a warning telling the application that MQ client was not able to convert the incoming message and it delivered an unconverted message to the application. The application must handle this exception and should not rollback such messages. You will need to investigate the application that is sending such messages and fix any issues.Please see the documentationhere.\n"} +{"text": "### Human: I'm currently getting all of the queue names like this:PCFAgent agent = new PCFAgent(this.HostName, this.Port, this.CHANNEL_NAME);\nPCFParameter[] parameters = { new MQCFST(CMQC.MQCA_Q_NAME, \"*\"), new MQCFIN (CMQC.MQIA_Q_TYPE, CMQC.MQQT_ALL) };\nMQMessage[] responses = agent.send(CMQCFC.MQCMD_INQUIRE_Q_NAMES, parameters);\nMQCFH cfh = new MQCFH(responses[0]);But I'm also getting remote queues, is there a way to retrive only local and alias queue names?### Assistant: Instead of doing 2 PCF requests, the other approach is to get all of the queues and simply select the type you want.PCFAgent agent = new PCFAgent(this.HostName, this.Port, this.CHANNEL_NAME);\nPCFParameter[] parameters = { new MQCFST(CMQC.MQCA_Q_NAME, \"*\"), new MQCFIN (CMQC.MQIA_Q_TYPE, CMQC.MQQT_ALL) };\nMQMessage[] responses = agent.send(CMQCFC.MQCMD_INQUIRE_Q_NAMES, parameters);\n\nfor (int i = 0; i < responses.length; i++)\n{\n // Make sure that each response is ok\n if ((responses[i]).getCompCode() == MQException.MQCC_OK)\n {\n type = responses[i].getIntParameterValue(CMQC.MQIA_Q_TYPE);\n\n switch (type)\n {\n case CMQC.MQQT_LOCAL:\n // do something with local queue\n break;\n case CMQC.MQQT_MODEL:\n // skip model queue\n break;\n case CMQC.MQQT_ALIAS:\n // do something with alias queue\n break;\n case CMQC.MQQT_REMOTE:\n // skip remote queue\n break;\n case CMQC.MQQT_CLUSTER:\n // skip cluster queue\n break;\n default :\n // something unexpected\n break;\n }\n }\n}\n"} +{"text": "### Human: We have a request to connect automatically when there is a connection failure(so that messages are not lost/neither its correlation ids).Automatic reconnect to messages/MQ Manager via IBM MQ 7x client connected to IBM 6.x remote MQ server(don't have an option to upgrade 7x MQ server).I tried doingif Manager is disconnected then stop and reconnectbut this keeps losing the value of correlation ids.I am using MQ.NET classes. Also, please advise if there is a manual reconnect possible, when there is a connection glitch?### Assistant: It is always good to put all MQ method calls in a try/catch block and in the catch block, determine if the exception is connection error, then reconnect and reopen all the MQ objects that were open earlier. For example:public static void GetQueueName()\n {\n Hashtable mqProps = new Hashtable();\n MQQueueManager qm = null;\n String strCorrelId = \"00123456789\";\n MQQueue importQ = null;\n\n Reconnect:\n try\n {\n mqProps.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\n mqProps.Add(MQC.CHANNEL_PROPERTY, \"NET.CHL\");\n mqProps.Add(MQC.HOST_NAME_PROPERTY, \"localhost\");\n mqProps.Add(MQC.PORT_PROPERTY, 2099);\n\n qm = new MQQueueManager(\"QM1\", mqProps);\n }\n catch (MQException mqex)\n {\n // Handle any exception appropriately\n }\n\n try\n {\n importQ = qm.AccessQueue(\"Q1\", MQC.MQOO_INPUT_SHARED | MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING);\n\n MQMessage mqPutMsg = new MQMessage();\n mqPutMsg.WriteString(\"This is an import message\");\n mqPutMsg.CorrelationId = System.Text.Encoding.UTF8.GetBytes(strCorrelId);\n MQPutMessageOptions mqpmo = new MQPutMessageOptions();\n mqpmo.Options = MQC.MQPMO_NEW_CORREL_ID;\n importQ.Put(mqPutMsg,mqpmo);\n\n MQMessage respMsg = new MQMessage();\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.WaitInterval = 3000;\n gmo.Options = MQC.MQGMO_WAIT;\n\n importQ.Get(respMsg, gmo);\n }\n catch (MQException ex)\n {\n switch(ex.ReasonCode)\n {\n case MQC.MQRC_CONNECTION_BROKEN:\n case MQC.MQRC_CONNECTION_ERROR:\n case MQC.MQRC_CONNECTION_QUIESCING:\n {\n try\n {\n importQ.Close();\n qm.Disconnect();\n }\n catch (Exception ex1)\n {\n // Ignore any exception\n }\n goto Reconnect;\n }\n }\n }\n importQ.Close(); \n qm.Disconnect();\n }\n"} +{"text": "### Human: We have implemented a message listener with spring and the container configurations looks like below\n \n \n \n \n \n \n \n \n \n Its deployed in Jboss and the server log shows the below connection refresh message frequently.org.springframework.jms.listener.DefaultMessageListenerContainer] (customContainer-3849) Successfully refreshed JMS ConnectionIt's been reported a high MSU/MIPS utilization at mainframe side where the WebSphere MQ is hosted. Could this be a reason to cause frequent MQ GET calls and increase in utilization?We haven't specified the message Reply To explicitly, will this be causing a reply to attempt to queue every time? Also the receive timeout is set to 1 ms, does that mean it will be actively polling the queue in every 1 ms? Could someone please explain the concept?### Assistant: TheDefaultMessageListenerContainerimplements polling of the queue. This means that it issues a GET with a wait of thereceiveTimeout. If you have areceiveTimeoutof 1ms, that means that every GET call will return after 1ms if no message is on the queue and another GET call will be made. This would appear to the queue manager as back to back GET calls.Two options:You can increasereceiveTimeoutto a higher number which will cause get with wait of the specified value, for example, get with wait of 60000 ms would only do a get every 1 minute or after a message hits the queue. You still get messages off the queue as soon as they are PUT to the queue.A slightly more efficient option if possible is to switch to theSimpleMessageListenerContainerwhich will use a native JMS async listener. For IBM MQ this is implemented with the MQ callback functionality. This means the listener registers the callback to the queue manager and the queue manager notifies the listener when new messages land on the queue, so there is no polling.\n"} +{"text": "### Human: Is there a way by which we can do integration between On-Premise IBM MQ with AWS SQS/API Gateway.I checked lots of links but found that we can migrate whole IBM MQ to AWS MQ but can't call from AWS to on premise MQ. Please suggest if anyone has tried this kind of integration.### Assistant: I\u2019m assuming you have an AWS based application that integrates with SQS and an on-premise application that integrates with IBM MQ, and ultimately you want to communicate effectively between the two applications.\nAt a functional level IBM MQ provides a client interface and a bridge between this and the AWS SQS interface is relatively straight forward to create. One important aspect to consider is the non-functional aspects. The IBM MQ client can either communicate directly back to the on-premise MQ instance, or via an AWS MQ instance. Although it may appear to be more straight forward to communicate directly to the on-premise MQ instance there are a few considerations that may mean an MQ instance in AWS is a more sensible approach.Applications often use IBM MQ for its assured delivery capabilities,\nby building a bridge to AWS SQS which is a non-assured delivery\nprovider there is a risk that messages can be lost or duplicated\n(depending on the implementation of the bridging logic). To minimize\nthe chance of this occurring you want to ensure that you have a\nreliable network between MQ, the bridge and SQS instance. This\nremoves any fragile network links, as MQ can transfer the message\nreliably from on-premise to a MQ instance deployed in AWS, overcoming\nany network issues transparently.The MQ Client is relatively chatty compared to two MQ instances exchanging messages. Due to the network latency between the on-premise and AWS data center, the chatty nature of the MQ Client can impact the overall performance of the solution.Therefore, it is often sensible to install a lightweight instance of MQ within your AWS availability zone and allow MQ to transfer the messages from on-premise to AWS efficiently and reliably. To help get you up and running quickly, you can grab the IBM MQ developer container for free on DockerHubhere.\n"} +{"text": "### Human: I have a requirement to write a shell script to check queue depth of few queues in remote Queue manager.\nVersion of remote queue manager IBM websphere Mq v8.\nCan anyone advise on this?### Assistant: You can do the following:1) Create an mqsc file, say curdepth.mqsc containing the following:DIS QL(*) CURDEPTHThe above will display curdepth of all queues. If you need for a specific queue, thenDIS QL() CURDEPTHYou can also wildcard in the name.DIS QL(SW*) CURDEPTH2) Setup MQSERVER environment variable to point to remote queue manager. For example:SET MQSERVER=MQ_CHN/TCP/remotehost(1414)3) Through your shell scriptrunmqsc -c < curdepth.mqscThe output would look something likeAMQ8409I: Display Queue details.\n QUEUE(SWIFTQ) TYPE(QLOCAL)\n CURDEPTH(0)4) Then parse the output of the command.\n"} +{"text": "### Human: I have a spring boot application that is connecting to an IBM MessageQueue service using the IBM Spring Boot starter:com.ibm.mq:mq-jms-spring-boot-starter:2.1.2I have a component class listening to the queues and it has the following annotation to enable/disable connecting to the queue:@ConditionalOnProperty(name = \"queue.enabled\", havingValue = \"true\")I also have the following property in my application.properties:queue.enabled=falseThis annotation worked for disabling the queue connections when I was connecting to ActiveMQ, but upon changing the codebase to connect to IBM MQ it seems that the connection is unaffected by the ConditionalOnProperty and always tries to connect.Is there a way to enable/disable connecting to the IBM MQ service upon server startup?### Assistant: The MQAutoConfiguration class that exists in themq-jms-spring-boot-starterdependency is what is causing the attempted queue connection.You have two options to fix this issue, one requires you to set a specific property, and the other allows you to define the property you want used to enable or disable the queue connection.Option 1Set the valuespring.jta.enabled = falsein yourapplication.propertiesfile.\n(This may not be a preferred option if you're using transactions in your application.)Looking at the MQAutoConfiguration class, you can see it is conditional on the propertyspring.jta.enabled. Setting that property to false in yourapplication.propertiesfile will prevent the MQAutoConfiguration class from being registered, which means no MQ beans get registered, and therefore no attempts will be made to connect to a queue.Option 2 (if you don't want to disable JTA)Create the packagecom.ibm.mq.spring.bootand create a copy of theMQAutoConfigurationclass there. Modify the@ConditionalOnPropertyannotation to the property of your choosing.\n"} +{"text": "### Human: How and where can I get the .net core dll for IBM MQ akaamqmdnetstd.dll?\nIs there any nuget for it? How can I send a message to a queue, I am getting error2082when trying to access the queue.queue = mqManager.AccessQueue(queueName, openOptions);\n \n MQQueueManager queueManager = null;\n MQQueue queue=null;\n try\n {\n properties = new Hashtable();\n properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\n properties.Add(MQC.HOST_NAME_PROPERTY, queueManagerName);\n properties.Add(MQC.PORT_PROPERTY, 1414);\n properties.Add(MQC.CHANNEL_PROPERTY, MQChannel);\n properties.Add(MQC.USER_ID_PROPERTY, connectionName);\n properties.Add(MQC.PASSWORD_PROPERTY, \"\");\n \n queueManager = new MQQueueManager(\"MNTSCM01\", properties);\n quqeue=queueManager .AccessQueue(queueName, openOptions);\n \n }\n catch (MQException mqex)\n {\n // Console out exception\n }### Assistant: 2 problems:How and where i can get the .net core dll for mqserie aka amqmdnetstd.dllYou need MQ 9.1.1 or higher, and if you just want MQ Client capability you could download the whole client or the redistributable client. Pick 9.1.1.0-IBM-MQC-Win64 or 9.1.1.0-IBM-MQC-Redist-Win64https://www-945.ibm.com/support/fixcentral/swg/selectFixes?parent=ibm~WebSphere&product=ibm/WebSphere/WebSphere+MQ&release=9.1.1&platform=All&function=fixId&fixids=9.1.1.0-IBM-MQC-%2A,9.1.1.0-IBM-MQ-Install-Java-All,9.1.1.0-IBM-MQ-Java-InstallRA&useReleaseAsTarget=true&includeSupersedes=1i am getting errors on this 2082 when tryinh to access the queuemqrc 2082 shows \"2082 0x00000822 MQRC_UNKNOWN_ALIAS_BASE_Q\", ie you are opening a queue which is an alias queue, but the thing it points to doesnt exist. Seehttps://www.ibm.com/support/knowledgecenter/en/SSFKSJ_7.5.0/com.ibm.mq.tro.doc/q039210_.htm\n"} +{"text": "### Human: I have a queue form which i'd like to be able to retrieve message. I then need to process them somehow (not in the scope) and then remove them from the queue.I tried to create 2 queues, one that browse the message and one to delete the message after it has been processed.MQQueue browseQueue = qMgr.AccessQueue(QUEUE_NAME, MQC.MQOO_BROWSE);\n MQGetMessageOptions browseOptions = new MQGetMessageOptions()\n {\n Options = MQC.MQGMO_WAIT | MQC.MQPMO_FAIL_IF_QUIESCING | MQC.MQGMO_BROWSE_NEXT,\n WaitInterval = MQC.MQWI_UNLIMITED\n };\n\n MQQueue acknowledgeQueue = qMgr.AccessQueue(QUEUE_NAME, MQC.MQOO_INPUT_AS_Q_DEF);\n MQGetMessageOptions acknowledgeOptions = new MQGetMessageOptions()\n {\n Options = MQC.MQGMO_WAIT | MQC.MQPMO_FAIL_IF_QUIESCING | MQC.MQMO_MATCH_MSG_ID,\n WaitInterval = MQC.MQWI_UNLIMITED\n };\n\n while (keepRunning.WaitOne(0))\n {\n MQMessage browseMessage = new MQMessage();\n\n try\n {\n browseQueue.Get(browseMessage, browseOptions);\n }\n catch (MQException mqexe)\n {\n throw;\n }\n\n if (browseMessage.MessageType != ShutDown.TYPE)\n {\n object o = browseMessage.ReadObject();\n Console.WriteLine(\"The message is: {0}\", o);\n }\n\n browseMessage.ClearMessage();\n\n MQMessage acknowledgeMessage = new MQMessage()\n {\n MessageId = browseMessage.MessageId\n };\n acknowledgeQueue.Get(acknowledgeMessage, acknowledgeOptions);\n }But I need to make sure no other process can access the same message. Since, I relied on using 2 queues, I don't see how to do it.### Assistant: Yuk. You do not understand MQ. As Attila said, you need to use MQ SyncPoint and if you are happy with the message then commit it, otherwise back it out. Also, do NOT hard-code queue manager or queue names in your program, you should be reading them from a property file.Here is how the code should look:MQQueueManager qMgr = new MQQueueManager(qMgrName);\nMQQueue queue = qMgr.AccessQueue(qName, MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING);\nMQGetMessageOptions gmo = new MQGetMessageOptions();\ngmo.Options = MQC.MQGMO_WAIT | MQC.MQGMO_FAIL_IF_QUIESCING | MQC.MQGMO_SYNCPOINT;\ngmo.WaitInterval = MQC.MQWI_UNLIMITED;\nMQMessage receiveMsg;\n\nwhile (keepRunning.WaitOne(0))\n{\n receiveMsg = new MQMessage();\n\n try\n {\n queue.Get(receiveMsg, gmo);\n if (receiveMsg.MessageType != ShutDown.TYPE)\n {\n object o = receiveMsg.ReadObject();\n Console.WriteLine(\"The message is: {0}\", o);\n }\n\n qMgr.Commit();\n }\n catch (MQException mqexe)\n {\n qMgr.Backout();\n throw mqexe;\n }\n}\n"} +{"text": "### Human: I got a MDB which picks up all the messages dropped in a Queue owned by somebody elseThere are many subscribers to that Queue.I am interested only in a particular type of message. Like some messages start as \"Password Changed\". Others are like \"Violation\".I don't want to Acknowledge the messages that i am not interested in and leave it in the Queue for somebody else who would be interested in itHow do I do it?### Assistant: JMS specification says messages can be filtered based on message headers and properties. Accordingly IBM MQ JMS allows applications to select messages based on JMS message headers and user properties. Message can not be filtered based on contents of body.You can ask the sender application to set message properties and your MDB can filter based on those properties.The other option is to use a dedicated queue for your MDB in which case you don't need to filter messages.\n"} +{"text": "### Human: 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.### Assistant: The number of instances a message flow has on the execution group is configured in the BAR file, before deployment.\nIf 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.\n"} +{"text": "### Human: I have an EAR which I deploy on Websphere Application Server, that uses a function to send a message to a MQ by using JMS, and receives a message inmediately from another queue.:ConnectionFactory cf = null;\n InitialContext context = null;\n String[] arrDatos_SR = null;\n\n Connection conn = null;\n Session session = null;\n Queue queue = null;\n Queue queue2 = null;\n\n Destination dest = null;\n Destination dest2 = null;\n MessageConsumer consumer = null;\n MessageProducer producer = null;\n TextMessage message = null;\n\n String comando = \"\";\n int tamanio = 0;\n String tamanio2 = \"\";\n String cadena = \"\";\n\n try {\n context = new InitialContext();\n cf = (ConnectionFactory) context.lookup(arrDatos[1].trim());\n conn = cf.createConnection();\n session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE); \n queue = (Queue) context.lookup(arrDatos[2].trim());\n queue2 = (Queue) context.lookup(arrDatos[3].trim());\n dest = (Destination) queue;\n dest2 = (Destination) queue2;\n\n producer = session.createProducer(dest);\n\n\n // Create a text message using the queue session.\n TextMessage textMessage = session.createTextMessage();\n\n textMessage.setText(arrDatos[4]);\n\n textMessage.setJMSReplyTo(dest2);\n textMessage.setJMSMessageID(arrDatos[6]);\n textMessage.setJMSCorrelationID(arrDatos[7]);\n producer.send(textMessage);\n\n\n } catch (NamingException e) {\n // TODO Auto-generated catch block\n logger.error(\"MQSendReceive() - Exception e2 = \"\n + e, e);\n } catch (JMSException e) {\n // TODO Auto-generated catch block\n logger.error(\"MQSendReceive() - Exception e2 = \"\n + e, e);\n } \n\n arrDatos[5] = arrDatos[5].trim();\n\n try{\n conn.start(); \n consumer = session.createConsumer(dest2);\n Message receivedMessage = consumer.receive(Long.parseLong(arrDatos[5]) * 1000);\n\n\n\n if(receivedMessage != null)\n {\n message = (TextMessage)receivedMessage;\n comando = message.getText();\n comando = comando.trim();\n tamanio = comando.length();\n tamanio2 = StringUtils.leftPad(Integer.toString(tamanio), 9, '0');\n\n comando = StringUtils.rightPad(comando, Constantes.TAMANIO_RESPUESTA_DES_C1, ' ');\n cadena = arrDatos[0] + comando + tamanio2; \n }\n else\n {\n comando = new String();\n comando = \"\";\n tamanio = comando.length();\n tamanio2 = StringUtils.leftPad(Integer.toString(tamanio), 9, '0');\n\n cadena = arrDatos[0] + comando + tamanio2;\n }\n\n arrDatos_SR = new String[2];\n arrDatos_SR[0] = cadena;\n arrDatos_SR[1] = arrDatos[0];\n\n }\n catch(Exception e)\n {\n logger.error(\"MQSendReceive() - Excepcion:\" + e);\n }\n finally\n {\n try {\n consumer.close();\n session.close();\n conn.close();\n context.close();\n } catch (JMSException e) {\n // TODO Auto-generated catch block\n logger.error(\"MQSendReceive() - Error desconectando de MQ - Excepcion:\" + e);\n } catch (NamingException e) {\n // TODO Auto-generated catch block\n logger.error(\"MQSendReceive() - Error desconectando de MQ - Excepcion:\" + e);\n }\n\n }\n\n return arrDatos_SR;The message is sent to a a MQ Queue #1, which is then transferred to another MQ Queue #2 which is a tranmission queue to another MQ Queue #3. I tested with the Websphere MQ Administration GUI putting messages to this queue, and they transfer smoothly. But when I use my code for some reason the send is not made inmediately. Instead, it is done after the receive ends (when the timeout expires or when it actually receives a message)Can someone tell me why is this happening?UPDATE: (March 31st, 2014) I forgot to mention that I'm using an EJB container with @LocalBean, @Singleton and @TransactionManagement(TransactionManagementType.CONTAINER) annotations. By reading this post from SO (http://goo.gl/JBSW7r), I realized that I have 3 classes that make the whole connection, and one main that makes use of all of them as objects from which I use the public methods. I decided to turn these classes into EJB as well with the same annotation. I also tried to change the @TransactionAttribute type of each method to REQUIRED, NOT SUPPORTED and MANDATORY one at a time, just to test if some of them worked. I also changed the session line to this:session = conn.createSession(true, Session.SESSION_TRANSACTED);Result appears to be the same. The message is still stuck in the transmission queue while the message is being received during timeout interval of the MessageConsumer.Can someone give me some thoughs on these?### Assistant: Based on your description of the problem I believe the code you have provided is executing in the context of an EJB with a container managed transaction in effect. In a Java EE application server the JMS operations will be coordinated by the transaction. That means the send will not in fact complete until the transaction is committed by the container at the end of the EJB method.Although you have set false when creating the Session in a Java EE application server this is ignored and the session will be enrolled in any global transaction in effect.The solution to this problem is to ensure that the JMS send executes with no transaction. To do this the EJB method should be configured with a transaction type of NOT_SUPPORTED.\n"} +{"text": "### Human: I'm executing a program that gets access to a MQ Queue Manager with java. The programs works, but when I run the .jar in a server, it cannot access the MQ. I asked the administrator, and it tells me that the .jar is running with the usermqm. There's another user that could run it. How can I run the jar so it runs under this other user? Or do I have to change something in my code?### Assistant: Setting a UserID in the channel's MCAUSER field means that EVERYBODY connecting on the channel will be using that particular UserID.Its like going to a conference and everybody getting the same conference badge with the name of \"Joe\" written on it. Not really useful or secure. Why both.\n"} +{"text": "### Human: How do I determine the cause of this error stackIs it complaining about a missing Jar file ?ThanksCaught Exception while Creating QueueConnection from QueueConnectionFactory com.ibm.msg.client.jms.DetailedJMSException: JMSFMQ6312: An exception occurred in the Java(tm) MQI. The Java(tm) MQI has thrown an exception describing the problem. See the linked exception for further information. com.ibm.msg.client.jms.DetailedJMSException: JMSFMQ6312: An exception occurred in the Java(tm) MQI. The Java(tm) MQI has thrown an exception describing the problem. See the linked exception for further information.\n at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\n at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)\n at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\n at java.lang.reflect.Constructor.newInstance(Constructor.java:525)\n at com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:319)\n at com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:233)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:6889)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6277)\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:285)\n at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6233)\n at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:120)\n at connection.JMSConnection.makeQueueConnectionMQSeries(JMSConnection.java:228)\n at connection.JMSConnection.makeQueueConnection(JMSConnection.java:614)\n at testType.JMS_PTP.setupMsgTransportProtocol(JMS_PTP.java:335)\n at testType.JMS_PTP.run(JMS_PTP.java:806) Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2195;AMQ9546: Error return code received. [1=java.lang.reflect.InvocationTargetException[null],3=NativeConstructorAccessorImpl.newInstance0]\n at com.ibm.mq.jmqi.JmqiEnvironment.processESESecurity(JmqiEnvironment.java:989)\n at com.ibm.mq.jmqi.JmqiEnvironment.getInstance(JmqiEnvironment.java:809)\n at com.ibm.mq.jmqi.JmqiEnvironment.getMQI(JmqiEnvironment.java:615)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:6881)\n ... 8 more Caused by: java.lang.reflect.InvocationTargetException\n at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\n at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)\n at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\n at java.lang.reflect.Constructor.newInstance(Constructor.java:525)\n at com.ibm.mq.jmqi.JmqiEnvironment.processESESecurity(JmqiEnvironment.java:896)\n ... 11 more Caused by: java.lang.NoClassDefFoundError: com/ibm/mq/headers/MQDataException\n at com.ibm.mq.ese.service.ServicesFactoryImpl.createPolicyService(ServicesFactoryImpl.java:173)\n at com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.createServices(InterceptedJmqiImpl.java:224)\n at com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.(InterceptedJmqiImpl.java:184)\n at com.ibm.mq.ese.jmqi.ESEJMQI.(ESEJMQI.java:117)\n ... 16 more Caused by: java.lang.ClassNotFoundException: com.ibm.mq.headers.MQDataException\n at java.net.URLClassLoader$1.run(URLClassLoader.java:366)\n at java.net.URLClassLoader$1.run(URLClassLoader.java:355)\n at java.security.AccessController.doPrivileged(Native Method)\n at java.net.URLClassLoader.findClass(URLClassLoader.java:354)\n at java.lang.ClassLoader.loadClass(ClassLoader.java:423)\n at java.lang.ClassLoader.loadClass(ClassLoader.java:356)\n ... 20 more Linked Exception: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2195;AMQ9546: Error return code received. [1=java.lang.reflect.InvocationTargetException[null],3=NativeConstructorAccessorImpl.newInstance0]\n-----------------------------------------------### Assistant: In order to identify the cause of an error in a StackTrace it is common to read the stackfrom bottom to upand look for theCaused bywords. That is the main reason of your problem. In your particular case:Caused by: java.lang.ClassNotFoundException: com.ibm.mq.headers.MQDataExceptionSo that states that this classMQDataExceptionwas not found on your classpath. So you should put the jar that contain this class on the classpath of your application and it should work fine.\n"} +{"text": "### Human: Can a 7.5 ibm mq client dll run on MQ 6.x server (compatible with 6x MQ server) ?I am going to implement get, put messages and few more. What objects will be supported (for ex: queue manager, queue instance etc)?If it is not compatible, what 6.x version(64-bit complaint) of MQ client dll will be supportive in MQ 6.x version?Any inputs will be highly helpful. Thanks in advance.### Assistant: It is possible to connect to MQ v6 queue manager using a higher version of MQ Client. But there are lot of differences between MQ v6 and MQ v7x queue manager. When you connect to MQ v6 queue manager all the features of MQ v7x will not be available. The notable feature is the native Pub/Sub and object like Topic. You can't use the MQ v7 native pub/sub API, MQSUB, MQSUBRQ to subscribe and MQPUT on topics.You can use only those features that are available in MQ v6. You can do Put/Get to/from a queue and do Pub/Sub using the Queued interface.\n"} +{"text": "### Human: We are using IBM MQ and we are facing some serious problems regarding controlling its asynchronous delivery to its recipient.We are having some java listeners configured, now the problem is that we need to control the messages coming towards listener, because the messages coming to server are in millions count and server machine dont have that much capacity t process so many threads at a time, so is there any way like throttling on IBM MQ side where we can configure preetch limit like Apache MQ does?or is there any other way to achieve this?Currently we are closing connection with IBM MQ when some X limit has reached on listener, but doesen't seems to be efficient way.Please guys help us out to solve this issue.### Assistant: Generally with message queueing technologies like MQ the point of the queue is that the sender is decoupled from the receiver. If you're having trouble with message volumes then the answer is to let them queue up on the receiver queue and process them as best you can, not to throttle the sender.The obvious answer is to limit the maximum number of threads that your listeners are allowed to take up. I'm assuming you're using some sort of MQ threadpool? What platform are you using that provides unlimited listener threads?From your description, it almost sounds like you have some process running that - as soon as it detects a message in the queue - it reads the message, starts up a new thread and goes back and looks at the queue again. This is the WRONG approach.You should have a defined number of process threads running (start with one and scale up as required, and within limits of your server) which read from the queue themselves. They would each open the queue in shared mode and either get-with-wait or do immediate get with a sleep if you get a MQRC 2033 (no messages in queue).Hope that helps.\n"} +{"text": "### Human: We have a key.kdb file, contents of which I can browse using ikeyman tool(ibm),I need to know how I can extract key.jks and trust.jks of one of the personal certs from the kdb,I require the jks files to populate in the IBM Mq explorer for connectivity.### Assistant: You can use the following command to extract from kdb to jks:runmqckm -cert -export -db key.kdb -target key.jks -stashed -target_type jks -label \"certLabel\"\n"} +{"text": "### Human: I've gone throughthis partof the official documentation of the IBM App Connect Enterprise but I can't still figure out how an integration node communicates with the default associated IBM MQ queue manager. It is obvious that the connection is locally bound (when on the same machine) but I can't figure out the following,What channel does IBM App Connect Enterprise use to connect to the associated queue manager?Which userid is used to connect?Since the connection is locally bound, does the authentication not happen?This pagestates \"You cannot use a secured queue manager as the local default queue manager for an integration node or an integration server\", what does it mean by a secured queue manager?How can I verify that the given queue manager is successfully associated with the node? How can I test?Goal: Associate a local default queue manager with an integration node without disabling channel authentication and in a secure way.### Assistant: ACE connects to the default QM in bindings mode, so no channel is needed.It will connect as the user running your ACE node.Usually the user running the ACE node is made a member of the mqm group, so it has full access to the default QM. So for example, if you disable mqm access to the QM via bindings using connauth, that will cause problems, but I believe you can still secure the QM, you just need to grant the exact permissions the ACE user will need, if it\u2019s not made member of mqm.You can test it with a flow using an MQ input or output configured to use the default QM. Or a flow using a feature dependent on the default QM like a collector node.\n"} +{"text": "### Human: we are using IBM MQ client (com.ibm.mq.allclient-9.1.3.0.jar) from a Spring-Boot project sending mq messages, the problem is the too many (tons) garbage output into the console:..... ----+----+- } (JmqiEnvironment)\n..... ----+----+- { setUserDataSingle(byte [ ],int) [0(0x0)]\n..... ----+----+- } setUserDataSingle(byte [ ],int)(xxx are replacement for privacy)How can we control/remove the this low level info from the console ?\nThanks in advance,Csaba### Assistant: I looks like you have trace enabled.Check if you have the java system propertycom.ibm.msg.client.commonservices.trace.status=ONset. If it is set, remove it and restart.\n"} +{"text": "### Human: I am getting following error while trying to connect with IBM MQ. I have done enough configuration in MQ Explorer but still getting this error.**MQ Config:**\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Error Logs:log1log2### Assistant: Did you disable authorisation for the queue manager QM1?Try this:Create connection for MQ Explorerrunmqsc QM1\n\ndefine channel(SYSTEM.ADMIN.SVRCONN) chltype(SVRCONN) MCAUSER('mqm')\nalter qmgr chlauth(DISABLED)\nrefresh securityAfter these commands use Channel SYSTEM.ADMIN.SVRCONN instead of CH1. Or try to change SYSTEM.ADMIN.SVRCONN to CH1 in the command.Change access permissions for rfhutilrunmqsc QM1\n\nALTER AUTHINFO(SYSTEM.DEFAULT.AUTHINFO.IDPWOS) AUTHTYPE(IDPWOS) CHCKCLNT(OPTIONAL) \nREFRESH SECURITY TYPE(CONNAUTH)\n"} +{"text": "### Human: While I'm trying to install IBM mq in the GCP Kubernetes engine using Helm charts, I got an error as shown in above figure. Anyone help me out from this...Infrastructure: Google Cloud Platform\nKubectl version: \n Client Version: v1.18.6\n Server Version: v1.16.13-gke.1.\nHelm version: v3.2.1+gfe51cd1\nhelm chart:\n helm repo add ibm-charts https://raw.githubusercontent.com/IBM/charts/master/repo/stable/Helm command:$ helm install mqa ibm-charts/ibm-mqadvanced-server-dev --version 4.0.0 --set license=accept --set service.type=LoadBalancer --set queueManager.dev.secret.name=mysecret --set queueManager.dev.secret.adminPasswordKey=adminPassword --set security.initVolumeAsRoot=true### Assistant: First, it appears it's not installing the right version of the Helm chart. You can follow the officialinstallation instructionsfor the Chart.Secondly, the messages are inconsistent. The error shows a GKE v1.15.12-gke.2 and also a GKE v1.16.13-gke.1. So I would make sure your client K8scontextis pointing to the right cluster.It also appears that the kubectl versions are not matching.For example, you can download thev1.16.13client so that it matches (Assuming that your client is on Linux):$ curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.16.13/bin/linux/amd64/kubectl\n$ chmod +x kubectl\n$ ./kubectl version\u270c\ufe0f\n"} +{"text": "### Human: I don't want to use message expiry as it has dependency on sending application and don't want to use pub/sub as well because if the applications don't take the messages it will fill up the filesystem etc. I don't want the messages to be piled up in the queue because application is down.This setup is required so that there wont be any outage because of this queue and the application consuming it. Any advice?### Assistant: CAPEXPRY allows the administrator to set message expiry without application changes. Seehttps://www.ibm.com/support/knowledgecenter/SSFKSJ_9.1.0/com.ibm.mq.ref.dev.doc/q097495_.htm\n"} +{"text": "### Human: I have a problem with PCF message agent while inquiring channel in order to obtain informations about hosts connected to a given queue manager. The code of PCFAgent isMQGetMessageOptions getMessageOptions = new MQGetMessageOptions();\n getMessageOptions.options = MQC.MQGMO_BROWSE_NEXT + MQC.MQGMO_NO_WAIT + MQC.MQGMO_FAIL_IF_QUIESCING;\n messageAgent = new PCFMessageAgent(MQEnvironment.hostname, MQEnvironment.port, MQEnvironment.channel);and code of options isinquireOptions = new PCFMessage(CMQCFC.MQCMD_INQUIRE_CHANNEL_STATUS);\n inquireOptions.addParameter(CMQCFC.MQCACH_CHANNEL_NAME, \"*\");\n inquireOptions.addParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_TYPE, CMQC.MQOT_CURRENT_CHANNEL);\n inquireOptions.addParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_ATTRS, new int[]{\n CMQCFC.MQCACH_CHANNEL_NAME, CMQCFC.MQCACH_CONNECTION_NAME, CMQCFC.MQIACH_MSGS,\n CMQCFC.MQCACH_LAST_MSG_DATE, CMQCFC.MQCACH_LAST_MSG_TIME, CMQCFC.MQIACH_CHANNEL_STATUS\n });\n responses = messageAgent.send(inquireOptions);Not always, but occasionally the application resturns an exception that says \"Completion Code 2, Reason 2100\" and my host (the one on which the application is running) leaves a pending connection on the server that is never closed until the MQManager is restarted.I've read that this exception is due to a conflict in creating dynamic queues, but in my code I don't create any queue.\nSomeone could help me? Sorry, I've no previous experiences with queue managers.Thank you### Assistant: 2100 (MQRC_OBJECT_ALREADY EXISTS)is indeed a problem with creating a dynamic queue.ExplanationAn MQOPEN call was issued to create a dynamic queue, but a queue with the same name as the dynamic queue already exists.Completion codeMQCC_FAILEDProgrammer responseIf supplying a dynamic queue name in full, ensure that it obeys the naming conventions for dynamic queues; if it does, either supply a different name, or delete the existing queue if it is no longer required. Alternatively, allow the queue manager to generate the name.If the queue manager is generating the name (either in part or in full), reissue the MQOPEN call.Under the covers, thePCFMessageAgentwill create a PCF Format message using the details you supply in thePCFMessageand will open a model queue to create a temporary queue in order to receive the reply from the Command Server. These temporary queues are named by the queue manager by producing a unique portion using a timestamp, resulting in a name something likeAMQ.5E47207E2227AA02. If you have lots of concurrent applications doing this, it is possible that you could end up with a clash of names, and the second request in, at the same time might get a name conflict.If you have a way to make the temporary queue name more unique should such concurrency be a problem in your system, you can set the prefix used for the temporary queue name using thesetReplyQueuePrefixmethod. You could, for example, user the user ID each application is running under, if that is unique.public void setReplyQueuePrefix(java.lang.String prefixP)Sets the string used as the first part of the agent's reply queue name. The reply queue used by the PCFAgent is a temporary dynamic queue. By default, the reply queue prefix used by the PCFAgent is the empty string (\"\"). When this is used, the name of the reply queue is generated entirely by the queue manager. If the method is called with a prefix specified, then the PCFAgent will pass that prefix to the queue manager whenever it needs to create a temporary queue. The queue manager will then generate the rest of the temporary queue name. This means that the queue manager generates a unique name, but the PCFAgent still has some control. The prefix specified should be fewer than 33 characters. If the prefix contains 33 characters or greater, then this method will truncate the prefix to be 32 characters in length. If the prefix does not contain an asterisk (*) character at the end, then an asterisk will be added to the end.\n"} +{"text": "### Human: MQ reconnect does not work. Can you suggest ways to fix it?I use Wildfly 12.0.0.FinalDriver is wmq.jmsra-9.1.2.0.rarTried to use this ways to configure reconnectFirst\n \n \n \n wmq.jmsra-9.1.2.0.rar\n \n NoTransaction\n \n 300\n \n \n 9000\n \n \n 9000\n \n \n 300\n \n \n \n Second (two last properties)private JMSContext createJmsContext() throws JMSException {\n JmsConnectionFactory cf;\n JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\n cf = ff.createConnectionFactory();\n cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, props.getProperty(Q_HOST));\n cf.setIntProperty(WMQConstants.WMQ_PORT, Integer.valueOf(props.getProperty(Q_PORT)));\n cf.setStringProperty(WMQConstants.WMQ_CHANNEL, props.getProperty(Q_CHANNEL));\n cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\n cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, props.getProperty(Q_MANAGER));\n cf.setStringProperty(WMQConstants.WMQ_APPLICATIONNAME, \"JmsPutGet (JMS)\");\n cf.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, true);\n cf.setIntProperty(WMQConstants.WMQ_CLIENT_RECONNECT_OPTIONS, WMQConstants.WMQ_CLIENT_RECONNECT_Q_MGR);\n cf.setIntProperty(WMQConstants.WMQ_CLIENT_RECONNECT_TIMEOUT, 60000);\n return cf.createContext();\n }### Assistant: The IBM MQ classes for JMS resource adapter does not support support Automatic JMS client reconnection.See IBM MQ v9.1 Knowledge Center pageDeveloping applications>Developing JMS and Java applications>Using IBM MQ classes for JMS>Writing IBM MQ classes for JMS applications>Accessing IBM MQ features from an IBM MQ classes for JMS application:The use of this implementation of automatic client reconnection is not supported within Java\u2122 Platform, Enterprise Edition application servers. SeeUsing automatic client reconnection in Java EE environmentsfor an alternative implementation.As stated above see IBM MQ v9.1 Knowledge Center pageDeveloping applications>Developing JMS and Java applications>Using IBM MQ classes for JMS>Writing IBM MQ classes for JMS applications>Accessing IBM MQ features from an IBM MQ classes for JMS application>Automatic JMS client reconnection>Using automatic client reconnection in Java SE and Java EE environments:NoteAutomatic client reconnection with activation specifications using the functionality provided by IBM MQ classes for JMS is not supported. The IBM MQ resource adapter provides its own mechanism for reconnecting activation specifications if the queue manager that the activation specification was connecting to becomes unavailable.\n"} +{"text": "### Human: I am using JMS Connector to connect to IBM MQ. If I use IBM MQ Connector I have option (targetClient=\"NO_JMS_COMPLIANT\") to disable RFH Header from the message. How can I achieve the same thing using the JMS Connector. My JMS config looks like below\n \nConnection Factory looks like this:\n \n \n \n \n \nJMS Connector config looks like this:\n \n \n \nI have tried adding request queue name withP2.REQUEST?targetClient=1. I could not see any changes.### Assistant: I doubt the JMS connector allows to select a non-JMS compatible mode that is specific to a broker (IBM MQ). It a generic connector which provides no broker specific features. You should be using the IBM MQ connector for that that already provides that specific feature.\n"} +{"text": "### Human: Connecting to IBM MQ using java but both application and MQ reside on same server. In this case do I need to specify host,port,channel etc., or is only Queue Manager fine, or any better approach.I am aware how to connect by using host, port, channel and queue name.What is the best approach to connect when both application and queue manager reside on the same server.### Assistant: If both application and queue manager are running on the same machine, you do not need to connect using a client connection (that is using host, port and channel name), but can instead use what is known as a local bindings connection, and just provide the queue manager name.For a client connection, the connection to the queue manager is made over a TCP/IP socket.For a local bindings connection, the connection to the queue manager is made used shared memory.Depending on which MQ Java interface you are using, take a look at the following samples.IBM MQ Classes for JavaLook at the sample MQSample.java which makes a very simple local bindings connection.IBM MQ Class for JMSLook at the JmsBrowser sample as an example. It can use either client or local bindings conncetions. Look at the booleanclientTransportand follow the code accordingly.\n"} +{"text": "### Human: Please see my code snippets below:amqmdnet (this works but we prefer IBM.XMS because we can then do asynchronous consumption)XMS with CCDT fileXMS with property for compressionWe tried all possible ways to configure compression (in XMS). I really appreciate your help, if anyone could help...### Assistant: It seems to me the possible values for the compression property are:static int WMQ_COMPMSG_DEFAULT\nstatic int WMQ_COMPMSG_NONE\nstatic int WMQ_COMPMSG_RLE\nstatic int WMQ_COMPMSG_ZLIBFAST\nstatic int WMQ_COMPMSG_ZLIBHIGHSo 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\npublic static final int WMQ_COMPMSG_NONE 0\npublic static final int WMQ_COMPMSG_RLE 1\npublic static final int WMQ_COMPMSG_ZLIBFAST 2\npublic static final int WMQ_COMPMSG_ZLIBHIGH 4Please 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.\n"} +{"text": "### Human: I have implemented the MQ source in Spark structured streaming. And I am usingIBM MQ Core libraryand usingJava 8com.ibm.mq\n com.ibm.mq\n ${mq.version}\n providedThe issue is reading operation is too slow. I am running my streaming application with 4 executors, 4GB memory each and with 4 Cores. But my application takes 10 minutes to read 1000 messages from Queue. Each message size is around 3kb.As of now my spark application reading the message one by one and processing the messages in parallel.Is there a way we can read this messages in parallel as well. I have heard concurrent consumers in mq. But I couldnt get any proper documentation for that.Can anyone share me some examples in Java?I cant share any code because of my organizational restrictions. sorry for that. But I can give any information needed to provide some help.### Assistant: But my application takes 10 minutes to read 1000 messages from Queue.\n Each message size is around 3kb.Are you running your application on the same server as MQ queue manager or on a remote server? Is your application doing some backend work before looping to get the next message? What network performance testing have you done? Maybe you have a slow network.Below is a simple Java/MQ that loops and retrieves all messages on the queue. I just put 1000 3KB messages on a queue and ran it. Here is the output:2018/06/28 17:18:21.191 MQTest12L: testReceive: successfully connected to MQWT1\n2018/06/28 17:18:21.207 MQTest12L: testReceive: successfully opened TEST.Q1\n2018/06/28 17:18:21.448 MQTest12L: testReceive: read 1000 messages\n2018/06/28 17:18:21.448 MQTest12L: testReceive: closed: TEST.Q1\n2018/06/28 17:18:21.450 MQTest12L: testReceive: disconnected from MQWT1To get 1000 3KB messages took259 milliseconds. So, if your program takes 10 minutes to get 1000 3kb messages then there is something wrong with either your program or your network.Here is the fully-functioning Java/MQ application called MQTest12L.java that will loop and retrieve all messages on the queue:import java.io.IOException;\nimport java.text.SimpleDateFormat;\nimport java.util.Date;\nimport java.util.Hashtable;\n\nimport com.ibm.mq.MQException;\nimport com.ibm.mq.MQMessage;\nimport com.ibm.mq.MQGetMessageOptions;\nimport com.ibm.mq.MQQueue;\nimport com.ibm.mq.MQQueueManager;\nimport com.ibm.mq.constants.CMQC;\n\n/**\n * Program Name\n * MQTest12L\n *\n * Description\n * This java class will connect to a remote queue manager with the \n * MQ setting stored in a HashTable, loop to retrieve all messages on a queue\n * then close and disconnect.\n *\n * Sample Command Line Parameters\n * -m MQA1 -h 127.0.0.1 -p 1414 -c TEST.CHL -q TEST.Q1 -u UserID -x Password\n *\n * @author Roger Lacroix\n */\npublic class MQTest12L\n{\n private static final SimpleDateFormat lOGGER_TIMESTAMP = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss.SSS\");\n\n private Hashtable params;\n private Hashtable mqht;\n private String qMgrName;\n private String outputQName;\n\n /**\n * The constructor\n */\n public MQTest12L()\n {\n super();\n params = new Hashtable();\n mqht = new Hashtable();\n }\n\n /**\n * Make sure the required parameters are present.\n * @return true/false\n */\n private boolean allParamsPresent()\n {\n boolean b = params.containsKey(\"-h\") && params.containsKey(\"-p\") &&\n params.containsKey(\"-c\") && params.containsKey(\"-m\") &&\n params.containsKey(\"-q\") &&\n params.containsKey(\"-u\") && params.containsKey(\"-x\");\n if (b)\n {\n try\n {\n Integer.parseInt((String) params.get(\"-p\"));\n }\n catch (NumberFormatException e)\n {\n b = false;\n }\n }\n\n return b;\n }\n\n /**\n * Extract the command-line parameters and initialize the MQ HashTable.\n * @param args\n * @throws IllegalArgumentException\n */\n private void init(String[] args) throws IllegalArgumentException\n {\n int port = 1414;\n if (args.length > 0 && (args.length % 2) == 0)\n {\n for (int i = 0; i < args.length; i += 2)\n {\n params.put(args[i], args[i + 1]);\n }\n }\n else\n {\n throw new IllegalArgumentException();\n }\n\n if (allParamsPresent())\n {\n qMgrName = (String) params.get(\"-m\");\n outputQName = (String) params.get(\"-q\");\n\n try\n {\n port = Integer.parseInt((String) params.get(\"-p\"));\n }\n catch (NumberFormatException e)\n {\n port = 1414;\n }\n\n mqht.put(CMQC.CHANNEL_PROPERTY, params.get(\"-c\"));\n mqht.put(CMQC.HOST_NAME_PROPERTY, params.get(\"-h\"));\n mqht.put(CMQC.PORT_PROPERTY, new Integer(port));\n mqht.put(CMQC.USER_ID_PROPERTY, params.get(\"-u\"));\n mqht.put(CMQC.PASSWORD_PROPERTY, params.get(\"-x\"));\n\n // I don't want to see MQ exceptions at the console.\n MQException.log = null;\n }\n else\n {\n throw new IllegalArgumentException();\n }\n }\n\n /**\n * Connect, open queue, loop and get all messages then close queue and disconnect.\n *\n * @throws MQException\n */\n private void testReceive()\n {\n MQQueueManager qMgr = null;\n MQQueue queue = null;\n int openOptions = CMQC.MQOO_INPUT_AS_Q_DEF + CMQC.MQOO_INQUIRE + CMQC.MQOO_FAIL_IF_QUIESCING;\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.options = CMQC.MQGMO_NO_WAIT + CMQC.MQGMO_FAIL_IF_QUIESCING;\n MQMessage receiveMsg = null;\n int msgCount = 0;\n boolean getMore = true;\n\n try\n {\n qMgr = new MQQueueManager(qMgrName, mqht);\n MQTest12L.logger(\"successfully connected to \"+ qMgrName);\n\n queue = qMgr.accessQueue(outputQName, openOptions);\n MQTest12L.logger(\"successfully opened \"+ outputQName);\n\n while(getMore)\n {\n receiveMsg = new MQMessage();\n\n try\n {\n // get the message on the queue\n queue.get(receiveMsg, gmo);\n msgCount++;\n\n if (CMQC.MQFMT_STRING.equals(receiveMsg.format))\n {\n String msgStr = receiveMsg.readStringOfByteLength(receiveMsg.getMessageLength());\n// MQTest12L.logger(\"[\"+msgCount+\"] \" + msgStr);\n }\n else\n {\n byte[] b = new byte[receiveMsg.getMessageLength()];\n receiveMsg.readFully(b);\n// MQTest12L.logger(\"[\"+msgCount+\"] \" + new String(b));\n }\n }\n catch (MQException e)\n {\n if ( (e.completionCode == CMQC.MQCC_FAILED) && \n (e.reasonCode == CMQC.MQRC_NO_MSG_AVAILABLE) )\n {\n // All messages read.\n getMore = false;\n break;\n }\n else\n {\n MQTest12L.logger(\"MQException: \" + e.getLocalizedMessage());\n MQTest12L.logger(\"CC=\" + e.completionCode + \" : RC=\" + e.reasonCode);\n getMore = false;\n break;\n }\n }\n catch (IOException e)\n {\n MQTest12L.logger(\"IOException:\" +e.getLocalizedMessage());\n }\n }\n }\n catch (MQException e)\n {\n MQTest12L.logger(\"CC=\" +e.completionCode + \" : RC=\" + e.reasonCode);\n }\n finally\n {\n MQTest12L.logger(\"read \" + msgCount + \" messages\");\n\n try\n {\n if (queue != null)\n {\n queue.close();\n MQTest12L.logger(\"closed: \"+ outputQName);\n }\n }\n catch (MQException e)\n {\n MQTest12L.logger(\"CC=\" +e.completionCode + \" : RC=\" + e.reasonCode);\n }\n try\n {\n if (qMgr != null)\n {\n qMgr.disconnect();\n MQTest12L.logger(\"disconnected from \"+ qMgrName);\n }\n }\n catch (MQException e)\n {\n MQTest12L.logger(\"CC=\" +e.completionCode + \" : RC=\" + e.reasonCode);\n }\n }\n }\n\n /**\n * A simple logger method\n * @param data\n */\n public static void logger(String data)\n {\n String className = Thread.currentThread().getStackTrace()[2].getClassName();\n\n // Remove the package info.\n if ( (className != null) && (className.lastIndexOf('.') != -1) )\n className = className.substring(className.lastIndexOf('.')+1);\n\n System.out.println(lOGGER_TIMESTAMP.format(new Date())+\" \"+className+\": \"+Thread.currentThread().getStackTrace()[2].getMethodName()+\": \"+data);\n }\n\n /**\n * main line\n * @param args\n */\n public static void main(String[] args)\n {\n MQTest12L write = new MQTest12L();\n\n try\n {\n write.init(args);\n write.testReceive();\n }\n catch (IllegalArgumentException e)\n {\n System.err.println(\"Usage: java MQTest12L -m QueueManagerName -h host -p port -c channel -q QueueName -u UserID -x Password\");\n System.exit(1);\n }\n\n System.exit(0);\n }\n}\n"} +{"text": "### Human: Could anyone please help me to know, how can i know the MQ Queue Manager Channel Name.I have created a local MQ queue, but when i'm trying to connect to it from OSB, its asking for channel name as well.I'm having both IBM MQ and OSB on same windows system.### Assistant: You can either create a new server connection channel from MQ Explorer (or using runmqsc commands) or connect using the \"SYSTEM.DEF.SVRCONN\" channel, which exists by default on all queue managers.To list all channels in the queue manager, dorunmqscqueuemanager_nameDISPLAY CHANNEL (*)To see only Server connection channels,DISPLAY CHANNEL (*) CHLTYPE(SVRCONN)Hope this helps.\n"} +{"text": "### Human: BACKGROUND:I assembled a \"relatively\" compact JBossFuse, REST-DSL example (from disparate posts/articles) that routes to an ActiveMQ queue (see working example, further below).PROBLEM:I want to route to an \"IBM MQ\" queue, instead.QUESTION:What has to change for me to route to \"IBM MQ\" instead of \"ActiveMQ\"?I've tried the following...:(A) building an IBM MQ \"support bundle\" and deploying it to Fuse and adding the dep. to the app's pom.xml\n \n 4.0.0\n com.ibm\n ibm-mq-lib\n 9.0.0.0\n ibm-mq-lib\n bundle\n\n \n \n com.ibm.mq.osgi\n allclient\n 9.0.0.0\n C:/tools/wmq/OSGi/com.ibm.mq.osgi.allclient_9.0.0.0.jar \n system \n \n \n com.ibm.mq.osgi \n allclientprereqs\n 9.0.0.0\n C:/tools/wmq/OSGi/com.ibm.mq.osgi.allclientprereqs_9.0.0.0.jar\n system \n \n \n com.ibm.mq \n allclient\n 9.0.0.0\n C:/tools/wmq/JavaSE/com.ibm.mq.allclient.jar\n system \n \n \n com.ibm.mq \n traceControl\n 9.0.0.0\n C:/tools/wmq/JavaSE/com.ibm.mq.traceControl.jar\n system \n \n \n com.ibm.mq \n fscontext\n 9.0.0.0\n C:/tools/wmq/JavaSE/fscontext.jar\n system \n \n \n com.ibm.mq \n jms\n 9.0.0.0\n C:/tools/wmq/JavaSE/jms.jar\n system \n \n \n com.ibm.mq \n providerutil\n 9.0.0.0\n C:/tools/wmq/JavaSE/providerutil.jar\n system \n \n \n \n \n \n org.apache.felix\n maven-bundle-plugin\n 3.3.0\n true\n \n \n ${project.artifactId}\n ${project.artifactId}\n description\n IBM MQ 9.0.0.0\n \n *\n *\n \n \n \n \n \n ibm-mq-lib\n (B) modified the \"camel-route.xml\" file (added the following)...\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n (C) modified \"CamelRestRoutes.java\" file to point to the IBM MQ queue (instead of the ActiveMQ queue)......\n from(\"direct:thingZ\")\n .log(\"---------------------- (CCC) ----------------------> direct:thingZ...:\" + body().toString())\n .to(\"ibmMq:queue:bubblegum?jmsMessageType=Text&exchangePattern=InOnly\");Call the \"getAll\" method in the REST service results in an exception with the following log/exception output...\n WorkQueueMananger Contents\n --------------------------\n\n | Maintain ThreadPool size :- false\n | Maximum ThreadPool size :- -1\n | ThreadPool inactive timeout :- 0\n | unavailable - :- com.ibm.msg.client.commonservices.CSIException: JMSCS0002\n\n Runtime properties\n ------------------\n\n | Available processors :- 4\n | Free memory in bytes (now) :- 737153288\n | Max memory in bytes :- 954728448\n | Total memory in bytes (now) :- 875036672\n\n Component Manager Contents\n --------------------------\n\n Common Services Components:\n Messaging Provider Components:\n | CMVC :- p900-L160512.4\n | Class Name :- class com.ibm.msg.client.wmq.factories.WMQComponent\n | Component Name :- com.ibm.msg.client.wmq\n | Component Title :- IBM MQ JMS Provider\n | Factory Class :- class com.ibm.msg.client.wmq.factories.WMQFactoryFactory\n | Jar location :- bundle://530.0:1/com/ibm/msg/client/wmq/factories/WMQComponent.class\n | Version :- 9.0.0.0\n\n\n\n\n Provider Specific Information\n -----------------------------\n\n Overview of JMS System\n Num. Contexts : 0\n Num. Connections : 0\n Num. Sessions : 0\n Num. Consumers : 0\n Num. Producers : 0\n\n Detailed JMS System Information\n Contexts :\n Connections :\n Sessions :\n Consumers :\n Producers :\n\n\n 2017-08-08 09:44:57,407 | ERROR | estlet-672518929 | DefaultErrorHandler | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | Failed delivery for (MessageId: ID-AAXA22A747-53217-1502199741603-0-3 on ExchangeId: ID-AAXA22A747-53217-1502199741603-0-2). Exhausted after delivery attempt: 1 caught: org.springframework.jms.UncategorizedJmsException: Uncategorized exception occured during JMS processing; nested exception is com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0018: null; nested exception is com.ibm.mq.MQException: JMSCMQ0001: JMSCMQ0001, 2, MQCC_FAILED, 2195, MQRC_UNEXPECTED_ERROR\n\n Message History\n ---------------------------------------------------------------------------------------------------------------------------------------\n RouteId ProcessorId Processor Elapsed (ms)\n [route1 ] [route1 ] [http://localhost:8182/service/getAll?restletMethods=GET ] [ 4126]\n [route1 ] [restBinding1 ] [ ] [ 4]\n [route1 ] [route1 ] [direct:thingX ] [ 4119]\n [route2 ] [to1 ] [bean:camelRestService?method=getAll ] [ 7]\n [route2 ] [log1 ] [log ] [ 1]\n [route2 ] [to2 ] [direct:thingY ] [ 4110]\n [route3 ] [log2 ] [log ] [ 1]\n [route3 ] [to3 ] [direct:thingZ ] [ 4109]\n [route4 ] [log3 ] [log ] [ 0]\n [route4 ] [to4 ] [ibmMq:queue:mylocalqueue?jmsMessageType=Text&exchangePattern=InOnly ] [ 4109]\n\n Stacktrace\n ---------------------------------------------------------------------------------------------------------------------------------------\n org.springframework.jms.UncategorizedJmsException: Uncategorized exception occured during JMS processing; nested exception is com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0018: null; nested exception is com.ibm.mq.MQException: JMSCMQ0001: JMSCMQ0001, 2, MQCC_FAILED, 2195, MQRC_UNEXPECTED_ERROR\n at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:316)[243:org.apache.servicemix.bundles.spring-jms:3.2.16.RELEASE_2]\n at org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:168)[243:org.apache.servicemix.bundles.spring-jms:3.2.16.RELEASE_2]\n at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:469)[243:org.apache.servicemix.bundles.spring-jms:3.2.16.RELEASE_2]\n at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.send(JmsConfiguration.java:452)[244:org.apache.camel.camel-jms:2.17.0.redhat-630187]\n at org.apache.camel.component.jms.JmsProducer.doSend(JmsProducer.java:414)[244:org.apache.camel.camel-jms:2.17.0.redhat-630187]\n at org.apache.camel.component.jms.JmsProducer.processInOnly(JmsProducer.java:368)[244:org.apache.camel.camel-jms:2.17.0.redhat-630187]\n at org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:154)[244:org.apache.camel.camel-jms:2.17.0.redhat-630187]\n at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:468)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:196)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.processor.Pipeline.process(Pipeline.java:121)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:196)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:62)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:468)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:196)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.processor.Pipeline.process(Pipeline.java:121)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:196)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:62)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:468)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:196)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.processor.Pipeline.process(Pipeline.java:121)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:196)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:62)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:468)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:196)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.processor.Pipeline.process(Pipeline.java:121)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:196)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:109)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:91)[232:org.apache.camel.camel-core:2.17.0.redhat-630187]\n at org.apache.camel.component.restlet.RestletConsumer$1.handle(RestletConsumer.java:68)[304:org.apache.camel.camel-restlet:2.17.0.redhat-630187]\n at org.apache.camel.component.restlet.MethodBasedRouter.handle(MethodBasedRouter.java:54)[304:org.apache.camel.camel-restlet:2.17.0.redhat-630187]\n at org.restlet.routing.Filter.doHandle(Filter.java:150)[303:org.restlet:2.3.6.v20160126-1627]\n at org.restlet.routing.Filter.handle(Filter.java:197)[303:org.restlet:2.3.6.v20160126-1627]\n at org.restlet.routing.Router.doHandle(Router.java:422)[303:org.restlet:2.3.6.v20160126-1627]\n at org.restlet.routing.Router.handle(Router.java:639)[303:org.restlet:2.3.6.v20160126-1627]\n at org.restlet.routing.Filter.doHandle(Filter.java:150)[303:org.restlet:2.3.6.v20160126-1627]\n at org.restlet.routing.Filter.handle(Filter.java:197)[303:org.restlet:2.3.6.v20160126-1627]\n at org.restlet.routing.Router.doHandle(Router.java:422)[303:org.restlet:2.3.6.v20160126-1627]\n at org.restlet.routing.Router.handle(Router.java:639)[303:org.restlet:2.3.6.v20160126-1627]\n at org.restlet.routing.Filter.doHandle(Filter.java:150)[303:org.restlet:2.3.6.v20160126-1627]\n at org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:140)[303:org.restlet:2.3.6.v20160126-1627]\n at org.restlet.routing.Filter.handle(Filter.java:197)[303:org.restlet:2.3.6.v20160126-1627]\n at org.restlet.routing.Filter.doHandle(Filter.java:150)[303:org.restlet:2.3.6.v20160126-1627]\n at org.restlet.routing.Filter.handle(Filter.java:197)[303:org.restlet:2.3.6.v20160126-1627]\n at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:202)[303:org.restlet:2.3.6.v20160126-1627]\n at org.restlet.Component.handle(Component.java:408)[303:org.restlet:2.3.6.v20160126-1627]\n at org.restlet.Server.handle(Server.java:507)[303:org.restlet:2.3.6.v20160126-1627]\n at org.restlet.engine.connector.ServerHelper.handle(ServerHelper.java:63)[303:org.restlet:2.3.6.v20160126-1627]\n at org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:143)[303:org.restlet:2.3.6.v20160126-1627]\n at org.restlet.engine.connector.HttpServerHelper$1.handle(HttpServerHelper.java:64)[303:org.restlet:2.3.6.v20160126-1627]\n at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79)[:1.8.0_131]\n at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83)[:1.8.0_131]\n at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:82)[:1.8.0_131]\n at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:675)[:1.8.0_131]\n at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79)[:1.8.0_131]\n at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:647)[:1.8.0_131]\n at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_131]\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_131]\n at java.lang.Thread.run(Thread.java:748)[:1.8.0_131]\n Caused by: com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0018: null\n at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:595)[530:com.ibm.mq.osgi.allclient:9.0.0.0]\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:215)[530:com.ibm.mq.osgi.allclient:9.0.0.0]\n at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:422)[530:com.ibm.mq.osgi.allclient:9.0.0.0]\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:8475)[530:com.ibm.mq.osgi.allclient:9.0.0.0]\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:7814)[530:com.ibm.mq.osgi.allclient:9.0.0.0]\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl._createConnection(JmsConnectionFactoryImpl.java:299)[530:com.ibm.mq.osgi.allclient:9.0.0.0]\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:236)[530:com.ibm.mq.osgi.allclient:9.0.0.0]\n at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6024)[530:com.ibm.mq.osgi.allclient:9.0.0.0]\n at com.ibm.mq.jms.MQConnectionFactory.createConnection(MQConnectionFactory.java:6049)[530:com.ibm.mq.osgi.allclient:9.0.0.0]\n at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184)[243:org.apache.servicemix.bundles.spring-jms:3.2.16.RELEASE_2]\n at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:456)[243:org.apache.servicemix.bundles.spring-jms:3.2.16.RELEASE_2]\n ... 67 more\n Caused by: com.ibm.mq.MQException: JMSCMQ0001: JMSCMQ0001, 2, MQCC_FAILED, 2195, MQRC_UNEXPECTED_ERROR\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:203)[530:com.ibm.mq.osgi.allclient:9.0.0.0]\n ... 76 more\n Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2195;AMQ9204: Connection to host 'localhost(1414)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2195],3=localhost(1414),5=JmqiDefaultThreadPool.enqueue]\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:2280)[530:com.ibm.mq.osgi.allclient:9.0.0.0]\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1285)[530:com.ibm.mq.osgi.allclient:9.0.0.0]\n at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:355)[530:com.ibm.mq.osgi.allclient:9.0.0.0]\n ... 75 more\n Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2195\n at com.ibm.mq.jmqi.JmqiDefaultThreadPool.enqueue(JmqiDefaultThreadPool.java:97)[530:com.ibm.mq.osgi.allclient:9.0.0.0]\n at com.ibm.mq.jmqi.remote.impl.RemoteConnection.setUpAsyncMode(RemoteConnection.java:1979)[530:com.ibm.mq.osgi.allclient:9.0.0.0]\n at com.ibm.mq.jmqi.remote.impl.RemoteConnection.initSess(RemoteConnection.java:1741)[530:com.ibm.mq.osgi.allclient:9.0.0.0]\n at com.ibm.mq.jmqi.remote.impl.RemoteConnection.connect(RemoteConnection.java:863)[530:com.ibm.mq.osgi.allclient:9.0.0.0]\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSessionFromNewConnection(RemoteConnectionSpecification.java:409)[530:com.ibm.mq.osgi.allclient:9.0.0.0]\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSession(RemoteConnectionSpecification.java:305)[530:com.ibm.mq.osgi.allclient:9.0.0.0]\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionPool.getSession(RemoteConnectionPool.java:146)[530:com.ibm.mq.osgi.allclient:9.0.0.0]\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1721)[530:com.ibm.mq.osgi.allclient:9.0.0.0]\n ... 77 more\n Caused by: com.ibm.msg.client.commonservices.CSIException: JMSCS0002\n at com.ibm.msg.client.commonservices.workqueue.PIWorkQueueManager.enqueueItem(PIWorkQueueManager.java:55)[530:com.ibm.mq.osgi.allclient:9.0.0.0]\n at com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.enqueue(WorkQueueManager.java:232)[530:com.ibm.mq.osgi.allclient:9.0.0.0]\n at com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.enqueue(WorkQueueManager.java:200)[530:com.ibm.mq.osgi.allclient:9.0.0.0]\n at com.ibm.mq.jmqi.JmqiDefaultThreadPool.enqueue(JmqiDefaultThreadPool.java:79)[530:com.ibm.mq.osgi.allclient:9.0.0.0]\n ... 84 more\n 2017-08-08 09:44:57,429 | INFO | estlet-672518929 | LogService | 303 - org.restlet - 2.3.6.v20160126-1627 | 2017-08-08 09:44:57 0:0:0:0:0:0:0:1 - - 8182 GET /service/getAll/ - 500 8856 0 4140 http://localhost:8182 Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:55.0) Gecko/20100101 Firefox/55.0 -For comparison/context, BELOW, is the working project that routes to an ActiveMQ queue...Here is the project structureaaa.bbb.ccc.CamelRestService.javapackage aaa.bbb.ccc;\n\nimport aaa.bbb.ccc.model.CamelRestPojo;\nimport javax.ws.rs.GET;\nimport javax.ws.rs.Path;\nimport javax.ws.rs.Produces;\nimport java.util.Collection;\nimport java.util.HashMap;\nimport java.util.Map;\nimport javax.ws.rs.core.MediaType;\n\n@Path(\"/service/\")\npublic class CamelRestService {\n Map itemMap = new HashMap<>();\n public CamelRestService() {\n init();\n }\n @GET\n @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) \n @Path(\"/getAll/\")\n public Collection getAll() {\n return itemMap.values();\n }\n\n final void init() {\n CamelRestPojo o = new CamelRestPojo();\n o.setName(\"JOE BLOW\");\n o.setId(100);\n itemMap.put(o.getId(), o);\n }\n}aaa.bbb.ccc.CamelRestRoute.javapackage aaa.bbb.ccc;\n\nimport org.apache.camel.builder.RouteBuilder;\nimport org.apache.camel.model.rest.RestBindingMode;\n\npublic class CamelRestRoutes extends RouteBuilder {\n\n public CamelRestRoutes() {\n }\n\n @Override\n public void configure() throws Exception {\n restConfiguration().component(\"restlet\")\n .host(\"localhost\")\n .port(8182)\n .bindingMode(RestBindingMode.json_xml);\n\n rest(\"/service\")\n .bindingMode(RestBindingMode.json_xml)\n .get(\"/getAll\")\n .produces(\"application/json\")\n .to(\"direct:thingX\");\n\n from(\"direct:thingX\")\n .to(\"bean:camelRestService?method=getAll\")\n .log(\"---------------------- (AAA) ----------------------> direct:thingX...:\" + body().toString())\n .to(\"direct:thingY\");\n\n from(\"direct:thingY\")\n .log(\"---------------------- (BBB) ----------------------> direct:thingY...:\" + body().toString())\n .to(\"direct:thingZ\");\n from(\"direct:thingZ\")\n .log(\"---------------------- (CCC) ----------------------> direct:thingZ...:\" + body().toString())\n .to(\"activemq:queue:bubblegum?jmsMessageType=Text&exchangePattern=InOnly\");\n }\n}aaa.bbb.ccc.model.CamelRestPojo.javapackage aaa.bbb.ccc.model;\n\nimport java.io.Serializable;\nimport javax.xml.bind.annotation.XmlElement;\nimport javax.xml.bind.annotation.XmlRootElement;\n@XmlRootElement(name = \"camelRestPojo\")\npublic class CamelRestPojo implements Serializable {\n @XmlElement\n private long id;\n @XmlElement\n private String name;\n public long getId() {\n return id;\n }\n public void setId(long id) {\n this.id = id;\n }\n public String getName() {\n return name;\n }\n public void setName(String name) {\n this.name = name;\n }\n @Override\n public String toString() {\n return \"CamelRestPojo{\" + \"id=\" + id + \", name=\" + name + '}';\n }\n}camel-route.xml\n\n \n \n aaa.bbb.ccc\n \n \n \n \n \n \n \n \npom.xml\n\n 4.0.0\n aaa.bbb.ccc\n camelRest\n 1\n bundle\n camelRest\n camelRest\n \n UTF-8\n true\n \n \n \n org.apache.camel\n camel-core\n 2.17.0\n provided\n \n \n org.apache.camel\n camel-restlet\n 2.17.0 \n provided \n \n \n org.apache.camel\n camel-cxf\n 2.17.0\n provided \n \n \n org.apache.activemq\n activemq-camel\n 5.11.0\n provided \n \n \n \n ${project.artifactId}-${project.version}\n \n \n src/main/resources\n true\n \n \n \n \n org.apache.maven.plugins\n maven-compiler-plugin\n 3.1\n \n 1.8\n 1.8\n true\n \n \n \n org.apache.felix\n maven-bundle-plugin\n 3.3.0\n true\n \n \n ${project.groupId}.${project.artifactId}\n aaa.bbb.ccc*\n *\n \n \n \n \n \ntest url/return valueURL:\nhttp://localhost:8182/service/getAll/\n\nRETURNS:\n[{\"id\": 100,\"name\": \"JOE BLOW\"}]EnvironmentIBM MQ server 9.0.3.0\nIBM MQ client 8.0.0.7\njdk1.8.0_131\njboss-fuse-6.3.0.redhat-187### Assistant: I've worked on a few Fuse/W-MQ integration exercises. Bundling the W-MQ client drivers into your application probably won't work on Fuse. You need to install the W-MQ client JARs into the Fuse run-time. IBM provides OSGi-compliant versions for that purpose.My recollection is that there are nine in total, but not all are needed in all configurations. You can install them using osgi:install at the Karaf prompt, or just dump them in the deploy/ directory for testing purposes. Some configuration changes might need to be made in Fuse -- these depend on the specific version combination.Your connection factory configuration looks broadly correct.\n"} +{"text": "### Human: In order to integrate with a data provider, I have to send and receive requests across an IBM MQ channel. I will send a request over and receive a request back from the provider. In this process though, I may be sending hundreds of requests per second and need to be able to \"match\" the responses to the corresponding requesting threads.I don't want to send the request and then just continue to Get from the queue until the response has arrived because that could be a lot of traffic if potentially hundreds of threads are pinging the queue checking for their response, and I also don't want to wait a period of time and then check because I want the results to be real time.Is there a way to subscribe not just to a queue, but to a specific response id or something coming back on the queue? This seems like something that should be doable, but I can't find it in their documentation.### Assistant: You do know that you can do an 'MQGET with wait'?(1) A default MQGET will get the next message off the queue or return with RC 2033 (No message available).(2) The program can do an 'MQGET with wait' where you specify 'x' milliseconds to wait before returning RC of 2033 if no message was available. Note: If the message IS available then the MQGET returns as soon as the message is available - it does not wait the entire wait internal before returning.MQMessage msg = new MQMessage();\nMQGetMessageOptions gmo = new MQGetMessageOptions();\ngmo.Options |= MQC.MQGMO_WAIT | MQC.MQGMO_FAIL_IF_QUIESCING;\ngmo.WaitInterval = 60000; // wait 60 seconds\n\ntry\n{\n inQ.Get(msg, gmo);\n System.Console.Out.WriteLine(\"Message Data: \" + msg.ReadString(msg.MessageLength));\n}\ncatch (MQException mqex)\n{\n System.Console.Out.WriteLine(\"MQTest62B CC=\" + mqex.CompletionCode + \" : RC=\" + mqex.ReasonCode);\n if (mqex.Reason == MQC.MQRC_NO_MSG_AVAILABLE)\n {\n // no meesage - life is good - loop again\n }\n}\n"} +{"text": "### Human: I want my JAVA application to communicate with Mainframe. I want mainframe to send the data in a text file to MQ and from MQ I can read it.Currently our Mainframe developer is able to send everything in a single line. He sends it like a big message and I want the content to be sent in a text file.\nIs that possible? Does Mainframe support file sending to MQ?### Assistant: This is no big deal - I've been doing this for 20 years.Clearly, you have limited knowledge of MQ and z/OS (mainframe). A file is a file is a file whether it is on a PC or Unix/Linux or the mainframe.As other people have pointed out, MQ deals with messages and not files but you can put a file as a message. MQ treats the message data (aka payload) as a blob. The message data can be an XML file or PNG or PDF or simple text, etc.The difference between a file on a given platform is the termination of a line (aka record). On a PC it is CRLF, on Unix/Linux it is LF and Mac OS X it is CR. The mainframe does not have that concept. On the mainframe, you have either fixed record length or variable record length files (aka datasets).If the mainframe program is loading a fixed record length file then life is very straight forward. Simply ask the mainframe developer what the record length is (i.e. 80) then parse the message data in chunks. If it is variable length record then ask the mainframe developer to insert a CR (x'0D') after each record then when your application receives it, you will know where the termination of a line is.\n"} +{"text": "### Human: I want to set the mqclient.ini location to custom one rather than c:/program files(x86) /IBM/webspheremq.I am using mqseries.net with c#.\nWebsphere MQ version 7.5.0.0I have read somewhere to use MQCLNTCF environment variable. But I am not sure how to use it? I am not able to find variable under MQEnvironment object.Any help would be appreciated.### Assistant: Do you know what a Windows Environment Variable is?In a Windows batch file, do the following:set MQCLNTCF=C:\\some\\pathOr make it global by going to Control Panel -> System -> Advanced System Setting -> Environment Variablesthen set the variable as either a User or System environment variable.Finally, did you read point #2 of that link? That is the easiest way of handling the mqclient.ini file.\n"} +{"text": "### Human: I've created a utility in Java which picks up XML files, sends them over to a queue on IBM MQ. When I go into IBM MQ Explorer, the message is showing as received, but there is an ASCII character in front if it (as shown in the \"Message Data\" field in the image below) which is resulting in it not being recognized as a properly formatted SOAP message which the queue can process. I have tried using XML editors to make sure that my XML files don't have any non-white space characters, but that hasn't resolved the issue.Here is my code which I am using to put the file on the queue:* sending message to MQ\n * \n * @param file\n * @return messageId\n * @throws UnsupportedEncodingException\n * @throws IOException\n */\nprivate byte[] sendMessageToMQ(File file) throws UnsupportedEncodingException, IOException {\n\n int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT;\n try {\n defaultLocalQueue = qManager.accessQueue(queueName, openOptions);\n\n MQMessage putMessage = new MQMessage();\n\n String msg = readFile(file);\n putMessage.writeUTF(msg);\n\n // specify the message options...\n MQPutMessageOptions pmo = new MQPutMessageOptions();\n // accept\n // put the message on the queue\n defaultLocalQueue.put(putMessage, pmo);\n\n System.out.println(\"Message is put on MQ.\");\n\n return putMessage.messageId;\n\n } catch (MQException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n}### Assistant: writeUTF is documented as prefixing the data with the lengthhttps://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.dev.doc/q030840_.htmNote: The writeUTF() method of MQMessage automatically encodes the\n length of the string as well as the Unicode bytes it contains. When\n your message will be read by another Java program (using readUTF()),\n this is the simplest way to send string information.You can set the characterSet of the MQMessage to 1208 (or whatever the ccsid of the message is currently according to the explorer), then use the writeString methodhttps://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000000023465If you need UTF-8 text in your message, but don't require the two byte\n length field, set the characterSet field to 1208 (which is the CCSID\n for UTF-8) and use writeString().Note although this article talks about .net, but the same is true for Java:http://www-01.ibm.com/support/docview.wss?uid=swg21267940\n"} +{"text": "### Human: I'm trying to put MQMD.MsgId to XMLNSC.MsgId field, like this:SET OutputRoot.XMLNSC.Root.MsgId = InputRoot.MQMD.MsgId;But I'm gettingX'414d51204d39392e5352442e4330302e56c47bd4203b3708'instead of just414d51204d39392e5352442e4330302e56c47bd4203b3708.Also i've tried to cast MsgId to CHARACTER, but result is the same.How to get rid of quotes and 'X'?### Assistant: I don't have enough reputation to 'add a commment' yet, but working with so many languages, I've learned to dislike SUBSTRING and LENGTH type functions. In the case of answer 'Feb 28 2016 at 10:41' above (yes I found this answer in response to my own search - for the \"CAST(InputRoot.MQMD.MsgId AS CHAR)\" above, I chose to use this instead:DECLARE MsgId CHAR RIGHT(LEFT(CAST(InputRoot.MQMD.MsgId AS CHAR),50),48);This assumes MsgId is always 24 hex pairs long (24x2=48) and goes for LEFT 50 first (taking off the last single quote), then RIGHT 48 (taking off the first X char and the first single quote). Does anyone disagree with the assumption? It also has the bonus of condensing to one line as it's not necessary to have two references to \"MsgId\" in 'SUBSTRING'\n"} +{"text": "### Human: I have the requirement like connecting MQ with userid instead of channel.I have tried with setting user id and password without chanel to MQEnvironment class but got the below exception.com.ibm.mq.jmqi.JmqiException: CC=2;RC=2540;AMQ9520: Channel not defined remotely. [3=].Please guide me, is it possible to write java client to connect MQ with user id instead of channel.### Assistant: There are 2 ways for an MQ application to connect to a queue manager: bindings and client mode.Bindings mode means that your MQ application is running on the SAME\nserver as the queue manager. Hence, the MQI calls will not use\nnetwork resources.Client mode means that your MQ application can run on any server and\nit will use network resources when it issues MQI calls. For the\nMQCONN call, besides the queue manager name, you will also need the\nhostname/IP address, port # and channel name.In either case, your MQ application should be supplying its user credentials (UserID & Password).Finally, do NOT use the MQEnvironment class. It is far, far better to use a HashTable and pass it to the queue manager constructor class. i.e.Hashtable mqht = new Hashtable();\nmqht.put(CMQC.CHANNEL_PROPERTY, channelName);\nmqht.put(CMQC.HOST_NAME_PROPERTY, hostName);\nmqht.put(CMQC.PORT_PROPERTY, new Integer(portNumber));\nmqht.put(CMQC.USER_ID_PROPERTY, userID);\nmqht.put(CMQC.PASSWORD_PROPERTY, password);\ntry\n{\n MQQueueManager qMgr = new MQQueueManager(qMgrName, mqht);\n System.out.println(\"Successfully connected to \"+ qMgrName);\n}\ncatch (com.ibm.mq.MQException mqex)\n{\n System.out.println(\"MQException cc=\" +mqex.completionCode + \" : rc=\" + mqex.reasonCode);\n}\n"} +{"text": "### Human: I would like my Java MQ client to be able to access (do puts) to multiple MQ server endpoints (by endpoint i mean 'host/port/Qmanager/Queue/Channel'). Basically this Java app will get a request to put a message and the endpoint detail along with the request. It should be able to find the corresponding connection pool for the endpoint and use it to do the put.\nFrom my limited understanding so far, the MQEnvironment is a global configuration (only one is possible in one JVM?) which can be configured to one endpoint at a time. So if the idea is multiple threads accessing multiple MQserver endpoints parallely - this does not seem to implementable with current understanding.### Assistant: You can also use a Hashtable to pass connection parameters while creating a connection to queue manager. For example:Hashtable properties;\n properties = new Hashtable();\n properties.put(\"hostname\", \"remotehost\");\n properties.put(\"port\", new Integer(1414));\n properties.put(\"channel\", \"REMOTEQM.SVRCONN\");\n MQQueueManager queueManager = new MQQueueManager(queueManagerName, properties);\n"} +{"text": "### Human: In the Queue manager object we have a parameter under log section to define the log write integrity. What is the difference betweenSingleWrite,DoubleWriteandTripleWritein IBM MQ log write integrity ? Please explain in detail.### Assistant: LogWriteIntegrityis all about how the queue manager logger writes partial 4KB pages. Unless you areabsolutely certainthat your file system provides atomically written pages underall circumstancesyou should leave it at the default setting ofTripleWrite. The option to set anything other thanTripleWriteonly exists because of a possible performance enhancement, however since partial pages should be rare with a queue manager with a good amount of concurrent work going on, it's not a big area for performance improvement, and a better way to improve the performance of your queue manager is to increase concurrency rather than the risks associated with changing this setting.There is a very useful blog post from MQ Development that you should read. You can find it here:LogWriteIntegrity.... should I pick SingleWrite or TripleWrite?\n"} +{"text": "### Human: I have two network zones devided by a firewall. In the two zones there are QMs that exchange messages. Now I would like to add other two QMs, on each side one, that would serve for transferring non-critical messages such as logging events. Not to saturate the firewall, I would like to limit the speed between these two new QMs.Is it possible to finetune maximum speed of the MQ Channels?### Assistant: Is it possible to finetune maximum speed of the MQ Channels?No. But there is an add on product calledMQ Channel Throttlerthat will do it.\n"} +{"text": "### Human: I am new to Websphere MQ (IBM z/OS) technologies. We had a requirement to implement a standalone application that uses JMS technology to connect to an MQ server (on IBM z/OS. This is maintained by a different organization for which we have only limited access) and put a message on the queue.Here are pieces of my code below.private void sendMessage(String queue, String msg) {\n JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\n JmsConnectionFactory cf = ff.createConnectionFactory();\n\n cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, host);\n cf.setIntProperty(WMQConstants.WMQ_PORT, port);\n cf.setStringProperty(WMQConstants.WMQ_CHANNEL, channel);\n cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\n cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, queueManagerName);\n cf.setStringProperty(WMQConstants.USERID, user);\n cf.setStringProperty(WMQConstants.PASSWORD, password);\n\n Connection connection = null;\n Session session = null;\n Destination destination = null;\n MessageProducer producer = null;\n\n\n connection = cf.createConnection(user, password);\n session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);\n destination = session.createQueue(queue);\n //((MQDestination)destination).setCCSID(37);\n producer = session.createProducer(destination);\n\n TextMessage message = session.createTextMessage();\n message.setIntProperty(WMQConstants.JMS_IBM_CHARACTER_SET, 37);\n //message.setIntProperty(WMQConstants.JMS_IBM_ENCODING, 785);\n\n message.setText(msg);\n // Start the connection\n connection.start();\n\n // And, send the message\n producer.send(message);\n}I was successfully able to connect to the MQ server on the other end and put the messages on the remote server in ASCII format. I was able to consume the message that I have put on the queue from an AIX server.But since the MQ is running on z/OS and the consumer is also an Mainframe application the message I put appears to be a garbage/unreadable format. After some research I figured out that messages needs to be converted to EBCDIC to be put on z/OS MQ. I expected that this will be taken care of by the IBM MQ libraries.Please help on how can I put the messages in EBCDIC format.### Assistant: You are doing this wrong:message.setIntProperty(WMQConstants.JMS_IBM_CHARACTER_SET, 37);You need to declare the character set that you are putting on the queue. Since that looks like Java, I'm assuming it is a UTF-16 string. Declare it as 1208, not 37.On the other end, if they want it in EBCDIC, they will do a GET-With-Convert, declaring that they want to receive it in IBM 37/1140 and MQ will invoke Unicode Conversion Services for z/OS and make it happen.\n"} +{"text": "### Human: The configured MQ message endpoints get paused automatic many times and we had to keep eye-on and then resume it manually.\nAny idea on why it gets auto-paused? \nIs the receiver channel gets full with MQ messages ?MQ version 6 is being used currently in our application to communicate with external system through messages.Due to this issue, the feature which uses that listener does not provide the service intermittently until we manual resume the endpoints.IBM Websphere Console: Application->Application Types->Websphere Enterprise Applications-> WC Comm01->Runtime Tab->Manage Message Endpoints.### Assistant: The message endpoint is being paused because there was an error in processing the MDB and the behaviour of pausing(stopping) the endpoint is what has been configured on the activation specification. Have a look at this page:https://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.iseries.doc/ae/umj_pasm_advprops.html?lang=enfor details on the advanced settings. The properties you are interested in is the \"Stop endpoint if message delivery fails\" and \"Number of sequential message delivery failures before suspending endpoint\".So you could turn off the \"Stop endpoint if message delivery fails\" and this would stop your message endpoint from auto-pausing. However, you will still have message delivery failures and the message delivery will be retried to the MDB. I would check the application server logs to see what the error is in your MDB and fix that issue (if you can). You can then determine whether you want to the endpoint to auto-pause or maybe configure it so it auto-pauses but only after a larger number of sequential failures than what is currently configured.\n"} +{"text": "### Human: We are experimenting with IBM's WebSphere Liberty profile. Now we have trouble to connect to our WebSphere MQ server. It works for normal WebSphere profile. We followed this tutorialhttps://developer.ibm.com/wasdev/2013/06/14/using-websphere-mq-with-the-liberty-profile/and I ran into the following Exception:Stack Dump = java.lang.ClassNotFoundException: com.ibm.mq.jms.MQQueueAny idea what I could change, so that this class could be found?I am working with Liberty Profile, version 8.5.5.3.myserver.xmllooks the following:\n\n \n \n jsf-2.0\n jpa-2.0\n jndi-1.0\n localConnector-1.0\n beanValidation-1.0\n wasJmsClient-1.1\n jaxws-2.2\n jmsMdb-3.1\n \n\n \n \n\n \n \n \n\n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n\n### Assistant: You have the wrong feature there. It should be:wmqJmsClient-1.1not:wasJmsClient-1.1the later one is for built in messaging not MQ.\n"} +{"text": "### Human: I am working on a monitor application for some IBM MQ queues. I am trying to implement a way in which I can transfer all messages from one queue to another. Will the get(msg) method remove a message from the queue? Or will it just retrieve a copy of it?Here is my code:private void moveMessages(String qName, String moveToThisQ) {\n try {\n MQQueue q = qm.accessQueue(qName, MQConstants.MQOO_INQUIRE);\n MQQueue qMoveHere = qm.accessQueue(moveToThisQ,\n MQConstants.MQOO_INQUIRE);\n while (q.getCurrentDepth() != 0) {\n MQMessage msg = new MQMessage();\n q.get(msg);\n qMoveHere.put(msg);\n }\n if (q != null)\n q.close();\n if (qMoveHere != null)\n qMoveHere.close();\n } catch (MQException e) {\n e.printStackTrace();\n }\n}If anyone could offer any insight as tho the effects of the get(msg) will have on the queue? From the examples I've looked at, I might have to pass an option along with the get method? maybe not?!### Assistant: while (q.getCurrentDepth() != 0)Never ever do this in MQ. A message could be on the queue but not available to your application yet and yes, current depth would be greater than 1.Also, doing what you are doing will not keep the information in the MQMD header. Most fields will be re-initialized on the put call. Go look up MQOO_PASS_ALL_CONTEXT and MQOO_SAVE_ALL_CONTEXT in the manual.\n"} +{"text": "### Human: I have a C# listener for IBM MQ like below. Only listener method mentioned here.private void OnMessage(IMessage msg)\n{\n try\n {\n\n ITextMessage textMsg = (ITextMessage)msg;\n Console.Write(\"Got a message: \");\n Console.WriteLine(textMsg.Text);\n\n }\n catch(Exception ex)\n {\n }\n}Whenever a text format message has been reached in side my queue, above listener is invoking and i am able to read values.Problem is that if you stop the listener and then push a message, that\n message is retaining in MQ Explorer. But if the listener method has been invoked, the\n message has been deleting from \"Web Sphere MQ Explorer\" always just after\n read from the listener method. Do I need to set some more\n configuration to retain my messages even after my listener read it?### Assistant: There are 2 ways to read messages from a queue:destructive get (default)using a non-destructive get (aka browse)If you want to only browse messages in a queue then use the non-destructive get.\n"} +{"text": "### Human: I'm currently writing an Application for viewing messages in an IBM MQ.\nNow I am implementing pagination. I have Queues with arround 40000 entries.\nI wrote code (see shortened example) that just skips the messages I dont want to display and only handles the messages I want to display. However this is very slow (>45 seconds).\nTherefore my question is: can I set the cursor explicitly for example to position 35900? I could not find anything in the IBM documentation.import com.ibm.mq.*;\n\npublic class IBMMQMessageBrowser {\n private static final String QUEUE_MANAGER_NAME = \"QMGR_NAME\";\n private static final String QUEUE_NAME = \"QUEUE_NAME\";\n private static final int START_MESSAGE_NUMBER = 100;\n private static final int END_MESSAGE_NUMBER = 200;\n\n public static void main(String[] args) {\n try {\n MQQueueManager queueManager = new MQQueueManager(QUEUE_MANAGER_NAME);\n int openOptions = MQC.MQOO_BROWSE | MQC.MQOO_INQUIRE;\n MQQueue queue = queueManager.accessQueue(QUEUE_NAME, openOptions);\n\n MQMessage message = new MQMessage();\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.options = MQC.MQGMO_BROWSE_FIRST;\n\n int messageCounter = 0;\n\n while (true) {\n try {\n queue.get(message, gmo); //Even if i set the desired message size to 0 for Messages I want to skip it is very slow.\n messageCounter++;\n\n // Check if we are within the desired range\n if (messageCounter >= START_MESSAGE_NUMBER && messageCounter <= END_MESSAGE_NUMBER) {\n // Process the message here (e.g., print its contents)\n System.out.println(\"Message: \" + message.readStringOfByteLength(message.getMessageLength()));\n }\n\n // Break the loop if we have reached the end of the range\n if (messageCounter > END_MESSAGE_NUMBER) {\n break;\n }\n\n gmo.options = MQC.MQGMO_BROWSE_NEXT;\n } catch (MQException mqe) {\n if (mqe.reasonCode == MQException.MQRC_NO_MSG_AVAILABLE) {\n break; // No more messages to browse\n } else {\n throw mqe; // Handle other exceptions\n }\n }\n }\n\n queue.close();\n queueManager.disconnect();\n } catch (MQException mqe) {\n // Handle MQException\n mqe.printStackTrace();\n }\n }\n}### Assistant: IBM MQ has a few quirks. I'll try not to go too technically in-depth but you & future readers need to understand how to deal with these quirks.There is no ability to move the 'read' cursor forward other than actually getting or browsing a message.There may be far more MQGETs performed than you actually realize.The reason why it takes more than 45 seconds to get to message # 39,500 is because you are pulling all of the data across the network. By that I mean, if the average message size was 100k and you retrieved 39,500 messages, then you dragged a minimum of 3.8GB of data across the network to get to message number 39,500 plus a minimum of 39,500 MQGET API calls.Now why do I say \"minimum\" of 39,500 MQGET API calls? It is because for Java, JMS and .NET applications, the MQ Client library preallocates a 4KB buffer to retrieve the message. So, under the covers, it may take 2 MQGETs to actually retrieve your message if it is larger than 4KB.I've written a lot about it on my blog:JMS and Java Client Mode Performance Issues for MQ Get API CallsHow to Improve Your Java/JMS MQ Tuning Cred.Tuning Java Programs for Optimum MQ Get API Calls PerformanceNow to the second part, how to speed up moving the cursor from the current message to say message number 39,500.There are 3 get methods for the MQQueue class:https://www.ibm.com/docs/en/ibm-mq/latest?topic=java-mqqueueYou should be using the get method that takes 3 parameters for when you are simply wanting to move the cursor forward.public void get(MQMessage message,\n MQGetMessageOptions getMessageOptions,\n int maxMsgSize)\n throws MQExceptionTherefore, in the loop for moving the cursor forward, you change:queue.get(message, gmo);toqueue.get(message, gmo, 0);There used to be a weird bug if you set the max message length to zero but it appears that it has been fixed. I still use 1 just to make sure I don't hit that issue.And you need to add the MQGMO_ACCEPT_TRUNCATED_MSG option to GMO options.\ni.e.gmo.options = CMQC.MQGMO_BROWSE_NEXT + CMQC.MQGMO_FAIL_IF_QUIESCING + CMQC.MQGMO_ACCEPT_TRUNCATED_MSG;Finally, you should ALWAYS have \"Fail if Quiescing\" options added to MQ API calls like MQOPEN, MQGET, MQPUT, etc.When you set the max. message length to zero & add the MQGMO_ACCEPT_TRUNCATED_MSG option, the MQGET call will throw an MQ exception of 2079 - MQRC_TRUNCATED_MSG_ACCEPTED which is perfectly normal. MQ will return the MQMD of the message along with an empty message buffer. You just handle the MQ exception and loop again for the next message.Hence, the time it takes to move the cursor to message number 39,500 should now be under 5 seconds, maybe even less than 1 second depending on your network traffic.\n"} +{"text": "### Human: I want to use a Spring Boot Apache Camel application to get a message on IBM MQ. I am currently setting up the JMS connection, but I receive an error about a class not found. I thought it had something to do with dependencies so I tried a lot of different things, but the error stays the same.import com.ibm.mq.MQEnvironment;\nimport com.ibm.msg.client.wmq.common.CommonConstants;\n//import org.apache.camel.component.jms.JmsComponent;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.springframework.beans.factory.annotation.Value;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.ComponentScan;\nimport org.springframework.context.annotation.Configuration;\nimport com.ibm.mq.jms.MQQueueConnectionFactory;\nimport org.springframework.jms.annotation.EnableJms;\nimport com.ibm.msg.client.wmq.WMQConstants;\n\nimport javax.net.ssl.*;\nimport java.security.KeyStore;\n\n\n@EnableJms\n@Configuration\npublic class JmsConfiguration {\n\n private static final Logger LOG = LoggerFactory.getLogger(JmsComponent.class);\n private String host = \"xxx\";\n private int port = 4510;\n private String queueManager = \"xxx\";\n private String channel = \"xxx\";\n //private String username = \"\";\n //private String password = \"\";\n private String sslCipherSuite = \"TLS_RSA_WITH_AES_256_CBC_SHA256\";\n\n @Value(\"${keyStore}\")\n private String keyStore;\n\n @Value(\"${keyStorePassword}\")\n private String keyStorePassword;\n\n @Value(\"${trustStore}\")\n private String trustStore;\n\n @Value(\"${trustStorepassword}\")\n private String trustStorePassword;\n\n\n @Bean\n public JmsComponent mq() {\n JmsComponent jmsComponent = new JmsComponent();\n jmsComponent.setConnectionFactory(mqQueueConnectionFactory());\n return jmsComponent;\n }\n\n @Bean\n public MQQueueConnectionFactory mqQueueConnectionFactory() {\n MQQueueConnectionFactory mqQueueConnectionFactory = new MQQueueConnectionFactory();\n mqQueueConnectionFactory.setHostName(host);\n try {\n //Load trust store\n //System.setProperty(\"javax.net.ssl.trustStore\", trustStore);\n //System.setProperty(\"javax.net.ssl.trustStorePassword\", trustStorePassword);\n //Load keystore\n //System.setProperty(\"javax.net.ssl.keyStore\", keyStore);\n //System.setProperty(\"javax.net.ssl.keyStorePassword\", keyStorePassword);\n\n //keystore fetch\n String keystoreKey = \"${keyStorePassword}\";\n KeyStore keyStore = KeyStore.getInstance(\"JKS\");\n keyStore.load(Thread.currentThread().getContextClassLoader().getResourceAsStream(\"${keyStore}\"),\n keystoreKey.toCharArray());\n\n // Create key manager\n KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(\"SunX509\");\n keyManagerFactory.init(keyStore, keystoreKey.toCharArray());\n KeyManager[] km = keyManagerFactory.getKeyManagers();\n\n // Create trust manager\n TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(\"SunX509\");\n trustManagerFactory.init(keyStore);\n TrustManager[] tm = trustManagerFactory.getTrustManagers();\n\n // Initialize SSLContext\n SSLContext sslContext = SSLContext.getInstance(\"TLSv1\");\n sslContext.init(km, tm, null);\n SSLSocketFactory sslSocketFactory = sslContext.getSocketFactory();\n\n mqQueueConnectionFactory.setPort(port);\n mqQueueConnectionFactory.setChannel(channel);\n mqQueueConnectionFactory.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n mqQueueConnectionFactory.setObjectProperty(WMQConstants.WMQ_SSL_SOCKET_FACTORY, sslSocketFactory);\n mqQueueConnectionFactory.setSSLCipherSuite(sslCipherSuite);\n mqQueueConnectionFactory.setIntProperty(CommonConstants.WMQ_CONNECTION_MODE, CommonConstants.WMQ_CM_CLIENT);\n mqQueueConnectionFactory.setTransportType(CommonConstants.WMQ_CM_BINDINGS);\n\n MQEnvironment.sslSocketFactory = sslSocketFactory;\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n return mqQueueConnectionFactory;\n }\n}\n\n 4.0.0\n \n org.springframework.boot\n spring-boot-starter-parent\n 3.0.8\n \n \n nl.test\n Testapp\n 0.0.1-SNAPSHOT\n Testapp\n Testapp\n \n 17\n \n \n \n org.apache.camel.springboot\n camel-spring-boot-starter\n 4.0.0-M3\n \n \n org.springframework\n spring-jms\n 4.3.3.RELEASE\n \n \n org.apache.camel.springboot\n camel-jms-starter\n 4.0.0-M3\n \n \n org.springframework.boot\n spring-boot-devtools\n runtime\n true\n \n \n org.springframework.boot\n spring-boot-starter-test\n test\n \n \n com.ibm.mq\n com.ibm.mq.allclient\n 9.1.0.5\n \n \n org.apache.logging.log4j\n log4j-api\n 2.20.0\n \n \n jakarta.jms\n jakarta.jms-api\n 3.0.0\n \n \n\n \n \n \n org.springframework.boot\n spring-boot-maven-plugin\n \n \n \n\nThis is the stacktrace:java.lang.NoClassDefFoundError: jakarta/jms/ConnectionFactory\n at java.base/java.lang.Class.getDeclaredFields0(Native Method) ~[na:na]\n at java.base/java.lang.Class.privateGetDeclaredFields(Class.java:3353) ~[na:na]\n at java.base/java.lang.Class.getDeclaredField(Class.java:2661) ~[na:na]\n at org.springframework.boot.context.properties.bind.DefaultBindConstructorProvider$Constructors.isInnerClass(DefaultBindConstructorProvider.java:145) ~[spring-boot-3.0.8.jar:3.0.8] \n at org.springframework.boot.context.properties.bind.DefaultBindConstructorProvider$Constructors.getCandidateConstructors(DefaultBindConstructorProvider.java:135) ~[spring-boot-3.0.8.jar:3.0.8] \n at org.springframework.boot.context.properties.bind.DefaultBindConstructorProvider$Constructors.getConstructors(DefaultBindConstructorProvider.java:103) ~[spring-boot-3.0.8.jar:3.0.8] \n at org.springframework.boot.context.properties.bind.DefaultBindConstructorProvider.getBindConstructor(DefaultBindConstructorProvider.java:55) ~[spring-boot-3.0.8.jar:3.0.8] \n at org.springframework.boot.context.properties.ConfigurationPropertiesBean.deduceBindMethod(ConfigurationPropertiesBean.java:328) ~[spring-boot-3.0.8.jar:3.0.8] \n at org.springframework.boot.context.properties.ConfigurationPropertiesBeanRegistrar.createBeanDefinition(ConfigurationPropertiesBeanRegistrar.java:93) ~[spring-boot-3.0.8.jar:3.0.8] \n at org.springframework.boot.context.properties.ConfigurationPropertiesBeanRegistrar.registerBeanDefinition(ConfigurationPropertiesBeanRegistrar.java:89) ~[spring-boot-3.0.8.jar:3.0.8] \n at org.springframework.boot.context.properties.ConfigurationPropertiesBeanRegistrar.register(ConfigurationPropertiesBeanRegistrar.java:61) ~[spring-boot-3.0.8.jar:3.0.8] \n at org.springframework.boot.context.properties.ConfigurationPropertiesBeanRegistrar.register(ConfigurationPropertiesBeanRegistrar.java:55) ~[spring-boot-3.0.8.jar:3.0.8] \n at java.base/java.lang.Iterable.forEach(Iterable.java:75) ~[na:na] \n at org.springframework.boot.context.properties.EnableConfigurationPropertiesRegistrar.registerBeanDefinitions(EnableConfigurationPropertiesRegistrar.java:49) ~[spring-boot-3.0.8.jar:3.0.8] \n at org.springframework.context.annotation.ImportBeanDefinitionRegistrar.registerBeanDefinitions(ImportBeanDefinitionRegistrar.java:86) ~[spring-context-6.0.10.jar:6.0.10] \n at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.lambda$loadBeanDefinitionsFromRegistrars$1(ConfigurationClassBeanDefinitionReader.java:373) ~[spring-context-6.0.10.jar:6.0.10] \n at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:729) ~[na:na] \n at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromRegistrars(ConfigurationClassBeanDefinitionReader.java:372) ~[spring-context-6.0.10.jar:6.0.10] \n at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:148) ~[spring-context-6.0.10.jar:6.0.10] \n at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:120) ~[spring-context-6.0.10.jar:6.0.10] \n at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:427) ~[spring-context-6.0.10.jar:6.0.10] \n at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:287) ~[spring-context-6.0.10.jar:6.0.10] \n at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:344) ~[spring-context-6.0.10.jar:6.0.10] \n at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:115) ~[spring-context-6.0.10.jar:6.0.10] \n at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:771) ~[spring-context-6.0.10.jar:6.0.10] \n at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:589) ~[spring-context-6.0.10.jar:6.0.10] \n at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732) ~[spring-boot-3.0.8.jar:3.0.8] \n at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[spring-boot-3.0.8.jar:3.0.8] \n at org.springframework.boot.SpringApplication.run(SpringApplication.java:310) ~[spring-boot-3.0.8.jar:3.0.8] \n at org.springframework.boot.SpringApplication.run(SpringApplication.java:1304) ~[spring-boot-3.0.8.jar:3.0.8] \n at org.springframework.boot.SpringApplication.run(SpringApplication.java:1293) ~[spring-boot-3.0.8.jar:3.0.8] \n at nl.rabobank.mqputter.MqPutterApplication.main(MqPutterApplication.java:10) ~[classes/:na] \n at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[na:na] \n at java.base/java.lang.reflect.Method.invoke(Method.java:578) ~[na:na]\n at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:50) ~[spring-boot-devtools-3.0.8.jar:3.0.8] \nCaused by: java.lang.ClassNotFoundException: jakarta.jms.ConnectionFactory \n at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) ~[na:na] \n at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) ~[na:na] \n at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[na:na] \n ... 35 common frames omitted### Assistant: At the very least you need to include the Jakarta Messaging API jar in your application's classpath.You may also need to upgrade your IBM MQ client to 9.3 as it supports Jakarta Messaging (i.e. classes injakarta.jms.*).\n"} +{"text": "### Human: I'm trying to connect to a SSL enabled MQ channel in order to place a message using JMS(within Spring boot app) . below are the connection factory properties set before sending the message. I'm getting the\nfollowing error when jms trying to put the message.Caused by: com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2397' ('MQRC_JSSE_ERROR')....\n.....\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:203)\nCaused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target\n at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:439)\n at java.base/sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:306)\n at java.base/sun.security.validator.Validator.validate(Validator.java:264)\n at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:231)\n at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:132)\n at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:638)\n ... 81 more\nCaused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target\n at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)\n at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)\n at java.base/java.security.cert.CertPathBuilder.build(CertPathBuilder.java:297)\n at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:434)** certificates are already installed at QM level. it seems jms client is not picking the root certificate from the specified location. the CA root certificate(myCAcertfile.cer) (self signed) was generated using runmqckm tool in IBM mq.MQ channel informationCHANNEL(KAU.CONN) CHLTYPE(SVRCONN)\n ALTDATE(2014-02-28) ALTTIME(17.28.55)\n CERTLABL( ) COMPHDR(NONE)\n COMPMSG(NONE)\n DESCR(Server-connection to windows host)\n DISCINT(0) HBINT(300)\n KAINT(AUTO) MAXINST(999999999)\n MAXINSTC(999999999) MAXMSGL(4194304)\n MCAUSER( ) MONCHL(QMGR)\n RCVDATA( ) RCVEXIT( )\n SCYDATA( ) SCYEXIT( )\n SENDDATA( ) SENDEXIT( )\n SHARECNV(10) SSLCAUTH(REQUIRED)\n SSLCIPH(TLS_RSA_WITH_AES_128_CBC_SHA256)\n SSLPEER( ) TRPTYPE(TCP)JMS connection factory properties// Create a connection factory\n JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\n JmsConnectionFactory cf = ff.createConnectionFactory();\n\n // Set the properties\n cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, HOST);\n cf.setIntProperty(WMQConstants.WMQ_PORT, PORT);\n cf.setStringProperty(WMQConstants.WMQ_CHANNEL, CHANNEL);\n cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\n cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, QMGR);\n cf.setStringProperty(WMQConstants.WMQ_APPLICATIONNAME, \"Manual message publihser\");\n cf.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, true);\n cf.setStringProperty(WMQConstants.USERID, \"\");\n cf.setStringProperty(WMQConstants.PASSWORD, \"\");\n\n\n System.setProperty(\"com.ibm.mq.cfg.useIBMCipherMappings\", \"false\" );\n \n cf.setStringProperty(\"Djavax.net.ssl.trustStore\", \"D:\\\\mq-message-handler-1.0\\\\ssl\\\\myCAcertfile.cer\");\n cf.setStringProperty(WMQConstants.WMQ_SSL_CIPHER_SUITE, \"TLS_RSA_WITH_AES_128_CBC_SHA256\");Commands used to create CA's certificaterunmqckm -keydb -create -db myCA.kdb -type cms -pw mycakeypassword -stash\nrunmqckm -cert -create -db myCA.kdb -type cms -label \"myCAcertificate\" -dn \"CN=demmoCA,O=DemmoOrg,OU=DemmoDepartment,L=DemmoLocation,C=UK\" -expire 1000 -size 1024\nrunmqckm -cert -extract -db myCA.kdb -type cms -label \"myCAcertificate\" -target myCAcertfile.cer -format ascii -stashedthen created the keystore for the client using above certificate using key toolkeytool -keystore kautstclient.jks -genkey -alias winclientcert -storepass clientpassword\nkeytool -import -keystore kautstclient.jks -file myCAcertfile.cer -alias theCARoot30/02/2022 update > I have now added the certificates to the client side using below commands.generating client side's CA to self sign the client's certificate\n================================================================\nopenssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365\n\n\ncreating certificate request from the jks in order to signed by the above CA.\n===========================================================================\n\n keytool -certreq -v -alias winclientcert -file kauclient.csr -keypass clientpassword -storepass clientpassword -keystore kautstclient.jks\n \nsigning the certificate requst(csr file) using the generated CA key \n==================================================\nopenssl x509 -req -in kauclient.csr -CA cert.pem -CAkey key.pem -CAcreateserial -out kauclientown.crt\n\n\n Import the the signed and then provided certificate certificate into your keystore using the following command:\n========================================================================================\n\nkeytool -import -v -alias kauclientowncert -file kauclientown.crt -keystore kautstclient.jks -keypass clientpassword -storepass clientpassword\n\n\nadding the client's key signed root CA in to queue manager's key.db\n=================================================================\nrunmqckm -cert -add -db myqmgr.kdb -file cert.pem -label kauclientsignercertificate### Assistant: Djavax.net.ssl.trustStoreis not a connection factory property. You need to pass it as a Java system property. The value of the property needs to be either a JKS or PKCS12 file.You can do this in two ways:As a-Dcommand line option:-Djavax.net.ssl.trustStore=D:\\mq-message-handler-1.0\\ssl\\myCAcertfile.jksUsingSystem.setProperty:System.setProperty(javax.net.ssl.trustStore, \"D:\\mq-message-handler-1.0\\ssl\\myCAcertfile.jks\");\n"} +{"text": "### Human: I use TestContainers with ibm mq image in it. Through config I set host, port, user=app, default passw0rd, manager = QM1. I also have more custom queues and besides default DEV.QUEUE.1 - 3 ,created by container, I gotta start up mine. I found such operator like withCommand, accepting String argument, and try to set it like.withCommand(\"sh\",\"-c\",\"runmqsc QM1 | define qlocal(LQ1) | end\")https://www.ibm.com/docs/en/ibm-mq/7.5?topic=75-creating-queue-called-lq1Unfortunately, it seems not starting with it.My full snap of code related:@Container\n static GenericContainer mqContainer = new GenericContainer<>(DockerImageName.parse(\"ibmcom/mq\"))\n .withEnv(\"LICENSE\", \"accept\")\n .withEnv(\"MQ_QMGR_NAME\", \"QM1\")\n /* .withCommand(\"sh\",\"-c\",\"runmqsc\")*/\n \n .withExposedPorts(1414)\n .withStartupTimeout(Duration.of(1, ChronoUnit.HALF_DAYS))\n .withLogConsumer(new Slf4jLogConsumer(log));### Assistant: ibmcom/mq image already covers this scenario. Create a mqsc script with all custom resources. Copy this script in /etc/mq folder. All resources defined in script will be created on startup.SeeCustomizing the queue manager configurationfor details.\n"} +{"text": "### Human: Closed.This question does not meetStack Overflow guidelines. It is not currently accepting answers.This question does not appear to be abouta specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic onanother Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.Closed2 years ago.Improve this questionI am looking to deploy IBM MQ on kubernetes. Does anyone have any example or links on how to do this image build/deploy to kubernets e.g minikube?. On the official IBM site , it mentions containerised deployments but using OpenShift but it is not what I need.How can I deploy this on kubernetes?### Assistant: Take a look athttps://github.com/ibm-messaging/mq-containerIt has information about deploying MQ in containers.\n"} +{"text": "### Human: I want to consume all messages from MQ.public static void main(String[] args)\n{ \n JMSContext context = null;\n Destination destination = null;\n JMSConsumer consumer = null;\n\n JmsFactoryFactory FF = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\n JmsConnectionFactor CF = FF.createConnectionFactory();\n context = CF.createContext();\n destination = context.createQueue(QUEUE_NAME);\n consumer = context.createConsumer(destination);\n String msg = consumer.receiveBody(String.class, 15090);\n System.out.println(msg);\n }It is able to read one message only. How can I consume all messages? Also, is there any simpler way to delete all messages in queue without even reading or consuming them?### Assistant: The JMS API consumes a single message at a time so you'll need to put yourreceiveBodyin a loop, e.g.:public static void main(String[] args) { \n JMSContext context = null;\n Destination destination = null;\n JMSConsumer consumer = null;\n\n JmsFactoryFactory FF = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\n JmsConnectionFactor CF = FF.createConnectionFactory();\n context = CF.createContext();\n destination = context.createQueue(QUEUE_NAME);\n consumer = context.createConsumer(destination);\n String msg = null;\n do {\n msg = consumer.receiveBody(String.class, 15090);\n System.out.println(msg);\n } while (msg != null);\n}WhenreceiveBodyreturnsnullthat means there's no more messages in the queue.The JMS API doesn't define any way to delete all the messages from a queue, but most JMS servers have an implementation-specific management API through which you can perform those sorts of actions.\n"} +{"text": "### Human: I am consuming message from IBM MQ queue. Messages are of format MQSTR. But message data is TEXT+Binary. This Binary data is nothing but a JPG image\nWhen these messages are consumed by my JMS consumer, I can see some encoding issue for Binary data, due to which transformed image is distorted from original.I have tried every possible aspect (different IBM specification). But was not able to make through.If someone already faced such issue please suggest possible solution for it.### Assistant: If the message has an MQSTR MQMD.Format, then it must be a text string. MQ will convert text strings between codepages when required (eg ASCII to Unicode). If the message is not meant to be a string - which it sounds like from your limited description - then whoever creates the message needs to set the format suitably, and the receiving app must be prepared to parse and convert the message body components.\n"} +{"text": "### Human: You want to get a list of the queues for a specific queue manager. I seem to understand how to do this, but when I try, I get an error.Traceback (most recent call last): File\n\"D:/project/Work-Project/queue list.py\", line 23, in \nresponse = pcf.MQCMD_INQUIRE_Q(args) File \"C:\\Users\\ShevcovAA\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\pymqi_init_.py\",\nline 2769, incallmessage = self._pcf.reply_queue.get(None, get_md, get_opts) File\n\"C:\\Users\\ShevcovAA\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\pymqi_init.py\",\nline 2021, in get\nraise MQMIError(rv[-2], rv[-1], message=rv[0], original_length=rv[-3]) pymqi.MQMIError: MQI Error. Comp: 2, Reason\n2033: FAILED: MQRC_NO_MSG_AVAILABLEMy Code:import logging\nimport re\nimport pymqi\n\nlogging.basicConfig(level=logging.INFO)\n\nqueue_manager = 'QM1'\nchannel = 'DEV.APP.SVRCONN'\nhost = '127.0.0.1'\nport = '1414'\nconn_info = '%s(%s)' % (host, port)\n\nprefix = \"*\"\nqueue_type = pymqi.CMQC.MQQT_LOCAL\n\nargs = {pymqi.CMQC.MQCA_Q_NAME: prefix,\n pymqi.CMQC.MQIA_Q_TYPE: queue_type}\n\nqmgr = pymqi.connect(queue_manager, channel, conn_info)\npcf = pymqi.PCFExecute(qmgr)\n\nresponse = pcf.MQCMD_INQUIRE_Q(args)\n\nfor queue_info in response:\n queue_name = queue_info[pymqi.CMQC.MQCA_Q_NAME]\n if (re.match('^SYSTEM', queue_name) or re.match('^AMQ', queue_name) or re.match('^MQ', queue_name)):\n pass\n else:\n q = pymqi.Queue(qmgr, queue_name)\n print(queue_name.strip() + ':' + 'Queue depth:', q.inquire(pymqi.CMQC.MQIA_CURRENT_Q_DEPTH))\n q.close()\n\nqmgr.disconnect()### Assistant: v1.12.0 pymqi uses different logic to get PCF response messages from the response queue.By default, a timeout of 5 seconds is used to wait for a response.\nAs a result, if you have a lot of queues or your QM is under heavy load, this may not be enough.To fix this, you can increase this interval using the response_wait_interval parameter of the PCFExecute constructor.pcf = pymqi.PCFExecute(qmgr, response_wait_interval=30000) # 30 secondsv1.11.0 does not have this parameter and uses default interval of 30 seconds.And avoid querying each queue for depth, just query MQIA_CURRENT_Q_DEPTH attribute.In new notation, supported in v1.12+, it will be something like:attrs = [] # type: List[pymqi.MQOpts]\n attrs.append(pymqi.CFST(Parameter=pymqi.CMQC.MQCA_Q_NAME,\n String=pymqi.ensure_bytes(prefix)))\n attrs.append(pymqi.CFIN(Parameter=pymqi.CMQC.MQIA_Q_TYPE,\n Value=queue_type))\n attrs.append(pymqi.CFIL(Parameter=pymqi.CMQCFC.MQIACF_Q_ATTRS,\n Values=[pymqi.CMQC.MQIA_CURRENT_Q_DEPTH]))\n\n object_filters = []\n# object_filters.append(\n# pymqi.CFIF(Parameter=pymqi.CMQC.MQIA_CURRENT_Q_DEPTH,\n# Operator=pymqi.CMQCFC.MQCFOP_GREATER,\n# FilterValue=0))\n\n response = pcf.MQCMD_INQUIRE_Q(attrs, object_filters)\n\n for queue_info in response:\n queue_name = queue_info[pymqi.CMQC.MQCA_Q_NAME]\n queue_depth = queue_info[pymqi.CMQC.MQIA_CURRENT_Q_DEPTH]\n print('{}: {} message(s)'.format(queue_name.strip().decode(), queue_depth))\n"} +{"text": "### Human: How to handle/assemble segments of a MQ message when using Spring Integration JMS Jms.messageDrivenChannelAdapter. ? I did find some reference on how to do in when using MQ API .https://medium.com/@marcus_j/consuming-segmented-ibm-mq-messages-in-java-cbdee4a9ad85MQGetMessageOptions gmo = new MQGetMessageOptions();\ngmo.options = MQC.MQGMO_ALL_SEGMENTS_AVAILABLE \n | MQC.MQGMO_SYNCPOINT \n | MQC.MQGMO_COMPLETE_MSG; \ngmo.matchOptions = MQC.MQMO_NONE; \ngmo.waitInterval = 10000;\nMQMessage message = new MQMessage(); \nqueue.get(message, gmo);\n// Do your stuff with the message\nmessage.clearMessage();\nqueue.close(); \nmanager.disconnect();Per my understanding i will have to pass the appropriate MQGetMessageOptions , to be able to ask the queue manager to reassemble the message if it has been segmented. Could not find any reference on how to pass these options when using spring JMS .### Assistant: Unfortunately IBM MQ does not supportMessage segmentationin JMS:This feature is not supported on IBM\u00ae MQ for z/OS\u00ae or by applications usingIBM MQ classes for JMS.\n"} +{"text": "### Human: In my IBM MQ, I have multiple queue managers which I need to enable SSL.I've been following thisblogand successfully configured SSL to a single queue manager.If I have more than 1 queue manager, do I need to have a dedicated keystore for each queue manager?Is there a way to have a global/common keystore and enable SSL for all the queue managers using that keystore?Have this question since the blog says,\"A word about the certificate label here. Default name for this certificate is in the form of: \u2018ibmwebspheremq\u2019 + \u2018queue manager name\u2019 (all lower case)\nIn our case this becomes: \u2018ibmwebpsheremqmyqm01\u2019\"Any guidance would be very much helpful.IBM MQ v 9.1### Assistant: The answer like many of these questions is it depends.\nIf you can send the keystore files around to each machine -securelythen you could have the same files for all of your queue manages. If you do it insecurely then people could take a copy of your keystores and impersonate you, and see all your traffic.If you have your private certificate in an external HSM (think Secure USB store), you cannot get the private key to another machine, and so you will have to get a machine unique certificate.You can use CERTLABL(...) to specify the name of the certificates in the keystore.Ive just (today) put up some blog posts about TLS on midrange. Seehttps://colinpaice.blog/2021/02/13/which-cipher-spec-and-certificate-type-should-i-use-for-the-mq-server-tls-1-2\n"} +{"text": "### Human: We are trying to send a message to IBM MQ using JMS Point to Point Sampler in JMeter. After sending the message we can see that in the response queue an extra RFH header is getting added like this -WRN Encountered invalid data from source 'HttpXmlObjectConverter' in data: RFH \u2592\u2592MQSTR \u2592 jms_text `queue:///quenename16074278433242\"After searching on Google I found out thattargetClientshould be changed to1orMQ.Any idea where we need to modify this? In JMeter or in Queue? If it is in JMeter then how to do that? I tried doing it in JMS and JNDI properties, but I'm still getting the same error.### Assistant: Alternatively, you can configure the queue not to supply the RFH2 headers to getters who don't know how to handle them by using this command:ALTER QLOCAL('quenename16074278433242') PROPCTL(NONE)\n"} +{"text": "### Human: Trying to publish and subscribe message from IBM MQ 9 which has Cipher suite, user id, password, mykey.kdb file for SSL connection. we are able to connect through SSL with java. but want to do same thing with node js. While trying to do so we are gettingSSL_INITIALISATION_ERROR. InAMQERR01.LOGwe are Seeing below error block:AMQ6090I:MQM could not display text for error 3456322\nCOMMENTINSERT3(SSLCIPH(' ') -> SSLCIPH(???))can anyone help me on connecting to MQ using NOde js?### Assistant: If you have TLS working with Java, then in most likelihood you have the server configured correctly.To run a Node.js MQ Client in TLS mode needs code that sets the cipher spec and identifies the location of the client keys.const KEY_REPOSITORY = \"../keys/clientkey\";\n const CIPHER = \"TLS_RSA_WITH_AES_128_CBC_SHA256\";\n\n\n var cno = new mq.MQCNO();\n\n // code that sets up cno object\n // like Options and MQCSP credentials\n\n\n var cd = new mq.MQCD();\n // And then fill in relevant fields for the MQCD\n // like ChannelName and ConnectionName\n\n // If running in TLS Mode \n cd.SSLCipherSpec = CIPHER;\n cd.SSLClientAuth = MQC.MQSCA_OPTIONAL;\n\n\n var sco = new mq.MQSCO();\n\n sco.KeyRepository = KEY_REPOSITORY;\n // And make the CNO refer to the SSL Connection Options\n cno.SSLConfig = sco;For java you are most likely using a .jks client keystore. For MQI based Clients (Node, Python, Go, C), you need a key database and stash file.As you will need to have installed the MQI client, you can run the runmqakm tool to create them:runmqakm -keydb -create -db clientkey.kdb -pw tru5tpassw0rd -type pkcs12 -expire 1000 -stashand import the server's public key certificate into the client key databaserunmqakm -cert -add -label QM1.cert -db clientkey.kdb -pw tru5tpassw0rd -trust enable -file key.crtNotice that I have called the keystore and stashclientkey. You can call them what ever you want, but in your node.js code setsco.KeyRepository = KEY_REPOSITORY;to point at your equivalent ofclientkey\n"} +{"text": "### Human: There is a queue manager which runs with CCSID 437, and i would like to connect remotely to the queue manager via MQ Explorer. I got this error:AMQ6047E: Conversion not supported.\nEXPLANATION:\nIBM MQ is unable to convert string data tagged in CCSID 437 to data in CCSID\n1208.My first debugging try was connecting to the queue manager with mqsc console. And \"alter qmgr ccsid(1208) force\" even with this i couldn't connect. (i did a restart). And the issue was the same.However, i seen another queue manager which runs with ccsid (819), but there wasn 't any issue with connecting.IBM MQ version 9.1\nOS: AIX 7.1Any idea that can solve this issue?\nIf i change ccsid(437) to 819. Applications could connect again to the queue manager without a problem?Thanks a lot.### Assistant: MQ relies on the AIX base operating system to perform data conversion on its behalf. In order to support Unicode conversion AIX provides several optional filesets:bos.iconv.ucs.com Unicode converters for AIX setsbos.iconv.ucs.ebcdic Unicode converters for EBCDIC setsbos.iconv.ucs.pc Unicode converters for PC setsYou should install these filesets from the AIX operating system installation media if you need to convert data to and from Unicode on your system.\n"} +{"text": "### Human: Is it possible in IBM MQ through the console (command-line) to stop a queue?\nI know how to stop a Queue Manager withendmqm. But can I run a console command which will stop one queue?### Assistant: A queue cannot be stopped independently of the queue manager.\nHowever, you may find that restricting puts and/or gets on/from the queue achieves your desired goal, depending on your setup. This will allow you to prevent applications from adding new messages to the queue and/or removing messages from the queue.This can be done using commands in therunmqscinterface.https://www.ibm.com/support/knowledgecenter/SSFKSJ_latest/com.ibm.mq.ref.adm.doc/q083460_.htmHere are the commands you'll need:runmqsc QUEUE_MANAGER_NAME\nALTER QLOCAL('QUEUE_NAME') GET(DISABLED)\nALTER QLOCAL('QUEUE_NAME') PUT(DISABLED)\nEXITBelow is the commands and output for me disabling PUT and GET for my queue named Q1 on queue manager MyQM1.mqa(mqcli)# runmqsc MyQM1\n5724-H72 (C) Copyright IBM Corp. 1994, 2020.\nStarting MQSC for queue manager MyQM1.\n\n\nALTER QLOCAL('Q1') GET(DISABLED)\n 1 : ALTER QLOCAL('Q1') GET(DISABLED)\nAMQ8008I: IBM MQ Appliance queue changed.\nALTER QLOCAL('Q1') PUT(DISABLED)\n 2 : ALTER QLOCAL('Q1') PUT(DISABLED)\nAMQ8008I: IBM MQ Appliance queue changed.I'd recommend trying this out in a test environment first, to ensure it meets your needs and that your applications behave correctly to the error messages. E.g. \"MQGET calls are currently inhibited for the queue. (2016)\"\n"} +{"text": "### Human: I have been trying to find all the queue managers inside IBM MQ Server by giving server details without queue manager name.The idea is :I have a properties file having server details- host, port number, channel, userid, passwrd.By using this info we need to connect to the server and find all the queue managers available in the server.I need to use IBM MQ classes in java.As we have ways to find all the queues inside a queue manager can we do similarly to find all queue managers?### Assistant: No.PCF operations like getting the list of queues require you to connect to a queue manager first. To get the list of queue managers on a machine requires OS-level commands instead. A couple of ways that can be donerundspmq(if you can work out where it might be - cannot assume it's always in /opt/mqm/bin and might require setmqenv to give it a workable environment) and then parse the outputdirectly parse/var/mqm/mqs.ini(more challenging on Windows or even worse on z/OS).And if you're trying to do it remotely, then you have to wrap it up in something like ssh.\n"} +{"text": "### Human: I use spring boot 2.3.2 with ibm mq.\nI use property file setup mq.ibm.mq.queueManager=\nibm.mq.channel=\nibm.mq.connName\nibm.mq.user\nibm.mq.password\nibm.mq.useIBMCipherMappings=false\nibm.mq.userAuthenticationMQCSP=false\nibm.mq.sslCipherSuite=TLS_RSA_WITH_AES_128_CBC_SHA256that works fine.I need to create another factory to be able to connect to another channel. So I would like to create a similar one which is created by default but with different channel name.So I created a config class@EnableJms\n@Configuration\npublic class JmsConfig {\n@Bean\n public MQQueueConnectionFactory jmsMQConnectionFactoryPayment() throws JMSException {\n MQQueueConnectionFactory connectionFactory = new MQQueueConnectionFactory();\n connectionFactory.setQueueManager(\"AD_TEST\");\n connectionFactory.setChannel(\"FROM.PAYMENTMNG\");\n connectionFactory.setConnectionNameList(\"wmqd1.int.test.com(1818),wmqd2.int.test.com(1818)\");\n\n\n connectionFactory.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, false);\n\n connectionFactory.setStringProperty(WMQConstants.WMQ_SSL_CIPHER_SUITE, \"TLS_RSA_WITH_AES_128_CBC_SHA256\");\n connectionFactory.setIntProperty(CommonConstants.WMQ_CONNECTION_MODE, CommonConstants.WMQ_CM_CLIENT);\n\n\n System.setProperty(\"com.ibm.mq.cfg.useIBMCipherMappings\", String.valueOf(Boolean.FALSE));\n\n connectionFactory.createConnection(\"123\", \"123\");\n return connectionFactory;\n }\n\n @Bean\n JmsListenerContainerFactory jmsContainerFactoryPayment() throws JMSException {\n DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();\n factory.setConnectionFactory(jmsMQConnectionFactoryPayment());\n return factory;\n }\n\n @Bean(\"payment\")\n JmsTemplate jmsTemplatePayment() throws JMSException {\n JmsTemplate template = new JmsTemplate();\n template.setConnectionFactory(jmsMQConnectionFactoryPayment());\n return template;\n }\n\n\n}In a class I have@JmsListener(destination=\"xxx\", containerFactory=\"jmsContainerFactoryPayment\"){\n ....\n}When I start application, I getcom.ibm.msg.client.jms.DetailedIllegalStateException: JMSWMQ0018: E Failed to connect to queue manager 'AD_TEST' with connection mode 'Client' and host name 'wmqd1.int.test.com(1818),wmqd2.int.test.com(1818)'.\n\n at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:489) ~[com.ibm.mq.allclient-9.2.0.0.jar:9.2.0.0 - p920-L200710.DE]\n\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:215) ~[com.ibm.mq.allclient-9.2.0.0.jar:9.2.0.0 - p920-L200710.DE]\n\n at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:450) ~[com.ibm.mq.allclient-9.2.0.0.jar:9.2.0.0 - p920-L200710.DE]\n\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:8475) ~[com.ibm.mq.allclient-9.2.0.0.jar:9.2.0.0\n\nCaused by: com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') ; reason '2538' ('MQRC_HOST_NOT_AVAILABLE').\n\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:203) ~[com.ibm.mq.allclient-9.2.0.0.jar:9.2.0.0 - p920-L200710.DE]\n\n ... 51 common frames omittedSeem like we can't have two queue manager with same host but different channel### Assistant: I have configured Spring Boot with IBM MQ to test this. Starting with the sample provided in thisIBM Messaging GitHub Repo, I added two additional listeners as follows.First I added some additional properties to theapplication.propertiesfilemy.mq.queueManager=QM2\nmy.mq.channel=DEV.APP.SVRCONN\nmy.mq.connName=localhost(1415)\nmy.mq.user=\nmy.mq.password=I leftApplication.javaunchanged, copiedListener.javato createListenerTwo.javaandListenerThree.java. I then added a newListenerBeanConfig.javaclass to the sample.ListenerTwo.javawas changed to bind to a newConnectionFactoryconfigurationlistenerTwoFactorywhich is created later.@JmsListener(destination = Application.qName, containerFactory = \"listenerTwoFactory\")ListenerThree.javawas changed to bind to a newlistenerThreeFactoryconfiguration andQueue@JmsListener(destination = \"DEV.QUEUE.2\", containerFactory = \"listenerThreeFactory\")TheListenerBeanConfig.javaclass declaration was annotated so that I can access my properties by adding Strings for each property e.g.,queueManager,channel,connNameetc. and providing setter methods for each of them e.g.,@Configuration\n@EnableJms\n@ConfigurationProperties(prefix=\"my.mq\")\npublic class ListenerBeanConfig {\n\n String connName;public void setConnName(String value) {\n System.out.println(\"connName is set to: \"+value);\n connName = value;\n }I registered the two newListenerbeans@Bean\n public ListenerTwo myListenerTwo() {\n return new ListenerTwo();\n }\n\n@Bean\n public ListenerThree myListenerThree() {\n return new ListenerThree();\n }I then created the new connection factory configurationslistenerTwoFactoryandlistenerThreeFactoryForlistenerTwoFactoryI used the JMS classes provided bycom.ibm.mq.jmsin the Spring Boot configJmsConnectionFactory cf;\n\n@Bean\n public DefaultJmsListenerContainerFactory listenerTwoFactory() {\n DefaultJmsListenerContainerFactory containerFactory = new DefaultJmsListenerContainerFactory();\n try {\n JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\n cf = ff.createConnectionFactory();\n cf.setStringProperty(WMQConstants.WMQ_CONNECTION_NAME_LIST, connName);\n cf.setStringProperty(WMQConstants.WMQ_CHANNEL, channel);\n cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\n cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, queueManager);\n cf.setStringProperty(WMQConstants.WMQ_APPLICATIONNAME, \"Spring Boot ListenerTwo\");\n cf.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, true);\n cf.setStringProperty(WMQConstants.USERID, user);\n cf.setStringProperty(WMQConstants.PASSWORD, password);\n } catch (JMSException jmsex) {\n System.out.println(jmsex);\n }\n containerFactory.setConnectionFactory(cf);\n return containerFactory;\n}For thelistenerThreeFactoryI used the MQ JMS helper classes fromcom.ibm.mq.spring.boot.@Bean\npublic DefaultJmsListenerContainerFactory listenerThreeFactory() {\n MQConfigurationProperties myProps = new MQConfigurationProperties();\n myProps.setUser(user);\n myProps.setChannel(channel);\n myProps.setConnName(connName);\n myProps.setPassword(password);\n myProps.setQueueManager(queueManager);\n //No customizer\n MQConnectionFactoryFactory mqcff = new MQConnectionFactoryFactory(myProps,null);\n MQConnectionFactory mqcf = mqcff.createConnectionFactory(MQConnectionFactory.class);\n DefaultJmsListenerContainerFactory containerFactory = new DefaultJmsListenerContainerFactory();\n containerFactory.setConnectionFactory(mqcf);\n return containerFactory;\n}Finally, I compiled and ran the new sample configuration. Using the IBM MQ Console for two IBM MQ queue manager docker instances, I put messages toQM1: DEV.QUEUE.1andQM2: DEV.QUEUE.1, DEV.QUEUE.2. On the terminal see the following output.========================================\nReceived message is: message 1\n========================================\n\n========================================\nListenerTwo received message is: message 2\n========================================\n\n========================================\nListenerThree received message is: message 3\n========================================Also tested with all three listeners connected to QM2 via a two different channels:DEV.APP.SVRCONNandDEV.APP.SVRCONN.TWO.I am sure there are far more elegant ways to manage the additional properties.\n"} +{"text": "### Human: I am about to develop an IBM MQ Client.I want to start from the very basics, so I created a project to connect to some queue.public void Init(IbmMqConnection configuration)\n{\n // _properties is a Hashtable\n _properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);\n _properties.Add(MQC.HOST_NAME_PROPERTY, configuration.Host);\n _properties.Add(MQC.CHANNEL_PROPERTY, configuration.Channel);\n\n MQEnvironment.Port = 1414;\n MQEnvironment.UserId = configuration.UserId;\n\n _qm = new MQQueueManager(configuration.QueueManager, _properties);\n\n int options = 0;\n options += MQC.MQOO_OUTPUT;\n options += MQC.MQOO_INQUIRE;\n options += MQC.MQOO_FAIL_IF_QUIESCING;\n\n _q = _qm.AccessQueue(\"SYSTEM.DEFAULT.LOCAL.QUEUE\", options);\n}And called this method with the configuration below_qManager.Init(new IbmMqConnection\n{\n Host = \"DESA_MQ\",\n UserId = \"mqscpd\",\n Channel = \"SCPPAQUE.WIN.SVRCONN\",\n QueueManager = \"QMDESA01\"\n});... and, of course I got thisExceptionthrown.MQException -> Completion Code 2 and Reason Code 2298Well, I wasn't expecting nothing different from that.I am roaming exhaustively theIBM MQ Documentationand I found nothing related to serve any kind of development environment before installing the real one.I hope I am missing something to develop my project pointing out to a (free) development server mounted locally or something.I installed theIBMMQDotnetClientpackage, version 9.1.5.Summarying, how can I develop my project testing it before deploy to a real IBM MQ system?Thanks.### Assistant: You will have to use Managed mode if you are developing IBM MQ .NET applications using nuget package. To use Managed mode you have to set TRANSPORT_PROPERTY to TRANSPORT_MQSERIES_MANAGED. MQC.TRANSPORT_MQSERIES_CLIENT uses unmanaged mode and is not supported in MQ .NET standard libraries that is the reason you are seeing \"MQException -> Completion Code 2 and Reason Code 2298\".Modifying the property should do._properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\n _properties.Add(MQC.HOST_NAME_PROPERTY, configuration.Host);\n _properties.Add(MQC.CHANNEL_PROPERTY, configuration.Channel);With IBM MQ v9.1.5 Client installation, you have project templates which has some basic MQ .NET API's using which you can connect to Queue Manager and then perform a Put/Get operation.Following Knowledge Center link has some information on it:https://www.ibm.com/support/knowledgecenter/SSFKSJ_9.1.0/com.ibm.mq.dev.doc/q134410_.htm.As Josh pointed out,LearnMQis also a good starting point.\n"} +{"text": "### Human: I am trying to get data from one application and send that to another(mainframe) after processing the data.Lets assume I am getting data as \"This is from another application\", processed the same and processing status as \"This data is processed\". Final message should be combination of both using encoding(Cp1047) to mainframe application to read the same as0024This is from another application001AThis data is processeddecimal value of 0024 is 36 (message length + 4 which is hexa value length)decimal value of 001A is 26 (processed message length + 4)My application runs on Java8 and uses websphere MQ. I need to send data to application which receives data from Mainframe MQ. Remote queue in WebSphere MQ puts messge to Local Queue of Mainframe MQ. My code as below to convert data and encode using Cp1047,String incomingData = \"This is from another application\";\nString processingData = \"This data is processed\" \npublic String outGoingData(String incomingData, String processingData) { \n StringBuilder strBuilder = new StringBuilder();\n return stringbuilder.append(new String(convertToEbcidie(incomingData, \"Cp1047\")))\n .append(incomingData)\n .append(new String(convertToEbcidie(processingData, \"Cp1047\")))\n .append(processing data).toString(); //playing this string to queue\n}\nprivate byte[] convertToEbcidic(String s) {\n String hexStr = StringUtils.leftPad(s.length+4, 8, \"0\");\n byte[] byteAry = new byte[hexStr.length()/2];\n for (int i = 0; i < hexStr.length(); i+=2) {\n byteAry[i/2] = (byte) ((Character.digit(s.charAt(i), 16) << 4)\n + Character.digit(s.charAt(i+1), 16)); \n } return byteAry;\n}Receiver application(mainframe) decide which is original message and processing status based hexavalue which is 4 characters.They are able to read most of the messages but not all. for ex, hexa value of length 805 is 325, but in mainframe mq entry is as 315. They are not able to process since the length mismatches.ANOTHER SAMPLE DATA :-OO25THIS IS ORIGINAL DATA FROM SOURCE001APROCESSED SUCCESSFULLY0025 is hexval of org msg length(33) + 4 and 001A is hexval of processed msg length (22) + 4. Here 4 is the length of hexa decimal value.Am I missing any logic to convert to ebcidic?### Assistant: There is so much wrong with the code you posted, I don't know where to begin.First off, StackOverflow rules/policy is that you are supposed to copy & paste yourworking codefrom your editor or IDE to StackOverflow. Clearly, you did not do that but rather just created new code in the StackOverflow edit window - which is wrong!!!return stringbuilder.append(new String(convertToEbcidie(incomingData, \"Cp1047\")))\n .append(incomingData)\n .append(new String(convertToEbcidie(processingData, \"Cp1047\")))\n .append(processing data).toString();(1) The convertToEbcidic method takes ONE parameter and not 2. You have your bracketing wrong.(2) The method name is convertToEbcidic and not convertToEbcidie (last letter is 'c' not 'e')private byte[] convertToEbcidic(String s) {\n String hexStr = StringUtils.leftPad(s.length+4, 8, \"0\");\n byte[] byteAry = new byte[hexStr.length()/2];\n for (int i = 0; i < hexStr.length(); i+=2) {\n byteAry[i/2] = (byte) ((Character.digit(s.charAt(i), 16) << 4)\n + Character.digit(s.charAt(i+1), 16)); \n } return byteAry;\n}(3) I have no clue what you are trying to do but clearly it is not doing anything you think it is. Did you step through the code with a debugger?(3A) The length for s variable is a method not a field. It should be \"s.length()\" and not \"s.length\".(3B) StringUtils.leftPad method's first parameter must be a String and not an int.(3C) hexStr will be \"00000036\" (32 + 4). hexStr has a length of 8.(3D) byteAry will have a size of 4!!! How are you suppose to fit 36 characters into 4 bytes? i.e. 4 + 26 characters \"This is from another application\".(3E) What is your loop doing?? It runs 4 times and I have absolutely no idea what you were thinking.Ok. Now to your problem.ANOTHER SAMPLE DATA :- OO25THIS IS ORIGINAL DATA FROM SOURCE001APROCESSED SUCCESSFULLYOk. So based on that sample, it appears to me that the layout is as following:{string representation of length of \"character data 1\" in hex}{character data 1}{string representation of length of \"character data 2\" in hex}{character data 2}Since, the entire message payload will be string then it is far, far better to put the string as a message in the local codepage (ASCII), mark the MQMD format as string and let MQ do the conversion. The conversion will be done when the mainframe application issues an \"MQGET with Convert\" call.Here is the proper code to your problem:String incomingData = \"This is from another application\";\nString processingData = \"This data is processed\";\nStringBuilder sb = new StringBuilder();\nMQQueueManager qMgr = null;\nMQQueue outQ = null;\n\nString inHexLen = Integer.toHexString(incomingData.length()+4).toUpperCase();\ninHexLen = StringUtils.leftPad(inHexLen, 4, '0');\nsb.append(inHexLen);\nsb.append(incomingData);\n\nString outHexLen = Integer.toHexString(processingData.length()+4).toUpperCase();\noutHexLen = StringUtils.leftPad(outHexLen, 4, '0');\nsb.append(outHexLen);\nsb.append(processingData);\n\nSystem.out.println(\"sb=\"+sb.toString());\n\ntry\n{\n qMgr = new MQQueueManager(\"MQA1\");\n\n outQ = qMgr.accessQueue(\"TEST.Q1\",\n CMQC.MQOO_OUTPUT + CMQC.MQOO_FAIL_IF_QUIESCING);\n\n MQMessage sendmsg = new MQMessage();\n sendmsg.format = CMQC.MQFMT_STRING;\n sendmsg.writeString(sb.toString());\n outQ.put(sendmsg, new MQPutMessageOptions());\n}\ncatch (MQException e)\n{\n e.printStackTrace();\n}\ncatch (IOException e)\n{\n e.printStackTrace();\n}\nfinally\n{\n try\n {\n if (outQ != null)\n outQ.close();\n }\n catch (MQException e)\n {\n e.printStackTrace();\n }\n try\n {\n if (qMgr != null)\n qMgr.disconnect();\n }\n catch (MQException e)\n {\n e.printStackTrace();\n }\n}\n"} +{"text": "### Human: I have to inject a message in IBM MQ.Could you please explain me how to add a custom information in the header?Please find below how I defined the RFH2 header and the message.def message = new MQMessage()\ndef rfh2 = new MQRFH2()\nrfh2.setEncoding(CMQC.MQENC_NATIVE)\nrfh2.setCodedCharSetId(CMQC.MQCCSI_INHERIT)\nrfh2.setFormat(CMQC.MQFMT_NONE)\nrfh2.setNameValueCCSID(1208)\nrfh2.setFieldValue('mcd', 'Msd', 'jms_byte')\nrfh2.setFieldValue('usr', 'Sender', 'mysender')\nrfh2.write(message)\n\nmessage.writeString(mymessage)\n\nmessage.format = CMQC.MQFMT_RF_HEADER_2And I would like to addtypeinformation. So the expected result istype='mytype'.There is a way, a method to do that please? I checked on the doc but I didn't found information.Thank you for help. Regards.### Assistant: If you want to add a property to a message then you put it in the 'usr' (user) folder.i.e.rfh2.setFieldValue('usr', 'type', 'mytype');Now, if you want to pass information that either (1) is NOT going to be consumed by a JMS application or (2) you want it to be unavailable to the JMS application then use your own folder.i.e.rfh2.setFieldValue('royce', 'type', 'mytype');JMS framework will only handle/use values from 3 folders: 'mcd', 'jms' and 'usr'. Supposedly, 'mqext' folder gets processed by the JMS framework but I have never been able to get it to work.\n"} +{"text": "### Human: I was using docker image ibmcom/mq .\nMy compose file was:FROM ibmcom/mq\nUSER root\n# create another client user\n# default is app without password\nRUN useradd user1 -G mqclient && \\\necho user1:passwd | chpasswdThen suddenly it was stopped working when I build latest image again.Error is :useradd: group 'mqclient' does not exist\nERROR: Service 'mq' failed to build: The command '/bin/sh -c useradd user1 -G mqclient && echo user1:passwd | chpasswd' returned a non-zero code: 6Now compose is not working with latest image(9.1.5.0-r1) version but works with old version e.g. 9.1.4.0-r1Can anyone suggest what is the alternative### Assistant: From 9.1.5 the container does not use OS based users or groups. This is to conform to cloud best practices. Instead a file based system is being used. This is so that when you roll-out the container in a cloud into production you can switch to an LDAP based system.The 9.1.5 container uses htpasswd, with the relevant file in /etc/mqm/For development, if you are not going to create new users, then you can use the 9.1.5 container. If you want to create new users, then you can use 9.1.4 or earlier, or use htpasswd with bcrypt to create the users.\n"} +{"text": "### Human: I try to catch a message from a queue. Note that the message has axmlcontent.However, an exception is throw in the blockcatch (MQException e)while the message is correctly received by the queue.MQException: MQJE001: Completion Code '2', Reason '2033'Please find below code used:import com.ibm.mq.MQMessage\nimport com.ibm.mq.MQGetMessageOptions\nimport com.ibm.mq.MQQueueManager\nimport com.ibm.mq.constants.CMQC\nimport com.ibm.mq.headers.MQRFH2\nimport com.ibm.MQException\n\ndef mqProps = new Hashtable()\nmqProps.put(MQConstants.CHANNEL_PROPERTY, 'mychannel')\nmqProps.put(MQConstants.PORT_PROPERTY, myport)\nmqProps.put(MQConstants.HOST_NAME_PROPERTY, 'myhost')\n\ndef qMgr = new MQQueueManager('myqueuemanager', mqProps)\ndef openOptions = MQConstants.MQOO_OUTPUT | MQConstants.MQOO_INPUT_AS_Q_DEF\n\ndef gmo = new MQGetMessageOptions()\ngmo.options = CMQC.MQGMO_WAIT + CMQC.MQGMO_FAIL_IF_QUIESCING\n\ndef queue = qMgr.accessQueue('myqueue', openOptions)\nMQMessage receiveMsg = null\nboolean getMore = true\nwhile(getMore) {\n receiveMsg = new MQMessage()\n\n try {\n // get the message on the queue\n queue.get(receiveMsg, gmo)\n def rfh2 = new MQRFH2(receiveMsg)\n def strucLen = rfh2.getStrucLength()\n def encoding = rfh2.getEncoding()\n def CCSID = rfh2.getCodedCharSetId()\n def format = rfh2.getFormat()\n def flags = rfh2.getFlags()\n def nameValueCCSID = rfh2.getNameValueCCSID()\n\n def b = new byte[receiveMsg.getDataLength()]\n receiveMsg.readFully(b)\n System.out.println(\"Data: \" + new String(b))\n queue.close()\n } catch (MQException e) {\n if (e.completionCode == CMQC.MQCC_FAILED && e.reasonCode == CMQC.MQRC_NO_MSG_AVAILABLE) {\n // No message - loop again\n }\n else {\n log.info(\"MQException: \" + e.getLocalizedMessage())\n log.info(\"CC=\" + e.completionCode + \" : RC=\" + e.reasonCode)\n getMore = false\n }\n } catch (IOException e) {\n log.info(\"IOException:\" + e.getLocalizedMessage())\n }\n\n}Could you please help me to fix it? Thank you.### Assistant: def openOptions = MQConstants.MQOO_OUTPUT |\n MQConstants.MQOO_INPUT_AS_Q_DEFThere is no reason to open the queue for both input and output. Also, you should include MQOO_FAIL_IF_QUIESCING.def qMgr = new MQQueueManager('myqueuemanager', mqProps) def queue =\n qMgr.accessQueue('myqueue', openOptions)I strongly recommend that you use UPPERCASE, queue manager and queue names. Also, it is an IBM Best Practise.queue.close()The close method should be called in the finally clause otherwise you could get memory leak.I postedMQTEST12L.java(fully functioning) many times to StackOverflow. You can get it fromhere.Use MQTest12L as an example on how to correctly code a Java application to get messages from a queue.\n"} +{"text": "### Human: I have to process messages in Dead Letter Queue (DLQ) using JMS API. The goal is to read body of the original messages and it's user properties. I realize that such approach to DLQ processing might be considered as bad design, but I have to deal with it anyway.Once read with JMS, body of DLQ message contains body of the original one, prepended with DL header and a structure very similar to RFH2 header of the original message (so containing all the needed user properties).The question is, how to parse these 2 structures in java?Yet I only found a doc about how DLH could be constructed from raw data (https://www.ibm.com/support/knowledgecenter/SS8JB4/com.ibm.wbpm.main.doc/topics/esbprog_bindings_wmq5.html). But while DLH seems to be a fixed-lenght structure, RFH2 is definitely not - so the most tricky part of parsing is there.Any idea would be appreciated.UPDATEHere is what I have found:1) DLH was parsed from raw byte array without any problem, as simple as follows:MQDLH rfh = new MQDLH(new DataInputStream(new ByteArrayInputStream(bytes)));Once constructed, all the properties are available.2) MQRFH2 could be created in a similar manner, if MQLONG values were written there as usual, in big endian. But for some reason, completely unclear to me, in this case all MQLONG are little endian.So, to create MQRFH2 from raw bytes I have to reverse bytes for all MQLONGs. Not a problem for a fixed part (as described inhttps://www.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q032000_.htm), but a bit more complicated for variable part.I haven't seen any confirmation in docs, but it seems that each folder in variable part is prepended with MQLONG (well, just 4-bytes integer) containing folder length. Once these values were converted from LE to BE as well, MQRFH2 seem to be working correctly.### Assistant: I wouldn't process the DLQ with a JMS application. It will be so, so tricky and you will spend days or weeks trying to get it right. I would write a regular Java application to do it, far simpler.i.e.MQMessage rcvMsg = new MQMessage();\nMQDLH dlh = new MQDLH(rcvMsg);\nMQRFH2 rfh2 = new MQRFH2(rcvMsg);\nbyte[] bData = new byte[rcvMsg.getDataLength()];\nrcvMsg.readFully(bData);Updated on March 4, 2020.I am normally not into banging my head against the wall but if you want to then here is the code that I would try:ByteArrayInputStream bais = new ByteArrayInputStream(bytes);\nDataInput di = new DataInputStream(bais);\n\nMQDLH dlh = new MQDLH(di);\nMQRFH2 rfh2 = new MQRFH2(di)\n\n// Get all folders\nString[] folderStrings = rfh2.getFolderStrings();\n\n// or you can get individual name/values using\n// get***FieldValue() methods of the MQRFH2 class.\n\n/*\n * At this point, the cursor for \"di\" is pointing\n * to the beginning of the message payload and I\n * would normal do:\n */\nbyte[] bData = new byte[mqMsg.getDataLength()];\nmqMsg.readFully(bData);\n"} +{"text": "### Human: I am doing a POC for Prometheus and one of the things we would like to get metrics from is an IBM MQ server running on W2012R2. There is a Prometheus exporter for IBM MQ but that is for Linux and isn't working on Windows.We do have an option to schedule a report to write data to a file, however the output for that file is useless for Prometheus, so the document has te be reformatted.I've been breaking my head on how to achieve this using PowerShell but since I lack scripting experience with PowerShell I decided to ask here for help.You guys have any idea how to change a report in this layout:5724-H72 (C) Copyright IBM Corp. 1994, 2015.\nStarting MQSC for queue manager QMGR.\n\n\n 1 : DISPLAY CHSTATUS(*) \n\nAMQ8450: Display Channel Status details.\n CHANNEL(QMGR.HOSTNAME.R1) CHLTYPE(RCVR)\n CONNAME(10.10.10.10) CURRENT\n RQMNAME(QMGR) STATUS(RUNNING)\n SUBSTATE(RECEIVE) \nAMQ8450: Display Channel Status details.\n CHANNEL(QMGR.HOSTNAME.R3) CHLTYPE(RCVR)\n CONNAME(10.10.10.10) CURRENT\n STATUS(RUNNING) SUBSTATE(RECEIVE)To something looking like this:status{channel=\"QMGR.HOSTNAME.R1\", chltype=\"rcvr\", conname=\"10.10.10.10\", rqmname=\"QMGR\"} running\nsubstate{channel=\"QMGR.HOSTNAME.R1\", chltype=\"rcvr\", conname=\"10.10.10.10\", rqmname=\"QMGR\"} receive\nstatus{channel=\"QMGR.HOSTNAME.R3\", chltype=\"rcvr\", conname=\"10.10.10.10\"} running\nsubstate{channel=\"QMGR.HOSTNAME.R3\", chltype=\"rcvr\", conname=\"10.10.10.10\"} receiveThis is what I came up with so far, not exactly pretty I guess but it seems to be a step in the right direction...$Contents = Get-Content \".\\CHSTATUS.txt\" | select -Skip 5 \nforeach($Line in $Contents) {\n foreach($channel in [Regex]::Matches($Line, '(?<=CHANNEL\\()(.*?)(?=\\))')) {}\n foreach($chltype in [Regex]::Matches($Line, '(?<=CHLTYPE\\()(.*?)(?=\\))')) {}\n foreach($conname in [Regex]::Matches($Line, '(?<=CONNAME\\()(.*?)(?=\\))')) {}\n foreach($status in [Regex]::Matches($Line, '(?<=STATUS\\()(.*?)(?=\\))')) {}\n foreach($substate in [Regex]::Matches($Line, '(?<=SUBSTATE\\()(.*?)(?=\\))')) {\n Write-Host \"status{channel=\"\"$channel\"\", chltype=\"\"$chltype\"\", conname=\"\"$conname\"\"}\" $status \n Write-Host \"substate{channel=\"\"$channel\"\", chltype=\"\"$chltype\"\", conname=\"\"$conname\"\"}\" $substate\n }\n}Hope somebody here can give me a push in the right direction on how to tackle this.### Assistant: To convert that input and parse out the fields, you can do this:$inputFile = 'D:\\Report.txt'\n\n# read the file, split into usable blocks and collect in variable $report\n$report = ((Get-Content -Path $inputFile -Raw) -split '.*Display Channel Status details\\.' | Select-Object -Skip 1 | ForEach-Object {\n $channel = ([regex] 'CHANNEL\\(([^)]+)\\)').Match($_).Groups[1].Value\n $chltype = ([regex] 'CHLTYPE\\(([^)]+)\\)').Match($_).Groups[1].Value.ToLower()\n $conname = ([regex] 'CONNAME\\(([^)]+)\\)').Match($_).Groups[1].Value\n $rqmname = ([regex] 'RQMNAME\\(([^)]+)\\)').Match($_).Groups[1].Value\n $status = ([regex] 'STATUS\\(([^)]+)\\)').Match($_).Groups[1].Value.ToLower()\n $substate = ([regex] 'SUBSTATE\\(([^)]+)\\)').Match($_).Groups[1].Value.ToLower()\n\n if ($rqmname) {\n $out = 'status{{channel=\"{0}\", chltype=\"{1}\", conname=\"{2}\", rqmname=\"{3}\"}} {4}' + \"`r`n\" +\n 'substate{{channel=\"{0}\", chltype=\"{1}\", conname=\"{2}\", rqmname=\"{3}\"}} {5}'\n # output the two lines including rqmname\n $out -f $channel, $chltype, $conname, $rqmname, $status, $substate\n\n }\n else {\n $out = 'status{{channel=\"{0}\", chltype=\"{1}\", conname=\"{2}\"}} {3}' + \"`r`n\" +\n 'substate{{channel=\"{0}\", chltype=\"{1}\", conname=\"{2}\"}} {4}'\n # output the two lines excluding rqmname\n $out -f $channel, $chltype, $conname, $status, $substate\n }\n}) -join \"`r`n\"\n\n# output on screen\n$report\n\n# or save to new file\n$report | Set-Content -Path 'D:\\ConvertedReport.txt'Result:status{channel=\"QMGR.HOSTNAME.R1\", chltype=\"rcvr\", conname=\"10.10.10.10\", rqmname=\"QMGR\"} running\nsubstate{channel=\"QMGR.HOSTNAME.R1\", chltype=\"rcvr\", conname=\"10.10.10.10\", rqmname=\"QMGR\"} receive\nstatus{channel=\"QMGR.HOSTNAME.R3\", chltype=\"rcvr\", conname=\"10.10.10.10\"} running\nsubstate{channel=\"QMGR.HOSTNAME.R3\", chltype=\"rcvr\", conname=\"10.10.10.10\"} receive\n"} +{"text": "### Human: I am working on IIB 10 toolkit.I have to stop a message flow which listens to a queue.How to inhibit the input queue of that messageflow from another service using esql commands?I know the mqsc commands to alter the queues, but don't know to do the same from esql code.Please help.Hi, please find the code below: \nI got this from a forum and I still have doubts on this code like how to specify the q manager to which the queue is associated with.CREATE NEXTSIBLING OF OutputRoot.Properties DOMAIN 'MQMD';\n CREATE NEXTSIBLING OF OutputRoot.MQMD DOMAIN 'MQADMIN' NAME 'MQPCF';\n\n CREATE FIELD OutputRoot.MQPCF;\n DECLARE refRequest REFERENCE TO OutputRoot.MQPCF;\n SET refRequest.Command = MQCMD_CHANGE_Q;\n /* First parameter: Queue Name. */\n SET refRequest.Parameter[1] = MQCA_Q_NAME;\n\n SET refRequest.Parameter[1].* = 'TEST.IN';\n /* Second parameter: Queue Type. */\n SET refRequest.Parameter[2] = MQIA_Q_TYPE;\n SET refRequest.Parameter[2].* = MQQT_LOCAL ;\n\n /* Third parameter: Allow/Inhibit GET.*/\n\n SET refRequest.Parameter[3] = MQIA_INHIBIT_GET;\n SET refRequest.Parameter[3].* = MQQA_GET_INHIBITED;\n SET OutputRoot.BLOB.BLOB = asbitstream(OutputRoot.MQPCF);\n\n SET OutputRoot.MQPCF = null;\n SET OutputRoot.MQMD.Format = MQFMT_ADMIN;### Assistant: Your only choice is to create an external program to either issue an MQ PCF command or use the MQSET API call. Either one is reasonably straight forward.You can use the MQSET in C, COBOL, C#, Java, etc.In Java, you would do:MQQueue queue = qMgr.accessQueue(\"TEST.Q1\", CMQC.MQOO_SET + CMQC.MQOO_FAIL_IF_QUIESCING);\nqueue.setInhibitGet(CMQC.MQQA_GET_INHIBITED);You can check out this blogpostingfor a complete Java program that will issue the MQSET API call against the queue's get & put attributes with either inhibit or allow.\n"} +{"text": "### Human: This question is in continuation to the question askedIBM MQ listener service - onMessage not getting triggeredLet's say the same code is in production , now how do we keep the program running. I felt adding scanner code is not the correct or effective way of achieving it. Is there any better solution to keep the program running so when the end of main is reached , program will not quit. Ideally i think the call to start methodqc.start()should wait indefinitely. \nPlease let me know how do we implement this in a proper and ideal way.Requirement is the listener should run indefinitely waiting for new messages. I do not have any other business condition to put in the main method inorder to keep the program running. Adding scanner code doesn't seem a good approach. What's the ideal way ??### Assistant: What I think what you are asking is how to keep a Java program running indefinitely.There are several ways, but you do need a way of terminating it, either by user interrupt or a signal, and you don't want it in a tight loop so it will consume all CPU and stack memory, leaving nothing for youronMessageevent.You don't want to put to sleep theonMessageso it should be spawned in a secondary thread, allowing the main thread to periodically awaken from a sleep to check for a\ntermination signal.The basics areThread worker = new Thread(new yourOnMessageThread());\nworker.start();\n\nwhile(true) {\n try {\n Thread.sleep(sleep duration);\n } catch(InterruptedException ex) {\n // check for termination signal\n // if required, terminate\n }\n}\n"} +{"text": "### Human: I am using jmsTemplate to send messages to MQ Queue. When the consuming MQ application gets the message they are able to see junk chars like below in message. I need to remove them as they are causing parse exception.WS-OUTPUT-BUFFER:RFH \ufffd\ufffd\ufffd\ufffd\ufffd*\ufffd\ufffd\ufffd\ufffd4MQSTR \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u00cf\u00b4\ufffd\ufffd\ufffd\u2211\u221e_\u00e9\u00a5\u00fb\u221e(\u03a9\u00a5\u00fb|_\u03a9\u2122\u00e6\u00b5\u00ac\u00e6\u221e(\u03a9\u00a5\u00fb\u221e_\u00e9\u00a5\u00fb\u2211\u2211\ufffd\ufffd\ufffd\u00eb\u221e|_\u03a9\u00fb\u221e\u00d6\u03a9\u00e6\u00fb\u00ea\u00db\u00b5\u00db\u00b5\u00c8\u00e4\u00a7\u00c9\u2020\u00e2\u00c9\n \u00d1<\u2026\u00a7(\u00e2\u00a7+\u00e4\u00e0\u00e2\u00e4\u00e0\u2020&<\u00b7\u221e\u00d6\u03a9\u00e6\u00fb\u221e\u00e4_\u03a9\u00fb\u2044\ufb02\u2021\u00c2\u203a\u00c2\ufb01\u201e\ufb01\u221e\u00e4_\u03a9\u00fb\u221e\u00d1\u2022\u00a5\u00fb\u00a7\u00d6\u00c8\u00e9\u203a\u00b5\u00a5\u201e\ufb01\u0178\u00e9\u203a\u00b5\u00a5\u201e\u00b5\ufb01\u0178\ufb01\u0178\ufb01\u0178\ufb01\u0178\ufb01\u0178\ufb01\u0178\ufb01\u0178\ufb01\u0178\u00a5\u2021\u00e9\ufb01\ufb02\u00e9\u203a\u2202\u00e9\u00e9\u201e\u201e\ufb01\u201e\u2044\u0178\u221e\u00d1\u2022\u00a5\u00fb\u221e\u00d6%\u00bf\u00fb\u221e\u00d6\n %\u00bf\u00fb\u221e|_\u03a9\u00fb\ufffd\ufffd\ufffd\u222b\u221e\u00db\u03a9\u00ba\u00fb\u221e\u00d1\u00d1\u00e2\u00a7\u00d6\u2211\u00a5\u00e6\u00b1\u2022\ufb01\u00fb\u201e\u2044\u00c2\u221e\u00d1\u00d1\u00e2\u00a7\u00d6\u00fb\u221e\u2202/\u2022%\u00a7\u2202\u00c7\u00db\u2022\u00b5\u03a9\u00e9\u00b5\u2211\u00a5\u00e6\u00b1\u2022\ufb01\u00fb\u2044\u221e\u2202/\u2022%\u00a7\u2202\u00c7\u00db\u2022\u00b5\u03a9\u00e9\u00b5\u00fb\u221e\u00b5>\u00e9?\u00a5\u2022>\u00e8\u2211\u00a5\u00e6\u00b1\u2022\ufb01\u00fb\u203a\u221e\u00b5>\u00e9?\u00a5\u2022>\u00e8\u00fb\u221e\u00db\u03a9\n \u00ba\u00fb\u2211\u2211\u2211### Assistant: I had a similar issue when the receiving application could not handle the MQRFH2 header.Therefore I had to set theTARGCLIENT(shortTC) property withWMQ_CLIENT_NONJMS_MQ(value1) on the JMS Destination object like this:See alsoExchanging messages between a JMS application and a traditional IBM MQ application.\n"} +{"text": "### Human: I need to configuration connection with MQ, to receive messages.\nTried to use this example:https://github.com/ibm-messaging/mq-mqi-nodejs/blob/85f216027b02b959be586d6f8fca9f242df485e0/samples/amqsgeta.jsBut, I do not fully understand. Where I need to put parameters:\nHost, port, MQ Queue Manager Name, MQ Queue Name.\nWhen I put my parameters it doesn`t work. I see error ibm mq error 2538\nCould you show an example?\nI use ubuntu.### Assistant: Understanding is that you are running your program from a box other than where the MQ server(and Queue manager) is running. You have to set the MQ environment before connecting the queue manager. The sample in the github location is in the link =>https://github.com/ibm-messaging/mq-mqi-nodejs/blob/master/samples/amqsconn.jsYou'll have to populate the below parameters mentioned in the program to connect to Queue manager :var qMgr = \"QM1\"; //Queue manager name\n\n csp.UserId = \"mqguest\"; //Username & password configured by your MQ admin\n csp.Password = \"passw0rd\";\n\n cd.ConnectionName = \"localhost(1414)\"; //host & port\n cd.ChannelName = \"SYSTEM.DEF.SVRCONN\"; //Client channel name to connect to MQ sever\n"} +{"text": "### Human: I`m using apache-camel connection to IBM MQ. if the connection to the queue is not established in the log I get[INFO ] 2019-09-20 13:55:21.983 [Camel (camel-1) thread #6 - JmsConsumer[QUEUE]] DefaultJmsMessageListenerContainer - [, TID=, SID=, ] - Successfully refreshed JMS Connection\n[WARN ] 2019-09-20 13:55:27.178 [Camel (camel-1) thread #23 - JmsConsumer[QUEUE]] DefaultJmsMessageListenerContainer - [, TID=, SID=, ] - Setup of JMS message listener invoker failed for destination 'QUEUE' - trying to recover. Cause: JMSWMQ2008: Failed to open MQ queue 'QUEUE'.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2085' ('MQRC_UNKNOWN_OBJECT_NAME').\n[INFO ] 2019-09-20 13:55:27.178 [Camel (camel-1) thread #23 - JmsConsumer[QUEUE]] DefaultJmsMessageListenerContainer - [, TID=, SID=, ] - Successfully refreshed JMS Connection\n[WARN ] 2019-09-20 13:55:32.286 [Camel (camel-1) thread #6 - JmsConsumer[QUEUE]] DefaultJmsMessageListenerContainer - [, TID=, SID=, ] - Setup of JMS message listener invoker failed for destination 'QUEUE' - trying to recover. Cause: JMSWMQ2008: Failed to open MQ queue 'QUEUE'.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2085' ('MQRC_UNKNOWN_OBJECT_NAME').\n[INFO ] 2019-09-20 13:55:32.287 [Camel (camel-1) thread #6 - JmsConsumer[QUEUE]] DefaultJmsMessageListenerContainer - [, TID=, SID=, ] - Successfully refreshed JMS ConnectionIm trying usefrom(queue1).processor(exchange -> {\"some code\"}).to(queue2).\nonException(Throwable.class).proccess(exchange -> {\"some code\"})andpublic class camelError implements ErrorHandler {\n @Override\n public void process(Exchange exchange) throws Exception {\n\n }\n}this does not workHow can I catch and handle a com.ibm.mq.MQException connection exception and get the queue name?### Assistant: compcode '2' ('MQCC_FAILED') reason '2085' \n ('MQRC_UNKNOWN_OBJECT_NAME').Did you look up that MQ Reason Code in theMQ Knowledge Center? You clearly have a configuration error. How are you defining your JMS queue to IBM MQ queue? i.e. are you using MQ JNDI. Where do you define \"queue1\" and \"queue2\"?\n"} +{"text": "### Human: Can someone please explain whyTextMessage textMessage = (TextMessage) message;work? (JAVA 8)TextMessageinheritsMessageMessage is not an instance ofClonableif(message instanceof TextMessage) {\n TextMessage textMessage = (TextMessage) message; \n String body = textMessage.getBody(); \n}The expected outputs are good.### Assistant: It works because you are casting the message object when you set textMessage to equal it. Effectively you're telling Java to ignore what it thinks message is and instead treat it as a TextMessage object. This means it will pass the compiler stage.In your code you've done due dilligence to check that message really is a TextMessage beforehand. If you hadn't of done that if at any point your code ran where message was not a TextMessage you would get a Java class cast exception.\n"} +{"text": "### Human: org.springframework.jms.UncategorizedJmsException: Uncategorized exception occurred during JMS processing; nested exception is com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0018: Failed to connect to queue manager 'DevQueue01' with connection mode 'Client' and host name 'myhost(51401)'.\nCheck the queue manager is started and if running in client mode, check there is a listener running. Please see the linked exception for more information.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2537' ('MQRC_CHANNEL_NOT_AVAILABLE').at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:316)\nat org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:169)\nat org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:487)\nat org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:570)\nat org.springframework.jms.core.JmsTemplate.convertAndSend(JmsTemplate.java:696)\nat com.bnsf.me.echs.inspection.consumer.jms.InspectionSender.send(InspectionSender.java:20)\nat com.bnsf.me.echs.inspection.consumer.jms.InspectionSenderTest.testReceive(InspectionSenderTest.java:24)\nat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nat sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)\nat sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\nat java.lang.reflect.Method.invoke(Unknown Source)\nat org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)\nat org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)\nat org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)\nat org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)\nat org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)\nat org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)\nat org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)\nat org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)\nat org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252)\nat org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)Caused by: com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0018: Failed to connect to queue manager 'DevQueue01' with connection mode 'Client' and host name 'myhost(51401)'.\nCheck the queue manager is started and if running in client mode, check there is a listener running. Please see the linked exception for more information.\n at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:595)\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:215)\n at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:413)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:8475)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:7814)\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl._createConnection(JmsConnectionFactoryImpl.java:299)\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:236)\n at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6024)\n at com.ibm.mq.jms.MQConnectionFactory.createConnection(MQConnectionFactory.java:6049)\n at org.springframework.jms.connection.SingleConnectionFactory.doCreateConnection(SingleConnectionFactory.java:365)\n at org.springframework.jms.connection.SingleConnectionFactory.initConnection(SingleConnectionFactory.java:305)\n at org.springframework.jms.connection.SingleConnectionFactory.getConnection(SingleConnectionFactory.java:283)\n at org.springframework.jms.connection.SingleConnectionFactory.createConnection(SingleConnectionFactory.java:224)\n at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:180)\n at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:474)\n ... 33 more\nCaused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2537' ('MQRC_CHANNEL_NOT_AVAILABLE').\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:203)\n ... 46 more\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2537;AMQ9204: Connection to host 'myhost(51401)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2537;AMQ9558: The remote channel 'ME.JAVA.CLIENT' on host '' is not currently available. [3=ME.JAVA.CLIENT]],3=myhost(51401),5=RemoteConnection.analyseErrorSegment]\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:2282)\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1294)\n at com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.jmqiConnect(InterceptedJmqiImpl.java:376)\n at com.ibm.mq.ese.jmqi.ESEJMQI.jmqiConnect(ESEJMQI.java:560)\n at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:346)\n ... 45 more\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2537;AMQ9558: The remote channel 'ME.JAVA.CLIENT' on host '' is not currently available. [3=ME.JAVA.CLIENT]### Assistant: The client side of your connection has reported the following error:-JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED')\nreason '2537' ('MQRC_CHANNEL_NOT_AVAILABLE').This could be for one of the following reasons:-The channel is currently in stopped state.The channel has been stopped by a channel exit.The queue manager has reached its maximum allowable limit for this channel from this client.The queue manager has reached its maximum allowable limit for this channel.The queue manager has reached its maximum allowable limit for all channelsas described in theexplanation of 2537 (MQRC_CHANNEL_NOT_AVAILABLE)in IBM Knowledge Center.As it also says in that explanation, you should examine the queue manager and client error logs for messages explaining the cause of the problem.If you don't understand what the issue is when you read theAMQERR01.LOGfiles on both client and queue manager machines, please update your question with the relevant error message and we can give further help.\n"} +{"text": "### Human: Using IIB 10 and MQ 9.\nThe problem is that when you add the mqrfh2 header, its part appears in the body:SET OutputRoot.MQMD.CodedCharSetId = InputRoot.Properties.CodedCharSetId;\n SET OutputRoot.MQMD.Format = 'MQRFH2';\n SET OutputRoot.MQMD.Version = MQMD_VERSION_2;\n SET OutputRoot.MQRFH2.(MQRFH2.Field)Format = 'MQRFH2';\n SET OutputRoot.MQRFH2.(MQRFH2.Field)Version = MQRFH_VERSION_2;\n SET OutputRoot.MQRFH2.(MQRFH2.Field)NameValueCCSID = InputRoot.Properties.CodedCharSetId;\n\n SET OutputRoot.MQRFH2.usr.errorDescription = FIELDVALUE(Environment.Variables.exceptionMsg);### Assistant: I think you need to read thedocumentationfor an MQRFH2 message. All folders and the header of an MQRFH2 message are in the MQ message body. If the receiving application cannot handle an MQRFH2 message then treat it as a JMS message or a plain message with named properties.In case you did not know:MQRFH2 message == JMS message == plain message with named properties (aka message properties)Updated:I just noticed this line:SET OutputRoot.MQRFH2.(MQRFH2.Field)Format = 'MQRFH2';This is probably your problem. You are embedding an MQRFH2 message within an MQRFH2 message. Change to it the following:SET OutputRoot.MQRFH2.(MQRFH2.Field)Format = 'MQSTR ';This says that the message data for the MQRFH2 message is to be considered to be string data (i.e. JMSTextMessage).\n"} +{"text": "### Human: I'm trying to put a message onto an IBM MQ queue through the REST API, but I can't figure out how to set the priority in the request. I've tried simply using \"priority\" as a query parameter but received the following error:\"error\": [\n {\n \"action\": \"Resubmit the request with an appropriate set of parameters.\",\n \"completionCode\": 0,\n \"explanation\": \"The REST API does not support this query parameter for this operation.\",\n \"message\": \"MQWB0019E: The query parameter 'priority' is not allowed.\",\n \"msgId\": \"MQWB0019E\",\n \"reasonCode\": 0,\n \"type\": \"rest\"\n }\n ]Question 36399382mentioned using both the \"priority\" and \"targetClient\" query parameters, but that seems specific to Apache Camel, and even trying it, it didn't work.I've looked through all of the IBM MQ REST API documentation I can find, but nothing that I've come across addresses it. I'm sure there's some documentation somewhere, but I'm just not finding it. Is this something specific that has to be configured on the server, or is there a problem with my syntax?Thanks in advance!### Assistant: The messaging REST API, that is HTTP POST to/messaging/qmgr/{qmgrName}/queue/{queueName}/messagedoes not currently include a header for setting the priority of the message.It includes headers forcorrelationId,expiry,persistence, andReplyTo. See thereference material here.If you have requests that need to set different priorities, you could create different ALIAS Queue definitions with different values for theDEFPRTYattribute, all pointing to the same LOCAL Queue, and have your REST API applications use the appropriate ALIAS queue name in order to have the priority set to what they need.UPDATE:The v3 MQ REST API, that is HTTP POST to/ibmmq/rest/v3/messaging/qmgr/{qmgrName}/queue/{queueName}/messagenow supports a header in order to set the priority of the message. This was introduced in IBM MQ V9.2.5.Use the headeribm-mq-md-priority, for example like this:-curl -X POST https://localhost:9443/ibmmq/rest/v3/messaging/qmgr/MQG1/queue/MY.QUEUE/message -H \"Content-Type: text/plain\" -d \"My message\" -H \"ibm-mq-md-priority: 9\"\n"} +{"text": "### Human: After successfully connecting to IBM MQ 9.1 with the IBM MQ Client with SSL, we're trying to setup the same configuration, but this time, with the Microsoft MQ Client binding.So this should be straight forward, onceHIS 2016is configured (CU2 is installed). But not in my case.The following error was thrown on the BizTalk Server 2016 (CU6 installed) with event source 'HIS Microsoft Client for MQ':Connecting to a Queue Manager failed: Could not Connect the Queue Manager 'test': Could not connect to the target Host/Port, SSL handshake failed.The following error was thrown on the IBM MQ Server machine:Internal error on call to SSL function on channel '????' to host ''. \nAn error indicating a software problem was returned from a function which is used to provide SSL or TLS support. \nThe error code returned was '447'. The function call was 'gsk_secure_soc_init'. &P The channel is '????'; in some cases its name cannot be determined and so is shown as '????'. \nThe channel did not start. &P The remote host name is ''.So it's throwing a 447 error, which IBM explains as follows:The TLS server or client encountered a communicating partner that does not support a TLS extension that is defined as required. \nEnsure that the TLS extension data is correctly defined, and that both the TLS server and client support the required extension. \nIf the problem persists collect a System SSL trace and contact your service representative.The MQSC Transport properties on the BizTalk receive location looks something like this:Use Microsoft MQ Client : YesSSL Cipher Specification: TLS_RSA_WITH_AES_256_CBC_SHASSL Key Repository Location: D:\\SomepathtocertTransport Type: TCPSSL Peer name is kept empty.User Id is kept empty.I did not change anything to the bindings except the 'Use Microsoft MQ Client' part of course. This is a working setup when used with the IBM MQ Client with SSL. So I'm wondering why all of the sudden it will not work with the Microsoft MQ Client.### Assistant: SSL Cipher Specification is not considered in the MSFT MQ client,\nwhile the IBM MQ client use the configured cipher.The MS MQ client only use default Windows cipher (first choice in the adapter list), so you have to set the same cipher in the MQ channel that you use.so depends on the default Cipher in Windows, your IBM should be configured.Thanks for my colleague Niklas Engfelt for testing this.\n"} +{"text": "### Human: I'm using JndiDestinationResolver (JNDI-lookup) to resolve destination which i have added on application server.I saw solutions to remove rfh from message is by appending--> queue + \"?targetClient=1\". I'm passing jndi-name to send(Destination,meassage) and need help to understand how i can set this variable (context file or on app server).\nOne solution mention- On the administered object there is a property called TARGCLIENT which should be set to 'MQ'.How and where exactly we need to set this on WAS.\nI really appreciate any help on this. Thanks!### Assistant: It is no longer necessary to change the message producer to do this now, there are other options.So long as your queue manager is at MQ V7.0 or above, you can alter the queue definition on the queue manager as follows, and the RFH2 header will be removed before the message is given to the consumer.ALTER QLOCAL(q-name) PROPCTL(NONE)\n"} +{"text": "### Human: I am working on a legacy system and have been tasked with modifying a Visual Basic API that is using mq series (now called IBM websphere) to send and receive data from a mainframe system. My network admin has informed me that he sees 97 connections from the API. At the queue manager level, max channels is set to 100. He says that is fine but that the problem is that the API makes a client channel connection but never releases it. I would assume there must be a close() action that I can execute once I retrieve the response from the queue but I do not know what the syntax would be. This is the code that I execute to send and receive data:Dim passedmqRequest = mqRequest\n Dim Session_mq_put_array As Object\n Dim Session_mq_get_array As Object\n Dim Session_MqResponse As String = \"\"\n Dim Session_error_code As String = \"\"\n Dim Session_plan_id As String = Mid(passedmqRequest, 15, 4)\n\n Dim ipAddress As String = \"xxx.xxx.xxx.xxx\"\n\n Dim mq_get_error As String = \"N\"\n Dim mq_put_array(2) As String\n Dim mq_get_array(2) As String\n Dim Response_queue As String = \"\"\n Dim Response_queue_mgt As String = \"\"\n\n ' send messages to TOSSMQT1\n Response_queue = \"ARI.GW1TEST.RESPONSES\"\n Response_queue_mgt = \"ARIT\"\n mq_put_array(0) = \"ARI.TEST.QUEUE\"\n Response_queue = \"ARI.TEST.RESPONSES\"\n mq_put_array(1) = \"VRU4300b\"\n mq_put_array(2) = \"SVRCONN//\" & ipAddress & \"(1414)\" '* internal\n mq_put_array(2) = \"SVRCONN//\" & ipAddress & \"(1414)\" '* internal\n Session_mq_put_array = mq_put_array\n\n mq_get_array(0) = \"ARI.TEST.HOST.RESPONSES\"\n mq_get_array(1) = \"VRU4300b\"\n mq_get_array(2) = \"SVRCONN//\" & ipAddress & \"(1414)\" '* internal\n mq_get_array(2) = \"SVRCONN//\" & ipAddress & \"(1414)\" '* internal\n Session_mq_get_array = mq_get_array\n\n Dim CmdArgs() As String\n CmdArgs = Session_mq_put_array\n\n Dim CmdResponse() As String\n CmdResponse = Session_mq_get_array\n\n Dim mqQMgr As MQQueueManager '* MQQueueManager instance \n Dim mqQueue As MQQueue '* MQQueue instance \n Dim responseQueue As MQQueue\n\n Dim mqMsg As MQMessage '* MQMessage instance \n Dim responseMSG As MQMessage\n Dim mqPutMsgOpts As MQPutMessageOptions '* MQPutMessageOptions instance \n Dim queueName As String '* Name of queue to use \n Dim responsequeueName As String '* Name of response queue to use \n Dim message As String '* Message buffer \n\n Dim mqError As String = \"\"\n\n queueName = CmdArgs.GetValue(0)\n responsequeueName = CmdResponse(0)\n\n '* \n '* Try to create an MQQueueManager instance \n '* \n Dim channelDefinition As String = CmdArgs.GetValue(2)\n Dim channelName As String = \"\"\n Dim transportType As String = \"\"\n Dim connectionName As String = \"\"\n Dim separator As Char() = \"/\"\n Dim parts As String()\n Try\n '* queue name, queue manager name, channel definition all provided \n '* Break down the channel definition, \n '* which is of the form \"channel-name/transport-type/connection-name\". \n channelDefinition = CmdArgs.GetValue(2)\n parts = channelDefinition.Split(separator)\n If (parts.Length > 0) Then\n channelName = parts(0)\n End If\n If (parts.Length > 1) Then\n transportType = parts(1)\n End If\n If (parts.Length > 2) Then\n connectionName = parts(2)\n End If\n mqQMgr = New MQQueueManager(CmdArgs.GetValue(1), channelName, connectionName)\n Try\n mqQueue = mqQMgr.AccessQueue(queueName, MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING) '* open queue for output but not if MQM stopping \n message = passedmqRequest\n '* put the next message to the queue \n mqMsg = New MQMessage()\n mqMsg.WriteString(message)\n mqMsg.Format = MQC.MQFMT_STRING\n mqPutMsgOpts = New MQPutMessageOptions()\n mqMsg.ReplyToQueueName = Response_queue\n mqMsg.ReplyToQueueManagerName = Response_queue_mgt\n Try\n mqQueue.Put(mqMsg, mqPutMsgOpts)\n responseQueue = mqQMgr.AccessQueue(mq_get_array(0), MQC.MQOO_INPUT_SHARED + MQC.MQOO_FAIL_IF_QUIESCING)\n Dim MQGetMessageOptions As New MQGetMessageOptions()\n MQGetMessageOptions.Options = IBM.WMQ.MQC.MQGMO_WAIT + IBM.WMQ.MQC.MQGMO_FAIL_IF_QUIESCING + IBM.WMQ.MQC.MQGMO_CONVERT\n MQGetMessageOptions.WaitInterval = 20000\n MQGetMessageOptions.MatchOptions = MQC.MQMO_MATCH_MSG_ID\n\n responseMSG = New MQMessage\n responseMSG.MessageId = mqMsg.MessageId\n Try\n responseQueue.Get(responseMSG, MQGetMessageOptions)\n Session_MqResponse = responseMSG.ReadString(responseMSG.DataLength)\n Session_error_code = \"0\"\n'\n' at this point a response has been received and I should close\n' the client channel connection\n'\n Catch mqe As MQException\n '* report the error \n Session_MqResponse = \"MQQueue::get ended with \" & mqe.Message & \"
\"\n mq_get_error = \"Y\"\n Session_error_code = \"1\"\n End Try\n Catch mqe As MQException\n '* report the error \n Session_MqResponse = \"MQQueue::Put ended with \" & mqe.Message & \"
\"\n Session_error_code = \"2\"\n End Try\n Catch mqe As MQException\n '* stop if failed \n Session_MqResponse = \"MQQueueManager::AccessQueue ended with error message = \" & mqe.Message & \"
\"\n Session_MqResponse = Session_MqResponse & \"create of MQQueueManager ended with error reason = \" & mqe.Reason & \"
\"\n Session_error_code = \"3\"\n End Try\n Catch mqe As MQException\n '* stop if failed \n Session_MqResponse = \"create of MQQueueManager ended with error message = \" & mqe.Message & \"
\"\n Session_MqResponse = Session_MqResponse & \"create of MQQueueManager ended with error reason = \" & mqe.Reason & \"
\"\n Session_error_code = \"4\"\n End Try### Assistant: Walking through your code:mqQMgr = New MQQueueManager(...)This creates a MQQueueManager object, but also connects to the destination queue manager as a client connection - this will be the connections the network admin is talking aboutmqQueue = mqQMgr.AccessQueue(queueName, MQC.MQOO_OUTPUT, ...)This opens a queue on the destination queue manager for outputresponseQueue = mqQMgr.AccessQueue(mq_get_array(0), MQC.MQOO_INPUT_SHARED, ...)This opens a queue on the destination queue manager for input.At this point you have 2 queues and one connection open on the destination queue manager. If you just drop into other code, then you are holding resources on the server. My understanding is that when the objects go out of scope, they would be destroyed, but I might be wrong for this language (out of practice!).To explicitly free the resources you would need to just close the qmgr connection (as any queues it holds would be released) with appropriate error checking:mqQMgr.Disconnect()If you really want to explicitly clean up the queues and then the queue manager, you can do the following before the disconnect (with appropriate error checking):mqQueue.Close()\nresponseQueue.Close()\n"} +{"text": "### Human: Problem Description :I have installed MQ Server and MQ Client both with version 9.0. I have defined a Queue Manager and Queues and Topics. I am using Java 7. I have developed a standalone java client to connect to the Queue Manager inBINDING mode. The java application and MQ are being hosted on the same server, so BINDING connection has its necessary pre-requisites.However when I am trying to run my application I am getting an error :Exception in thread \"main\" java.lang.UnsatisfiedLinkError: mqjbnd05 (Not found in java.library.path)\nat java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:1279)\nat java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:1245)\nat java.lang.System.loadLibrary(System.java:540)\nat com.ibm.mq.MQSESSION.loadLib(MQSESSION.java:872).....Have searched a few topics related to this but couldn't find any definite solution. I am pasting my java code below :/**\n* \n*/\npackage com.binding;\n\nimport javax.jms.JMSException;\nimport javax.jms.Session; \nimport com.ibm.jms.JMSMessage;\nimport com.ibm.jms.JMSTextMessage;\nimport com.ibm.mq.jms.JMSC;\nimport com.ibm.mq.jms.MQQueue;\nimport com.ibm.mq.jms.MQQueueConnection;\nimport com.ibm.mq.jms.MQQueueConnectionFactory;\nimport com.ibm.mq.jms.MQQueueReceiver;\nimport com.ibm.mq.jms.MQQueueSender;\nimport com.ibm.mq.jms.MQQueueSession;\n\n/**\n* @author Som\n*\n*/\npublic class MQBindingConnection {\n\n/**\n* @param args\n*/\npublic static void main(String[] args) {\n// TODO Auto-generated method stub\n\ntry {\n MQQueueConnectionFactory cf = new MQQueueConnectionFactory();\n\n // Config\n //cf.setHostName(\"localhost\");\n //cf.setPort(1414);\n cf.setTransportType(JMSC.MQJMS_TP_BINDINGS_MQ);\n cf.setQueueManager(\"QM.E001\");\n //cf.setChannel(\"SYSTEM.DEF.SVRCONN\");\n\n MQQueueConnection connection = (MQQueueConnection) cf.createQueueConnection(\"user\",\"pass\");\n MQQueueSession session = (MQQueueSession) connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\n MQQueue queue = (MQQueue) session.createQueue(\"BINDING.CONN\");\n MQQueueSender sender = (MQQueueSender) session.createSender(queue);\n MQQueueReceiver receiver = (MQQueueReceiver) session.createReceiver(queue); \n\n long uniqueNumber = System.currentTimeMillis() % 1000;\n JMSTextMessage message = (JMSTextMessage) session.createTextMessage(\"SimplePTP \"+ uniqueNumber); \n\n // Start the connection\n connection.start();\n\n sender.send(message);\n System.out.println(\"Sent message:\\\\n\" + message);\n\n JMSMessage receivedMessage = (JMSMessage) receiver.receive(10000);\n System.out.println(\"\\\\nReceived message:\\\\n\" + receivedMessage);\n\n sender.close();\n receiver.close();\n session.close();\n connection.close();\n\n System.out.println(\"\\\\nSUCCESS\\\\n\");\n }\n catch (JMSException jmsex) {\n System.out.println(jmsex);\n System.out.println(\"\\\\nFAILURE\\\\n\");\n }\n catch (Exception ex) {\n System.out.println(ex);\n System.out.println(\"\\\\nFAILURE\\\\n\");\n }\n\n }\n\n}I could not find the file \"mqjbnd05\" in the directory location :C:\\Program Files\\IBM\\MQ\\java\\libAlso in lib64 path I have checked but the file is missing.C:\\Program Files\\IBM\\MQ\\java\\lib64I have set my CLASSPATH variable to point to the correct MQ lib directory.I have tried changing the lib directory location to both server and client, however, the file\"mqjbnd05\"is missing everywhere, so as expected same error is encountered.The same piece of code using the commented out sections is running fine forCLIENT mode.Please let me know what else I am missing out for connecting inBINDING mode.I am using the following ENV variables :MQ_JAVA_LIB_PATH = C:\\Program Files\\IBM\\MQ\\java\\lib64;C:\\Program Files\\IBM\\MQ\\java\\lib \nMQ_FILE_PATH = C:\\Program Files\\IBM\\MQ \nMQ_JAVA_DATA_PATH = C:\\ProgramData\\IBM\\MQ \nMQ_JAVA_INSTALL_PATH = C:\\Program Files\\IBM\\MQ\\java \nMQ_JRE_PATH = C:\\Program Files\\IBM\\MQ\\java\\jre \nLIB = C:\\Program Files\\IBM\\MQ\\tools\\lib64;C:\\IBM\\SQLLIB\\LIB;C:\\Program Files\\IBM\\MQ\\tools\\lib \nCLASSPATH = C:\\Program Files\\IBM\\MQ\\java\\lib\\com.ibm.mqjms.jar;C:\\Program Files\\IBM\\MQ\\java\\lib\\com.ibm.mq.jar;C:\\Program Files\\IBM\\MQ\\java\\lib;C:\\Program Files\\IBM\\MQ\\java\\lib64;One thing to add is : I have the filemqjbnd.dllbut not themqjbnd05### Assistant: mqjbnd05 was removed from the MQ product in MQ v7, prefering instead to use a generic mqjbnd with an interface which worked across subsequent releases. However, that means if you are running a Java application and picking up MQ v6 or earlier jar files, but with an MQ product install of post-MQv6 then you will get the error you report. There are no references I can find to mqjbnd05 in the MQv9 codebase.Given you said in a comment you have mqjbnd.dll and MQServer+MQClient v9, then the only way I can think of to achieve this is either you are picking up jars from pre-MQv7 from the classpath, or that you have build your application and included within your application the MQ jars themsevles.Depending on how you run your application, you could try adding the -verbose option to the java launch to see where the MQ jars are coming from.\n"} +{"text": "### Human: Is there any command similar todspmqto check a queue managers status on a remote server.Also i am using the command below to check if a queue exists on queue manager or not. But this command only executes if queue is present on the same server.echo 'DISPLAY QLOCAL(*)' | runmqsc -e [queue manager] |grep [queuename]I am stuck as I have a server for which queue is hosted on a different server.When I execute the above commands they fail.Are there any commands to check a queue and queue manager on a remote server.### Assistant: Assuming you can make a client connection to the remote queue manager (e.g. with MQSERVER or MQCHLLIB/MQCHLTAB), you could use the client mode connection (-c) option on that runmqsc command from v8 onwards. Read more about this in the link below.MQ V8 - Client MQSCSo then, for example, your commands would be:-export MQSERVER='channel-name/TCP/hostname(port)'\necho 'DISPLAY QLOCAL(queuename)' | runmqsc -c queue-managerYou'll have to replacechannel-name,hostname, andportwith your own values of course.Note I have changed the example from that which you cited, to put the queue name in theDISPLAY QLOCALcommand, save you grepping afterwards, you can just ask the queue manager for only the queue you are interested in.Alternatively if your local and remote queue managers are connected, and you have appropriate security and definitions, you can route the MQSC command through your local queue manager to your remote queue manager with the -w option. Read more here.Issuing MQSC commands on a remote queue manager\n"} +{"text": "### Human: I'm currently using the IBM MQ JMS libraries and writing a Java class that will handle pulling down a message from a consuming queue with a selector like so:consumer = session.createConsumer(queue, \"JMSCorrelationID = '\" + request.getCorrelationID() + \"'\");\nmessage = consumer.receive(30000);My question is, if there were two messages in the consuming queue that match the message selector, would callingconsumer.receivepull down both messages or would it only pull down the first one it sees?I found this other SO question:How to remove multiple messages using message selector in JMSwhich seems to allude to the fact that calling receive will pull a single message down even if two messages in the consuming queue match the selector.### Assistant: The documentation of MessageConsumer says the following:Receives the next message that arrives within the specified timeout\n interval.https://docs.oracle.com/javaee/7/api/javax/jms/MessageConsumer.htmlSo calling receive should pull down 1 message at a time. It cannot really return more messages as the return type is Message and not any kind of a collection.\n"} +{"text": "### Human: I am using MQ Java PCF API to retrieve information from an MQ installation.\nThere are several constructors for the classPCFMessageAgent.\nThere is one that accepts thehost,portandchannelname. I have shown an extract from the documentation.public PCFMessageAgent(String host,\n int port,\n String channel)\n throws MQException\nInitializes a new PCFMessageAgent with a client connection to a queue manager.My question is which queue manager will this connect to?Is it the default queue manager?How do I specify the queue manager i want to connect to?### Assistant: No need to specify queue manager, as soon as you specify host and port.\nYou will connect to the one listening to that port.Update, from IBM docs:A server connection channel is a bidirectional MQI channel that is\n used to connect a IBM WebSphere MQ client to a IBM WebSphere MQ\n server.The server connection channel is the server end of the\n channel.A client connection channel is a bidirectional MQI channel that is\n used to connect a IBM WebSphere MQ client to a IBM WebSphere MQ\n server. IBM WebSphere MQ Explorer also uses client connections to\n connect to remote queue managers.The client connection channel is\n the client end of the channel. When you create a client-connection\n channel, a file is created on the computer that hosts the queue\n manager. You must then, copy the client-connection file to the IBM\n WebSphere MQ Client computer.https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_7.5.0/com.ibm.mq.explorer.doc/e_channels.htm\n"} +{"text": "### Human: So I have IIB 9 and WMQ. For example there are two local queues Q1 and Q2. From Q1 messages goes to Q2. May I somehow filter how much messages in minute may go from Q1 to Q2? I want Q1 not to place more than N messages in minute to Q2, but I also don't want to lose messages from Q1 and I don't wnat to override messages in Q2. Just maybe turn off the ability to place in Q2 from Q1 for X seconds if Q1 reached it's limit.### Assistant: If you are using IBM Integration Bus to build your messages flows you can do this.MQ Input (Q1) --> Mediation --> MQ Output (Q2)You can create a Workload Management Policy in IBM Integration Bus 9.0.In this kind of policy you can define the processing rate and attach this to the message flow.Configuration\n"} +{"text": "### Human: In multi installation environment (of IBM MQ v9.0 on windows), I am trying to create a queue manager and set its installation (crtmqm,setmqm) from command prompt, but getting the error:Command not executed from the installation named by the -n parameterHow do I perform the following actions:check what the current installation associated with command\nprompt.change the current installation associated with the\ncommand prompt ( basically running command against a specific\ninstallation, which is not necessarily the primary installation).### Assistant: To answer your two questions:-To check the current installation associated with the command prompt use thedspmqvercommand.To change the current installation associated with the command prompt use thesetmqenvcommand in one of the following ways:-To set your installation you can either do so using the installation name, e.g.:-setmqenv -n Installation2or the path of the installation, e.g.:-setmqenv -p c:\\mqm8000which has the same result as changing to the directory of the one you want and then telling it you want to change the environment to self (-s), e.g.cd \\mqm8000\nsetmqenv -s\n"} +{"text": "### Human: HI i am trying to add data in the RFH2 MQ header.\nThe format for the data which i want is:struc id : RFH\nversion:2\nencoding:546\nCodedCharSetid:437\nFormat:MQSTR\nFlags:0\nNameValeCCSID:1208\nNamevalueLen:56\nNamevaluedata:jms_textHello\nNamvalueLen:56\nNameValuedata:\nNamevalueLen:56\nNameValuedata:HiI have the following code, but i am not understanding how to add theNameValueLenandNAMEVALUEDATApart. Can some check the code which i have written and guide me further on this?MQMessage msg = new MQMessage();\nmsg.format = MQC.MQFMT_RF_HEADER_2; // Msg Format\nmsg.writeString(MQC.MQRFH_STRUC_ID); // StrucId \nmsg.writeInt4(MQC.MQRFH_VERSION_2); // Version \nmsg.writeInt4(MQC.MQRFH_STRUC_LENGTH_FIXED_2 + folderLength + 4); \nmsg.writeInt4(MQC.MQENC_NATIVE); // Encoding \nmsg.writeInt4(MQC.MQCCSI_DEFAULT); // CodedCharacterSetId \nmsg.writeString(MQC.MQFMT_NONE); // Format (content) \nmsg.writeInt4(MQC.MQRFH_NO_FLAGS); // Flags \nmsg.writeInt4(1208); // NameValueCCSID = UTF-8### Assistant: I don't know what tool you are using but it is confusing the issue. MQRFH2 has \"folders\". The 1st folder is ALWAYS \"mcd\". The 2nd folder is \"jms\". All folders after that are optional.Note: The \"usr\" folder is where you put your user data.Why are you not using theMQRFH2 classin MQ?https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_8.0.0/com.ibm.mq.dev.doc/q030950_.htmi.e. Here's how you should be doing it:MQMessage mqMsg = new MQMessage();\nMQRFH2 rfh2 = new MQRFH2();\n\nrfh2.setEncoding(CMQC.MQENC_NATIVE);\nrfh2.setCodedCharSetId(CMQC.MQCCSI_INHERIT);\nrfh2.setFormat(CMQC.MQFMT_STRING);\nrfh2.setNameValueCCSID(1208);\nrfh2.setFieldValue(\"usr\", \"somefield\", \"somedata\");\n\ntry\n{\n rfh2.write(mqMsg);\n}\ncatch (IOException e)\n{\n System.err.println(e.getLocalizedMessage());\n}Note: In the above code, folders \"mcd\" and \"jms\" will be automatically created and populated.You can blast all 3 folders (\"mcd\", \"jms\" and \"usr\") in 1 shot. I don't recommend it unless you know what you are doing.rfh2.setFolderStrings(new String[]{\"jms_text\",\n \"queue:///TEST.Q10\",\n \"somedata\"});\n"} +{"text": "### Human: For me it is not clear what the difference is between a WebSphere Message Broker and the WebSphere MQ .According to wikipedia the message broker translates and routes the message. Which would lead me to believe the WebSphere MQ is the queue, but it is not clear from all of the marketing information what the core task of the WebSphere MQ is. Wikipedia says MQ is composed of messages, queues, and queue managers.Does that mean WebSphere Message Broker is a component of MQ?### Assistant: WebSphere Message Broker is not a component of WebSphere MQ Series (moreover, starting from v10 of Message Broker you don't need to have WebSphere MQ installed at all on your system in order to run message broker).Think about WebSphere MQ as of a transport layer - you can send a message and receive it on another end (and all other particularities like persistence, fail-over, JMS, etc.)Think about WebSphere Message Broker as of a set of transformations you can apply on your message (whichmaybe transported via WebSphere MQ layer)\n"} +{"text": "### Human: I'm sending a JMSBytesMessage that I'm reading in from a file. I can write byte array back out to a file with no issues. But if I sent it to the JMS queue and retrieve it and try to print it to a file, it's unreadable.Files.readAllBytes(Paths.get(file.getPath()))\n\nFiles.write(filename, message.getBytes(), StandardOpenOption.CREATE);I've encoded it to Base64, which makes it two KB larger after retrieving it from the queue, but doesn't make it into anything I can read. What don't I understand about BytesMessages?### Assistant: Your code is ...strange or incompleteHow do you get the bytes from the JMS message? Ismessagethe JMSBytesMessageyou get from the queue?? There is nogetBytes()method in classBytesMessage.To get the bytes from aBytesMessage, do the following:BytesMessage msg = ... // Obtain the message from the Q\nbyte[] data = new byte[(int) msg.getBodyLength()];\nmsg.readBytes(data);Then to write the bytes to a fileFiles.write(filename, data, StandardOpenOption.CREATE);\n"} +{"text": "### Human: I am trying to subscribe to the topic via RFHUTIL, but I get an error message: \"Queue name required if not managed.\"\nBut I do not use queue, I use topic instead. Why should I specify the queue name? How can I subscribe to the topic?### Assistant: When you subscribe to a topic, messages are sent to you as a result. There are two choices that you can make.You can ask for those messages to be sent to a queueYou can have what is called a \"managed subscription\" which means you don't have to provide a specific queue name for those messages to be sent to.First of all, make sure you are using at minimum a V7 RFHUtil. That is when support for MQ V7 Publish/Subscribe was added.Make sure you are using the PS tab rather than the PubSub tab.Ensure you select the \"Managed Sub\" check box.\n"} +{"text": "### Human: We are using MQ Client ver 7.5.0.5 (64 bit), now want to migrate to ver 9.0(64 bit).\nDownloaded installer fromhere.With that said, I would like to ask below:App was compiled against ver 7.5.0.5; To enable the app to work with ver. 9.0 MQ client Installation does it need to be compiled against 9.0.?MQ Client ver. 7.5.0.5 works with .NET framework 4.0. I guess MQ Client ver. 9.0. also works with .NET framework 4.0, right?I searched IBM Site, but I didn't get pages explaining the above compatibility info. I might have not found if any pages explaining the above. If you know, could you give a link?### Assistant: I think you are asking about .net apps, so my answer expands on that, but for things like C applications, they also should just work.When you compile against 7505, you build in a dependency on the 7.5.0.5 version of amqmdnet for example. However MQ also ships policy files to indicate the newer versions or fix packs support the functionality of that one, and hence it should run without change on v9Yes, MQ supports .net framework 4 the same as 7.5.0.5 and should work seamlessly, assuming it worked at 7.5As an example I ran the 7.5 simpleput.exe sample against a v9 primary install and it just worked. (Although it looks like that sample is built with pre-.net 4, I dont have a .net 4 sample built against 7.5 to hand)To confirm it really is linked against 7.5.0.5 (bear in mind older pre-7.1 releases all have 1.0.0.3 as the version), you can use ildasm.exe simpleput.exe, look in manifest:.assembly extern amqmdnet\n{\n:\n .ver 7:5:0:5\n}In the GAC you have a policy file: gacutil /l | findstr /i amqmdnet\n policy.7.5.amqmdnet, Version=9.0.0.0, Culture=neutral, ....I dont know of any compatibility document like that other than the MQ Statement of operating environments (SOE) stating support for .net 4.\n"} +{"text": "### Human: I am newbie to Websphere MQ and i have some basic understanding on the concept of MQ. I know that MQ client would create a message (with MQMD and application data) and then send to MQ manager. MQ client will get the correct response back from MQ Manager. Supposedly there are many messages on the MQ Queue Manager, how does MQ client able to retrieve the right messages? What determines the uniqueness of a MQ message?### Assistant: There are different ways this can be approached - one common way is for the applications processing the messages to use the message ID and correlation ID fields. The message ID can be randomly generated and saved then copied to correlation ID field to be match when the reply is sent. Applications can do gets matching on those fields in the message header.I suggest you read through the applicationprogramming guideandreferencein the knowledge center.\n"} +{"text": "### Human: We have IBM MQ V7.1.0 installed and working in production. Can I create a queue manager in the production environment and perform stress testing on that. Will that impact other queue managers that are existing. Is there any way I can create separate environment from the installed IBM MQ (Not installing the MQ again).### Assistant: MQ is IO intensive, so performance mostly depends on the storage where the log and data directories of your queue managers are and on the capacity of the network interface(s) of your host.If you configure the queue managers to have separate (both logically and phisically) storages for the data and log directories of each, and you provide enough bandwidth for the machine to handle the message load of multiple queue managers, performance impact of the queue managers on each other should be minimal.That said, I don't think it's a good idea to do stress testing on an in use production environment, as the goal of stress testing is to find the load which \"breaks\" the system.\n"} +{"text": "### Human: I have a mq cluster setup that has a few queue managers, some are full repositories and some are partial repositories.A full repository is supposed to hold information(meta data?) about the entire cluster.A partial repository will hold some information about the cluster.How do I gather information about the entire cluster using Programmable Command Format?Information about hosts, queue managers, full and partial repositories, cluster queues etc....Update 1I have tried the following code but this does not return cluster information.PCFMessageAgent agent = new PCFMessageAgent(queueManager);\nagent.setCheckResponses(false);\nPCFMessage[] responses;\nPCFMessage request = new PCFMessage(MQConstants.MQCMD_INQUIRE_CLUSTER_Q_MGR);\nrequest.addParameter(MQConstants.MQCA_CLUSTER_Q_MGR_NAME, queueManager);\n\nresponses = agent.send(request);\nString clusterName = (String)responses[0].getParameterValue(MQConstants.MQCA_CLUSTER_NAME);\nString clusterInfo = (String)responses[0].getParameterValue(MQConstants.MQIACF_CLUSTER_INFO);\nlogger.info(\"Cluster Name [\" + clusterName + \"]\");\nlogger.info(\"Cluster Information [\" + clusterInfo + \"]\");The last line prints out a null.Update 2The answer below suggests thatMQCMD_INQUIRE_CLUSTER_Q_MGRis equivalent torunmqsc DISPLAY CLUSQMGR(*)command. Following is the output from this commanddisplay clusqmgr(*)\n 4 : display clusqmgr(*)\nAMQ8441: Display Cluster Queue Manager details.\n CLUSQMGR(QM_FR1) CHANNEL(TO.QM_FR1)\n CLUSTER(CLUSTER1) \nAMQ8441: Display Cluster Queue Manager details.\n CLUSQMGR(QM_FR2) CHANNEL(TO.QM_FR2)\n CLUSTER(CLUSTER1) \nAMQ8441: Display Cluster Queue Manager details.\n CLUSQMGR(QM_PR1) CHANNEL(TO.QM_PR1)\n CLUSTER(CLUSTER1) \nAMQ8441: Display Cluster Queue Manager details.\n CLUSQMGR(QM_PR2) CHANNEL(TO.QM_PR2)\n CLUSTER(CLUSTER1) \nAMQ8441: Display Cluster Queue Manager details.\n CLUSQMGR(QM_PR3) CHANNEL(TO.QM_PR3)\n CLUSTER(CLUSTER1) \nAMQ8441: Display Cluster Queue Manager details.\n CLUSQMGR(QM_PR3) CHANNEL(TO.QM_PR3)\n CLUSTER(CLUSTER1)I was expecting a similar response with PCF in the code i have supplied, but i don't get this information.So the question isHow do I get this information using PCF?The above output is for a full repository queue manager.### Assistant: Use the following PCF commandsInquire Cluster Queue Manager (MQCMD_INQUIRE_CLUSTER_Q_MGR) which is the equivalent of the MQSC commandDISPLAY CLUSQMGR. In the linked page, you can see all the possible output parameters listed in the section headed withClusterQMgrAttrs. You can remove the line in your code that is trying to retrieve the value of the MQIACF_CLUSTER_INFO - anINPUT-ONLYparameter - and replace that line with any one of the parameters listed in that section to retrieve whatever information it is that you want about this cluster queue manager.Inquire Queue (MQCMD_INQUIRE_Q) with the MQIACF_CLUSTER_INFO parameter which is the equivalent of the MQSC commandDISPLAY QUEUE(*) CLUSINFO. Please note, the MQIACF_CLUSTER_INFO parameter is an input qualifier to this command that causes cluster queues as well as local queues to be returned as answers.As you correctly note, only the full repository queue manager knows everything about a cluster, so you need to make your inquiries against that queue manager in order to get the full picture.\n"} +{"text": "### Human: I am using IBM MQ-7.5. I am running a jms client which connects to the manager running on some other hosts.I want to monitor the TCP connections with the manager. How do I get notified if my client connection is broken with the manager ? Is there any callback or listener provided in IBM MQ APIs to know any interruption on connection ?Eg. Like ActiveMQ hashttp://activemq.apache.org/maven/apidocs/org/apache/activemq/transport/TransportListener.htmlThanks,Anuj### Assistant: In terms of connections being dropped a connection broken exception will be sent via the exception listener.The JMS Specification is written such that events such as connection broken are legitimately returned on synchronous calls only. I would also recommended setting an exception listener, and to catch exceptions from all messaging operations and taking appropriate action.\n"} +{"text": "### Human: I have created an application using IBM XMS.NET. All is good and I am able to read the mssages from queue. \nI want to read only those messages which are older that 2 mins from now.\nHow to use selector in this case. Below is code I have created.var time = 120000; // 2 mins in miliseconds\n var currentTime = (DateTime.Now - DateTime.MinValue).TotalMilliseconds; // current time in milliseconds\n long finaltime = Convert.ToInt64(currentTime - time); // Time in milliseconds after substracting 2 minutes\nvar dtt = Convert.ToInt64(((new DateTime(1970, 01, 01, 01, 00, 00)) - DateTime.MinValue).TotalMilliseconds); // Time in miliseconds till 1970\n finaltime = finaltime - dtt; // substracting milliseconds till 1976 as JMSTimestamp shows time after 1970\nstring selector = \"JMSTimestamp <=\" + finaltime.ToString();Here selector is getting set as fixed value for example 1454322340382. \nHow I can set selector to choose latest DateTime.Now and then look for message older that DateTime.Now - 2 minutes.### Assistant: Selecting on those messages that are older than 2 minutes is probably the most inefficient way to look at those messages. You don't say why you want to do this. If you simply want to discard them, then I suggest you have the producer of the message add an expiry time on those messages. If you cannot get the producer of the message to change their application to do this, then consider using the CAPEXPRY administrative over-ride.If you want to look at them, then browsing through all the messages and only operating on those which are the right age would be more efficient that selecting them I'm sure.\n"} +{"text": "### Human: echo \"DISPLAY QL($Queue) CURDEPTH\" \\\n | runmqsc Queue_Managr \\\n | grep 'CURDEPTH(' \\\n | sed 's/.*CURDEPTH//' \\\n | tr -d '()'.Can anyone suggest how this script works? Actually this command displays the current depth value for a particular Q_Manager for a particular queue.I understand\"DISPLAY QL($Queue) CURDEPTH\" | runmqsc Queue_Managr\"- this command displays the queue name and curdepth{value}.But I don't understandgrep 'CURDEPTH(' | sed 's/.*CURDEPTH//' | tr -d '(). How does this command work?### Assistant: It's a pipeline. It contains five stages, separated by the pipe character|. The output of one stage is used as the input to the next stage.echo \"DISPLAY blatti blatti\"- this just outputs some text.runmqsc Queue_Managr- Uses the text as input to therunmqsc-command, which does some MQ magic and outputs data.grep 'CURDEPTH('- Grep is a standard unix utility. It filters its input. In this case, only lines containing the textCURDEPTH(is allowed through to the next stage.sed 's/.*CURDEPTH//'- Sed is another standard utility. It's short for \"stream editor\", and allows you edit the input as it passes through. In this case, the expression's/.*CURDEPTH//'means to delete everything from the start of each line, up to and including the textCURDEPTH. (remember, only lines containing that text was passed through from the previous stage).tr -d '()'- Finally, another standard utility, tr, which also allows editing the text that flows through from input to output.-d '()'means delete the characters(and)from the text.The output from the final stage is shown in the terminal (if you ran your script in a terminal).It's a fairly common way of building scripts in a unix shell. Generate the input data somehow, push it to a command, and massage the output data through a couple of stages each doing its little bit.Long dissertations can be (and probably have been) written about all ofgrep,sedandtr. Look them up if you're interested.\n"} +{"text": "### Human: I'm trying to get an understanding of how thePCFMessageAgentmanages connections to ensure I'm cleaning up everything properly.For example, at what point is the connection disconnected once I've created the object and I'm done with it?PCFMessageAgent agent = new PCFMessageAgent (\"localhost\", 1414, \"CLIENT\");The example in the documentation does not show any disconnect call, but I want to be sure I'm not assuming anything.If it matters, I'm currently on MQ version 7.5, but it doesn't appear this has changed much.### Assistant: Always cleanup your stuff.If you connect it, then make sure you disconnect from itIf you open it, then make sure you close iti.e.if (agent != null)\n agent.disconnect();\n"} +{"text": "### Human: We have IBM WebSphere MQ 7.5. We have setup Queue Manager and Queues. We want to read and write XML formatted text from the queues using XMS for .net client application. I tried below code but I don't know how to read that data.Code:try\n {\n var factoryfactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\n var connectionfactory = factoryfactory.CreateConnectionFactory();\n connectionfactory.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, queueManager);\n connectionfactory.SetStringProperty(XMSC.WMQ_HOST_NAME, hostIP);\n connectionfactory.SetIntProperty(XMSC.WMQ_PORT, port);\n connectionfactory.SetStringProperty(XMSC.WMQ_CHANNEL, channel);\n connectionfactory.SetIntProperty(XMSC.WMQ_BROKER_VERSION, XMSC.WMQ_BROKER_V2);\n connectionfactory.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT_UNMANAGED);\n using (IConnection conn = connectionfactory.CreateConnection())\n {\n using (ISession session = conn.CreateSession(false, AcknowledgeMode.AutoAcknowledge))\n {\n using (IDestination dest = session.CreateQueue(string.Format(\"queue://{0}\", queueName))) // Create a queue\n {\n using (IMessageConsumer consumer = session.CreateConsumer(dest))\n {\n conn.Start();\n IMessage recvMsg = null;\n recvMsg = consumer.Receive();\n if (recvMsg != null)\n return recvMsg;\n\n }\n }\n }\n }\n }\n catch(XMSException ex)\n {\n\n }recvMsg is returning data in JMS. Any working code to read data for string/XML?The response is coming like this:JMSMessage class: jms_bytes\n JMSType: \n JMSDeliveryMode: NonPersistent\n JMSExpiration: 0\n JMSPriority: 0\n JMSMessageID: ID:414d512043524d44514d312020202020118cff552000dd10\n JMSTimestamp: 1442899405610\n JMSCorrelationID: \n JMSDestination: \n JMSReplyTo: \n JMSRedelivered: False\n JMS_IBM_Character_Set: 850\n JMS_IBM_Encoding: 546\n JMS_IBM_Format: \n JMS_IBM_MsgType: 8\n JMS_IBM_PutApplType: 11\n JMS_IBM_PutDate: 20150922\n JMS_IBM_PutTime: 05232561\n JMSXAppID: staller\\MQ\\Tools\\rfhutil.exe\n JMSXDeliveryCount: 1\n JMSXUserID: \n3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d38223f3e0d0a\n3c212d2d53616d706c6520584d4c2066696c652067656e65726174656420627920584d4c53707920\n76323031322028687474703a2f2f7777772e616c746f76612e636f6d292d2d3e0d0a3c6d74613a4d\n5441546f45534254726176656c486973746f7279526571756573744d657373616765207873693a73\n6368656d614c6f636174696f6e3d22687474703a2f2f6d74612e626f726465722e676f762e61752f\n6d74612f76312e30204d5441546f4553424d657373616765732e7873642220786d6c6e733a636f6d\n6d6f6e3d22687474703a2f2f6573622e626f726465722e676f762e61752f636f6d6d6f6e2f76312e\n302220786d6c6e733a74683d22687474703a2f2f6d74612e626f726465722e676f762e61752f6d74\n612f74726176656c686973746f72792f76312e302220786d6c6e733a6d74613d22687474703a2f2f\n6d74612e626f726465722e676f762e61752f6d74612f76312e302220786d6c6e733a7873693d2268\n...### Assistant: Your application is getting the message asjms_bytestype message. As XML is basically text you can useITextMessagemessage type for sending and receiving XML payload. Change your producer application to send messages of typeITextMessageand change your application to receive the same message type. Sample snippet is here.Producer:IMessageProducer producer;\n ITextMessage textMessage;\n\n // create session, producer\n ....\n\n textMessage = sessionWMQ.CreateTextMessage();\n textMessage.Text = XmlPayload;\n producer.Send(textMessage);Consumer:IMessageConsumer consumer;\nITextMessage textMessage;\n\n// create session and consumer\n\n....\n// Receive text message\ntextMessage = (ITextMessage)consumer.Receive(3000); // Wait for 3 seconds to receive message\nString XmlPayload = textMessage.Text;\n"} +{"text": "### Human: I have a requirement where I need to read the current configuration of WebSphere MQ (cluster config, queue managers, queues, channels, remote queue etc..., the works).I need to write this tool in Java.So is there a JMX API for WebSphere MQ that will allow me to read MQ configuration?Is the config stored in a file (xml? or otherwise.) that I can read?MQExplorer shows all the queues, queue managers etc... How does it do it? I am not really interested in queue depth etc... (don't want runtime info) just the config.### Assistant: Oh boy.\nThere's nothing as straight forward as a JMX API, or even XML.\nThe only real way to get the data you're looking for (in Java) other than issuing command line requests and scraping the response is theProgrammable Command Formatsor PCF. It's the nastiest API I've ever had the displeasure of using, but it is, admittedly, very useful. There's a decent number of examples floating around (not from IBM mind you) butthis oneis the most comprehensive collection I've seen.\n"} +{"text": "### Human: I am trying to push a message to IBM MQ but while adding properties like HostName, channel and Port I am getting below error when I continue the debug without stoppingItem has already been added. Key in dictionary: 'Hostname' Key being added: 'Hostname' in c#.I have tried to validate as below,if (!MQEnvironment.properties.ContainsKey(strHost) && !MQEnvironment.properties.ContainsKey(intPort) && !MQEnvironment.properties.ContainsKey(strChannel))\n {\n\n MQEnvironment.properties.Add(\"Hostname\", strHost);\n MQEnvironment.properties.Add(\"Port\", intPort);\n MQEnvironment.properties.Add(\"Channel\", strChannel);\n MQEnvironment.properties.Add(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES);\n }above code contains in my MQ PutMessage method where I am pushing my message.### Assistant: Yuk (and a headache for future support).First off, the MQEnvironment class is a static class and should ONLY be used for super simple programs. The IBM MQ best practices is to use a HashTable.Second, why are you not using the supplied MQ defines for the key names? (it will eliminate typos)Third, you need to review the MQ Knowledge Center for the correct MQ .NET values for 'TRANSPORT_PROPERTY'. Please seehere. There are 4 valid values for MQ .NET:MQC.TRANSPORT_MQSERIES_BINDINGS - connect as server\n MQC.TRANSPORT_MQSERIES_CLIENT - connect as non-XA client\n MQC.TRANSPORT_MQSERIES_XACLIENT - connect as XA client\n MQC.TRANSPORT_MQSERIES_MANAGED - connect as non-XA managed clientHere is the proper way to code it:Hashtable qMgrProp = new Hashtable();\nqMgrProp.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);\nqMgrProp.Add(MQC.HOST_NAME_PROPERTY, strHost);\nqMgrProp.Add(MQC.PORT_PROPERTY, intPort);\nqMgrProp.Add(MQC.CHANNEL_PROPERTY, strChannel);\n\nMQQueueManager qMgr = new MQQueueManager(qMgrName, qMgrProp);\n"} +{"text": "### Human: I create a small application to subscribe message from definite topic. In my test environment I have only trial version WebSphere MQ and i don't know how can I put message to the my definite topic. I can put message to queue and get it, but when i want get message from definite topic, a get a empty message.UpdateMoved question update from another answer by OP into the question.I use sample codeC:\\Program Files\\IBM\\WebSphere MQ\\Tools\\dotnet\\samples\\cs\\base\\SimpleSubscribe// mq properties\n properties = new Hashtable();\n properties.Add(MQC.HOST_NAME_PROPERTY, hostName);\n properties.Add(MQC.PORT_PROPERTY, port);\n properties.Add(MQC.CHANNEL_PROPERTY, channelName);\n #region pass\n properties.Add(MQC.USER_ID_PROPERTY, \"LOGIN\");\n properties.Add(MQC.PASSWORD_PROPERTY, \"PASSWORD\");\n #endregion\n properties.Add(MQC.MQCA_TOPIC_NAME, \"News.Topic\");\n\n if (sslKeyRepository != null)\n {\n properties.Add(MQC.SSL_CERT_STORE_PROPERTY, sslKeyRepository);\n }\n if (cipherSpec != null)\n {\n properties.Add(MQC.SSL_CIPHER_SPEC_PROPERTY, cipherSpec);\n }\n if (sslPeerName != null)\n {\n properties.Add(MQC.SSL_PEER_NAME_PROPERTY, sslPeerName);\n }\n if (keyResetCount != 0)\n {\n properties.Add(MQC.SSL_RESET_COUNT_PROPERTY, keyResetCount);\n }\n if (sslCertRevocationCheck != false)\n {\n MQEnvironment.SSLCertRevocationCheck = sslCertRevocationCheck;\n }\n\n if (transportMode == \"managed\")\n properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\n else if (transportMode == \"unmanaged\")\n properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);\n\n // create connection\n Console.Write(\"Connecting to queue manager.. \");\n queueManager = new MQQueueManager(queueManagerName, properties);\n Console.WriteLine(\"done\");\n\n // accessing topic\n Console.Write(\"Accessing topic \" + topicName + \".. \");\n if (durability == \"nondurable\")\n topic = queueManager.AccessTopic(topicName, null, MQC.MQTOPIC_OPEN_AS_SUBSCRIPTION, MQC.MQSO_CREATE | MQC.MQSO_FAIL_IF_QUIESCING);\n else if (durability == \"durable\")\n topic = queueManager.AccessTopic(topicName, null, MQC.MQSO_CREATE | MQC.MQSO_FAIL_IF_QUIESCING | MQC.MQSO_DURABLE | MQC.MQSO_RESUME, null, \"DurableSubscriptionName\");\n Console.WriteLine(\"done\");\n\n // creating a message object\n message = new MQMessage();\n message.WriteString(messageString);\n\n int time = 1;\n // getting messages continuously\n for (int i = 1; i <= numberOfMsgs; i++)\n {\n // creating a message object\n message = new MQMessage();\n\n try\n {\n topic.Get(message);\n Console.WriteLine(\"Message \" + i + \" got = \" + message.ReadString(message.MessageLength));\n message.ClearMessage();\n }\n catch (MQException mqe)\n {\n if (mqe.ReasonCode == 2033)\n {\n ++time;\n --i;\n Console.WriteLine(\"No message available\");\n Thread.Sleep(1000);\n //waiting for 10sec \n if (time > 10)\n {\n Console.WriteLine(\"Timeout : No message available\");\n break;\n }\n continue;\n }\n else\n {\n Console.WriteLine(\"MQException caught: {0} - {1}\", mqe.ReasonCode, mqe.Message);\n }\n }\n }\n\n // closing topic\n Console.Write(\"Closing topic.. \");\n topic.Close();\n Console.WriteLine(\"done\");\n\n // disconnecting queue manager\n Console.Write(\"Disconnecting queue manager.. \");\n queueManager.Disconnect();\n Console.WriteLine(\"done\");### Assistant: The Publish/Subscribe methodology is different from putting and getting from queues. In order to receive a message that has been published to a topic, the receiving application must have a subscription to that topic.If you create a subscription first, and then receive messages from it, then when you put to the topic, your receiving application will get a copy of the message.I would reiterate Shashi's request though, post the code you have so far so we can help further.\n"} +{"text": "### Human: I am getting the following error when I try to do a Fan-In using aggregate node in IBM integration bus.( T24_Integ_Node.default ) The Aggregation Reply node has received a reply message which has a blank reply ID: ''. \nThis is not allowed because the reply ID is needed so that a reply message can be matched to the original request message. If you are using WebSphere MQ to send and receive aggregation requests, the reply ID must be stored in the correlation identifier (CorrelId) field of the message descriptor (MQMD) and it must be set to the value of the message ID in the request message's MQMDThe message flow is like below:FILE<1> -->AggregateControl<1>-->FAN-OUT-COMPUTE-NODES<1,2,3> -->FILE-OUTPUT-NODES<1,2,3> --> AGGREGATE-REQUEST-NODES<1,2,3> --> AGGREGATE-REPLY-NODE<1> --> FAN-IN-COMPUTE-NODE<1> --> FILE-OUTPUT-NODE<1>Please note I am not using MQ nodes\nKindly suggest.### Assistant: What you are attempting will not work because you are not using a request/reply protocol on the inside of the aggregation. As stated in the Knowledge Center article at thislink, \"The aggregation nodes work correctly only for transports that use a request/reply model\", and writing to and reading from files does not fulfill that requirement. Some nodes that do fulfill this requirement are the MQ nodes, the SOAP Asynchronous nodes, and the HTTP Asynchronous nodes. Additionally, you need to use an AggregateControl node to mark the start of the fan-out, and I do not see an AggregateControl node in your flow sketch.I suspect that you want to submit files to an external application(s), have that application(s)'s instances run independently and in parallel, receive response files, then group the response files based upon a flag(s) in the files' names or in the files' content. If so, use the Collector node.An alternative would be to use the aggregation nodes with MQ nodes inside of the aggregation, with these MQ nodes feeding an intermediate flow that changed the fan-out protocol from MQ to file, then conversely, the fan-in protocol from file to MQ. See IIB's web services aggregation sample for an example of this technique.\n"} +{"text": "### Human: After creating a new Queue-Manager using the MQ Explorer, it's fails to be started properly and provide the following message:Command: \"C:\\Program Files (x86)\\IBM\\WebSphere MQ\\bin\\crtmqm\" -sa test_qmWebSphere MQ queue manager created.Directory 'C:\\Program Files (x86)\\IBM\\WebSphere MQ\\qmgrs\\test_qm'\n created.The queue manager is associated with installation 'WMQ75Install'.exitvalue = 2059I couldn't figure out how to solve it from the logs and tried to start it manually from the MQ Explorer and from the command-line shell as well, but without any success - it just not started.HERE IS MY AMQERR01.LOG TEXT:21/01/2015 14:18:46 - Process(7960.3) User(johnsmith) Program(amqzmuc0.exe)\n Host(NY0035546) Installation(WMQ75Install)\n VRMF(7.5.0.2) QMgr(test_qm)AMQ6287: WebSphere MQ V7.5.0.2 (p750-002-131001_DE).EXPLANATION:\nWebSphere MQ system information: \nHost Info :- Windows 7 Enterprise x64 Edition, Build 7601: SP1 (MQ\nWindows 32-bit) \nInstallation :- C:\\Program Files (x86)\\IBM\\WebSphere MQ (WMQ75Install) \nVersion :- 7.5.0.2 (p750-002-131001_DE)\nACTION:None.21/01/2015 14:18:46 - Process(7960.3) User(johnsmith) Program(amqzmuc0.exe)\n Host(NY0035546) Installation(WMQ75Install)\n VRMF(7.5.0.2) QMgr(test_qm)AMQ5051: The queue manager task 'LOGGER-IO' has started.EXPLANATION:\nThe critical utility task manager has started the LOGGER-IO task. This task has\nnow started 1 times.\nACTION:None.21/01/2015 14:18:46 - Process(7960.1) User(johnsmith) Program(amqzmuc0.exe)\n Host(NY0035546) Installation(WMQ75Install)\n VRMF(7.5.0.2) QMgr(test_qm)AMQ5041: The queue manager task 'LOGGER-IO' has ended.EXPLANATION:\nThe queue manager task LOGGER-IO has ended.\nACTION:None.21/01/2015 14:18:49 - Process(7528.3) User(johnsmith) Program(amqzmuc0.exe)\n Host(NY0035546) Installation(WMQ75Install)\n VRMF(7.5.0.2) QMgr(test_qm)AMQ5051: The queue manager task 'LOGGER-IO' has started.EXPLANATION:\nThe critical utility task manager has started the LOGGER-IO task. This task has\nnow started 1 times.\nACTION:None.21/01/2015 14:18:49 - Process(9760.1) User(johnsmith) Program(amqzxma0.exe)\n Host(NY0035546) Installation(WMQ75Install)\n VRMF(7.5.0.2) QMgr(test_qm)AMQ7229: 4 log records accessed on queue manager 'test_qm' during the log\nreplay phase.EXPLANATION:\n4 log records have been accessed so far on queue manager test_qm during the log\nreplay phase in order to bring the queue manager back to a previously known\nstate.\nACTION:None.21/01/2015 14:18:49 - Process(9760.1) User(johnsmith) Program(amqzxma0.exe)\n Host(NY0035546) Installation(WMQ75Install)\n VRMF(7.5.0.2) QMgr(test_qm)AMQ7230: Log replay for queue manager 'test_qm' complete.EXPLANATION:\nThe log replay phase of the queue manager restart process has been completed\nfor queue manager test_qm.\nACTION:None.21/01/2015 14:18:49 - Process(9760.1) User(johnsmith) Program(amqzxma0.exe)\n Host(NY0035546) Installation(WMQ75Install)\n VRMF(7.5.0.2) QMgr(test_qm)AMQ7231: 0 log records accessed on queue manager 'test_qm' during the recovery\nphase.EXPLANATION:\n0 log records have been accessed so far on queue manager test_qm during the\nrecovery phase of the transactions manager state.\nACTION:None.21/01/2015 14:18:49 - Process(9760.1) User(johnsmith) Program(amqzxma0.exe)\n Host(NY0035546) Installation(WMQ75Install)\n VRMF(7.5.0.2) QMgr(test_qm)AMQ7232: Transaction manager state recovered for queue manager 'test_qm'.EXPLANATION:\nThe state of transactions at the time the queue manager ended has been\nrecovered for queue manager test_qm.\nACTION:None.21/01/2015 14:18:49 - Process(9760.1) User(johnsmith) Program(amqzxma0.exe)\n Host(NY0035546) Installation(WMQ75Install)\n VRMF(7.5.0.2) QMgr(test_qm)AMQ7233: 0 out of 0 in-flight transactions resolved for queue manager\n'test_qm'.EXPLANATION:\n0 transactions out of 0 in-flight at the time queue manager test_qm ended have\nbeen resolved.\nACTION:None.21/01/2015 14:18:49 - Process(7528.4) User(johnsmith) Program(amqzmuc0.exe)\n Host(NY0035546) Installation(WMQ75Install)\n VRMF(7.5.0.2) QMgr(test_qm)AMQ5051: The queue manager task 'CHECKPOINT' has started.EXPLANATION:\nThe critical utility task manager has started the CHECKPOINT task. This task\nhas now started 1 times.\nACTION:None.21/01/2015 14:18:51 - Process(9796.3) User(johnsmith) Program(amqzmur0.exe)\n Host(NY0035546) Installation(WMQ75Install)\n VRMF(7.5.0.2) QMgr(test_qm)AMQ5037: The queue manager task 'ERROR-LOG' has started.EXPLANATION:\nThe restartable utility task manager has started the ERROR-LOG task. This task\nhas now started 1 times.\nACTION:None.21/01/2015 14:18:51 - Process(9796.4) User(johnsmith) Program(amqzmur0.exe)\n Host(NY0035546) Installation(WMQ75Install)\n VRMF(7.5.0.2) QMgr(test_qm)AMQ5037: The queue manager task 'APP-SIGNAL' has started.EXPLANATION:\nThe restartable utility task manager has started the APP-SIGNAL task. This task\nhas now started 1 times.\nACTION:None.21/01/2015 14:18:51 - Process(9796.5) User(johnsmith) Program(amqzmur0.exe)\n Host(NY0035546) Installation(WMQ75Install)\n VRMF(7.5.0.2) QMgr(test_qm)AMQ5037: The queue manager task 'APP-SIGNAL' has started.EXPLANATION:\nThe restartable utility task manager has started the APP-SIGNAL task. This task\nhas now started 2 times.\nACTION:None.21/01/2015 14:18:51 - Process(9796.7) User(johnsmith) Program(amqzmur0.exe)\n Host(NY0035546) Installation(WMQ75Install)\n VRMF(7.5.0.2) QMgr(test_qm)AMQ5037: The queue manager task 'APP-SIGNAL' has started.EXPLANATION:\nThe restartable utility task manager has started the APP-SIGNAL task. This task\nhas now started 4 times.\nACTION:None.21/01/2015 14:18:51 - Process(9796.6) User(johnsmith) Program(amqzmur0.exe)\n Host(NY0035546) Installation(WMQ75Install)\n VRMF(7.5.0.2) QMgr(test_qm)AMQ5037: The queue manager task 'APP-SIGNAL' has started.EXPLANATION:\nThe restartable utility task manager has started the APP-SIGNAL task. This task\nhas now started 3 times.\nACTION:None.21/01/2015 14:18:52 - Process(10328.1) User(johnsmith) Program(amqzfuma.exe)\n Host(NY0035546) Installation(WMQ75Install)\n VRMF(7.5.0.2) QMgr(test_qm)AMQ8077: Entity 'johnsmith@intranet' has insufficient authority to access object\n'test_qm'.EXPLANATION:\nThe specified entity is not authorized to access the required object. The\nfollowing requested permissions are unauthorized: connect/system\nACTION:\nEnsure that the correct level of authority has been set for this entity against\nthe required object, or ensure that the entity is a member of a privileged\ngroup. \n----- amqzfubn.c : 515 --------------------------------------------------------\n21/01/2015 14:18:52 - Process(9760.1) User(johnsmith) Program(amqzxma0.exe)\n Host(NY0035546) Installation(WMQ75Install)\n VRMF(7.5.0.2) QMgr(test_qm)AMQ5525: The WebSphere MQ Object Authority Manager has failed.EXPLANATION:\nThe Object Authority Manager has failed to complete an MQ request.\nACTION:\nCheck the queue manager error logs for messages explaining the failure and try\nto correct the problem accordingly. \n----- amqzxma0.c : 3825 -------------------------------------------------------\n21/01/2015 14:18:52 - Process(9760.1) User(johnsmith) Program(amqzxma0.exe)\n Host(NY0035546) Installation(WMQ75Install)\n VRMF(7.5.0.2) QMgr(test_qm)AMQ8003: WebSphere MQ queue manager 'test_qm' started using V7.5.0.2.EXPLANATION:\nWebSphere MQ queue manager 'test_qm' started using V7.5.0.2.\nACTION:None.21/01/2015 14:18:52 - Process(9760.1) User(johnsmith) Program(amqzxma0.exe)\n Host(NY0035546) Installation(WMQ75Install)\n VRMF(7.5.0.2) QMgr(test_qm)AMQ5008: An essential WebSphere MQ process 10328 (amqzfuma.exe) cannot be found\nand is assumed to be terminated.EXPLANATION:\n1) A user has inadvertently terminated the process. 2) The system is low on\nresources. Some operating systems terminate processes to free resources. If\nyour system is low on resources, it is possible it has terminated the process\nso that a new process can be created.\nACTION:\nWebSphere MQ will stop all MQ processes. Inform your systems administrator. \nWhen the problem is rectified WebSphere MQ can be restarted. \n----- amqzxmb0.c : 9956 -------------------------------------------------------\n21/01/2015 14:18:52 - Process(9760.1) User(johnsmith) Program(amqzxma0.exe)\n Host(NY0035546) Installation(WMQ75Install)\n VRMF(7.5.0.2) QMgr(test_qm)AMQ5050: An essential WebSphere MQ process 9188 (zllPUBSUB) cannot be found and\nis assumed to be terminated.EXPLANATION:\n1) A user has inadvertently terminated the process. 2) The system is low on\nresources. Some operating systems terminate processes to free resources. If\nyour system is low on resources, it is possible it has terminated the process\nso that a new process can be created. 3) MQ has encountered an unexpected\nerror. Check for possible errors reported in the MQ error logs and for any\nFFSTs that have been generated.\nACTION:\nWebSphere MQ will attempt to restart the terminated process. \n----- amqzxmb0.c : 9679 -------------------------------------------------------\n21/01/2015 14:18:53 - Process(9760.1) User(johnsmith) Program(amqzxma0.exe)\n Host(NY0035546) Installation(WMQ75Install)\n VRMF(7.5.0.2) QMgr(test_qm)AMQ8004: WebSphere MQ queue manager 'test_qm' ended.EXPLANATION:\nWebSphere MQ queue manager 'test_qm' ended.\nACTION:None.### Assistant: At a guess, is johnsmith a domain id? Is this a domain workstation (what is 'johnsmith@intranet')? My suspicion is you have a machine in a domain but you have not configured MQ to run on a machine in a domain. I think the issue is that at startup MQ is trying to determine what groups the userid 'johnsmith@intranet' is a member of, and hence fails. Its possible, adding johnsmith to the local mqm groupmayget you futher although my suspicion is you need to do the domain configuration. See another answer for details of what to do:Issue with permission grant to domain users in IBM web sphere queue manager\n"} +{"text": "### Human: I have aspring-integration 4.0.xbased application which makes connections to a Websphere MQ manager for producing/consuming JMS messages. The application is currently deployed on aTomcat 7.0.xcontainer which, when running on a Windows host, the application stops as expected when the container is shutdown but, when running on a RH6 Linux host, the application fails to stop as expected when the container is shutdown.Looking at trace level logging during the Linux based shutdown, I can see that the application gets stuck when trying to close JMS connections to the Websphere MQ queues:15:24:30.628 [localhost-startStop-2] DEBUG org.springframework.beans.factory.support.DisposableBeanAdapter - Invoking destroy() on bean with name 'cachingConnectionFactory'\n15:24:30.628 [localhost-startStop-2] DEBUG org.springframework.jms.connection.CachingConnectionFactory - Closing shared JMS Connection: com.ibm.mq.jms.MQQueueConnection@13909638The application then remains at this point for about 15 minutes until the following then gets logged:15:40:24.247 [task-scheduler-1] TRACE org.springframework.jms.connection.CachingConnectionFactory - Logical close of cached JMS Session failed - discarding it\njavax.jms.IllegalStateException: MQJMS1024: session closed\n at com.ibm.mq.jms.MQSession.checkSessionOpen(MQSession.java:2629) ~[com.ibm.mqjms-6.0.2.3.jar:6.0.2.3 - j600-203-080121 ]\n at com.ibm.mq.jms.MQSession.getTransacted(MQSession.java:1385) ~[com.ibm.mqjms-6.0.2.3.jar:6.0.2.3 - j600-203-080121 ]\n at org.springframework.jms.connection.CachingConnectionFactory$CachedSessionInvocationHandler.logicalClose(CachingConnectionFactory.java:457) ~[spring-jms-4.0.7.RELEASE.jar:4.0.7.RELEASE]\n at org.springframework.jms.connection.CachingConnectionFactory$CachedSessionInvocationHandler.invoke(CachingConnectionFactory.java:309) [spring-jms-4.0.7.RELEASE.jar:4.0.7.RELEASE]\n at com.sun.proxy.$Proxy92.close(Unknown Source) [?:?]\n at org.springframework.jms.support.JmsUtils.closeSession(JmsUtils.java:108) [spring-jms-4.0.7.RELEASE.jar:4.0.7.RELEASE]\n at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:497) [spring-jms-4.0.7.RELEASE.jar:4.0.7.RELEASE]\n at org.springframework.jms.core.JmsTemplate.receiveSelected(JmsTemplate.java:761) [spring-jms-4.0.7.RELEASE.jar:4.0.7.RELEASE]\n at org.springframework.integration.jms.JmsDestinationPollingSource.doReceiveJmsMessage(JmsDestinationPollingSource.java:122) [spring-integration-jms-4.0.4.RELEASE.jar:?]\n at org.springframework.integration.jms.JmsDestinationPollingSource.receive(JmsDestinationPollingSource.java:96) [spring-integration-jms-4.0.4.RELEASE.jar:?]\n at org.springframework.integration.endpoint.SourcePollingChannelAdapter.receiveMessage(SourcePollingChannelAdapter.java:144) [spring-integration-core-4.0.6.RELEASE.jar:?]\n at org.springframework.integration.endpoint.AbstractPollingEndpoint.doPoll(AbstractPollingEndpoint.java:192) [spring-integration-core-4.0.6.RELEASE.jar:?]\n at org.springframework.integration.endpoint.AbstractPollingEndpoint.access$000(AbstractPollingEndpoint.java:55) [spring-integration-core-4.0.6.RELEASE.jar:?]\n at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:149) [spring-integration-core-4.0.6.RELEASE.jar:?]\n at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:146) [spring-integration-core-4.0.6.RELEASE.jar:?]\n at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller$1.run(AbstractPollingEndpoint.java:298) [spring-integration-core-4.0.6.RELEASE.jar:?]\n at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:52) [spring-integration-core-4.0.6.RELEASE.jar:?]\n at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50) [spring-core-4.0.8.RELEASE.jar:4.0.8.RELEASE]\n at org.springframework.integration.util.ErrorHandlingTaskExecutor.execute(ErrorHandlingTaskExecutor.java:49) [spring-integration-core-4.0.6.RELEASE.jar:?]\n at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.run(AbstractPollingEndpoint.java:292) [spring-integration-core-4.0.6.RELEASE.jar:?]\n at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) [spring-context-4.0.8.RELEASE.jar:4.0.8.RELEASE]\n at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81) [spring-context-4.0.8.RELEASE.jar:4.0.8.RELEASE]\n at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_25]\n at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_25]\n at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) [?:1.8.0_25]\n at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [?:1.8.0_25]\n at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_25]\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_25]\n at java.lang.Thread.run(Unknown Source) [?:1.8.0_25]\n15:40:24.257 [task-scheduler-1] DEBUG org.springframework.jms.connection.CachingConnectionFactory - Closing cached Session: com.ibm.mq.jms.MQQueueSession@6d33d604\n15:40:24.258 [task-scheduler-1] DEBUG org.springframework.integration.endpoint.SourcePollingChannelAdapter - Poll interrupted - during stop()? : MQJMS1024: session closed; nested exception is javax.jms.IllegalStateException: MQJMS1024: session closedMy application runs using the following stack:java 8\n\ncom.ibm:com.ibm.mq:6.0.2.3\ncom.ibm:com.ibm.mqjms:6.0.2.3\njavax.jms:jms:1.1\norg.springframework.integration:spring-integration-core:4.0.6.RELEASE\norg.springframework.integration:spring-integration-java-dsl:1.0.1.RELEASE\norg.springframework.integration:spring-integration-jms:4.0.4.RELEASEMy application's JMS config is shown here:@Configuration\n@ComponentScan\npublic class JmsConfig {\n\n @Autowired\n private Properties jndiProperties;\n \n private ConnectionFactory mqConnectionFactory() throws NamingException {\n \n Context ctx = new InitialContext(jndiProperties);\n \n try {\n MQQueueConnectionFactory connectionFactory = (MQQueueConnectionFactory)\n ctx.lookup(\"jms/service/SERVICE_QCF\");\n \n return connectionFactory;\n \n } finally {\n ctx.close();\n } \n }\n \n @Bean\n public CachingConnectionFactory cachingConnectionFactory() throws NamingException {\n CachingConnectionFactory connectionFactory = new CachingConnectionFactory();\n connectionFactory.setTargetConnectionFactory(mqConnectionFactory());\n connectionFactory.setCacheConsumers(false);\n return connectionFactory;\n }\n}My application's Integration config is partially shown here:@Configuration\n@EnableIntegration\npublic class IntegrationConfig {\n\n ...\n\n @Autowired\n private CachingConnectionFactory cachingConnectionFactory;\n\n @Bean\n public IntegrationFlow requestFlow() {\n \n return IntegrationFlows\n .from(\"request.ch\")\n .handle(Jms.outboundAdapter(cachingConnectionFactory)\n .destination(\"REQUEST_QUEUE\")).get();\n }\n\n @Bean\n public IntegrationFlow responseFlow() {\n\n return IntegrationFlows\n .from(Jms.inboundAdapter(cachingConnectionFactory).destination(\n \"RESPONSE_QUEUE\"),\n c -> c.poller(Pollers.fixedRate(1000).maxMessagesPerPoll(10)))\n .channel(\"response.ch\")\n .get();\n }\n\n ...\n}How can I ensure that connections to the MQ manager's queues are properly closed upon the application stopping/closing down?Thanks in advance,\nPM### Assistant: Reposting my comment as an answer...You're using an incredibly old version of the MQ Java client, 6.0.2.3 - which isn't even supported by IBM anymore. Have you considered using something newer like the 7.5.0.5 client? Much more up to date, with many fixes and enhancements in. Also worth noting that Java 8 isn't supported by any version of MQ Java client either, newest which is supported is Java 7.IBM supply their 7.5 clients free of charge here:http://www-01.ibm.com/support/docview.wss?uid=swg24032744The design of MQ is such that all versions of client can work with all versions of queue manager. So it certainly isn't a problem to use a 7.5 client with a 6.0 queue manager, or any other combination.I'm sure IBM will announce support for Java 8 with IBM MQ at some point, but there's nothing public I'm aware of with any dates. You can request support (and functional enhancements) here:https://www.ibm.com/developerworks/rfe/Might be worth submitting an RFE for Java 8 on IBM MQ in your case. (Note: it's still called WebSphere MQ on the RFE pages)\n"} +{"text": "### Human: I want to read the first MQ message off a queue (without removing it) and save this message into my database. Then if everything is done I need to permanently remove this message off the MQ queue. What I do know, is to just delete the first message in the queue. But how do I know if the same message that I saved into the database is the same one I will delete from the MQ?Thanks,\nMichaelEdit:Now tried to handle the actions with a TransactionScope in C#(Console Application):using (TransactionScope scope = new TransactionScope){\n //MQ Connection ( read message of queue)\n Hashtable properties = new Hashtable();\n properties.Add(MQC.HOST_NAME_PROPERTY, _settings.MQServer);\n properties.Add(MQC.PORT_PROPERTY, _settings.MQPort);\n properties.Add(MQC.CHANNEL_PROPERTY, _settings.MQChannelName);\n properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_XACLIENT);\n MQQueueManager _MQHandler = new MQQueueManager(_settings.MQManager, properties);\n\n MQQueue = _MQHandler.AccessQueue(ReceiveQueueName,\n MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_FAIL_IF_QUIESCING);\n MQQueueMessage = new MQMessage();\n MQQueueMessage.Format = MQC.MQFMT_STRING;\n MQQueueGetMessageOptions = new MQGetMessageOptions();\n MQQueueGetMessageOptions.Options += MQC.MQGMO_SYNCPOINT; //new\n MQQueue.Get(MQQueueMessage, MQQueueGetMessageOptions);\n\n //DB Connection (save message in database)\n\n if ( DBsuccess ) {\n _MQHandler.Commit();\n scope.Complete(); \n }else{\n _MQHandler.Backout();\n } \n\n}This seems to do what I want :) But some question:\n- If I make a syncpoint at a Put/Get, then call the Backout(), will the MQ only rollback to this syncpoint?\n- Is the MQ blocked for other MQ managers, if a message is a unit of work?### Assistant: So to clarify some terminology, the message is on the queue, not the channel - the channel just gives you access into a queue manager. So in effect you want to 'get' the first message (inside a unit of work with GMO_SYNCPOINT), store it into a database, and if the storing works, remove the message from a queue (via a commit). To do this, you would get the message from the queue in a unit of work, and only 'commit' the get (ie make it happen) and the database update at the same time. Generally speaking, you would use transaction coordination, to ensure the database update and the get either both happen (commit) or neither happen (rollback). Hopefully you can use the o/s DTC (distributed transaction coordinator) to make both MQ and the database participate in the same transaction - you also need to look at whether you want managed or unmanaged connections as they are different implementations - See the info centerhttp://www-01.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.dev.doc/q029290_.htm\n"} +{"text": "### Human: MQ version 7.5.0.4Is there a way of getting a notification when the connection is lost. What I can se I only get an error when the timeout has been reached. (JMSWMQ1107: A problem with this connection has occurred.)mqcf.setConnectionNameList(host); // \"host1(1414),host2(1414)\";\n mqcf.setClientReconnectOptions(WMQConstants.WMQ_CLIENT_RECONNECT);\n mqcf.setClientReconnectTimeout(100); // seconds\n\n ExceptionListener exceptionListener = new ExceptionListener(){\n @Override\n public void onException(JMSException e) {\n System.out.println(e.getErrorCode() + \" \" + e.getMessage());\n }\n };\n\n\n // need to reconnect on exception..! \n connection.setExceptionListener(exceptionListener);### Assistant: Using the Exception Listener for events (even reconnection) is outside of the scope of the JMS Specification. The strict definition is that that should be fired only for when a connection is broken - and the correct course of action is to recreate the connection. (note that various vendors MQ included do provide extensions - so it's always worth raising the requirement!)In the JavaSE environment you have here, it's possible to set the autoreconnect. In managed environments that's not supported so you do actually have to listen for the connection broken and then the applicaiton needs to redrive createConnection(). The connectionNameList is then 'walked' to find a QM that is running.\n"} +{"text": "### Human: I'm trying to connect to theMQusing the information present in theCCDTfile. I can currently connect to theMQusing all the details, and get and put messages from and to the queue.After extensive googling, I've been unable to find any sample code which allows me to connect using theCCDTfile.One of my colleagues forwarded me hisJMSconnection code, but I've been unable to port it toC#.TheJAVAcode is as follows -public class MQTest {\npublic static void main(String[] args) {\n\n MQQueueManager queueManager = null;\n URL ccdtFileUrl = null;\n MQMessage mqMessage = null;\n //MQPutMessageOptions myPMO = null\n try {\n String QM = \"IB9QMGR\";\n String QUEUE1 = \"TEST\";\n\n System.out.println(\"Starting MQClient Put Program: \");\n ccdtFileUrl = new URL(\"file:///D:/AMQCLCHL.TAB\") ;\n ccdtFileUrl.openConnection();\n queueManager = new MQQueueManager(\"SDCQMGR.T1\", ccdtFileUrl);\n\n System.out.println(\"Connected to QMGR \");\n int openOptions = MQC.MQOO_OUTPUT;\n MQQueue InQueue = queueManager.accessQueue(QUEUE1,openOptions,null,null,null);\n MQMessage inMessage = new MQMessage();\n inMessage.writeString(\"###Testing####\");\n InQueue.put(inMessage);\n System.out.println(\"Message Id is :\" + inMessage.messageId);\n System.out.println(inMessage.toString());\n InQueue.close();\n queueManager.disconnect() ;\n }\n catch(MQException ex){\n System.out.println(\"MQ Error - Reason code :\" + ex.reasonCode);\n }\n catch (Exception e){\n System.out.println(\"Error : \" + e);\n }\n}\n}Instead ofURL, I used theURI(in C#) to set file location. (This may be wrongly used. Not sure what else to use though.)Uri ccdtFileUrl = new Uri(\"file:///D:/AMQCLCHL.TAB\") ;but I can't useopenConnection()on a URI. Also,queueManager = new MQQueueManager(\"SDCQMGR.T1\",ccdtFileUrl);gives an argument overload exception. As URI is not supported in C#.I've tried looking up samples but I've found some JMS samples and thats it. Looking for some sample code to connect in C#.### Assistant: You will need to setMQCHLLIBandMQCHLTABenvironment variables to use CCDT. You can set these two variables either from command prompt,app.config or code in the application itself.Following example demonstrates usage ofCCDT:MQQueueManager qm = null;\n System.Environment.SetEnvironmentVariable(\"MQCHLLIB\", \"C:\\\\ProgramData\\\\IBM\\\\MQ\\\\qmgrs\\\\QM1\\\\@ipcc\");\n System.Environment.SetEnvironmentVariable(\"MQCHLTAB\", \"AMQCLCHL.TAB\");\n\n try\n {\n **Hashtable props = new Hashtable();\n props.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);\n qm = new MQQueueManager(\"QM1\",props);**\n MQQueue queue1 = qm.AccessQueue(\"SYSTEM.DEFAULT.LOCAL.QUEUE\", MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING);\n MQMessage msg = new MQMessage();\n msg.WriteUTF(\"Hello this message is from .net client\");\n queue1.Put(msg);\n queue1.Close();\n qm.Disconnect();\n }\n catch (Exception ex)\n {\n Console.Write(ex);\n }\n"} +{"text": "### Human: I want high level steps to connect to remote JMS Provider.I have some client application which wants to lookup in JNDI on FileSystem based to get the connection factory for JMS provider.I understand that in JMS Administeration (MQ Explorer), we can create the Connection factories. This is creating .bindings file.How can I use this .bindings file into my client application system?Should the Client Application system contain the JMS Administerator to create the .bindings in the same system or .bindings alone should be imported to the client system?If Filesystem is used,then a path specifying the .binding is given as Provider url. This provider url (EG: F:/JMS) seems to be the path present in JMS Provider system.If .bindings file imported in client system, then how the client can recognise the path of .bindings file?And What is the purpose of having ServerConnection channel in the Connection Factories definition when MQClient mode is used?When the JMS client connects through JNDI bindings, why Server Connection channel is required?### Assistant: Q1)How can I use this .bindings file into my client application system?The .bindings file must be placed on file server that can be accessed by your client system. For example place the .bindings file on file server MyFileSvr's D:\\JNDI-Directory folder. Then in your client machine D:\\ folder must be mounted as a drive, say as F drive. Then in your application you can reference the .bindings file as// Instantiate the initial context\n String contextFactory = \"com.sun.jndi.fscontext.RefFSContextFactory\";\n Hashtable environment = new Hashtable();\n environment.put(Context.INITIAL_CONTEXT_FACTORY, contextFactory);\n environment.put(Context.PROVIDER_URL, \"file:/F:/JNDI-Directory\");\n Context context = new InitialDirContext(environment);\n System.out.println(\"Initial context found!\");\n\n // Lookup the connection factory\n JmsConnectionFactory cf = (JmsConnectionFactory) context.lookup(connectionFactoryFromJndi);Q2)Should the Client Application system contain the JMS Administerator to create the .bindings in the same system?or .bindings alone should be imported to the client system?See the answer for Q1 above. It's good practice to keep the bindings file on a shared drive so that multiple client application can access.Q3)If Filesystem is used,then a path specifying the .binding is given as Provider url.This provider url (EG: F:/JMS) seems to be the path present in JMS Provider system.If .bindings file imported in client system,then how the client can recognise the path of .bindings file?Again see answer for Q1.Q4)And What is the purpose of having ServerConnection channel in the Connection Factories definition when MQClient mode is used? When the JMS client connects through JNDI bindings ,why Server Connection channel is required?A server connection channel defines the required properties for MQ client applications (JMS or otherwise) connect to a IBM MQ queue manager. A connection factory object in JNDI bindings will have, among others,the following defined for an application to connect to a IBM MQ queue manager1) Host name where queue manager is running2) Port where queue manager is listening3) Server Connection channel name.4) Queue manager name.Bottom line JNDI bindings and Server connection channel are not same.Please read through online documentation of IBM MQ as well as MQ Redbooks.\n"} +{"text": "### Human: Exception in thread \"main\" java.lang.UnsatisfiedLinkError: no mqjbnd05 in java.library.pathwhile creating a MQQueueManager.I have no idea why this is happening.. Can u please help me.### Assistant: The error means the MQ client has attempted to load the mqjbnd library but can not find it on the java.library path provided. The MQ client tried to load that library as the application has specified a transport type of 'bindings' which means that the MQ client application will exist on the same physically machine as the MQ server, and so a bindings connection (not TCP/IP) will be made.So resolve the issue you need to find out if your java application should exist on the same physically machine as the MQ Server (QueueManager) that you want to connect to. If it should be then the mqjbnd library (.dll or .so) should be located in the java/lib directory. Add this to the java.library (PATH on windows or LD_LIBRARY_PATH on unix).If your application is to be remote to the MQ Server then you must change your java code to use a transport type of 'client'. There is no need to reference any libraries when connecting remotely.\n"} +{"text": "### Human: I am getting the below error.Kindly help[8/8/14 21:14:56:939 GMT-08:00] 00000005 TimeoutManage I WTRN0006W: Transaction 00000147B92EFAE20000000100000012DF462C9E681BA3670A44A25FE1B0F6182303FB5C00000147B92EFAE20000000100000012DF462C9E681BA3670A44A25FE1B0F6182303FB5C00000001 has timed out after 120 seconds.[8/8/14 21:14:56:967 GMT-08:00] 00000006 TimeoutManage I WTRN0124I: When the timeout occurred the thread with which the transaction is, or was most recently, associated was Thread[WMQJCAResourceAdapter : 4,5,main]. The stack trace of this thread when the timeout occurred was:java.net.SocketOutputStream.socketWrite0(Native Method)\njava.net.SocketOutputStream.socketWrite(SocketOutputStream.java:103)\njava.net.SocketOutputStream.write(SocketOutputStream.java:147)\ncom.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.send(RemoteTCPConnection.java:1212)\ncom.ibm.mq.jmqi.remote.internal.system.RemoteConnection.sendTSH(RemoteConnection.java:2289)\ncom.ibm.mq.jmqi.remote.internal.RemoteHconn.sendTSH(RemoteHconn.java:954)\ncom.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiPut(RemoteFAP.java:5443)\ncom.ibm.mq.jmqi.remote.internal.RemoteFAP.MQPUT(RemoteFAP.java:5205)\ncom.ibm.msg.client.wmq.v6.base.internal.MQSESSION.MQPUT(MQSESSION.java:1252)\ncom.ibm.msg.client.wmq.v6.base.internal.MQQueue.putMsg2(MQQueue.java:2090)\ncom.ibm.msg.client.wmq.v6.jms.internal.MQMessageProducer.sendInternal(MQMessageProducer.java:1262)\ncom.ibm.msg.client.wmq.v6.jms.internal.MQMessageProducer.send(MQMessageProducer.java:768)\ncom.ibm.msg.client.wmq.v6.jms.internal.MQMessageProducer.send(MQMessageProducer.java:2713)\ncom.ibm.msg.client.jms.internal.JmsMessageProducerImpl.sendMessage(JmsMessageProducerImpl.java:872)\ncom.ibm.msg.client.jms.internal.JmsMessageProducerImpl.send_(JmsMessageProducerImpl.java:727)\ncom.ibm.msg.client.jms.internal.JmsMessageProducerImpl.send(JmsMessageProducerImpl.java:398)\ncom.ibm.mq.jms.MQMessageProducer.send(MQMessageProducer.java:281)\ncom.ibm.ejs.jms.JMSQueueSenderHandle.send(JMSQueueSenderHandle.java:204)\ncom.scb.sts.stsappserver.sender.MessageSender.sendRecords(Unknown Source)\ncom.scb.sts.services.PCSPPaymentSplitter.doExecute(Unknown Source)\ncom.scb.sts.stsappserver.eventhandler.SplitterEventHandler.handleEvent(Unknown Source)\ncom.scb.sts.services.PCSPPaymentReceiver.doProcess(Unknown Source)\ncom.scb.sts.services.PCSPPaymentReceiver.doExecute(Unknown Source)\ncom.scb.sts.controllers.OCWSServlet.doPost(Unknown Source)\ncom.scb.sts.qlcomm.QLCommBean.processXMLFile(Unknown Source)\ncom.scb.sts.qlcomm.QLCommBean.isDoOutput(Unknown Source)\ncom.scb.sts.qlcomm.QLCommBean.onMessage(Unknown Source)\ncom.ibm.ejs.container.MessageEndpointHandler.invokeMdbMethod(MessageEndpointHandler.java:1093)\ncom.ibm.ejs.container.MessageEndpointHandler.invoke(MessageEndpointHandler.java:778)\n$Proxy32.onMessage(Unknown Source)\ncom.ibm.mq.connector.inbound.MessageEndpointWrapper.onMessage(MessageEndpointWrapper.java:131)\ncom.ibm.mq.jms.MQSession$FacadeMessageListener.onMessage(MQSession.java:147)\ncom.ibm.msg.client.jms.internal.JmsSessionImpl.run(JmsSessionImpl.java:2557)\ncom.ibm.mq.jms.MQSession.run(MQSession.java:860)\ncom.ibm.mq.connector.inbound.WorkImpl.run(WorkImpl.java:172)\ncom.ibm.ejs.j2c.work.WorkProxy.run(WorkProxy.java:399)\ncom.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1604)### Assistant: The transaction timeout simply means that the transaction not was committed before the timeout expired, in this case 120s elapsed without a commit.The stack shows that you're in the onMessage() function of an MDB named QLCommBean. And that this MDB was sending some messages via MessageSender.sendRecords(), which in turn was called the MQ JMS API:JMSQueueSenderHandle.send()The top of the stack is:java.net.SocketOutputStream.socketWrite0(Native Method)This means that the active code within the MDB at the time of the transaction timeout, was a socket write (sending data over the network). In this case MQ was sending a message to the queue manager.The transaction timeout itself is not a bug. You need to review the MDB logic and determine if 120s is an appropriate amount of time to be in the MDB. If it isn't, I suggest you add logging to your MDB to find out what it was doing for 120s. Itmaybe that the MQ code has used up a lot of this time, but it may not be. The stack shown is just where the code happened to be 120s after onMessage() was invoked.As MQ in the process of sending data over the network to the queue manager, you may want to look at your network to see if its performing adequately, or possibly your queue manager. It might be heavily loaded.If this occurs regularly, one good option is to take a number of javacores over the course of the 120s. You can then see what the stack was at various points.Otherwise I suggest:1) Instrument your MDB, make sure you know which code was executed, and at what time. Only this will rule out your MDB logic.2) Consider your network3) Possibly trace your queue manager & the MQ JMS code - you may need IBM's help to determine if the time taken by the IBM code is appropriate4) If 120s is an acceptable length of time for onMessage(), consider increasing the transaction timeout value to a value greater than the maximum time you consider to be acceptable for onMessage().\n"} +{"text": "### Human: I am receiving bytes[] from mainframe MQ. This bytes[] I am trying to convert to EBCDIC string. I am using the following and the sytem just hangs. What could be the issue?new String(mqmdAccountingToken,\"Cp1047\");mqmdAccountingToken is the byte array received from MQ. I feel that the Charset that I have provided is not correct. Is there a way to identify the correct charset to use and then convert?### Assistant: The MQMD AccountingToken field is made up of both binary values and character values set by the queue manager (default behavior), so you need to treat it as a binary field (i.e. byte[] field) and not a character field.If you really want to convert it to some character field then convert it to Hex display characters.\n"} +{"text": "### Human: I am not sure how to add message header to the message which we send to IBM MQ websphere server. Below is code I tried to use but I get exception :Creating Connection to the serverqMgr = new MQQueueManager(queueMgr, props);\n\n int openOptions = MQC.MQOO_INPUT_AS_Q_DEF\n | MQC.MQOO_OUTPUT | MQC.MQOO_INQUIRE;\n queue = qMgr.accessQueue(queueName, openOptions);\n message = new MQMessage();Sending the Messagepublic String sendMessage(){\n\n MQPutMessageOptions pmo = new MQPutMessageOptions();\n\n\n message.format = MQC.MQFMT_STRING;\n message.feedback = MQC.MQFB_NONE;\n message.messageType = MQC.MQMT_DATAGRAM;\n\n message.messageId = MQC.MQMI_NONE;\n message.correlationId = MQC.MQCI_NONE;\n\n message.writeString(sMsg);\n queue.put(message,pmo);\n}I tried with the below code to add Header((TextMessage)message).setStringProperty(header_name,header_value);But i get the exceptionjava.lang.ClassCastException: com.ibm.mq.MQMessage cannot be cast to javax.jms.TextMessage.And I am Stuck here. If this is solved then the riddle is completed.### Assistant: Why are you mixing Java SE MQ API calls with JMS calls?From the manual, in the section 'Handling message properties' for WebSphere MQ classes for Java:Function calls to process message handles have no equivalent in\n WebSphere MQ classes for Java. To set, return, or delete message\n handle properties, use methods of the MQMessage class.Therefore, why aren't you simply doing:MQPutMessageOptions pmo = new MQPutMessageOptions();\npmo.options = MQC.MQPMO_FAIL_IF_QUIESCING | MQC.MQPMO_NO_SYNCPOINT;\n\nmessage.format = MQC.MQFMT_STRING;\nmessage.feedback = MQC.MQFB_NONE;\nmessage.messageType = MQC.MQMT_DATAGRAM;\nmessage.messageId = MQC.MQMI_NONE;\nmessage.correlationId = MQC.MQCI_NONE;\n\nmessage.setStringProperty(header_name,header_value)\n\nmessage.writeString(sMsg);\nqueue.put(message,pmo);One final note, please do not reply saying you can't do that, as you are using WMQ v6. WMQ v6 went out of support almost 2 years ago, so you must upgrade to WMQ v7.* (preferably to WMQ v7.5).\n"} +{"text": "### Human: I am currently testing performance of two different messaging systems and there are many independent tuning and load parameters that influence the message rate. I would like to develop an automated method that would produce the maximum message per second rate on a given hardware.CONSTANTS:# of CPUs, memory, network and other hardware parameters are a constant (or at least there is a known maximum).Version of OS and the messaging products is a constant (WebSphere MQ 7.5 for instance)Message size3 minutes to complete one test measurementDESIRED RESULT:Maximum rate of messages per secondVARIABLES:OS tuning options (kernel, TCP and other network and memory stuff)Messaging software tuning settings - of which there are several dozens (buffer sizes of all sorts, number of threads, number of Queue Managers, number of queues, different kinds of bindings for clients, security settings, log types, number and sizes of log and data files, etc.....)Number of message producers and consumers (say a range from 1 to 10,000)Currently performance tuning is done as an iterative process - change one variable at a time, measure msg/sec, rinse and repeat.I have developed a script framework that can iterate over different settings, but if I do this as a nested loop that is 50 levels deep and iterate over every possible value for each variable this process will take hundreds of years to complete. Including a random factor might help, but what I would like to do is to use neural network to find optimum settings for my tuning variables.I found some research papers that talk about this kind of thing, but could not find any real implementations. Has anybody done it? Any recommendations on how to proceed? I have not worked with neural networks, but have done mathematical programming (optimization) in university and normal optimization methods will take too long to solve this problem.### Assistant: This kind of problem doesn't sound very suitable for neural networks. Neural networks are probably most often used as classifiers with supervised learning. Typically, you have to have a training set with examples that are already classified. There are some unsupervised approaches too, most recently most notably perhaps thedeep neural networks. But that is an active area of research and I doubt there are ready made tools for what you need.You have a problem with combinatorial explosion in the parameter space. That kind of problem is often well suited for solving with evolutionary algorithms. For examplegenetic algorithmsorsimulated annealing.With genetic algorithms the problem solving shifts to findinga good problem representation that allows you to do crossover and mutations,a suitable fitness function.This often proves to be very difficult.Your problem, however, seems to be very suitable for this method:individual solution representation: a list of parametersi = [p_1, p_2, ..., p_n]crossover ofi_1andi_2: choose a splitting point between1andnand exchange the respective parts of the individuals' listsmutation: choose a parameter and adjust itfitness function: rate of messages per secondIt's not guaranteed that you would get an optimal solution this way but it can help you to combat the combinatorial explosion quite effectively.\n"} +{"text": "### Human: We are working on establishing an architecture where we will have two processing applications needing to receive information from a single queue (They will use the data in entirely different ways). What is considered best practice / path-forward for IBM WebSphere MQ in this situation?Pub / Sub - One publisher and \"n\" number of subscribers?The folks administering our MQ have suggested a fan out (trigger that reads from a named list and distributes to multiple queues) - This doesn't seem like a good idea to us.Others?Any suggestions or input would be greatly appreciated.### Assistant: Decision to use Pub/Sub doesn't come from the fact that queues doesn't help ...If your scenario is a request-response type of scenario the Queuing would be a best fit in most cases.If your scenario will have many consumers dynamically getting added (or removed) then Pub-Sub helps.I think what you are doing is routing messages to well known consumers. If there lot more of routing and transformation cases need to be dealt in future you can use IBM Integration Bus. If the routing is as simple as this, the sender can send a message to a queue and then a program can read messages from that in a transaction context and send those to 2 different queues. A message listener of JMS can help in aync processing.Have a look at this patternhttp://www.eaipatterns.com/MessageRouter.html. I guess it matches to what you are doing.\n"} +{"text": "### Human: I'm trying to configure my NServiceBus project to use WebSphere mq. \nI've been searching all other the web and didn't find any up to date examples.\naccording tothis postthere is a dll that exposes API for WMQ configuration.\nHowever, their example works with really old NServiceBus version and is not compatible for the current (4.3.1) version. \nThe only manual that has some real examples isthis oneand is for PubSuB and not for simple client server configuration.\nCan anyone please direct me to a up to date example that describes how should I configure my NSB project to use WMQ.Thanks!### Assistant: i have migrated NServiceBus.WebSphereMQ to the version 5 of NServiceBus.\nHaving used the solution for a P.O.C. the implementation is not very elegant and, therefore, I have not had the courage to publish it on Git Hub :-D.In the P.O.C. i have created two endpoints using the NServiceBus.WebSphereMQ transport.The configuration is quite simple.Inside each Endpoint's config file (app.config) i have specified the following settings:\n ...\n
\n
\n ...\n \n \n \n ...\n \n \n It's important to pay attention to the connection string. QueueManager name and Channel name are very important informations and will be specified later.\nUsing ServiceMatrix for VisualStudio 2013, i have automatically generated the EndpointConfig file, specifying the transport's logic inside:public partial class EndpointConfig : IConfigureThisEndpoint, AsA_Server\n {\n public void Customize(BusConfiguration configuration)\n {\n configuration.UseSerialization();\n\n configuration.UsePersistence();\n\n configuration.UseTransport();\n }\n }That's all code side.To test the communication using MQ, i downloaded WebSphere MQ Advanced from the IBM website ( it's free ):http://www-01.ibm.com/support/docview.wss?uid=swg24032734If you install the version 7.5, remember to install the recommended hotfixes!First of all you have to configure a QueueManager. To do this i used WebSphere MQ Explorer tool as shown below:Then, you must create a Server-Connection channel:To use the channel you must provide grant authorizationAt this point each Endpoint is able to create all queues automatically the first time running.\nIt works great!I hope I was helpful\n"} +{"text": "### Human: I want to send and receive a file to WebSphere mq by java, i don't know how to set about it, could there any one help me?, a java sample is desirable \nthanks### Assistant: Whenever you ask a question, you should first tell about approaches you have tried for your problem. Right now you sound like you are asking someone to write code for you which is not the motive of SO.\nKeep this in mind for your next question.Now, we come to your question. What you are trying to achieve is actually very simple.You have to:Read the file from your Java program into a string(Hope you want to transfer Text file only).Create an MQMessage.Write the string into the MQMessage.Post the MQMessage in the queue.Sending SideCode for reading file into a string variable:static String readFile(String path, Charset encoding) \n throws IOException \n{\n byte[] encoded = Files.readAllBytes(Paths.get(path));\n return encoding.decode(ByteBuffer.wrap(encoded)).toString();\n}Reference:hereCode for creating MQMessage from this string and posting into the queue:MQQueueManager qMgr = new MQQueueManager(YourQueueManagerName);\n // Set up the options on the queue we wish to open...\n int openOptions = MQC.MQOO_INPUT_AS_Q_DEF |\n MQC.MQOO_OUTPUT ;\n\n // Now specifythe queue that we wish to open, and the open options...\n MQQueue inputQ =\n qMgr.accessQueue(Inputqueue,openOptions);\n Charset charset = Charset.forName(\"UTF-8\");\n String messg=(readFile(\"C:\\test.txt\", charset));\n\n MQMessage InputMsg1 = new MQMessage();\n InputMsg1.writeString(messg);\n\n MQPutMessageOptions pmo = new MQPutMessageOptions();\n inputQ.put(InputMsg1,pmo);\n\n inputQ.close();\n qMgr.disconnect();Receiving SideCode for reading message from the queue:MQQueueManager qMgr2 = new MQQueueManager(OutQM);\n // Set up the options on the queue we wish to open...\n\n int openOptions2 = MQC.MQOO_INPUT_AS_Q_DEF |\n MQC.MQOO_OUTPUT ;\n // Now specifythe queue that we wish to open, and the open options...\n MQQueue Output =\n qMgr2.accessQueue(OutQ,openOptions2);\n\n MQMessage retrievedMessage = new MQMessage();\n\n MQGetMessageOptions gmo = new MQGetMessageOptions(); // accept the defaults\n // // same as\n // // MQGMO_DEFAULT\n // // get the message off the queue..\n Output.get(retrievedMessage, gmo);\n String msgText = retrievedMessage.readString(retrievedMessage.getDataLength());After receiving the message in a string variable you can use the data the way you want or you can save it in a file.\n"} +{"text": "### Human: I need to clear a group of messages from a MQ Queue, but I need to do this without retriving the message or clearing the whole queue?### Assistant: No, you can't remove/clear a message from a queue without retrieving it. A QueueBrowser is used to browse messages from a queue. It does not remove/clear messages from a queue.\n"} +{"text": "### Human: After checking out mq series docs and white paper I have got the architecture for MQ messages ie Message descriptor (Message header)\nApplication data (Message body) and itsdetails hereBut I want to know what is the format (xml,binary,text...) in which quemanager of MQ series stores the messages.### Assistant: The format of the payload is decided by the application, not MQ. You can send messages in whatever format you want. As mentioned in the developersWorks article, MQ has some predefined formats such MQFMT_STRING which means the format of the payload is text. This format is typically used for XML, text message body.Theseare the predefined list of message formats.\n"} +{"text": "### Human: I am new to IBM MQ,my queue manager uses tcp channel connection and the tcp connections go up extensively, this is the piece of code am using. How to handle connections within the channel in a reusable manner?I am using 7.5 MQ client, talking to 6.0.5.2 MQ remote server. I close the connection properly, however when i run a netstat it says tcp connections in time_wait state. Are these connection/socket leaks?MQQueue mqQueue = null; \nMQQueueManager mqQMgr=null; \ntry\n{\n //Create connection to queue manager\n mqQMgr = new MQQueueManager(\"Queue Manager name\", properties);\n //Access the queue\n mqQueue = mqQMgr.AccessQueue(QueueName, MQC.MQOO_FAIL_IF_QUIESCING | MQC.MQOO_INPUT_SHARED | MQC.MQOO_BROWSE);\n for(int i=1;i<2000;i++)\n {\n //read the messages\n mqMsg=new MQMessage();\n mqQueue.Get(mqMsg);\n }\n}\ncatch(MQException mqe)\n{ \n //If no messages in the queue , break. (if not, catch any error)\n}\nfinally\n{\n mqQueue.Close(); //Close the MQ Queue\n mqQMgr.Disconnect(); //Disconnect the MQ Manager\n}When i run a netstat, it showsTCP x.x.x.x:59092 x.x.x.x:1400 TIME_WAIT \nTCP x.x.x.x:59093 x.x.x.x:1400 TIME_WAIT\nTCP x.x.x.x:59094 x.x.x.x:1400 TIME_WAIT\nTCP x.x.x.x:59095 x.x.x.x:1400 TIME_WAIT\nTCP x.x.x.x:59096 x.x.x.x:1400 TIME_WAIT\nTCP x.x.x.x:59097 x.x.x.x:1400 TIME_WAIT\nTCP x.x.x.x:59098 x.x.x.x:1400 TIME_WAIT\nTCP x.x.x.x:59099 x.x.x.x:1400 TIME_WAIT### Assistant: It's not a leak. A socket enters into TIME_WAIT state after it has been closed. It is normal for a socket to be in TIME_WAIT for a longer time, something like 4 minutes and depends on the operating system.\n"} +{"text": "### Human: My system reads data fromWebsphere MQwhich comes fromMainframequeues, the data which application reads is in EBCDIC format -It was working fine earlier, we moved to jdk1.6 earlier this year (Not sure if this cause this issue).Am getting one variable value as 40 which EBCDIC representation of \" \", but that's not getting covert.So the question is MQ or Mainframe should responsible for this conversion? Cause we are doing below conversion but that's not working -UnicodeFormat = \"CP037\";\n byte[] b;\n b = UninterpretedRowdata.getBytes(\"Cp037\");\n //System.out.println(\"DEST CP : \"+UnicodeFormat);\n UnicodedRow = new String(b, UnicodeFormat);Thanks in advance.### Assistant: I have no idea why in the world you would want to do the conversion yourself. Weird. It is far, far better for MQ to do the conversion for you. i.e. RTMhttp://publib.boulder.ibm.com/infocenter/wmqv7/v7r1/topic/com.ibm.mq.doc/zd00050_.htmFor MQ to do the conversion requires 2 things:1) The message needs the MD.Format field to be set to MQC.MQFMT_STRING2) You issue a MQGet API call with converti.e.MQGetMessageOptions gmo = new MQGetMessageOptions();\ngmo.options = MQC.MQGMO_FAIL_IF_QUIESCING + MQC.MQGMO_CONVERT;\nMQMessage receiveMsg = new MQMessage();\ninQ.get(receiveMsg, gmo);\n"} +{"text": "### Human: I have two MQ queue manager with same queue names configured. Both are configured to send data to different servers. Currently queue manager(QM1) is stopped(status Ended Immediately) and QM2 is runningNow my program opens the queue and sends data. It doesnot specify queue manager name. When I execute the program, MQ connection request returnserror 2059.My questions are:What happens when multiple queue managers have same queue name?How to tackle situation without changing the code?Please forgive if the description is vague. It would be helpful if anyone provide links so that newbie like me can learn something.Thanks### Assistant: It would be helpful if could provide details on your application. Whether it's using server bindings or client mode connection to queue manager. What version of MQ are you using?The below information is valid for MQ v7.x:If you are using client mode then you can use multiple CONNNAMEs to connect. If one queue manager is down, your application will connect to next queue manager in CONNAME list. One of the simplest way to do when using client mode connection is to define MQSERVER environment variable and specify multiple CONNNAMEs.SET MQSERVER=/TCP/host1(port1), host2(port2)For example when both queue managers are on local host:SET MQSERVER=MYSVRCONCHN/TCP/localhost(1414),localhost(1415)In server bindings mode if queue manager name is not specified, then application will attempt to connect to the default queue manager. If the default queue manager is down, then 2059 is thrown.\n"} +{"text": "### Human: I would truly appreciate some help with developing a simple pub/sub flow using message broker 7.0 and MQ 7.0My flow is supposed to accept a certain message with no header, filter it based on \nthe field (process, if the value is \"yes\")\nAnd then publish the body to all the queues, listed in nodes of the message\n
\n \n Topic1 \n Topic2 \n \n\n \n \n yes\n \n \n
\n\n \n \n The publication \n \n \n
This is my flow:I registered a Topic and a Subscription in MQ, but I'm pretty much lost what am I supposed to do next.\nI used RFHUtil for testing point-to-point application,\nbut have no idea, how to make use of the it while developing publish-subscribe.questions: \n1. Is it correct to use just a simple queue as a publisher ( in MQ input i just set \"IN\", the queue, i have in MQ)\n2. How do I register subscriber/multiple subscribers in this flow? What is the subscription point?It's just a learning task.Any help is welcome!### Assistant: For a normal pub-sub flow you can have something like below:Set, the queue name of MQInput node to your input queue. Let's name it as \"inputQ\".Now the message has been read by MQInput node from the \"inputQ\" and it has been passed on to the compute node.In the compute node you need to set the message type to publish and also set the topic name, before you pass it to the Publication node.You can use below code for the same:SET OutputRoot.MQRFH2.psc.Command = 'Publish';\nSET OutputRoot.MQRFH2.psc.Topic = 'YourTopicString';\"How do I register subscriber/multiple subscribers in this flow? \"I am assuming your problem is \"How to publish message with different topics from same flow\".Now suppose you have multiple topics to be published from the same flow. You can't do it all at once. One message can have one topic.But, you can achieve it as below (Suppose you have 3 topics):SET OutputRoot.MQRFH2.psc.Command = 'Publish';\nSET OutputRoot.MQRFH2.psc.Topic = 'Topic1';\nPROPAGATE TO TERMINAL 'out' DELETE NONE;\nSET OutputRoot.MQRFH2.psc.Topic = 'Topic2';\nPROPAGATE TO TERMINAL 'out' DELETE NONE;\nSET OutputRoot.MQRFH2.psc.Topic = 'Topic3';\nPROPAGATE TO TERMINAL 'out' DELETE NONE;\nRETURN FALSE;However, if your requirement is publishing single topic but multiple queues should pick it up, then its simpler.You just need to create subscriptions for all those queues for your topic.\n"} +{"text": "### Human: I am using MQQueueSession.rollback() to rollback the unit of work. The message is moved to BACKOUT queue, which is all right.The question though is how to handle these messages in backout queue? I read that I can use runmqdlq tool but it only works with messages prefixed with MQDLH. Simple MQQueueSession.rollback() doesn't seem to be doing that. What am I doing wrong?The code sample:MQQueueConnection connection;\n// ...\nMQQueueSession session = (MQQueueSession) connection.createQueueSession(true, Session.SESSION_TRANSACTED);\nMQQueue queue = (MQQueue) session.createQueue(\"queue:///TEST\");\nMQQueueReceiver receiver = (MQQueueReceiver) session.createReceiver(queue);\nJMSTextMessage message = null;\n\ntry {\n message = (JMSTextMessage) receiver.receive();\n // ...\n session.commit();\n} catch (JMSException e) {\n session.rollback();\n e.printStackTrace();\n}### Assistant: A message can be backed out by MQ JMS provider to a back out queue or a dead letter queue for few reasons. Some of them are1) Badly formatted messages2) Message not acknowledged by the client application either by doing aCommitin a transacted session orMessage.Acknowledge()in a client acknowledged session. In such case a message is redelivered. If the same is delivered again and again, MQ JMS provider moves that message to back out queue based on theBOTHRESHsetting on the queue.The above is called \"Poison Message\" handling.Many a times, a queue may not have a back out queue (BOQUEUE) defined. In such cases MQ JMS provider moves the poison message to a dead letter queue (DLQ) prefixing DLQ header. You can userunmqdlqto handle messages in aDLQ.Messages in backout queue do not have any header pre-fixed likeDLQ. You need to investigate why messages ending up there. Fix the reason(s) and move the message back to original queue so that the message can be delivered to application.\n"} +{"text": "### Human: Once one has a coordination queue manager in the \"Managed File Transfer\" folder of the IBM MQ Explorer (with the FTE add-on of course), how is it that one adds additional Coordination Queue managers? I don't see an \"Add Coordiation Qmgr\" option from the Managed File Transfer folder ... ?### Assistant: You have to create a coordination queue manager using fteSetupCoordination command from command line.fteSetupCoordination.cmd -coordinationQMgr QM_COORD2 -coordinationQMgrHost localhost -coordinationQMgrPort 3099 -coordinationQMgrChannel MQSVRCHNThis command will create a .mqsc file under config directory. That mqsc file must be run against the new coordination queue manager. For example:runmqsc QM_COORD2 < C:\\MQFTE\\IBM\\WMQFTE\\config\\QM_COORD2\\QM_COORD2.mqscStart MQ Explorer, you will seeQM_COORD2as another coordination queue manager underManaged File Transfernode.Note that there can be only one coordination queue manager active at any point.HenceQM_COORD2queue manager will be shown as inactive. You will need to disconnect the active coordination queue manager and then make theQM_COORD2active. To make it active, just right click on theQM_COORD2and click onConnectshort menu.\n"} +{"text": "### Human: I am starting the development of a simple WCF application that queries data from an Oracle 11g DB table and enqueues a message into Websphere MQ 5.3. I am not sure of the best way to design this application.Should I use an Oracle trigger to notify WCF when a change is made to the table or should I use WCF to continually poll the DB table for changes?Also, how can get I WCF to communicate with Websphere MQ 5.3? I've researched enough to see that the newer version of Websphere MQ 7.1 comes with a custom channel for WCF but I don't know how to get WCF to work with 5.3.I've been told that we don't use Microsoft Biztalk or Oracle Database Change Notification(ODBN).\nShould I recommend to my supervisor that we upgrade Websphere MQ to 7.1 and also use Biztalk or ODBN?I am new to using WCF, Oracle, and Websphere MQ and am unsure which direction to take.\nAny links or resources to help me figure this out would be appreciated.### Assistant: MQ 5.3 is out of support. So it is not recommended to use an out of support product. As you found WCF support is not available in MQ v5.3. WCF support is available from MQ v7.0.1. So you have to upgrade to at least MQ v7.0.1.MQ WCF provides a custom channel using which web services can be hosted on MQ and clients can call those web services using the custom channel.If your intention is to use MQ WCF for just putting messages into a queue and not develop any web service, then it would be better to look at either MQ .NET classes or XMS .NET classes. MQ .NET classes provide OO API for messaging with MQ queue/topic whereas XMS .NET provides a JMS like API.My 2 cents on other part: It is better to receive notifications from Oracle DB when a change happens than polling. There could be way in Oracle where you could register a callback or listener that gets called when change occurs to a table.\n"} +{"text": "### Human: I have a message queue and use it from java code viaMQQueueConnectionFactory.\nI have a userid/password and need to setApplIdentityDatafield, how to do it correctly (via properties, something else?)?\nThanks.### Assistant: After some investigation we solved this issue:queue.setBooleanProperty(WMQConstants.WMQ_MQMD_WRITE_ENABLED, true);\n queue.setBooleanProperty(WMQConstants.WMQ_MQMD_READ_ENABLED, true);\n queue.setIntProperty(WMQConstants.WMQ_MQMD_MESSAGE_CONTEXT, WMQConstants.WMQ_MDCTX_SET_ALL_CONTEXT);\n ...\n message.setStringProperty(JmsConstants.JMS_IBM_MQMD_APPLIDENTITYDATA, \"....\");\n"} +{"text": "### Human: I need help with implementing IBM WebSphere MQ for a system where the queue is supposed to send the XML messages to a SQL database. May please help me with resources and video tutorials for the matter in hand. The system will be in C#Thanks!### Assistant: Message Service Client for .NET a.k.a XMS .NET is now part of WebSphere MQ v701. You can find latest documentation on XMS .NEThere. XMS .NET gets installed along with MQ Client from v701 on-wards.\n"} +{"text": "### Human: Is there a way to block connections on an MQ SVRCONN channel based on the client version?I am running MQ v9.3 and in some of my SVRCONN channels, I don't wanna allow MQ v8 Clients to connect to it.Do anyway see a way to achieve that?Regards### Assistant: There's nothing in the MQ product itself. You'd have to use a channel security exit to do it. The MQCXP structure passed to the exit containsRemoteVersionthat tells you the version of the connecting client.\n"} +{"text": "### Human: We are trying to write a message to IBM MQ using JMS, we are able to write the message but notice that the field UserIdentifier in MQMD is getting over-written by the QManager.We've tried both these properties to set user id,message.setStringProperty(JmsConstants.JMS_IBM_MQMD_USERIDENTIFIER, \"ourUserID\");\nmessage.setStringProperty(\"JMSXUserID\", \"ourUserID\");We also have these properties before setting the User id,message.setBooleanProperty(WMQConstants.WMQ_MQMD_WRITE_ENABLED,true);\nmessage.setIntProperty(WMQConstants.WMQ_MQMD_MESSAGE_CONTEXT,WMQConstants.WMQ_MDCTX_SET_ALL_CONTEXT);also the Queue Manager and Queue have the required configuration,+setall +setid +passallbut still we are unable to get required result. What can we do different over here ?### Assistant: This is an extract from one of my programs:MQQueue d = (MQQueue)destination;\nString altusr=\"myuserid\";\nd.setMQMDWriteEnabled(true);\noutMsg.setBooleanProperty(MQConstants.WMQ_MQMD_WRITE_ENABLED, true);\noutMsg.setStringProperty(CommonConstants.JMS_IBM_MQMD_USERIDENTIFIER, altusr);\nd.setIntProperty(MQConstants.WMQ_MQMD_MESSAGE_CONTEXT, MQConstants.WMQ_MDCTX_SET_IDENTITY_CONTEXT);It's possible that this only works if you are using the JMSContext API model rather than the older createSession() approach as that can also affect when the underlying MQOPEN or MQPUT1 happens. Which in turn affects whether the context-setting flags are referred to.\n"} +{"text": "### Human: I've tried to follow thisguide, but problem occured: I have to use spring boot version 2.7.11 which does not contain com.ibm.mq.spring.boot.MQConnectionFactoryFactory class.\nI assume if the class was removed, there should be another solution to configure multiple ibm mq jms brokers?I need to create bean MQConnectionFactory which would use my MQConfigurationProperties.### Assistant: In addition to the tutorial that @Rich mentions take a look at pattern 114 : Custom connection beanshttps://github.com/ibm-messaging/mq-dev-patterns/tree/eecc42470a821c05e11e0f0fb10477ad01bf6806/Spring-JMS#level-114-sampleie.https://github.com/ibm-messaging/mq-dev-patterns/blob/eecc42470a821c05e11e0f0fb10477ad01bf6806/Spring-JMS/src/main/java/com/ibm/mq/samples/jms/spring/level114/MQConfiguration114.javawhich shows how to create a custom connection factory. Which in turn allows two or more custom factories enabling an application to create connections to multiple MQ host / port / channel combinations.If you have\n com.ibm.mq\n mq-jms-spring-boot-starter\n 3.0.6\n as a dependency (current version is 3.1.1), then you should have all the classes you need.import com.ibm.mq.spring.boot.MQConnectionFactoryFactory;\n\n\n @Bean\n public MQConnectionFactory mqConnectionFactory() throws JMSException {\n MQConfigurationProperties properties = new MQConfigurationProperties();\n // Properties will be a mix of defaults, and those found in application.properties\n // under ibm.mq\n // Here we can override any of the properties should we need to\n MQConnectionFactoryFactory mqcff = new MQConnectionFactoryFactory(properties,null);\n MQConnectionFactory mqcf = mqcff.createConnectionFactory(MQConnectionFactory.class);\n return mqcf;\n }\n"} +{"text": "### Human: I intend to use following code to send many messages into IBM MQpublic static void main(String[] args) {\n int openOptions = CMQC.MQOO_INQUIRE | CMQC.MQOO_OUTPUT;\n MQEnvironment.hostname = \"192.168.0.13\";\n MQEnvironment.port = 1414;\n MQEnvironment.channel = \"SYSTEM.DEF.SVRCONN\";\n MQEnvironment.properties.put(CMQC.TRANSPORT_PROPERTY, CMQC.TRANSPORT_MQSERIES);\n\n MQQueueManager qMgr;\n MQMessage tmpMsg = new MQMessage();\n try {\n qMgr = new MQQueueManager(\"QM1\");\n MQQueue destQueue = qMgr.accessQueue(\"TESTQ\", openOptions);\n\n tmpMsg.write(\"Msg1\".getBytes());\n destQueue.put(tmpMsg, pmo);\n tmpMsg.clearMessage();\n\n tmpMsg.write(\"Msg2\".getBytes());\n destQueue.put(tmpMsg, pmo);\n\n destQueue.close();\n\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n if(qMgr != null)\n qMgr.disconnect();\n }\n\n }then the program give me errorMQJE001: Completion Code '2', Reason '2495'. I saw the other post said something about that I have set this program to connect in binding mode? I didn't see anything about binding in myopenOptions. Does anyone know what happen?=====Update=====the client that I'm using iscom.ibm.mq.allclient 9.3.2.0\n com.ibm.mq\n com.ibm.mq.allclient\n 9.3.2.0\n ### Assistant: What is the exact version/release number of the MQ JAR files you are using? i.e. 9.2.0.11This could be a bug in the Java/MQ library or a simple coding issue on your part.You should only ever get Reason Code 2495 - MQRC_MODULE_NOT_FOUND when your client application is connecting in \"bindings mode\" but by your code above, you appear to be connecting to the queue manager in \"client mode\". Which does appear to be correct.Here are some of the problems I see with your code:MQEnvironment class is not thread-safe and should not be used. You should set the connection parameters in a Hashtable and pass it to the MQQueueManager class.You should never use any MQ object that begins with 'SYSTEM' (i.e. SYSTEM.DEF.SVRCONN). Create your own channel for your application. i.e. APP.TEST.CHL or whatever you want to call it.You should have a catch clause for the MQException and then dump out the MQ Completion Code and Reason Code.The close method for the opened queue should be in the finally clause.Here's my suggestion on what the code should look like:import java.util.Hashtable;\nimport com.ibm.mq.MQException;\nimport com.ibm.mq.MQMessage;\nimport com.ibm.mq.MQPutMessageOptions;\nimport com.ibm.mq.MQQueue;\nimport com.ibm.mq.MQQueueManager;\nimport com.ibm.mq.constants.CMQC;\n\npublic class SO_TestIt\n{\n public static void main(String[] args) {\n int openOptions = CMQC.MQOO_INQUIRE | CMQC.MQOO_OUTPUT;\n Hashtable mqht = new Hashtable();\n\n mqht.put(CMQC.CHANNEL_PROPERTY, \"APP.TEST.CHL\");\n mqht.put(CMQC.HOST_NAME_PROPERTY, \"192.168.0.13\");\n mqht.put(CMQC.PORT_PROPERTY, new Integer(1414));\n mqht.put(CMQC.USER_ID_PROPERTY, \"myUserId\");\n mqht.put(CMQC.PASSWORD_PROPERTY, \"myPwd\");\n\n MQQueueManager qMgr = null;\n MQQueue destQueue = null;\n MQMessage tmpMsg = new MQMessage();\n try {\n qMgr = new MQQueueManager(\"QM1\", mqht);\n destQueue = qMgr.accessQueue(\"TESTQ\", openOptions);\n\n tmpMsg.write(\"Msg1\".getBytes());\n destQueue.put(tmpMsg, new MQPutMessageOptions());\n tmpMsg.clearMessage();\n\n tmpMsg.write(\"Msg2\".getBytes());\n destQueue.put(tmpMsg, new MQPutMessageOptions());\n } catch (MQException e) {\n System.err.println(\"Put CC=\" +e.completionCode + \" : RC=\" + e.reasonCode);\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n try {\n if(destQueue != null)\n destQueue.close();\n } catch (MQException e) {\n System.err.println(\"Close: CC=\" +e.completionCode + \" : RC=\" + e.reasonCode);\n }\n\n try {\n if(qMgr != null)\n qMgr.disconnect();\n } catch (MQException e) {\n System.err.println(\"Disconnect: CC=\" +e.completionCode + \" : RC=\" + e.reasonCode);\n }\n }\n }\n}\n"} +{"text": "### Human: We develop an .NET application which connects to IBM MQ with IBM XMS library.\nIt's working, but the produced messages contains the MQRFH2 header, which the target application cannot process, so we have to remove it.\nThis normally can be done by set a property likehttps://www.ibm.com/docs/en/ibm-mq/9.1?topic=definitions-xmsc-wmq-target-client.\nWe tried this by settingcf.SetIntProperty(IBM.XMS.XMSC.WMQ_TARGET_CLIENT, IBM.XMS.XMSC.WMQ_TARGET_DEST_MQ);IBM.XMS.IConnection connectionWMQ;\n IBM.XMS.XMSFactoryFactory factoryFactory;\n IBM.XMS.IConnectionFactory cf;\n\n factoryFactory = IBM.XMS.XMSFactoryFactory.GetInstance(IBM.XMS.XMSC.CT_WMQ);\n cf = factoryFactory.CreateConnectionFactory();\n\n cf.SetStringProperty(IBM.XMS.XMSC.WMQ_HOST_NAME, mqQueueOptions.HostName);\n cf.SetIntProperty(IBM.XMS.XMSC.WMQ_PORT, mqQueueOptions.Port);\n cf.SetStringProperty(IBM.XMS.XMSC.WMQ_CHANNEL, mqQueueOptions.Channel);\n cf.SetIntProperty(IBM.XMS.XMSC.WMQ_CONNECTION_MODE, IBM.XMS.XMSC.WMQ_CM_CLIENT);\n cf.SetStringProperty(IBM.XMS.XMSC.WMQ_QUEUE_MANAGER, mqQueueOptions.QueueManager);\n cf.SetIntProperty(IBM.XMS.XMSC.WMQ_CLIENT_RECONNECT_OPTIONS, IBM.XMS.XMSC.WMQ_CLIENT_RECONNECT);\n cf.SetIntProperty(IBM.XMS.XMSC.WMQ_CLIENT_RECONNECT_TIMEOUT, IBM.XMS.XMSC.WMQ_CLIENT_RECONNECT_TIMEOUT_DEFAULT);\n cf.SetIntProperty(IBM.XMS.XMSC.WMQ_TARGET_CLIENT, IBM.XMS.XMSC.WMQ_TARGET_DEST_MQ);But then we get:Retry 00:00:02 of RetryPolicy-1d242dc3 at , due to: 'IBM.XMS.XMSException: Value 1 not valid for property: targetClient\n at IBM.XMS.Client.Impl.XmsPropertyContextImpl.SetObjectPropertyInternal(String name, Object value, Boolean validationEnabled)\n at IBM.XMS.Client.Impl.XmsPropertyContextImpl.SetObjectProperty(String name, Object value)\n at IBM.XMS.Client.Impl.XmsPropertyContextImpl.SetIntProperty(String name, Int32 value)What's the problem?Tried by settingcf.SetIntProperty(IBM.XMS.XMSC.WMQ_TARGET_CLIENT, IBM.XMS.XMSC.WMQ_TARGET_DEST_MQ);to remove the RF2H header but get exception of invalid value for the property.### Assistant: In a roundabout way this question is a duplicate ofIs there an MQ/XMS equivalent for the MQ/JMS setTargetClientIn SummaryYou are setting the property on the connection factory. It needs to set it on the destination. Same syntax as you have, but somewhere later in the code when you have instantiated adestinationobject.destination.SetIntProperty(XMSC.WMQ_TARGET_CLIENT, XMSC.WMQ_TARGET_DEST_MQ);See:https://www.ibm.com/docs/en/ibm-mq/9.3?topic=definitions-xmsc-wmq-target-client\n"} +{"text": "### Human: I want to read data from queue of MQ.When I browse queue in MQExplorer I find messages with Format=MQSTR.But when I read them, Format is MQHRF2 !!My MQ server is MQ7.5 and use com.ibm.mq.allclient maven library.MQMessage getMessage = new MQMessage();\ngetMessage.clearMessage();\nMQGetMessageOptions mqGetMessageOptions = new MQGetMessageOptions();\nqueue.get(getMessage, mqGetMessageOptions);\nString format = getMessage.format.trim();I tried my source on other server and queue and works well (get MQSTR).### Assistant: You need to understand the big picture then the coding will make sense.A JMS message is actually an MQRFH2 message to IBM MQ internally. So, IBM allows the client application to receive the JMS message in 1 of 2 formats. i.e. JMS message or MQRFH2 message.A JMS message means that the message MQMD.Format will be 'MQSTR' and it will have Named Properties (aka Message Properties).An MQRFH2 message means that the message MQMD.Format will be 'MQHRF2' and it will have an embedded MQHRF2 structure that will contain the Named Properties (aka Message Properties).Therefore, if you want the client application to receive a JMS message then you can code the following:MQGetMessageOptions gmo = new MQGetMessageOptions();\ngmo.options = CMQC.MQGMO_PROPERTIES_IN_HANDLE + CMQC.MQGMO_FAIL_IF_QUIESCING;\nMQMessage getMsg = new MQMessage();\ninQ.get(getMsg, gmo);On the other hand, if you want the client application to receive an MQRFH2 message then you can code the following:MQGetMessageOptions gmo = new MQGetMessageOptions();\ngmo.options = CMQC.MQGMO_PROPERTIES_FORCE_MQRFH2 + CMQC.MQGMO_FAIL_IF_QUIESCING;\nMQMessage getMsg = new MQMessage();\ninQ.get(getMsg, gmo);If you go with the MQRFH2 message, you can still get access to the Named Properties in the message's payload by using the MQRFH class. Note: User/application properties are stored in the 'usr' folder.MQRFH2 rfh2 = new MQRFH2(getMsg);\nString value = rfh2.getStringFieldValue (\"usr\", \"MyProp\");Finally, for MQ APIs calls like MQOPEN, MQGET, MQPUT or MQPUT1, it is MQ Best Practises to use/code the 'Fail if Quiescing' option.i.e.int openOptions = CMQC.MQOO_INPUT_AS_Q_DEF + CMQC.MQOO_FAIL_IF_QUIESCING;\nMQQueue inQ = qMgr.accessQueue(inputQName, openOptions);\nMQGetMessageOptions gmo = new MQGetMessageOptions();\ngmo.options = CMQC.MQGMO_PROPERTIES_IN_HANDLE + CMQC.MQGMO_FAIL_IF_QUIESCING;\nMQMessage getMsg = new MQMessage();\ninQ.get(getMsg, gmo);And:int openOptions = CMQC.MQOO_OUTPUT + CMQC.MQOO_FAIL_IF_QUIESCING;\nMQQueue outQ = qMgr.accessQueue(outputQName, openOptions);\nMQPutMessageOptions pmo = new MQPutMessageOptions();\npmo.options = CMQC.MQPMO_FAIL_IF_QUIESCING;\nMQMessage putMsg = new MQMessage();\nputMsg.writeString(\"This is a test message.\");\noutQ.put(putMsg, pmo);\n"} +{"text": "### Human: I am new to IBM MQ, wanted to know if its possible to display remote queue managers from client host using CLI, like I can successfully see the remote queue managers in webconsole of client-ibm-mq but how to check that from CLI or PCF or REST call### Assistant: It is not currently possible to use remote MQ commands (such as PCF or MQSC) to display the queue managers on a machine.However, using the MQ Console or the REST API it is possible. Do an HTTP GET from the following URL (changing the domain accordingly):-http://localhost:9080/ibmmq/rest/v1/admin/qmgrThis will show you output like the following:-{\"qmgr\": [\n {\n \"name\": \"MQG1\",\n \"state\": \"running\"\n },\n {\n \"name\": \"MQG2\",\n \"state\": \"ended\"\n }\n]}For more information on this particular REST API, seereference page for HTTP GET from /admin/qmgr\n"} +{"text": "### Human: Is it possible to use qload utility to connect to remote queue manager.\nI am not able to connect currently and has anyone tried and connected, if so how?\nQLoad version : 1.9\nI cant see any documentation on how to connect to remote queue manager.\nI also tried set MQSERVER variable from command line before executing the command.qload -m -i -f \n\n\nQLOAD Program by Paul Clarke [ V1.9 Build:Jun 19 2012 ]\nMQCONN on object '' returned 2058 QMgr name error..### Assistant: Invoke QLOAD as follows to use the client libraries.qload -m -i -l mqic -f The-lflag allows to chose the library to be used,mqicvsmqm. The default if the flag is omitted is to usemqm. You can read documentation for a rather more up-to-date version of qloadhere.Alternatively, if you want to continue to use themqmlibrary, you can set theMQ_CONNECT_TYPEenvironment variable, as describedhereto make a client connection using themqmlibrary.\n"} +{"text": "### Human: I am trying to use ACE Toolkit so that it listens / reads from IBM MQ queue (Docker container, dev version, running locally).Documentations instructs simply:\"You can use the Security identity property on the MQ node or MQEndpoint policy to pass a user name and password to the queue manager, by specifying a security identity that contains those credentials. The identity is defined using the mqsisetdbparms command.\"How do I run \"mqsisetdbparms\" command, where can I find that command ?I use Ubuntu Linux (for now).Alternatively, can I test my ACE Flow so that I run MQ Manager (dev) kind of unsecured way, so that it does not expect user / password ?Now I am getting error :2023-01-03 20:57:07.515800: BIP2628W: Exception condition detected on input node 'MQFlow.MQ Input'. \n2023-01-03 20:57:07.515866: BIP2678E: Failed to make a server connection to queue manager 'QM1': MQCC=2; MQRC=2058..version: '3.7'\n\nservices:\n\n mq-manager:\n container_name: mq-manager\n build:\n context: ./mq\n dockerfile: Dockerfile\n image: ibm-mq\n ports:\n - '1414:1414'\n - '9443:9443'\n environment:\n - LICENSE=accept\n - MQ_QMGR_NAME=QM1\n# - MQ_APP_PASSWORD=passw0rd.FROM ibmcom/mq:latest### Assistant: For local testing, you can configure without usage ofmqsisetdbparmslike this:Configure a policy in$YOUR_ACE_WORK_DIR/run/DefaultPolicies/MQ.policyxml:\n \n CLIENT\n QM1\n localhost\n 1414\n DEV.ADMIN.SVRCONN\n \n MqIdentity\n false\n \n \n \n \n default\n \nConfigure a remote default queue manager and credentials in$YOUR_ACE_WORK_DIR/overrides/server.conf.yaml:remoteDefaultQueueManager: '{DefaultPolicies}:MQ'\n\nCredentials:\n ServerCredentials:\n mq:\n MqIdentity:\n username: 'admin'\n password: 'passw0rd'Restart your ACE server\n"} +{"text": "### Human: I learn App Connect Enterprise v11 and try to make a DFDL Schema for JSON data and I do not know how. I successfully made a Schema for Record-Oriented-Text like the below but do not know how to do it for JSON.Record-Oriented-Text example:Delivery+++XYZ123ABC+++My order was delivered in time, but the package was torn|C01-COM684a2da-384+++Your complaint has been receivedJSON example:{\n\"YourComplaint\": {\n \"Type\": \"Delivery\",\n \"Reference\": \"XYZ123ABC\",\n \"Text\": \"My order was delivered in time, but the package was torn\"\n},\n\"Reply\": {\n \"OurReference\": \"C01-COM684a2da-384\",\n \"Text\": \"Your complaint has been received\"\n}}### Assistant: You should not create a DFDL schema for JSON data. ACE can parse JSON without any help from a schema. You should use the JSON parser/domain for JSON (just as you use the XMLNSC domain for XML).If you need to output your record-oriented data as JSON then you need to map from InputRoot.DFDL to OutputRoot.JSON. You may also need to set some field types to ensure that the JSON data looks exactly how you need it.\n"} +{"text": "### Human: I'm new at the MQ topic.How do I Test/Unit-Test my Java Services, which do actions against a real Queue.\nMy classes do connections, deletes etc.Is there any way to test these services without performing actions against the productive Queues?@Service\npublic class QueueConnectionService {\n\n private final MQConfigMapping configMapping;\n\n private MQQueueManager queueManager;\n\n @Autowired\n public QueueConnectionService(MQConfigMapping configMapping) {\n this.configMapping = configMapping;\n }\n\n\n MQQueue connect(String queuePropertyTitle, int openOptions, String queueName) throws MQException {\n MQEnvironment.hostname = configMapping.getNamed().get(queuePropertyTitle).getHostname();\n MQEnvironment.channel = configMapping.getNamed().get(queuePropertyTitle).getChannel();\n MQEnvironment.port = configMapping.getNamed().get(queuePropertyTitle).getPort();\n MQEnvironment.userID = configMapping.getNamed().get(queuePropertyTitle).getUser();\n MQEnvironment.password = configMapping.getNamed().get(queuePropertyTitle).getPassword();\n queueManager = new MQQueueManager(configMapping.getNamed().get(queuePropertyTitle).getQueueManager());\n return queueManager.accessQueue(queueName, openOptions);\n }\n}This is my QueueConnectionService, but I have no clue how to use this one at local tests.### Assistant: In order to dounit tests, you will need to mock the IBM MQ classes, using a framework likeMockito.One issue you'll encounter is that you cannot mock the call to theMQQueueManagerconstructor, as thenewoperator cannot be mocked. I would recommend creating aMqQueueManagerFactoryservice, autowire this service into yourQueueConnectionServiceand mock it in the test.Your unit test will end up looking like this:@ExtendWith(MockitoExtension.class)\nclass QueueConnectionServiceTest {\n\n private static final String TITLE = \"Some random string\";\n private static final String QUEUE_MANAGER = \"Actual value does not matter\";\n private static final String NAME = \"Really. Those constants are magic strings.\";\n private static final int OPTIONS = 42;\n\n @InjectMock\n private QueueConnectionService service;\n\n @Mock(answer = RETURNS_DEEP_STUBS)\n private MQConfigMapping configMapping;\n\n @Mock\n private MqConnectionManagerFactory connectionManagerFactory;\n\n @Mock\n private MQConnectionManager connectionManager;\n\n @Mock\n private MQQueue queue;\n\n @Test\n void should_provide_queue() {\n when(configMapping.getNamed().get(TITLE).getQueueManager()).thenReturn(QUEUE_MANAGER);\n // repeat above line for each configuration parameter.\n // Alternatively, create a config object and:\n when(configMapping.getNamed().get(TITLE)).thenReturn(config);\n\n when(connectionManagerFactory.create(QUEUE_MANAGER)).thenReturn(connectionManager);\n when(connectionManager.accessQueue(NAME, OPTIONS)).thenReturn(queue);\n\n var actual = service.connect(TITLE, OPTIONS, NAME);\n\n assertSame(actual, queue);\n }\n\n}(This is withJUnit 5andMockito. You would have something slightly different with another testing framework or another mocking framework.)As a side note, creating a queue manager at each connection smells bad. You probably want to create it once in an@PostConstructmethod.\n"} +{"text": "### Human: There is a requirement to create a Topic in IBMMQ . I couldnt find any documentaion for creating a topic using rest-api or SDK . Kindly help to create a Topic in IBMMQ using REST API or Java SDK### Assistant: You can use the MQSC REST API to create a topic. For example - do a HTTP/S POST to your MQ WebServer URL:http://:/ibmmq/rest/v3/admin/action/qmgr//mqscwith the following body:{\n \"type\": \"runCommand\",\n \"parameters\": {\n \"command\": \"def topic(RESTTOPIC) topicstr(RESTTOPIC)\"\n }\n}This will create a topic for you.Start your MQ WebServer usingstrmqweband note down the REST API URL usingdspmqwebcommand. Replace the URL in my example given above.Seeherefor more details.\n"} +{"text": "### Human: I am NOT able to stop anJMSconsumer dynamically using aSpring BootREST endpoint.\nThe number of consumers stays as is. No exceptions either.IBM MQ Version: 9.2.0.5pom.xml\n com.ibm.mq\n mq-jms-spring-boot-starter\n 2.0.8\nJmsConfig.java@Configuration\n@EnableJms\n@Log4j2\npublic class JmsConfig {\n @Bean\n public MQQueueConnectionFactory mqQueueConnectionFactory() {\n MQQueueConnectionFactory mqQueueConnectionFactory = new MQQueueConnectionFactory();\n mqQueueConnectionFactory.setHostName(\"my-ibm-mq-host.com\");\n try {\n mqQueueConnectionFactory.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n mqQueueConnectionFactory.setCCSID(1208);\n mqQueueConnectionFactory.setChannel(\"my-channel\");\n mqQueueConnectionFactory.setPort(1234);\n mqQueueConnectionFactory.setQueueManager(\"my-QM\");\n } catch (Exception e) {\n log.error(\"Exception while creating JMS connecion...\", e.getMessage());\n }\n return mqQueueConnectionFactory;\n }\n}JmsListenerConfig.java@Configuration\n@Log4j2\npublic class JmsListenerConfig implements JmsListenerConfigurer {\n @Autowired\n private JmsConfig jmsConfig;\n private Map queueMap = new HashMap<>();\n\n @Bean\n public DefaultJmsListenerContainerFactory mqJmsListenerContainerFactory() throws JMSException {\n DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();\n factory.setConnectionFactory(jmsConfig.mqQueueConnectionFactory());\n factory.setDestinationResolver(new DynamicDestinationResolver());\n factory.setSessionTransacted(true);\n factory.setConcurrency(\"5\");\n return factory;\n }\n\n @Override\n public void configureJmsListeners(JmsListenerEndpointRegistrar registrar) {\n queueMap.put(\"my-queue-101\", \"101\");\n log.info(\"queueMap: \" + queueMap);\n\n queueMap.entrySet().forEach(e -> {\n SimpleJmsListenerEndpoint endpoint = new SimpleJmsListenerEndpoint();\n endpoint.setDestination(e.getKey());\n endpoint.setId(e.getValue());\n try {\n log.info(\"Reading message....\");\n endpoint.setMessageListener(message -> {\n try {\n log.info(\"Receieved ID: {} Destination {}\", message.getJMSMessageID(), message.getJMSDestination());\n } catch (JMSException ex) {\n log.error(\"Exception while reading message - \" + ex.getMessage());\n }\n });\n registrar.setContainerFactory(mqJmsListenerContainerFactory());\n } catch (JMSException ex) {\n log.error(\"Exception while reading message - \" + ex.getMessage());\n }\n registrar.registerEndpoint(endpoint);\n });\n }\n}JmsController.java@RestController\n@RequestMapping(\"/jms\")\n@Log4j2\npublic class JmsController {\n @Autowired\n ApplicationContext context;\n\n @RequestMapping(value = \"/stop\", method = RequestMethod.GET)\n public @ResponseBody\n String haltJmsListener() {\n JmsListenerEndpointRegistry listenerEndpointRegistry = context.getBean(JmsListenerEndpointRegistry.class);\n\n Set containerIds = listenerEndpointRegistry.getListenerContainerIds();\n log.info(\"containerIds: \" + containerIds);\n\n //stops all consumers\n listenerEndpointRegistry.stop(); //DOESN'T WORK :(\n\n //stops a consumer by id, used when there are multiple consumers and want to stop them individually\n //listenerEndpointRegistry.getListenerContainer(\"101\").stop(); //DOESN'T WORK EITHER :(\n\n return \"Jms Listener stopped\";\n }\n}Here is the result that I noticed.Initial # of consumers: 0 (as expected)After server startup and queue connection, total # of consumers: 1 (as expected)After hittinghttp://localhost:8080/jms/stopendpoint, total # of consumers: 1 (NOT as expected, should go back to 0)Am I missing any configuration ?### Assistant: You need to also callshutDownon the container; see my comment on this answerDefaultMessageListenerContainer's \"isActive\" vs \"isRunning\"start()/stop()set/resetrunning;initialize()/shutDown()set/resetactive. It depends on what your requirements are.stop()just stops the consumers from getting new messages, but the consumers still exist.shutDown()closes the consumers. Most people callstop + shutdownand theninitialize + startto restart. But if you just want to stop consuming for a short time, stop/start is all you need.You will need to iterate over the containers and cast them to callshutDown().\n"} +{"text": "### Human: I have a problem when I want to set delivery delay for each message (IBM MQ and Spring boot). Normal way is to usejmsTemplate.deliveryDelay = 324234but the problem is we are changing the property of thejmsTemplatewhich is a global object (Singlteon). So I would like to send different delivery delays per message not a delay for all the messages (delay can be varied for each message).It seems the right way is to set this delivery in header for each message like code below. but when I tried it, it didn't work. I received messages immediately.jmsMessage.setLongProperty(\n DELAY_DELIVERY_TAG,\n deliveryDelayService.delay(message)\n )Does anyone know how I can set delivery delay per message?### Assistant: The IBM docs onJMS 2.0 delivery delaysays you can set it only on theproducer(i.e. theJmsTemplate), not the message:An application can specify a delivery delay in milliseconds, when it sends a message, by using eitherMessageProducer.setDeliveryDelay(long deliveryDelay) orJMSProducer.setDeliveryDelay(long deliveryDelay)It is fine to create a newJmsTemplateper invocation; just read theCaching Connection Resourcescarefully and follow the advice written in theJmsTemplate Java API:NOTE: The ConnectionFactory used with this template should return pooled Connections (or a single shared Connection) as well as pooled Sessions and MessageProducers. Otherwise, performance of ad-hoc JMS operations is going to suffer\n"} +{"text": "### Human: Need to have two outbound queues on two different servers and queue managers act as primary and secondary respectively if the sending to primary fails want to connect to secondary but as soon as primary become up application must send to primary any spring boot configuration can help? using websphere MQ.### Assistant: For a Java JMS messaging application in Spring Boot, aconnection name listallows for setting multiplehost(port)endpoints as comma separated pairs.The connection factory will then try these endpoints in turn to finds an available queue manager. UnsettingWMQConstants.WMQ_QUEUE_MANAGERmeans the connection factory will connect to the available queue manager on a givenhost(port)endpoint regardless of its name.You'll need to think about the lifecycle of the connection factory as the connection will remain valid once it has been established. In the scenario where the connection factory is bound to the queue manager onhostB(1414)(the second in the list) and then the queue manager onhostA(1414)(the first in the list) becomes available again, nothing would change until the next connection attempt.It's important to note that where the queue manager endpoints in the connection name list are unrelated, then the queues and messages available will not be the same.Multi-Instancequeue managers allow a queue manager instance to failover between twohost(port)endpoints. For container deployments,IBM MQ Native HAensures your messaging applications are routed to an active instance of the queue managerA CCDT allows for much more sophisticated connection matching options with IBM MQ over the connection name list method outlined above. More information on CCDT is availablehere. For JMS applications you'll need to set the connection factory to use CCDT e.g.,cf.setStringProperty(WMQConstants.WMQ_CCDTURL, \"\")to the location of the CCDT JSON file.\n"} +{"text": "### Human: Java.I had to port away from the Proton MQ library to the IBM one. I had written a dummy MQ server to run jUnit tests against but I cannot see any way to achieve something similar with IBM MQ. To me it seems that it requires a standalone server and a license. Is that the case? Are there any lightweight alternatives usable for jUnit?They mention that there is an IVTRun application which is actually just a wrapper over MQJMSIVT.class. Decompiling inside, I don't see anything that can start an actual server/queue manager. See this:https://www.ibm.com/docs/en/ibm-mq/9.2?topic=jms-point-point-ivt-mq-classes### Assistant: You can run MQ natively, in a container or in the cloud. The container option lends itself to automated testing as the set up and start can be automated.For detailed instructions seehttps://developer.ibm.com/series/mq-ready-set-connect/\n"} +{"text": "### Human: I am trying to retrieve messages from IBM mq with a specific time range for example messages that were put over the past 2 hours or from 0500 to 0600 or between dates or 2 days back. if possible please provide a sample java code. Thank you### Assistant: What have you written so far? Or are you looking to pay a consultant to do it for you?Basically, you have to browse with a lock, and check the message's timestamp to see if it is in the time range, if yes, perform a destructive MQGET otherwise browse the next message.\n"} +{"text": "### Human: I have a Normal IBM MQ developer edition 924 installed on a ubuntu virtual machine. And have cpp code files for Publisher and Subscriber model. I created a topic and started sending messages on the topic.The issue happens when I send a larger message on the topic, the error code of 2031(MQRC_MSG_TOO_BIG_FOR_Q_MGR) is outputted. (https://www.ibm.com/docs/en/ibm-mq/9.1?topic=arc-2031-07ef-rc2031-mqrc-msg-too-big-q-mgr)I changed the maxmsgl value for the Queue manager and the SVR channel as well. I ran the following commands for this:runmqsc QM1\nALTER QMGR MAXMSGL(104857600)\nALTER CHANNEL(SYSTEM.AUTO.SVRCONN) CHLTYPE(SVRCONN) maxmsgl(104857600)But still the error persists, could someone reflect on what needs to be done regarding this error code. And also as message segmentation is not allowed on pubsub what is the maximum limit of message size it can handle.### Assistant: When using a topic for publish/subscribe, the messages sent to subscribers are still put onto a queue for safe storage until they are consumed by the subscribing/getting application. These queues must also have MAXMSGL set appropriately.If you do not know which queue to adjust, follow these steps:-Run the subscriber application - assuming that it will wait around for a whileIssue the following MQSC command (e.g. usingrunmqsc):-DISPLAY SUB(*) DEST DESTCLAS TOPICSTR DURABLEThe name shown in theDESTfield in the output is the queue your subscription is using. If it's name starts withSYSTEM.MANAGEDand it also showsDESTCLAS(MANAGED)then your subscription is a managed subscription. You say that your subscription is not managed, but if you don't know which queue is in use by that subscriber then it is most likely that it IS managed, since that means you don't have to worry about the queue.A managed subscription queue is built from a MODEL queue referenced on the topic. If you are unsure which MODEL queue would be used, issue the following command using theTOPICSTRvalue from the output of the above command.DISPLAY TPSTATUS('topic-str-value') MNDURMDL MDURMDLIf the output from theDISPLAY SUBcommand earlier showed that your subscription wasDURABLE(YES)then the MODEL queue in use is the one shown in the fieldMDURMDL(Managed DURable MoDeL). If it showedDURABLE(NO)then the MODEL queue in use is the one shown in the fieldMNDURMDL(Managed Non-DURable MoDeL).Using the name determined in step 4 if it is not managed, or in step 5 if it is managed, issue the following MQSC command:-ALTER QLOCAL('q-name-from-step-4') MAXMSGL(104857600)\nor\nALTER QMODEL('q-name-from-step-5') MAXMSGL(104857600)Now re-make your subscription (so that it deletes the previous temporary queue it created and makes a new one from the model) and re-run your publisher application.\n"} +{"text": "### Human: a cluster queue part of a single cluster is deleted without taking the queue out of the cluster in IBM MQ v9.1\n. What issue will it cause?### Assistant: Some messages might already be en-route to this queue, sitting on transmission queues, being moved by channels, and when the messages arrive at the target queue manager, the cluster channel will try to put them to the queue only to discover it has been deleted. The messages will hopefully then end up on a DLQ, but if you don't have one, and the messages are persistent, the channel will stop so that the messages stay safe, and that will mean other messages can't get through.Altering the queue to take it out of the cluster, means that any en-route messages can still be put to the queue when they arrive, but no new messages will be sent that way as the queue is no longer in the cluster.Then you can wait a little while - make sure all channels are running so all en-route messages can get through - and once no more messages are arriving for that queue, you can delete it later without the above problems happening.\n"} +{"text": "### Human: I'm reading messages from IBM WMQ in C#. I need to read the message Id. Currently when attempting to read it, it's not readable.I think it may be because the messages contain RFH2 headers and I need to handle them before consuming the messages however I'm not sure how to exactly do this?C# code:try\n{\n MQMessage queueMessage;\n MQGetMessageOptions queueGetMessageOptions;\n string message = string.Empty;\n queueMessage = new MQMessage();\n queueMessage.Format = MQC.MQFMT_STRING;\n queueGetMessageOptions = new MQGetMessageOptions { WaitInterval = _appSettings.MqProperties.WaitIntervalMs };\n queueGetMessageOptions.Options |= MQC.MQGMO_WAIT;\n queueGetMessageOptions.Options |= MQC.MQGMO_SYNCPOINT;\n queue.Get(queueMessage, queueGetMessageOptions);\n\n if (queueMessage.Format.CompareTo(MQC.MQFMT_STRING) == 0)\n {\n if (queueMessage.MessageLength > 0)\n {\n message = queueMessage.ReadString(queueMessage.MessageLength);\n _logger.LogInfo(LogStatus.InProgress, $\"Message: {message}.\");\n _logger.LogInfo(LogStatus.InProgress, $\"Message ID length: {queueMessage.MessageId.Length}.MessageId: {Encoding.UTF8.GetString(queueMessage.MessageId, 0, queueMessage.MessageId.Length)}\");\n _logger.LogInfo(LogStatus.InProgress, $\"Message ID length: {queueMessage.MessageId.Length}.MessageId: {Encoding.ASCII.GetString(queueMessage.MessageId, 0, queueMessage.MessageId.Length)}\");\n _logger.LogInfo(LogStatus.InProgress, $\"Message ID length: {queueMessage.MessageId.Length}.MessageId: {Encoding.Default.GetString(queueMessage.MessageId, 0, queueMessage.MessageId.Length)}\");\n _logger.LogInfo(LogStatus.InProgress, $\"Message ID length: {queueMessage.MessageId.Length}.MessageId: {Encoding.Unicode.GetString(queueMessage.MessageId, 0, queueMessage.MessageId.Length)}\");\n _logger.LogInfo(LogStatus.InProgress, $\"Message ID length: {queueMessage.MessageId.Length}.MessageId: {Encoding.Latin1.GetString(queueMessage.MessageId, 0, queueMessage.MessageId.Length)}\");\n _logger.LogInfo(LogStatus.InProgress, $\"Message ID length: {queueMessage.MessageId.Length}.MessageId: {Encoding.UTF32.GetString(queueMessage.MessageId, 0, queueMessage.MessageId.Length)}\");\n _logger.LogInfo(LogStatus.InProgress, $\"Message ID length: {queueMessage.MessageId.Length}.MessageId: {Encoding.BigEndianUnicode.GetString(queueMessage.MessageId, 0, queueMessage.MessageId.Length)}\");\n\n await _messageConsumer.ConsumeMessage(message, Encoding.UTF8.GetString(queueMessage.MessageId, 0, queueMessage.MessageId.Length));\n }\n else\n {\n _logger.LogInfo(LogStatus.InProgress, $\"INVALID MESSAGE. Message Length {queueMessage.MessageLength}\");\n }\n }\n else\n {\n _logger.LogInfo(LogStatus.InProgress, $\"UNRECOGNISED MESSAGE FORMAT\");\n }\n}\ncatch (MQException mqex)\n{\n if (mqex.Reason == MQC.MQRC_NO_MSG_AVAILABLE)\n {\n _logConstants.InitializeCorrelationIdAndKeysForEachRun();\n _logConstants.InitializeLoggerKeys(null, null);\n _logger.LogInfo(LogStatus.InProgress, $\"{mqex.ReasonCode} {mqex.Message} CurrentDepth: {queue.CurrentDepth}. MaximumDepth {queue.MaximumDepth}\");\n }\n else if (mqex.Reason == MQC.MQRC_Q_MGR_STOPPING)\n {\n _logger.LogError(\n LogErrors.ErrorWhileConsumingMsgFromIBMMQ,\n LogStatus.Failed,\n \"IBM MQ Consumer Error\",\n $\" Error in Consuming the message from MQ. Making the thread sleep for one minute\");\n\n await Task.Delay(60000, cancellationToken);\n }\n else\n {\n _logger.LogError(\n LogErrors.ErrorWhileConsumingMsgFromIBMMQ,\n LogStatus.Failed,\n \"IBM MQ Consumer Error\",\n $\" Error in Consuming the Message from MQ {mqex.Reason} {mqex.Message} {mqex.StackTrace}\");\n\n await Task.Delay(60000, cancellationToken);\n queueManager = null;\n queue = null;\n }\n}Update:Following the comments on here, I tried the following:_logger.LogInfo(LogStatus.InProgress, $\"Message ID length: {queueMessage.MessageId.Length}.MessageId: {queueMessage.MessageId.ByteArrayToString}\");\n\npublic static string ByteArrayToString(this byte[] ba)\n{\n return BitConverter.ToString(ba).Replace(\"-\", \"\");\n}However that outputs:Message ID length: 24.MessageId: System.Func`1[System.String]### Assistant: This looks like a normal IBM MQ MessageId. The 24 bytes contain non-printable characters. You shouldConvert.ToHexStringthe MessageId before printing it:string messageIdHex = Convert.ToHexString(queueMessage.MessageId);\n// Now you can print this hex-encoded IBM MQ Message ID\n"} +{"text": "### Human: For a c++ and c program, I am trying to set a value for msgId or CorrelId for a particular message in IBM MQ, that will be later put to a topic. But there's an error of \"Expression must be a modifiable L-value\" for both the ids.I defined the ids asMQBYTE24 MsgId;\nMQBYTE24 CorrelId;and the MQMD is defined as default:MQMD md = {MQMD_DEFAULT};I cannot use the #define directive as I am trying to single out a message to be put to a topic from the publisher's end. Receive all the messages for subscriber and check for the particular message.Is my approach of using correlIds or MsgIds correct or is there a better way for doing this?### Assistant: I would expect you to have some code that looks like the following:-memcpy(md.CorrelId, CorrelId, MQ_MSG_ID_LENGTH);Please also remember that the message ID that you MQPUT to a topic does not end up at the subscribers. A new message ID is created for each copy of the published message that is given to each subscriber. You should use the Correlation ID instead to have it flow through to the subscriber, and ensure the subscribers are made correctly to receive the publishers correlation ID.ReadIBM MQ Little Gem #31: Publisher's CorrelIdfor more information about this.\n"} +{"text": "### Human: I want to use thedmpmqlogutility to view messages found in circular logs. Even though I follow everything as per IBM documentation, after I create the dump I'm unable to find the data in the logs. I stop the queue manager before running thedmpmqlogcommand, manually add few messages to the queue. But in the dumped log files these messages are not shown.I used the following invocation ofdmpmqlog:dmpmqlog -m QMAAMQ7701I: DMPMQLOG command is starting.\nLOG FILE HEADER\n***************\n\ncounter1 . . . : 56 \nFormatVersion . : 5 StrucId . . . . : 'HLFH'\nlogactive . . . : 3 loginactive . . : 2 \nlogsize . . . . : 4096 pages\nbaselsn . . . . : <0:0:0:0> \nnextlsn . . . . : <0:0:16:43833> \nlowtranlsn . . : <0:0:16:43129> \nminbufflsn . . : <0:0:16:42697> \nheadlsn . . . . : <0:0:16:42697> \ntaillsn . . . . : <0:0:16:43832> \nhflag1 . . . . : 1 \n -> CONSISTENT\n -> CIRCULAR\nHeadExtentID . : 0 LastEID . . . . : 1650643508\nLogId . . . . . : 1650643508\nFirstArchNum . : 4294967295 LastArchNum . . : 4294967295\nnextArcFile . . : 4294967295\nFileCount . . . : 3 \nFiles . . . . . : 0, 1, 2\nLastCId . . . . : 0 softmax . . . . : 16777216 \nLogPageSize . . : 4096 \nRecOffset . . . : 4096 \nMinAlign . . . : 4096 \ncounter2 . . . : 56 \n\n\nAMQ7719I: DMPMQLOG command is using a default of '0:0:16:42697' for the starting dump location.\nLOG RECORD - LSN <0:0:16:42697> \n**********\n\nHLG Header: lrecsize 212, version 1, rmid 0, eyecatcher HLRH\nCreation Time: 2022-04-22 22:39:27.137 (UNKNOWN) (UTC +330)\n\nLogRecdType . . : ALM Start Checkpoint (1025)\nEyecatcher . . : ALRH Version . . . . : 1\nLogRecdLen . . : 192 LogRecdOwnr . . : 1024 (ALM)\nXTranid . . . . : TranType: NULL\nObjectName . . : NULL\nQid . . . . . . : {NULL_QID}\nThisLSN . . . . : <0:0:0:0> \nPrevLSN . . . . : <0:0:15:50639> \n\nNo data for Start Checkpoint Record\n\n\nLOG RECORD - LSN <0:0:16:42909> \n**********\n\nHLG Header: lrecsize 220, version 1, rmid 0, eyecatcher HLRH\nCreation Time: 2022-04-22 22:39:27.137 (UNKNOWN) (UTC +330)\n\nLogRecdType . . : ATM Transaction Table (773)\nEyecatcher . . : ALRH Version . . . . : 1\nLogRecdLen . . : 200 LogRecdOwnr . . : 768 (ATM)\nXTranid . . . . : TranType: NULL\nObjectName . . : NULL\nQid . . . . . . : {NULL_QID}\nThisLSN . . . . : <0:0:0:0> \nPrevLSN . . . . : <0:0:0:0>Also myCURRLOGis showing no log files.DIS QMSTATUS CURRLOG\n 1 : DIS QMSTATUS CURRLOG\nAMQ8705I: Display Queue Manager Status Details.\n QMNAME(QMD) STATUS(RUNNING)\n CURRLOG( )What am I doing wrong here, any help would be greatly appreciated.IBM MQ V 9.1### Assistant: I suspect you might have more luck with thedmpmqlogprogram if you try the following invocation:-dmpmqlog -m QMA -bThe CURRLOG parameter is only applicable if you are using linear logging. Since you are using circular logging, it is expected to see a blank in there.From IBM Docs aboutDISPLAY QMSTATUS:-CURRLOGThe name of the log extent being written to at the time that theDISPLAY QMSTATUScommand is processed. If the queue manager is using circular logging, and this parameter is explicitly requested, a blank string is displayed.\n"} +{"text": "### Human: I am creating an object ofImqQueueManagerclass like thisImqQueueManager mqManager;Default constructor is getting called which is default initializing an object ofImqObjectclass.\nWhich is further leading to the crash. Here is the call stack(gdb) bt full\n#0 0x00007fb41179c336 in xcsCheckPointer () from /apps/mqm/lib64/libmqe_r.so\nNo symbol table info available.\n#1 0x00007fb412101ccd in ImqTrc::checkWritePointer(void const*, unsigned long) () from /apps/mqm/lib64/libimqb23gl_r.so\nNo symbol table info available.\n#2 0x00007fb412100264 in ImqStr::copy(char*, unsigned long, char const*, char) () from /apps/mqm/lib64/libimqb23gl_r.so\nNo symbol table info available.\n#3 0x00007fb411fdd007 in ImqObj::setName(char const*) () from /apps/mqm/lib64/libimqc23gl_r.so\nNo symbol table info available.\n#4 0x00007fb411fda4ee in ImqMgr::ImqMgr() () from /apps/mqm/lib64/libimqc23gl_r.soIBM MQversion7.5is installed on this64 bit Linuxmachine.\nSame code is working fine on another machine having the sameIBM MQversion installed on that.Can someone please help me to figure out what could be the reason behind this?### Assistant: IBM MQ version 7.5 is installed on this 64 bit Linux machine.You are using a release of IBM MQ that is long out of support. Seeherefor a list ofIBM MQ End of Service Dates.Secondly, you should be showing us your code (update your post) because otherwise we will just be guessing.Here's a fully functioning C++ that will connect to a remote queue manager and put a message to a queue./*\n * Program Name\n * MQTest31.cpp\n *\n * Description\n * Test program to connect to a queue manager using MQCONNX and MQCSP\n * and then put a message from a queue.\n *\n * Sample Command Line Parameters\n * QMgrName ChlName hostname(port) QName\n *\n * Where\n * QMgrName is the queue manager name\n * ChlName is the name of the channel to be used\n * hostname(port) is the hostname and port number\n * QName is the queue name\n * i.e.\n * MQTest31.exe MQWT1 TEST.CHL 127.0.0.1(1415) TEST.Q1\n *\n * @author Roger Lacroix, Capitalware Inc.\n */\n\n /*\n * Standard Include files\n */\n#include \n#include \n#include \n\n#include /* MQI */\n\n/*\n * mainline\n */\nint main ( int argc, char * * argv )\n{\n /* --------------------------------------------\n * Variable declarations.\n * --------------------------------------------\n */\n ImqQueueManager mgr;\n ImqChannel *pchannel = 0 ;\n ImqQueue queue;\n ImqMessage msg;\n /* */\n char buffer[10240];\n char myUserId[33] = \"roger\";\n char myPassword[33] = \"mypwd\";\n char testMsg[] = \"This is a simple test message.\";\n\n /* --------------------------------------------\n * Code section\n * --------------------------------------------\n */\n if (argc != 5)\n {\n cout << \"Usage: MQTest31 QMgrName ChlName hostname(port) QName\" < setHeartBeatInterval( 1 );\n pchannel -> setTransportType( MQXPT_TCP );\n pchannel -> setChannelName( argv[ 2 ] );\n pchannel -> setConnectionName( argv[ 3 ] );\n\n mgr.setChannelReference( pchannel );\n\n queue.setName( argv[ 4 ] );\n\n /*\n * Specify UserId and Password via MQCSP\n */\n mgr.setAuthenticationType(MQCSP_AUTH_USER_ID_AND_PWD);\n mgr.setUserId( myUserId );\n mgr.setPassword( myPassword );\n\n /*\n * Connect to queue manager\n */\n if ( ! mgr.connect( ) )\n {\n cout << \"MQTest31: connect CC=\" << mgr.completionCode()<< \" : RC=\" << mgr.reasonCode() < mqContainer = new GenericContainer<>(DockerImageName.parse(\"ibmcom/mq\"))\n .withEnv(\"LICENSE\", \"accept\")\n .withEnv(\"MQ_QMGR_NAME\", \"QM1\")\n .withEnv(\"MQ_USER_NAME\",\"admin\")\n .withCommand(\"--volume q1data:/mnt/mqm\")\n .withExposedPorts(1414);```All the settings in yml file for queue look unrelated, cause there is no any port specific stuff:ibm:\n mq:\n channel: DEV.APP.SVRCONN\n queue-manager: QM1\n user: admin\n password: passw0rd\n use-i-b-m-cipher-mappings: false\n user-authentication-m-q-c-s-p: false\n #ssl-cipher-spec: ECDHE_RSA_AES_128_CBC_SHA256\n ssl.enabled: falseI asked TC framework supporters and they advised to set host and port for spring in dynamic properties, which seems legit. The only problem I cant find correct settings to use. Any suggestion?### Assistant: From the tutorial here:https://developer.ibm.com/tutorials/mq-jms-application-development-with-spring-boot/, these could be the following property:ibm.mq.connName=localhost(1414)So your@DynamicPropertySourcecould be something like:@DynamicPropertySource\nstatic void registerMqProperties(DynamicPropertyRegistry registry) {\n registry.add(\"ibm.mq.connName\", \n () -> String.format(\"%s(%d)\", \n mqContainer.getHost(), \n mqContainer.getFirstMappedPort()));\n}\n"} +{"text": "### Human: I'm trying to receive a message asynchronously from IBM MQ:@JmsListener(destination = \"queue\", containerFactory = \"Factory\", id = \"start\")\n public Mono requestProcess(Message message) {return Mono.just(\"\").then(); \n}Catch:Caused by: org.springframework.jms.support.converter.MessageConversionException: Cannot convert object of type [reactor.core.publisher.MonoLift] to JMS message. Supported message payloads are: String, byte array, Map, Serializable object.If I switch method type to simplevoidit works as supposed to. How can I set listener to receive messages in non-blocking reactive way?### Assistant: The conversion that is failing is the input torequestProcess.@JmsListenerhas a found a publisher of typereactor.core.publisher.MonoLift, butrequestProcessis expecting aMessage, and it doesn't have a conversion.The way round this would be to changed the input signature forrequestProcessto@JmsListener(destination = \"queue\", containerFactory = \"Factory\", id = \"start\")\n public Mono requestProcess(MonoLift publisher) {\n ...\n\n }and modify the method body accordingly.\n"} +{"text": "### Human: I have installed IBM MQ server with a developer license (https://developer.ibm.com/articles/mq-downloads/) and followed the tutorial from here:https://developer.ibm.com/tutorials/mq-connect-app-queue-manager-windows/.So what I have now is:IBM MQ ManagerOneQueue Manager(QM1)4 Queues (one dead letter queue and 3 dev queues DEV.QUEUE.x) all local2 Channels (one admin and one 'normal' server connection channel)I enabled SSL on the QM1 queue manager:[![SSL Settings for QM1][1]][1]and I also created a personal certificate:\n[![Key management][2]][2]EDIT: I connected with username/password instead of using an SSL certificate. I have fixed this but now I cannot connect either.I also set the SSL ChiperSpec for the channel to ANY.amqsputc dev.queue.1 QM1now gives me:MQCONNX ended with reason code 2058Which (https://www.ibm.com/docs/en/ibm-mq/9.2?topic=arc-2058-080a-rc2058-mqrc-q-mgr-name-error) says that the que manager name is wrong. But as far as I can see QM1 is the corecct name.EDIT: When connecting with theamqssslctool with the following syntax I am getting this:amqssslc -l ibmwebspheremq -k C:\\ProgramData\\IBM\\MQ\\qmgrs\\QM1\\ssl\\key -c DEV.APP.SVRCONN -x DEV.APP.SVRCONN -s TLS_RSA_WITH_AES_128_CBC_SHA256 -m QM1\n\nSample AMQSSSLC start\nConnecting to queue manager QM1\nUsing the server connection channel DEV.APP.SVRCONN\non connection name DEV.APP.SVRCONN.\nUsing SSL CipherSpec TLS_RSA_WITH_AES_128_CBC_SHA256\nUsing SSL key repository stem C:\\ProgramData\\IBM\\MQ\\qmgrs\\QM1\\ssl\\key\nCertificate Label: ibmwebspheremq\nNo OCSP configuration specified.\nMQCONNX ended with reason code 2538### Assistant: As the error message you have shown us says, your channel definition forDEV.APP.SVRCONNhas not put a value in theSSLCIPHattribute.If this is missing at the queue manager end, use the following MQSC command to rectify:-ALTER CHANNEL(DEV.APP.SVRCONN) CHLTYPE(SVRCONN) SSLCIPH(ANY)or alternatively put the same value in theSSLCIPHattribute that you are using for the client application.If this is missing at the client application end, because you can see that there is a value in theSSLCIPHattribute on theSVRCONNalready, change your client application to also use the same cipherspec.If you are unsure how to, please update your question with theSVRCONNdefinition and details about your client application for more help.\n"} +{"text": "### Human: As below display, I need to change the Cluster Queue Manager(not the queue manager) from INACTIVE to Running. And after it is changed to Running, what command should I use if I need to change it from Running to Inactive. Anyone can tell me the command on this? Thanks!DISPLAY CLUSQMGR (PWRCSHK03) STATUS\n 8 : DISPLAY CLUSQMGR (PWRCSHK03) STATUS\nAMQ8441: Display Cluster Queue Manager details.\n CLUSQMGR(PWRCSHK03) CHANNEL(TO.PWRCSHK03.PHK02)\n CLUSTER(PHKCLUS02) STATUS(INACTIVE)\nDISPLAY QMSTATUS\n 9 : DISPLAY QMSTATUS\nAMQ8705: Display Queue Manager Status Details.\n QMNAME(PWRCSHK03) STATUS(RUNNING)### Assistant: TheSTATUSshown on aCLUSQMGRis the status of the channel. So when you seeSTATUS(INACTIVE)this means that the channel isn't running.The channel will start running automatically when it has messages to deliver - one of the benefits of clustering, but if you really want to start it up, assuming it is aCLUSSDRchannel, you can use:-START CHANNEL(TO.PWRCSHK03.PHK02)If it is aCLUSRCVRthen to seeSTATUS(RUNNING)you need to start one of theCLUSSDRchannels on another queue manager in the cluster to connect to this queue manager'sCLUSRCVR.\n"} +{"text": "### Human: I'm using transactions to read and acknowledge messages on a IBM queue and I'm wondering if a session created withconnection.CreateSession(true, AcknowledgeMode.SessionTransacted)locks a messagegloballywhenmultiple instancesof consumers are reading from thesamequeue?Background:\nI have written a small .NET Core Background Service that fetches messages of a queue using IBM XMS. Instances of this service will be hosted on two different servers (load-balanced) and each service will connect to the same queue. My worry is that since two different consumers on different servers are reading from the same queue, they might try to consume the same message.I recently came across theSimpleXAConsumerexample where aCommittableTransaction()-object was used instead of the session-transaction. Thedocumentationstates that:\"When XA transaction is in use, the transaction control is through\nDistributed Transaction Coordinator (DTC)global transactionsand it\nis not though XMS sessions.\"... which makes me believe that XMS session-transactions aren't global unless the CommittableTransaction()-object is used.It would be great if someone could confirm:If CommittableTransaction() must be used to create a global transaction.If a global transaction locks a message so that no other consumers may consume it.### Assistant: If an application gets a message in a transacted session, then that message will not be visible to other applications (and hence can't get it). If the application commits the transaction usingsession.commit()method, then the message is permanently removed from the queue. On the other hand, that message becomes available to other consumers (or to the same consumer) if the message is rolled back by the application.Another point to note: TheAcknowledgeModeparameter inconnection.createSession()method has no effect if the first parameter is true - meaning a transacted session is being created. When using transacted session, applications must use commit or rollback methods.\n"} +{"text": "### Human: I need to push a message into a remote Queue sending some header properties.\nIn my side I'm using IBM MQ v9 and I must not use the MQRFH2, just the 'native' MQ header (I'm not sure if it is possible).\nBut when I'm pull the message I can no see any of the properties.import javax.jms.Destination;\nimport javax.jms.JMSContext;\nimport javax.jms.JMSException;\nimport javax.jms.JMSProducer;\n\nimport com.ibm.mq.jms.MQDestination;\nimport com.ibm.msg.client.jms.JmsConnectionFactory;\nimport com.ibm.msg.client.jms.JmsFactoryFactory;\nimport com.ibm.msg.client.wmq.WMQConstants;\n\npublic class MessageSender {\n\n public void sendMessage() throws JMSException {\n JMSContext context = createJMSContext();\n JMSProducer producer = context.createProducer();\n Destination destination = context.createQueue(\"queue:///\" + queueName);\n System.out.println(\"destination: \" + destination);\n MQDestination mqDestination = (MQDestination) destination;\n // the header properties to be added\n mqDestination.setStringProperty(\"KEY1\", \"VALUE1\");\n mqDestination.setStringProperty(\"KEY2\", \"VALUE2\");\n mqDestination.setStringProperty(\"KEY3\", \"VALUE3\");\n // WMQ_CLIENT_NONJMS_MQ - static final int WMQ_CLIENT_NONJMS_MQ\n // WMQ_TARGET_CLIENT property value. Target is an MQ application (RFH2 will be excluded).\n mqDestination.setTargetClient(WMQConstants.WMQ_CLIENT_NONJMS_MQ);\n System.out.println(\"mqDestination: \" + mqDestination);\n String message = \"mymessage\";\n producer.send(mqDestination, message);\n }\n\n private JMSContext createJMSContext() {\n JMSContext context = null;\n try {\n JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\n JmsConnectionFactory cf = ff.createConnectionFactory();\n cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\n cf.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, false);\n cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, \"hostname\");\n cf.setStringProperty(WMQConstants.WMQ_CHANNEL, \"channel\");\n cf.setIntProperty(WMQConstants.WMQ_PORT, 1411);\n cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, \"queueManager\");\n context = cf.createContext();\n } catch (JMSException e) {\n e.printStackTrace();\n }\n\n return context;\n }\n\n}### Assistant: This code:-mqDestination.setTargetClient(WMQConstants.WMQ_CLIENT_NONJMS_MQ);is stripping the message properties off before the message is sent.You say that you want to use the 'native header' and not 'MQRFH2' but the two are fully interchangeable. There is no one or the other, it is just how the message properties are presented to the receiver of the message depending on how they are capable of consuming them.If you put messages properties and the receiver asks for them in RFH2 then that is what they will get.If you build the correctly formed RFH2 header and the receiver asks for message properties then that is what they will get.Remove the above mentioned line from your application and your message properties will flow to the receiver.\n"} +{"text": "### Human: I have a requirement, where I am publishing data to the IBM MQ and at around 10pm we run a scheduler that should consume only those messages that are published before 10pm. The messages that are published on or after 10pm should be picked next day.Is there a way in IBM MQ where we can filter it based on the datetime and consume? Any suggestion?Thanks in advance.### Assistant: What you'd really like to be able to do is use a message selector something like this:-Root.MQMD.PutDate = '20210924' AND Root.MQMD.PutTime < '22000000'However, unfortunately, the only operators you are allowed to use with strings (and both of these fields are string fields) are=and<>(not-equals) (seeIBM MQ Docs: Message selector syntax).Alternatively, you could make use of QLOAD which can select messages based on time, and have it pre-process the queue by moving all the messages you should be processing to another queue and then allow your application to work on that entire queue. You could invoke QLOAD to do this as follows:-qload -m QM1 -i INPUT.Q -Tt22:00 -o APPL.INPUT.QThis command will read messages from a queue calledINPUT.Qand will only move those that were put today before 22:00 (10pm) to the queue calledAPPL.INPUT.Q.Of course, QLOAD is not doing anything here that you couldn't write into your own application. Just inspect thePutDateandPutTimefields in theMQMDand use those to decide whether to process the message or not.\n"} +{"text": "### Human: Below is a summary of the AMQP client we have trying to build to evaluate request / response message pattern with IBM MQ.Current IBM Queue Manager version = 9.1.0.6AMQP channel setup with the below properties, and is available at <>:5672. Properties of the channel are below.Attributes for COMET.AMQP_SECCLNT\nname COMET.AMQP_SECCLNT\ntype AMQP\nalteration_date 2021-09-06\nalteration_time 08.48.37\nno_external_participants \ndescription COMET Secure SSL Client for AMQP\ndisc_interval \nhb_interval \nkeep_alive_interval \nmax_instances 999999999\nmax_instances_per_client \nmax_message_length 4194304\nmca_user \nsharing_conversations \nssl_client_auth REQUIRED\nssl_cipher_spec ECDHE_RSA_AES_256_CBC_SHA384\nssl_peer_name \ncert-label \nstatus INACTIVE\ncanStart false\ncanStop falseTo access an existing queue via the channel, a subscription was setup - /comet/interim/claim. The subscription was mapped to queue endpoint \u2013 COMET.INTERIM_CLAIMQ.\nThe below client is configured toSend a message and pickup the message using jms correlation id from the same queue endpoint.Set the JMS Message Type to MQSTR instead of MQHRF2Set reply to end point as /comet/interim/claim \u2013 subscription created to access COMET.INTERIM_CLAIMQ.Client code is belowpackage com.ibm.mq.samples.jms.qpid;\n\nimport javax.jms.JMSContext;\nimport javax.jms.Message;\nimport javax.jms.Queue;\nimport javax.jms.QueueConnection;\nimport javax.jms.QueueReceiver;\nimport javax.jms.QueueSender;\nimport javax.jms.QueueSession;\nimport javax.jms.TextMessage;\nimport org.apache.qpid.jms.JmsConnectionFactory;\n\npublic class TestMessageSender {\n public static void main(String[] args) {\n\n System.setProperty(\"javax.net.ssl.keyStore\", \"cometdesktopmq.jks\");\n System.setProperty(\"javax.net.ssl.trustStore\", \"cometdesktopmq.jks\");\n System.setProperty(\"javax.net.ssl.keyStorePassword\", \"<>\");\n System.setProperty(\"com.ibm.mq.cfg.useIBMCipherMappings\", \"false\");\n try {\n String requsetUri = \"amqps://host_name:5672\";\n String userName = \"tgusr\";\n String password = \"<>\";\n JmsConnectionFactory factory = new JmsConnectionFactory(userName, password, requsetUri);\n QueueConnection conn = factory.createQueueConnection();\n conn.start();\n System.out.println(\"conn started\");\n QueueSession sess = conn.createQueueSession(false, 1);\n System.out.println(\"queue session created\");\n JMSContext context = factory.createContext(userName, password);\n System.out.println(\"context created\");\n Queue q = context.createQueue(\"/comet/interim/claim\");\n QueueSender qs = sess.createSender(q);\n System.out.println(\"queue sender created\");\n TextMessage message = context.createTextMessage(\"Text content\");\n message.setJMSType(\"MQSTR\");\n String msgId = message.getJMSMessageID();\n message.setJMSCorrelationID(msgId);\n Queue rq = context.createQueue(\"/comet/interim/claim\");\n message.setJMSReplyTo(rq);\n qs.send(message); // Send the message\n System.out.println(\"message sent\");\n QueueReceiver reciever = sess.createReceiver(rq, \"JMSCorrelationID ='\" + msgId + \"'\");\n Message reply = reciever.receive(10*1000); // Pickup the message using the id set in correlation id field, timeout = 10 secs\n Inspector ins = new Inspector(reply);\n ins.showMessageType();\n ins.showProperties();\n ins.showMessageHeaders();\n ins.showMessageBody();\n conn.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n}The message that was received at queue COMET.INTERIM_CLAIMQ is a belowRFH [1]\\[1] \u00b8\n________________________________________\nMQSTR \nMQMD\nStrucId: MD Version: 1\nMsgType: 8 Expiry: -1\nEncoding: 546 CodedCharSetId: 1208\nFormat: MQHRF2 Priority: 0\nReport: 0 Feedback: 0\nMsgId: 414d5120574d51543532352020202020e4c44561003c722a\nCorrelId: 414d5120574d51543532352020202020b6273861033d162d\nBackoutCount: 0\nAccountingToken: 0531353938370000000000000000000000000000000000000000000000000006\nApplIdentityData: ApplOriginData: \nReplyToQ: ReplyToQMgr: WMQT525\nPersistence: 1 UserIdentifier: mqm\nPutApplType: 26 PutApplName: WMQT525\nPutDate: 09/19/2021 22:14:20\nGroupId: 000000000000000000000000000000000000000000000000\nMsgSeqNumber: 1 Offset: 0\nMsgFlags: 0 OriginalLength: -1\nMessage \nRFH [1]\\[1] \u00b8\n________________________________________\nMQSTR \u00b8\n________________________________________\n\u00fcp910-006-2007031.0140ID:ce297c87-f1f4-46af-8ecb-6f6eb4d97d70:1:1:1-1/comet/interim/claimMQSTR/comet/interim/claim016321076609400005 4topic:///comet/interim/claim Text contentConcerns \u2013Format still shows MQHRF2 instead of MQSTR.ReplyToQ property shows blank.\n[First to concerns are high priority]The message body contains tag To as - /comet/interim/claim , What does this indicate ?It also contains tag topic:///comet/interim/claim. The relyTo destination we are setting in the code is a Queue, Why does it get translated into a topic:///?### Assistant: Below is a summary of the AMQP client we have trying to build to\nevaluate request / response message pattern with IBM MQ.Current IBM Queue Manager version = 9.1.0.6If you want to create a client application to connect to IBM MQ queue manager, then why don't you just write it using the MQ Java or Java/JMS Client Library? Why add all this extra stuff? You are giving yourself more headaches than it is worth.IBM has been incrementally adding AMQP features to IBM MQ over the last 6 years since IBM added AMQP channel support in IBM MQ v8.0.0.2.You are using IBM MQ v9.1, I believe it only supports Pub/Sub and not point-to-point messages. For Pub/Sub, all messages will be in the JMS message format (aka MQRFH2 format). You should readthis page.If you upgrade your queue manager to IBM MQ v9.2 then you will get more AMQP features. For IBM MQ v9.2 AMQP features, you should readthis page.\n"} +{"text": "### Human: I want to set up a windows service that logs all messages to all topics in my system. It seems like the way the code is working in C# means that I need to create a root topic \"MyCompany\" and then subscribe to the \"#\" wildcard topic name of the \"MyCompany\" topic object. This will allow me to log all messages so long as I force all applications in my company to publish to topics within the \"MyCompany\" topic then set up my logger to subscribe like this:_topic = _queueManager.AccessTopic(\"#\", \"MyCompany\", MQC.MQTOPIC_OPEN_AS_SUBSCRIPTION, _openOptions);Is there a way to set IBM MQ up so that I don't need to force the use of the MyCompany root topic? Do I need to access the topic a different way in my code?### Assistant: You are overthinking it. Or maybe you are confused by the terminology and think you need both a Topic String and Topic Object. Not so.You can specify:Only a Topic StringOnly a Topic ObjectBoth.Note: A Topic Object is also called an administrative Topic. And in some IBM documentation, it is called Topic Name. Not very consistent but it is something you should be aware of.So, the easiest way to do it is:_topic = _queueManager.AccessTopic(\"#\", null, MQC.MQTOPIC_OPEN_AS_SUBSCRIPTION, _openOptions);This call will subscribe to all topics of the queue manager. Seeherefor more information about the AccessTopic method.\n"} +{"text": "### Human: Application scope:To send message from java application to IBM MQ, which is consumed by non-java mainframe applicationIssue:Simplified chinese characters message are successfully consumed and processed by non-java mainframe application. Whereas Traditional characters msg fails with below error in receiving application.0051963 MQ Request failed. MQ Type: MQGET MQ Name: LOADER CC: 00000001 RC: 00002079\n0051963 MQ Request failed. MQ Type: MQOPEN MQ Name: ERROR CC: 00000002 RC: 00002035\n0051963 MQ Request failed. MQ Type: MQPUT MQ Name: ERROR CC: 00000002 RC: 00002019Error code 2079 say\u2019s truncated message was accepted so message failing in receiving application.Why does traditional character message are truncated first? What is\nthe correct encoding or CCSID should be used in java while handling\nwith chinese characters?Using below MQ jar's in java application:\n \n org.springframework.boot\n spring-boot-starter-activemq\n \n \n com.ibm\n com.ibm.mq.allclient\n 8.0.0.5\n Java Code to post message to IBM MQ.Integer charSetId = 935;\n String senderQ = \"queue:///\"+queueName+\"?CCSID=\"+charSetId+\"&targetClient=1\"; \n jmsTemplate.setExplicitQosEnabled(true);\n jmsTemplate.setDeliveryPersistent(false); \n jmsTemplate.send(senderQ,new MessageCreator() { \n public javax.jms.Message createMessage(javax.jms.Session session) throws JMSException { \n TextMessage msg = session.createTextMessage(); \n try {\n msg.setIntProperty(WMQConstants.JMS_IBM_CHARACTER_SET, charSetId);\n msg.setStringProperty(WMQConstants.JMS_IBM_UNMAPPABLE_ACTION, \"REPLACE\");\n msg.setText(txt);\n \n } catch (Exception e) {\n LOGGER.error(errorLog.getErrorDetail(e), e); \n }\n \n return msg; \n\n }\n });### Assistant: 0051963 MQ Request failed. MQ Type: MQGET MQ Name: LOADER CC:\n00000001 RC: 00002079Reason code of 2079 (MQRC_TRUNCATED_MSG_ACCEPTED) means that you need to use a larger buffer for the MQGET.0051963 MQ Request failed. MQ Type: MQOPEN MQ Name: ERROR CC:\n00000002 RC: 00002035Reason code of 2035 (MQRC_NOT_AUTHORIZED) means that the UserId you are connecting with to the queue manager does not hae permission to open that particular queue. Get the MQAdmin to set the permissions for the UserId, so that it can open the queue.0051963 MQ Request failed. MQ Type: MQPUT MQ Name: ERROR CC:\n00000002 RC: 00002019Fix the security issue then this error message will go away. Someone isn't properly coding their application because the exception (RC of 2035) should have been caught and not continued with putting of a message.\n"} +{"text": "### Human: Today we have our MQ installations primarely on mainframe, but are considering moving them to Windows or Linux instead.\nWe have three queue managers (qmgrs) in most environments. Two in a queue sharing group across two LPARs, and a stand-alone qmgr for applications that doesn't need to run 24/7. We have many smaller applications, which shares the few qmgrs.When I read up on building qmgrs in Windows and Linux, I get the impression that most designs favor a qmgr or a cluster per application. Is it a no-go to build a general purpose qmgr for a hundred small applications on Windows/Linux?I have considered a Multi instance Qmgr (active/passive) or a clustered solution.\nWhat is considered best practice in a scenario, where I have several hundred different applications that needs MQ communication.### Assistant: First off, you are asking for an opinion that is not allowed on StackOverflow.Secondly, if you have z/OS (mainframe) applications using MQ then you cannot move MQ off the mainframe because there is no client-mode connectivity for mainframe applications. What I mean is that the mainframe MQ applications cannot connect in client mode to a queue manager running on a distributed platform (i.e. Linux, Windows, etc.). You will need to have queue managers on both mainframe and distributed platforms to allow messages to flow between the platforms. So, your title of \"Moving IBM MQ away from mainframe\" is a no go unlessALLmainframe MQ applications are moving off the mainframe too.I get the impression that most designs favor a qmgr or a cluster per\napplication.I don't know where you read that but it sounds like information from the 90's. Normally, you should only isolate a queue manager if you have a very good reason.I have considered a Multi instance Qmgr (active/passive) or a\nclustered solution.I think you need to read up on MQ MI and MQ clustering because they are not mutually exclusive. MQ clustering has nothing to do with fail-over or HA (high-availability).Here is a description ofMQ clusteringfrom the MQ Knowledge Center.\n"} +{"text": "### Human: IBM providesa methodto control performance when using asynchronous delivery:setMsgBatchSizepublic void setMsgBatchSize(int size)\nthrows javax.jms.JMSExceptionSets the message batch size.Parameters:\nsize - the maximum number of messages to be taken at once when using asynchronous delivery.\nThrows:\njavax.jms.JMSExceptionHow can we achieve this on ActiveMQ? From the official documentation of ActiveMQ they have provided property named:cf.setUseAsyncSend(true);I'm not sure if ActiveMQ was settingmsg batch sizeby default, and when we setuseAsyncSendtotruewe can achieve results as IBM did.Thank you in advance and willing to listen to any discussion.### Assistant: ActiveMQ does not have an equivalent option. When a message is sent it is immediately put to the wire and if the async send option is enabled (default is true) then for messages that are not persistent or are within a transaction there is no wait for remote acknowledgement of the send, your code can immediately send the next message.\n"} +{"text": "### Human: @Component\n @RequiredArgsConstructor\n public class EventListener {\n \n private final EventProcessingService eventProcessingService;\n\n @JmsListener(destination = \"inputQueue\", constainerFactory = \"myContainerFactory)\n public void receiveMessage(Message message) {\n eventProcessingService.doSome(message).subscribe(); // return Mono\n }\n }\n \n\n\n @Service\n public class EventProcessingService {\n\n public Mono doSome(Message message) {\n //...\n }\n }\n \n @Configuration\n @RequiredArgsConstructor\n public class MqIntegration {\n \n private final ConnectionFactory connectionFactory;\n\n @Bean\n public Publisher> mqReactiveFlow() {\n return IntegrationFlows\n .from(Jms.messageDrivenChannelAdapter(this.connectionFactory)\n .destination(\"testQueue\"))\n .channel(MessageChannels.queue())\n .toReactivePublisher();\n }\n }I have some webflux application which interacts with ibm mq and a JmsListener which listens for messages from the queue when a message is received EventProcessingService makes requests to other services depending on the messages.\nI would like to know how I can create a JmsListener that works with reactive threads using Spring Integration. In other words I want to know if it is possible to create an Integration flow which will receive messages from the queue and call the EvenProcessingService when the messages are received so that it does not have a negative effect on the threads inside webflux application### Assistant: I think we need to clean up some points in your question.WebFlux is not a project by itself. It is Spring Framework module about Web on top of reactive server:https://docs.spring.io/spring-framework/docs/current/reference/html/web-reactive.html#spring-webfluxThe@JmsListeneris a part of another Spring Framework module -spring-jms. And there is nothing relevant to threads used by reactive server for WebFlux layer.https://docs.spring.io/spring-framework/docs/current/reference/html/integration.html#jmsSpring Integration is a separate project which implement EIP on top of Spring Framework dependency injection container. It indeed has its own WebFlux module for channel adapters on top of WebFlux API in Spring Framework:https://docs.spring.io/spring-integration/docs/current/reference/html/webflux.html#webflux. And it also has a JMS module on top of JMS module from Spring Framework:https://docs.spring.io/spring-integration/docs/current/reference/html/jms.html#jms. However there is nothing related to@JmsLisntenersince itsJms.messageDrivenChannelAdapter()fully covers that functionality and from a big height it does it the same way - viaMessageListenerContainer.All of this is might not be relevant to the question, but it is better to have a clear context of what you are asking so we will feel that we are on the same page with you.Now trying to answer to your concern.As long as you don't deal with JMS from WebFlux layer (@RequestMappingorWebFlux.inboundGateway()), you don't effect those non-blocking thread. The JMSMessageListenerContainerspawns its own threads and perform pulling from the queue and message processing.What you are explaining with your JMS configuration and service looks more like this:@Bean\n public IntegrationFlow mqReactiveFlow() {\n return IntegrationFlows\n .from(Jms.messageDrivenChannelAdapter(this.connectionFactory)\n .destination(\"testQueue\"))\n .handle(this.eventProcessingService)\n .nullChannel();\n }There is really no reason to shift messages just after JMS into aQueueChannelsince JMS listening is already an async operation.We need thatnullChannelin the end of your flow just because your service method returnsMonoand framework knows nothing what to do with that. Starting with version5.4.3theNullChannelis able to subscribe to thePublisherpayload of the message produced to it.You could have though aFluxMessageChannelin between to really simulate a back-pressure for JMS listener, but that won't make to much different for your next service.\n"} +{"text": "### Human: I am having issue issue while connecting to ssl enabled ibm mq using nodejs. I am tryingthiscode with all values replaced as per my MQ. When i execute code i see error MQ call failed in CONNX: MQCC = MQCC_FAILED [2] MQRC = MQRC_HOST_NOT_AVAILABLE [2538]Keydb i have created using 'runmqakm' utility.to get ssl logs, i tried setting below system variable before executting Node js code but dont get any logs on console.\nset NODE_DEBUG='tls' or even set NODE_DEBUG=tlsCan some one please help me to get ssl debug logs### Assistant: For the Node.js side you need to know which npm modules are being used to determine which settings to use. Theibmmqnode library calls the C MQI API, which also takes care of TLS, so aNODE_DEBUGoption is not going to help.Going through the library it looks like you might be able to dynamically switch on logging by callingconst mq = require('ibmmq');\nmq.setTuningParameters({debugLog:true});but the chances are that it's not going to give you much information.Better would be to check the server logs for an indication of why the connection failed. You can follow the cheat sheet to determine where and what to look for.https://developer.ibm.com/articles/mq-dev-cheat-sheet/Most likely it will be because of a cipher mismatch between MQ and app.If you check the patterns repo, it does describe how to set up TLS -https://github.com/ibm-messaging/mq-dev-patternsThere is also a TLS tutorial -https://developer.ibm.com/tutorials/mq-secure-msgs-tls/\n"} +{"text": "### Human: Tried setting an IBM MQ custom property in JMS while sending messages. It doesn't work.I'm looking for an equivalent of the following in JMS/Apache camel.mQMessage.setStringProperty( \"customProperty\", \"123\" );Tried the following 3 options:1) exchange.getIn().setHeader( \"customProperty\", \"123\" );\n2) exchange.getIn().setProperty( \"customProperty\", \"123\" );\n3) mQQueueConnectionFactory.setStringProperty( \"customProperty\", \"123\" );The following code to read the property throws error because the property doesn't exist it seems.\nmQMessage.getStringProperty( \"messageGlobalSequenceNumber\" )throws the following error:com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2471'.\n at com.ibm.mq.MQMessage.getProperty(MQMessage.java:5694)\n at com.ibm.mq.MQMessage.getStringProperty(MQMessage.java:6949)\n at com.ibm.mq.MQMessage.getStringProperty(MQMessage.java:6925)\n...### Assistant: Are you sure that the property that you are trying to retrieve actually exists for that message? Because Reason Code of 2471 (MQRC_PROPERTY_NOT_AVAILABLE) clearly says that the named property does not exist.The correct way to create a message property in JMS (for IBM MQ) is as follows:/**\n * Send a message to a queue.\n * @param session\n * @param myQ\n * @throws JMSException\n */\nprivate void sendMsg(QueueSession session, Queue myQ) throws JMSException\n{\n QueueSender sender = null;\n\n try\n {\n TextMessage msg = session.createTextMessage();\n msg.setText(\"This is a test message.\");\n msg.setStringProperty(\"MyProp01\", \"somevalue\");\n\n sender = session.createSender(myQ);\n sender.send(msg);\n }\n finally\n {\n try\n {\n if (sender != null)\n sender.close();\n }\n catch (Exception ex)\n {\n System.out.println(\"sender.close() : \" + ex.getLocalizedMessage());\n }\n }\n}Did you use an MQ tool to check the property values of the message? I ran the above code then checked the message on the queue withMQ Visual Editand here is a screen-shot:Or a screen-shot of the opened selected message showing the Named Properties (aka message properties):\n"} +{"text": "### Human: I am using ibm cloud pak for integration version 3.0.0.\nI deployed an MQ instance into my Openshift Cluster.\nwhen I check my new created instance information it says: \"telemetry not supported\"But I want my instance to support MQTT protocol.is there anything I am missing? what can I do? thanks### Assistant: I think it's not installed by default, which means that to install it you will need to customise the container.You will need to clone the IBM MQ Container -https://github.com/ibm-messaging/mq-containerand ask for MQTT to be installed by changing the lineexport genmqpkg_incmqxr=0toexport genmqpkg_incmqxr=1in the fileinstall-mq.sh. Then follow the build instructions to create the container image.\n"} +{"text": "### Human: I have installed a IBM MQ Developer version on a server, and I need to configure Rest requests, to be more specific it must be able to put message in the queue using a Rest request.Unfortunately I didn't find any good source of information about this...### Assistant: You need to run the MQ web server. Use the commandstrmqweb.Seehttps://www.ibm.com/support/knowledgecenter/SSFKSJ_9.1.0/com.ibm.mq.ref.adm.doc/q127860_.html\n"} +{"text": "### Human: IBM's documentation on ALTER CHANNELgoes to commendable length explaining the various available alterations, but does not offer a singleexample-- certainly not for C++-users.Suppose, I want to change theMCAUSERfrom the default (OS username) to another string, what would the function-call look like?### Assistant: The documentation you link to in your question is the MQSC command reference. This is designed for scripts.Please also note that the default value of a channel's MCAUSER field is actually blank, not the OS username. Because it is blank, then in the case of a SVRCONN channel, when a client application connects, the OS username flowed from the client, will be used for the MCAUSER for that running instance. You cannot change this behaviour using ALTER CHANNEL from your client application. I note this, in case this is the reason you are thinking to use ALTER CHANNEL.If you want to write a program to make a change to an IBM MQ object, such as a channel, you would instead want to make use of a different, but equivalent interface called the Programmable Command Format (PCF). The equivalent command reference page ishere.There is an example C++ PCF samplehere- look forSrvPCFIn short, psuedo-code, you would write a program as follows:-MQCONN(Qmgr-name)\nMQOPEN(Reply-Q)\nBuild PCF message for MQCMD_CHANGE_CHANNEL\n with MQCACH_CHANNEL_NAME\n with MQIACH_CHANNEL_TYPE\n with MQCACH_MCA_USER_ID\nMQPUT1(PCF Message to SYSTEM.ADMIN.COMMAND.QUEUE)\nMQGET(wait for reply on Reply-Q to say whether it worked or not)\n"} +{"text": "### Human: I am completely new to MQ world and need help understanding the install.I have downladed 9.2.0.1-IBM-MQFA-Redist-LinuxX64.tar.gz redistrible package . Now i can see under bin folder there is set of FTE* commands.Requirements:\nNeed to transfer files from linux server to queue (File to Queue)Questions:Do i need to run FTEcreateagent in my linux host or MQ server?If i run FTEcreateagent in my linux host, does the agent will be visible automatically in windows server?### Assistant: You have downloaded is the Redistributable version of IBM MQ Managed File Transfer product. It can be simply unpackaged anywhere on a file system. But you need to have a MQ v9 or above queue manager running somewhere as MQ is a prerequisite for MFT.The redistributable package contains binaries and commands for for setting up agents to run transfers. It does not contain MQExplorer.You need to start by running fteCreateEnvironment command and then call fteSetupCoordination, fteSetupCommands and then fteCreateAgent.Thisis the best place to start learning about configuring MFT using the redistributable package.\n"} +{"text": "### Human: I have created a local queue, using MQ Explorer, but I cannot see it in MQ Explorer's list of queues. Here is a screen shot of what I see in MQ Explorer:I expect the Local Queue to appear under the Queue folder.If I right-click on the Queue folder and select Status, I can see it, as shown in this second screen shot. So I know that the queue has definitely been created.### Assistant: When viewing IBM MQ objects, such as queues, with MQ Explorer, the display is split into two panes, \"MQ Explorer - Navigator\" and \"MQ Explorer - Content\".Clicking on a \"folder\" in the Navigator pane causes items to be shown in the Content pane.If you don't see the list of queues when you click on the \"Queues\" folder in the Navigator pane, this could be because you have closed the Content pane. To re-open the Content pane, use the Window menu, and choose \"Show View\" and then choose \"MQ Explorer - Content\". This will re-instate your Content pane, and you can then select the \"Queues\" folder and see the list of queues in the Content pane.\n"} +{"text": "### Human: We are using Mule runtime 3.9.0. In our production environment our Mule application connects to WMQ gateway queue manager. WMQ gateway queue manager is configured on 2 nodes (i.e. active/passive). WMQ switches between both nodes where active nodes changes in time.Mule configurations for JMS Connector to WMQ GW: \n \n \n \n \n \n\n \n \nBelow configurations properties are used for the above connection:## MQ GW (for File Adapters)\nmqm.gw.connectionNameList=euukteialmq01uf(11414),euukteialmq02uf(11414)\nmqm.gw.name=QMUAGW01\nmqm.gw.channel=CLIENT.APP.SVRCONNWhen WMQ gateway switch the active node, JMS Connector WebsphereMQConnector_GW_Adapters stops, and we get the below error log:ERROR 2020-10-31 21:31:12,178 [JMSCCThreadPoolWorker-2555] org.mule.exception.DefaultSystemExceptionStrategy:\n********************************************************************************\nMessage : JMSWMQ1107: A problem with this connection has occurred. (com.ibm.msg.client.jms.DetailedJMSException)\nJMS Code : JMSWMQ1107\nElement : /WebsphereMQConnector_GW_Adapters @ app:af_globals.xml:157 (WebsphereMQConnector_GW_Adapters)\n--------------------------------------------------------------------------------\nRoot Exception stack trace:\ncom.ibm.mq.MQException: MQ delivered an asynchronous event with completion code '2', and reason '2009'.\n at com.ibm.msg.client.wmq.internal.WMQConnection.consumer(WMQConnection.java:800)\n at com.ibm.mq.jmqi.remote.api.RemoteHconn.callEventHandler(RemoteHconn.java:3132)\n at com.ibm.mq.jmqi.remote.api.RemoteHconn.driveEventsEH(RemoteHconn.java:658)\n at com.ibm.mq.jmqi.remote.impl.RemoteDispatchThread.processHconn(RemoteDispatchThread.java:666)\n at com.ibm.mq.jmqi.remote.impl.RemoteDispatchThread.run(RemoteDispatchThread.java:223)\n at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.runTask(WorkQueueItem.java:319)\n at com.ibm.msg.client.commonservices.workqueue.SimpleWorkQueueItem.runItem(SimpleWorkQueueItem.java:99)\n at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.run(WorkQueueItem.java:343)\n at com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.runWorkQueueItem(WorkQueueManager.java:312)\n at com.ibm.msg.client.commonservices.j2se.workqueue.WorkQueueManagerImplementation$ThreadPoolWorker.run(WorkQueueManagerImplementation.java:1227)\n\n********************************************************************************I know mule should re-attempt and get a connection back to the gateway WMQ queue manager, but it doesn't. And we are forced to restart production Mule nodes.As per Mule article, this isa known problemand Mule has not fixed this on runtime 3.9.0. Can someone help me with the best way to get this connection working on active-passive WMQ?### Assistant: The Knowledge Base article provides you with the answer. Mule 3.9.0 has the issue. The fix is in 3.9.3+. I strongly recommend to migrate to Mule 3.9.4 as the latest and more stable release of Mule 3. Using 3.9.0 you'll keep finding issues already resolved in later bug fix releases. You can find the list of fixes in each version at the release notes:Mule 3.9.1 release notesMule 3.9.2 release notesMule 3.9.3 release notesMule 3.9.4 release notesAlternatively you can create a support case to ask for a patch for this issue for your version.\n"} +{"text": "### Human: I'm trying to connect to a IBM MQ using .net core (\"IBMMQDotnetClient\" Version=\"9.2.0.1\") with a certificate inside alinuxcontainer (mcr.microsoft.com/dotnet/core/runtime:3.1).Configuration Hashtable:new Hashtable {\n {\n MQC.HOST_NAME_PROPERTY, \"localhost\"\n },\n {\n MQC.CHANNEL_PROPERTY, \"DEV.SVRCONN\"\n },\n {\n MQC.PORT_PROPERTY, 1419\n },\n {\n MQC.SSL_CIPHER_SPEC_PROPERTY, \"TLS_RSA_WITH_AES_128_CBC_SHA\"\n },\n {\n MQC.SSL_CERT_STORE_PROPERTY, \"*USER\"\n }}The tracing reveals this exception:0000702 17:37:10.738499 1.1 KeyStore is *USER\n00000703 17:37:10.738530 1.1 KeyResetCount is 0\n00000704 17:37:10.738543 1.1 CertificationCheck = False\n00000705 17:37:10.738553 1.1 CipherSpec value is TLS_RSA_WITH_AES_128_CBC_SHA\n00000706 17:37:10.738562 1.1 SSLPEERNAME value is\n00000707 17:37:10.738570 1.1 -----------} MQEncryptedSocket.RetrieveAndValidateSSLParams(MQConnectOptions) rc=OK\n00000708 17:37:10.738625 1.1 -----------{ MQEncryptedSocket.MakeSecuredConnection()\n00000709 17:37:10.738653 1.1 Created an instance of SSLStreams\n0000070A 17:37:10.738662 1.1 Setting current certificate store as 'User'\n0000070B 17:37:10.738676 1.1 Linux so use My & CurrentUser\n0000070C 17:37:10.738683 1.1 Created store object to access certificates\n0000070D 17:37:10.738740 1.1 Opened store\n0000070E 17:37:10.738750 1.1 Accessing certificate - ibmwebspheremqroot\n0000070F 17:37:10.748556 1.1 Number of certificates in the store:6\n00000710 17:37:10.748629 1.1 TLS12 supported - True\n00000711 17:37:10.748648 1.1 Setting SslProtol as Tls\n00000712 17:37:10.748655 1.1 Starting SSL Authentication\n00000713 17:37:10.748738 1.1 ------------{ MQEncryptedSocket.FixClientCertificate(Object,String,X509CertificateCollection,X509Certificate,String[])\n00000714 17:37:10.748754 1.1 Client callback has been invoked to find client certificate\n00000715 17:37:10.748766 1.1 ------------} MQEncryptedSocket.FixClientCertificate(Object,String,X509CertificateCollection,X509Certificate,String[]) rc=OK \n00000716 17:37:10.766153 1.1 ------------{ MQEncryptedSocket.ClientValidatingServerCertificate(Object,X509Certificate,X509Chain,SslPolicyErrors) inputs [11]\n00000717 17:37:10.766190 1.1 SSL Server Certificate validation failed - RemoteCertificateNameMismatch, RemoteCertificateChainErrors\n00000718 17:37:10.766196 1.1 ------------} MQEncryptedSocket.ClientValidatingServerCertificate(Object,X509Certificate,X509Chain,SslPolicyErrors) rc=OK\n00000719 17:37:10.766662 1.1 System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.The same code works on WindowsI've installed the root CA that signed the certificate.EDIT 1@Morag Hughson - Regarding the certificates i've installed the organizations root CA, subCA that have signed the IBM MQ cert:COPY ssl/ /usr/local/share/ca-certificates/\nRUN update-ca-certificates --fresh --verboseAlso tried doing it in code:var root = new X509Store(StoreName.Root, StoreLocation.CurrentUser);\nroot.Open(OpenFlags.ReadWrite);\nroot.Add(theAppCert);\ncollection.Add(new X509Certificate2(\"./ssl/root.crt\"));\nroot.AddRange(collection);This is how i add the IBM MQ certificatevar collection = new X509Certificate2Collection();\n\ncollection.Import(File.ReadAllBytes(\"./ssl/key.p12\"), \"123456\", X509KeyStorageFlags.PersistKeySet);\n\nvar store = new X509Store(StoreName.My, StoreLocation.CurrentUser);\n\nvar theAppCert = collection.Find(X509FindType.FindBySubjectName, \"app_test\", false)[0];\nif (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))\n{\n theAppCert.FriendlyName =\"ibmwebspheremq{Environment.UserName.ToLower()}\";\n}\nstore.Open(OpenFlags.ReadWrite);\nstore.Add(theAppCert);EDIT 2Is this sufficient?0000049D 17:51:51.929051 1.1 Data:- IBM.WMQ.MQTCPConnection#02EED1CA\n0000049D 17:51:51.929051 1.1 0x00000000 54 53 48 20 00 00 00 24 02 05 0A 00 00 00 00 00 : TSH ...$......\n0000049D 17:51:51.929051 1.1 0x00000010 00 00 00 00 22 02 00 00 E4 04 00 00 08 00 00 00 : ....\"..?....\n0000049D 17:51:51.929051 1.1 0x00000020 1A 00 00 00 : ...\n0000049E 17:51:51.929066 1.1 Data Length --> 36\n0000049F 17:51:51.929071 1.1 ------------} MQTCPConnection.Receive(ref byte [ ],ref int,ref int) rc=OK\n000004A0 17:51:51.929076 1.1 Bytes Read from Socket = 36\n000004A1 17:51:51.929083 1.1 ------------{ MQTSH.ReadStruct(Byte [ ],int) inputs [System.Byte[]] [0]\n000004A2 17:51:51.929106 1.1 ------------} MQTSH.ReadStruct(Byte [ ],int) rc=OK returns [28]\n000004A3 17:51:51.929120 1.1 ------------{ MQTSH.CheckTSH(byte [ ]) inputs [System.Byte[]]\n000004A4 17:51:51.929127 1.1 ------------} MQTSH.CheckTSH(byte [ ]) rc=OK returns [True]\n000004A5 17:51:51.929134 1.1 ------------{ MQFAPConnection.AnalyseErrorSegment(MQTSH) inputs [IBM.WMQ.MQTSH#039490E2]\n000004A6 17:51:51.929140 1.1 -------------{ MQTSH.GetLength()\n000004A7 17:51:51.929145 1.1 -------------} MQTSH.GetLength() rc=OK returns [28]\n000004A8 17:51:51.929196 1.1 Constructing IBM.WMQ.MQERD#003917F2 MQMBID sn=p920-001-200918 su=_tqsBSQMcEeuBJdh7_yjHsA pn=basedotnet/nmqi/MQERD.cs\n000004A9 17:51:51.929208 1.1 -------------{ MQERD.ReadStruct(Byte [ ],int) inputs [System.Byte[]] [28]\n000004AA 17:51:51.929216 1.1 -------------} MQERD.ReadStruct(Byte [ ],int) rc=OK returns [8]\n000004AB 17:51:51.929231 1.1 New MQException CompCode: 2 Reason: 2059```### Assistant: I managed to get it working by only installing one (CN=app_test) of the three certificates from the .p12 file into my local user store.The file contained:CN=Root CA v2, DC=corp1, DC=ad1, DC=xxx, DC=netCN=Appl Sub CA v2, DC=corp1, DC=ad1, DC=xxx, DC=netCN=app_testIf i install the whole collection of those three certificates i get a failure with the code 2059 from MQ.\n"} +{"text": "### Human: is there a cloud stream ibm qm binder for spring cloud stream?I have seen this onehttps://github.com/spring-cloud/spring-cloud-stream-binder-ibm-mqbut if I understand well, due to license constraints I must manually install the library (which is not possible for me).\nSo it will be nice if there is a cloud stream binder all done we can declare in our pom.xml or build.gradle (like spring-cloud-stream-kafka or spring-cloud-stream-rabbit).it will also be kind if someone can provide a full example of spring cloud stream with ibm qm binderthank you.### Assistant: The Spring Cloud Stream project is currently supporting bindings only for RabbitMQ, Apache Kafka, Kafka Streams, and Amazon Kinesis. Then, there are some binders supported by partners for Google PubSub, Solace Pub/Sub+, Azure Event Hubs, and Apache RocketMQ. More info in theofficial documentation.The binder for IBM MQ that you referenced is not supported anymore, just like other JMS-based systems like ApacheMQ.The project exposes an SPI for implementing custom binders, in case you're interested. More info:Implementing Custom Binders (official docs)How to create a Spring Cloud Stream Binder from scratch (tutorial)\n"} +{"text": "### Human: How do I distinguishMQMT_SYSTEM_FIRSTvsMQMT_REQUEST?### Assistant: MQMT_SYSTEM_FIRSTis a range identifier and will never be used in a real message. If you see the value 1 in an MQMD, italwaysmeansMQMT_REQUEST.So in effect you haveMQMT_SYSTEM_FIRST -> MQMT_SYSTEM_LASTas a reserved range for systemMQMT*values andMQMT_APPL_FIRST -> MQMT_APPL_LASTfor application use.\n"} +{"text": "### Human: I am using Windows 10 (despite MQ reporting it as Windows 8), the user starting the service is part of mqm group and was the same user used to do all the mq administrative work.The FDC error file in the qmgr logs is showing these.+-----------------------------------------------------------------------------+\n| |\n| IBM MQ First Failure Symptom Report |\n| ========================================= |\n| |\n| Date/Time :- Sun October 04 2020 17:57:20 E. Africa Standard Time |\n| UTC Time :- 1601823440.226000 |\n| UTC Time Offset :- 180 ((UNKNOWN)) |\n| Host Name :- |\n| Operating System :- Windows 8 Enterprise x64 Edition, Build 9200 |\n| PIDS :- 5724H7251 |\n| LVLS :- 9.0.0.0 |\n| Product Long Name :- IBM MQ for Windows (x64 platform) |\n| Vendor :- IBM |\n| O/S Registered :- 1 |\n| Data Path :- D:\\Installations\\IBM\\DataFiles\\MQ |\n| Installation Path :- D:\\Installations\\IBM\\MQ |\n| Installation Name :- Installation1 (1) |\n| License Type :- Production |\n| Probe Id :- ZT473001 |\n| Application Name :- MQM |\n| Component :- zutUpdateQMXADLLEntry |\n| SCCS Info :- F:\\build\\slot1\\p900_P\\src\\lib\\zu\\amqzutb0.c, |\n| Line Number :- 4718 |\n| Build Date :- May 12 2016 |\n| Build Level :- p900-L160512.4 |\n| Build Type :- IKAP - (Production) |\n| UserID :- mquser |\n| Process Name :- D:\\Installations\\IBM\\MQ\\bin64\\strmqm.exe |\n| Arguments :- -x -d all IIBQM |\n| Addressing mode :- 64-bit |\n| Process :- 00013196 |\n| Thread :- 00000001 |\n| Session :- 00000001 |\n| QueueManager :- IIBQM |\n| UserApp :- FALSE |\n| Last HQC :- 0.0.0-0 |\n| Last HSHMEMB :- 0.0.0-0 |\n| Last ObjectName :- |\n| Major Errorcode :- xecF_E_UNEXPECTED_SYSTEM_RC |\n| Minor Errorcode :- OK |\n| Probe Type :- MSGAMQ6119 |\n| Probe Severity :- 2 |\n| Probe Description :- AMQ6119: An internal IBM MQ error has occurred (IIBQM) |\n| FDCSequenceNumber :- 0 |\n| Arith1 :- 5 5 |\n| Comment1 :- IIBQM |\n| |\n+-----------------------------------------------------------------------------+### Assistant: The FDC reports that MQ is unable to access somthing (In this case, arith1 == 5 == access denied). The function doing this is trying to update a particular registry key which is outside the MQ tree and which is updated by the MQ installation.It might potentially be caused if you have configured MQ so the user that the service runs under is not in the local mqm group, although that would not be a good thing, so you might want to fix that. To fix that, you would bring up an elevated (ie use the \"run as administrator\", not just one where you are logged in as an administrator) command prompt and issuenet localgroup mqm /ADDOnce you have done this, you might need to reboot the machine for it to be effective. Try restarting the service manually once, and if it doesnt help, try the reboot.I've also seen this problem after a windows update which reset the registry permissions on a key which the MQ installation has previously updated, preventing it being updated when the queue manager starts.When this occurs, depending on the version of MQ you might also get an error message in the global errors log (and possibly the event log) saying:AMQ6509E: Unable to update registry value.EXPLANATION: An attempt was made to update the value of 'WebSphere MQ\nQMgr (myqm)' in registry key\n'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MSDTC\\XADLL' to\n'C:\\mqinstalls\\MQ9120\\bin64\\amqmtsxatm.dll', however a problem was\nencountered when doing so. The system return code was 5. ACTION:\nVerify that the permissions on registry key\n'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MSDTC\\XADLL' allow the\nexecuting user to modify values within it. Executing 'crtmqdir -f -a'\nunder a local computer administrator user account will restore any\nmissing permissions required by MQ.You need to follow the instructions in the error message, ie To fix that, bring up an elevated (ie use the \"run as administrator\", not just one where you are logged in as an administrator) command prompt and issue{path to MQ installation}\\bin64\\crtmqdir -f -aIf your version of MQ does not have such a binary, manually browse in regedit to HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MSDTC\\XADLL and right mouse button on XADLL->permissions and give mqm rights to query and set values for that key.\n"} +{"text": "### Human: I am trying to connect a C++ application (using MQCONNX) based on a PaaS IBM MQ client to two different queue managers, each one based on a different server (one in a PaaS server and the other one in a Unix server). Unfortunately I am not able to do it as I am getting a message when I try to connect to the second server saying that it is not possible as it is connected to the first queue manager. I am using two different MQHCONN connections, one for each queue manager, but the problem is still there.I have taken a look into this link, but I still have some doubts, as for example, from which server should I copy the CCDT to the client?https://www.ibm.com/support/pages/connecting-mq-clients-multiple-queue-managers-client-channel-definition-table-ccdtAny help would be much appreciated, or even a quick sample of how to use CCDT, as right now I am completely stuck.Many thanks in advance for any help.### Assistant: Assuming Queue Manager 1 is calledMQG1and Queue Manager 2 is calledMQG2and these can be found using connection names ofmachine1.com(1701)andmachine2.com(1702)respectively, and using channel namesMQG1.SVRCONNandMQG2.SVRCONNrespectively, you can create your CCDT, on your client application machine, thus:-runmqsc -nissue these commands intorunmqsc:-DEFINE CHANNEL(MQG1.SVRCONN) CHLTYPE(CLNTCONN) CONNAME('machine1.com(1701)') QMNAME(MQG1)\nDEFINE CHANNEL(MQG2.SVRCONN) CHLTYPE(CLNTCONN) CONNAME('machine2.com(1702)') QMNAME(MQG2)Then you can code your 2 xMQCONN(orMQCONNXif you need to specify any additional things on the connection) thus:-#include /* Includes for MQI constants */\n#include /* Convert MQRC into string */\n\nMQHCONN hConn1 = MQHC_UNUSABLE_HCONN;\nMQHCONN hConn2 = MQHC_UNUSABLE_HCONN;\nMQCHAR QMName1[MQ_Q_MGR_NAME_LENGTH] = \"MQG1\";\nMQCHAR QMName2[MQ_Q_MGR_NAME_LENGTH] = \"MQG2\";\nMQLONG CompCode, Reason;\n\nMQCONN(QMName1,\n &hConn1,\n &CompCode,\n &Reason);\nif (CompCode)\n{\n printf(\"MQCONN to %s failed with reason code %s (%d)\\n\", QMName1, MQRC_STR(Reason), Reason); \n}\nMQCONN(QMName2,\n &hConn2,\n &CompCode,\n &Reason);\nif (CompCode)\n{\n printf(\"MQCONN to %s failed with reason code %s (%d)\\n\", QMName2, MQRC_STR(Reason), Reason); \n}Take care with how you are linking your program. If you try to make two local connections, you will get a return code ofMQRC_ANOTHER_Q_MGR_CONNECTED. Ensure you either link with the client library, set connection optionMQCNO_CLIENT(which means you must useMQCONNX) or set the environment variableMQ_CONNECT_TYPE=CLIENT.You might find the following blog post useful additional reading:-IBM MQ Little Gem #30: MQ_CONNECT_TYPE\n"} +{"text": "### Human: We have programmatically created subscriber to IBM MQ AMQP TOPIC withcreateDurableSubscriberby providingclientIdand subscriber name.We start the program so it subscribes to TOPIC and stop the program. Then send the msgs to topic and again start the receiver program again but we cannot receive the msgs sent and loose the messages which should not happen in case of durable subscription..We can see amqp topic and its durable subscription when subscriber is connected using mqsc commandsDISPLAY TOPIC,DISPLAY TPSTATUS,DISPLAY TPSTATUS SUB,DISPLAY SUB SUBIDbut not when subscriber program is stopped. We have defined attributeDEFPSIST(YES)and client(producer to topic) is sending persistent messages.Where are the messages gone as we cannot see messages in durable queues of subscriber? Does it depends on expiry attribute?Output ofDISPLAY SUB SUBIDfor our subscriber when it is connected.AMQ8096: WebSphere MQ subscription inquired.\n\n\nSUBID(\"hex sub id\")\n SUB(:private:CLINET01:TOPIC01) TOPICSTR(TOPIC01)\n TOPICOBJ(SYSTEM.BASE.TOPIC) DISTYPE(RESOLVED)\n DEST(SYSTEM.MANAGED.DURABLE.5F6B5C2524FB9AED)\n DESTQMGR(qm.name) PUBAPPID( )\n SELECTOR( ) SELTYPE(NONE)\n USERDATA(010)\n PUBACCT(***************************************************)\n DESTCORL(***************************************************)\n DESTCLAS(MANAGED) DURABLE(YES)\n EXPIRY(0) PSPROP(MSGPROP)\n PUBPRTY(ASPUB) REQONLY(NO)\n SUBSCOPE(ALL) SUBLEVEL(1)\n SUBTYPE(API) VARUSER(FIXED)\n WSCHEMA(TOPIC) SUBUSER(mqm)\n CRDATE(2020-09-28) CRTIME(04:14:09)\n ALTDATE(2020-09-28) ALTTIME(04:14:09)Subscriber id has private(not sure why) and client id but not subscriber name which is sub4import javax.jms.Connection;\nimport javax.jms.ConnectionFactory;\nimport javax.jms.MessageConsumer;\nimport javax.jms.MessageProducer;\nimport javax.jms.Topic;\nimport javax.jms.Queue;\n\nimport javax.jms.Session;\nimport javax.jms.TextMessage;\nimport java.lang.String;\nimport javax.jms.Destination;\nimport javax.naming.Context;\nimport org.apache.qpid.jms.JmsConnectionFactory;\nimport javax.jms.DeliveryMode;\nimport javax.naming.InitialContext;\nimport javax.jms.Message;\n\npublic class AMQPQueueExample1 implements Runnable {\nprivate static final int DELIVERY_MODE = DeliveryMode.PERSISTENT;\n\npublic void run(){\ntry{\n Connection connection = null;\n Context context = new InitialContext();\n ConnectionFactory connectionFactory = (ConnectionFactory) context.lookup(\"myFactoryLookup\");\n connection = connectionFactory.createConnection();\n connection.setClientID(\"123\");//(\"WHATS_MY_PURPOSE3\"); // Why do we need clientID while publishing the TOPIC from consumer / publisher\n Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);\n Topic priceTopic = (Topic) context.lookup(\"myTopicLookup1\");\n MessageConsumer subscriber1 = session.createDurableSubscriber(priceTopic,\"sub420\"); //\"sub3\");\nSystem.out.println(\"TOPIC \"+priceTopic);\n\nconnection.start();\nwhile(true){\nTextMessage message1 = (TextMessage) subscriber1.receive(1000);\nif(message1!=null)\n System.out.println(\"Subscriber 1 received : \" + message1.getText());\n\n\n}\n}catch(Exception e){\ne.printStackTrace();\n}\n}\n\n public static void main(String[] args) {\n\nAMQPQueueExample1 amp=new AMQPQueueExample1();\n Thread thread = new Thread(amp);\nthread.start();\n\n\n }\n}Values are taken from jndi.properties file for context factory and provider url.### Assistant: It looks from the comments like you're using MQ 8.0.0.5? If that's the case then Apache Qpid JMS clients aren't supported with that version of MQ. I believe with that version a very basic non-durable subscribemightwork, but any other JMS methods are unlikely to.I suspect what is happening is the AMQP 1.0 flows from Qpid JMS aren't fully understood by that version of MQ, so the expiry of the subscription is being set to 0 rather than unlimited.MQ 9.2 added support for more of the JMS 2.0 spec - although not every JMS feature. There is more information about the methods which are supported here:https://www.ibm.com/support/knowledgecenter/SSFKSJ_9.2.0/com.ibm.mq.dev.doc/q125050_.htmCreating durable subscribers and/or consumers should work as you expect.\n"} +{"text": "### Human: We are trying to connect to IBM MQ from a Java client. We have generated.bindingsfor JNDI context using the JMSAdmin utility. When connecting to IBM MQ we are getting following exception:ERR fmbaJMS JMSException: JMSWMQ0018: Failed to connect to queue manager '' with connection mode 'Client' and host name 'null'Host name parameter sent is null while.bindingsfile correctly havemq/RefAddr/30/Content=localhost(51410)\nmq/RefAddr/30/Type=CRSHOSTSEntries pointing to localhost and port 51410.### Assistant: Your .bindings file does not look right. What was the JMSAdmin command you used to create it?MQ0018: Failed to connect to queue manager 'bt.qm.ccxp0'Is that your queue manager name or QCF? Note: As per the IBM Best Practises, queue manager names should be in uppercase.To define a QCF (Queue Connection Factory), you would do:DEFINE QCF(myQCF) QMANAGER(MQA1) CHANNEL(TEST.CHL) HOSTNAME(127.0.0.1) PORT(1414) TRANSPORT(CLIENT) FAILIFQUIESCE(YES)To define a JMS queue, you would do:DEFINE Q(mqs.dev.test.q) QUEUE(TEST.Q1) QMANAGER(MQA1) TARGCLIENT(JMS) FAILIFQUIESCE(YES)Then in your code, you would do the following to load the objects from the MQ JNDI:Hashtable env = new Hashtable();\nenv.put(Context.INITIAL_CONTEXT_FACTORY, \"com.sun.jndi.fscontext.RefFSContextFactory\");\nenv.put(Context.PROVIDER_URL, \"file:/C:/JNDI-Directory\");\n\nContext ctx = new InitialContext(env);\n\nQueueConnectionFactory cf = (QueueConnectionFactory) ctx.lookup(\"myQCF\");\nQueue q = (Queue) ctx.lookup(\"mqs.dev.test.q\");\n"} +{"text": "### Human: I'm using IBM-MQ, and I want to get the number of subscribers for a specific topic using PCFMessageMQQueueManager qmgr = null;\n PCFMessageAgent agent = null;\n \n Hashtable hashtable = new Hashtable();\n hashtable.put(MQConstants.HOST_NAME_PROPERTY,\"HOST NAME\");\n hashtable.put(MQConstants.PORT_PROPERTY,1414);\n hashtable.put(MQConstants.CHANNEL_PROPERTY,\"CHANNEL NAME\");\n hashtable.put(MQConstants.USER_ID_PROPERTY, \"USER_ID\");\n hashtable.put(MQConstants.PASSWORD_PROPERTY, \"PASSWORD\");\n \n agent = new PCFMessageAgent(qmgr);\n PCFMessage request = new PCFMessage(MQConstants.MQCMD_INQUIRE_TOPIC_STATUS);\n request.addParameter(MQConstants.MQCA_TOPIC_STRING, groupTopic);The result for this isMQCFH (com.ibm.mq.headers.internal.store.ByteStore [encoding: 0x00000001, ccsid: 1208, size: 36] @813045649)\n MQLONG Type: 2 (0x00000002)\n MQLONG StrucLength: 36 (0x00000024)\n MQLONG Version: 3 (0x00000003)\n MQLONG Command: 183 (0x000000b7)\n MQLONG MsgSeqNumber: 1 (0x00000001)\n MQLONG Control: 1 (0x00000001)\n MQLONG CompCode: 0 (0x00000000)\n MQLONG Reason: 0 (0x00000000)\n MQLONG ParameterCount: 22 (0x00000016)\nMQCFST (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])\n MQLONG Type: 4 (0x00000004)\n MQLONG StrucLength: 40 (0x00000028)\n MQLONG Parameter: 2094 (MQCA_TOPIC_STRING)\n MQLONG CodedCharSetId: 1208 (0x000004b8)\n MQLONG StringLength: 19 (0x00000013)\n MQCHAR[] String: \"{grouplist}\"\nMQCFST (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])\n MQLONG Type: 4 (0x00000004)\n MQLONG StrucLength: 68 (0x00000044)\n MQLONG Parameter: 2105 (MQCA_ADMIN_TOPIC_NAME)\n MQLONG CodedCharSetId: 1208 (0x000004b8)\n MQLONG StringLength: 48 (0x00000030)\n MQCHAR[] String: \" \"\nMQCFST (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])\n MQLONG Type: 4 (0x00000004)\n MQLONG StrucLength: 20 (0x00000014)\n MQLONG Parameter: 2029 (MQCA_CLUSTER_NAME)\n MQLONG CodedCharSetId: 1208 (0x000004b8)\n MQLONG StringLength: 0 (0x00000000)\n MQCHAR[] String: \"\"\nMQCFST (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])\n MQLONG Type: 4 (0x00000004)\n MQLONG StrucLength: 68 (0x00000044)\n MQLONG Parameter: 2110 (MQCA_COMM_INFO_NAME)\n MQLONG CodedCharSetId: 1208 (0x000004b8)\n MQLONG StringLength: 48 (0x00000030)\n MQCHAR[] String: \"SYSTEM.DEFAULT.COMMINFO.MULTICAST \"\nMQCFST (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])\n MQLONG Type: 4 (0x00000004)\n MQLONG StrucLength: 68 (0x00000044)\n MQLONG Parameter: 2096 (MQCA_MODEL_DURABLE_Q)\n MQLONG CodedCharSetId: 1208 (0x000004b8)\n MQLONG StringLength: 48 (0x00000030)\n MQCHAR[] String: \"SYSTEM.DURABLE.MODEL.QUEUE \"\nMQCFST (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])\n MQLONG Type: 4 (0x00000004)\n MQLONG StrucLength: 68 (0x00000044)\n MQLONG Parameter: 2097 (MQCA_MODEL_NON_DURABLE_Q)\n MQLONG CodedCharSetId: 1208 (0x000004b8)\n MQLONG StringLength: 48 (0x00000030)\n MQCHAR[] String: \"SYSTEM.NDURABLE.MODEL.QUEUE \"\nMQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])\n MQLONG Type: 3 (0x00000003)\n MQLONG StrucLength: 16 (0x00000010)\n MQLONG Parameter: 255 (MQIA_CLUSTER_PUB_ROUTE)\n MQLONG Value: 2 (0x00000002)\nMQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])\n MQLONG Type: 3 (0x00000003)\n MQLONG StrucLength: 16 (0x00000010)\n MQLONG Parameter: 185 (MQIA_TOPIC_DEF_PERSISTENCE)\n MQLONG Value: 0 (0x00000000)\nMQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])\n MQLONG Type: 3 (0x00000003)\n MQLONG StrucLength: 16 (0x00000010)\n MQLONG Parameter: 6 (MQIA_DEF_PRIORITY)\n MQLONG Value: 0 (0x00000000)\nMQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])\n MQLONG Type: 3 (0x00000003)\n MQLONG StrucLength: 16 (0x00000010)\n MQLONG Parameter: 184 (MQIA_DEF_PUT_RESPONSE_TYPE)\n MQLONG Value: 1 (0x00000001)\nMQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])\n MQLONG Type: 3 (0x00000003)\n MQLONG StrucLength: 16 (0x00000010)\n MQLONG Parameter: 175 (MQIA_DURABLE_SUB)\n MQLONG Value: 1 (0x00000001)\nMQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])\n MQLONG Type: 3 (0x00000003)\n MQLONG StrucLength: 16 (0x00000010)\n MQLONG Parameter: 181 (MQIA_INHIBIT_PUB)\n MQLONG Value: 2 (0x00000002)\nMQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])\n MQLONG Type: 3 (0x00000003)\n MQLONG StrucLength: 16 (0x00000010)\n MQLONG Parameter: 182 (MQIA_INHIBIT_SUB)\n MQLONG Value: 2 (0x00000002)\nMQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])\n MQLONG Type: 3 (0x00000003)\n MQLONG StrucLength: 16 (0x00000010)\n MQLONG Parameter: 195 (MQIA_PM_DELIVERY)\n MQLONG Value: 2 (0x00000002)\nMQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])\n MQLONG Type: 3 (0x00000003)\n MQLONG StrucLength: 16 (0x00000010)\n MQLONG Parameter: 196 (MQIA_NPM_DELIVERY)\n MQLONG Value: 3 (0x00000003)\nMQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])\n MQLONG Type: 3 (0x00000003)\n MQLONG StrucLength: 16 (0x00000010)\n MQLONG Parameter: 1300 (MQIACF_RETAINED_PUBLICATION)\n MQLONG Value: 0 (0x00000000)\nMQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])\n MQLONG Type: 3 (0x00000003)\n MQLONG StrucLength: 16 (0x00000010)\n MQLONG Parameter: 176 (MQIA_MULTICAST)\n MQLONG Value: 2 (0x00000002)\nMQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])\n MQLONG Type: 3 (0x00000003)\n MQLONG StrucLength: 16 (0x00000010)\n MQLONG Parameter: 215 (MQIA_PUB_COUNT)\n MQLONG Value: 1 (0x00000001)\nMQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])\n MQLONG Type: 3 (0x00000003)\n MQLONG StrucLength: 16 (0x00000010)\n MQLONG Parameter: 204 (MQIA_SUB_COUNT)\n MQLONG Value: 48 (0x00000030)\nMQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])\n MQLONG Type: 3 (0x00000003)\n MQLONG StrucLength: 16 (0x00000010)\n MQLONG Parameter: 219 (MQIA_PUB_SCOPE)\n MQLONG Value: 0 (0x00000000)\nMQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])\n MQLONG Type: 3 (0x00000003)\n MQLONG StrucLength: 16 (0x00000010)\n MQLONG Parameter: 218 (MQIA_SUB_SCOPE)\n MQLONG Value: 0 (0x00000000)\nMQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])\n MQLONG Type: 3 (0x00000003)\n MQLONG StrucLength: 16 (0x00000010)\n MQLONG Parameter: 234 (MQIA_USE_DEAD_LETTER_Q)\n MQLONG Value: 2 (0x00000002)What I'm expecting is to get the number of users Susbscribed to groupTopic via the code above.\nBut the value of MQConstants.MQIA_SUB_COUNT is\nIt is always fixed at 48. I am wondering if I am using PCFMessage incorrectly or if there is another way to get the number of Subscribers for Topic.### Assistant: Like Mark said in his comment, you should do the MQSC commandDISPLAY TPSTATUS(xxxx) TYPE(TOPIC). I prefer to explicitly set PCF parameters so that I know what will be returned.Coding for the PCF command of MQCMD_INQUIRE_TOPIC_STATUS, follow the rules in theMQ KnowLedge Center:Hence, the code would be:request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_TOPIC_STATUS); \nrequest.addParameter(CMQC.MQCA_TOPIC_STRING, groupTopic);\nrequest.addParameter(CMQCFC.MQIACF_TOPIC_STATUS_TYPE, CMQCFC.MQIACF_TOPIC_STATUS);\nrequest.addParameter(CMQCFC.MQIACF_TOPIC_STATUS_ATTRS, new int [] { CMQCFC.MQIACF_ALL });\n\nresponses = agent.send(request);\n\nfor (int i = 0; i < responses.length; i++)\n{\n // Make sure that each response is ok\n if ((responses[i]).getCompCode() == CMQC.MQCC_OK)\n {\n topicStr = responses[i].getStringParameterValue(CMQC.MQCA_TOPIC_STRING);\n topicName= responses[i].getStringParameterValue(CMQC.MQCA_ADMIN_TOPIC_NAME);\n durable = responses[i].getIntParameterValue(CMQC.MQIA_DURABLE_SUB);\n persist = responses[i].getIntParameterValue(CMQC.MQIA_TOPIC_DEF_PERSISTENCE);\n inh_Pub = responses[i].getIntParameterValue(CMQC.MQIA_INHIBIT_PUB);\n inh_Sub = responses[i].getIntParameterValue(CMQC.MQIA_INHIBIT_SUB);\n pubCount = responses[i].getIntParameterValue(CMQC.MQIA_PUB_COUNT);\n subCount = responses[i].getIntParameterValue(CMQC.MQIA_SUB_COUNT);\n }\n}So, the above PCF code is equivalent to the following MQSC command:DISPLAY TPSTATUS(xxxx) TYPE(TOPIC) ALL\n"} +{"text": "### Human: I have written below code to read more than one messages in IBM MQcom.ibm.mq.MQQueue defaultLocalQueue;\n MQQueueManager qManager=null;\n \n MQEnvironment.hostname = \"reese.int.westgroup.com\";\n MQEnvironment.channel = \"CLIENTCONNECTION\";\n MQEnvironment.port = 1414;\n String qMngrStr = \"\";\n qManager = new MQQueueManager(qMngrStr); \n int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT | MQC.MQOO_INQUIRE ; \n String queueName=\"COMSERV.SRCHEXT.EVENTS.PUBLISH.QA.Q01\";\n System.out.println(\"accessing::\"+queueName);\n defaultLocalQueue = qManager.accessQueue(queueName, openOptions);\n //set transport properties.\n System.out.println(\"set MQ props\");\n MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);\n System.out.println(\"new Queuemanager\");\n ArrayList msg = new ArrayList();\n //MQMessage putMessage = new MQMessage();\n //String msg = \"hello\";\n // putMessage.writeUTF(msg);\n \n //specify the message options...\n // MQPutMessageOptions pmo = new MQPutMessageOptions(); \n // accept \n // put the message on the queue\n //defaultLocalQueue.put(putMessage, pmo);\n boolean getMore = true;\n while(getMore)\n { \n MQMessage getMessages= new MQMessage();\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.options=MQC.MQGMO_WAIT;\n gmo.waitInterval=1000000;\n //gmo.wait(100000);\n\n System.out.println(\"get messages::\"+gmo.toString());\n defaultLocalQueue.get(getMessages, gmo);\n \n msg.add(getMessages);\n int length=getMessages.getMessageLength();\n System.out.println(\"length::\"+length);\n String retrievedMsg = getMessages.readStringOfCharLength(length);\n System.out.println(\"Message got from MQ: \"+retrievedMsg);\n \n }\n if(defaultLocalQueue.getCurrentDepth()==0)\n {\n getMore=false;\n }\n for (MQMessage message : msg)\n {\n System.out.println(\"message::\"+message);\n \n }\n }The lineString retrievedMsg = getMessages.readStringOfCharLength(length);is causing an EOF exception even though the messages are there in MQ and length of the message is also printing 3760.Below is the complete stack trace of the exception.length::3760\n\n java.io.EOFException: MQJE086: End of file exception ('MQMessage.readChar()').\n at com.ibm.mq.MQMessage.readChar(MQMessage.java:908)\n at com.ibm.mq.MQMessage.readStringOfCharLength(MQMessage.java:1232)\n at com.tlr.searchextract.messages.MessageTrigger_ABean.init(MessageTrigger_ABean.java:109)\n at com.tlr.searchextract.servlet.SEControllerServlet.insertRequestTemplate(SEControllerServlet.java:1385)\n at com.tlr.searchextract.servlet.SEControllerServlet.performTask(SEControllerServlet.java:2055)\n at com.tlr.searchextract.servlet.SEControllerServlet.doPost(SEControllerServlet.java:117)\n at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)\n at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)\n at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)\n at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:203)\n at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)\n at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)\n at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)\n at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)\n at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)\n at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)\n at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)\n at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)\n at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)\n at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)\n at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)\n at java.lang.Thread.run(Thread.java:748)Please help me with this.### Assistant: From the MQMessage in theMQ KnowLedge Center:getMessageLength() Gets the number of bytes of message data in this\nmessage.So, one method deals in bytes then you use readStringOfCharLength method which deals in characters.FYI: byte length != character lengthYou should be using readStringOfByteLength method.i.e.int length=getMessages.getMessageLength();\nString retrievedMsg = getMessages.readStringOfByteLength(length);Updated: August 19, 2020.If MQ cannot convert the message to a string then you can get it as a byte array and have the JVM attempt to convert it to a string.int length=getMessages.getMessageLength();\nbyte[] bMsg = new byte[length];\ngetMessages.readFully(bMsg);\nString retrievedMsg = new String(bMsg);\n"} +{"text": "### Human: I am trying to create a new Queue Manager in Websphere but it does not give me a 'new option'. I only have Websphere MQ Explorer installed, how do I get the server?### Assistant: The IBM MQ Explorer is a remote administration only package which you install and configure it to point to remote queue managers to administer. It does the administration via client channels to the queue manager listeners. It does not understand how to connect to a remote machine, like ssh etc, just a remote queue manager - hence there is no way to create a queue manager on a remote machine.If you install the MQ Explorer as a component of a server install, as part of an installation which includes the server component, then it is possible for the MQ Explorer to create new queue managers but only on the same box that MQ Explorer is running (ie locally on your box).So to answer your question, if you only have the explorer installed you have probably installed it from:https://www.ibm.com/support/pages/ms0t-ibm-mq-explorerIf you want to create servers from within MQ Explorer, you need to install if from the main server product as a component, so need a new installation package. The IBM MQ Advanced for Developers for example, which is freely available for developer only (ie non production only... for production use you would need to obtain licensed media):https://www.ibm.com/support/knowledgecenter/SSFKSJ/com.ibm.mq.helphome.doc/mq_downloads_admins.htm\n"} +{"text": "### Human: I have started exploring MQ series and I noticed Sender channel in RETRYING status after SHORTRTR are exhausted. I have also noticed client applications couldn't connect to MQ when Sender channel was in RETRYING status.Is my understanding correct that client applications can't connect to MQ if Sender channel is in RETRYING status?What happens client start connection with MQ and Sender channel is not RUNNING?Does Sender channel status matter when client is initializing MQ connection?### Assistant: The ability for a client application to connect is almost entirely unrelated to the state of a sender channel. (I say almost because theoretically you could use up all the resources in your queue manager by having loads of retrying senders and then maybe they could affect clients).When a client application makes a connection to a queue manager, the network connection is first caught by the listener, and then a running channel of type SVRCONN is started. This is a different type from a SENDER channel, and so there is no requirement to have a SENDER channel running for the client connection to be successful.Sender channel status does not matter for the client to be able to connect.Lets' try to diagnose your two problems. Look in the queue manager AMQERR01.LOG (found in the data directory under\\Qmgrs\\\\errors) and edit your question to add the errors you see in there. There should be errors that explain why the sender channel is retrying, and some to explain why the client cannot connect.It is possible that the problem with the client not being able to connect is because it is not even reaching the queue manager machine - in which case there will be nothing about that in the queue manager error log. In this case, you should also look in the AMQERR01.LOG on the client machine, this time in the data directory just under the errors folder (as no queue manager name there). You should also have seen some sort of error message or MQRC Reason code from the client application - you should tell us that too.\n"} +{"text": "### Human: ---\n- hosts: all\n become_user: mqm\n become_method: sudo\n tasks:\n - name: Execute a MQ Command\n shell: \n cmd: \"echo 'DISPLAY LSSTATUS(TCP) STATUS' | runmqsc QMGR\"\n chdir: /opt/mqm/bin/runmqsc\n register: mqstat\n\n - debug: \n var: mqstat.stdout_lines**Error: **TASK [Execute a MQ Command] ****************************************************************************************************************************************\nfatal: [QMGR]: FAILED! => {\"changed\": false, \"module_stderr\": \"Shared connection to xyz.pqr.com closed.\\r\\n\", \"module_stdout\": \"Traceback (most recent call last):\\r\\n File \\\"/tmp/ansible_UASQnG/ansible_module_command.py\\\", line 213, in \\r\\n main()\\r\\n File \\\"/tmp/ansible_UASQnG/ansible_module_command.py\\\", line 152, in main\\r\\n os.chdir(chdir)\\r\\nOSError: [Errno 20] Not a directory: '/opt/mqm/bin/runmqsc'\\r\\n\", \"msg\": \"MODULE FAILURE\", \"rc\": 0}### Assistant: chdir: /opt/mqm/bin/runmqscIf this is supposed to be the directory to execute the command in, runmqsc is not a directory name so isnt it supposed to be simply chdir: /opt/mqm/bin. In addition from the comments, remember that if you pipe to runmqsc, then runmqsc has to be on the path. If it is not, then you need to fully qualify it, meaning try:shell: \n cmd: \"echo 'DISPLAY LSSTATUS(TCP) STATUS' | ./runmqsc QMGR\"\n chdir: /opt/mqm/binorshell: \n cmd: \"echo 'DISPLAY LSSTATUS(TCP) STATUS' | /opt/mqm/bin/runmqsc QMGR\"\n chdir: /opt/mqm/bin\n"} +{"text": "### Human: I'm trying to access a queue.def mqProps = new Hashtable()\nmqProps.put(MQConstants.CHANNEL_PROPERTY, 'CHANNEL')\nmqProps.put(MQConstants.PORT_PROPERTY, PORT)\nmqProps.put(MQConstants.HOST_NAME_PROPERTY, 'HOST')\nmqProps.put(MQConstants.USER_ID_PROPERTY, 'myuser') // is it the correct property for the user? \nmqProps.put(MQConstants.PASSWORD_PROPERTY, 'mypassword') // is it the correct property for the password?\n\ndef qMgr = new MQQueueManager('QM', mqProps)However I'm facing the following errorjavax.script.ScriptException: com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2538'\n...\nCaused by: com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2538'.\n...\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2538;AMQ9204: Connection to host 'HOST(PORT)' rejected.\n...\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2538;AMQ9204: Connection to host 'HOST/address:PORT' rejected.\n...\nCaused by: java.net.ConnectException: Connection timed out: connect\n...The error happened on the line:def qMgr = new MQQueueManager('QM', mqProps)Can you please explain me reason of this issue? Thank you a lot.### Assistant: Reason Code 2538 isMQRC_HOST_NOT_AVAILABLE.You can quickly discover this by using themqrccommand line tool that comes with IBM MQ. Type:mqrc 2538and you will be told:2538 0x000009ea MQRC_HOST_NOT_AVAILABLEAlternatively you can look it up in the IBM MQ Knowledge Center.Reading the explanation in Knowledge Center will show you a number of common possibilities for the problem.The listener has not been started on the remote system.The connection name in the client channel definition is incorrect.The network is currently unavailable.A firewall blocking the port, or protocol-specific trafficPerhaps the most common of errors is that the listener running at the queue manager is not using the same port number that you have put in the client application connection details.You haven't shown us in your question any details about the listener running on the queue manager, so we will have to leave that for you to check yourself.\n"} +{"text": "### Human: I need to create a message with RFH2 header and inject it in IBM MQ. Please find below how the message is created.def message = new MQMessage()\ndef rfh2 = new MQRFH2()\nrfh2.setEncoding(CMQC.MQENC_NATIVE)\nrfh2.setCodedCharSetId(CMQC.MQCCSI_INHERIT)\nrfh2.setFormat(\" \")\nrfh2.setNameValueCCSID(1208)\nrfh2.setFieldValue('mcd', 'Msd', 'jms_byte')\nrfh2.setFieldValue('jms', 'Dst', 'queue:///myqueue')\nrfh2.setFieldValue('jms', 'Pri', 0)\nrfh2.setFieldValue('usr', 'Sender', 'mysender')\nrfh2.write(message)\n\nmessage.writeString('''${msgText}''')However, it seems that header content is not put in the header but before the message. Please find below an example:Server logs with message sent with MQ Visual EditHeader2020-04-21 11:07:59.913 DEBUG 48093 --- [DefaultMessageListenerContainer-2] \n c.b.i.c.listeners.AbstractAgiListener : Receive message on MQ with header : {someargs, \n jms_destination=queue:///myqueue, someargs, Sender=mysender, someargs, jms_type=mcd://jms_byte,\n someargs}Message...Server logs with message sent with above codeHeader2020-04-21 11:07:59.913 DEBUG 48093 --- [DefaultMessageListenerContainer-2] \n c.b.i.c.listeners.AbstractAgiListener : Receive message on MQ with header : {someargs}MessageRFH \u00a8\u00ff\u00ff\u00ff\u00fe \u00b8 jms_bytes 8queue:///myqueue\n0 mysender...Any idea how to solve it please? Thank you.Update 1Even with the below code, information are still present before the messagedef message = new MQMessage()\ndef rfh2 = new MQRFH2()\nrfh2.setEncoding(CMQC.MQENC_NATIVE)\nrfh2.setCodedCharSetId(CMQC.MQCCSI_INHERIT)\nrfh2.setFormat(CMQC.MQFMT_NONE)\nrfh2.setNameValueCCSID(1208)\nrfh2.setFieldValue('mcd', 'Msd', 'jms_byte')\nrfh2.setFieldValue('usr', 'Sender', 'mysender')\nrfh2.write(message)### Assistant: rfh2.setFormat(\"RHF2\")That is not valid.rfh2.setFormat(CMQC.MQFMT_NONE)That says the message payload has no type. i.e. It is not string or another internal is not found after this RFH2 structure.Like MQ Visual Edit do?Yes, MQ Visual Edit uses the MQRFH2 class but you need to understand that it is up to the programmer to code the correct MQMD.Format value.Did you set the message's MQMD.Format to MQFMT_RF_HEADER_2:msg.format = CMQC.MQFMT_RF_HEADER_2;I have posted a lot of fully functioning Java (non-JMS) programs that create a MQRFH2 (aka JMS) message both here on StackOverflow and on my blog.You can search MQRFH2 with my name to find them here.Here's one that describes how MQ Visual Edit handles displaying named properties vs raw MQRFH2 message.https://www.capitalware.com/rl_blog/?p=4786Here is one that shows how to create a JMS (MQRFH2) message in non-JMS Java application:https://www.capitalware.com/rl_blog/?p=4823And finally, one that shows to handle an incoming JMS (MQRFH2) Message in non-JMS Java application:https://www.capitalware.com/rl_blog/?p=4811\n"} +{"text": "### Human: I'm trying to create IBM MQ subs via command line on a linux installation and I get:AMQ8135: Not authorized.My logs show:AMQ8009: Entity '' has insufficient authority to access topic string 'WW/XX/YY'.\nEXPLANATION: The specified entity is not authorized to access the required topic.\nThe following permissions were requested: altusr/ctrlIt looks like the command line isn't getting the entity value from where ever it was trying to find, not sure where that is!But the confusing part is that creating of other mq objects(queues/topics) work just fine on command line and even the create subs works from MO71 and failing on cmd.File permission look good and env variable also looked fine to me unless!cmd- DEFINE SUB('ABC.1') TOPICSTR('xx/yy/zz') DEST('lq.abc')Anyone one ran into such/fixed such issue?### Assistant: In order to successfully run aDEFINE SUBcommand, the user ID that you are running it with requires the following authorities (you can work these out from looking at the whole of theAMQ8009message in yourAMQERR01.LOG, specifically the EXPLANATION: section).ctrlon the nearest administrative topic objectputon the named destination queueAlso readIBM Knowledge Center: Authorizations for commandsIBM Knowledge Center: MQSUB - Usage Notes(for authority for output -put- needed for subscription)As an example, let's assume:-TOPIC(XYZ)is defined withTOPICSTR('xx/yy/zz')QUEUE(LQ.ABC)existsThe non-privileged user ID running the command is a member of the groupmqgemadmThen you need to set the following two privileges (over and above whatever you might have already set for this group in order to be able to issue commands in general):-SET AUTHREC PROFILE(XYZ) OBJTYPE(TOPIC) GROUP('mqgemadm') AUTHADD(ctrl)\nSET AUTHREC PROFILE(LQ.ABC) OBJTYPE(QUEUE) GROUP('mqgemadm') AUTHADD(put)If you believe that your user id already has these permissions and the reason it is failing is because the user id is not making it to the command, you could try adding theSUBUSERfield to the command.DEFINE SUB('ABC.1') TOPICSTR('xx/yy/zz') DEST(LQ.ABC) SUBUSER('mqgemusr')If this works, but withoutSUBUSERstill fails, suggest you report the defect to IBM via a PMR/support case.\n"} +{"text": "### Human: We have to create a responder application as a windows service which will take messages off the queue, acknowledge the sender that we received them and that they are validated by sending a response back within 5 seconds. After we get another acknowledgement from the sender that we are okay to process the message, we process the message and send the result of that request back to them within another (5 sec). If at any point in that cycle either they or we do not get the message off the queue and respond within the time allotted the message will expire and we will need to re-try the message.What we are having trouble with determining when messages will expire and need to be re-sent. I've been reading about putting them on the dead-letterqueue, but I'm unsure that the purpose of it matches what we need. The dead-letter queue is not for items which just timeout, but failed in transmission. I've also read about using theReportoption on the MQMessage itself to generate a report and possibly move it to a different queue which can be monitored. We'd then need to re-try the items that are on the new queue.Are those my only two options if I need to monitor every incoming and outgoing message to ensure that we get a response from the other MQ server we are communicating with?### Assistant: I'd do it with message expiry and activity reporting in MQ, but that doesn't make it unnecessary for your applications to have a log of what they sent and received.On every message you send, you could set an expiry time (meaning that the message will be discarded, if it is removed from the queue outside of that time frame). And by also setting the reporting option for getting reports when the message is discarded, the sender of the message (actually you can specify any queue for the reports not just one monitored by the sender) will get a report message identifying the discarded message, which can then be resent.However the discarded message won't be put to any queue, the sending application needs to be able to resend the message from scratch.And the processing side, when it's waiting on the 2nd message, it will need to have it's own \"timer\" for handling timeouts.https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.1.0/com.ibm.mq.ref.dev.doc/q097490_.htmhttps://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.1.0/com.ibm.mq.mon.doc/q036600_.htmAll that said, it seems to me that you are not using MQ as intended and are trying to mimic a synchronous communication. MQ can gurantee exactly once delivery, so I'd say that if you have a properly configured and sized MQ route between your applications and properly set up message monitoring, then all this ack/nack is unnecessary.\n"} +{"text": "### Human: I have a java application running on WebSphere 8.5.5.12 server. I connect to other applications via MQ. I have faced a performance issue with the application and found that whenever the MQ reply is getting timeout, the Queue connection was not closed properly. I have fixed the issue. I am planning to increase the Maximum connection for the particular Queue Connection factory and i want to get the number of connection used/opened in the Queue Connection Factory via code, so that i can increase the maximum connections accordingly based on the traffic/volume. Any leads would be much helpful.### Assistant: To learn the number of connections used and the number of queues opened by an application, you can use the MQSC DISPLAY CONN command like this:-DISPLAY CONN(*) TYPE(ALL) ALL WHERE(OBJNAME EQ reply-q-name)This will show you all the connections and all the open handles.You can also discover exactly the same data using a programatic interface called PCF commands, although given how many excellent MQ admin tools there are out there, I'm not sure why you would need to do this \"via code\" as you put it?\n"} +{"text": "### Human: We have a requirement to reply to a response queue with the same message from request queue after processing the payload. I am facing issue while trying to write string to incoming message. The processing message is getting appended to existing payload. Here is the code snippet I am usingpublic void readFromQueue(String reqQueue, String queueMgrName) {\n int depth = 0;\n MQQueueManager queueMgr = null;\n MQQueue queue = null;\n MQHeaderList headerList = null;\n try {\n queueMgr = getQueueManager(); //queue manager is initiated\n queue = getQueue(\"get\", queueMgr); // queue is intiated\n MQGetMessageOptions getOptions = new MQGetMessageOptions(); // Message GET options\n getOptions.options = MQConstants.MQGMO_WAIT + MQConstants.MQGMO_FAIL_IF_QUIESCING + \n MQConstants.MQGMO_COMPLETE_MSG + \n MQConstants.MQGMO_PROPERTIES_FORCE_MQRFH2;\n byte[] b = null;\n while (true) {\n try {\n message = new MQMessage();\n queue.get(message, getOptions);\n headerList = new MQHeaderList(message, true);\n processMessage(headerList, message);\n } catch (Exception e) {\n System.out.println(e.getMessage());\n } \n }\n}\n\npublic void processMessage(MQHeaderList headerList, MQMessage message) {\n String receivedRequest = headerList.getBody().toString();\n /* ---- Message processing logic here ---- */\n message.writeString(outMessage);\n writeToQueue(message);\n} \npublic void writeToQueue (MQMessage putMsg)\n throws MQDataException, ConfigurationException { \n MQQueueManager queueMgr = null;\n MQQueue queue = null;\n try {\n queueMgr = getQueueManager();\n queue = getQueue(\"put\", queueMgr);\n MQPutMessageOptions pmo = new MQPutMessageOptions();\n queue.put(putMsg, pmo);\n queueMgr.commit();\n }\n catch (Exception mqex) {\n System.out.println(mqex);\n } \n}Example payload message:{\n Msg:{\n MsgHeader: {\n headerKey1: headerValue1,\n headerKey2: headerValue2\n },\n MsgBody: {\n bodyKey1: bodyValue1,\n bodyKey2: bodyValue2\n }\n}Expected payload in response message:{\n Msg:{\n MsgHeader: {\n headerKey1: headerValue1,\n headerKey2: headerValue2\n },\n MsgBody: {\n newBodyKey1: newBodyValue1,\n newBodyKey2: newBodyValue2,\n }\n}Acutal payload in the response message: (Appended to actual payload instead of replacing it){\n Msg:{\n MsgHeader: {\n headerKey1: headerValue1,\n headerKey2: headerValue2\n },\n MsgBody: {\n bodyKey1: bodyValue1,\n bodyKey2: bodyValue2\n }\n}\n{\n Msg:{\n MsgHeader: {\n headerKey1: headerValue1,\n headerKey2: headerValue2\n },\n MsgBody: {\n newBodyKey1: newBodyValue1,\n newBodyKey2: newBodyValue2,\n }\n}Please help me to resolve this issue### Assistant: I don't understand why you are using the MQHeaderList class. How many MQ internal headers are in your original request message?Also, are you trying to put MQMessage objects in a JSON object because your description is very confusing.It sounds like your request message layout is:{RFH2 header}{mcd folder}{jms folder}{usr folder}{message payload}And you want the reply message to be:{RFH2 header}{mcd folder}{jms folder}{usr folder}{updated message payload}where the RFH2 header, mcd folder, jms folder and usr folder contain the original values of the request message.If this is what your are trying to do then have a look at another blogpostingand see if it matches what you are trying to do.Updated: Feb. 3, 2020.To get the message payload from the request message, simply do the following:String msgStr = null;\nif (CMQC.MQFMT_STRING.equals(rfh2.getFormat()))\n{\n msgStr = requestMsg.readStringOfByteLength(requestMsg.getDataLength());\n}\nelse\n{\n byte[] b = new byte[requestMsg.getDataLength()];\n requestMsg.readFully(b);\n msgStr = new String(b);\n}\n"} +{"text": "### Human: I want to install a re-distributable managed file transfer agent in a Linux machine \nwhich in turn will transfer files to a windows machine. My issue is, do I need to install the \nIBM MQ in the machine which the re-distributable client is installed, because when I run \nthe command in the clientrunmqsc MFTU < RDSAGTLIN_create.mqsc > mftu.outto create the required object for the redistributable client, (MFTU is the Queue manager name and RDSAGTLIN is the re-distributable client agent name), the below error pops up.[root@mqlocalhost RDSAGTLIN]# runmqsc MFTU < RDSAGTLIN_create.mqsc > mftu.out\n bash: runmqsc: command not found...I understandrunmqscis a IBM MQ command, my question is do I have to install the IBM MQ \nin the client also to setup the re-distributable file transfer agent?Any help will be very much appreciated.Regards,Yasothar### Assistant: runmqscshould be delivered in an MQ Client only installation, so you don't need a full IBM MQ installation if you only need to addrunmqsc. You will need a 'C' client if you are trying to userunmqscagainst a queue manager on a different machine. e.g.runmqsc -cHowever, your question appears to be trying to userunmqscagainst a queue manager on the same machine - is this the case? If so your problem might simply be that you have not foundrunmqscin your path. Have you used thesetmqenvcommand to set up your environment?If this is not the case and the queue manager MFTU is on a different machine then it might be as easy to run therunmqsccommand directly on that machine?runmqscwill be available there because the full queue manager installation will be there.\n"} +{"text": "### Human: I have an error when starting the IBM MQ Container. \nI followedthis tutorialAfter the docker run:docker run --name mq-demo --env LICENSE=accept --env MQ_QMGR_NAME=QM1 --volume qm1data:/mnt/mqm --publish 1414:1414 --publish 9443:9443 --network mq-demo-network --network-alias qmgr --detach --env MQ_APP_PASSWORD=mypassw0rd ibmcom/mq:latestThe container exited with this error:> docker logs mq-demo \n2020-01-21T14:34:37.059Z CPU architecture: amd64\n2020-01-21T14:34:37.059Z Linux kernel version: 4.15.0-74-generic\n2020-01-21T14:34:37.059Z Container runtime: docker\n2020-01-21T14:34:37.059Z Base image: Red Hat Enterprise Linux 8.1 (Ootpa)\n2020-01-21T14:34:37.061Z Running as user ID 888 () with primary group 888, and supplementary groups 0\n2020-01-21T14:34:37.061Z Capabilities (bounding set): chown,dac_override,fowner,fsetid,kill,setgid,setuid,setpcap,net_bind_service,net_raw,sys_chroot,mknod,audit_write,setfcap\n2020-01-21T14:34:37.061Z seccomp enforcing mode: filtering\n2020-01-21T14:34:37.061Z Process security attributes: docker-default (enforce)\n2020-01-21T14:34:37.061Z Detected 'ext4' volume mounted to /mnt/mqm\n2020-01-21T14:34:37.062Z Error setting admin password: exit status 1: [115 117 100 111 58 32 101 102 102 101 99 116 105 118 101 32 117 105 100 32 105 115 32 110 111 116 32 48 44 32 105 115 32 47 117 115 114 47 98 105 110 47 115 117 100 111 32 111 110 32 97 32 102 105 108 101 32 115 121 115 116 101 109 32 119 105 116 104 32 116 104 101 32 39 110 111 115 117 105 100 39 32 111 112 116 105 111 110 32 115 101 116 32 111 114 32 97 110 32 78 70 83 32 102 105 108 101 32 115 121 115 116 101 109 32 119 105 116 104 111 117 116 32 114 111 111 116 32 112 114 105 118 105 108 101 103 101 115 63 10]Does anyone know how to fix this?\nThanks.### Assistant: I just tried that command and have not seen that error!. This is the modified command from me:docker run --name mq-demo --env LICENSE=accept --env MQ_QMGR_NAME=QM1 --publish 1414:1414 --publish 9443:9443 --detach --env MQ_APP_PASSWORD=mypassw0rd docker.io/ibmcom/mq:latestOnly difference is to use fully qualified name for the image in command. You could try that and you may also want to clean up any existing ibmcom/mq images first and try this command.\n"} +{"text": "### Human: Using Spring's JmsTemplatemessage.setStringProperty(\"param\", \"value\")one can set the value inMQRFH2.usr. How can we set values inMQRFH2.other?### Assistant: I'm not a JMS guy but I do know how to do it with regular MQ/Java API.You use the MQRFH2 class and use the setFieldValue method:rfh2.setFieldValue(\"other\", \"SomeText\", \"TEST\");I cannot find where I posted my program MQTest71.java on StackOverflow but you can find a write up on my bloghere.Update 2020/01/14:This afternoon I played around with MQ/Java programs that created various folders in an MQRFH2 message and then ran MQ/JMS programs to retrieve the messages. MQ/JMS programs simply ignore all folders outside of 'mcd', 'jms' and 'usr'.Therefore, you need to put the name/value properties in the 'usr' folder if you want MQ/JMS applications to access the information.\n"} +{"text": "### Human: I am trying to publish messages on a IBM MQ Queue. \nHere is a my implementation -@Bean(\"jmsTemplate\")\npublic JmsTemplate createProducer(@Qualifier(\"jmsConnectionFactory\") ConnectionFactory cf) {\n JmsTemplate jmsTemplate = new JmsTemplate(cf);\n jmsTemplate.setDefaultDestinationName(\"my-queue-name\");\n return jmsTemplate;\n}and then I am calling it in a scheduler to produce message every second -@Autowired @Qualifier(\"jmsTemplate\") JmsTemplate jmsTemplate;\n\n@Scheduled(fixedDelayString = \"1000\")\npublic void runOnStart() {\n String message = \"sample message \"+String.valueOf(System.currentTimeMillis());\n jmsTemplate.convertAndSend(message);\n LOGGER.info(message);\n}All works good. Then I shut off the internet and this piece of code started throwing error - saying queue connection not available. I connected my system back to internet and it started sending the messages again. Cool! It worked as I wanted.I tried to repeat the same experiment using JMS2.0 with javaContext implementation. Here is my second implementation -@Bean(\"jmsContext\")\npublic JMSContext createProducer(@Qualifier(\"jmsConnectionFactory\") ConnectionFactory cf) {\n return cf.createContext();\n}\n@Bean(\"jmsProducer\")\npublic JMSProducer createProducer(@Qualifier(\"jmsContext\") JMSContext jmsContext) {\n return jmsContext.createProducer();\n}Again, similar to last approach, I created a scheduler to publish messages like this -@Autowired @Qualifier(\"jmsContext\") JMSContext jmsContext;\n@Autowired @Qualifier(\"jmsProducer\") JMSProducer jmsProducer;\n\n@Scheduled(fixedDelayString = \"1000\")\npublic void runOnStart() {\n try {\n Destination destination = this.jmsContext.createQueue(\"my-queue-name\"));\n String message = \"sample message \"+String.valueOf(System.currentTimeMillis());\n this.jmsProducer.send(destination, message);\n } catch (JMSException e) {\n LOGGER.error(\"Error in sending message\", e.getLinkedException());\n }\n}Here also, I am able to send the messages. Very well till now. My issue comes in the following part.\nThe scheduler was running, I disconnected my system from internet and the code throws error saying there is no connection. I reconnected my system back, but still my messages were not going to the broker(unlike the previous implementation). Isn't it supposed to connect back and send messages?What have I missed in my 2nd implementation?Note that: the Bean@Qualifier(\"jmsConnectionFactory\") ConnectionFactory cfis same for both implementation and it is like -public static ConnectionFactory getMQConnectionFactory (\n Map queueDetails,\n SSLContext sslContext) throws Exception {\n MQConnectionFactory cf = new MQConnectionFactory();\n cf.setHostName(queueDetails.get(\"hostname\"));\n cf.setPort(Integer.parseInt(queueDetails.get(\"port\")));\n cf.setQueueManager(queueDetails.get(\"queueManager\"));\n cf.setChannel(queueDetails.get(\"channel\"));\n cf.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n cf.setStringProperty(WMQConstants.USERID, queueDetails.get(\"username\"));\n cf.setSSLCipherSuite(queueDetails.get(\"sslCipherSuite\"));\n cf.setSSLSocketFactory(sslContext.getSocketFactory());\n return cf;\n}The exception -com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2009' ('MQRC_CONNECTION_BROKEN').### Assistant: If you want the underlying MQ client code to reconnect on failure you will need to enable mq auto reconnect like this:cf.setClientReconnectOptions(WMQConstants.WMQ_CLIENT_RECONNECT);\ncf.setClientReconnectTimeout(1800); // how long in seconds to continue to attempt reconnection before failing\n"} +{"text": "### Human: I use spring boot 2.2 application who receive mq message via jms.Data is jsonIn my code I have this config@Bean\n public MessageConverter jacksonJmsMessageConverter() {\n MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter();\n converter.setTargetType(MessageType.TEXT);\n converter.setTypeIdPropertyName(\"_type\");\n return converter;\n }When I send data via IBM MQ Explorer, I get this errororg.springframework.jms.support.converter.MessageConversionException: Could not find type id property [_type] on messageIs there a way to set this with IBM MQ explorer?### Assistant: If your message doesn't have a property containing type information, you can subclass theMappingJackson2MessageConverterand overridegetJavaTypeForMessage/**\n * Determine a Jackson JavaType for the given JMS Message,\n * typically parsing a type id message property.\n *

The default implementation parses the configured type id property name\n * and consults the configured type id mapping. This can be overridden with\n * a different strategy, e.g. doing some heuristics based on message origin.\n * @param message the JMS Message to set the type id on\n * @throws JMSException if thrown by JMS methods\n * @see #setTypeIdOnMessage(Object, javax.jms.Message)\n * @see #setTypeIdPropertyName(String)\n * @see #setTypeIdMappings(java.util.Map)\n */\nprotected JavaType getJavaTypeForMessage(Message message) throws JMSException {\n"} +{"text": "### Human: Can someone please help me to get/read the port number, hostname, channel details when i using ccdt.tab file. these details were configured in tab file. queue creation was opened successfully by using tab file but i want to get above details (connection details) using java.I can able to get only queue manager name and queue name by using MQQueueSender.getstringproperty(); but other not able to find.I expect port number, hostname, channel which i defined in TAB fileMQQueueConnection connection = null;\n MQQueueSession session = null;\n MQQueueSender sender = null;\n MQQueueReceiver receiver = null;\n HashMap setValue = null;\n\n try {\n\n connection = getConnection(prop.getProperty(\"tabFilePath\"));\n session = (MQQueueSession) connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\n MQQueue sendQueue = (MQQueue) session.createQueue(prop.getProperty(\"queueName\"));\n sender = (MQQueueSender) session.createSender(sendQueue); System.out.println(sender.getStringProperty(\"XMSC_WMQ_RESOLVED_QUEUE_MANAGER\"));\n System.out.println(sender.getStringProperty(\"XMSC_WMQ_QUEUE_MANAGER\"));### Assistant: There is no MQ API or Class that will parse a CCDT file for an MQ application.Set the environment variables MQCHLLIB and MQCHLTAB to point to where your CCDT file located and then use runmqsc with the '-n' parameter to have MQ manage it then issue the following MQSC command:DIS CHL(*) ALLNow you will have all of the details of all CLNTCONN channels from the CCDT file.\n"} +{"text": "### Human: I built a Java library to send message in IBM MQ.It is working fine when I execute the code on the library project.However, when I use the.jarinto another tool (JMeter), an error occurs.java.lang.NoSuchMethodError: com.ibm.mq.jmqi.JmqiFactory.getInstance(Lcom/ibm/mq/jmqi/JmqiThreadPoolFactory;Lcom/ibm/mq/jmqi/JmqiPropertyHandler;)Lcom/ibm/mq/jmqi/JmqiEnvironment;\n at com.ibm.msg.client.mqlight.MQLightComponent.getImplementationInfo(MQLightComponent.java:220) ~[mq-jms-8.0.0.3.jar:8.0.0.3 - p800-003-150615.2]\n at com.ibm.msg.client.commonservices.trace.Trace.getVersion(Trace.java:1692) ~[mq-jms-7.0.1.3.jar:?]\n at com.ibm.msg.client.commonservices.trace.Trace.createFFSTString(Trace.java:1650) ~[mq-jms-7.0.1.3.jar:?]\n at com.ibm.msg.client.commonservices.trace.Trace.ffstInternal(Trace.java:1536) ~[mq-jms-7.0.1.3.jar:?]\n at com.ibm.msg.client.commonservices.trace.Trace.ffst(Trace.java:1444) ~[mq-jms-7.0.1.3.jar:?]\n at com.ibm.msg.client.jms.JmsFactoryFactory.getInstance(JmsFactoryFactory.java:209) ~[mq-jms-7.0.1.3.jar:7.0.1.3 - k701-103-100812]\n at com.ibm.mq.jms.MQConnectionFactory.initialiseMQConnectionFactory(MQConnectionFactory.java:3325) ~[mq-jms-7.0.1.3.jar:7.0.1.3 - k701-103-100812]\n at com.ibm.mq.jms.MQConnectionFactory.(MQConnectionFactory.java:274) ~[mq-jms-7.0.1.3.jar:7.0.1.3 - k701-103-100812]\n at my.package.MQ_Manager.createConnection(MQ_Manager.java:36) ~[my-jar.jar:?]\n at my.package.MQ_Manager.(MQ_Manager.java:27) ~[my-jar.jar:?]\n at my.package.Producer.(Producer.java:18) ~[my-jar.jar:?]\n at my.package.Request.sendRequest(Request.java:116) ~[my-jar.jar:?]\n at my.package.Request$sendRequest$2.call(Unknown Source) ~[?:?]\n at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47) ~[groovy-all-2.4.16.jar:2.4.16]\n at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) ~[groovy-all-2.4.16.jar:2.4.16]\n at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120) ~[groovy-all-2.4.16.jar:2.4.16]\n at Script1.run(Script1.groovy:14) ~[?:?]\n at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:321) ~[groovy-all-2.4.16.jar:2.4.16]\n at org.codehaus.groovy.jsr223.GroovyCompiledScript.eval(GroovyCompiledScript.java:72) ~[groovy-all-2.4.16.jar:2.4.16]\n at javax.script.CompiledScript.eval(Unknown Source) ~[?:1.8.0_31]\n at org.apache.jmeter.util.JSR223TestElement.processFileOrScript(JSR223TestElement.java:223) ~[ApacheJMeter_core.jar:5.1 r1853635]\n at org.apache.jmeter.protocol.java.sampler.JSR223Sampler.sample(JSR223Sampler.java:71) ~[ApacheJMeter_java.jar:5.1 r1853635]\n at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:622) ~[ApacheJMeter_core.jar:5.1 r1853635]\n at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:546) ~[ApacheJMeter_core.jar:5.1 r1853635]\n at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:486) ~[ApacheJMeter_core.jar:5.1 r1853635]\n at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253) ~[ApacheJMeter_core.jar:5.1 r1853635]\n at java.lang.Thread.run(Unknown Source) [?:1.8.0_31]Corresponding code:MQConnectionFactory factory = new MQConnectionFactory();\nfactory.setHostName(properties.getProperty(\"HOST\"));\nfactory.setPort(Integer.parseInt(properties.getProperty(\"PORT\")));\nfactory.setChannel(properties.getProperty(\"CHANNEL\"));\nfactory.setTransportType(WMQConstants.WMQ_CM_CLIENT);\nfactory.setQueueManager(properties.getProperty(\"QUEUE_MANAGER\"));\nfactory.setAppName(properties.getProperty(\"APP_NAME\"));\nConnection connection = factory.createConnection(properties.getProperty(\"APP_USER\"), properties.getProperty(\"APP_PASSWORD\"));\nconnection.start();\nreturn connection;Error occurs at this lineMQConnectionFactory factory = new MQConnectionFactory();Any idea? Thank you.Update 1To create the.jarI :Clicked onExportSelectedRunnable JAR fileSelectedExtract required libraries into generated JARUpdate 2Moreover when I built the Jar, I get this warning. Do you think that is important?This operation repacks references libraries. Please review the licences associated with libraries you wish ti reference to make sure you are able to repack them using this application. Note also that this operation does not copy signature files from orignal libraies to the generated JAR file.### Assistant: After disccussing the issue with theOPI went ahead a verified the issue myself.\nThe result is that its working for me ...Step 1:Created a maven project with included the following codepackage test;\n\nimport javax.jms.JMSException;\nimport com.ibm.mq.jms.MQConnectionFactory;\n\npublic class JmeterTest {\n\n public JmeterTest() {\n }\n\n public void test() throws JMSException {\n MQConnectionFactory factory = new MQConnectionFactory();\n factory.setAppName(\"myApp\");\n }\n\n public static void main(String[] args) {\n System.out.println(\"test\");\n }\n}Step 2:Exported this from eclipse as runnable jar and copied into JMeter (\\lib\\ext\\).Note that a export with library handlingpackage required jars into generated jardoes not work. UseExtract into generated jarorCopy into subfolder(and then copy the jars from the subfolder into\\lib\\extas well).related dependecies are:com.ibm.mq.allclient-9.0.4.0.jar\nbcokix-jdk15on-1.57.jar\nbcprov-jdk15on-1.57.jar\njavax.jms-api-2.0.1.jarStep 3:Started JMeter and created a ThreadGroup with aJSR223 Sampler.import test.JmeterTest;\nnew JmeterTest().test();Then started the test. No error occurred.Step 4:Instead of exporting a library, you could directly (after adding the dependencies) add the required code into the script panel:import javax.jms.JMSException;\nimport com.ibm.mq.jms.MQConnectionFactory;\n\nMQConnectionFactory factory = new MQConnectionFactory();\nfactory.setAppName(\"myApp\");Worked as wellConclusion: Interference from other dependencies on the jmeter classpath are the likeliest cause of the issue.\n"} +{"text": "### Human: How to send MQ message without RFH header in C or in other words how do i send NonJMS MQ message using 'C' library interface?Basically, is there any 'C' equivalent of((com.ibm.mq.jms.MQQueue) queue).setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ);Following 'C' MQ calls I am makingMQCONNX(qmgrName, &mqcno, &hConn_, &compCode, &cReason);\nMQOPEN(hConn_, &od, openOptions, &hObj_, &openCode, &reason)\nMQCRTMH(hConn_, &cmho, &hMsg, &createCode, &reason)\nMQSETMP(hConn_, hMsg, &smpo, &prop, &pd, MQTYPE_STRING, propVal.length(), propVal, &compCode, &reason);\npmo.Version = MQPMO_VERSION_3;\npmo.OriginalMsgHandle = hMsg;\nMQPUT(hConn_, hObj_, NULL, &pmo, msg._theMessage.length(), buffer, &compCode, &reason);\nMQDLTMH(hConn_, &hMsg, &dmho, &compCode, &reason);pmo.OriginalMsgHandle = hMsg//This line is causing RFH headerMQ Receiver is giving following output. I am using C++ MQ interface to receive the message because that's what existing code is doing and need to make sure that C generated msgs can be read by C++ receiver2024489 - 2019-09-26 09:00:05.691154 Receiver: Received Message from MQ of size 490\n2024489 - 2019-09-26 09:00:05.691163 Receiver: Received Message from MQ --> RFH ^Bstd::basic_string, std::allocator >::basic_string (this=0x6ce7938,\n __str=\"RFH \\002\\000\\000\\000P\\000\\000\\000\\\"\\002\\000\\000\\063\\003\\000\\000MQSTR \\000\\000\\000\\000\\270\\004\\000\\000(\\000\\000\\0001 corrId: \\\"CORR_ID\\\"\\nchannel: \\\"HIFI\\\"\\nemp\nIds {\\n empId {\\n type: \\\"CALLER_NO\\\"\\n value: \\\"123456\"...)### Assistant: The IBM MQ classes for JMS API and the XMS APIs (C++ and .NET) are the only APIs that default to sending a RFH2 header.The setting below that you mention is specific to the JMS API (there would be something similar or the same for XMS) and tells the API that the app receiving the message is not a JMS app so do not send the RFH2 header:((com.ibm.mq.jms.MQQueue) queue).setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ);If you are using the C API to send messages it will NOT have a RFH2 header so there is no setting to turn off what is not sent.\n"} +{"text": "### Human: I am trying to use IBM MQ client 9 with C++. I would like to read only messages that has group id '2'. I have tried everything but it just does not work. Can someone assist please?I tried to set groupId and flag to match on group.MQGETgmoptions.setMatchOptions(MQMO_MATCH_GROUP_ID);\nMQBYTE24 bGroupId(\"2\");\nImqBinary _groupId;\n_groupId.set(bGroupId, sizeof(bGroupId));\nmessage.setGroupId(_groupId);\nq->get(message, gmoptions);MQPUTMQBYTE24 bGroupId(\"2\");\nImqBinary _groupId;\n_groupId.set(bGroupId, sizeof(bGroupId));\nmessage.setGroupId(_groupId);\nImqPutMessageOptions pmo;\npmo.setOptions(MQPMO_LOGICAL_ORDER);\npmo.setRecordFields(MQPMRF_GROUP_ID);\nq->put(message, pmo);mqget should be able to get all the msgs with groupId \"2\" but it does not. Though it can read the msg as soon as I remove setMatchOptions.Basically, I want to use Group Id as filter where server instance 1 will read msgs only in group1 and server instance 2 will read msgs only in group 2 and so on, instead of creating separate queues for each server instance.May be following can help me if group id is only for batching instead of filtering though not sure how to do 'Selection using the MQSUB and MQOPEN function calls' in C++https://www.ibm.com/support/knowledgecenter/SSFKSJ_9.0.0/com.ibm.mq.dev.doc/q022990_.htmIs there any C++ equivalent of MQSETMP ? I am unable to find any interface in ImqQueue or ImqObject that will let me set message property or selectionString.### Assistant: I don't think you are going about this the right way.IBM published a Java/MQ sample program to get messages in a group calledGetGroup.java. You can find ithere. You can use it as a model for your C++ program.Basically, the code retrieves a message from the queue and then checks themessageFlagsfield if the message is part of a group.if ((myMessage.messageFlags & CMQC.MQMF_MSG_IN_GROUP) == CMQC.MQMF_MSG_IN_GROUP)If the message is part of the group then the code sets thematchOptionsfor matching on a group and retrieves all of the messages in the group.Note: You will probably want to add logical order to the GMO options.gmo.options |= CMQC.MQGMO_LOGICAL_ORDER;Finally, what is this?pmo.setRecordFields(MQPMRF_GROUP_ID);That doesn't make any sense. You should be settingmessageFlagsfield toMQMF_MSG_IN_GROUP.\n"} +{"text": "### Human: LDAP server cridentials are configured correctly, however I am unable to get to the figure out why LDAPCONN is INACTIVE. The logs are not showing the issue.DEFINE AUTHINFO(USE.LDAP) AUTHTYPE(IDPWLDAP) CONNAME('127.0.0.1(389)') LDAPUSER('cn=admin,dc=organisation,dc=co,dc=za') LDAPPWD('admin') SHORTUSR('mqm') REPLACE\nAMQ8563: IBM MQ authentication information object created.\n\nALTER QMGR CONNAUTH(USE.LDAP)\nAMQ8005: IBM MQ queue manager changed\n\nREFRESH SECURITY TYPE(CONNAUTH)\nAMQ8560: IBM MQ security cache refreshed.\n\nDISPLAY QMSTATUS LDAPCONN\nAMQ8705: Display Queue Manager Status Details.\n QMNAME(TEST) STATUS(RUNNING)\n LDAPCONN(INACTIVE)When executing DISPLAY QMSTATUS LDAPCONN. I want to be able to see LDAPCONN(ACTIVE).### Assistant: I work with Thulasizwe and we found the problem.We are using an IBM MQ docker container to do local testing for our LDAP solution that we are busy with. The issue was caused by an environment variable which is passed to the docker container, basically disabling the IBM OAM (Object Authority Manager) of the MQ server. This has the result of still authenticating against the LDAP server, but disabling object authority checking of the MQ server.With the OAM switched off, the Queue Manager reports the LDAPCONN as INACTIVE (although authentication is still done against the LDAP server).After removing the environment variable which causes the OAM to be disabled, the authority manager switched on and the LDAPCONN reported CONNECTED.LDAP Configuration in IBM MQ serverDEFINE AUTHINFO(USE.LDAP) AUTHTYPE(IDPWLDAP) + \nCONNAME('127.0.0.1(10389)') + \nLDAPUSER('uid=adminuser,cn=users,ou=organisation,dc=sa') LDAPPWD('password') + \nBASEDNG('cn=groups,ou=organisation,dc=sa') + \nBASEDNU('cn=users,ou=organisation,dc=sa') + \nCLASSUSR('inetOrgPerson') CLASSGRP('groupOfUniqueNames') +\nFINDGRP('uniqueMember') GRPFIELD('cn') USRFIELD('uid') + \nSHORTUSR('uid') AUTHORMD(SEARCHGRP) +\nDESCR('LDAP authentication module.') +\nREPLACEEnvironment variable which caused the issueIn the creation of the docker container (look in your Dockerfile) there was an environment variable set:FROM ibmcom/mq:latest\n...\n\nENV MQSNOAUT=\"YES\"\n\n...The environment variableMQSNOAUTtells the queue manager to disable the OAM when the manager is created.To read more about the MQ environment variables here:(IBM Knowledge center, SSFKSJ_9.0.0).We used the docker container at:https://hub.docker.com/r/ibmcom/mqAfter removing the setting, everything worked as expected.Thank you all for the responses. Hope this answer helps someone else in future.AfterthoughtBut, to answer the main question about if IBM indicatesthis specific INACTIVE issuein the logs, the answer is no. I suppose that the status of INACTIVE in our case was correct since it indicated that the OAM is not active. But, in our case LDAP connectivity is not completely inactive since the MQ server still used the LDAP server for the authentication of the user (thus it did connect!). Credential checking of the user (login) against the LDAP server was done successfully even with the status showing INACTIVE. So the INACTIVE indicator in our case is a bit confusing for me.I.r.o the indicator otherwise, it will have a state of INACTIVE, CONNECTED or ERROR. If everything is fine, the status will be CONNECTED, else it will have a status of ERROR in which case you can check the logs under the /var/mqm/qmgr/QMGR/error for more information about the issue.\n"} +{"text": "### Human: I'm working on some project where I'm building some JMS messages that I want to send usingJmsTemplate, which is initialized in a Spring Boot app, via JNDI naming.As my Broker isIBM MQ Series, I need to change the encoding value in the outgoing XML message, so I'm sure the broker will understand the message.I haven't seen anywhere on theJmsTemplatesettings, or theConnectionFactoryJmsTemplate need to be initialized, where to put some outgoing interceptors.If anyone got some ideas, or any workaround or some framework/library that could help, feel free to give me some hint.Thanks### Assistant: I assume you are using JAXB to create the XML message.Configure yourJmsTemplatewith aMarshallingMessageConverterthat uses aJaxb2Marshallerwhere you can set the marshaller propertyJAXB_ENCODING:Jaxb2Marshaller jaxb2Marshaller = new Jaxb2Marshaller(); \nMap properties = new HashMap();\nproperties.put(javax.xml.bind.Marshaller.JAXB_ENCODING, \"YOUR-ENCODING\");\njaxb2Marshaller.setMarshallerProperties(properties);\njaxb2Marshaller.setPackagesToScan(\"your.package\");\n\nJmsTemplate jms = new JmsTemplate(connectionFactory);\njms.setMessageConverter(new MarshallingMessageConverter(jaxb2Marshaller));\n...\njms.convertAndSend(yourObject);\n...\n"} +{"text": "### Human: I am newbie to python. I am trying to connect to my IBM MQ and put some messages in them through the Python code.import pymqi\n\nqueue_manager = 'XXXXXX'\nchannel = 'XXXXX'\nhost = 'XXXXX'\nport = 'XXXX'\nconn_info = '%s(%s)' % (host, port)\nqmgr = pymqi.connect(queue_manager, channel, conn_info)\nfile = open('E:\\D Drive Back up\\Scripts\\Data1.csv','r')\ny = file.readlines()\nprint y[1]\nputQ = pymqi.Queue(qmgr, queue_manager)\nputQ.put(y[1])\nqmgr.disconnect()Sample Data which I am trying to input:{1:F01COBADEFFGXXX3575743055}{2:I103BARCGB22GXXXU3003}{4:##:20:Forw092010004R1##:23B:CRED##:32A:181010EUR250000,00##:50F:/N101000004EUR##1/John Doe##2/Dankelmannstrasse 6##3/DE/Berlin##:59F:/N101000004EUR##1/Jane Doe##2/Wissmannstr 1##3/DE/Berlin##:71A:BEN##-}{5:{MAC:11111111}{CHK:6E470F24FDE6}}The output I am getting is this:E:\\D Drive Back up\\Scripts>python MQ.py\n{1:F01COBADEFFGXXX3575743055}{2:I103BARCGB22GXXXU3003}{4:##:20:Forw092010R1##:23B:CRED##:32A:181010EUR1000000,00##:50F:/N101000004EUR##1/John Doe##2/Dankelmannstrasse 6##3/DE/Berlin##:59F:/N101000004EUR##1/Jane Doe##2/Wissmannstr 1##3/DE/Berlin##:71A:BEN##-}{5:{MAC:11111111}{CHK:6E470F24FDE6}}\n\nTraceback (most recent call last):\nFile \"MQ.py\", line 19, in \nputQ.put(y[1])\nFile \"C:\\Users\\aassharma\\AppData\\Local\\Continuum\\anaconda2\\lib\\site-packages\\pymqi_init_.py\", line 1727, in put\nself._realOpen()\nFile \"C:\\Users\\aassharma\\AppData\\Local\\Continuum\\anaconda2\\lib\\site-packages\\pymqi_init.py\", line 1632, in __realOpen\nraise MQMIError(rv[-2], rv[-1])\npymqi.MQMIError: MQI Error. Comp: 2, Reason 2085: FAILED: MQRC_UNKNOWN_OBJECT_NAME### Assistant: Compare your code to the pymqi put sample from -https://dsuch.github.io/pymqi/examples.html#how-to-put-the-message-on-a-queueimport pymqi\n\nqueue_manager = 'QM1'\nchannel = 'DEV.APP.SVRCONN'\nhost = '127.0.0.1'\nport = '1414'\nqueue_name = 'TEST.1'\nmessage = 'Hello from Python!'\nconn_info = '%s(%s)' % (host, port)\n\nqmgr = pymqi.connect(queue_manager, channel, conn_info)\n\nqueue = pymqi.Queue(qmgr, queue_name)\nqueue.put(message)\nqueue.close()\n\nqmgr.disconnect()As Morag Hughson and JoshMc already pointed out, the difference isqueue_name. You don't specify one.It should be something like 'DEV.QUEUE.1' and used as the second parameter in the call to connect to the queue -queue = pymqi.Queue(qmgr, queue_name). You pass in the Queue Manager, which I guess will be something like 'QM1', which is very unlikely to be the queue name on your MQ Server, and also why you are getting the errorMQRC_UNKNOWN_OBJECT_NAME.\n"} +{"text": "### Human: I realize there is a method to set on MQConnectionFactory to attempt to reconnect if the connection of a consumer or producer is broken. However, I'm wondering if one can do something similar for an application that is starting up and setting up consumers and producers. The code I have right now will not recover if the server is down when my client application comes up.Is there a common/recommended practice here?### Assistant: My recommendation would simply be to use the tools that are provided in the Java language itself. For example, you could write a loop with exception handling to retry the initial connection or JNDI lookup a configurable number of times. It's hard to provide more specific recommendations when you haven't provided any client code of your own.\n"} +{"text": "### Human: I am new to docker, and as I am trying to configure an IBM integration environment using docker. I have used docker pull command to install two different images, one is the IBM Integration Bus (IIB) and the other is IBM Message Queueing (MQ). Then I ran each of the images in separate containers using docker run command.The problem is, IIB is depending on MQ for its broker creation. I created the queue manager in the MQ container, and then created a broker in the iib container. I need a way to link the broker contianer with queue manager container, or combine them if possible.https://developer.ibm.com/messaging/learn-mq/mq-tutorials/mq-connect-to-queue-manager/#dockerhttps://hub.docker.com/r/ibmcom/iib/Can someone help and provide instructions?### Assistant: If you can work with the latest IIB version, now called ACE, look at theseimages.\n"} +{"text": "### Human: I am trying JBOSS EAP 6.4 to JBOSS EAP 7.2 migration.At the server startup I am gettingBeanCreationException: Error creating bean with name 'A' defined in ServletContext resource Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'com.ibm.mq.connector.outbound.ConnectionFactoryImpl' to required type 'javax.jms.ConnectionFactory' for property 'queueManager'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.ibm.mq.connector.outbound.ConnectionFactoryImpl] to required type [javax.jms.ConnectionFactory] for property 'queueManager': no matching editors or conversion strategy foundWhy this is happening and how to solve it?### Assistant: After so much trying, I solved this error by addingjavax.jms.apito the global-modules section instandalone.xml. It resolves above issue with theWMQsetup.\n \n\n"} +{"text": "### Human: After I went to multiple sites and learned JMS I wrote a JMS standalone client to read messages from a database and send them one by one. I also want to receive message one by one message and then update the database.\nI need to send a message to a queue and the other application using standard JMS which will consume aTextMessageand whose body will be read as an ISO-8859-1 string. Also they will similarly send reply as aTextMessage.\nI wrote aforloop to read the message one by one from the DB.I am new to JMS so could you please correct me whether my below code works properly to read and send messages to a queue and receive and update the DB. Is there any thing I need to change in the JMS Type or any thing I need to correct. Does theforloop work fine?/*MQ Configuration*/\nMQQueueConnectionFactory mqQueueConnectionFactory = new MQQueueConnectionFactory();\nmqQueueConnectionFactory.setHostName(url);\nmqQueueConnectionFactory.setChannel(channel);//communications link\nmqQueueConnectionFactory.setPort(port);\nmqQueueConnectionFactory.setQueueManager(qmgr);//service provider \nmqQueueConnectionFactory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);\n\n/*Create Connection */\nQueueConnection queueConnection = mqQueueConnectionFactory.createQueueConnection();\nqueueConnection.start();\n\n/*Create session */\nQueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\n\n/*Create response queue */\n// Queue queue = queueSession.createQueue(\"QUEUE.RESPONSE\");\n\nint messageCount = 0;\n\nQueue queue = queueSession.createQueue(replytoQueueName);\nQueueSender queueSender = null;\nQueueReceiver queueReceiver=null;\n\nfor (Testbean testBean : testbeanList) {\n String testMessage = testBean.getMessage(); \n /*Create text message */\n textMessage = queueSession.createTextMessage(testMessage);\n\n logger.info(\"Text messages sent: \" + messageCount);\n\n textMessage.setJMSReplyTo(queue);\n textMessage.setJMSType(\"mcd://xmlns\");//message type\n textMessage.setJMSExpiration(2*1000);//message expiration\n textMessage.setJMSDeliveryMode(DeliveryMode.PERSISTENT); //message delivery mode either persistent or non-persistemnt\n\n /*Create sender queue */\n // QueueSender queueSender = queueSession.createSender(queueSession.createQueue(\"QUEUE.REQEST\"));\n\n queueSender = queueSession.createSender(queueSession.createQueue(outputQName));\n queueSender.setTimeToLive(2*1000);\n queueSender.send(textMessage);\n\n /*After sending a message we get message id */\n System.out.println(\"after sending a message we get message id \"+ textMessage.getJMSMessageID());\n String jmsCorrelationID = \" JMSCorrelationID = '\" + textMessage.getJMSMessageID() + \"'\";\n\n\n /*Within the session we have to create queue reciver */\n queueReceiver = queueSession.createReceiver(queue,jmsCorrelationID);\n\n /*Receive the message from*/\n Message message = queueReceiver.receive(60*1000);\n // String responseMsg = ((TextMessage) message).getText();\n\n byte[] by = ((TextMessage) message).getText().getBytes(\"ISO-8859-1\");\n\n logger.info(new String(by));\n String responseMsg = new String(by,\"UTF-8\");\n\n testDAO rmdao = new testDAO();\n rmdao.updateTest(responseMsg, jmsCorrelationID); \n\n messageCount += 1;\n}\n\nqueueSender.close();\nqueueReceiver.close();\nqueueSession.close();\nqueueConnection.close();### Assistant: Couple of things:I would create yourQueueSenderand theQueueobject its sending messages tooutsidetheforloop since they don't appear to be changing.Without the corresponding consumer code it's ultimately impossible to tell if the selector will work or not, butnotinvokingsetCorrelationID()on the message you send looks a bit strange to me. Using the provider-assigned message ID may be a common pattern with IBM MQ request/reply applications, but the general pattern for using a correlation ID is to invokesetJMSCorrelationID()on the sent message. This makes the code more clear and also allows the application to directly control the uniqueness of the correlation ID. This is potentially important for application portability (e.g. if you migrated from IBM MQ to a different JMS provider) since different JMS providers use styles/formats of message ID specific to their particular implementation. Also, regarding the message ID the JMS spec states, \"The exact scope of uniqueness is provider defined,\" which in my opinion is not a strong enough guarantee of uniqueness especially when using something likejava.util.UUID.randomUUID().toString()is so simple.You should ensure that you're using an XA transaction for both the JMS & database work so that they are atomic.Close your JMS resources in afinallyblock.\n"} +{"text": "### Human: i am working on a solution where the client already own an iBM MQ so i need to integrate Kafka to it. i would need to fetch data from a IBM MQ and push it to kafka topic for further processing. I would request experts to answer my query and the best way it can be done.if I develop a Kafka connect to fetch data from IBM MQ then it is will incurred into licenses.. may be we client wont agree for the license cost.Intend :to build a solution without license if possible.Kindly suggest if that can done in any Open source way for this implementation.i have tried to look for many blogs but they say it should be done using Kafka connect which is from confluent.### Assistant: Kafka Connect itself is not from Confluent.Kafka Connect is an API as a part of Apache Kafka. Kafka Connect is definitely the preferred way to integrate Kafka with other systems.There are different connector plugins available, with varying licences and support available. There are two connectors for IBM MQ that I could find :https://github.com/ibm-messaging/kafka-connect-mq-source- Apache 2.0, from IBMhttps://www.confluent.io/connector/kafka-connect-ibm-mq/- commercial licence from Confluent\n"} +{"text": "### Human: Assuming each msg matches to a single TX, and abatchcan contain multiple msgs. Question is, how often does QM writes those log records to disk, on both SDR and RCVR sides? For instance, if webatches contains 50 msgs each, does that mean QM writes to disk on both sides 50 times, or there are some optimization nobs we can tune to avoid/reduce such io overhead.A little backgroundWe use WebsphereMQ (7.1.0.3) for QReplication, and frequently hit max MQ-transfer-rate at about8.33 batch/sec(or 120ms perbatch). SDR chstatus reportNETTIME~=24ms, ping time around 20ms, so seems like about 100ms spent perbatchon both QMs together. The averagebatchsize during those periods of time are at 100 (yes, it max out atBATCHSZ). Averagebatchsize is a little less than 180KB, or about 1.8KB/msg.Thanks.### Assistant: All messages in a batch are transferred in 1 transaction, so the message channel agent will open 1 transaction on the sender and 1 on the receiver side to get and put all the messages in the batch. This transaction is committed when the batch size or the batch interval is exhausted.\n"} +{"text": "### Human: Using a .net framework Web API project we want to create a listener(consumer) for our MQ queue. We are using XMS.Net as we are interested in asynchronous style of receiving messages. However, while creating a connection we are getting error:Could not load type 'IBM.WMQ.ManagedCommonServices' from assembly 'IBM.XMS.Client.WMQ, Version=8.0.0.7, Culture=neutral, PublicKeyToken=d2666ab12fca862b'.As perhttp://www-01.ibm.com/support/docview.wss?uid=swg1IC89514this issue is fixed but we are still facing it using version 8.0.0.7.This is working fine for .Net framework console application but with Web API project it is failing.As workaround we also tried adding following in app.config for Web API but no luck - Note: The MQ client is not installed on my machine. We have referred - amqmdmsg, amqmdnet, amqmdnm, amqmdnsp, amqmdxcs dlls into the project.### Assistant: If you are using MQ v9.1, you can try the following steps1) SET the following variable in the environment\n DEVPATH=&RedistributablePackagePath&\\bin2) Add binding redirect tag to the App.config file of the application as the application was compiled using a lower MQ version and it has to be run against a higher version. For this you can copy the content of NonPrimaryRedirect.config file located at \"&MQInstallPath&\\Tools\\dotnet\\samples\\cs\\base\"Note:You have to modify the \"newVersion\" attribute value in the app.config file to the version you want to run against in your case it should be 9.1.0.0 and modify the \"href\" to the redistributable package path.3) Add the following tags into the app.config file\n\n\n\n \n \n"} +{"text": "### Human: We have an IBM MQ JMS queue and want to distribute the data into multiple consumers for load balancing. So if we write two JMS Clients to consume from same JMS queue what will happen? Will Messages be equally distributed across both consumers since one consumer will delete the data after it is read? Is there a possibility for data duplication, like if the same message is read by both consumers in a race condition?### Assistant: My comments below are based on destructive get and not a browse get.So if we write two JMS Clients to consume from same JMS queue what\n will happen?They will both consume messages.Will Messages be equally distributed across both consumers since one\n consumer will delete the data after it is read?No. The \"hot\" consumer will be feed the next available message, assuming it is \"getting\" a message again before the next message arrives.Is there a possibility for data duplication, like if the same message\n is read by both consumers in a race condition?Not if you are performing a destructive get (the default).\n"} +{"text": "### Human: I have a stateless EJB which inserts data into database, sends a response immediately and in the last step calls an asynchronous EJB. Asynchronous EJB can run for long (I mean 5-10 mins which is longer then JPA transaction timeout). The asynchronous ejb needs to read (and work on it) the same record tree (only read) as the one persisted by stateless EJB.Is seems that the asynchronous bean tries to read the record tree before it was commited or inserted (JPA) by the statelsss EJB so record tree is not visible by async bean.Stateless EJB:@Stateless\npublic class ReceiverBean {\n\n public void receiverOfIncomingRequest(data) {\n long id = persistRequest(data);\n sendResponseToJmsBasedOnIncomingData(data);\n processorAsyncBean.calculate(id);\n }\n }\n}Asynchronous EJB:@Stateless\npublic class ProcessorAsyncBean {\n\n @Asynchronous\n public void calculate(id) {\n Data data = dao.getById(id); <- DATA IS ALLWAYS NULL HERE!\n\n // the following method going to send\n // data to external system via internet (TCP/IP)\n Result result = doSomethingForLongWithData(data);\n\n updateData(id, result);\n }\n\n @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)\n public void updateData(id, result) {\n dao.update(id, result);\n}Maybe I can use a JMS queue to send a signal with ID to the processor bean instead of calling asyc ejb (and message driven bean read data from database) but I want to avoid that if possible.Another solution can be to pass the whole record tree as a detached JPA object to the processor async EJB instead of reading data back from database.Can I make async EJB work well in this structure somehow?-- UPDATE --I was thinking about using Weblogic JMS. There is another issue here. In case of big load, when there are 100 000 or more data in queue (that will be normal) and there is no internet connection then all of my data in the queue will fail. In case of that exception (or any) appears during sending data via internet (bydoSomethingForLongWithDatamethod) the data will be rollbacked to the original queue based on theredelivery-limitandrepetitaionsettings of Weblogic. This rollback event will generate 100 000 or more threads on Weblogic in the managed server to manage redelivery. That new tons of background processes can kill or at least slow down the server.I can use IBM MQ as well because we have MQ infrastructure. MQ does not have this kind of affect on Weblogic server but MQ does not have redelivery-limit and delay function. So in case of error (rollback) the message will appear immediately on the MQ again, without delay and I built a hand mill.Thread.sleep()in thecatchcondition is not a solution in EE application I guess...### Assistant: Is seems that the asynchronous bean tries to read the record tree before it was commited or inserted (JPA) by the statelsss EJB so record tree is not visible by async bean.This is expected behavior with bean managed transactions. Your are starting the asynchronous EJB from the EJB with its own transaction context. The asynchronous EJB never uses the callers transaction context (see EJB spec 4.5.3).\nAs long as you are not using transaction isolation level \"read uncommited\" with your persistence, you won't see the still not commited data from the caller.You must think about the case, when the asynch job won't commit (e.g. applicationserver shutdown or abnormal abortion). Is the following calculation and update critical? Is the asynchronous process recoverable if not executed successfully or not even called?You can think about using bean managed transactions, commiting before calling the asynchronous EJB. Or you can delegate the data update to another EJB with a new transactin context. This will be commited before the call of the asynchronous EJB. This is usally ok for uncritical stuff, missing or failing.Using persistent and transactional JMS messages along with a dead letter queue has the advantage of a reliable processing of your caclulation and update, even with stopping / starting application server in between or with temporal errors during processing.\n"} +{"text": "### Human: So I am trying to connect to FTPClient from my JavaCompute node in Integration Bus v10.0.0.8. \nThe problem occurs because my runtime don't see the imported jar. \nException that happens :java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClientCan anyone help me?### Assistant: You probably did not add the JAR files as dependencies of the Java project in your Toolkit.Create alibsubdirectory in your Java project and copy the JAR files there.Right click the Java project, Properties -> Java Build Path -> LibrariesClick buttonAdd JARs...and add the libraries from thelibdirectory.See also theKnowledge Center.To read a file from an FTP server, you can also use theFile InputorFile Readnodes and configure the FTP section. In case you use SFTP, please look atIT23379as well.\n"} +{"text": "### Human: I wrote some codes to get message from remote mq but after message is not available into Queue I disconnect from MQ . Then I want to reconnect to MQ . I added timer for this . But it increases open input count . Is there any way to reconnect without timer? any clue will do fine .CODEC# codeusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing IBM.WMQ;\nusing System.Diagnostics;\nusing System.Collections;\nusing System.Configuration;\nusing System.Timers;\n\nnamespace MQMessageSender\n {\n public class MQTest\n {\n private static MQQueueManager queueManager;\n private static MQMessage queueMessage;\n private static MQGetMessageOptions queueGetMessageOptions;\n private static MQQueue queue;\n static string strReturn = \"\";\n static string QueueName;\n static string QueueManagerName;\n static string ChannelInfo;\n static string channelName;\n static string PortNumber;\n static string transportType;\n static string connectionName;\n static bool running = true;\n\n public static void Main(string[] args)\n {\n getMessage();\n }\n\n public static void connectMQ()\n { \n QueueManagerName = ConfigurationManager.AppSettings[\"QueueManager\"];\n QueueName = ConfigurationManager.AppSettings[\"Queuename\"];\n ChannelInfo = ConfigurationManager.AppSettings[\"ChannelInformation\"];\n PortNumber = ConfigurationManager.AppSettings[\"Port\"];\n char[] separator = { '/' };\n string[] ChannelParams;\n ChannelParams = ChannelInfo.Split(separator);\n channelName = ConfigurationManager.AppSettings[\"Channel\"];\n transportType = ConfigurationManager.AppSettings[\"TransportType\"];\n connectionName = ConfigurationManager.AppSettings[\"ConnectionName\"];\n queueManager = new MQQueueManager(QueueManagerName,\n channelName, connectionName);\n strReturn = \"Connected Successfully\";\n\n // return strReturn;\n }\n\n public static void getMessage()\n {\n connectMQ();\n queue = queueManager.AccessQueue(QueueName,\n MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING);\n\n while (running)\n {\n try\n {\n queueMessage = new MQMessage();\n queueMessage.Format = MQC.MQFMT_STRING;\n queueGetMessageOptions = new MQGetMessageOptions();\n queue.Get(queueMessage, queueGetMessageOptions);\n strReturn = queueMessage.ReadString (queueMessage.MessageLength);\n //messageavailable = MQC.MQRC_NO_MSG_AVAILABLE;\n // strReturn1 = strReturn + \"@@@@@@@\" + messageavailable;\n }\n catch (MQException exp)\n {\n strReturn = \"Exception: \" + exp.Message;\n }\n\n\n if (strReturn != \"Exception: MQRC_NO_MSG_AVAILABLE\")\n {\n string path = ConfigurationManager.AppSettings[\"xmlFilePath\"];\n string fileName = path + \"MQMessage\" + DateTime.Now.ToString(\"yyyyMMddHHmmssfff\") + \".xml\";\n System.IO.File.WriteAllText(fileName, strReturn);\n }\n else if (strReturn == \"Exception: MQRC_NO_MSG_AVAILABLE\")\n {\n queueManager.Disconnect();\n string path = ConfigurationManager.AppSettings[\"logFilePath\"];\n string fileName = path + \"MQLog\" + DateTime.Now.ToString(\"yyyyMMddHHmmssfff\") + \".txt\";\n System.IO.File.WriteAllText(fileName, strReturn);\n System.Timers.Timer aTimer = new System.Timers.Timer();\n aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);\n aTimer.Interval = 30000;\n aTimer.Enabled = true;\n }\n else\n {\n queueManager.Disconnect();\n string path = ConfigurationManager.AppSettings[\"logFilePath\"];\n string fileName = path + \"MQLog\" + DateTime.Now.ToString(\"yyyyMMddHHmmssfff\") + \".txt\";\n System.IO.File.WriteAllText(fileName, strReturn);\n System.Timers.Timer aTimer = new System.Timers.Timer();\n aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);\n aTimer.Interval = 30000;\n aTimer.Enabled = true;\n }\n }\n }\n\n public static void OnTimedEvent(object source, ElapsedEventArgs e)\n {\n getMessage();\n }\n }\n}So here I used timer to reconnect but it increases open input count . Please help### Assistant: So here I used timer to reconnect but it increases open input countThat's because you are not closing the queue before opening it again.queueManager = new MQQueueManager(QueueManagerName, channelName, connectionName);Using MQQueueManager class this way means that there is no security i.e. SSL/TLS or security exit. Bad idea. You should set the connection information in a Hashtable and pass the Hashtable to the MQQueueManager class.Also, you should be using \"MQGet with wait\" rather than polling using a timer.Here is a sample C# program that uses a Hashtable for connection information and performs an \"MQGet with wait\":using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Text;\nusing IBM.WMQ;\n\n///

Program Name\n/// MQTest62\n///\n/// Description\n/// This C# class will connect to a remote queue manager\n/// and get messages from a queue using a managed .NET environment.\n///\n/// Sample Command Line Parameters\n/// -h 127.0.0.1 -p 1415 -c TEST.CHL -m MQWT1 -q TEST.Q1 -u tester -x mypwd\n/// \n/// Roger Lacroix\n/// \nnamespace MQTest62\n{\n public class MQTest62\n {\n private Hashtable inParms = null;\n private Hashtable qMgrProp = null;\n private System.String qManager;\n private System.String inputQName;\n\n /*\n * The constructor\n */\n public MQTest62()\n : base()\n {\n }\n\n /// Make sure the required parameters are present.\n /// true/false\n /// \n private bool allParamsPresent()\n {\n bool b = inParms.ContainsKey(\"-h\") && inParms.ContainsKey(\"-p\") &&\n inParms.ContainsKey(\"-c\") && inParms.ContainsKey(\"-m\") &&\n inParms.ContainsKey(\"-q\");\n if (b)\n {\n try\n {\n System.Int32.Parse((System.String)inParms[\"-p\"]);\n }\n catch (System.FormatException e)\n {\n b = false;\n }\n }\n\n return b;\n }\n\n /// Extract the command-line parameters and initialize the MQ variables.\n /// \n /// \n /// IllegalArgumentException \n private void init(System.String[] args)\n {\n inParms = System.Collections.Hashtable.Synchronized(new System.Collections.Hashtable(14));\n if (args.Length > 0 && (args.Length % 2) == 0)\n {\n for (int i = 0; i < args.Length; i += 2)\n {\n inParms[args[i]] = args[i + 1];\n }\n }\n else\n {\n throw new System.ArgumentException();\n }\n\n if (allParamsPresent())\n {\n qManager = ((System.String)inParms[\"-m\"]);\n inputQName = ((System.String)inParms[\"-q\"]);\n\n qMgrProp = new Hashtable();\n qMgrProp.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\n\n qMgrProp.Add(MQC.HOST_NAME_PROPERTY, ((System.String)inParms[\"-h\"]));\n qMgrProp.Add(MQC.CHANNEL_PROPERTY, ((System.String)inParms[\"-c\"]));\n\n try\n {\n qMgrProp.Add(MQC.PORT_PROPERTY, System.Int32.Parse((System.String)inParms[\"-p\"]));\n }\n catch (System.FormatException e)\n {\n qMgrProp.Add(MQC.PORT_PROPERTY, 1414);\n }\n\n if (inParms.ContainsKey(\"-u\"))\n qMgrProp.Add(MQC.USER_ID_PROPERTY, ((System.String)inParms[\"-u\"]));\n\n if (inParms.ContainsKey(\"-x\"))\n qMgrProp.Add(MQC.PASSWORD_PROPERTY, ((System.String)inParms[\"-x\"]));\n\n System.Console.Out.WriteLine(\"MQTest62:\");\n Console.WriteLine(\" QMgrName ='{0}'\", qManager);\n Console.WriteLine(\" Output QName ='{0}'\", inputQName);\n\n System.Console.Out.WriteLine(\"QMgr Property values:\");\n foreach (DictionaryEntry de in qMgrProp)\n {\n Console.WriteLine(\" {0} = '{1}'\", de.Key, de.Value);\n }\n }\n else\n {\n throw new System.ArgumentException();\n }\n }\n\n /// Connect, open queue, read (browse) a message, close queue and disconnect. \n ///\n private void testReceive()\n {\n MQQueueManager qMgr = null;\n MQQueue inQ = null;\n int openOptions = MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING;\n\n try\n {\n qMgr = new MQQueueManager(qManager, qMgrProp);\n System.Console.Out.WriteLine(\"MQTest62 successfully connected to \" + qManager);\n\n inQ = qMgr.AccessQueue(inputQName, openOptions);\n System.Console.Out.WriteLine(\"MQTest62 successfully opened \" + inputQName);\n\n testLoop(inQ);\n\n }\n catch (MQException mqex)\n {\n System.Console.Out.WriteLine(\"MQTest62 cc=\" + mqex.CompletionCode + \" : rc=\" + mqex.ReasonCode);\n }\n catch (System.IO.IOException ioex)\n {\n System.Console.Out.WriteLine(\"MQTest62 ioex=\" + ioex);\n }\n finally\n {\n try\n {\n if (inQ != null)\n inQ.Close();\n System.Console.Out.WriteLine(\"MQTest62 closed: \" + inputQName);\n }\n catch (MQException mqex)\n {\n System.Console.Out.WriteLine(\"MQTest62 cc=\" + mqex.CompletionCode + \" : rc=\" + mqex.ReasonCode);\n }\n\n try\n {\n if (qMgr != null)\n qMgr.Disconnect();\n System.Console.Out.WriteLine(\"MQTest62 disconnected from \" + qManager);\n }\n catch (MQException mqex)\n {\n System.Console.Out.WriteLine(\"MQTest62 cc=\" + mqex.CompletionCode + \" : rc=\" + mqex.ReasonCode);\n }\n }\n }\n\n private void testLoop(MQQueue inQ)\n {\n bool flag = true;\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.Options |= MQC.MQGMO_WAIT | MQC.MQGMO_FAIL_IF_QUIESCING;\n gmo.WaitInterval = 2500; // 2.5 seconds wait time or use MQC.MQEI_UNLIMITED to wait forever\n MQMessage msg = null;\n\n while (flag)\n {\n try\n {\n msg = new MQMessage();\n inQ.Get(msg, gmo);\n System.Console.Out.WriteLine(\"Message Data: \" + msg.ReadString(msg.MessageLength));\n }\n catch (MQException mqex)\n {\n System.Console.Out.WriteLine(\"MQTest62 CC=\" + mqex.CompletionCode + \" : RC=\" + mqex.ReasonCode);\n if (mqex.Reason == MQC.MQRC_NO_MSG_AVAILABLE)\n {\n // no meesage - life is good - loop again\n }\n else\n {\n flag = false; // severe error - time to exit\n }\n }\n catch (System.IO.IOException ioex)\n {\n System.Console.Out.WriteLine(\"MQTest62 ioex=\" + ioex);\n }\n }\n }\n\n /// main line\n /// \n /// \n // [STAThread]\n public static void Main(System.String[] args)\n {\n MQTest62 write = new MQTest62();\n\n try\n {\n write.init(args);\n write.testReceive();\n }\n catch (System.ArgumentException e)\n {\n System.Console.Out.WriteLine(\"Usage: MQTest62 -h host -p port -c channel -m QueueManagerName -q QueueName [-u userID] [-x passwd]\");\n System.Environment.Exit(1);\n }\n catch (MQException e)\n {\n System.Console.Out.WriteLine(e);\n System.Environment.Exit(1);\n }\n\n System.Environment.Exit(0);\n }\n }\n}\n"} +{"text": "### Human: I am trying to connect Remote MQ using pro*c language , While connecting to MQ i am using MQCONNX and MQOPEN methods,After execution of MQOPEN method it returns an error MQRC 2018.Below is the code for reference .Also want to know is there any kind of authentication problem or server level problem causing this , As the same code with different method is working perfectly while connecting to local MQ client.Thanksint MS_MQ_Open(const char *chr_p_qmname, const char *chr_p_qname,\n const char *mode, MQHCONN *Hcon, MQHOBJ *Hobj,\n INTL_ENV_DATA_STRUCT_H *p_intlenv_data_struct_h,\n DEBUG_INFO_STRUCT_H **l_debug_info_ptr) {\n MQOD od = {MQOD_DEFAULT}; /* Object Descriptor */\n MQLONG OpenCode; /* MQOPEN completion code */\n MQLONG O_options;\n MQLONG Reason;\n MQLONG CReason;\n MQLONG CompCode;\n MQCNO mqcno = {MQCNO_DEFAULT}; /* Connection options */\n MQCD mqcd = {MQCD_CLIENT_CONN_DEFAULT}; /* Channel Defs */\n MQCSP csp = {MQCSP_DEFAULT};\n MQCHAR chr_l_qmname[MQ_Q_MGR_NAME_LENGTH];\n char userId[50];\n char password[50];\n strncpy(userId, \"XXXXXX\", 50);\n strncpy(chr_l_qmname, chr_p_qmname, MQ_Q_MGR_NAME_LENGTH);\n strncpy(mqcd.ConnectionName, \"10.000.00.00(port number)\",\n MQ_CONN_NAME_LENGTH);\n strncpy(mqcd.ChannelName, \"SVRCONN\", MQ_CHANNEL_NAME_LENGTH);\n mqcno.SecurityParmsPtr = &csp;\n mqcno.Version = MQCNO_VERSION_5;\n csp.AuthenticationType = MQCSP_AUTH_USER_ID_AND_PWD;\n csp.CSPUserIdPtr = userId;\n csp.CSPUserIdOffset = 0;\n csp.CSPUserIdLength = strlen(userId);\n strncpy(password, \"XXXX\", 50);\n csp.CSPPasswordPtr = password;\n csp.CSPPasswordOffset = 0;\n csp.CSPPasswordLength = strlen(password);\n mqcno.ClientConnPtr = &mqcd;\n mqcno.Version = MQCNO_VERSION_5;\n\n MQCONNX(chr_l_qmname, &mqcno, &Hcon, &CompCode, &CReason);\n if (CompCode == MQCC_FAILED) {\n printf(\"MQCONNX ended with reason code |%ld|\\n\", CReason);\n }\n strncpy(od.ObjectName, chr_p_qname, (size_t)MQ_Q_NAME_LENGTH);\n if (!strcmp(mode, \"I\")) {\n O_options = MQOO_INQUIRE + MQOO_FAIL_IF_QUIESCING;\n } else if (!strcmp(mode, \"O\")) {\n O_options = MQOO_OUTPUT /* open queue for output */\n + MQOO_FAIL_IF_QUIESCING +\n MQOO_SET_ALL_CONTEXT; /* but not if MQM stopping */\n } else {\n printf(\"Invalid mode %s\\n\", mode);\n APL_GOBACK_FAIL\n }\n MQOPEN(Hcon, &od, O_options, &Hobj, &OpenCode, &Reason);\n if (Reason != MQRC_NONE) {\n printf(\"MQOPEN ended with reason code |%ld|\\n\", Reason);\n }\n}### Assistant: The MQ Reason code 2018 (MQRC_HCONN_ERROR) means that yourHconparameter is not correct. Your code tests for theCompCodebeingMQCC_FAILED, but does not check forMQCC_WARNING. I suggest that you change this test to the following:-if (CompCode != MQCC_OK) {\n printf(\"MQCONNX ended with reason code |%ld|\\n\", CReason);\n}It is possible that you have run into one of the fewMQCC_WARNINGreason codesand that theHconis not set for the one you have hit.Good practice is to set yourHconparameter to the value MQHC_UNUSABLE_HCONN prior to making a call to MQCONN or MQCONNX, and then test that theHconparameter is no longer set to that value before making a call to something like MQOPEN. This will mean that you can be certain that your MQCONN(X) call set theHconparameter to something that should not cause a 2018.if (Hcon != MQHC_UNUSABLE_HCONN)\n{\n MQOPEN(Hcon, &od, O_options, &Hobj, &OpenCode, &Reason);\n if (Reason != MQRC_NONE) {\n printf(\"MQOPEN ended with reason code |%ld|\\n\", Reason);\n }\n}\n"} +{"text": "### Human: I am trying to fetch Current Depth, Last Puttime & last get time using java from IBM Mq's to monitor queue performance. I was able to fetch LPUTTIME & current depth using below code. I am using MQMESSAGE browse api. But i am having hard time to fetch the LGETTIME (Last message get time)- last message that was processed out of queue. Because MQMESSAGE browse has nothing like Last get time. Any help regarding this ????public int depthOf(String queueName) throws MQException {\n MQQueue queue = qmgr.accessQueue(queueName, mqOpnOpt, null, null, null);\n int qDpth = queue.getCurrentDepth();\n\n queue.close();\n //qmgr.disconnect();\n System.out.println(\"Current Depth of \"+ queueName + \" is \" + qDpth); \n return qDpth;\n}\n\n@SuppressWarnings(\"unchecked\")\nprivate MQQueueManager createQueueManager() throws MQException {\n MQEnvironment.channel = channel;\n MQEnvironment.port = port;\n MQEnvironment.hostname = host;\n MQEnvironment.properties.put(CMQC.TRANSPORT_PROPERTY,\n CMQC.TRANSPORT_MQSERIES);\n\n return new MQQueueManager(manager);\n}\n\n/**\n * Returns 1st message put time when it is put in to Queue and not consumed.\n * \n * @return\n * @throws MQException\n */\npublic int queueMsgAge() throws MQException {\n MQQueue queue = null;\n MQMessage message = new MQMessage();\n queue = qmgr.accessQueue(queueName, MQC.MQOO_BROWSE\n | MQC.MQOO_FAIL_IF_QUIESCING);\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.options = MQC.MQGMO_BROWSE_FIRST | MQC.MQGMO_NO_WAIT;\n queue.get(message, gmo);\n\n GregorianCalendar cal = message.putDateTime;\n long ageInMillis = new java.util.Date().getTime()\n - cal.getTime().getTime();\n int ageInSeconds = (int) ageInMillis / 1000;\n System.out.println(\"Put Date & Time: \"+ cal.getTime()\n + \" Age of Msg in seconds: \" + ageInSeconds + \" Queue Name \"\n + queueName);\n _log.info(\"Put Date & Time: \" + cal.getTime() + \" Age of Msg in seconds: \"\n + ageInSeconds + \" Queue Name \" + queueName);\n return ageInSeconds;\n}### Assistant: First read JoshMc & Morag's comments above.Second, you should play around with runmqsc issuing both types of Queue Status commands. i.e. HANDLE vs QUEUE. Note: You are interested in the values related to Queue Status Type(QUEUE).i.e. runmqsc command:DIS QSTATUS(TEST.Q1) TYPE(QUEUE)Third, don't use the MQEnvironment class as it is not thread safe. Put the connection information in a Hashtable and pass the Hashtable to the MQQueueManager class.As mentioned in the comments above, you cannot retrieve that information via a regular MQ program. You need to write a MQ Java program that issues a PCF command to the queue manager's command server.When creating a PCF request message, the parameters MUST added in a particular order. It is a bit of a pain but you just get use to it.Here is a simple MQ Java program that will issue a PCF \"Inquire Queue Status\" command, get the PCF response messages, loop through the PCF responses and output the information.import java.io.IOException;\nimport java.text.SimpleDateFormat;\nimport java.util.Date;\nimport java.util.Hashtable;\n\nimport com.ibm.mq.MQException;\nimport com.ibm.mq.MQQueueManager;\nimport com.ibm.mq.constants.CMQC;\nimport com.ibm.mq.constants.CMQCFC;\nimport com.ibm.mq.headers.MQDataException;\nimport com.ibm.mq.headers.pcf.PCFMessage;\nimport com.ibm.mq.headers.pcf.PCFMessageAgent;\n\n/**\n * Program Name\n * MQListQueueStatus01\n *\n * Description\n * This java class issues a PCF \"inquire queue status\" request message for all (\"*\") queues \n * of a remote queue manager. \n *\n * Sample Command Line Parameters\n * -m MQA1 -h 127.0.0.1 -p 1414 -c TEST.CHL -q TEST.Q1 -u UserID -x Password\n *\n * @author Roger Lacroix\n */\npublic class MQListQueueStatus01\n{\n private static final SimpleDateFormat lOGGER_TIMESTAMP = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss.SSS\");\n\n private Hashtable params;\n private Hashtable mqht;\n private String qMgrName;\n\n public MQListQueueStatus01()\n {\n super();\n params = new Hashtable();\n mqht = new Hashtable();\n }\n\n /**\n * Make sure the required parameters are present.\n * @return true/false\n */\n private boolean allParamsPresent()\n {\n boolean b = params.containsKey(\"-h\") && params.containsKey(\"-p\") &&\n params.containsKey(\"-c\") && params.containsKey(\"-m\") &&\n params.containsKey(\"-u\") && params.containsKey(\"-x\");\n if (b)\n {\n try\n {\n Integer.parseInt((String) params.get(\"-p\"));\n }\n catch (NumberFormatException e)\n {\n b = false;\n }\n }\n\n return b;\n }\n\n /**\n * Extract the command-line parameters and initialize the MQ HashTable.\n * @param args\n * @throws IllegalArgumentException\n */\n private void init(String[] args) throws IllegalArgumentException\n {\n int port = 1414;\n if (args.length > 0 && (args.length % 2) == 0)\n {\n for (int i = 0; i < args.length; i += 2)\n {\n params.put(args[i], args[i + 1]);\n }\n }\n else\n {\n throw new IllegalArgumentException();\n }\n\n if (allParamsPresent())\n {\n qMgrName = (String) params.get(\"-m\");\n\n try\n {\n port = Integer.parseInt((String) params.get(\"-p\"));\n }\n catch (NumberFormatException e)\n {\n port = 1414;\n }\n\n mqht.put(CMQC.CHANNEL_PROPERTY, params.get(\"-c\"));\n mqht.put(CMQC.HOST_NAME_PROPERTY, params.get(\"-h\"));\n mqht.put(CMQC.PORT_PROPERTY, new Integer(port));\n mqht.put(CMQC.USER_ID_PROPERTY, params.get(\"-u\"));\n mqht.put(CMQC.PASSWORD_PROPERTY, params.get(\"-x\"));\n\n // I don't want to see MQ exceptions at the console.\n MQException.log = null;\n }\n else\n {\n throw new IllegalArgumentException();\n }\n }\n\n private void doPCF()\n {\n MQQueueManager qMgr = null;\n PCFMessageAgent agent = null;\n PCFMessage request = null;\n PCFMessage[] responses = null;\n\n try\n {\n qMgr = new MQQueueManager(qMgrName, mqht);\n MQListQueueStatus01.logger(\"successfully connected to \"+ qMgrName);\n\n agent = new PCFMessageAgent(qMgr);\n MQListQueueStatus01.logger(\"successfully created agent\");\n\n // https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.1.0/com.ibm.mq.ref.adm.doc/q087880_.htm\n request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_Q_STATUS);\n\n /**\n * You can explicitly set a queue name like \"TEST.Q1\" or\n * use a wild card like \"TEST.*\"\n */\n request.addParameter (CMQC.MQCA_Q_NAME, \"*\");\n request.addParameter(CMQCFC.MQIACF_Q_STATUS_TYPE, CMQCFC.MQIACF_Q_STATUS);\n\n request.addParameter(CMQCFC.MQIACF_Q_STATUS_ATTRS,\n new int [] { CMQC.MQCA_Q_NAME,\n CMQC.MQIA_CURRENT_Q_DEPTH,\n CMQC.MQIA_OPEN_INPUT_COUNT,\n CMQC.MQIA_OPEN_OUTPUT_COUNT,\n CMQCFC.MQCACF_LAST_PUT_DATE,\n CMQCFC.MQCACF_LAST_PUT_TIME,\n CMQCFC.MQCACF_LAST_GET_DATE,\n CMQCFC.MQCACF_LAST_GET_TIME,\n });\n\n responses = agent.send(request);\n\n for (int i = 0; i < responses.length; i++)\n {\n if ((responses[i]).getCompCode() == CMQC.MQCC_OK)\n {\n String name = responses[i].getStringParameterValue(CMQC.MQCA_Q_NAME);\n\n int depth = responses[i].getIntParameterValue(CMQC.MQIA_CURRENT_Q_DEPTH);\n int iprocs = responses[i].getIntParameterValue(CMQC.MQIA_OPEN_INPUT_COUNT);\n int oprocs = responses[i].getIntParameterValue(CMQC.MQIA_OPEN_OUTPUT_COUNT);\n\n String lastPutDate = responses[i].getStringParameterValue(CMQCFC.MQCACF_LAST_PUT_DATE);\n String lastPutTime = responses[i].getStringParameterValue(CMQCFC.MQCACF_LAST_PUT_TIME);\n\n String lastGetDate = responses[i].getStringParameterValue(CMQCFC.MQCACF_LAST_GET_DATE);\n String lastGetTime = responses[i].getStringParameterValue(CMQCFC.MQCACF_LAST_GET_TIME);\n\n MQListQueueStatus01.logger(\"Name=\"+name.trim()+\" : depth=\"+depth + \" : iprocs=\"+iprocs+\" : oprocs=\"+oprocs+\" : lastPutDate='\"+lastPutDate.trim()+\"' : lastPutTime='\"+lastPutTime.trim()+\"' : lastGetDate='\"+lastGetDate.trim()+\"' : lastGetTime='\"+lastGetTime.trim()+\"'\");\n }\n }\n }\n catch (MQException e)\n {\n MQListQueueStatus01.logger(\"CC=\" +e.completionCode + \" : RC=\" + e.reasonCode);\n }\n catch (IOException e)\n {\n MQListQueueStatus01.logger(\"IOException:\" +e.getLocalizedMessage());\n }\n catch (MQDataException e)\n {\n MQListQueueStatus01.logger(\"MQDataException:\" +e.getLocalizedMessage());\n }\n finally\n {\n try\n {\n if (agent != null)\n {\n agent.disconnect();\n MQListQueueStatus01.logger(\"disconnected from agent\");\n }\n }\n catch (MQDataException e)\n {\n MQListQueueStatus01.logger(\"CC=\" +e.completionCode + \" : RC=\" + e.reasonCode);\n }\n\n try\n {\n if (qMgr != null)\n {\n qMgr.disconnect();\n MQListQueueStatus01.logger(\"disconnected from \"+ qMgrName);\n }\n }\n catch (MQException e)\n {\n MQListQueueStatus01.logger(\"CC=\" +e.completionCode + \" : RC=\" + e.reasonCode);\n }\n }\n }\n\n /**\n * A simple logger method\n * @param data\n */\n public static void logger(String data)\n {\n String className = Thread.currentThread().getStackTrace()[2].getClassName();\n\n // Remove the package info.\n if ( (className != null) && (className.lastIndexOf('.') != -1) )\n className = className.substring(className.lastIndexOf('.')+1);\n\n System.out.println(lOGGER_TIMESTAMP.format(new Date())+\" \"+className+\": \"+Thread.currentThread().getStackTrace()[2].getMethodName()+\": \"+data);\n }\n\n public static void main(String[] args)\n {\n MQListQueueStatus01 mqlqs = new MQListQueueStatus01();\n\n try\n {\n mqlqs.init(args);\n mqlqs.doPCF();\n }\n catch (IllegalArgumentException e)\n {\n MQListQueueStatus01.logger(\"Usage: java MQListQueueStatus01 -m QueueManagerName -h host -p port -c channel -u UserID -x Password\");\n System.exit(1);\n }\n\n System.exit(0);\n }\n}\n"} +{"text": "### Human: A vendor have given me a .jks to connect to their mq via jms. I am using the following code as a template for my proof of concept.Connecting to a Websphere MQ in Java with SSL/KeystoreThe creation of the Keystore is fine, however when it attempts to create a Truststore it loads a new .jks file. Am i supposed to generate this file or should it have been provided as currently I am unable to create it.// instantiate a KeyStore with type JKS\n KeyStore ks = KeyStore.getInstance(\"JKS\");\n // load the contents of the KeyStore\n ks.load(new FileInputStream(\"/home/hudo/hugo.jks\"), KSPW);\n System.out.println(\"Number of keys on JKS: \"\n + Integer.toString(ks.size()));\n\n // Create a keystore object for the truststore\n KeyStore trustStore = KeyStore.getInstance(\"JKS\");\n // Open our file and read the truststore (no password)\n trustStore.load(new FileInputStream(\"/home/xwgztu2/xwgztu2.jks\"), null);Thanks### Assistant: There are a lot of assumptions in this answer (as the question does't provide much of information), but I as well assume it comes with the amount of experience.To create an SSL connection, the server must have a keypair (private, public key and a certificate bount to the public key) and client must trust the certificate (or its issuer). There is as well an option for mutual SSL (aka client auth ssl), where the client needs its own keypair and certificate and the server needs to trust the client's certificate.Truststore it loads a new .jks file. Am i supposed to generate this file or should it have been provided as currently I am unable to create it.The truststore should effectively contain the issuer certificate of the server's certificate (if a self-signed certificate is used, it is the same one).You can get the certificate byconnecting to the serviceopenssl s_client -connect host:port -showcertsand then import the returned certificate into a new keystore (using e.g.keytool -importcertcommand)keytool -importcert -keystore mytruststore.jks -alias mqserver -file servercert.pemIf the server returns you multiple certificates (certificate chain), you may import them all.If you are not able to do so, just ask the service provider (someone who deploys the MQ) to provide you the certificate or the truststore.\n"} +{"text": "### Human: As a requirement of our partner, We have to make MQ connections on different ports. And the requirement is to configureseparateCCDT files for each port because. All connections are made on one client application (oneProcess).Because our client application is oneProcessI can't configure the below environment variables for each port separately.How environment variables are set for configuring Client Channel Definition (This is .NET C#):Environment.SetEnvironmentVariable(\"MQCHLLIB\", @\"C:\\ProgramData\\IBM\\MQ\");\n Environment.SetEnvironmentVariable(\"MQCHLTAB\", \"AMQCLCHL.TAB\");Our problem; We have to set these environment variables on connection level and not on Process or Global level. Any suggestions?Update below is from info gathered in comments and Chat:Requirement is to configure Header and Message compression with XMS.NET.Per IBM's answer to IBM Community Forums post \"Header and message compression on IBM.XMS with C# .NET\" XMS.NET can only utilize compression using a CCDT.CCDT Entries haveQMNAME(*).Difference between CCDT entries is only thePORT.### Assistant: Are you saying that once you start your application (process), it will connect & disconnect to/from different queue managers in one execution? If so, then setting the environment variables then changing them on the fly will not work.A better approach is to have an INI file with 4 sections - 1 per port. Have your application load the particular section from the INI file, create a Hashtable with those particular values and pass the Hashtable to the MQQueueManager class.For more information about reading an INI file see:https://code.msdn.microsoft.com/windowsdesktop/Reading-and-Writing-Values-85084b6aI would set your 1414 section of the INI file as:[Port1414]\nmq.qmname=MQA1\nmq.channel=TEST.CHL\nmq.hostname=10.10.10.10\nmq.port=1414\nmq.userid=MyUserId\nmq.inputq=SOME.INPUT.QUEUE\nmq.outputq=SOME.OUTPUT.QUEUEAnd for 1415 section of the INI file as:[Port1415]\nmq.qmname=MQA1\nmq.channel=TEST.CHL\nmq.hostname=10.10.10.10\nmq.port=1415\nmq.userid=MyUserId\nmq.inputq=SOME.INPUT.QUEUE2\nmq.outputq=SOME.OUTPUT.QUEUE2and the same for the 1415 & 1416.After reading the particular section of the INI file, you would do:Hashtable qMgrProp = new Hashtable();\nqMgrProp.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\nqMgrProp.Add(MQC.CHANNEL_PROPERTY, channelName);\nqMgrProp.Add(MQC.HOST_NAME_PROPERTY, hostname);\nqMgrProp.Add(MQC.PORT_PROPERTY, 1414);\nqMgrProp.Add(MQC.USER_ID_PROPERTY, userId);\n\nMQQueueManager qMgr = new MQQueueManager(qManager, qMgrProp);\n"} +{"text": "### Human: I try to receive the message from the MQ.\nI can able to see the messages in the MQ Explorer.\nBut i cant able to get the messages. It always return null.\nBut i can able to drop message to the Queue.The code is here.MQQueueConnectionFactory cf = new MQQueueConnectionFactory();\n cf.setHostName(\"localhost\");\n cf.setPort(1415);\n\n cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\n\n cf.setQueueManager(\"TEST\");\n cf.setChannel(\"TEST.CHANNEL\");\n\n\n MQQueueConnection connection = (MQQueueConnection)cf.createQueueConnection(\"mqusr\",\"q@789945\");\n\n MQQueueSession session = (MQQueueSession) connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\n MQQueue replyQueue = (MQQueue) session.createQueue(\"queue:///TEST.REPLY.QUEUE\");\n MQQueueReceiver receiver = (MQQueueReceiver) session.createReceiver(replyQueue);\n\n TextMessage receivedMessage = (TextMessage) receiver.receive(10000);\n String reponseMessage = receivedMessage != null ? receivedMessage.toString() : \"\";### Assistant: To receive the message you need to issue connection.start() before doing a receive.receive(10000) \u2013\n"} +{"text": "### Human: Can any one tell me how to exclude system objects while taking backup of queue manager using save queue manager and dump queue manager commands?### Assistant: Another tool that you can used instead ofsaveqmgrordmpmqcfgwhich can excludeSYSTEM.*objects when making a backup of all your queue manager object definitions is MO71.\n"} +{"text": "### Human: I am getting the following error in my log file:2018-04-19 11:42:17,564 ERROR QueueContainer - Error com.ibm.msg.client.jms.DetailedIllegalStateException: JMSWMQ2002: Failed to get a message from destination. WebSphere MQ classes for JMS attempted to perform an MQGET; however WebSphere MQ reported an error. Use the linked exception to determine the cause of this error.\n at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:496)\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:236)\n at com.ibm.msg.client.wmq.internal.WMQMessageConsumer.checkJmqiCallSuccess(WMQMessageConsumer.java:130)\n at com.ibm.msg.client.wmq.internal.WMQConsumerShadow.getMsg(WMQConsumerShadow.java:1431)\n at com.ibm.msg.client.wmq.internal.WMQSyncConsumerShadow.receiveInternal(WMQSyncConsumerShadow.java:239)\n at com.ibm.msg.client.wmq.internal.WMQConsumerShadow.receive(WMQConsumerShadow.java:1135)\n at com.ibm.msg.client.wmq.internal.WMQMessageConsumer.receive(WMQMessageConsumer.java:469)\n at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl.receiveInboundMessage(JmsMessageConsumerImpl.java:883)\n at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl.receive(JmsMessageConsumerImpl.java:546)\n at com.ibm.mq.jms.MQMessageConsumer.receive(MQMessageConsumer.java:258)\n at com.damco.tools.proxy.mq.jms.JMSQueueReader.readNextMessage(JMSQueueReader.java:44)\n at com.damco.tools.proxy.QueueContainer.runMessageLoop(QueueContainer.java:122)\n at com.damco.tools.proxy.QueueContainer.run(QueueContainer.java:107)\n at java.lang.Thread.run(Thread.java:767)\nCaused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2016' ('MQRC_GET_INHIBITED').\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:223)\n ... 12 moreWhat can be the reason and resolution for this?### Assistant: As previous person stated, the queue from which you would like to GET the message has GET inhibited.\nHowever on QLOCAL level it is shown as:DIS QL(\"QUEUE.A\") GET(DISABLED)so you need to ask MQ admin or if you have access to enable it.ALTER QL(QUEUE.A) GET(ENABLED)then try and it would work as charm!\n"} +{"text": "### Human: I'm getting this error message, MQRC_HOST_NOT_AVAILABLE, when connecting to IBMMQ.I'm relatively new to working with IBMMQ, but have been handed this project and need to get our .NET WCF code talking to MQ.Our code currently looks like this:Hashtable queueManagerProps = new Hashtable();\nqueueManagerProps.Add(MQC.HOST_NAME_PROPERTY, mqhost);\nqueueManagerProps.Add(MQC.CHANNEL_PROPERTY, mqchannel);\nqueueManagerProps.Add(MQC.PORT_PROPERTY, ConfigurationManager.AppSettings[\"MQPort\"].ToString());\nqueueManagerProps.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\ntry\n{\n mqQMgr = new MQQueueManager(qmname, queueManagerProps);\n}\ncatch (Exception ex)\n{\n throw new Exception(String.Format(\"Failed to connect to MQ Queue Manager {0}, channel {1} on host {2} on port {3}. Check inner exception for root cause.\", qmname, mqchannel, mqhost, ConfigurationManager.AppSettings[\"MQPort\"].ToString()), ex);\n}I have confirmed that (1) all the properties contain values, and (2) the values match the setup of our MQ server.I also looked in the AMQERR01.LOG log file and there have been no entries since we set up the queue earlier this month.Why is my new MQQueueManager() called throwing this exception? Is there any chance this could be a permissions issue, or is it definitely network / connectivity / configuration related?### Assistant: Found the problem. I had the host name misspelt.The moral of the story is don't overlook the fundamentals, even when working with a technology you don't understand.Admins: please feel free to delete this question if you don't find it useful.\n"} +{"text": "### Human: We're trying to send a message on an IBM MQ Message Queue.We can contact the Queue Manager, but as soon as we call theMQMessageconstructor, the process hangs. We suspect that this is actually because whateverAccessQueueis doing is failing.using (MQQueueManager qMgr = new MQQueueManager(queueManagerName, connectionProperties))\n {\n // Set up the options on the queue we want to open\n int openOptions = MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING; \n\n // Now specify the queue that we want to open,and the open options\n MQQueue system_default_local_queue =\n qMgr.AccessQueue(sendQueueName, openOptions); // we suspect this is actually where things are wrong\n\n // Define a WebSphere MQ message, writing some text in UTF format\n MQMessage mqMessage = new MQMessage(); // ** THIS HANGS\n mqMessage.WriteUTF(text);\n\n // Specify the message options\n MQPutMessageOptions pmo = new MQPutMessageOptions(); // accept the defaults,\n // same as MQPMO_DEFAULT\n\n // Put the message on the queue\n system_default_local_queue.Put(mqMessage, pmo);\n\n system_default_local_queue.Close();\n\n // Disconnect from the queue manager\n qMgr.Disconnect();\n }Is there an option we're not including or something we're missing?We're using the the NuGet package WebSphereMqClient v8.0.0.7.Update:I'll include our connection properties for completeness based on feedback.Hashtable connectionProperties = new Hashtable();\n connectionProperties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\n connectionProperties.Add(MQC.USE_MQCSP_AUTHENTICATION_PROPERTY, true);\n // Set up the rest of the connection properties, based on the\n // connection type requested\n // this is all for MQC.TRANSPORT_MQSERIES_MANAGED\n connectionProperties.Add(MQC.HOST_NAME_PROPERTY, \"myserver.com\");\n connectionProperties.Add(MQC.CHANNEL_PROPERTY, \"MY.CHANNEL\");\n connectionProperties.Add(MQC.PORT_PROPERTY, 3223);\n connectionProperties.Add(MQC.CONNECT_OPTIONS_PROPERTY, MQC.MQCNO_RECONNECT_Q_MGR);In answer to a question from Roger, this is a Managed Queue.### Assistant: You don't show us your connection properties, so I don't know if you set everything correctly. Did you make sure you set 'managed mode'? Also, why aren't you doing any print-outs of what the code has completed?Here is a complete and working C# .NET/MQ program that uses 'managed mode' connection.using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Text;\nusing IBM.WMQ;\n\n/// Program Name\n/// MQTest51\n///\n/// Description\n/// This C# class will connect to a remote queue manager\n/// and put a message to a queue under a managed .NET environment.\n///\n/// Sample Command Line Parameters\n/// -h 127.0.0.1 -p 1414 -c TEST.CHL -m MQWT1 -q TEST.Q1\n///\n/// \nnamespace MQTest51\n{\n class MQTest51\n {\n private Hashtable inParms = null;\n private Hashtable qMgrProp = null;\n private System.String qManager;\n private System.String outputQName;\n\n /*\n * The constructor\n */\n public MQTest51()\n : base()\n {\n }\n\n /// Make sure the required parameters are present.\n /// true/false\n /// \n private bool allParamsPresent()\n {\n bool b = inParms.ContainsKey(\"-h\") && inParms.ContainsKey(\"-p\") &&\n inParms.ContainsKey(\"-c\") && inParms.ContainsKey(\"-m\") &&\n inParms.ContainsKey(\"-q\");\n if (b)\n {\n try\n {\n System.Int32.Parse((System.String)inParms[\"-p\"]);\n }\n catch (System.FormatException e)\n {\n b = false;\n }\n }\n\n return b;\n }\n\n /// Extract the command-line parameters and initialize the MQ variables.\n /// \n /// \n /// IllegalArgumentException \n private void init(System.String[] args)\n {\n inParms = Hashtable.Synchronized(new Hashtable());\n if (args.Length > 0 && (args.Length % 2) == 0)\n {\n for (int i = 0; i < args.Length; i += 2)\n {\n inParms[args[i]] = args[i + 1];\n }\n }\n else\n {\n throw new System.ArgumentException();\n }\n\n if (allParamsPresent())\n {\n qManager = ((System.String)inParms[\"-m\"]);\n outputQName = ((System.String)inParms[\"-q\"]);\n\n qMgrProp = new Hashtable();\n\n qMgrProp.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\n\n qMgrProp.Add(MQC.HOST_NAME_PROPERTY, ((System.String)inParms[\"-h\"]));\n qMgrProp.Add(MQC.CHANNEL_PROPERTY, ((System.String)inParms[\"-c\"]));\n\n try\n {\n qMgrProp.Add(MQC.PORT_PROPERTY, System.Int32.Parse((System.String)inParms[\"-p\"]));\n }\n catch (System.FormatException e)\n {\n qMgrProp.Add(MQC.PORT_PROPERTY, 1414);\n }\n\n if (inParms.ContainsKey(\"-u\"))\n qMgrProp.Add(MQC.USER_ID_PROPERTY, ((System.String)inParms[\"-u\"]));\n\n if (inParms.ContainsKey(\"-x\"))\n qMgrProp.Add(MQC.PASSWORD_PROPERTY, ((System.String)inParms[\"-x\"]));\n\n if ( (inParms.ContainsKey(\"-u\")) && (inParms.ContainsKey(\"-x\")) )\n qMgrProp.Add(MQC.USE_MQCSP_AUTHENTICATION_PROPERTY, true);\n }\n else\n {\n throw new System.ArgumentException();\n }\n }\n\n /// Connect, open queue, write a message, close queue and disconnect.\n ///\n /// \n /// MQException \n private void testSend()\n {\n MQQueueManager qMgr = null;\n MQQueue outQ = null;\n System.String line = \"This is a test message embedded in the MQTest51 program.\";\n int openOptions = MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING;\n MQPutMessageOptions pmo = new MQPutMessageOptions();\n\n try\n {\n qMgr = new MQQueueManager(qManager, qMgrProp);\n System.Console.Out.WriteLine(\"MQTest51 successfully connected to \" + qManager);\n\n outQ = qMgr.AccessQueue(outputQName, openOptions);\n System.Console.Out.WriteLine(\"MQTest51 successfully opened \" + outputQName);\n\n // Define a simple MQ message, and write some text in UTF format..\n MQMessage sendmsg = new MQMessage();\n sendmsg.Format = MQC.MQFMT_STRING;\n sendmsg.MessageType = MQC.MQMT_DATAGRAM;\n sendmsg.MessageId = MQC.MQMI_NONE;\n sendmsg.CorrelationId = MQC.MQCI_NONE;\n sendmsg.WriteString(line);\n\n // put the message on the outQ\n outQ.Put(sendmsg, pmo);\n System.Console.Out.WriteLine(\"Message Data>>>\" + line);\n }\n catch (MQException mqex)\n {\n System.Console.Out.WriteLine(\"MQTest51 CC=\" + mqex.CompletionCode + \" : RC=\" + mqex.ReasonCode);\n }\n catch (System.IO.IOException ioex)\n {\n System.Console.Out.WriteLine(\"MQTest51 ioex=\" + ioex);\n }\n finally\n {\n try\n {\n if (outQ != null)\n {\n outQ.Close();\n System.Console.Out.WriteLine(\"MQTest51 closed: \" + outputQName);\n }\n }\n catch (MQException mqex)\n {\n System.Console.Out.WriteLine(\"MQTest51 CC=\" + mqex.CompletionCode + \" : RC=\" + mqex.ReasonCode);\n }\n\n try\n {\n if (qMgr != null)\n {\n qMgr.Disconnect();\n System.Console.Out.WriteLine(\"MQTest51 disconnected from \" + qManager);\n }\n }\n catch (MQException mqex)\n {\n System.Console.Out.WriteLine(\"MQTest51 CC=\" + mqex.CompletionCode + \" : RC=\" + mqex.ReasonCode);\n }\n }\n }\n\n /// main line\n /// \n /// \n // [STAThread]\n public static void Main(System.String[] args)\n {\n MQTest51 write = new MQTest51();\n\n try\n {\n write.init(args);\n write.testSend();\n }\n catch (System.ArgumentException e)\n {\n System.Console.Out.WriteLine(\"Usage: MQTest51 -h host -p port -c channel -m QueueManagerName -q QueueName [-u userID] [-x passwd]\");\n System.Environment.Exit(1);\n }\n catch (MQException e)\n {\n System.Console.Out.WriteLine(e);\n System.Environment.Exit(1);\n }\n\n System.Environment.Exit(0);\n }\n }\n}\n"} +{"text": "### Human: I am using citrus integration framework to execute test cases that puts messages in IBM websphere MQ. When I am sending special headers with jms message headers. I am able to set correlation ID as mentioned in the header but I am unable to set messageID. Here is the headers I am sending\n \n \n \n
\n \n \n \n\n
here is the message id and correlation Id appearing in IBM MQ### Assistant: Bad idea, very bad idea to set the MessageId in MQ. Let MQ set and control the MessageId. Setting the CorrelationId is what you should be setting.The screen-shot shows that you set the CorrelationId to '161514131211109876543212' which is Hex='313631353134313331323131313039383736353433323132'.\n"} +{"text": "### Human: I want to use Apache Camel to get a message on IBM MQ in a spring boot project.\nI use sprin boot annotation based.\nI dont find any fully example: pom.xml, receiver, configuration class, ...Is there anyone to help me? Any link, documentation, ...?Thanks a lot of### Assistant: Take a look ata new Spring Boot Starter for MQthat may help here. The README shows how to modify the JMS Getting Started samplehereto use IBM MQ instead of ActiveMQ. And the MQ jars - including this starter - are all on Maven Central for easy access.\n"} +{"text": "### Human: I am migrating from Fuse 6.2.1 to 6.3-310, I am getting an osgi wiring package error. it looks like it is related to the IBM WMQ libraries, possible one of these bundles exports this javax.jms requirement. I have searched but cannot find, in hope that this has been discovered already. thank you in advance.#JBOSS ENV INFO \n JBossFuse:karaf@root> info\n Karaf\n Karaf version 2.4.0.redhat-630310\n Karaf home /app/instances/jboss-fuse-6.3.0.redhat-310\n Karaf base /app/instances/jboss-fuse-6.3.0.redhat-310\n OSGi Framework org.apache.felix.framework - 4.4.1\n\n JVM\n Java Virtual Machine Java HotSpot(TM) 64-Bit Server VM version 25.162-b12\n Version 1.8.0_162\n Vendor Oracle Corporation\n Pid 23619\n Uptime 1 hour 44 minutes\n Total compile time 1 minute\n Threads\n Live threads 85\n Daemon threads 67\n Peak 94\n Total started 214\n Memory\n Current heap size 93,729 kbytes\n Maximum heap size 932,352 kbytes\n Committed heap size 686,080 kbytes\n Pending objects 0\n Garbage collector Name = 'PS Scavenge', Collections = 48, Time = 1.019 seconds\n Garbage collector Name = 'PS MarkSweep', Collections = 4, Time = 1.140 seconds\n Classes\n Current classes loaded 10,801\n Total classes loaded 10,867\n Total classes unloaded 66\n Operating system\n Name Linux version 2.6.32-696.6.3.el6.x86_64\n Architecture amd64\n Processors 6\n #FUSE JMS BUNDLES\n JBossFuse:karaf@root> list -t 0 -s | grep jms\n [ 241] [Active ] [Created ] [ ] [ 80] org.apache.karaf.jms.core (2.4.0.redhat-630310)\n [ 242] [Active ] [ ] [ ] [ 30] org.apache.servicemix.bundles.spring-jms (3.2.18.RELEASE_1)\n [ 243] [Active ] [ ] [ ] [ 50] org.apache.camel.camel-jms (2.17.0.redhat-630310)\n [ 244] [Active ] [Created ] [ ] [ 80] org.apache.karaf.jms.command (2.4.0.redhat-630310)\n#EXPORTS\n JBossFuse:karaf@root> exports | grep jms\n 78 org.apache.cxf.binding.soap.jms.interceptor; version=3.1.5\n 218 org.apache.activemq.jms.pool; version=5.11.0.redhat-630310\n 218 org.apache.activemq.network.jms; version=5.11.0.redhat-630310\n 241 org.apache.karaf.jms; version=2.4.0\n 242 org.springframework.jms.core.support; version=3.2.18.RELEASE\n 242 org.springframework.jms.connection; version=3.2.18.RELEASE\n 242 org.springframework.jms.listener.adapter; version=3.2.18.RELEASE\n 242 org.springframework.jms.support; version=3.2.18.RELEASE\n 242 org.springframework.jms; version=3.2.18.RELEASE\n 242 org.springframework.jms.core; version=3.2.18.RELEASE\n 242 org.springframework.jms.config; version=3.2.18.RELEASE\n 242 org.springframework.jms.support.converter; version=3.2.18.RELEASE\n 242 org.springframework.jms.listener; version=3.2.18.RELEASE\n 242 org.springframework.jms.listener.endpoint; version=3.2.18.RELEASE\n 242 org.springframework.jms.support.destination; version=3.2.18.RELEASE\n 242 org.springframework.jms.remoting; version=3.2.18.RELEASE\n 243 org.apache.camel.component.jms; version=2.17.0.redhat-630310\n 243 org.apache.camel.component.jms.reply; version=2.17.0.redhat-630310\n 244 org.apache.karaf.jms.command; version=2.4.0.redhat-630310\n 244 org.apache.karaf.jms.command.completers; version=2.4.0.redhat-630310\n#IMPORTS\n JBossFuse:karaf@root> imports | grep jms\n JMS API (198): javax.jms; version=2.0.0\n JMS API (198): javax.jms; version=2.0.0\n JMS API (198): javax.jms; version=2.0.0\n JMS API (198): javax.jms; version=2.0.0\n JMS API (198): javax.jms; version=2.0.0\n Apache ServiceMix :: Bundles :: spring-jms (242): org.springframework.jms.connection; version=3.2.18.RELEASE\n Apache ServiceMix :: Bundles :: spring-jms (242): org.springframework.jms.support; version=3.2.18.RELEASE\n Apache ServiceMix :: Bundles :: spring-jms (242): org.springframework.jms; version=3.2.18.RELEASE\n Apache ServiceMix :: Bundles :: spring-jms (242): org.springframework.jms.core; version=3.2.18.RELEASE\n Apache ServiceMix :: Bundles :: spring-jms (242): org.springframework.jms.support.converter; version=3.2.18.RELEASE\n Apache ServiceMix :: Bundles :: spring-jms (242): org.springframework.jms.listener; version=3.2.18.RELEASE\n Apache ServiceMix :: Bundles :: spring-jms (242): org.springframework.jms.support.destination; version=3.2.18.RELEASE\n JMS API (198): javax.jms; version=2.0.0\n Apache Karaf :: JMS :: Core (241): org.apache.karaf.jms; version=2.4.0\n JMS API (198): javax.jms; version=2.0.0\n Apache ServiceMix :: Bundles :: spring-jms (242): org.springframework.jms.connection; version=3.2.18.RELEASE\n camel-jms (243): org.apache.camel.component.jms; version=2.17.0.redhat-630310\n JMS API (198): javax.jms; version=2.0.0\n camel-jms (243): org.apache.camel.component.jms; version=2.17.0.redhat-630310\n#FEATURES FILE\n \n \n \n camel-core\n camel-blueprint\n camel-csv\n camel-sql\n camel-velocity\n camel-xmlbeans\n\n mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j/1.6.1_5\n wrap:mvn:org.apache.poi/poi-ooxml-schemas/3.9$DynamicImport-package=*\n mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi/3.9_2\n\n mvn:com.ibm.msg.client.osgi/commonservices-j2se/7.5.0.2\n mvn:com.ibm.msg.client.osgi/nls/7.5.0.2\n mvn:com.ibm.msg.client.osgi/jms-prereq/7.5.0.2\n mvn:com.ibm.msg.client.osgi/jms/7.5.0.2\n mvn:com.ibm.msg.client.osgi/wmq-nls/7.5.0.2\n mvn:com.ibm.msg.client.osgi/wmq-prereq/7.5.0.2\n mvn:com.ibm.msg.client.osgi/wmq/7.5.0.2\n mvn:com.ibm.mq.osgi/directip/7.5.0.2\n wrap:mvn:mysql/mysql-connector-java/5.1.45\n wrap:mvn:com.mchange/mchange-commons-java/0.2.11\n wrap:mvn:com.mchange/c3p0/0.9.5.2$Bundle-SymbolicName=c3p0-0.9.5.2&Import-package=*;resolution:=optional;version=0\n wrap:mvn:org.springframework/spring-jdbc/5.0.3.RELEASE$Import-package=com.mysql.jdbc;resolution:=optional;version=0,javax.sql;resolution:=optional;version=0,org.apache.commons.logging;resolution:=optional;version=0,org.springframework.util;resolution:=0;version=0\n mvn:com.ge.ip.infra/delta-fadec-prod/3.0.1-SNAPSHOT\n \n \n\n # POM.XML\n \n\n UTF-8\n UTF-8\n\n 1.8\n 1.8\n\n \n 6.3.0.redhat-310\n 6.3.0.redhat-310\n\n \n 2.17.0.redhat-630310\n 2.17.0.redhat-630310\n 5.11.0.redhat-630310\n 2.4.0.redhat-630310\n 1.4.0.redhat-630310\n 1.2.0.redhat-630310\n 4.11\n 1.2.17\n 2.17.0.redhat-630310 \n 2.17.0.redhat-630310\n 2.9.2\n\n \n \n 7.5.0.2\n\n \n 1.0.6\n 0.10.0\n 1.4.0\n\n \n 2.5.1\n 2.3.7\n 1.8\n 2.4.3\n 2.3.7\n 1.0.0\n 2.8.1\n 1.2\n\n \n\n \n \n \n \n org.jboss.fuse.bom\n jboss-fuse-parent\n ${jboss.fuse.bom.version}\n pom\n import\n \n\n \n \n com.ibm.mq\n com.ibm.mq.dhbcore\n ${ibm-mq-version}\n \n \n com.ibm.mq\n com.ibm.mq.jmqi\n ${ibm-mq-version}\n \n \n com.ibm\n com.ibm.mq\n ${ibm-mq-version}\n \n \n com.ibm\n com.ibm.mqjms\n ${ibm-mq-version}\n \n \n org.springframework\n spring-jdbc\n 5.0.3.RELEASE\n \n \n com.mchange\n c3p0\n 0.9.5.2\n \n\n\n \n mysql\n mysql-connector-java\n 5.1.45\n \n\n \n joda-time\n joda-time\n ${joda-time-version}\n \n \n org.apache.servicemix.bundles\n org.apache.servicemix.bundles.dom4j\n 1.6.1_5\n \n \n org.apache.servicemix.bundles\n org.apache.servicemix.bundles.poi\n 3.9_2\n \n \n org.apache.poi\n poi-ooxml-schemas\n 3.9\n \n \n org.apache.poi\n poi-ooxml\n 3.9\n \n \n \n\n \n \n org.apache.camel\n camel-core\n \n \n org.apache.camel\n camel-blueprint\n \n \n org.apache.camel\n camel-mail\n \n \n org.apache.camel\n camel-ftp\n \n \n org.apache.activemq\n activemq-camel\n \n \n org.apache.camel\n camel-jaxb\n \n \n org.apache.camel\n camel-quartz\n \n \n org.apache.camel\n camel-bindy\n \n \n junit\n junit\n \n \n log4j\n log4j\n \n \n org.slf4j\n slf4j-log4j12\n \n \n org.slf4j\n slf4j-api\n \n \n\n \n install\n \n \n org.apache.maven.plugins\n maven-compiler-plugin\n ${version.maven-compiler-plugin}\n \n ${compiler.source.version}\n ${compiler.target.version}\n \n \n \n \n\n \n \n com.ge.ip.snapshot.local\n GE IP Releases\n http://10.0.0.12:8082/nexus/content/repositories/releases\n \n \n \n com.ge.ip.snapshot.local\n GE IP Snapshots\n http://10.0.0.12:8082/nexus/content/repositories/snapshots\n \n \n \n\n ### Assistant: On Fuse 6.2, the supplied JMS version was 1.1. This aligns with IBM MQ 7.5. On Fuse 6.3, the supplied JMS version is 2.0. This aligns with IBM MQ 8 and later.For IBM MQ 8, thecom.ibm.mq.osgi.allclientprereqs_8.0.0.8.jarbundle supplies the JMS API. You need to remove the jms.jar file from the bundle and edit the MANIFEST.MF file and remove the exports for javax.jms.\n"} +{"text": "### Human: Was trying to locate the IBM MQ client installable ( and dependent libraries ) for Mac operating system, but could not.\nTried couple of variations from the IBM site, but always ends up getting the error :package MQSeriesMsg_cs-.x86_64 is intended for a different operating systemAnyone faced this error and was able to get a proper version for MacOS,please suggest.### Assistant: If you are still looking for this, IBM now have an official toolkit. See this link:https://developer.ibm.com/components/ibm-mq/tutorials/mq-macos-dev/\n"} +{"text": "### Human: I have created a IBM Websphere MQ Muliti Instance queue manager and I need to connect to this Queue manager from jboss eap 6.4 to achieve High Availability### Assistant: Instead of using the 'host' and 'port' attributes, you can use the 'connectionNameList' property on the Connection Factory. The syntax is:connectionNameList\nmqhost1(1414), mqhost2(1414)\n"} +{"text": "### Human: I am trying to learnMessage oriented middle-ware (MOM), and in that pursuit referring to online material.I understand that MOM is used to make two heterogeneous systems communicate by message passing.I also came to know of various products like:IBM MQ / IBM WebSphere MQ / IBM MQSeriesRabbitMQApache ActiveMQAre these products implementation of conceptMessage oriented middle-ware? If so, is there any standard specification forMOM?### Assistant: These products are typical MOM implementations. There are a few others as well. As for standards, AMQP and MQTT are two standard for MOM communication. While not specifications, they are simply wire level protocols.Then there is JMS. It's more of a Java specification/API and less of a generic MOM spec, but it has been very influential for various messaging systems and is widely implemented among MOM providers.\n"} +{"text": "### Human: I want to increase IBM MQ MQGET throughput and notice in some conditions I can use QueueManager MQOO_READ_AHEAD option. In this way after first get execution, many records are transferred from server to client lib and be ready to read on next GETs. I want to control size of this read ahead messages count. I noticed that there is some Configuration properties as MaximumSize, PurgeTime, and UpdatePercentage but how can I set/control these values in my java client code?### Assistant: The properties that control behaviour of the client side ReadAhead message buffer are set with the client configuration file, mq client.ini under the MessageBuffer stanza:https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.con.doc/q016890_.htmHere is a link to the documentation that describes the client configuration file and the locations on the system where the MQ Java client code attempts to load it from:https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.con.doc/q016840_.htmI'm not aware of way to specify the MaximumSize, PurgeTime and UpdatePercentage properties programmatically within an application.Update:You can set the three MessageBuffer properties as Java system properties using the names:com.ibm.mq.cfg.MessageBuffer.MaximumSize\n\ncom.ibm.mq.cfg.MessageBuffer.PurgeTime\n\ncom.ibm.mq.cfg.MessageBuffer.UpdatePercentageTherefore you could set these using -D flags on the Java command when the application is invoked or viaSystem.setProperty(String, String)calls within the application code itself - so long as the properties are set before any MQ classes for JMS/classes for Java API calls are made.\n"} +{"text": "### Human: I have a Camel/Spring-based Java MQ client, which should connect to MQ and get some messages from queue. The connection is estabilished, but the client is not downloading any messages. Wireshark network analysis shows that after some initial processing an MQCLOSE is generated and only further only heartbeat traffic appears.The IBM MQ server version is 8.0.0.5 while the client JARs are in version 7.1.0.3. But I believe this combination worked on other environments.I have checked the application on some other environment, where it works properly and after the MQCLOSE_REPLY there comes a number of other messages, starting with what Wireshark recognizes as SOCKET_ACTION. But this does not happen on this environment, why??### Assistant: Your application isn't requesting any messages, that's why it is not receiving any.Based on the snippet of network trace from your non-working environment, it is only connecting (opening, inquiring and closing the queue manager - which it does during connection processing and after the MQCONN). The connection that was created is then not used - there are no MQGET or SPI flows, just heartbeats.Why are you trying to debug this using network packet trace anyway?!Look at the application and work out what it does after connecting and determine why it isn't requesting any messages.\n"} +{"text": "### Human: What is the use of a server conn in Websphere MQ and why do we go for it.What is the difference between client conn and server conn.### Assistant: In some respects these are two opposite things, but they need to match to make a client connection to a queue manager. Its quite a generic topic but fortunately there is lots of useful documentation about this in google / IBM knowledgebase e.g.https://www.ibm.com/support/knowledgecenter/SSFKSJ_9.0.0/com.ibm.mq.con.doc/q016480_.htmAs a queue manager, if you are going to let clients connect into you, you need to be able to provide some configuration details (heartbeat intervals, max message sizes, user exits) - these are configured on a SVRCONN channelAs an application, if you want to connect into a queue manager via the client bindings (usually to go to another machine), you need some information about the configuration to use and these are configured on a CLNTCONN channel.The application 'provides' a CLNTCONN channel, and once the connection is made, an equivalent SVRCONN channel is looked up, and the configuration values are negotiated and the connection made.An application can 'provide' a CLNTCONN channel at least 3 common ways...\n- As part of an MQSERVER environment variable\n- Via a client channel table (MQCHLLIB/MQCHLTAB environment variables)\n- During an MQCONNX call it can provide the channel detailsMore details here:https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.dev.doc/q027440_.htm\n"} +{"text": "### Human: I have 5 input Queues, 5 message flows for each. After some processing messages from all queues go to one transport queue.Is there a possibility to set a priority across queues, for example messages from input queue 1 will always be processed and put in the transport queue first?### Assistant: It sounds like you need to set themessage priority.You set the priority of a message (in the Priority field of the MQMD\n structure) when you put the message on a queue\n ... you can create messages having priorities between 0 (the lowest) and 9\n (the highest).\n"} +{"text": "### Human: When creating aIBM MQ Message Listenerthat was implemented in.Net C#andworking on MQ Client 7.5.0.2I ran into severalProblems after installing MQ Client 7.5. Fixpack 7.One of them and the most important one is, that my client tool tried to find an assembly calledamqmdnac.dllduring runtime in %Program Files (x86)%\\IBM\\Websphere MQ\\bin.The file does not exist on MQ Client 7.5. Crawling the www for a download possibility or an answer to this problem did not result anything except a hint to MQ Client 7.1 that was not helpful.### Assistant: If you install the server product, you dont get the client libraries by default, you have to select them - amqmdnac is identified as being laid down by the client component, and hence would not be put on disk nor upgraded if you only installed the server product taking the defaults and then upgraded to fixpack 7. Given the fact you talk about applying the fix pack, that usually (not always) means you have installed from the server product media.Look under the registry tree \nHKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\IBM\\WebSphere MQ\\Installation\\\\Components \nor\nHKEY_LOCAL_MACHINE\\SOFTWARE\\IBM\\WebSphere MQ\\Installation\\\\Components \nfor the value for \"Local Clients\\Windows NT Client\" which should be identified as Installed. If not, you havent installed the libraries you need.\n"} +{"text": "### Human: In a REST application, i need to publish a message in this flow:RESTApi -> ComputeNode -> Publication -> ...Can I publish without using an MQInput / Output? How can i do it?### Assistant: Yes, you should be able to set up the Properties tree to allow the Publication node to work without receiving the input message on MQ Input. MQ Output is not needed.From the IIB knowledge center:The message being published must:Be a Publish command messageBe a Delete Publication command message, orHave at least one topic present in the standard properties of the\n message.The 3rd option seems like the one you need.\n"} +{"text": "### Human: I have everything was working OK, until today I on MQOPEN got error2085 MQRC_UNKNOWN_OBJECT_NAME#include \n#include \n#include \n#include \"dte_mq.h\" \n#include \n#include \n\ntypedef struct tagDTE_QUEUE_DESCRIPTOR \n{ \n MQHOBJ handle; \n int IsSyncpointControled; \n} DTE_QUEUE_DESCRIPTOR, *PDTE_QUEUE_DESCRIPTOR; \n\nstatic MQHCONN sHConn = 0; \nstatic MQLONG sCompCode = MQCC_OK; \nstatic MQLONG sReason = MQRC_NONE; \nstatic int sNumOpenQueues = 0; \nstatic PDTE_QUEUE_DESCRIPTOR sQueues = NULL; \nMQLONG OpenCode; \nMQOD od = {MQOD_DEFAULT}; /* Object Descriptor */ \nMQMD md = {MQMD_DEFAULT}; \nMQPMO pmo = {MQPMO_DEFAULT}; \nMQLONG O_options;/* MQCONNX options */ \nMQCNO Connect_options = {MQCNO_DEFAULT}; \n/* Client connection channel */ \nMQCD ClientConn = {MQCD_CLIENT_CONN_DEFAULT}; \n\n\n\n#define MAX_NUM_OPEN_QUEUES 10 \n\n\n\nint dteMqOpen(const char *name, int *qd) \n{ \n MQLONG options; \n MQHOBJ hObj; \n int i; \n printf(\"SAM\\n\"); \n strncpy(od.ObjectName, name, MQ_Q_NAME_LENGTH); \n printf(\"SAM2\\n\"); \n O_options = MQOO_INPUT_AS_Q_DEF + MQOO_FAIL_IF_QUIESCING; \n printf(\"SAM3\\n\"); \n MQOPEN(sHConn, &od, O_options, &hObj, &sCompCode, &sReason); \n printf(\"MQopen = %d and %d\\n\",sCompCode,sReason); \n if (sCompCode != MQCC_OK) \n { \n printf(\"RETURN %d\\n\",DTE_MQR_FAILED); \n return DTE_MQR_FAILED; \n } \n ++sNumOpenQueues; \n *qd = 1; \n for(i = 0; i < MAX_NUM_OPEN_QUEUES; i++) \n { \n printf(\"In the loop1\\n\"); \n if(sQueues[i].handle == -1) \n { \n *qd = i; \n printf(\"QDESC1 = %d\\n\",qd); \n sQueues[i].handle = hObj; \n sQueues[i].IsSyncpointControled = 0; \n break; \n } \n printf(\"In the loop\\n\"); \n } \n printf(\"QDESC = %d\\n\",qd); \n return DTE_MQR_OK; \n}Function call is:qd = -1; \ndteretopen = dteMqOpen(QName, &qd); \nprintf (\"Return code from dteMqOpen = %d\\n\",dteretopen); \nif (dteretopen ==0) \n{ \n printf(\"MQOPEN could not open MQ, check errpr log\\n\"); \n exit(99); \n}Error 2085. But several days before there was no such errorConnection is OK, but MQOPEN failed### Assistant: dteretopen = dteMqOpen(QName, &qd);Clearly 'QName' has an invalid value.You have been posting question after question about the same program. Obviously, you have zero training in MQ programming. You need to get some MQ training ASAP. There is lots and lots of information on the web and videos too.Why aren't you doing some basic debugging and outputting 'QName?You need to take some initiative in debugging your program before posting questions here. We are not here to do your work.\n"} +{"text": "### Human: I am bit new to the whole MQ world so I am not sure about the specific technicalities.\nI am struggling to send a message on a Websphere Mq with additional data; the additional data will then be used by another system for processing.I am using the following code to do add additional properties to the mq; is this the correct way to do it?\nCode in C#IMessage sendMsg;\n\nIMessageProducer producer;\n\n// Create a message ---someMessage will be a xml file\nsendMsg = new IMessage(someMessage);\n\nint fileSize= size(\"document.pdf\"); \n\n\n//add addtional message properties\nsendMsg.SetStringProperty(\"MessageSize\",fileSize);\n\n\n// Send the message\nproducer.Send(sendMsg);Also, how do i query the mq so that I get all these properties along with the actual message?Can anyone please help; this has got me going round in circles....### Assistant: Yes using SetStringProperty,SetBooleanProperty, etc,you should be able to set the properties. For getting back the property values you should use msg.GetStringProperty,msg.GetBooleanProperty etc after the message is received.In your case it has to be something like msg.GetStringProperty(MessageSize).\n"} +{"text": "### Human: I'm trying to connect to an IBM message queue using .net and MQ client v8.0.0.5 but I keep receiving the following error:Fatal error. Failed to initialize XMSFactoryFactoryCould not load file or assembly 'IBM.XMS.Client.Impl, Version=8.0.0.5,\n Culture=neutral, PublicKeyToken=d2666ab12fca862b' or one of its\n dependencies.The system cannot find the file\n specified.\":\"IBM.XMS.Client.Impl, Version=8.0.0.5, Culture=neutral,\n PublicKeyToken=d2666ab12fca862bHere's what I've done so far:Installed MQ Client v8.0.0.5 (x64) on my machine.Referenced the following assemblies:amqmdnet.dllamqmdnsp.dllamqmdxcs.dllIBM.XMS.dllIBM.XMS.Admin.dllIBM.XMS.Client.Impl.dllIBM.XMS.NLS.dllIBM.XMS.Provider.dllIBM.XMS.Util.dllNow I also have version v7.5.0.4 installed on my machine and that is having no issues connecting to the queue.One more thing I noticed is there are no assemblies for v8.0.0.5 in the GAC but the assemblies for v7.5.0.4 are present. Can that be the reason?Unfortunately, I cannot remove v7.5.0.4 until have both the versions working normally.### Assistant: Yes, MQ v8.0.0.5 XMS .NET assemblies not being in the GAC is most likely the cause.You can look at the alternative of using redirection, update app.config file to use the correct version of assemblies your application requires. Look into your MQ installation directory for a file calledNonPrimaryRedirect.config. This file contains sample configuration required for application to look for a specific version of MQ/XMS .NET assembly. Copy the contents of this file to your application's app.config file and try. You must ensure allhrefattributes point to correct path.\n"} +{"text": "### Human: I try to inquire status of channels of IBM MQ.\nThe next snippet of PowerShell is my attempt to do it.\nBut i am in doubt about how i get the status of inactive channels.&{\n $erroractionpreference='stop'\n try{\n $mq=\"${env:programfiles(x86)}\\IBM\\WebSphere MQ\\bin\\amqmdnet.dll\"\n [void][reflection.assembly]::loadfrom($mq)\n $mqe=[ibm.wmq.mqenvironment]\n $mqe::hostname='localhost'\n $mqe::port=1414\n $mqe::channel='SYSTEM.DEF.SVRCONN'\n $mqc=[ibm.wmq.mqc]\n $mqe::properties[$mqc::transport_property]=$mqc::transport_mqseries_managed\n $mqe::properties[$mqc::ccsid_property]=$mqc::codeset_utf\n $qm=new-object ibm.wmq.mqqueuemanager EKR_33\n $ag=new-object ibm.wmq.pcf.pcfmessageagent\n $ag.connect($qm)\n $cmqcfc=[ibm.wmq.pcf.cmqcfc]\n $rq=new-object ibm.wmq.pcf.pcfmessage $cmqcfc::mqcmd_inquire_channel_names\n $rq.addparameter($cmqcfc::mqcach_channel_name,'*')\n $chst=@{}\n $ag.send($rq)|%{\n $_.getstringlistparametervalue($cmqcfc::mqcach_channel_names)|%{\n $chst[$_.trim()]='INACTIVE'\n }\n }\n $rq=new-object ibm.wmq.pcf.pcfmessage $cmqcfc::mqcmd_inquire_channel_status\n $rq.addparameter($cmqcfc::mqcach_channel_name,'*')\n $st=@{$cmqcfc::mqchs_binding='BINDING'\n $cmqcfc::mqchs_inactive='INACTIVE'\n $cmqcfc::mqchs_initializing='INITIALIZING'\n $cmqcfc::mqchs_paused='PAUSED'\n $cmqcfc::mqchs_requesting='REQUESTING'\n $cmqcfc::mqchs_retrying='RETRYING'\n $cmqcfc::mqchs_running='RUNNING'\n $cmqcfc::mqchs_starting='STARTING' \n $cmqcfc::mqchs_stopped='STOPPED'\n $cmqcfc::mqchs_stopping='STOPPING'}\n $ag.send($rq)|%{\n $chst[$_.getstringparametervalue($cmqcfc::mqcach_channel_name).trim()]=\n $st[$_.getintparametervalue($cmqcfc::mqiach_channel_status)]\n }\n $chst|ft -a\n }finally{\n if($ag){$ag.disconnect()}\n if($qm){$qm.disconnect()}\n }\n}Some technical details:OS: Windows Server 2008 R2 StandardIBM Websphere MQ Version: 7.1.0.52 JoshMc:Actually, there is no any error in the snippet.At first i presume inactive status of channels...$rq=new-object ibm.wmq.pcf.pcfmessage $cmqcfc::mqcmd_inquire_channel_names\n$rq.addparameter($cmqcfc::mqcach_channel_name,'*') $chst=@{} $ag.send($rq)|%{\n $_.getstringlistparametervalue($cmqcfc::mqcach_channel_names)|%{\n $chst[$_.trim()]='INACTIVE' # My guess\n }\n}... and only then inquire their status in reality.$rq=new-object ibm.wmq.pcf.pcfmessage $cmqcfc::mqcmd_inquire_channel_status\n$rq.addparameter($cmqcfc::mqcach_channel_name,'*')\n$ag.send($rq)|%{ # I have never got channels with inactive status through sending the 'mqcmd_inquire_channel_names' message.\n $chst[$_.getstringparametervalue($cmqcfc::mqcach_channel_name).trim()]=\n $st[$_.getintparametervalue($cmqcfc::mqiach_channel_status)]I don't know whether it is right or not.### Assistant: If a channel is INACTIVE, this means it has no status. That is, no record associated with that channel will be returned on the Inquire Channel Status command.To put it another way. If you have no record returned on the Inquire Channel Status command for a particular channel name, then this means that the channel is INACTIVE.\n"} +{"text": "### Human: Is it possible to show all clients of a MQ server (or MQ queue manager, or channel) by Java? Because there are too many connections sometimes and I need to monitor it.I checked the API of com.ibm.mq.MQQueueManager\n(https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_7.5.0/com.ibm.mq.javadoc.doc/WMQJavaClasses/com/ibm/mq/MQQueueManager.html)\nI can use it to get queue depth, but I cannot get the client connection information (ex: IP address) of it.If it's impossible to get IP address, could we get \"connection count\" only?### Assistant: You need to use MQ PCF via Java.request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_CHANNEL_STATUS);\nrequest.addParameter(CMQCFC.MQCACH_CHANNEL_NAME, \"TEST.CHL\");\nrequest.addParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_TYPE, CMQC.MQOT_CURRENT_CHANNEL);\nrequest.addParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_ATTRS,\n new int []\n {\n CMQCFC.MQCACH_CHANNEL_NAME,\n CMQCFC.MQCACH_CONNECTION_NAME,\n CMQCFC.MQIACH_CHANNEL_STATUS,\n CMQCFC.MQIACH_CHANNEL_SUBSTATE,\n CMQCFC.MQIACH_MSGS,\n CMQCFC.MQCACH_LAST_MSG_DATE,\n CMQCFC.MQCACH_LAST_MSG_TIME,\n CMQCFC.MQCACH_CHANNEL_START_DATE,\n CMQCFC.MQCACH_CHANNEL_START_TIME,\n CMQCFC.MQIACH_BYTES_SENT,\n CMQCFC.MQIACH_BYTES_RECEIVED,\n CMQCFC.MQIACH_BUFFERS_SENT,\n CMQCFC.MQIACH_BUFFERS_RECEIVED,\n CMQCFC.MQIACH_MCA_STATUS,\n CMQCFC.MQCACH_MCA_JOB_NAME,\n CMQCFC.MQCACH_MCA_USER_ID\n } );\n\nresponses = agent.send(request);\n"} +{"text": "### Human: I need to know how IBM Websphere MQ works.As of my knowledge.IBM Websphere MQ is an application that runs continuouslyIBM Websphere MQ has a queue manager, queue name, port, host where it is runs, channel name.We have a two different application in two different remote place.Two applications and the IBM Websphere MQ applications are connected through network.Using IBM Websphere MQ credentials the applications are able to send and receive messages between them via IBM Websphere MQ.If I have anything wrong then please guide me.My questions are:If one application sends a message to the queue then where will the memory be consumed?Where do we run the MQ listeners? On the applications environment or the Websphere environment (where we installed the IBM Websphere MQ)?Do we need to run any programs in the application environments or are the IBM Websphere MQ credentials (queue manager, queue name, port, host where it is runs, channel name) enough to send and receive the messages?### Assistant: If one application sends a message to the queue then where will the memory be consumed?A Running Queue Manager requires memory in order to run and handle processing/storage of messages. As well as that every MQ Client application that connects to a Queue Manager requires memory to connect to and put/get messages. This is no different than any application that runs on any system.Where do we run the MQ listeners?Assuming you mean MQ Listeners. The MQ Listeners are run on the Queue Manager and specify the (TCP) port you want the Queue Manager to listen on.Do we need to run any programs in the application environments or are the IBM Websphere MQ credentials (queue manager, queue name, port, host where it is runs, channel name) enough to send and receive the messages?To run a Queue Manager on a machine, your machine must meet the System requirements stated in theSystem Requirements for WebSphere MQpage.Here is the MQ v8 oneLikewise to run a MQ Client application that can connect into a Queue Manager, the application needs to have be ran on a machine that has the IBM MQ Client libraries installed on and meet the system requirements.You also need to tell the application:The location of the Queue Manager hostname/IP Address and port number.The channel to connect into, which must exist on the Queue ManagerThe Queue name to interact with, which must exist on the Queue ManagerDepending on your Queue Manager's configuration you need to ensure that your application is running with the correct user/supplying the correct user to ensure it is properly authorized to access the Queue Manager.\n"} +{"text": "### Human: I am working on a project where I need to consume JMS messages from IBM MQ which is defined in websphere as JNDI.I have given only the JNDI of a queue (jms/sampleQ). I am trying to connect the Queue from Spring JMS.Here my question is, whether the QueueConnectionFactory is mandatory to connect the Queue (JNDI) ?### Assistant: To get the javax.jms.Queue object from JNDI you do not need to have a QueueConnectionFactory object. They are independent objects looked up from JNDI.However to actually send or receive messages you need to combined a JMS Queue and a JMS QueueConnectionFactory. The JMS Queue in JNDI can be used with an MQ QueueConnectionFactory no matter how you get hold of it, so it doesn't need to be grabbed from the WAS JNDI namespace, but if you don't get the QueueConnectionFactory from WAS JNDI you'll loose integration with some server functions like the transaction manager. Spring can pick up the QueueConnectionFactory from JNDI as an option.\n"} +{"text": "### Human: I am trying to restrict users on queues they could see in the Websphere MQ explorer.What i do right now is just configure Websphere MQ explorer queues in user systems (without any user creation).I got to see an online help but i could not understand it.Any help will be greatly appreciated### Assistant: If you did a search based on your title then Mr. Google would have given the following 2 links at the top of the search results:http://www.ibm.com/support/knowledgecenter/SSFKSJ_9.0.0/com.ibm.mq.sec.doc/q013740_.htmhttps://hursleyonwmq.wordpress.com/2007/02/08/using-websphere-mq-explorer-as-a-read-only-viewer/It is best if you apply the permissions to a group rather than a principle (user).\n"} +{"text": "### Human: My current application logic uses the depth of the a 'PROCESS' WMQ queue to determine if a job is being processed by an IIB9 workflow. If the workflow is processing a messages, the application wait till that workflow is over. Once the workflow is over, the 'PROCESS' queue will be emptied using GET operation and the application sends other messages in the sequence for processing. I am using JMS selectors to differentiate between multiple messages being processed parallelly by the workflow.The issue is with determining the depth of the queue. JMS API is giving the depth as 0, while IBM API is giving the depth as 1(which is expected). Unfortunately, I cannot use IBM API as my logic using some complex messageselectors.Has anyone seen this bizarre behaviour? Please note that the IIB9 workflow is in progress while the size check is being made. Is there a setting to be tweaked?JMS Code (message selector removed for clarity):public class QDepthJMS {\n\npublic static void main(String[] a) throws Exception {\n MQConnectionFactory factory = new MQConnectionFactory();\n factory.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n factory.setQueueManager(\"QM01\");\n factory.setHostName(\"10.10.98.15\");\n factory.setPort(1414);\n factory.setChannel(\"Java.Clients\");\n\n MQConnection connection = (MQConnection) factory.createConnection();\n connection.start();\n\n MQSession session = (MQSession) connection.createSession(false, Session.AUTO_ACKNOWLEDGE);\n\n MQQueue queue = (MQQueue) session.createQueue(\"queue:///PROCESS\");\n MQQueueBrowser browser = (MQQueueBrowser) session.createBrowser(queue); \n\n Enumeration msgs = browser.getEnumeration();\n int count =0;\n if (msgs.hasMoreElements()) {\n msgs.nextElement();\n ++count;\n }\n\n System.out.println(count);\n}\n}IBM API (Check MQ queue depth):public class QDepth {\n\nprivate final String host;\nprivate final int port;\nprivate final String channel;\nprivate final String manager;\nprivate final MQQueueManager qmgr;\n\npublic QDepth(String host, int port, String channel, String manager) throws MQException {\n this.host = host;\n this.port = port;\n this.channel = channel;\n this.manager = manager;\n this.qmgr = createQueueManager();\n}\n\npublic int depthOf(String queueName) throws MQException {\n MQQueue queue = qmgr.accessQueue(queueName, MQC.MQOO_INQUIRE | MQC.MQOO_INPUT_AS_Q_DEF, null, null, null);\n return queue.getCurrentDepth();\n}\n\n@SuppressWarnings(\"unchecked\")\nprivate MQQueueManager createQueueManager() throws MQException {\n MQEnvironment.channel = channel;\n MQEnvironment.port = port;\n MQEnvironment.hostname = host;\n MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES);\n return new MQQueueManager(manager);\n}\n\npublic static void main(String[] a) throws Exception {\n QDepth qd = new QDepth(\"10.10.98.15, 1414, \"Java.Clients\", \"QM01\");\n System.out.println(qd.depthOf(\"PROCESS\"));\n}\n}### Assistant: You are not comparing \"like with like\" - The IBM API queries the queue depth, ie how many messages are in the queue but the JMS API is browsing through the messages and counting them. There is a valid reason for them to be different - the usual cause is that someone has put a message under a unit of work (syncpoint) and it has not yet been committed - Therefore at the point you run the IBM API it will say there's 1 message on the queue (there is...) but it is not gettable / browseable as its not yet committed.You can verify this using runmqsc (and probably the GUI) by runmqsc DIS QSTATUS and look at the UNCOM attribute - Seehttp://www-01.ibm.com/support/docview.wss?uid=swg21636775\n"} +{"text": "### Human: I have a Java EE application with needs to integrate to a BizTalk server.\nI know there're bunch of OOTB adapters available. I have few questions need an answer to.Is it possible for a Java EE application to integrate to BizTalk via an MQ adapter? If yes can you elaborate little?Is it possible to talk to BizTalk via webservice, exposed on BizTalk side that my Java EE application can call?### Assistant: Sure, you can send a message to MQ queue and BizTalk can read the messages from there using an adapter. I guess it would be any non-Windows based queue so you'll need theMQSeries adapter. Not much more to elaborate, once the messages are taken, you work with BizTalk from there.Sure too, you canpublish your orchestration as a web serviceand call it from any application. The schema that you define as input of the flow will be your web service contract for the caller applications.\n"} +{"text": "### Human: I need to Display only the MQ channel ststua with out DetailsWhen using CHSTATUS(KONDOR_TO_T24)CHANNEL(KONDOR_TO_T24) CHLTYPE(SDR)\nCONNAME(192.168.11.30(1414)) CURRENT\nRQMNAME(GLOB_QM) STATUS(RUNNING)\nSUBSTATE(MQGET) XMITQ(KONDOR_OUT)it gives me all the bove details and i need only to display STATUS(RUNNING)### Assistant: That is the information you get when you issue the 'DISPLAY CHSTATUS' MQSC command. If you want selective information from the command then write a script to parse out what you want.\n"} +{"text": "### Human: Our client application uses the IBM .Net native library for interacting with our Websphere MQ server (V7.0.1). I can't figure out the cause of the issue. If you have any helpful suggestions to help diagnose the issue, please let me know.When trying to pull a message off a local queue the IBM library throws an exception which generated the following \"FDC\" file;+-----------------------------------------------------------------------------+\n| |\n| WebSphere MQ First Failure Symptom Report |\n| ========================================= |\n| |\n| Date/Time :- Mon October 17 2016 16:48:49 GMT Daylight Time |\n| UTC Time :- 1476719329.480000 |\n| UTC Time Offset :- 60 (GMT Daylight Time) |\n| Host Name :- ALXMQ001 |\n| Operating System :- Windows Ver 6.1 (3) Server Enterprise x64 Edition, |\n| Build 7601: SP1 |\n| PIDS :- 5724H7220 |\n| LVLS :- 7.0.1.0 |\n| Product Long Name :- WebSphere MQ for Windows |\n| Vendor :- IBM |\n| Probe Id :- DN133001 |\n| Application Name :- MQM |\n| Component :- MQFAP.LeaveCall() |\n| SCCS Info :- lib/dotnet/pc/winnt/nmqi/managed/MQFAP.cs, 1.7 |\n| Line Number :- 234 |\n| Build Date :- Aug 13 2009 |\n| CMVC level :- p000-L090813 |\n| Build Type :- IKAP - (Production) |\n| UserID :- ALXMQ001$ |\n| Process Name :- D:\\OurCompany\\OURAPP\\STAGING_v1.1\\Console\\OURAPP.Windo |\n| wsService.exe |\n| Addressing mode :- 32-bit |\n| Process :- 00005492 |\n| Thread :- 00000001 |\n| UserApp :- TRUE |\n| Last HQC :- 0.0.0-0 |\n| Last HSHMEMB :- 0.0.0-0 |\n| Major Errorcode :- MQRC_UNEXPECTED_ERROR |\n| Minor Errorcode :- OK |\n| Probe Type :- INCORROUT |\n| Probe Severity :- 4 |\n| Probe Description :- AMQ6125: An internal WebSphere MQ error has occurred. |\n| FDCSequenceNumber :- 0 |\n| |\n+-----------------------------------------------------------------------------+\n\nMQM Function Stack\nMQQueueManager.Disconnect()1\nMQManagedObject.Close()\nManagedNmqiMQ.MQCLOSE(Hconn,Phobj,int,out int,out int)\nMQFAP.LeaveCall()\nxcsFFST\n\nMQM Trace History\n----------------------------------------------------------------} ccxQueryProcAddr rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} cciSpxFreeMem rc=Unknown(F001)\n----------------------------------------------------------------} cciSpxFreeMem rc=Unknown(1)\n----------------------------------------------------------------} cciLoadTransportExit rc=Unknown(1)\n----------------------------------------------------------------} cciUdpCheckConfig rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} cciSpxAcceptConv rc=MQRC_NO_MSG_UNDER_CURSOR\n----------------------------------------------------------------} cciSpxAllocConv rc=MQRC_NO_MSG_UNDER_CURSOR\n----------------------------------------------------------------} ccxSetConvClass rc=Unknown(F001)\n----------------------------------------------------------------} ccxSetConvClass rc=Unknown(1)\n----------------------------------------------------------------} cciSslSecureAllocConv rc=Unknown(F001)\n----------------------------------------------------------------} cciSslSecureAllocConv rc=Unknown(1)\n----------------------------------------------------------------} ccxSetConvClass rc=Unknown(F001)\n----------------------------------------------------------------} ccxSetConvClass rc=Unknown(1)\n----------------------------------------------------------------} cmrcv rc=Unknown(F001)\n----------------------------------------------------------------} cmrcv rc=Unknown(1)\n----------------------------------------------------------------} cciSpxAllocConv rc=Unknown(F001)\n----------------------------------------------------------------} cciSpxAcceptConv rc=Unknown(F001)\n----------------------------------------------------------------} cciSslSecureInitEnv rc=Unknown(F001)\n----------------------------------------------------------------} cciSslSecureLDAPCRLServer rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} cciUdpGetNameandAddress rc=Unknown(F001)\n----------------------------------------------------------------} FileTransferApp.addMenuFile rc=Unknown(F001)\n----------------------------------------------------------------} FileTransferApp.addMenuFile rc=Unknown(1)\n----------------------------------------------------------------} cciSpxAllocMem rc=Unknown(F001)\n----------------------------------------------------------------} cmaccp rc=Unknown(F001)\n----------------------------------------------------------------} cmaccp rc=Unknown(1)\n----------------------------------------------------------------} cciSpxAllocMem rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} ccxListenConv rc=Unknown(F001)\n----------------------------------------------------------------} ccxListenConv rc=Unknown(1)\n----------------------------------------------------------------} ccxAllocConv rc=Unknown(F001)\n----------------------------------------------------------------} ccxAllocConv rc=Unknown(1)\n----------------------------------------------------------------} cciUdpReceive rc=Unknown(F001)\n----------------------------------------------------------------} cciUdpReceive rc=Unknown(1)\n----------------------------------------------------------------} cciSpxCheckComms rc=Unknown(F001)\n----------------------------------------------------------------} select rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} select rc=Unknown(1)\n----------------------------------------------------------------} cciSpxCheckComms rc=Unknown(1)\n----------------------------------------------------------------} cciSpxLoadDLLs rc=Unknown(F001)\n----------------------------------------------------------------} gethostbyaddr rc=Unknown(F001)\n----------------------------------------------------------------} ccxTermVicMq rc=Unknown(F001)\n----------------------------------------------------------------} ccxTermVicMq rc=Unknown(1)\n----------------------------------------------------------------} ccxTermVicMq rc=Unknown(F001)\n----------------------------------------------------------------} ccxTermVicMq rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} gethostbyaddr rc=Unknown(1)\n----------------------------------------------------------------} cciSpxLoadDLLs rc=Unknown(1)\n----------------------------------------------------------------} ccxTermVicMq rc=Unknown(F001)\n----------------------------------------------------------------} ccxTermVicMq rc=Unknown(1)\n----------------------------------------------------------------} ccxAcceptConv rc=Unknown(F001)\n----------------------------------------------------------------} ccxAcceptConv rc=Unknown(1)\n----------------------------------------------------------------} ccxTermVicMq rc=Unknown(F001)\n----------------------------------------------------------------} ccxTermVicMq rc=Unknown(1)\n----------------------------------------------------------------} cciUdpGetUniversalAddress rc=Unknown(F001)\n----------------------------------------------------------------} cciUdpGetUniversalAddress rc=Unknown(1)\n----------------------------------------------------------------} ccxTermVicMq rc=Unknown(F001)\n----------------------------------------------------------------} ccxTermVicMq rc=Unknown(1)\n----------------------------------------------------------------} cciUdpGetUniversalAddress rc=Unknown(F001)\n----------------------------------------------------------------} cciUdpGetUniversalAddress rc=Unknown(1)\n----------------------------------------------------------------} cciSpxFreeMem rc=Unknown(F001)\n----------------------------------------------------------------} cciSpxFreeMem rc=Unknown(1)\n----------------------------------------------------------------} ccxQueryProcAddr rc=Unknown(F001)\n----------------------------------------------------------------} ccxTermVicMq rc=Unknown(F001)\n----------------------------------------------------------------} ccxTermVicMq rc=Unknown(1)\n----------------------------------------------------------------} ccxInitVicRsp rc=Unknown(F001)\n----------------------------------------------------------------} ccxTermVicMq rc=Unknown(F001)\n----------------------------------------------------------------} ccxTermVicMq rc=Unknown(1)\n----------------------------------------------------------------} ccxInitVicRsp rc=Unknown(1)\n----------------------------------------------------------------} ccxQueryProcAddr rc=Unknown(1)\n----------------------------------------------------------------} cciUdpGetNameandAddress rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} cciSslSecureLDAPCRLServer rc=Unknown(1)\n----------------------------------------------------------------} cciSslSecureInitEnv rc=Unknown(1)\n----------------------------------------------------------------} CSQXARCV rc=Unknown(F001)\n----------------------------------------------------------------} CSQXARCV rc=Unknown(1)\n----------------------------------------------------------------} cciSslSecureAllocConv rc=Unknown(F001)\n----------------------------------------------------------------} cciSslSecureAllocConv rc=Unknown(1)\n----------------------------------------------------------------} FileTransferApp.getMessageSize rc=Unknown(F001)\n----------------------------------------------------------------} FileTransferApp.getMessageSize rc=Unknown(1)\n----------------------------------------------------------------} cciSpxFreeConv rc=Unknown(F001)\n----------------------------------------------------------------} cciSpxFreeConv rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} cciUdpCheckConfig rc=Unknown(F001)\n----------------------------------------------------------------} cciLoadTransportExit rc=Unknown(F001)\n----------------------------------------------------------------} cciFindNewPrimary rc=Unknown(F001)\n----------------------------------------------------------------} cciFindNewPrimary rc=Unknown(1)\n----------------------------------------------------------------} cmsend rc=Unknown(F001)\n----------------------------------------------------------------} cmsend rc=Unknown(1)\n----------------------------------------------------------------} FileTransferApp.addMenuFile rc=Unknown(F001)\n----------------------------------------------------------------} FileTransferApp.addMenuFile rc=Unknown(1)\n----------------------------------------------------------------} cciSpxAllocMem rc=Unknown(F001)\n----------------------------------------------------------------} cmaccp rc=Unknown(F001)\n----------------------------------------------------------------} cmaccp rc=Unknown(1)\n----------------------------------------------------------------} cciSpxAllocMem rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} ccxTermVicMsp rc=Unknown(F001)\n----------------------------------------------------------------} ccxInitVicMq rc=Unknown(F001)\n----------------------------------------------------------------} ccxInitVicMq rc=Unknown(1)\n----------------------------------------------------------------} ccxTermVicMsp rc=Unknown(1)\n----------------------------------------------------------------} ccxTermVicMq rc=Unknown(F001)\n----------------------------------------------------------------} ccxTermVicMq rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} select rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} select rc=Unknown(1)\n----------------------------------------------------------------} ccxQueryProcAddr rc=Unknown(F001)\n----------------------------------------------------------------} ccxTermVicMq rc=Unknown(F001)\n----------------------------------------------------------------} ccxTermVicMq rc=Unknown(1)\n----------------------------------------------------------------} ccxInitVicRsp rc=Unknown(F001)\n----------------------------------------------------------------} ccxTermVicMq rc=Unknown(F001)\n----------------------------------------------------------------} ccxTermVicMq rc=Unknown(1)\n----------------------------------------------------------------} ccxInitVicMq rc=Unknown(F001)\n----------------------------------------------------------------} ccxInitVicMq rc=Unknown(1)\n----------------------------------------------------------------} ccxInitVicRsp rc=Unknown(1)\n----------------------------------------------------------------} ccxQueryProcAddr rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} cciSpxFreeMem rc=Unknown(F001)\n----------------------------------------------------------------} cciSpxFreeMem rc=Unknown(1)\n----------------------------------------------------------------} cciLoadTransportExit rc=Unknown(1)\n----------------------------------------------------------------} cciUdpCheckConfig rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} cciSpxAcceptConv rc=MQRC_DUPLICATE_RECOV_COORD\n----------------------------------------------------------------} cciSpxAllocConv rc=MQRC_DUPLICATE_RECOV_COORD\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} cciLu62GetLLU rc=Unknown(F001)\n----------------------------------------------------------------} cciSslSecureOpenEnv rc=Unknown(F001)\n----------------------------------------------------------------} cciSslSecureOpenEnv rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n---------------------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n--------------------------------------------------------------} cciUdpSend rc=Unknown(F001)\n-------------------------------------------------------------} FileTransferApp.addMenuFile rc=Unknown(F001)\n------------------------------------------------------------} FileTransferApp.addMenuFile rc=Unknown(1)\n-----------------------------------------------------------} cciSpxAllocMem rc=Unknown(F001)\n----------------------------------------------------------} cmaccp rc=Unknown(F001)\n---------------------------------------------------------} cmaccp rc=Unknown(1)\n--------------------------------------------------------} cciSpxAllocMem rc=Unknown(1)\n-------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n------------------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n-----------------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------------------} ccxTermVicMsp rc=Unknown(F001)\n---------------------------------------------------} ccxInitVicMq rc=Unknown(F001)\n--------------------------------------------------} ccxInitVicMq rc=Unknown(1)\n-------------------------------------------------} ccxTermVicMsp rc=Unknown(1)\n------------------------------------------------} ccxTermVicMq rc=Unknown(F001)\n-----------------------------------------------} ccxTermVicMq rc=Unknown(1)\n----------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n---------------------------------------------} *** Unknown Function *** rc=Unknown(1)\n--------------------------------------------} ccxListenConv rc=Unknown(F001)\n-------------------------------------------} ccxListenConv rc=Unknown(1)\n------------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n-----------------------------------------} *** Unknown Function *** rc=Unknown(1)\n----------------------------------------} ccxAllocConv rc=Unknown(F001)\n---------------------------------------} ccxAllocConv rc=Unknown(1)\n--------------------------------------} select rc=Unknown(F001)\n-------------------------------------} *** Unknown Function *** rc=Unknown(F001)\n------------------------------------} *** Unknown Function *** rc=Unknown(1)\n-----------------------------------} select rc=Unknown(1)\n----------------------------------} ccxQueryProcAddr rc=Unknown(F001)\n---------------------------------} ccxTermVicMq rc=Unknown(F001)\n--------------------------------} ccxTermVicMq rc=Unknown(1)\n-------------------------------} ccxInitVicRsp rc=Unknown(F001)\n------------------------------} ccxTermVicMq rc=Unknown(F001)\n-----------------------------} ccxTermVicMq rc=Unknown(1)\n----------------------------} ccxInitVicMq rc=Unknown(F001)\n---------------------------} ccxInitVicMq rc=Unknown(1)\n--------------------------} ccxInitVicRsp rc=Unknown(1)\n-------------------------} ccxQueryProcAddr rc=Unknown(1)\n------------------------} gethostbyaddr rc=Unknown(F001)\n-----------------------} gethostbyaddr rc=MQRC_OPTION_ENVIRONMENT_ERROR\n----------------------} *** Unknown Function *** rc=Unknown(1)\n---------------------} cciSpxFreeMem rc=Unknown(F001)\n--------------------} cciSpxFreeMem rc=Unknown(1)\n-------------------} cciUdpSend rc=Unknown(1)\n------------------} *** Unknown Function *** rc=Unknown(1)\n-----------------} cciLu62GetLLU rc=Unknown(1)\n----------------} *** Unknown Function *** rc=Unknown(1)\n---------------} *** Unknown Function *** rc=Unknown(F001)\n--------------} cciSslSecureOpenEnv rc=Unknown(F001)\n-------------} *** Unknown Function *** rc=Unknown(F001)\n------------} *** Unknown Function *** rc=Unknown(F001)\n-----------} *** Unknown Function *** rc=Unknown(1)\n----------} *** Unknown Function *** rc=Unknown(F001)\n---------} *** Unknown Function *** rc=Unknown(1)\n--------} cciUdpSend rc=Unknown(F001)\n-------} FileTransferApp.addMenuFile rc=Unknown(F001)\n------} FileTransferApp.addMenuFile rc=Unknown(1)\n-----} cciSpxAllocMem rc=Unknown(F001)\n----} cmaccp rc=Unknown(F001)\n---} cmaccp rc=MQRC_OPTION_ENVIRONMENT_ERROR\n--} cciSpxAllocMem rc=Unknown(1)\n-} cciUdpSend rc=Unknown(1)\n} cciSpxFreeMem rc=Unknown(F001)\n{ xcsFFST\n\n\nComponent Dumps (Thread 00000001)\n-------< DNET \".NET\" >------\nOS Version: Microsoft Windows NT 6.1.7601 Service Pack 1\nCLR Version: 2.0.50727.5485\nWorking Set: 116953088 bytes\nShutdown Started: False\nThread State: Running\nThread Priority: Normal\nApartment State: MTA\nPool Thread: False\nBackground Thread: False\nUser Domain Name: KDC\nUser Name: ALXMQ001$\nInteractive User: False\nxcsInitialize Type: 0x00000407\nCommand Line: \"D:\\OurCompany\\OURAPP\\STAGING_v1.1\\Console\\OURAPP.WindowsService.exe\"\nCurrent Directory: D:\\OurCompany\\OURAPP\\STAGING_v1.1\\Console\nStack Trace: \n at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)\n\n at System.Environment.get_StackTrace()\n\n at IBM.WMQ.MQCommonServices.FmtDumpCallback(xcsFmtHandle& Handle, UInt32 ThreadState, UInt32 Component, UInt32 Function)\n-------------------------------------### Assistant: Shashi's comments are correct and most appropriate here - use newer (versions and releases) and especially newest (ie most recent fixpacks) versions of MQ as far as possible, and the newer the better (ie MQ v9 is most ideal). Also, if you are a client installation, any version of the client can talk to any version of the server, so you could update just the client without updating the server.However as a direct answer to this question, there were a number of places in the MQ product where the maintained indenting levels go badly wrong, with a variety of side effects - You can see this is going on in your FDC above in the way the history is so far to the right. The very first thing I suggest you do is to go the most recent level of 7.0.1.x which is 7.0.1.14 (http://www-01.ibm.com/support/docview.wss?uid=swg21979626), which should apply directly on your installation (and if by some unusual chance it causes problems, it can also rollback worst case!) - You are currently at 7.0.1.0 which is really ancient.These indenting issues were fixed at various points through the product lifecycle, and usually as part of other fixes, but it can cause very unusual and unpredictable issues. IC70822, IC68684 are two examples where these issues were specifically targetted, but there are others.\n"} +{"text": "### Human: I built a simple MDB application which listens a jms.Queue, had deployed it on IBM WAS 8.5.5 (with IBM MQ as a JMS broker) and when trying to start it I received the following error (sorry for cyrillic symbols, tried to translate closely):[11.10.16 16:01:43:207 MSK] 00000068 AdminHelper A ADMN1009I: /**An attempt to start application earMdb*/\u041f\u0440\u0435\u0434\u043f\u0440\u0438\u043d\u044f\u0442\u0430 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 earMdb. \n[11.10.16 16:01:43:228 MSK] 00000068 CompositionUn A WSVR0190I:/**Module started*/\u0417\u0430\u043f\u0443\u0441\u043a \u0441\u043e\u0441\u0442\u0430\u0432\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f WebSphere:cuname=earMdb \u0432 BLA WebSphere:blaname=earMdb. \n[11.10.16 16:01:43:263 MSK] 00000068 ApplicationMg A WSVR0200I: /**Application is starting*/\u0417\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f: earMdb \n[11.10.16 16:01:43:263 MSK] 00000068 ApplicationMg A WSVR0204I: \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435: earMdb \u0423\u0440\u043e\u0432\u0435\u043d\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u043a\u0438: \u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d\n[11.10.16 16:01:43:302 MSK] 00000068 SharedEJBRunt I WSVR0037I: \u0417\u0430\u043f\u0443\u0441\u043a \u0444\u0430\u0439\u043b\u0430 JAR EJB: ejb-mdb.jar\n[11.10.16 16:01:43:327 MSK] 00000068 AbstractEJBRu I CNTR0180I: /**Message driven object EJB MdbListener in ejb-mdb.jar module associated with activation specification jms/mdbtest/queue/activespec*/\u0423\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0439 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442 EJB MdbListener \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 ejb-mdb.jar \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f earMdb \u0441\u0432\u044f\u0437\u0430\u043d \u0441 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 jms/mdbtest/queue/activespec. \n[11.10.16 16:01:43:338 MSK] 00000068 RAWrapperImpl E J2CA0089E: /**method activateEndpoint in JavaBean ResourceAdapter cells/AParfenovNode02Cell/nodes/AParfenovNode02/resources.xml#J2CResourceAdapter_1476114690841 was not executed; exception is javax.resource.ResourceException: endpointActivation failed*/\u041c\u0435\u0442\u043e\u0434 activateEndpoint \u0432 JavaBean ResourceAdapter cells/AParfenovNode02Cell/nodes/AParfenovNode02/resources.xml#J2CResourceAdapter_1476114690841 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d; \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f javax.resource.ResourceException: endpointActivation failed \n at com.ibm.ejs.j2c.ActivationSpecWrapperImpl.activateEndpoint(ActivationSpecWrapperImpl.java:372)\n at com.ibm.ejs.j2c.RAWrapperImpl.activateEndpoint(RAWrapperImpl.java:1105)\n at com.ibm.ejs.j2c.RALifeCycleManagerImpl.activateEndpoint(RALifeCycleManagerImpl.java:1754)\n at com.ibm.ejs.container.MessageEndpointFactoryImpl.activateEndpoint(MessageEndpointFactoryImpl.java:168)\n at com.ibm.ws.runtime.component.EJBContainerImpl.startMDBs(EJBContainerImpl.java:4714)\n at com.ibm.ws.runtime.component.WASEJBRuntimeImpl.startMDBs(WASEJBRuntimeImpl.java:683)\n at com.ibm.ws.ejbcontainer.runtime.AbstractEJBRuntime.startModule(AbstractEJBRuntime.java:716)\n at com.ibm.ws.ejbcontainer.runtime.SharedEJBRuntimeImpl.startModule(SharedEJBRuntimeImpl.java:336)\n at com.ibm.ws.runtime.component.EJBContainerImpl.start(EJBContainerImpl.java:3576)\n at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1175)\n at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1370)\n at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:639)\n at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:968)\n at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:774)\n at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMgrImpl.java:1374)\n at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2179)\n at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:445)\n at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)\n at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:388)\n at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:116)\n at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$1.run(CompositionUnitMgrImpl.java:663)\n at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5384)\n at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5600)\n at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)\n at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:677)\n at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:621)\n at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1266)\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)\n at java.lang.reflect.Method.invoke(Method.java:611)\n at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:49)\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)\n at java.lang.reflect.Method.invoke(Method.java:611)\n at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:256)\n at javax.management.modelmbean.RequiredModelMBean$4.run(RequiredModelMBean.java:1148)\n at java.security.AccessController.doPrivileged(AccessController.java:252)\n at com.ibm.oti.security.CheckedAccessControlContext.securityCheck(CheckedAccessControlContext.java:30)\n at sun.misc.JavaSecurityAccessWrapper.doIntersectionPrivilege(JavaSecurityAccessWrapper.java:41)\n at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1142)\n at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:995)\n at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:848)\n at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:774)\n at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1335)\n at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)\n at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1228)\n at com.ibm.ws.management.commands.AdminServiceCommands$InvokeCmd.execute(AdminServiceCommands.java:251)\n at com.ibm.ws.console.core.mbean.MBeanHelper.invoke(MBeanHelper.java:241)\n at com.ibm.ws.console.appdeployment.ApplicationDeploymentCollectionAction.execute(ApplicationDeploymentCollectionAction.java:578)\n at org.apache.struts.action.RequestProcessor.processActionPerform(Unknown Source)\n at org.apache.struts.action.RequestProcessor.process(Unknown Source)\n at org.apache.struts.action.ActionServlet.process(Unknown Source)\n at org.apache.struts.action.ActionServlet.doPost(Unknown Source)\n at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)\n at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)\n at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1227)\n at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:776)\n at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:458)\n at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)\n at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136)\n at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:79)\n at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:928)\n at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1025)\n at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:1385)\n at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:194)\n at org.apache.struts.action.RequestProcessor.doForward(Unknown Source)\n at org.apache.struts.tiles.TilesRequestProcessor.doForward(Unknown Source)\n at org.apache.struts.action.RequestProcessor.processForwardConfig(Unknown Source)\n at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(Unknown Source)\n at org.apache.struts.action.RequestProcessor.process(Unknown Source)\n at org.apache.struts.action.ActionServlet.process(Unknown Source)\n at org.apache.struts.action.ActionServlet.doPost(Unknown Source)\n at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)\n at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)\n at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1227)\n at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:776)\n at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:458)\n at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)\n at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136)\n at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:97)\n at com.ibm.ws.console.core.servlet.WSCUrlFilter.setUpCommandAssistance(WSCUrlFilter.java:955)\n at com.ibm.ws.console.core.servlet.WSCUrlFilter.continueStoringTaskState(WSCUrlFilter.java:504)\n at com.ibm.ws.console.core.servlet.WSCUrlFilter.doFilter(WSCUrlFilter.java:325)\n at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)\n at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)\n at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:928)\n at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1025)\n at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3761)\n at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)\n at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:976)\n at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)\n at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)\n at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:459)\n at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:526)\n at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:312)\n at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:88)\n at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)\n at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)\n at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)\n at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)\n at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)\n at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)\n at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)\n at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1862)\nCaused by: java.lang.ClassCastException: com.ibm.ws.naming.jndicos.CNContextImpl incompatible with javax.jms.Destination\n at com.ibm.mq.connector.DestinationBuilder.createDestination(DestinationBuilder.java:152)\n at com.ibm.mq.connector.inbound.MessageEndpointDeployment.startDelivery(MessageEndpointDeployment.java:317)\n at com.ibm.mq.connector.inbound.MessageEndpointDeployment.(MessageEndpointDeployment.java:224)\n at com.ibm.mq.connector.ResourceAdapterImpl.endpointActivation(ResourceAdapterImpl.java:397)\n at com.ibm.ejs.j2c.ActivationSpecWrapperImpl.activateUnderRAClassLoaderContext(ActivationSpecWrapperImpl.java:646)\n at com.ibm.ejs.j2c.ActivationSpecWrapperImpl.activateEndpoint(ActivationSpecWrapperImpl.java:362)\n ... 105 more\n\n[11.10.16 16:01:43:349 MSK] 00000068 SharedEJBRunt E WSVR0040E: \u041c\u0435\u0442\u043e\u0434 addEjbModule \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0434\u043b\u044f ejb-mdb.jar\ncom.ibm.ws.exception.RuntimeWarning: javax.resource.ResourceException: endpointActivation failed /**Method addEjbModule for ejb-mdb.jar was not executed com.ibm.ws.exception.RuntimeWarning: javax.resource.ResourceException: endpointActivation failed*/\n at com.ibm.ws.runtime.component.EJBContainerImpl.startMDBs(EJBContainerImpl.java:4718)\n at com.ibm.ws.runtime.component.WASEJBRuntimeImpl.startMDBs(WASEJBRuntimeImpl.java:683)\n at com.ibm.ws.ejbcontainer.runtime.AbstractEJBRuntime.startModule(AbstractEJBRuntime.java:716)\n at com.ibm.ws.ejbcontainer.runtime.SharedEJBRuntimeImpl.startModule(SharedEJBRuntimeImpl.java:336)\n at com.ibm.ws.runtime.component.EJBContainerImpl.start(EJBContainerImpl.java:3576)\n at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1175)\n at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1370)\n at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:639)\n at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:968)\n at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:774)\n at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMgrImpl.java:1374)\n at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2179)\n at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:445)\n at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)\n at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:388)\n at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:116)\n at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$1.run(CompositionUnitMgrImpl.java:663)\n at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5384)\n at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5600)\n at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)\n at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:677)\n at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:621)\n at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1266)\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)\n at java.lang.reflect.Method.invoke(Method.java:611)\n at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:49)\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)\n at java.lang.reflect.Method.invoke(Method.java:611)\n at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:256)\n at javax.management.modelmbean.RequiredModelMBean$4.run(RequiredModelMBean.java:1148)\n at java.security.AccessController.doPrivileged(AccessController.java:252)\n at com.ibm.oti.security.CheckedAccessControlContext.securityCheck(CheckedAccessControlContext.java:30)\n at sun.misc.JavaSecurityAccessWrapper.doIntersectionPrivilege(JavaSecurityAccessWrapper.java:41)\n at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1142)\n at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:995)\n at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:848)\n at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:774)\n at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1335)\n at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)\n at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1228)\n at com.ibm.ws.management.commands.AdminServiceCommands$InvokeCmd.execute(AdminServiceCommands.java:251)\n at com.ibm.ws.console.core.mbean.MBeanHelper.invoke(MBeanHelper.java:241)\n at com.ibm.ws.console.appdeployment.ApplicationDeploymentCollectionAction.execute(ApplicationDeploymentCollectionAction.java:578)\n at org.apache.struts.action.RequestProcessor.processActionPerform(Unknown Source)\n at org.apache.struts.action.RequestProcessor.process(Unknown Source)\n at org.apache.struts.action.ActionServlet.process(Unknown Source)\n at org.apache.struts.action.ActionServlet.doPost(Unknown Source)\n at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)\n at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)\n at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1227)\n at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:776)\n at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:458)\n at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)\n at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136)\n at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:79)\n at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:928)\n at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1025)\n at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:1385)\n at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:194)\n at org.apache.struts.action.RequestProcessor.doForward(Unknown Source)\n at org.apache.struts.tiles.TilesRequestProcessor.doForward(Unknown Source)\n at org.apache.struts.action.RequestProcessor.processForwardConfig(Unknown Source)\n at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(Unknown Source)\n at org.apache.struts.action.RequestProcessor.process(Unknown Source)\n at org.apache.struts.action.ActionServlet.process(Unknown Source)\n at org.apache.struts.action.ActionServlet.doPost(Unknown Source)\n at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)\n at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)\n at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1227)\n at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:776)\n at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:458)\n at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)\n at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136)\n at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:97)\n at com.ibm.ws.console.core.servlet.WSCUrlFilter.setUpCommandAssistance(WSCUrlFilter.java:955)\n at com.ibm.ws.console.core.servlet.WSCUrlFilter.continueStoringTaskState(WSCUrlFilter.java:504)\n at com.ibm.ws.console.core.servlet.WSCUrlFilter.doFilter(WSCUrlFilter.java:325)\n at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)\n at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)\n at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:928)\n at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1025)\n at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3761)\n at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)\n at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:976)\n at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)\n at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)\n at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:459)\n at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:526)\n at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:312)\n at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:88)\n at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)\n at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)\n at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)\n at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)\n at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)\n at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)\n at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)\n at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1862)\nCaused by: javax.resource.ResourceException: endpointActivation failed\n at com.ibm.ejs.j2c.ActivationSpecWrapperImpl.activateEndpoint(ActivationSpecWrapperImpl.java:372)\n at com.ibm.ejs.j2c.RAWrapperImpl.activateEndpoint(RAWrapperImpl.java:1105)\n at com.ibm.ejs.j2c.RALifeCycleManagerImpl.activateEndpoint(RALifeCycleManagerImpl.java:1754)\n at com.ibm.ejs.container.MessageEndpointFactoryImpl.activateEndpoint(MessageEndpointFactoryImpl.java:168)\n at com.ibm.ws.runtime.component.EJBContainerImpl.startMDBs(EJBContainerImpl.java:4714)\n ... 101 more\nCaused by: java.lang.ClassCastException: com.ibm.ws.naming.jndicos.CNContextImpl incompatible with javax.jms.Destination\n at com.ibm.mq.connector.DestinationBuilder.createDestination(DestinationBuilder.java:152)\n at com.ibm.mq.connector.inbound.MessageEndpointDeployment.startDelivery(MessageEndpointDeployment.java:317)\n at com.ibm.mq.connector.inbound.MessageEndpointDeployment.(MessageEndpointDeployment.java:224)\n at com.ibm.mq.connector.ResourceAdapterImpl.endpointActivation(ResourceAdapterImpl.java:397)\n at com.ibm.ejs.j2c.ActivationSpecWrapperImpl.activateUnderRAClassLoaderContext(ActivationSpecWrapperImpl.java:646)\n at com.ibm.ejs.j2c.ActivationSpecWrapperImpl.activateEndpoint(ActivationSpecWrapperImpl.java:362)\n ... 105 moreMy message driven\nejb-mdb moduleMdbListener.java:@MessageDriven(activationConfig = {\n @ActivationConfigProperty(propertyName = \"destinationType\", \n propertyValue = \"javax.jms.Queue\")},\n name = \"MdbListener\")\npublic class MdbListener implements MessageListener {\n public void onMessage(Message message) {\n System.out.println(\"MdbListener called...\");\n }\n}ejb-mdb moduleejb-jar.xml:\n\n My MDB\n \n \n MdbListener\n MdbListener\n ru.aparfenov.mdb.MdbListener\n \n jms/mdbtest/queue\n javax.jms.Queue\n Consumes\n jms/mdbtest/queue\n \n \n \nejb-mdb moduleibm-ejb-jar-bnd.xml:\n\n \n \n \nWhen deploing my ear I was always asked to point out the JNDI name for target resource.All my JMS resources: queue connection factory, queue, activation specification and WebSphere MQ messaging provider are all in the sameCell=AParfenovNode02Cellscope. And resource adapter sees my active spec in J2C activation specifications with corresponding scope.\nMy messaging provider native library path is set toC:\\Program Files (x86)\\IBM\\WebSphere MQ\\java\\lib64.\nAlso I have a web application which successfully uses the same JMS resources and writes messages intojms/mdbtest/queue.\nCan someone help me?### Assistant: Looks like you're trying to use this for your JNDI locations:jms/mdbtest/queue # Queue \njms/mdbtest/queue/activespec #ActivationSpecbutjms/mdbtest/queueis a Context since it has children.Instead try something like:jms/mdbtest/queue/queue\njms/mdbtest/queue/activespec\n"} +{"text": "### Human: I have been provided by USER_ID and PASSWORD from MQ Administrator to connect to IBM MQ from our JMS application hosted on Webloigc 12c (12.1.3).Following is the configuration made by me in Weblogic:-\n1. Create a foreign server. Specified JNDI initial context factory as \"com.sun.jndi.fscontext.RefFSContextFactory\" and JNDI connection URL as path of .bindings file.Create destination in foreign server.Create connection factory in foreign server. Specified the username and password provided by MQ administrator.Restarted the server.After restart, server log show the error \"JMSWMQ2013\" and MQ administrator reported that following error----- cmqxrsrv.c : 2321 -------------------------------------------------------\n09/30/2016 11:09:46 AM - Process(10686.64) User(mqm) Program(amqzlaa0)\n Host(vlq9dmqsdv01.fulcrumlimited.ca) Installation(Installation1)\n VRMF(8.0.0.4) QMgr(FCSWIFTD)\n\nAMQ5540: Application 'weblogic.Server' did not supply a user ID and passwordMQ Administrator also reported that he is receive User ID as OS user which created EJB and not the one specified in Foreign Server.What configuration I need to do, so that weblogic send proper username and password to IBM MQ.### Assistant: You can pass a user identifier and a password via the JMS API call:javax.jms.ConnectionFactory.createConnection(String, String)or, if using the simplified JMS 2.0 API:javax.jms.ConnectionFactory.createContext(String, String)where the first String parameter is the user identifier passed to MQ when establishing a connection and the second parameter is the password.If you don't supply the user credentials via the API calls noted above, the MQ classes for JMS will default to sending the user identifier that started the JVM to the MQ queue manager on the connection and no password.For reference:https://docs.oracle.com/javaee/7/api/javax/jms/ConnectionFactory.html\n"} +{"text": "### Human: In my system, I need to load MQIC.DLL (IBM WebSphere MQ) to send and get messages to a MQ server.Currently, this service is running in VB5, and I need to upgrade to .Net. When I try to load this library, I get the error:Attempted to read or write protected memory. This is often an indication that other memory is corrupt.The code:[DllImport(\"MQIC.DLL\", EntryPoint = \"MQCONNstd@16\", SetLastError = true)]\npublic static extern void MQCONN(string QMgrName, long Hconn, long CompCode, long Reason);Does anybody have idea why it's happening?The VB5 code:Declare Sub MQCONN Lib \"MQIC.DLL\" Alias \"MQCONNstd@16\" (ByVal QMgrName As String, Hconn As Long, CompCode As Long, Reason As Long)This is MQOD struct:public struct MQOD\n{\n public String StrucId; //Structure identifier'\n public long Version; //Structure version number'\n public long ObjectType; //Object type'\n public string ObjectName; //Object name'\n public string ObjectQMgrName; //Object queue manager name'\n public string DynamicQName; //Dynamic queue name'\n public string AlternateUserId; //Alternate user identifier'\n}### Assistant: Change the declaration ofMQCONNto useout longfor alllongparameters.CheckMQ application programming referencefor each API call, and make sure you useoutorreffor every parameter described as output or input/output.You can also look forcmqc.hin your MQ installation directory, provided you have installed development environment. It has declarations of all MQI calls. You can transcribe the C header to C# - wherever you see a pointer (*) useoutorref.But generally speaking, you are going to be much better off using managed .Net classes for MQ, as others suggested.\n"} +{"text": "### Human: I am using an EJB 3.0 MDB to read messages asynchronously from a MQ queue. This MDB is packaged as a jar and imported as a dependency into a Web project.This application is deployed on Websphere 8.x, and the whole configuration, including the activation spec is similar to the one showed in this post:How to configure Java Message Driven Beans and Websphere Activation specification without hardcoded JNDI Names?My question is, how can I configure the thread pool, that is, the number of threads that are going to process the messages?I have found some IBM articles about it, but all of them about the deprecated ListenerPorts, not the activation specs.### Assistant: There are two basic settings to configure to control the number of messages that can be processed concurrently.First, theMaximum server sessionsdefines the number of concurrent messages that can be processed for each Activation specification.Second, the Activation specification server sessions are run on threads of the WMQJCAResourceAdapter thread pool, so this thread pool'sMaximum sizeis important.So a good starting point is to configure the WMQJCAResourceAdapter thread pool such that it equals the sum of theMaximum server sessionssettings across all WMQ Activation specifications visible to a server.E.g. if you have three WMQ Activation specifications in a server each withMaximum server sessionsset to 25, you should set the WMQJCAResourceAdapter thread poolMaximum sizeto 75.This is all explained along with screenshots inthis article.\n"} +{"text": "### Human: I am using JMeter to connect to Websphere MQ for placing multiple messages to the Queue. I have tried the belowDownloaded the below jars into a separate path and enabled the user.classpath variable injmeter.propertiesand appended the jars path to ita) com.ibm.mq.jarb) com.ibm.mqjms.jarc) dhbcore.jard) fscontext.jare) javax.jms.jarf) jms.jarg) providerutil.jarUsed JMS Publisher Sampler and have set the required detailsRan the Sampler and I am getting error asjavax.naming.NameNotFoundException: com.ibm.mq.jms.MQQueueConnectionFactoryI have tried downloading multiple other jars as specified in different forums on the internet. None of them seems to resolve this issue. The classcom.ibm.mq.jms.MQQueueConnectionFactoryis indeed present in the MQ jars downloaded. Not sure why JMeter is unable to find this class.Any help on this, please?### Assistant: Wow. You are missing a bunch of MQ JAR files.e) javax.jms.jarThat's not an MQ JAR file.Here's the list of MQ JAR files that you need for MQ JMS Pub/Sub:com.ibm.mq.commonservices.jarcom.ibm.mq.headers.jarcom.ibm.mq.jarcom.ibm.mq.jmqi.jarcom.ibm.mq.pcf.jarcom.ibm.mqjms.jarconnector.jardhbcore.jarfscontext.jarjms.jarjndi.jarjta.jarldap.jarproviderutil.jarrmm.jarIf you want to make your life easier, starting with MQ v8.0.0.4, there is an MQ JAR file called 'com.ibm.mq.allclient.jar' that contains everything.\n"} +{"text": "### Human: I am trying to put a large file onto a WebSphere MQ queue through a TCL script. Following is what I have at the moment:exec sh -c \"echo $msg | qmqsput targetQueue queueManagerHowever I run into the following error:Couldn't execute \"sh\": argument list too longMy message is very large and is larger than the max argument length. How can I tackle this problem?### Assistant: There's no need to go via sh, so just try this:exec qmqsput targetQueue queueManager << $msg\n"} +{"text": "### Human: We are planning to do a POC with Websphere MQ (8.0.0.5). \nCan anyone give any pointers on how to achieve the Websphere MQ (8.0.0.5 - which supports AMQP) integration with Spring-AMQP framework.As far as i know Spring-AMQP inherently supports RabbitMQ. \nPlease let me know how this can be extended to Websphere MQ.Thanks.### Assistant: Spring AMQP does not support AMQP 1.0 which (I believe) is what Websphere MQ supports.1.0 is a very different protocol to that supported by RabbitMQ (0.9.1).Spring currently does not have an abstraction over AMQP 1.0; there is an openJIRA issuebut it currently is not on the road map.Contributions are welcome.\n"} +{"text": "### Human: I am using Spring 3.2.8 with JDK 6 and Websphere MQ 7.5.0.5. In my application I am making some jms calls using jmsTemplate via ThreadPool. First I faced condition that \"Current queue depth\" count increases as I hit jms calls. I tracked all objects I am initiating via ThreadPool and interrupt or cancel all threads/future objects. So this \"Current queue depth\" count controlled.Now problem is \"Open input count\" value increases nearly to the number of requests I am sending. When I stops my server this count becomes 0.In all this case I am able to send request and get response till count of 80 and my ThreadPool size is 30. After reaching request count somewhere to 80 I keep receiving error of future object rejections and not able to receive responses. In fact null responses receive for remaining calls.Please suggest.### Assistant: I am using queue in my application and filter on correlation id has been applied. I read more on it and found when we make a call tojmsTemplate.receiveSelected (queue, filter)then this has serious impact on performance. Once I removed this filter the thread conjunction issue resolved. But now filtering is still a problem for me.Now I will be applying filter in a different way with some limitation of the application but not usingreceiveSelectedinstead now I am usingjmsTemplate.receive.Update on 14-SepAll - I find this as a solution and like to post here.One of my colleague helped in rectifying this issue which is great help. What we observed after debugging that if cacheConsumer is true then based on combination ofqueue + message-selector + sessionconsumers are cached by Spring. And even callingclose()method does not do any thing; basically empty method and causing thread to be hanged/stuck.After setting cacheConsumer to false, I reverted my code back to original i.e.jmsTemplate.receiveSelected (destination, messageSelector), now when I hit 100 request count of threads only increased between 5 to 10 during multiple iterations of test.So - this property need to be used carefully.hope this helps !!\n"} +{"text": "### Human: I am trying to connect to a QueueManager in Mainframe using Java code which also resides in Mainframe Server.Do we have any sample code to connect to Mainframe MQ from java which runs in Mainframe context? Do we need to connect using Client or Bindings mode?### Assistant: In the samples directory of WMQ you will have code that uses core MQI API's (MQQueueManager , MQQueue) and uses MQ Core API's. They are consistent with the JAVA & MQ API semantics (Not dependent on Platform). These should allow you to communicate with Queue/QueueManager.You can reference some of the code here (http://www.capitalware.com/pc_win_code_java.html).As for client vs Bindings mode , you will have to refer (https://www.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q030560_.htm)WebSphere\u00ae MQ classes for Java\u2122 can connect in client or bindings mode.Programmable options allow WebSphere MQ classes for Java to connect to WebSphere MQ in either of the following ways:\n As a WebSphere MQ MQI client using Transmission Control Protocol/Internet Protocol (TCP/IP)\n In bindings mode, connecting directly to WebSphere MQ using the Java Native Interface (JNI)\n Clients cannot be run on z/OS\u00ae, but clients on other platforms can connect to a WebSphere MQ for z/OS queue manager if the Client Attach Facility is installed.\n"} +{"text": "### Human: I am trying to put a message to Queue from a Java program, I am getting an issue where it says it unable to connect to the host & it seems it is not able to read the channel.Here is the error from AMERR01.log----- amqccita.c : 4113 -------------------------------------------------------\n07/25/2016 07:04:29 AM - Process(18280.26) User(mqm) Program(amqrmppa)\n Host(ip-10-0-0-238) Installation(Installation1)\n VRMF(8.0.0.4) QMgr(CSBTS.QUEUE.MANAGER)\n\nAMQ9209: Connection to host 'ip-10-0-0-238 (10.0.0.238)' for channel 'CHAN2'\nclosed.\n\nEXPLANATION:\nAn error occurred receiving data from 'ip-10-0-0-238 (10.0.0.238)' over TCP/IP.\n The connection to the remote host has unexpectedly terminated.\n\nThe channel name is 'CHAN2'; in some cases it cannot be determined and so is\nshown as '????'.\nACTION:\nTell the systems administrator.Here is the java code,package com.sample.mq.client.ClientMQ;\n\nimport java.io.IOException;\n\nimport com.ibm.mq.MQC;\nimport com.ibm.mq.MQEnvironment;\nimport com.ibm.mq.MQException;\nimport com.ibm.mq.MQGetMessageOptions;\nimport com.ibm.mq.MQMessage;\nimport com.ibm.mq.MQPutMessageOptions;\nimport com.ibm.mq.MQQueue;\nimport com.ibm.mq.MQQueueManager;\n\n/**\n * Java class to connect to MQ. Post and Retreive messages.\n *\n */\npublic class MQClientTest {\n\n String qMngrStr = \"CSBTS.QUEUE.MANAGER\";\n String user = \"mqm\";\n String password = \"bts@2016\";\n String queueName = \"CSBTS.DEAL\";\n String hostName = \"10.0.0.238\";\n int port = 1414;\n String channel = \"CHAN2\";\n //message to put on MQ.\n String msg = \"Hello World, WelCome to MQ.\";\n //Create a default local queue.\n MQQueue defaultLocalQueue;\n MQQueueManager qManager;\n\n /**\n * Initialize the MQ\n *\n */\n public void init(){\n\n //Set MQ connection credentials to MQ Envorinment.\n MQEnvironment.hostname = hostname;\n MQEnvironment.channel = channel;\n MQEnvironment.port = port;\n MQEnvironment.userID = user;\n MQEnvironment.password = password;\n //set transport properties.\n MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);\n\n try {\n //initialize MQ manager.\n qManager = new MQQueueManager(qMngrStr);\n } catch (MQException e) {\n e.printStackTrace();\n }\n }\n\n /**\n * Method to put message to MQ.\n *\n */\n public void putAndGetMessage(){\n\n int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT; \n try {\n defaultLocalQueue = qManager.accessQueue(queueName, openOptions);\n\n MQMessage putMessage = new MQMessage();\n putMessage.writeUTF(msg);\n\n //specify the message options...\n MQPutMessageOptions pmo = new MQPutMessageOptions(); \n // accept \n // put the message on the queue\n defaultLocalQueue.put(putMessage, pmo);\n\n System.out.println(\"Message is put on MQ.\");\n\n //get message from MQ.\n MQMessage getMessages = new MQMessage();\n //assign message id to get message.\n getMessages.messageId = putMessage.messageId;\n\n //get message options.\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n defaultLocalQueue.get(getMessages, gmo);\n\n String retreivedMsg = getMessages.readUTF();\n System.out.println(\"Message got from MQ: \"+retreivedMsg);\n\n } catch (MQException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n public static void main(String[] args) {\n\n System.out.println(\"Processing Main...\");\n\n MQClientTest clientTest = new MQClientTest();\n\n //initialize MQ.\n clientTest.init();\n\n //put and retreive message from MQ.\n clientTest.putAndGetMessage();\n\n System.out.println(\"Done!\");\n }\n\n}I am trying to read the message from the queue from the command line,./amqsget CSBTS.DEAL CSBTS.QUEUE.MANAGERI am not able to figure out what is the problem, is it with the connection or channel.\nP.S My channel authentication is disabled.### Assistant: Hummmm, where to begin?(1) That's some bad code. Your problem is not the channel or credentials but rather your lack of code. Even though you don't realize it, your code actually, put and retrieved a message from a queue. The reason for the error message in the MQ log is because the queue manager said WTF to your code. Programming 101, if you connect to it, then disconnect from it. If you open it then close it when you are done. Don't be lazy and assume something else will clean up your garbage. Hence, the reason for the log message is because you did NOT close and disconnect from the queue manager and it said WTF.(2) Don't use MQEnvironment class but rather put the connection information in a Hashtable and pass it to the MQQueueManager class. MQEnvironment is NOT thread safe.(3) If you want to match on either MsgID and/or CorrelID on an MQGET then you actually have to tell the queue manager it (see 'gmo.matchOptions' below).(4) Add the 'FAIL_IF_QUIESCING' options to all of your MQ API calls - good programming practice.Here's your code updated so that the queue manager does NOT say WTF:import java.io.IOException;\nimport java.util.Hashtable;\n\nimport com.ibm.mq.*;\nimport com.ibm.mq.constants.CMQC;\n\n/**\n * Java class to connect to MQ. Post and Retrieve messages.\n * \n * Sample Command Line Parameters \n * -h 127.0.0.1 -p 1414 -c TEST.CHL -m MQA1 -q TEST.Q1 -u userid -x password\n */\npublic class MQClientTest\n{\n private Hashtable params = null;\n private Hashtable mqht = null;\n private String qManager;\n private String inputQName;\n\n /**\n * The constructor\n */\n public MQClientTest()\n {\n super();\n }\n\n /**\n * Make sure the required parameters are present.\n * \n * @return true/false\n */\n private boolean allParamsPresent()\n {\n boolean b = params.containsKey(\"-h\") && params.containsKey(\"-p\") &&\n params.containsKey(\"-c\") && params.containsKey(\"-m\") &&\n params.containsKey(\"-u\") && params.containsKey(\"-x\") &&\n params.containsKey(\"-q\");\n if (b)\n {\n try\n {\n Integer.parseInt((String) params.get(\"-p\"));\n }\n catch (NumberFormatException e)\n {\n b = false;\n }\n }\n\n return b;\n }\n\n /**\n * Extract the command-line parameters and initialize the MQ variables.\n * \n * @param args\n * @throws IllegalArgumentException\n */\n private void init(String[] args) throws IllegalArgumentException\n {\n params = new Hashtable();\n if (args.length > 0 && (args.length % 2) == 0)\n {\n for (int i = 0; i < args.length; i += 2)\n {\n params.put(args[i], args[i + 1]);\n }\n }\n else\n {\n throw new IllegalArgumentException();\n }\n\n if (allParamsPresent())\n {\n qManager = (String) params.get(\"-m\");\n inputQName = (String) params.get(\"-q\");\n\n mqht = new Hashtable();\n\n mqht.put(CMQC.CHANNEL_PROPERTY, params.get(\"-c\"));\n mqht.put(CMQC.HOST_NAME_PROPERTY, params.get(\"-h\"));\n\n try\n {\n mqht.put(CMQC.PORT_PROPERTY, new Integer(params.get(\"-p\")));\n }\n catch (NumberFormatException e)\n {\n mqht.put(CMQC.PORT_PROPERTY, new Integer(1414));\n }\n\n mqht.put(CMQC.USER_ID_PROPERTY, params.get(\"-u\"));\n mqht.put(CMQC.PASSWORD_PROPERTY, params.get(\"-x\"));\n\n // I don't want to see MQ exceptions at the console.\n MQException.log = null;\n }\n else\n {\n throw new IllegalArgumentException();\n }\n }\n\n /**\n * Method to put then get a message to/from a queue.\n */\n public void putAndGetMessage()\n {\n MQQueueManager qMgr = null;\n MQQueue queue = null;\n MQMessage putMessage = null;\n MQMessage getMessage = null;\n\n int openOptions = CMQC.MQOO_INPUT_AS_Q_DEF | CMQC.MQOO_OUTPUT + CMQC.MQOO_FAIL_IF_QUIESCING;\n\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.options = CMQC.MQGMO_NO_WAIT + CMQC.MQGMO_FAIL_IF_QUIESCING;\n\n MQPutMessageOptions pmo = new MQPutMessageOptions();\n pmo.options = CMQC.MQPMO_FAIL_IF_QUIESCING;\n\n String msg = \"Hello World, WelCome to MQ.\";\n\n try\n {\n qMgr = new MQQueueManager(qManager, mqht);\n queue = qMgr.accessQueue(inputQName, openOptions);\n\n putMessage = new MQMessage();\n putMessage.writeUTF(msg);\n\n // put the message on the queue\n queue.put(putMessage, pmo);\n\n System.out.println(\"Message is put on MQ.\");\n\n // get message from MQ.\n getMessage = new MQMessage();\n // assign message id to get message.\n getMessage.messageId = putMessage.messageId;\n\n /*\n * Tell the queue manager that we want a message with a specific MsgID.\n */\n gmo.matchOptions = CMQC.MQMO_MATCH_MSG_ID;\n\n // get message options.\n queue.get(getMessage, gmo);\n\n String retreivedMsg = getMessage.readUTF();\n System.out.println(\"Message got from MQ: \" + retreivedMsg);\n }\n catch (MQException e)\n {\n System.err.println(\"CC=\" + e.completionCode + \" : RC=\" + e.reasonCode);\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n finally\n {\n try\n {\n if (queue != null)\n queue.close();\n }\n catch (MQException e)\n {\n System.err.println(\"MQCLOSE CC=\" + e.completionCode + \" : RC=\"\n + e.reasonCode);\n }\n\n try\n {\n if (qMgr != null)\n qMgr.disconnect();\n }\n catch (MQException e2)\n {\n System.err.println(\"MQDISC CC=\" + e2.completionCode + \" : RC=\"\n + e2.reasonCode);\n }\n }\n }\n\n public static void main(String[] args)\n {\n System.out.println(\"Processing Main...\");\n MQClientTest clientTest = new MQClientTest();\n\n try\n {\n // initialize MQ.\n clientTest.init(args);\n // put and retrieve message from MQ.\n clientTest.putAndGetMessage();\n }\n catch (IllegalArgumentException e)\n {\n System.out.println(\"Usage: java MQClientTest -h host -p port -c channel -m QueueManagerName -q QueueName -u userid -x password\");\n System.exit(1);\n }\n\n System.out.println(\"Done!\");\n }\n}\n"} +{"text": "### Human: I have a current requirement for upgrading MQ to support SHA2 . Currently we are using MQ6 , will upgrade to MQ7 to enable SHA2 support.We are using Weblogic8 for our current MQ6. Why do we have to upgrade our weblogic server for newer MQ7 upgrade.### Assistant: If you're making the effort to upgrade from such an old unsupported release of MQ, why would you only go to MQ 7.0 which itself is out of support?Why not consider in support options such as 7.1, 7.5, 8.0, or 9.0 and benefit from years of new function, bug fixes, and other improvements?You won't find anything as old as Weblogic 8 on an MQ 7+ supported environment statement as it is itself very old and presumably no longer supported.\n"} +{"text": "### Human: I have a C# application that sets up numerous MQ listeners (multiple threads and potentially multiple servers each with their own listeners). There are some messages that will come off the queue that I will want to leave on the queue, move on to the next message on the MQ, but then under some circumstances I will want to go back to re-read those messages...var connectionFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ).CreateConnectionFactory();\nconnectionFactory.SetStringProperty(XMSC.WMQ_HOST_NAME, origination.Server);\nconnectionFactory.SetIntProperty(XMSC.WMQ_PORT, int.Parse(origination.Port));\nconnectionFactory.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, origination.QueueManager);\nconnectionFactory.SetStringProperty(XMSC.WMQ_CHANNEL, origination.Channel);\n\nvar connection = connectionFactory.CreateConnection(null, null);\n_connections.Add(connection);\n\nvar session = connection.CreateSession(false, AcknowledgeMode.ClientAcknowledge); //changed to use ClientAcknowledge so that we will leave the message on the MQ until we're sure we're processing it\n_sessions.Add(session);\n\nvar destination = session.CreateQueue(origination.Queue);\n_destinations.Add(destination);\n\nvar consumer = session.CreateConsumer(destination);\n_consumers.Add(consumer);\n\nLogging.LogDebugMessage(Constants.ListenerStart);\n\nconnection.Start();\nThreadPool.QueueUserWorkItem((o) => Receive(forOrigination, consumer));Then I have...if (OnMQMessageReceived != null)\n{\n var message = consumer.Receive();\n var identifier = string.Empty;\n\n if (message is ITextMessage)\n {\n //do stuff with the message here\n //populates identifier from the message\n }\n else\n {\n //do stuff with the message here\n //populates identifier from the message\n }\n\n if (!string.IsNullOrWhiteSpace(identifier)&& OnMQMessageReceived != null)\n {\n if( some check to see if we should process the message now)\n {\n //process message here\n message.Acknowledge(); //this really pulls it off of the MQ\n\n //here is where I want to trigger the next read to be from the beginning of the MQ\n }\n else\n {\n //We actually want to do nothing here. As in do not do Acknowledge\n //This leaves the message on the MQ and we'll pick it up again later\n //But we want to move on to the next message in the MQ\n }\n }\n else\n {\n message.Acknowledge(); //this really pulls it off of the MQ...its useless to us anyways\n }\n}\nelse\n{\n Thread.Sleep(0);\n}\n\nThreadPool.QueueUserWorkItem((o) => Receive(forOrigination, consumer));So a couple of questions:If I do not acknowledge the message it stays on the MQ, right?If the message is not acknowledged then by default when I read from the MQ again with the same listener it reads the next one and does not go to the beginning, right?How do I change the listener so that the next time I read I start at the beginning of the queue?### Assistant: Leaving messages on a queue is an anti-pattern. If you don't want to or cannot process the message at a certain point of your logic, then you have a number of choices:Get it off the queue and put to another queue/topic for a delayed/different processing.Get it off the queue and dump to a database, flat file - whatever, if you want to process it outside of messaging flow, or don't want to process at all.If it is feasible, you may want to change the message producer so it doesn't mix the messages with different processing requirements in the same queue/topic.In any case, do not leave a message on the queue, and always move forward to the next message. This will make the application way more predictable and easier to reason about. You will also avoid all kinds of performance problems. If your application is or may ever become sensitive to the sequence of message delivery, then manual acknowledgement of selected messages will be at odds with it too.To your questions:The JMS spec is vague regarding the behavior of unacknowledged messages - they may be delivered out of order, and it is undefined when exactly when they will be delivered. Also, the acknowledge method call will acknowledge all previously received and unacknowledged messages - probably not what you had in mind.If you leave messages behind, the listener may or may not go back immediately. If you restart it, it of course will start afresh, but while it is sitting there waiting for messages it is implementation dependent.So if you try to make your design work, you may get it kind of work under certain circumstances, but it will not be predictable or reliable.\n"} +{"text": "### Human: I am confused with the usage of Local vs Remote Queue. Let me put a scenario :I have an Application 1 that sends message (Msg1) to IBM MQ that stores the message in the Queue 1 which resides in QMGR which is then consumed by Application 2.At this is stage is it necessary for me to implement a Remote Queue or a Local Queue. If I use a Local Queue for the this then where would I be using Remote Queue.I believe this a basic question but I just trying to get a better understanding of IBM MQ. Please help me with your suggestions.Thanks### Assistant: If you are just using MQ so that one application can store messages on a queue for another application to retrieve, all within a single queue manager then a local queue suffices. Within MQ messages always reside on local queues (normal or transmission queues), and the other definitions just help route traffic.An example of when you would use a remote queue is when you wish to split the applications apart, so the putter application puts to one queue manager on one machine, and the consumer/getter application lives on another queue manager potentially on another machine. In this scenario the putter can address a remote queue, but the messages really end up on a transmission queue - then a channel retrieves the messages from the transmission queue, flows it over the channel to the other queue manager and puts to the 'local' queue on the destination queue manager which the consumer is reading from.Using a remote queue for example, it is possible to split apart the producer and the consumer without needing them to change the queue name they get from - Imagine they both the producer and consumer read from queue MYQUEUE. You could then move the consumer to one queue manager (QM1) with a remote queue called MYQUEUE whose real (remote) name is MYQUEUE on another queue manager (QM2). On queue manager 2, you would then have a local queue definition called MYQUEUE. The producer still opens and writes to MYQUEUE and doesnt know its messages will be routed, and the consumer still reads from MYQUEUE and retrieves the messages.\n"} +{"text": "### Human: How do you get all available queue names from client side, of your MQ environment using the IBM MQ lib for .Net (IBM.WMQ), Version 8.0?\nI have written a fine .Net application for reading and sending data to MQ(similar founds at code project).Do anyone know if it is possible/how to get all available queue names from the IBM.WMQ .NET lib dynamically as you do when using tool IBM test tool RfhUtil.exe or as you can do withrunmqsc DISPLAY QUEUEcommand from IBM .Net lib?I have tried to brows theAPI,Reference manualandIBM programming guidewithout success.### Assistant: There is certain level of PCF support in MQ .NET but it is undocumented. Here is a sample code to display queue names in queue manager.using System;\nusing System.Collections;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing IBM.WMQ;\nusing IBM.WMQ.PCF;\n\nnamespace PCFNET\n{\n class Program\n {\n static void Main(string[] args)\n {\n InquireQueue();\n }\n\n /// \n /// Display list of queue names and queue depth for each queue\n /// \n public static void InquireQueue()\n {\n PCFMessageAgent messageAgent = null;\n try\n {\n // Create bindings connection to queue manager\n messageAgent = new PCFMessageAgent(\"DEMOQMGR\");\n\n // Build Inquire command to query queue name\n PCFMessage reqeuestMessage = new PCFMessage(MQC.MQCMD_INQUIRE_Q);\n reqeuestMessage.AddParameter(MQC.MQCA_Q_NAME, \"*\");\n\n // Send request and receive response\n PCFMessage[] pcfResponse = messageAgent.Send(reqeuestMessage);\n\n // Process and print response.\n int pcfResponseLen = pcfResponse.Length;\n for (int pcfResponseIdx = 0; pcfResponseIdx < pcfResponseLen; pcfResponseIdx++)\n {\n try\n {\n String qName = pcfResponse[pcfResponseIdx].GetStringParameterValue(MQC.MQCA_Q_NAME);\n int qDepth = pcfResponse[pcfResponseIdx].GetIntParameterValue(MQC.MQIA_CURRENT_Q_DEPTH);\n Console.WriteLine(\"QName: \" + qName + \" Depth: \" + qDepth);\n }\n catch (PCFException pcfex)\n {\n //Ignore exception and get the next response\n }\n }\n }\n catch (PCFException pcfEx)\n {\n Console.Write(pcfEx);\n }\n catch (MQException ex)\n {\n Console.Write(ex);\n }\n catch (Exception ex)\n {\n Console.Write(ex);\n }\n finally\n {\n if (messageAgent != null)\n messageAgent.Disconnect();\n }\n }\n}}\n"} +{"text": "### Human: I'm creating an error monitoring tool using Spring JMS and I am currently reading messages off of the queue and logging the errors. The angle I am going for is storing all the messages from our error queue into a map. The key for the map is basically the error info and the value is the count, as we would like to know how many of these there are. When all of the messages are read off and the queue has 0 messages on it, I would like to then run file creation portion of the application and finally terminate the application.I have ran across these posts:Check MQ queue depth,How to check whether have message in the queue,Websphere 7 MQueue: how to access queue depth from Java?I have tried a hodge podge of each of them and also looked over IBM's Knowledge Center and haven't gained any success. This what I currently have:public int depthOfQueue() throws MQException {\n queueManager = new MQQueueManager(queueManagerName); // fails here\n MQQueue queue = queueManager.accessQueue(queueName, CMQC.MQOO_OUTPUT);\n int depth = queue.getCurrentDepth();\n queueManager.disconnect();\n queue.close();\n return depth;\n }But in my logs I get stack traces like:java.lang.NoClassDefFoundError: Could not initialize class com.ibm.mq.internal.MQCommonServices\n at com.ibm.mq.MQSESSION.getJmqiEnv(MQSESSION.java:142) ~[com.ibm.mq-7.0.1.9.jar:7.0.1.9 - k701-109-120705]\n at com.ibm.mq.MQQueueManagerFactory.(MQQueueManagerFactory.java:85) ~[com.ibm.mq-7.0.1.9.jar:7.0.1.9 - k701-109-120705]\n at com.ibm.mq.MQQueueManagerFactory.getInstance(MQQueueManagerFactory.java:112) ~[com.ibm.mq-7.0.1.9.jar:7.0.1.9 - k701-109-120705]\n at com.ibm.mq.MQQueueManager.(MQQueueManager.java:156) ~[com.ibm.mq-7.0.1.9.jar:7.0.1.9 - k701-109-120705]\n at org.mycom.casts.MQReader.depthOfQueue(MQReader.java:56) ~[classes/:?]\n at org.mycom.casts.MQReader.processOrder(MQReader.java:36) ~[classes/:?]\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_74]\n at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_74]\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_74]\n at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_74]\n at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:198) ~[spring-messaging-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:116) ~[spring-messaging-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at org.springframework.jms.listener.adapter.MessagingMessageListenerAdapter.invokeHandler(MessagingMessageListenerAdapter.java:90) ~[spring-jms-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at org.springframework.jms.listener.adapter.MessagingMessageListenerAdapter.onMessage(MessagingMessageListenerAdapter.java:66) ~[spring-jms-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:721) ~[spring-jms-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:681) [spring-jms-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:651) [spring-jms-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:315) [spring-jms-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:253) [spring-jms-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1150) [spring-jms-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1142) [spring-jms-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1039) [spring-jms-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at java.lang.Thread.run(Unknown Source) [?:1.8.0_74]andjava.lang.NoClassDefFoundError: Could not initialize class com.ibm.mq.MQQueueManager\n at org.mycom.casts.MQReader.depthOfQueue(MQReader.java:56) ~[classes/:?]\n at org.mycom.casts.MQReader.processOrder(MQReader.java:36) ~[classes/:?]\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_74]\n at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_74]\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_74]\n at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_74]\n at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:198) ~[spring-messaging-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:116) ~[spring-messaging-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at org.springframework.jms.listener.adapter.MessagingMessageListenerAdapter.invokeHandler(MessagingMessageListenerAdapter.java:90) ~[spring-jms-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at org.springframework.jms.listener.adapter.MessagingMessageListenerAdapter.onMessage(MessagingMessageListenerAdapter.java:66) ~[spring-jms-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:721) ~[spring-jms-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:681) [spring-jms-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:651) [spring-jms-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:315) [spring-jms-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:253) [spring-jms-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1150) [spring-jms-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1142) [spring-jms-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1039) [spring-jms-4.2.4.RELEASE.jar:4.2.4.RELEASE]\n at java.lang.Thread.run(Unknown Source) [?:1.8.0_74]I've read that I could be missing dependencies for MQ but I have what I need in my pom. I also read that I could download a client version of MQ (or something), not in a position to do that.And as someone pointed out in this post:IBM MQ getCurrentDepth requires accessQueueFinally, there should NEVER be a need to use the getCurrentDepth\n method in an MQ application. You either get a single message or loop\n until an MQException is thrown with MQRC_NO_MSG_AVAILABLE (2033)\n reason code.So my question is. How can I resolve the Exceptions that are getting thrown (maybe I overlooked something), or what is the best way to check forMQException MQRC_NO_MSG_AVAILABLE (2033)? As this should also be a signal that the queue is empty.Last clarification, I am using Spring JMS with annotations to set up and read from the queue, all of which is working, I just need to know when the queue is empty.And just in case here is the listener method:@JmsListener(destination = \"${mq.queueName}\")\npublic void processOrder(String message) throws MQException {\n int messageCount = depthOfQueue(); //problem line\n String messageType = \"\";\n if(message.startsWith(\"MSH|\") && message.contains(\"ZER|\")){\n messageType = \"HL7\";\n manager.filterMessage(messageType, message);\n } else if (message.contains(\"\"/*ADD XML CHECK HERE*/)) {\n messageType = \"XML\";\n manager.filterMessage(messageType, message);\n } else {\n logger.error(\"Message:\\n\"+message+\"\\n does not meet conditions for error\");\n }\n}### Assistant: Important note pointed out by todji for this solution:Note: You're user needs to be given inq permissions on the queue for this to work:setmqaut -m QM1 -n Q1 -t queue -p mq-app +inqActually, for anyone digging around for this same issue, I got the functionality I needed from these two methodspublic int depthOfQueue() throws MQException {\n queueManager = createQueueManager();\n int openOptions = MQConstants.MQOO_INPUT_AS_Q_DEF | MQConstants.MQOO_OUTPUT | MQConstants.MQOO_INQUIRE;\n MQQueue queue = queueManager.accessQueue(queueName, openOptions);\n int depth = queue.getCurrentDepth();\n queueManager.disconnect();\n queue.close();\n return depth;\n }and@SuppressWarnings(\"unchecked\")\n public MQQueueManager createQueueManager() throws MQException {\n MQEnvironment.port = port;\n MQEnvironment.hostname = host;\n MQEnvironment.channel = channel; \n MQEnvironment.properties.put(MQConstants.TRANSPORT_PROPERTY, MQConstants.TRANSPORT_MQSERIES);\n return new MQQueueManager(queueManagerName);\n }using these:import com.ibm.mq.*;\nimport com.ibm.mq.constants.MQConstants;And you'll need the proper dependencies in the pom:\n com.ibm.mq\n com.ibm.mq\n 7.0.1.9\n \n \n com.ibm.mq\n com.ibm.mq.headers\n 7.0.1.9\n \n \n com.ibm.mq\n com.ibm.mq.commonservices\n 7.0.1.9\n \n \n com.ibm.mq\n com.ibm.mq.pcf\n 7.0.1.9\n \n \n com.ibm.mq\n com.ibm.mqjms\n 7.0.1.9\n \n \n com.ibm.mq\n com.ibm.mq.jmqi\n 7.0.1.9\n \n \n com.ibm.mq\n dhbcore\n 7.0.1.9\n \n \n javax.resource\n connector\n 1.0\n Probably a better way, but this will do the job.\n"} +{"text": "### Human: I am using IBM MQ API to connect to the queue to load my messages from a file. I usejavax.jms.QueueSenderto load the messages to my queue 'TEST.IBM.Q'.I have a functionality to load the number of valid messages from a file to be loaded as the first message.Example:\nSay I have a file called File1.txt:Valid\nValid\nValid\nInvalid\nValidHere, I will load 5 messages to my queue like below,Count-4\nValid\nValid\nValid\nValidCurrently, I am iterating throughout the file to find the number of valid messages and loading it in the start & iterating again to load the messages.I know, its a bad way of doing it. Some one could you please let me know, Is there any possibility to load a message in the start of the queue once everything is done?Thanks in advance to everyone!!### Assistant: By default, in IBM MQ, messages are delivered on a priority basis, higher priority messages are delivered first followed by lower priority messages.You can make use of this feature. Set different priorities for valid and invalid messages. If you want the valid messages to be delivered first, then set a higher priority for valid messages and lower priority to invalid messages.\n"} +{"text": "### Human: When does MQ throw the JMS Exception 'MQJMS1022: failed to redirect message' ?Our application(running on JDK 1.5) is connected to MQ 7.5.\nWhile reading the message from MQ the following exception is thrown.javax.jms.JMSException: MQJMS1022: failed to redirect message\n at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:530)\n at com.ibm.mq.jms.MQQueueReceiver.receiveAsync(MQQueueReceiver.java:734)\n at com.ibm.mq.jms.SessionAsyncHelper.run(SessionAsyncHelper.java:269)\n at java.lang.Thread.run(Thread.java:682)There is no stack trace from our application code.\nDoes anyone know what could be the reason.\nThe MQ documentation is very poor and i couldn't find much info about the error.### Assistant: It is a really good idea to also dump out the LinkedException.\ni.e.catch (JMSException e)\n{\n System.err.println(\"getLinkedException()=\" + e.getLinkedException());\n System.err.println(e.getLocalizedMessage());\n e.printStackTrace();\n}The LinkedException will contain the MQ Reason Code.\n"} +{"text": "### Human: I am writing sample Apache Camel (2.16.2) application that connects to IBM MQ queue manager in clients mode. Apache Camel uses Spring JMS underneath to connect to JMS providers. I see that SpringJmsAccessordoes not have acreateConnection() method that takes UserId and Password. It only hascreateConnection() method that does not take any parameters. Because of this create connection to queue manager fails with 2035 - Not authorized.I can connect to queue manager in server bindings mode but I need to connect in client mode as queue manager runs in a different machine. Is there a way I can get around this problem?### Assistant: Wrap yourConnectionFactoryin aUserCredentialsConnectionFactoryAdapter.\n"} +{"text": "### Human: I'm new to the IBM Websphere MQ server and have few issues when I work with this.\nI'm usingMQQueueConnectionFactoryto send a message to a queue. Here is my code.MQQueueConnectionFactory connectionFactory = null;\nQueueConnection queueConn = null;\nQueueSession queueSession = null;\nQueueSender queueSender = null;\nTextMessage message = null;\n\ntry\n{\n connectionFactory = new MQQueueConnectionFactory();\n connectionFactory.setHostName(\"192.16.34.45\");\n connectionFactory.setPort(1415);\n connectionFactory.setTransportType(1);\n connectionFactory.setQueueManager(\"MQSLLXQ1\");\n connectionFactory.setChannel(\"TO.MQSLLXQ1\");\n\n queueConn = connectionFactory.createQueueConnection(\"username\", \"password\");\n queueSession = queueConn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\n queueSender = queueSession.createSender(queueSession.createQueue(\"TestQueue\"));\n queueSender.setDeliveryMode(DeliveryMode.PERSISTENT);\n message = queueSession.createTextMessage(\"Test Message\");\n queueSender.send(message);\n queueConn.close();\n\n} catch (Exception je) {\n je.printStackTrace();\n}The message visible in the MQ queue with JMS header.jms_text\n queue:///TestQueue1454047279356
2
\n Test Message1) Is there a way to avoid this jms header and get only the payload in MQ Queue?2) Is there a way to sync both MQ Queue and JMS Queue together?### Assistant: JMS is an API specification, not a wire level protocol specification. So different vendors have their own way of implementing JMS API specification. IBM MQ (a.k.a WebSphere MQ) uses RFH2 headers to implement JMS API.1) If you are using JMS API to receive the message, that header is made available to application as different message properties. The payload can be retrieved usingmessage.getBody()(in MQ v8) method. Depending on type of the message, i.e. Text, Byte etc, you can usegetText(), readBytes()etc methods to retrieve message body.If your receiving application uses MQ APIs, then it's possible to strip off message headers by changing the queue properties.2) In IBM MQ, a JMS queue actually points to a MQ Queue.\n"} +{"text": "### Human: I am trying to implement an application(Java) which will subscribe to different message types (XMLs) from other different applications via TIBCO EMS. Each of these message types will have a specific purpose. I am of the opinion that I should have multiple queues with multiple subscribers in my application, however, the TIBCO guy is adamant that there should be only one queue where all of these messages will be published and I will have one subscriber and the subscriber then should have logic to different tasks based on the XML received.Which approach is better? One with multiple queues and subscribers OR the one queue and one subscriber? Please let me know reasons for the choice.Thanks!-Naveen### Assistant: In general, if the same application is reading all the messages, it is much cleaner for that application to have a single input queue instead of multiple input queues. With multiple then the application will need to have logic to know which order to process the queues and so on. With one input queue, the messaging system can deal with the order of the messages - whether FIFO or by priority etc, and the application can just read the next message and process it.\n"} +{"text": "### Human: I am currently using AciveMQ for routing purpose. But now i need to migrate to ibmMq. Here is my camelContext.xml configuration for AciveMq. Please help me with ibmMq config.. \nThanks in advance.\n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n\n\n \n \n \n \n \n Can anybody help me change all my configuration with respective to IBMmq\nI am new to IBMmq :(### Assistant: Here I managed to configure with ibm mq :)\n ...\n \n ...\n \n \n \n \n \n \n \n\n \n \n \n \n\n \n \n Successfully :)\n"} +{"text": "### Human: I have a java application that connects to both ActiveMQ and IBM MQ. I'm currently using IBM MQ 7.1 and trying to upgrade to use the MQ 8.0 client. The MQ 8 jars reference JMS 2.0 classes, like JMSRuntimeException. the ActiveMQ-all jar includes JMS 1.1 classes which conflict with JMS 2.0.Is there any way to utilize both?### Assistant: One easy way you can do it is to use the direct WebsphereMQ classes and NOT use it as a JMS provider, then your conflict will evaporate.\n"} +{"text": "### Human: I am using IBM MQ v7.5. I want to have mutual SSL authentication between queue manager and my JMS client.\nI am a beginner in IBM MQ and SSL. Can someone help me step by step procedure for this ?Thanks,Anuj### Assistant: This Q&A on dwAnswers gives a step-by-step guide for versions older than 7.5 and also a link to the new runmqckm command in lieu of gsk6cmd.https://developer.ibm.com/answers/questions/180659/how-do-you-set-up-ssl-2-way-authentication-between/\n"} +{"text": "### Human: I'm trying to create a flow in Mule ESB (Enterprise Edition) that receives a message from a queue in WMQ 7.5 (xml payload), transforms it with DataWeave (for my purposes here, to a new xml file that is the same as the old one), and then puts it back on another queue. My flow is as follows:\n\n\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \nAnd my DataWeave configuration looks like this:\nInput:\nTransformation:%dw 1.0\n%input payload application/xml\n%output application/xml\n---\npayloadNow, when I run this flow, and I put a message on the queue, Mule can't process the message and continually throws exceptions, saying: \"Invalid mime type application/xml\", and the exception stack is 1. Invalid mime type application/xml (com.mulesoft.weave.mule.exception.InvalidMimeTypeException) com.mulesoft.weave.mule.WeaveMessageProcessor:165 (null) 2. Invalid mime type application/xml (com.mulesoft.weave.mule.exception.InvalidMimeTypeException). Message payload is of type: String (org.mule.api.MessagingException) org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor:32 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)Anyway, I'm fairly new to Mule (and certainly DataWeave), and help would be appreciated! Let me know if any more details are needed.### Assistant: After the bug being reported it was uncovered that a combination ofWMQ,DataWeaveandsynchronous processing strategywas throwing this weird exception. Patch is already available, it will be fixed on future versions of the ESB but for now you may contact support and ask aboutSE-3167.\nGood luck!\n"} +{"text": "### Human: I am listening for messages from an IBM MQ using .Net. When it sees a message it removes the message from the queue automatically. I want to check the schema of the message first. If its not the correct schema I am looking for I want to keep it in the queue.How do I alter the code to not automatically remove the message from the queue when a message is found?int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_FAIL_IF_QUIESCING;\n IBM.WMQ.MQQueueManager mqManager = new IBM.WMQ.MQQueueManager(qmName);\n\n MQQueue queue = mqManager.AccessQueue(queueName, openOptions);\n\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.Options = MQC.MQGMO_FAIL_IF_QUIESCING | MQC.MQGMO_WAIT;\n gmo.WaitInterval = MQC.MQWI_UNLIMITED;\n\n\n queue.Get(message, gmo);\n\n //Only remove message from the queue if a schema check of the message has passed### Assistant: You can browse the message to see if it is what you need and then do a GET if you determine it is. GET is destructive and removes message from a queue, browse is not destructive but lets you examine contents.openOptions = MQC.MQOO_BROWSE // open queue for browsing\n"} +{"text": "### Human: I have this function where I get a message from the queueint MQGet(MQHOBJ Hobj,char* buffer,int* count, long waitInterval, MQLONG codePage)\n{\n MQLONG msgLen = 0;\n MQLONG msgSize = *count-1;\n MQGMO gmo = {MQGMO_DEFAULT};\n MQMD md = {MQMD_DEFAULT}; /* Message Descriptor */\n\n gmo.Options = MQGMO_WAIT \n | MQGMO_SYNCPOINT\n | MQGMO_ACCEPT_TRUNCATED_MSG\n | MQGMO_FAIL_IF_QUIESCING\n | MQGMO_CONVERT ;\n\n gmo.MatchOptions = MQMO_NONE;\n\n //md.Format = ???\n //md.CodedCharSetId = 850;\n md.Encoding = MQENC_NATIVE;\n if( codePage != 0 )\n md.CodedCharSetId = codePage;\n\n gmo.WaitInterval = waitInterval;\n\n MQGET(Hcon, /* connection handle */\n Hobj, /* object handle */\n &md, /* message descriptor */\n &gmo, /* default options (datagram) */\n msgSize, /* message length */\n buffer, /* message buffer */\n &msgLen, \n &CompCode, /* completion code */\n &Reason); /* reason code */\n\n *count = msgLen;\n /* if (CompCode == MQCC_FAILED) {\n return (int) Reason;\n }*/ \n return (int) Reason;\n}and this on to put the message in the queueint MQPut(char* queueName,char* buffer,int count, bool persist, MQLONG codePage)\n{\n MQOD od = {MQOD_DEFAULT}; \n strncpy(od.ObjectName, queueName, (size_t)MQ_Q_NAME_LENGTH);\n\n memcpy(md.Format,MQFMT_STRING, (size_t)MQ_FORMAT_LENGTH); /* character string format */\n memcpy(md.MsgId, /* reset MsgId to get a new one */\n MQMI_NONE, sizeof(md.MsgId) );\n\n memcpy(md.CorrelId, /* reset CorrelId to get a new one */\n MQCI_NONE, sizeof(md.CorrelId) );\n\n// memcpy(md.Encoding, /* para forzar convert en destino */\n// MQENC_NATIVE, sizeof(md.Encoding) );\n md.Encoding = MQENC_NATIVE;\n\n if( persist )\n md.Persistence = MQPER_PERSISTENT; \n\n\n if( codePage != 0 )\n md.CodedCharSetId = codePage;\n\n// memcpy(md.CodedCharSetId, /* se agrega codificacion de caracteres a los mensajes */\n// codePage, sizeof(md.CodedCharSetId) );\n\n\n\n // MQPUT(Hcon, /* connection handle */\n // Hobj, /* object handle */\n // &md, /* message descriptor */\n // &pmo, /* default options (datagram) */\n // count, /* message length */\n // buffer, /* message buffer */\n // &CompCode, /* completion code */\n // &Reason); /* reason code */\n\n\n MQPUT1(Hcon, /* connection handle */\n &od, \n &md, /* message descriptor */\n &pmo, /* default options (datagram) */\n count, /* message length */\n buffer, /* message buffer */\n &CompCode, /* completion code */\n &Reason); /* reason code */\n\n\n if (CompCode == MQCC_FAILED) {\n return (int) Reason;\n }\n\n return 0;\n}the problem I'm having right now is that I need to know what is the message's lenght exactly,this is the RunGet and RunPut Servicevoid CNTService::RunPut()\n{\n _finddata_t fdata;\n char searchPath[MAX_PATH];\n char fname[MAX_PATH];\n char inputFileName[MAX_PATH];\n char outputFileName[MAX_PATH];\n char* t;\n char* f;\n intptr_t findHandle;\n MQHOBJ Hobj;\n DWORD status;\n// long error;\n\n // Set the service running flag\n\n m_bIsRunning = true;\n\n // Send a debug message that the service has started\n\n DebugMsg(\"Entering CNTService::Run()\");\n\n // Create the search path for the find first routines\n\n strcpy(searchPath,pathIn);\n strcat(searchPath,\"\\\\*.\");\n strcat(searchPath,inSuffix);\n\n // Process the incomming files from the search path\n\n while (m_bIsRunning) {\n try {\n // Connect to MQSeries \n\n Hobj = 0;\n if ((status = Connect(qMgrName,connName,channelName)) != 0) {\n throw CError(MSG_MQSERIES_OPEN,itoa(status,conv1,10));\n }\n\n // Open the queue for writing\n\n/* if ((Hobj = OpenQueue(queueName,error)) == 0) {\n throw CError(MSG_MQSERIES_QUEUE,queueName,itoa(error,conv1,10));\n }\n*/\n do {\n // get a file to process\n\n if ((findHandle = _findfirst(searchPath,&fdata)) != -1) {\n do {\n char* buffer = new char[fdata.size]; // Allocate memory space for the file contents\n HANDLE ifile;\n DWORD bread;\n\n // Read the file to memory\n sprintf(fname,\"%s\\\\%s\",pathIn,fdata.name);\n\n // Open the file\n\n //ifile = open(fname,O_RDONLY|O_BINARY);\n\n ifile = CreateFile(fname,\n FILE_READ_DATA,\n 0,\n NULL,\n OPEN_EXISTING,\n 0,\n 0);\n\n if (ifile != INVALID_HANDLE_VALUE) {\n // Read in it's contents to the memory buffered\n if (ReadFile(ifile,buffer,fdata.size,&bread,0) == 0) {\n DWORD err = GetLastError();\n //l(ifile);\n throw CError(MSG_OPEN_ERROR,fname,itoa(err,conv1,10));\n }\n\n // Close the file handle\n\n CloseHandle(ifile);\n\n // Check that the read byte coun is equal to the file size\n\n if (bread != fdata.size) {\n CloseHandle(ifile);\n LogWarning(CError(MSG_FILE_SIZE,itoa(bread,conv1,10),itoa(fdata.size,conv2,10)));\n continue;\n }\n }\n else {\n LogWarning(CError(MSG_OPEN_ERROR,fname,itoa(GetLastError(),conv1,10)));\n continue;\n }\n\n\n // Put the message into the MQSeries queue\n //TODO: Recalcular tama\u00f1o del buffer\n if ((status = MQPut(queueName,buffer,bread, persist, codePage)) != 0) {\n throw CError(MSG_MQSERIES_PUT,itoa(status,conv1,10));\n }\n\n // Create the output file name\n\n f = fdata.name;\n t = inputFileName;\n while (*f && *f != '.')\n *t++ = *f++;\n *t++ = 0;\n\n sprintf(outputFileName,\"%s\\\\%s%08d.%s\",pathOut,inputFileName,GetTickCount(),inSuffix);;\n\n // Rename the file to the queue directory\n\n if (rename(fname,outputFileName) == -1)\n throw CError(MSG_RENAME,fname,outputFileName);\n\n // Free used heap \n\n delete[] buffer;\n\n } while (_findnext(findHandle,&fdata) == 0);\n\n\n // close the findfirst handle\n\n _findclose(findHandle);\n }\n\n // Delay n milliseconds before processing the next request\n\n Sleep(delay);\n } while (m_bIsRunning);\n }\n\n // Trap thrown errors\n\n catch (CError err) {\n LogError(err);\n }\n\n // Trap unexpected errors\n\n catch (...) {\n LogError(CError(MSG_SERVICE,\"Error no esperado.\",itoa(GetLastError(),conv1,10)));\n }\n\n // Close the queue handle\n\n// if (Hobj != 0) \n// CloseQueue(Hobj); \n\n // Disconnect from MQSeries\n\n Disconnect();\n\n // Delay for 5 seconds before reattempting to open MQSeries\n\n Sleep(5000);\n\n }\n\n\n // Debug message \n DebugMsg(\"Leaving CNTService::Run()\");\n}\n\n// Get messages from MqSeries queue and store them in the output directory\n\nvoid CNTService::RunGet()\n{\n char outputFileName[MAX_PATH];\n MQHOBJ Hobj;\n char tmpStr[512]; \n int count;\n long error;\n DWORD status;\n static int sequence = 0;\n\n // Initialize variables\n m_bIsRunning = true;\n // send a debug message theat the service is starting\n DebugMsg(\"Entering CNTService::Run()\");\n\n // Set the localte to ascii\n setlocale(LC_ALL,\"C\"); /* for C with ancii 1 byte characters */\n\n // Process messages from the input queue\n while (m_bIsRunning) {\n try {\n // Connect to MQSeries\n Hobj = 0;\n if ((status = Connect(qMgrName, connName, channelName)) != 0) {\n throw CError(MSG_MQSERIES_OPEN,itoa(status,conv1,10));\n }\n // Open the input queue\n if ((Hobj = OpenGetQueue(queueName, error)) == -1) {\n throw CError(MSG_MQSERIES_QUEUE,queueName,itoa(error,conv1,10));\n }\n while (m_bIsRunning) {\n // Get the message from the input queue\n count = sizeof(buffer);\n\n error = MQGet(Hobj, buffer, &count, waitInterval, codePage);\n if (error == 0 || error == MQRC_TRUNCATED) {\n int n;\n int ofile;\n\n // Log the file content to the system log \n sprintf(tmpStr,\"count=%d,reason=%d\",count,error);\n\n if (logAll)\n LogInfo(CError(MSG_SERVICE,outputFileName,tmpStr,\"\"));\n\n // Write the message contents to a file\n\n sprintf(outputFileName,\"%s\\\\MSG%08d%03d.%s\", pathQueue, GetTickCount(), sequence, outSuffix);\n sequence = ++sequence % 1000;\n\n ofile = open(outputFileName, O_WRONLY|O_BINARY|O_TRUNC|O_CREAT,S_IREAD|S_IWRITE);\n if (ofile == -1) {\n throw CError(MSG_OPEN_ERROR,outputFileName,itoa(GetLastError(),conv1,10));\n }\n\n n = write(ofile, buffer, count);\n // Close the file\n close(ofile);\n\n // Check if the read in bytes differ\n if (n != count){ \n throw CError(MSG_FILE_WRITE,itoa(n,conv1,10),itoa(count,conv2,10));\n }else\n MQCMIT();\n }else {\n if (m_bIsRunning) {\n if (error != MQRC_NO_MSG_AVAILABLE) {\n sprintf(tmpStr,\"Error MQSeries reason=%d, error=\",count,error);\n throw CError(MSG_SERVICE,tmpStr,itoa(error,conv2,10));\n }\n Sleep(delay);\n }\n }\n } \n }\n // Catch thrown errors\n catch (CError err) {\n LogError(err);\n //revertimos mensaje a la cola\n MQBACK();\n }\n // Catch unexpected errors\n catch (...) {\n LogError(CError(MSG_SERVICE,\"Error no esperado.\"));\n MQBACK();\n }\n // Close the queue handle\n if (Hobj != 0) \n CloseQueue(Hobj); \n\n // Disconnect from mqseries\n Disconnect();\n\n // Delay until the next attemp\n Sleep(delay);\n }\n // nothing more to do\n DebugMsg(\"Leaving CNTService::Run()\");\n}If there is any body that could help out, I'll appreciate it.\nBest regards### Assistant: The output parameter on yourMQGETcall that you have namedmsgLenwill tell you the actual length of the message. This is true even if the message was truncated on the get because the buffer you provided wasn't big enough. Thus allowing you to retry theMQGETwith a bigger buffer.\n"} +{"text": "### Human: (NOTE: Here is a link with the attachments)I am having an issue where a Camel Flow runs correctly in the Jboss Developer Studio but will not correctly deploy to a standalone instance of Fuse. I have attached the application below.I have added the dependencies: com.ibm.mq.allclient, providerutil, fscontext, and jms to my local mvn repository.\nThe version of Websphere MQ is 8.0.0.2 and the version of Fuse is 6.2This as it is (once the dependencies are added to the local mvn repo) works correctly inside of JBoss Developer Studio.When I try to deploy the file onto my standalone Fuse instance it no longer successfully launches.\nThis is after deploying the OSGI jars included with Websphere. (before they are deployed the error is the same except com.ibm.mq.???? replaces javax.jms.JMSExceptionI get the following exception in the Fuse log:`JBossFuse:karaf@root> osgi:install -s` File:C:/Users/Administrator/workspace/WebsphereThroughput/target/WebsphereThroughput-1.0.0.jar\n Bundle ID: 330\n JBossFuse:karaf@root> log:display\n 2015-09-18 09:24:47,088 | INFO | l Console Thread | BlueprintExtender\n | ? ? | 21 - org.apache.aries.blueprint.core - 1.4.2 | Destroying BlueprintContainer for bundle org.Fuse.Testing.WebsphereThroughput\n 2015-09-18 09:24:50,851 | WARN | rint Extender: 3 | BeanRecipe\n | ? ? | 21 - org.apache.aries.blueprint.core - 1.4.2 | Object to be destroyed is not an instance of UnwrapperedBeanHolder, type: null\n 2015-09-18 09:24:50,851 | INFO | rint Extender: 3 | BlueprintCamelContext\n | ? ? | 198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Apache Camel 2.15.1.redhat-620133 (CamelContext: camel-4) is shutting down\n 2015-09-18 09:24:50,851 | INFO | rint Extender: 3 | BlueprintCamelContext\n | ? ? | 198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Apache Camel 2.15.1.redhat-620133 (CamelContext: camel-4) uptime not started\n 2015-09-18 09:24:50,851 | INFO | rint Extender: 3 | BlueprintCamelContext\n | ? ? | 198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Apache Camel 2.15.1.redhat-620133 (CamelContext: camel-4) is shutdown in 0.000 seconds\n 2015-09-18 09:24:50,851 | ERROR | rint Extender: 3 | BlueprintContainerImpl\n | ? ? | 21 - org.apache.aries.blueprint.core - 1.4.2 | Unable to start blueprint container for bundle org.Fuse.Testing.WebsphereThroughput\n org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to instantiate components\n at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:686)[21:org.apache.aries.blueprint\n .core:1.4.2]\n at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:377)[21:org.apache.aries.blueprint.core:1.4.2]\n at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:269)[21:org.apache.aries.blueprint.core:1.4.2]\n at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)[:1.8.0_60]\n at java.util.concurrent.FutureTask.run(Unknown Source)[:1.8.0_60]\n at org.apache.aries.blueprint.container.ExecutorServiceWrapper.run(ExecutorServiceWrapper.java:106)[21:org.apache.aries.blueprint.core:1.4.2]\n at org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48)[21:org.apache.aries.blueprint.core:1.4.2]\n at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)[:1.8.0_60]\n at java.util.concurrent.FutureTask.run(Unknown Source)[:1.8.0_60]\n at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)[:1.8.0_60]\n at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.JBossFuse:karaf@root> log:display\n 2015-09-18 09:24:47,088 | INFO | l Console Thread | BlueprintExtender\n | ? ? | 21 - org.apache.aries.blueprint.core - 1.4.2 | Destroying BlueprintContainer for bundle org.Fuse.Testing.WebsphereThroughput\n 2015-09-18 09:24:50,851 | WARN | rint Extender: 3 | BeanRecipe\n | ? ? | 21 - org.apache.aries.blueprint.core - 1.4.2 | Object to be destroyed is not an instance of UnwrapperedBeanHolder, type: null\n 2015-09-18 09:24:50,851 | INFO | rint Extender: 3 | BlueprintCamelContext\n | ? ? | 198 - org.apache.camel.camel-cor\n e - 2.15.1.redhat-620133 | Apache Camel 2.15.1.redhat-620133 (CamelContext: came\n l-4) is shutting down\n 2015-09-18 09:24:50,851 | INFO | rint Extender: 3 | BlueprintCamelContext\n | ? ? | 198 - org.apache.camel.camel-cor\n e - 2.15.1.redhat-620133 | Apache Camel 2.15.1.redhat-620133 (CamelContext: camel-4) uptime not started\n 2015-09-18 09:24:50,851 | INFO | rint Extender: 3 | BlueprintCamelContext\n | ? ? | 198 - org.apache.camel.camel-cor\n e - 2.15.1.redhat-620133 | Apache Camel 2.15.1.redhat-620133 (CamelContext: camel-4) is shutdown in 0.000 seconds\n 2015-09-18 09:24:50,851 | ERROR | rint Extender: 3 | BlueprintContainerImpl\n | ? ? | 21 - org.apache.aries.blueprint.\n core - 1.4.2 | Unable to start blueprint container for bundle org.Fuse.Testing.WebsphereThroughput\n org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to instantiate components\n at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:686)[21:org.apache.aries.blueprint.core:1.4.2]\n at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:377)[21:org.apache.aries.blueprint.core:1.4.2]\n at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:269)[21:org.apache.aries.blueprint.core:1.4.2]\n at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)[:1.8.0_60]\n at java.util.concurrent.FutureTask.run(Unknown Source)[:1.8.0_60]\n at org.apache.aries.blueprint.container.ExecutorServiceWrapper.run(ExecutorServiceWrapper.java:106)[21:org.apache.aries.blueprint.core:1.4.2]\n at org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48)[21:org.apache.aries.blueprint.core:1.4.2]\n at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)[:1.8.0_60]\n at java.util.concurrent.FutureTask.run(Unknown Source)[:1.8.0_60]\n at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)[:1.8.0_60]\n at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)[:1.8.0_60]\n at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)[:1.8.0_60]\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)[:1.8.0_60]\n at java.lang.Thread.run(Unknown Source)[:1.8.0_60]\n Caused by: java.lang.NoClassDefFoundError: javax/jms/JMSRuntimeException\n at java.lang.Class.getDeclaredConstructors0(Native Method)[:1.8.0_60]\n at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)[:1.8.0_60]\n at java.lang.Class.getConstructors(Unknown Source)[:1.8.0_60]\n at org.apache.aries.blueprint.container.BeanRecipe.findMatchingConstructors(BeanRecipe.java:509)\n at org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:327)\n at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:806)\n at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)\n at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:106)[21:org.apache.aries.blueprint.core:1.4.2]\n at org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:933)\n at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:907)\n at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:888)\n at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:820)\n at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)\n at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)\n at java.util.concurrent.FutureTask.run(Unknown Source)[:1.8.0_60]\n at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[21:org.apache.aries.blueprint.core:1.4.2]\n at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:245)[21:org.apache.aries.blueprint.core:1.4.2]\n at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:183)[21:org.apache.aries.blueprint.core:1.4.2]\n at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:682)[21:org.apache.aries.blueprint.core:1.4.2]\n ... 13 more\n Caused by: java.lang.ClassNotFoundException: javax.jms.JMSRuntimeException not found by org.apache.geronimo.specs.geronimo-jms_1.1_spec [177]\n at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1556)[org.apache.felix.framework-4.4.1.jar:]\n at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:77)[org.apache.felix.framework-4.4.1.jar:]\n at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1993)\n at java.lang.ClassLoader.loadClass(Unknown Source)[:1.8.0_60]\n at org.apache.felix.framework.BundleWiringImpl.getClassByDelegation(BundleWiringImpl.java:1397)[org.apache.felix.framework-4.4.1.jar:]\n at org.apache.felix.framework.BundleWiringImpl.searchImports(BundleWiringImpl.java:1577)[org.apache.felix.framework-4.4.1.jar:]\n at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1507)[org.apache.felix.framework-4.4.1.jar:]\n at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:77)[org.apache.felix.framework-4.4.1.jar:]\n at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1993)\n at java.lang.ClassLoader.loadClass(Unknown Source)[:1.8.0_60]\n ... 32 more\n\n\n JBossFuse:karaf@root>### Assistant: I found the solution at the following link:hereApparently a feature called Geronimo exports javax.jms and the older version does not have the Exception that is missing. You can refresh the Geronimo feature and this issue goes away.\n"} +{"text": "### Human: We have an interesting issue that came up.We have an integration between AS400 system that sends MQ messages in EBCDIC format, picked up by TIBCO BW MQ plugin and processed. These are financial transactions.The issue we have is that when the data element (packed decimal) contains odd digits like251-259or25001-25999etc. the data element is being interpreted by TIBCO BW MQ plugin as151-159etc.So we had an amount of25125interpreted as15125causing a transaction tally missing of $100 (amounts in cents). TIBCO BW MQ plugin uses Java underneath, so this is probably a Java issue. AS400 is able to send and receive as25125. But when we browse the message from MQ explorer, we see the data element value rendered as15125too.AS400 team specifies that since they are able to send and receive as25125the issue is not on their side. Did anyone encounter a similar issue before? If so, how did you solve it? Is this an issue with MQ client or an issue with AS400 MQ delivering the message?### Assistant: I'm not familiar with TIBCO...But generally speaking, passing packed data through MQ is a bad idea.MQ being multi-platform has only two ways to send a message. As a string and as raw bytes. When you send it as a string, it will handle converting from one encoding to another as dependent on the platforms involved.As you can see, treating packed decimal as a string doesn't work.TIBCO might have the functionality to process the raw message, somewhere in TIBCO (or your Java app?) you have to configure the EBCDIC to ASCII (Unicode) conversion along with unpacking the packed decimal field. You'd also have to set MQ to send that message raw.Otherwise, you'll need the IBM i side to unpack the data before sending it as an MQ string message.\n"} +{"text": "### Human: We have defined a WebSphere MQ cluster in our Production infrastructure with all the file systems using shared Network storage (NFS3). Recently we had to make one of the cluster queue managers in the MQ cluster highly available. So we migrated two of the servers in the MQ cluster to NFS4 and redefined the queue manager in multi-instance mode with active instance of QM in one server and the stand-by QM in the other server(both servers has NFS4 as file system). Now the question we have is since MQ cluster has lot of inter cluster communication happening between queue managers all time is it a best practice to keep MI queue managers in a cluster which has hybrid file systems including NFS4 & NFS3? Does the hybrid file system cause any known issues on our MI queue managers when we try to switch them?### Assistant: Please seeRequirements for shared file systemsin the IBM Knowledge Center for full details. Short answer: MQ mayrunon NFS3 but the functionality and reliability you probably expect from it isn't there.If a queue manager fails, or if there is a communication failure with\n the file system, files locked by the queue manager need to be unlocked\n and made available to other processes without waiting for the queue\n manager to be reconnected to the file system.For multi-instance queue managers on Microsoft Windows, the networked\n storage must be accessed by the Common Internet File System (CIFS)\n protocol used by Microsoft Windows networks.For multi-instance queue managers on other supported platforms, the\n storage must be accessed by a network file system protocol which is\n Posix-compliant and supports lease-based locking. Network File System\n Version 4 satisfies this requirement. Older file systems, such as\n Network File System Version 3, which do not have a reliable mechanism\n to release locks after a failure, must not be used with multi-instance\n queue managers.The file system supporting Multi-Instance QMgrsmustbe NFS4 or better. The possible instability issue isn't from running a hybrid mixed NFS3/4 setup, but rather from any use of NFS3at allwith MIQM.\n"} +{"text": "### Human: This might be a question that may not be answered due to the nature of the external tool I am using (lack of documentation).Basically, I am using a tool that pushes and pulls messages from the queue, more precisely - it pushes and pulls files. It worked perfectly for text files but when I tried pushing and then pulling a binary file - the pulled one was corrupted, it's size increased in comparsion with the original file (1.33 ratio).For example moving a zip file wouldn't work...I suppose it has something to do with the tools configuration, the only settings that can be changed regarding the problem are CCSID and encoding (UTF-8, Base16, etc.), I tried playing with both, unfortunately without success.Tried using the following CCSIDs: 65535, 1208, 819\nand encodings : UTF-8, Base16, Base64In every case the binary file was corrupted after pulling it from the queue, I'm not entirely sure how the tool acomplishes that, it's written in Java, also I'm new to MQ so I tried searching for the correct options in IBM's docs but I haven't found anything that makes more sense than 65535 and Base16, yet it still doesn't work, could anyone with more experience with MQ tell if playing with these options makes sense at all in this case and if so - suggest what CCSID and encoding can I try to accomplish what Ive described above?### Assistant: More information is really needed, but my suspicion is you are putting the message on the queue as a text message and playing around with encodings and ccsid's to try to get it right. You really need to know how the 'Java' app achieves this - is it using JMS (eg JMSBytesMessage) or base Java (something like setMessageData).At a high level, there is a header on a message (The MD) which 'describes' the data - the MD format field. If you say the data is a string then MQ can convert between codepages should the getter request it etc. Put a tiny binary file into a message onto a queue, and browse the queue with amqsbcg or the GUI - what are the MD fields for format? What headers are on the payload - anything like RFH2's?Put the same code in to give us a clue, or at least the amqsbcg output\n"} +{"text": "### Human: There is a system (IBM MDM) channel:SC.MDM.QMOn this channel you have access to the managers of the bus.\nFor example:M99.ESB.MDM2which contains queu for messages:ESB.IBSO.TB49.MDM.ORG.INThis is how we can put message to queu (using RFHUtilutility):Queue Manager Name(to connect to)SC.MDM.QM/TCP/megri-t5.cgs.sbrf.ru(1414)Queue NameESB.IBSO.TB49.MDM.ORG.INRemote Queue Manager Name (remote queues only)M99.ESB.MDM2But when i try to set same settings through java class:public class SetWebsphere extends ConnectSettings {\n\n public static String queueName = \"ESB.IBSO.TB49.MDM.ORG.IN\";\n\n MQQueue defaultLocalQueue;\n MQQueueManager qManager;\n\n @SuppressWarnings({ \"unchecked\", \"deprecation\" })\n public void init(){\n //Set MQ connection credentials to MQ Envorinment.\n MQEnvironment.hostname = hostName;\n MQEnvironment.channel = channel;\n MQEnvironment.port = port;\n MQEnvironment.userID = user;\n\n MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);\n\n try {\n //initialize MQ manager.\n qManager = new MQQueueManager(qMngrStr);\n } catch (MQException e) {\n e.printStackTrace();\n }\n }\n\n @SuppressWarnings(\"deprecation\")\n public void putAndGetMessage(String msg){\n int openOptions = MQC.MQOO_OUTPUT | MQC.MQOO_INQUIRE;\n try {\n defaultLocalQueue = qManager.accessQueue(queueName, openOptions);\n System.out.println(queueName); \n\n MQMessage putMessage = new MQMessage();\n\n byte[] xk = msg.getBytes(\"UTF-8\");\n putMessage.write(xk);\n putMessage.characterSet = 1208;\n //specify the message options...\n MQPutMessageOptions pmo = new MQPutMessageOptions(); \n // accept \n // put the message on the queue\n defaultLocalQueue.put(putMessage, pmo);\n\n System.out.println(\"Message is put on MQ.\");\n\n defaultLocalQueue.close();\n qManager.disconnect();\n } catch (MQException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\npublic class ConnectSettings {\n\n static String qMngrStr;\n static String hostName;\n static String channel;\n static int port;\n\n public static void ConnectIFT() { \n\n qMngrStr = \"M99.ESB.MDM2\";\n hostName = \"megri-t5.cgs.sbrf.ru\";\n port = 1414;\n channel = \"SC.MDM.QM\";\n }\n}The result is:com.ibm.mq.MQException: MQJE001: Completion code '2', Reason'2058'.\n at com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:238)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnection(MQClientManagedConnectionFactoryJ11.java:505)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnection(MQClientManagedConnectionFactoryJ11.java:547)\n at com.ibm.mq.StoredManagedConnection.(StoredManagedConnection.java:95)\n at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:182)\n at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:869)\n at com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:761)\n at com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:712)\n at com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:171)\n at com.ibm.mq.MQQueueManager.(MQQueueManager.java:603)\n at ibmWebsphereMQ.SetWebsphere.init(SetWebsphere.java:67)\n at ibsoTestWebsphereMQ.IBSOTest.IBSOCreateCLient(IBSOTest.java:44)\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\n at java.lang.reflect.Method.invoke(Unknown Source)\n at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)\n at org.testng.internal.Invoker.invokeMethod(Invoker.java:702)\n at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:894)\n at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1219)\n at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)\n at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)\n at org.testng.TestRunner.privateRun(TestRunner.java:768)\n at org.testng.TestRunner.run(TestRunner.java:617)\n at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)\n at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)\n at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)\n at org.testng.SuiteRunner.run(SuiteRunner.java:240)\n at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)\n at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:87)\n at org.testng.TestNG.runSuitesSequentially(TestNG.java:1188)\n at org.testng.TestNG.runSuitesLocally(TestNG.java:1113)\n at org.testng.TestNG.run(TestNG.java:1025)\n at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:109)\n at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:202)\n at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:173)This code works fine if i'm trying to connect through Bus channel, for example\n(another server):qMngrStr = \"M99.ESB.MDM2\";\nhostName = \"iskona-t2.cgs.sbrf.ru\";\nport = 1422;\nchannel = \"SC.M99.ESB.MDM2\";The main question:How to put message to queue through system channel (SC.MDM.QM), using java code ?Thanks In Advance!### Assistant: Reason code2058points to queue manager name error. Are you sure you have provided the correct queue manager name in your code? You may be providing correct channel, host, port and transport type but the queue manager name is incorrect. So check if queue manager is correct.\n"} +{"text": "### Human: I am trying to create simple Webapp to demonstrate the using WMQ 7.5 in Servlet Container (tomcat). My webbap is based on standalone WMQ sample app.\nMy standalone app works good.The testcase is also good.@RunWith(SpringJUnit4ClassRunner.class)\n@ContextConfiguration(classes = AppConfig.class)\npublic class MQMessageTest {\n\n /**\n * Message count fot test\n */\n private static final int MESSAGE_COUNT = 25;\n\n /**\n * Setting Environment for getting properties\n */\n @Autowired\n private Environment environment;\n\n /**\n * MQMessageSender for sending messages\n */\n @Autowired\n private MQMessageSender mqMessageSender;\n\n /**\n * JmsTemplate of Spring JMS\n */\n @Autowired\n private JmsTemplate jmsTemplate;\n\n @Test\n public void testEqualsOfSentAndReceivedMessages() {\n\n /*Sending messages to Queue*/\n for (int i = 0; i < MESSAGE_COUNT; i++) {\n mqMessageSender.send(\"Message with\" + System.nanoTime());\n }\n\n /*Container for received messages*/\n Set messages = new HashSet();\n\n /*Receiving messages from report Queue*/\n for (int i = 0; i < MESSAGE_COUNT; i++) {\n TextMessage message = (TextMessage) jmsTemplate.receive(environment.getRequiredProperty(\"wmq.queue.test.input.2\"));\n messages.add(message);\n }\n\n assertEquals(messages.size(), MESSAGE_COUNT);\n }\n}But when I am starting tomcat I have the following issue:org.springframework.web.context.support.AnnotationConfigWebApplicationContext loadBeanDefinitions\nINFO: Registering annotated classes: [class by.iba.config.AppConfig]\n\u0438\u044e\u043d 08, 2015 9:29:11 AM org.apache.catalina.core.ApplicationContext log\nSEVERE: StandardWrapper.Throwable\n**java.lang.NoClassDefFoundError: com/ibm/mq/jms/MQConnectionFactory**\n at java.lang.Class.getDeclaredMethods0(Native Method)\n at java.lang.Class.privateGetDeclaredMethods(Class.java:2615)\n at java.lang.Class.getDeclaredMethods(Class.java:1860)\n at org.springframework.core.type.StandardAnnotationMetadata.getAnnotatedMethods(StandardAnnotationMetadata.java:140)\n\n... 30 more\n\n\u0438\u044e\u043d 08, 2015 9:29:11 AM org.apache.catalina.core.StandardContext loadOnStartup\n**SEVERE: Servlet /mqservice-webapp threw load() exception\njava.lang.ClassNotFoundException: com.ibm.mq.jms.MQConnectionFactory**\n at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702)\n\n......Please tell me what's the problem. How can I resolve it? Whe it need to be fixed: in tomcat or websphere MQ or spring jms? I was trying to work with jetty but it was fail.My POM\n 4.0.0\n by.iba\n mqservice-webapp\n war\n 1.0-SNAPSHOT\n Web MQ Module\n http://maven.apache.org\n\n \n UTF-8\n 7.5.0.2\n ${basedir}/lib\n 4.0.6.RELEASE\n \n\n \n\n \n\n \n com.ibm\n com.ibm.mqjms\n ${websphereMq.version}\n system\n ${wmq.jars}/com.ibm.mqjms.jar\n \n\n \n com.ibm\n com.ibm.mq.headers\n ${websphereMq.version}\n system\n ${wmq.jars}/com.ibm.mq.headers.jar\n \n\n \n com.ibm\n com.ibm.mq.jmqi\n ${websphereMq.version}\n system\n ${wmq.jars}/com.ibm.mq.jmqi.jar\n \n\n \n com.ibm\n com.ibm.dhbcore\n ${websphereMq.version}\n system\n ${wmq.jars}/dhbcore.jar\n \n\n \n\n \n org.springframework\n spring-jms\n ${spring.version}\n \n\n \n org.springframework\n spring-test\n ${spring.version}\n \n\n \n org.apache.geronimo.specs\n geronimo-jms_1.1_spec\n 1.1.1\n \n\n \n org.springframework\n spring-webmvc\n ${spring.version}\n \n\n \n\n \n javax.servlet\n javax.servlet-api\n 3.1.0\n provided\n \n\n \n\n \n junit\n junit\n 4.6\n test\n \n\n \n\n \n \n\n \n\n \n \n \n \n \n\n \n\n \n org.apache.maven.plugins\n maven-compiler-plugin\n 3.3\n \n 1.7\n 1.7\n ${project.build.sourceEncoding}\n \n \n\n \n\n \n org.apache.tomcat.maven\n tomcat7-maven-plugin\n 2.2\n \n local_tomcat\n \n \n\n \n org.apache.maven.plugins\n maven-war-plugin\n 2.4\n \n mqservice-webapp\n false\n \n \n \n \n\nWebConfig@Configuration\n@ComponentScan({\"...\"})\n@PropertySource(value = {\"classpath:by.iba/wmq.properties\"})\npublic class AppConfig {\n\n /**\n * Logger is using for tracing status of the application configuration\n */\n public static final Logger LOGGER = Logger.getLogger(AppConfig.class.getName());\n\n /**\n * Environment Bean for working with properties\n */\n @Autowired\n private Environment environment;\n\n /**\n * Method provides setting up the MQConnectionFactory Bean in Binding mode\n *\n * @return MQConnectionFactory is set up in binding mode\n * @throws JMSException if setting up MQConnectionFactory failed\n */\n @Bean\n public MQConnectionFactory mqBindingConnectionFactory() {\n MQConnectionFactory connectionFactory = new MQConnectionFactory();\n try {\n connectionFactory.setHostName(environment.getRequiredProperty(\"wmq.qmgr.host\"));\n connectionFactory.setPort(environment.getProperty(\"wmq.qmgr.port\", Integer.class));\n connectionFactory.setQueueManager(environment.getRequiredProperty(\"wmq.qmgr.name\"));\n connectionFactory.setTransportType(environment.getProperty(\"wmq.qmgr.transport.type.binding\", Integer.class));\n connectionFactory.setCCSID(environment.getProperty(\"wmq.qmgr.ccsid\", Integer.class));\n } catch (JMSException e) {\n LOGGER.severe(\"Cannot set up binding connection factory\" + e.getMessage());\n }\n return connectionFactory;\n }\n\n /**\n * Method provides setting up the MQConnectionFactory Bean in Client mode\n *\n * @return MQConnectionFactory is set up in client mode\n * @throws JMSException if setting up MQConnectionFactory failed\n */\n @Bean\n public MQConnectionFactory mqClientConnectionFactory() {\n MQConnectionFactory connectionFactory = new MQConnectionFactory();\n try {\n connectionFactory.setHostName(environment.getRequiredProperty(\"wmq.qmgr.host\"));\n connectionFactory.setPort(environment.getProperty(\"wmq.qmgr.port\", Integer.class));\n connectionFactory.setQueueManager(environment.getRequiredProperty(\"wmq.qmgr.name\"));\n connectionFactory.setTransportType(environment.getProperty(\"wmq.qmgr.transport.type.client\", Integer.class));\n connectionFactory.setCCSID(environment.getProperty(\"wmq.qmgr.ccsid\", Integer.class));\n connectionFactory.setChannel(environment.getRequiredProperty(\"wmq.qmgr.channel\"));\n } catch (JMSException je) {\n LOGGER.severe(\"Cannot set up client connection factory\" + je.getMessage());\n }\n return connectionFactory;\n }\n\n /**\n * Method provides setting up Single Connection Factory Bean for using in Binding mode\n *\n * @return SingleConnectionFactory\n */\n @Bean\n public SingleConnectionFactory jmsQueueConnectionFactory() {\n SingleConnectionFactory singleConnectionFactory = new SingleConnectionFactory();\n singleConnectionFactory.setTargetConnectionFactory(mqBindingConnectionFactory());\n singleConnectionFactory.setReconnectOnException(true);\n return singleConnectionFactory;\n }\n\n /**\n * Method provides setting up UserCredentialsConnectionFactoryAdapter Bean for using in Client mode\n *\n * @return UserCredentialsConnectionFactoryAdapter\n */\n @Bean\n public UserCredentialsConnectionFactoryAdapter jmsQueueConnectionFactorySecured() {\n UserCredentialsConnectionFactoryAdapter connectionFactoryAdapter = new UserCredentialsConnectionFactoryAdapter();\n connectionFactoryAdapter.setTargetConnectionFactory(mqClientConnectionFactory());\n connectionFactoryAdapter.setUsername(environment.getRequiredProperty(\"wmq.qmgr.username\"));\n connectionFactoryAdapter.setPassword(environment.getRequiredProperty(\"wmq.qmgr.password\"));\n return connectionFactoryAdapter;\n }\n\n /**\n * Method provides setting up CachingConnectionFactory Bean to organize connection pool\n *\n * @return CachingConnectionFactory\n */\n @Bean\n public CachingConnectionFactory cachingConnectionFactory() {\n CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory();\n cachingConnectionFactory.setTargetConnectionFactory(jmsQueueConnectionFactorySecured());\n cachingConnectionFactory.setCacheConsumers(true);\n cachingConnectionFactory.setCacheProducers(true);\n cachingConnectionFactory.setSessionCacheSize(5);\n return cachingConnectionFactory;\n }\n\n /**\n * Method provides setting up DynamicDestinationResolver Bean\n *\n * @return DynamicDestinationResolver\n */\n @Bean\n public DynamicDestinationResolver destinationResolver() {\n return new DynamicDestinationResolver();\n }\n\n /**\n * Method provides setting up JmsTemplate Bean\n *\n * @return DynamicDestinationResolver\n */\n @Bean\n public JmsTemplate jmsQueueTemplate() {\n JmsTemplate jmsTemplate = new JmsTemplate();\n jmsTemplate.setConnectionFactory(jmsQueueConnectionFactorySecured()); // optionally switching client mode\n// jmsTemplate.setConnectionFactory(jmsQueueConnectionFactory()); // optionally switching binding mode\n jmsTemplate.setDestinationResolver(destinationResolver());\n jmsTemplate.setReceiveTimeout(10000);\n return jmsTemplate;\n }\n\n /**\n * Method provides setting up MQMessageListener Bean for getting messages\n * from Websphere MQ and his personal settings\n *\n * @return MQMessageListener\n */\n @Bean\n public MQMessageListener mqMessageListener() {\n return new MQMessageListener();\n }\n\n /**\n * Method provides MQMessageSender Bean for sending messages\n * to Websphere MQ and his personal settings\n *\n * @return @MQMessageSender\n */\n @Bean\n public MQMessageSender mqMessageSender() {\n MQMessageSender mqMessageSender = new MQMessageSender();\n mqMessageSender.setDestinationQueue(environment.getRequiredProperty(\"wmq.queue.test.input.1\"));\n mqMessageSender.setForwardQueue(environment.getRequiredProperty(\"wmq.queue.test.input.2\"));\n return mqMessageSender;\n }\n\n /**\n * Method provides DefaultMessageListenerContainer Bean for sending messages\n *\n * @return DefaultMessageListenerContainer\n */\n @Bean\n public DefaultMessageListenerContainer jmsListenerContainer() {\n DefaultMessageListenerContainer dmlc = new DefaultMessageListenerContainer();\n try {\n dmlc.setConnectionFactory(mqClientConnectionFactory()); // optionally switching client mode\n// dmlc.setConnectionFactory(mqBindingConnectionFactory()); // optionally switching binding mode\n dmlc.setConcurrentConsumers(environment.getProperty(\"wmq.listener.concurrent.consumers\", Integer.class));\n dmlc.setMessageListener(mqMessageListener());\n dmlc.setDestination(new MQDestination(environment.getRequiredProperty(\"wmq.queue.test.input.1\")));\n } catch (JMSException je) {\n LOGGER.severe(je.getMessage());\n }\n return dmlc;\n }\n\n}WEB Initializerpublic class WebInitializer implements WebApplicationInitializer {\n\n @Override\n public void onStartup(ServletContext servletContext) throws ServletException {\n AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext();\n ctx.register(AppConfig.class);\n ctx.setServletContext(servletContext);\n\n ServletRegistration.Dynamic servlet = servletContext.addServlet(\"dispatcher\", new DispatcherServlet(ctx));\n servlet.setLoadOnStartup(1);\n servlet.addMapping(\"/\");\n }\n}Thanks a lot. Sorry for my English### Assistant: Does the final war include the MQ jar files? I think its a problem with the build where the IBM MQ jar files are missing and hence ClassNotFoundException.I suggest, go with a filesystem repository for maven instead of directly linking to the source with systempath. ReferMaven: add a dependency to a jar by relative path. Add MQ Jars to this repository and add these as dependencies in your POM.Another option is to use the shared classloader in catalina.properties. Here you can load the MQ jars directly from /opt/mqm/java/lib.\n"} +{"text": "### Human: Closed. This question needs to be morefocused. It is not currently accepting answers.Want to improve this question?Update the question so it focuses on one problem only byediting this post.Closed8 years ago.Improve this questionMQ6 Giving Error message as \"Application Error\" while initializing MQQueueManager. In Error Details i have found Compcode =2 CompletionCode=2 ReasonCode=2012 (MQRC_ENVIRONMENT_ERROR). How can i resolve this error.mqQueueManager = new MQQueueManager(mqManager, channel, ipAddress);### Assistant: The description of the error code you have encountered,MQRC_ENVIRONMENT_ERROR (2012)contains a number of possible reasons for this error being returned in the fully managed .NET environment (which I am assuming is your environment from the tags on your question). I repeat the list here:-Unmanaged channel exitsSecure Sockets Layer (SSL)XA TransactionsCommunications other than TCP/IPChannel compressionIf you are using any of these features when you attempt to connect to the queue manager then you will receive this return code.\n"} +{"text": "### Human: I have created a windows service using MQI is there a way to add asynchronous fetch to MQGet i have tried it using Message Listener.But what to do it using MQConn without threading Please find the below codewhile (queueGetMessageOptions.GroupStatus != QC.MQGS_LAST_MSG_IN_GROUP)\n {\n try\n { \n inboundmsg = new MQMessage(); \n queuerecieve.Get(inboundmsg, queueGetMessageOptions);\n }\n }Is the above code correct. Do i need to set the Group Status? Because the service should be running and listening to the queue continously### Assistant: Your question and code don't match. Is the sender putting messages messages in groups? Because your code is looking for exactly 1 group of messages then it exits the loop.If you want to read all messages (no group) in a loop then you should do something like:MQMessage mqMsg;\nMQGetMessageOptions gmo = new MQGetMessageOptions();\ngmo.WaitInterval = 15000; // wait for up to 15 seconds\ngmo.Options |= MQC.MQGMO_WAIT;\n\nbool isContinue = true;\nwhile (isContinue)\n{\n mqMsg = new MQMessage();\n try\n {\n mqQueue.Get( mqMsg, gmo );\n if (mqMsg.Format.CompareTo(MQC.MQFMT_STRING) == 0)\n {\n System.Console.WriteLine( mqMsg.ReadString(mqMsg.MessageLength) );\n }\n else\n {\n System.Console.WriteLine( \"Non-text message\" );\n }\n }\n catch (MQException mqe)\n {\n // report reason, if any\n if ( mqe.Reason == MQC.MQRC_NO_MSG_AVAILABLE )\n {\n System.Console.WriteLine( \"no more messages - go loop again\" );\n }\n else\n {\n System.Console.WriteLine( \"MQQueue::Get ended with \" + mqe.Message );\n\n isContinue = false;\n }\n }\n}\n"} +{"text": "### Human: The native JNI library 'mqjbnd64' not found.\nplease some one can help me to get mqjbnd64 \n this is my codeConnectionFactory connectionFactory=null;\n Hashtable env = new Hashtable();\n env.put(Context.INITIAL_CONTEXT_FACTORY, \"com.sun.jndi.fscontext.RefFSContextFactory\");\n env.put(Context.PROVIDER_URL, \"file:/C:/CWMQv75-POT/JMS/JNDI Namespace\");\n\n\n try{ \n Context ctx = new InitialContext(env);\n // MQQueueManager qm = (MQQueueManager)ctx.lookup(\"QM\");\n MQConnectionFactory cf = (MQConnectionFactory) ctx.lookup(\"CF1\");\n // cf.createConnection().start();\n MQQueue q = (MQQueue) ctx.lookup(\"JMS1\");\n connectionFactory = (ConnectionFactory)ctx.lookup(\"CF1\");\n\n System.out.println(\"succes \"+q.getBaseQueueManagerName().toString() + \" \" + q.getBaseQueueName()+\" \" +\" \" + cf.getChannel() );\n } catch (NamingException e)\n {\n System.err.println(e.getLocalizedMessage());\n e.printStackTrace();\n }\n Connection connection = connectionFactory.createConnection();\n}### Assistant: The native JNI library 'mqjbnd64' not foundQuestions:1) Are you running your JMS application on the SAME serer as the queue manager or a different server?2) When you defined your QCF, did you include host, port #, channel name?3) Do you understand the difference between connecting to a queue manager inbindings modevsclient mode?You can ONLY connect in bindings mode if your application is running on the same server as the queue manager. When connecting in bindings mode the JMS/Java MQ library uses the native MQ library, hence, it needs the mqjbnd64 shared library or DLL on Windows to perform the MQ API calls.Most MQ applications do NOT reside on the same server as the queue manager and they will use client mode to connect to the remote queue manager and your QCF would look something like:DEFINE QCF(MYQCF) QMANAGER(MQWL1) CHANNEL(TESTCHL) HOSTNAME(10.10.10.10) PORT(1414) TRANSPORT(CLIENT) FAILIFQUIESCE(YES)One other thing I noticed:env.put(Context.PROVIDER_URL, \"file:/C:/CWMQv75-POT/JMS/JNDI Namespace\");that should be:env.put(Context.PROVIDER_URL, \"file://C:/CWMQv75-POT/JMS/JNDI Namespace\");You should have 2 forward slashes \"//\" after \"file:\".\n"} +{"text": "### Human: I am trying to run a demo class (JMSJNDIProducer.java) that comes with Websphere MQ 7.0 installation at 'websphere installation location'\\tools\\jms\\samples. I have Websphere up and running, below are my websphere configurations...Queue Manager Name: JMSDEMOQueue Manager Port: 1414Channel (default): SYSTEM.DEF.CLNTCONNQueue Name: JMSDEMO.QLlet me know if more info needed...My code is failing during the initial context creation, I'm very new to Websphere MQ and not sure what the initialContextUrl needs to be?public class JMS_JNDI_Websphere_Sample {\n\nprivate static String initialContextUrl = \"tcp://localhost:1414\";\n\npublic static void main(String args[]) {\n\n // Instantiate the initial context\n String contextFactory = \"com.sun.jndi.fscontext.RefFSContextFactory\";\n Hashtable environment = new Hashtable();\n environment.put(Context.INITIAL_CONTEXT_FACTORY, contextFactory);\n environment.put(Context.PROVIDER_URL, initialContextUrl);\n try {\n Context context = new InitialDirContext(environment);\n } catch (NamingException e) {\n e.printStackTrace();\n }\n System.out.println(\"Initial context found!\");\n\n}\n}I am getting the below exception.javax.naming.InvalidNameException: tcp://localhost:1414 [Root exception is java.net.MalformedURLException: unknown protocol: tcp]\n at com.sun.jndi.fscontext.FSContextFactory.getFileNameFromURLString(FSContextFactory.java:119)\n at com.sun.jndi.fscontext.RefFSContextFactory.createContext(RefFSContextFactory.java:41)\n at com.sun.jndi.fscontext.RefFSContextFactory.createContextAux(RefFSContextFactory.java:47)\n at com.sun.jndi.fscontext.FSContextFactory.getInitialContext(FSContextFactory.java:49)\n at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)\n at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)\n at javax.naming.InitialContext.init(InitialContext.java:223)\n at javax.naming.InitialContext.(InitialContext.java:197)\n at javax.naming.directory.InitialDirContext.(InitialDirContext.java:82)\n at com.hcsc.jms.websphere.jndi.JMS_JNDI_Websphere_Sample.main(JMS_JNDI_Websphere_Sample.java:32)\nCaused by: java.net.MalformedURLException: unknown protocol: tcp\n at java.net.URL.(URL.java:574)\n at java.net.URL.(URL.java:464)\n at java.net.URL.(URL.java:413)\n at com.sun.jndi.fscontext.FSContextFactory.getFileNameFromURLString(FSContextFactory.java:117)\n ... 9 more### Assistant: private static String initialContextUrl = \"tcp://localhost:1414\";First off, I don't think \"tcp\" is a valid value and if it is, do you have something running on port 1414 to reply JNDI lookup requests?Secondly, I think you are confusing MQ port 1414 with JNDI lookup.Third, why don't you just follow the example in JmsJndiProducer.java and use a file-based JNDI.i.e. Use MQ Explorer and select \"JMS Administered Objects\" then do file-based JNDI.Once you create your file-based JNDI then that value for your initial context.\n"} +{"text": "### Human: I have success fully created a JMS bridge between IBM MQ and Weblogic JMS on two different machines and we have enabled both connection as well as message authentication on IBM MQ server but to establish a connection I am providing my Weblogic JMS server's(machine where it is installed) userid/password and hostname.\nI do not want to provide the userid/password to IBM MQ. so how can I establish a connection between IBM MQ and the machine where my Weblogic JMS running. Can I implement ssl/TLs digital certificate to authenticate. we have weblogic 11g and IBM MQ v7.5.please advice### Assistant: Yes, IBM MQ allows you authenticate connections using SSL/TLS.\n"} +{"text": "### Human: I am unable to install IBM WebSphere MQ V7.01.6. When I install I am getting the following error:The process cannot access the file because it is being used by another process.The title in the dialog is .\\DATA1.CABI have tried running as administrator. I click OK and then it just locks up. I let it stay locked up overnight and then I had to do a force restart.### Assistant: Firstly, try copying the media locally and running the install from there. If that fails try the traditional reboot just in case. If that fails, use process explorer and 'search' by 'data1.cab' and see who has an open handle on it. If that fails, try using process monitor to log up until the error and see what you actually get.How far into the install does it fail... immediately or after a while? If it at least starts, the other thing to do is to enable MSI logging (See microsoft fixithttp://support.microsoft.com/kb/223300, which turns on logging and in your temporary directory (%temp%) you get a log file... I am suspicious you are not getting into the msi part yet.Bear in mind there might be other things opening the file such as indexers, virus scanners, backups etc so it might be a case of setting process monitor to log for access just to the file and see who hits it.\n"} +{"text": "### Human: We have a monitoring tool usingrunmqscwith the command:display qstatus(*) curdepth ipprocsto retrieve queue depths for alarming purposes(a).A script analyses the output and feeds the information to a database, so I'm just waiting on therawoutput of that command above to ensure it's not something wrong with the script. That's unlikely since all the other queues report fine.So the problem is that it reports a depth of 139 for a particular queue, and it's been at that value for many hours. MQ Explorer on that box however, seems to think there's only eight messages in the queue.Hence my question is (hopefully) a simple one: under what circumstances woulddisplay qstatus curdepthdisagree with MQ Explorer in terms of the queue depth? Is there someothermetric I should be gathering fromrunmqscto get the correct depth? Or is MQ Explorer not necessarily as reliable?(b)(a)The purpose of producing alarms, not purposes you should be alarmed about.(b)Yes, Iknowthat's three questions. I prefer to think of it as three aspects of thesamequestion.### Assistant: Both runmqsc and MQ Explorer (via PCF) display the same value that the queue manager gives to them. If both commands were issued atexactlythe same time they would give the sme answer. Of course, CURDEPTH is something that can change rapidly, so please be sure that it isn't simply an actual change in the depth between issuing the command with one tool and the other tool.\n"} +{"text": "### Human: I have a queue that is loaded with high priority JMS messages throughout the day, I want to get them out the door quickly. The queue is also being loaded periodically with lower priority messages in large batches. The problem that I see on busy days, is that there are always enough high priority messages at the front of the queue that none of the lower priority messages get selected until that volume drops off. Often they will sit on the queue until they middle of the night. The app is distributed over a number of servers, but the CPUs are not even breathing hard, the JMS seems to be the choak point.My hunch is to implement some sort of aging algorithm that increases priority for messages that have been on the queue for a very long time, but of course, that is what middleware is supposed to do for me. I can't imagine that the JMS provider (IBM WebsphereMQ) or the application server (TIBCO BusinessWorks) doesn't have some sort of facility to cope with this. So before I go write some code, I thought I would ask, is there any way to get either of these technologies to help me out with this problem?The BusinessWorks activity that is reading the queue is a JMS SOAP Event Source, but I could turn it into a JMS Queue Receiver activity or whatever.All thoughts on how to solve this are welcome :-) TIA### Assistant: That's like tying 1 hand behind your back and then complaining that you cannot swim properly. D'oh! First off, who's bright idea was it to mix messages. Just because you can do something does not mean you should.The app is distributed over a number of servers, but the CPUs are not\n even breathing hard, the JMS seems to be the choak point.Well then, the solution is easy. Put high priority messages into queue \"A\" (the existing queue) and low priority messages into a new queue \"B\". Next, startup another instance of your JMS application to read the messages off queue \"B\".Also, JMS is probably not the choke-point. It is what the application is doing with the message data after the JMS layer picks up the message that is taking a long time (i.e. backend work).Finally, how many instances of your JMS application is running against the existing queue? If you are only running 1 instance, why? If you have lots of CPU capacity then why don't you run 10 instances of your JMS application. Do some true parallel processing of messages.\n"} +{"text": "### Human: If I keep 500 messages in a Websphere MQ queue and run by program that consumes the queue, it takes about 2-3 ms per message.If I keep the consumer program running and keep putting messages on to the queue at the rate of 200 per sec, the reading program slows down drastically, taking about 200 ms per message.I suspect some kind of locking that affects the consumer program. Are there any ways to work around this?Thanks,Yash### Assistant: I am sure Morag will provide a much more technically detailed response, after you provide more information, but based solely on what you have presented -- The queue manager locks the queue access for single threaded access to the control blocks while a new message is being added, the overhead is in part dependent on the queue depth at the time. A deeper queue may take longer to add a message to, especially if there is a non-blank correlid (insertion into sorted linked-list).\n"} +{"text": "### Human: I'm trying to connect to a mq series queue using pymqi. The queue is configured with user and password access. I'm trying to pass user/password to the queue filling pymqi.cd() fields UserIdentifier and Password, but every time I try to put a message in the queue I get this error(MQI Error. Comp: 2, Reason 2035: FAILD: MQRC_NOT_AUTHORIZED)Is it possible to connect to a queue using userid/password with pymqi?The error reported is something like:11.52.24 STC01966 ICH408I USER(Uxxxxx) GROUP(MMMMM ) NAME(NNNN NNNN N\n806 CHAN1.EXAMPLE.QUEUE CL(MQQUEUE ) \n806 INSUFFICIENT ACCESS AUTHORITY \n806 FROM CHAN1.EXAMPLE.* (G) \n806 ACCESS INTENT(UPDATE ) ACCESS ALLOWED(NONE )where UXXXXX happens to be the session user of the process that try to put a message in the queue### Assistant: You have been given a2035 (MQRC_NOT_AUTHORIZED)error back to your application because of a lack of authority to do what you are trying to do. The error reported at your z/OS queue manager by RACF indicated that you tried to open a queue calledCHAN1.EXAMPLE.QUEUEso that you could put your message to it, but you have no access to that queue. In fact you have no access to any queues covered by the profileCHAN1.EXAMPLE.*. You need to be permittedUPDATEaccess to that profile using a command something like this:-PERMIT CHAN1.EXAMPLE.* CLASS(MQQUEUE) ID(Uxxxxx) ACCESS(UPDATE)It is not because of your user ID and password. User IDs and passwords are only checked at the queue manager side of the connection if you are using MQ V8, or if earlier as you indicated then only if a security exit is being used.Also, you said your queue manager was at V7.5, but since it is on z/OS, then it can't be, I assume therefore it is V7.1.\n"} +{"text": "### Human: I have got few queries regardingswitch over, fail over and auto reconnectin multi instance MQ. while going throughIBM Documentationon this.ScenariosSwitch Over: Usingendmqm -s Fail Over : Bringing down the server on which active instance is running.Application : I am running a stand alone Java program which puts messages in the queue.Questions:Is there any difference the way MQ handles the switch over and fail over? From the document I could see, in both the cases locks gets released.Is reconnect happens automatically if the active instance goes down either by switch over or fail over? I have observed while putting the messages through my stand alone application, the moment I fired up the commandendmqm -s in active instance, my application crashes withcom.ibm.msg.client.jms.DetailedJMSException: JMSWMQ2007: Failed to\n send a message to destination 'MYQ'. JMS attempted to perform an MQPUT\n or MQPUT1; however WebSphere MQ reported an error. Use the linked\n exception to determine the cause of this error.But If i restart my application it is connecting to the stand by server (Active after endmqm -s ) and successfully putting the messages. Is there any way to perform automatic re connection? If yes, is there any configuration available from MQ or it needs to be done from application level.I have seen in the document it is mentionedAutomatic client reconnect is not supported by WebSphere\u00ae MQ classes for Java.What does this means?So far I am using plain Java code to test the Multi Instance feature. I want to try the same withSpring DMLC. Is multi instance behavior supported with Spring DMLC? If yes, is there any extra configuration/set up required?Any guidance is much appreciated.### Assistant: From an application perspective both are same. The former is a forced/manual while the later is triggered by the hardware/software host.You can setup automatic reconnect on the application level.There are two types of Java applications in MQ. One is pure Java and uses MQ native java classes (like MQQueueManager, MQQueue). The other one uses JMS API (like ConnectionFactory, Connection, Session, Producer). From the error, it looks like you are using JMS. Automatic reconnection is supported in MQ JMS.http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.con.doc/q017800_.htm?lang=enThere are several ways to use it. The standard way is to enable it through JMS bindings reference (refer the page above).http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.ref.dev.doc/q111800_.htm?lang=enPay particular attention to CONNECTIONNAMELIST, CLIENTRECONNECTOPTIONS, CLIENTRECONNECTTIMEOUTIn pure Java, you have to recreate the MQQueueManager object on receiving a connection broken exception. Its not so trivial as it sounds but you may to look at the exact state of the application especially inflight transactions.Spring has JMS Support. Not sure if you mean JMS or MQ Java here. If MQ Java, then I am afraid its not possible. All you can use is the dependency injection.http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.dev.doc/q119450_.htm?lang=enSetup the connectionfactory with an appropriate connectionnamelist or load it through the bindings file (generated by JMSAdmin) in case of standalone.\n"} +{"text": "### Human: We are sending a message to Websphere MQ Queue. While sending the message we are setting the REPLY TO QUEUE NAME and JMSCOrrelationID. We also set the USER IDENTIFIER. The code snippet is as follows.Message msg = session.createTextMessage((String) message);\nDestination codeDestination = session.createQueue(\"queue://\" + replyToQueueMgr + \"/\" + replyToQueueName);\nmsg.setJMSReplyTo(codeDestination);\nmsg.setIntProperty(JmsConstants.JMS_IBM_REPORT_COD, MQC.MQRO_COD);\nmsg.setJMSCorrelationID(msgCorrelId);\n msg.setStringProperty(JmsConstants.JMS_IBM_MQMD_USERIDENTIFIER, \"abc\");\nproducer.send(msg);Please note that we have ensure that all the fields which we set are not null. Also the user abc is a valid user because if not then the CODs should go to DEAD LETTER QUEUE but there are no messages in it. Still after the message is picked up we get a COD which has JMSCorrelationID as null. In COD Processor we are listening on the replyToQueuename.String correlationID = (String)eventContext.getMessage().getInboundProperty(\"JMSCorrelationID\");On checking above correlation ID is null. ALso the message payload is of {null_payload} type of NullPayload class of mule. I know that body would be NULL because we setMQC.MQRO_COD. But I dont undertand how the correlationId got wiped out.Please advise if there is any configuration at the Webview MQ end whih could cause such a behaviour? Or is there something missing in the way we are setting the header properties?UPDATEThe queue that we are sending the message to with COD information is an alias to a TOPIC. There are 2 subscribers to this TOPIC and we observed that there were instances where we received multiple COD's when both the subscribers picked up the messages. Is there any way to ensure that the TOPIC sends a single COD after all the subscribers have picked up the message? Could this QM setup be the cause of the COD with null?### Assistant: User IdentifierWhen a message is published, each subscriber gets a copy of the message with a unique message ID and with the identity context fields in the MQMD (UserID, AccountingToken, ApplIdentityData) all set to the subscriber's context. So it doesn't matter what you set in the MQMD UserID of the message you publish, all the copies will have the subscriber user ID in them. This user ID will, by definition, exist where he subscriber is so the CODs will be able to be put.Correlation ID with Pub/SubYou can ensure the correlation ID from the publisher is sent all the way through to the subscriber, by ensuring the subscription is made using MQSO_SET_CORREL_ID and setting the MQSO SubCorrelId to MQCI_NONE.One COD for multiple messagesSince there are multiple independent messages, each with the COD Report Option set, you will get multiple report messages. There is no setting to combine these, however you could write an intermediate application to combine then if your main application wants only one.Passing Correl ID back in a Report MessageBy default the report option will send back the message ID in the Correl ID of the report message. If you want to have the Correl ID passed back, you should use MQRO_PASS_CORREL_ID.Further ReadingReport Option\n"} +{"text": "### Human: I'm new with WebsphereMQ C++. I would like to ask how to wait indefinitely for the incoming message, without usingWaitInterval (MQWI_UNLIMITED)because when I am using this mqwi_unlimited it then waits for the message for a long time as expected but the application is like \"hanging\" when going into a loop of getting messages(queue.get( msg, gmo )).I am thinking of setting wait interval into some seconds then reconnect or something like that. Is it possible?How can I wait for a message without getting an error of\"NO AVAILABLE MESSAGE (MQRC 2033)?\"The reason I ask this question is I am creating a daemon which waits for a message then do some process. The application is \"stack\" only on getting the message, I tried to replace the (MQWI_UNLIMITED) and it proceeds to the next process..//====DAEMON===//rcv->start(); -this is the get (loop of getting message)snd->start(); - this is the putlet's say the application start to get and process the message but after that it never execute thesnd->start()Please help me. Thank you :)### Assistant: I would like to ask how to wait indefinitely for the incoming message,\n without using WaitInterval (MQWI_UNLIMITED)ThatIShow you wait indefinitely.You can use the call-back method for getting a message, go look up MQCB API call.\n"} +{"text": "### Human: We are using IBM MQ as MoM for Java based JMS application. I need to know the underlying communication protocol used by ibm mq. Specifically, if I need to communicate using MQTT protocol with IBM MQ, do I need to use MQ Telemetry product ?### Assistant: The MQ JMS client will use a proprietary protocol to communicate to the queue manager rather than the MQTT protocol. This proprietary protocol is not published externally like the MQTT protocol is.If you need to use the MQTT protocol then you will need to use a MQTT client.\n"} +{"text": "### Human: How the Cluster Sender and Receiver channels usage differs in Full Repository & Partial Repository QManagers in IBM websphere MQ?### Assistant: On the Full Repository:\n - the queue manager's cluster receiver channel must point to itself, this is how other queue managers in the cluster will know how to reach the FR.- the cluster sender channel must point to another Full Repository.On the Partial Repository:\n - the queue manager's cluster receiver channel must also point to itself, this is how other queue managers in the cluster will know how to reach it.\n - the cluster sender channel must point to one of the Full Repository queue managers; this is the FR the PR will rely on for cluster object resolution.Notes:\n1. Your cluster should have 2 Full Repositories; each FR sender channel should point to the other FR.\n2. Your Partial Repositories should be configured to point to one of these 2 Full Repositories; a good habit is to equally assign them between the FRs.\n"} +{"text": "### Human: I am trying to transfer a 60mb file to queue, butWebsphere MQfte stall the transfer and keep recovering. I am running WebSphere MQ FTE on default configuration.### Assistant: I have tested following scenario with different results according to configuration changes I made.These commands were issued to create monitor:fteCreateTransfer -sa AGENT1 -sm TQM.FTE -da AGENT2 -dm QM.FTE -dq FTE.TEST.Q -p QM.FTE -de overwrite -sd delete -gt /var/IBM/WMQFTE/config/TQM.FTE/TEST_TRANSFER.xml D:\\\\rvs\\\\tstusrdat\\\\ALZtoSIP\\\\INC\\\\*.zip\n\nfteCreateMonitor -ma AGENT1 -mn TEST_MONITOR -md D:\\\\rvs\\\\tstusrdat\\\\ALZtoSIP\\\\INC -mt /var/IBM/WMQFTE/config/TQM.FTE/TEST_TRANSFER.xml -tr match,*.zipTest was performed on files: 53MB and 30MBDefault configuration (just enableQueueInputOutput=true added to AGENT2.properties)1) all defaultno success, transfer status: \"recovering\"for both files2) added maxInputOutputMessageLength=60000000, destination queue max message length changed to 103809024result transfer status: \"failed\" with following exception PM71138: BFGIO0178E: A QUEUE WRITE FAILED DUE TO A WMQAPIEXCEPTION WITH MESSAGE TEXT CC=2 RC=2142 MQRC_HEADER_ERRORfor both filesAfter reading this:http://pic.dhe.ibm.com/infocenter/wmqfte/v7r0/topic/com.ibm.wmqfte.doc/message_length.htmI came with working settings:3)maxInputOutputMessageLength=34603008(its maximum value), destination queue max message length still to 103809024result for file with size 30MB: succcessresult for file with size 53MB: \"failed\" with following exception PM71138: BFGIO0178E: A QUEUE WRITE FAILED DUE TO A WMQAPIEXCEPTION WITH MESSAGE TEXT CC=2 RC=2142 MQRC_HEADER_ERRORSo according to this I am afraid one can't transfer larger then 34603008 bytes.\n"} +{"text": "### Human: I have a qmgrQM1and local queuesQ1 and Q2. There is aSVRCONNchannel withMCAset tomqm.There are multiple application connect to myQMGRfor exampleAPP1 and App2.\nI wantApp1only havePUTauthority which meansONLY PUTmessage toQ1 or Q2andApp2only haveGETauthority toONLY GETmessage fromQ1 or Q2.Is there any advice.### Assistant: Each unique set of authorizations needs to be attached to a group. Then when the app connects it needs to do so as a user ID in the appropriate group. (Remember that access requests always resolve to a specific principal, but authorizations are attached to groups.)In this case, App1 and App2 each need their own group and at least one ID that is in each group. Once you have groups for app1 and app2, then you need to arrange that theMCAUSERof the running channel is a user ID in the appropriate group. You can do this by having different channels with hard-codedMCAUSERin each, or dynamically set theMCAUSERbased on CHLAUTH rules. If you have been using channel security exits such as BlockIP2 or MQAUSX then you can configure those to dynamically set theMCAUSERat connect time as well.Remember that the channels withMCAUSER('mqm')set must be configured to deny access to App1 and App2, or any other non-admin connection. It is much more common and better from a security standpoint to setMCAUSER('*NOACCESS')inallinbound channels and then override that with exits or CHLAUTH rules. That way if the channel configuration fails, it fails to a secure state rather than an insecure state.\n"} +{"text": "### Human: I'm new withWebsphere MQ V7 C++. I'm thinking of creatingmulti-threaded applicationto get and to respond in the message on the queue. Can you guys give me an example regarding this multi-threaded approach using pthread library? I don't have any idea how to create one.Thank you! :)### Assistant: Personally I would not recommend using the C++ api - it has been stabilized and is not being extended for the newer functionality. Use C calls from a C++ app insteadhttp://pic.dhe.ibm.com/infocenter/wmqv7/v7r1/index.jsp?topic=%2Fcom.ibm.mq.doc%2Fzd00030_.htm\"As of WebSphere MQ Version 7.0, enhancements to the WebSphere MQ programming interfaces will not be applied to the C++ classes.\"In terms of the multithreaded approach, it should be no different to any normal threaded program... If you dont use shared hconns then a hconn is only valid for the thread it was created on, and if you do use shared hconns I wouldn't try sharing them across threads simultaneously (calls will usually block depending on sharing options).\n"} +{"text": "### Human: I'm getting some type of error when starting my JavaSE application as a Windows service, but I'm not sure why. Some IBM jar is dumping a humongous bunch of data, but I can't seem to tell what's wrong:FFDC called in uninitialized Trace module\n\n\n\n FDCTitle\n\n\nProduct :- ProductName\nDate/Time :- Tue Apr 29 10:35:47 CEST 2014\nSystem time :- 1398760547128\nOperating System :- Windows 2003\nUserID :- SYSTEM\nJava Vendor :- Oracle Corporation\nJava Version :- 21.0-b17\n\nSource Class :- com.ibm.msg.client.commonservices.nls.PINLSServices\nSource Method :- getMessage(String,HashMap)\nProbeID :- XC003002\nThread :- name=Camel (bkr_message_remover) thread #0 - timer://poller priority=5 group=main ccl=sun.misc.Launcher$AppClassLoader@1a5f230\n\n\n Data\n ----\n\nData :- none\n\n Version information\n -------------------\n\nJava Message Service Client\n7.5.0.0\np000-L120604\nProduction\n\nWebSphere MQ classes for Java Message Service\n7.5.0.0\np000-L120604\nProduction\n\nIBM WebSphere MQ JMS Provider\n7.5.0.0\np000-L120604\nProduction\n\n\n\n Stack trace\n -----------\n\nStack trace to show the location of the FFST call\n FFST Location :- java.lang.Exception\n at com.ibm.msg.client.commonservices.trace.Trace.getCurrentPosition(Trace.java:1916)\n at com.ibm.msg.client.commonservices.trace.Trace.createFFSTString(Trace.java:1855)\n at com.ibm.msg.client.commonservices.trace.Trace.ffstInternal(Trace.java:1744)\n at com.ibm.msg.client.commonservices.trace.Trace.ffst(Trace.java:1568)\n at com.ibm.msg.client.commonservices.nls.PINLSServices.getMessage(PINLSServices.java:144)\n at com.ibm.msg.client.commonservices.nls.NLSServices.getMessage(NLSServices.java:246)\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:217)\n at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:420)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:6876)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6254)\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:285)\n at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6189)\n at com.ibm.mq.jms.MQConnectionFactory.createConnection(MQConnectionFactory.java:6218)\n at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184)\n at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:456)\n at org.springframework.jms.core.JmsTemplate.receiveSelected(JmsTemplate.java:703)\n at org.springframework.jms.core.JmsTemplate.receive(JmsTemplate.java:681)\n at org.springframework.jms.core.JmsTemplate.receive(JmsTemplate.java:672)\n at org.apache.camel.component.jms.JmsPollingConsumer.receive(JmsPollingConsumer.java:60)\n at org.apache.camel.impl.ConsumerCache.receive(ConsumerCache.java:112)\n at org.apache.camel.impl.DefaultConsumerTemplate.receive(DefaultConsumerTemplate.java:91)\n at org.apache.camel.impl.DefaultConsumerTemplate.receiveBody(DefaultConsumerTemplate.java:172)\n at com.hm.online.payment.bkr_message_remover.JmsFetcher.process(JmsFetcher.java:27)\n at org.apache.camel.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:63)\n at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)\n at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)\n at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)\n at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)\n at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)\n at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)\n at org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:139)\n at org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:64)\n at java.util.TimerThread.mainLoop(Unknown Source)\n at java.util.TimerThread.run(Unknown Source)\n\n\n Property Store Contents\n -----------------------\n\nAll currently set properties\n MQJMS_TRACE_DIR :-\n MQJMS_TRACE_LEVEL :-\n awt.toolkit :- sun.awt.windows.WToolkit\n com.ibm.mq.cfg.Channels.DefRecon :- \n com.ibm.mq.cfg.MQCCSID :- \n com.ibm.mq.cfg.MQCLNTCF :- \n com.ibm.mq.cfg.MQIPADDRV :- \n com.ibm.mq.cfg.MQSSLPOLLTIMEOUT :- \n com.ibm.mq.cfg.MQ_LCLADDR :- \n com.ibm.mq.cfg.TCP.ClntRcvBuffSize :- \n com.ibm.mq.cfg.TCP.ClntSndBuffSize :- \n com.ibm.mq.cfg.TCP.Connect_Timeout :- \n com.ibm.mq.cfg.TCP.EndPort :- \n com.ibm.mq.cfg.TCP.StrPort :- \n com.ibm.mq.cfg.jmqi.libpath :- \n com.ibm.mq.connector.JCARuntimeHelper :- \n com.ibm.mq.jms.ForceUserID :- false\n com.ibm.mq.jms.replyToStyle :- \n com.ibm.mq.jms.tuning.usePersistenceFromMD :- \n com.ibm.mq.localAddress :-\n com.ibm.msg.client.commonservices.ffst.suppress :- 0\n com.ibm.msg.client.commonservices.trace.standalone :- false\n com.ibm.msg.client.commonservices.trace.status :- OFF\n com.ibm.msg.client.wmq.forceAllowClientConnection :- false\n com.ibm.msg.client.wmq.internal.forceDontUseJmqiWorkerThread :- false\n com.ibm.msg.client.wmq.internal.forceDontUseSharedHconn :- false\n com.ibm.msg.client.wmq.internal.forceUseJmqiWorkerThread :- false\n com.ibm.msg.client.wmq.overrideInheritRRSContext :- false\n com.ibm.msg.client.wmq.overrideProviderVersion :- \n com.ibm.msg.client.wmq.xaClientEnabled :- false\n file.encoding :- Cp1252\n file.encoding.pkg :- sun.io\n file.separator :- \\\n java.awt.graphicsenv :- sun.awt.Win32GraphicsEnvironment\n java.awt.printerjob :- sun.awt.windows.WPrinterJob\n java.class.path :- C:\\yajsw-stable-11.11\\wrapperApp.jar;C:\\BKRMessageRemover\\bkr_message...\n java.class.version :- 51.0\n java.endorsed.dirs :- C:\\BKRMessageRemover\\lib\\endorsed\n java.ext.dirs :- C:\\BKRMessageRemover\\lib\\ext;C:\\WINDOWS\\Sun\\Java\\lib\\ext\n java.home :- C:\\BKRMessageRemover\n java.io.tmpdir :- C:\\WINDOWS\\TEMP\\\n java.library.path :- C:\\BKRMessageRemover\\bin;C:\\WINDOWS\\Sun\\Java\\bin;C:\\WINDOWS\\system32;...\n java.runtime.name :- Java(TM) SE Runtime Environment\n java.runtime.version :- 1.7.0-b147\n java.specification.name :- Java Platform API Specification\n java.specification.vendor :- Oracle Corporation\n java.specification.version :- 1.7\n java.vendor :- Oracle Corporation\n java.vendor.url :- http://java.oracle.com/\n java.vendor.url.bug :- http://bugreport.sun.com/bugreport/\n java.version :- 1.7.0\n java.vm.info :- mixed mode\n java.vm.name :- Java HotSpot(TM) Client VM\n java.vm.specification.name :- Java Virtual Machine Specification\n java.vm.specification.vendor :- Oracle Corporation\n java.vm.specification.version :- 1.7\n java.vm.vendor :- Oracle Corporation\n java.vm.version :- 21.0-b17\n jna_tmpdir :- C:\\yajsw-stable-11.11\\bat\\..\\tmp\n line.separator :-\n\n os.arch :- x86\n os.name :- \n os.version :- 5.2\n path.separator :- ;\n poll.period :- 30s\n server :- deve\n sun.arch.data.model :- 32\n sun.boot.class.path :- C:\\BKRMessageRemover\\lib\\resources.jar;C:\\BKRMessageRemover\\lib\\rt.ja...\n sun.boot.library.path :- C:\\BKRMessageRemover\\bin\n sun.cpu.endian :- little\n sun.cpu.isalist :- pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86\n sun.desktop :- windows\n sun.io.unicode.encoding :- UnicodeLittle\n sun.java.command :- org.rzo.yajsw.app.WrapperJVMMain\n sun.java.launcher :- SUN_STANDARD\n sun.jnu.encoding :- Cp1252\n sun.management.compiler :- HotSpot Client Compiler\n sun.os.patch.level :- Service Pack 2\n user.country :- US\n user.dir :- C:\\BKRMessageRemover\n user.home :- C:\\Documents and Settings\\Default User\n user.language :- en\n user.name :- SYSTEM\n user.script :-\n user.timezone :- Europe/Berlin\n user.variant :-\n wrapper.additional.1x :- -Xrs\n wrapper.config :- C:\\yajsw-stable-11.11\\conf\\wrapper.conf\n wrapper.console.visible :- false\n wrapper.key :- 545431178638744240\n wrapper.port :- 15003\n wrapper.service :- true\n wrapper.teeName :- 545431178638744240$1398760542738\n wrapper.tmp.path :- C:\\yajsw-stable-11.11\\bat\\..\\tmp\n wrapper.working.dir :- C:\\BKRMessageRemover\n wrapper_home :- C:\\yajsw-stable-11.11\\bat\\/..\n\n WorkQueueMananger Contents\n --------------------------\n\n Maintain ThreadPool size :- false\n Maximum ThreadPool size :- -1\n ThreadPool inactive timeout :- 0\n unavailable - :- com.ibm.msg.client.commonservices.CSIException: JMSCS0002\n\n Runtime properties\n ------------------\n\n Available processors :- 1\n Free memory in bytes (now) :- 7199800\n Max memory in bytes :- 259522560\n Total memory in bytes (now) :- 18948096\n\n Component Manager Contents\n --------------------------\n\nCommon Services Components:\nMessaging Provider Components:\n CMVC :- p000-L120604\n Class Name :- class com.ibm.msg.client.wmq.factories.WMQComponent\n Component Name :- com.ibm.msg.client.wmq\n Component Title :- IBM WebSphere MQ JMS Provider\n Factory Class :- class com.ibm.msg.client.wmq.factories.WMQFactoryFactory\n Version :- 7.5.0.0\n\n\n\n\n Provider Specific Information\n -----------------------------\n\nOverview of JMS System\nNum. Connections : 0\nNum. Sessions : 0\nNum. Consumers : 0\nNum. Producers : 0\n\nDetailed JMS System Information\nConnections :\nSessions :\nConsumers :\nProducers :I've packaged my stuff and all dependent jars in a single, fat jar (maven-assembly-plugin/jar-with-dependencies). Any ideas?### Assistant: Downgrade use of mqjms, jmqi, dhbcore and headers (from 7.5.0.0 to 7.0.1.3).\n"} +{"text": "### Human: I am getting the below error while the application polls the messages from different queues (using IBM MQ) and load the same into the some staging tables.....- Completion Code 1, Reason 2003\n com.ibm.mq.MQException: Completion Code 1, Reason 2003\n at com.ibm.mq.MQQueueManager.commit(MQQueueManager.java:795)Your help in resolving this would be most appreciated.### Assistant: Did you read the manual (InfoCenter):http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=/com.ibm.mq.amqzao.doc/fm12100_.htmHow often is your code doing a commit?\n"} +{"text": "### Human: I am trying to fully define my message driven beans using the deployment descriptor as I am deploying my app to Websphere and it doesn't handle annotations very nicely.I'm wondering if there is a way of specifying the message listener interface of an MDB in the ejb-jar.xml file?### Assistant: You must use the@javax.ejb.MessageDrivenannotation to declare the EJB type as message-driven. You can specify the following optional attributes:messageListenerInterface\u2014Specifies the message listener interface, if you haven't explicitly implemented it or if the bean implements additional interfaces.The bean class must implement, directly or indirectly, the message listener interface required by the messaging type that it supports or the methods of the message listener interface. In the case of JMS, this is the javax.jms.MessageListener interface.activationConfig\u2014Specifies an array of activation configuration properties that configure the bean in its operational environment.Activation configuration properties are name-value pairs that are passed to the MDB container when an MDB is deployed. The properties can be declared in either an ejb-jar.xml deployment descriptor or by using the@ActivationConfigPropertyannotation on the MDB bean class.Activation Configuration Properties Set in ejb-jar.xml\n . . .\n \n \n destinationJNDIName\n myQueue\n \n \n destinationType\n javax.jms.Queue\n \n \n . . .\n \n \n . . .\n \n \n destinationJNDIName\n myQueue\n \n \n destinationType\n javax.jms.Queue\n \n \n . . .\n \n"} +{"text": "### Human: I'm attempting to run a C# application I inherited which is supposed to connect to a Websphere MQ channel and write/read messages. I have IBM Websphere MQ 5.3 installed.The exception occurs when the code instantiates a MQQueueManager object.MQQueueManager queueManager = new MQQueueManager(\"somename\");The exception thrown is\n\"A first chance exception of type 'System.EntryPointNotFoundException' occurred in amqmdxcs.dllAdditional information: Unable to find an entry point named 'xtr_getTraceStatus' in DLL 'amqxcs2.dll'.\"I'm totally new at Websphere MQ and do not even have a proper basic understanding, but I really need to get this application to run properly as soon as I can. Any pointers will be appreciated. Thanks.### Assistant: You are using an old and unsupported version of MQ. Suggest you to upgrade to latest supported version of WebSphere MQ. Are you at the latest fix pack of MQ v5.3? It appears that there is some issue with the MQ you have installed.Can you upgrade to MQ v71? You can just upgrade only the client and compile your .NET application. You can download the MQC71 client fromhere.\n"} +{"text": "### Human: Hi StackOverflow community,I am currently using Spring to connect to a queue. I would want to be able to configure which provider I can connect with in our Test VS our UAT environments. In UAT, we use IBM WMQ 7; in Test, we are using ActiveMQ.We are also using an SSL connection in both cases.Currently, we have the following configuration which works for connecting to WMQ 7:\n \n \n \n \n \n \nUsing JNDI, I am able to connect to ActiveMQ. But when switching the provider class, it gives me the following exception.Spring JNDI Config:\n \n \n\n\n\n \n \n com.ibm.mq.jms.context.WMQInitialContextFactory\n ${UM_MQ_HOST}:${UM_MQ_PORT}/${UM_MQ_CHANNEL}\n \n \nException:Caused by: javax.naming.NamingException: Caught an Exception trying to create the admin queue. Exception was: com.ibm.mq.pcf.PCFException: MQJE001: Completion Code '2', Reason '2035'. [Root exception is com.ibm.mq.pcf.PCFException: MQJE001: Completion Code '2', Reason '2035'.]\n at com.ibm.mq.jms.context.MQContext.(MQContext.java:294)\n at com.ibm.mq.jms.context.WMQInitialContextFactory.getInitialContext(WMQInitialContextFactory.java:29)\n at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)\n at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)\n at javax.naming.InitialContext.init(InitialContext.java:223)\n at javax.naming.InitialContext.(InitialContext.java:197)\n at org.springframework.jndi.JndiTemplate.createInitialContext(JndiTemplate.java:136)\n at org.springframework.jndi.JndiTemplate.getContext(JndiTemplate.java:103)\n at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:85)\n at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152)\n at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)\n at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95)\n at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)\n at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:201)\n at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:187)\n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1545)\n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1483)\n ... 109 more\nCaused by: com.ibm.mq.pcf.PCFException: MQJE001: Completion Code '2', Reason '2035'.\n at com.ibm.mq.pcf.PCFMessageAgent.send(PCFMessageAgent.java:241)\n at com.ibm.mq.jms.context.MQContext.(MQContext.java:273)\n ... 125 moreI suspect this is due to either 2 things:We don't have explicit permissions set on the JMS Admin queue stated aboveThe Cipher setting is not working in the Spring configCan anyone provide some guidance? If you have faced this issue before, what was the solution?I am sure the answer is staring at me right in the face, just have some fog in my eyes :)Thanks,Jose### Assistant: You do not want to use WMQInitialContextFactory. Use File based JNDI or a real JNDI registry.WMQInitialContextFactory is from SupportPac ME01 written by an IBM employee as a simple tool for development only - never, ever for production. SupportPac ME01 is NOT recommended for use beyond simple development. Most IBM MQ people say to never use it. Also, WMQInitialContextFactory is NOT supported by IBM.Who ever told you to use WMQInitialContextFactory needs to refresh themselves on IBM MQ best practices.\n"} +{"text": "### Human: I have Weblogic 12.1.2 and IBM WebSphere MQ Explorer 7.5.0.2.In Weblogic, I created:JMS ServerJMS ModuleConnection FactoryJMS QueueI have a JAVA program, which can send messages into this Queue.I want to use the MQ Explorer, to read the messages from this Queue. How can I set it? What and how should I do/set in the MQ Explorer, to connect to this Queue? Could anyone give me maybe a web link? I could not find anything useful, but maybe I thought wrong how to set it.Thank you!### Assistant: You need to write a bridge yourself.1.Write an MDB on the weblogic that listens on the queue\n2.This MDB will basically act as a client to the websphere MQ .Basically you configure a queue on websphere MQ and using the client put messages on the queue.\n"} +{"text": "### Human: I've got a question with the MQ client configuration file mqclient.ini.If i have one MQ JAVA application which put msg to queue of remote MQ server in another box through TCP\uff0c does that java application search mqclient.ini locally when connectting to MQ Server? Or will it even go find that mqclient.ini file in remote MQ Server? since there is one default such file under MQ sever data directory, like /var/mqmthanks in advance### Assistant: MQ Client libraries use the mqclient.ini file located on the local server. They don't use the one on the remote server. The mqclient.ini file on the remote server will be used by MQ applications running on there.\n"} +{"text": "### Human: Is it possible to specify username and password for queue connection factory? Exampleheredoes not describe it.What I'm looking for is herehttp://publib.boulder.ibm.com/infocenter/wsdoc400/v6r0/index.jsp?topic=/com.ibm.websphere.iseries.doc/info/ae/ae/ucli_pqcfw.htmlThe properies of QCF:ASYNCEXCEPTION()\nCCSID()\nCHANNEL()\nCLIENTRECONNECTOPTIONS()\nCLIENTRECONNECTTIMEOUT()\nCOMPHDR()\nCOMPMSG()\nCONNECTIONNAMELIST()\nCONNOPT()\nFAILIFQUIESCE()\nHOSTNAME()\nLOCALADDRESS()\nMAPNAMESTYLE()\nMSGBATCHSZ()\nMSGRETENTION()\nPOLLINGINT()\nPORT()\nPROVIDERVERSION()\nQMANAGER()\nRESCANINT()\nSENDCHECKCOUNT()\nSHARECONVALLOWED()\nSSLFIPSREQUIRED()\nSSLRESETCOUNT()\nSYNCPOINTALLGETS()\nTARGCLIENTMATCHING()\nTEMPMODEL()\nTEMPQPREFIX()\nTRANSPORT()\nUSECONNPOOLING()\nVERSION()\nWILDCARDFORMAT()I'm trying to avoid calling createQueueConnection(\"user\", \"password\") and need these details provided somehow via binding so I can call createQueueConnection()### Assistant: Your task might be an issue. I don't know if it's even possible to configure this way.There are some options, such as creating a wrapper factory that handles the user/password so that you don't have to pass around the password all over the code - at least. Spring has oneprebuiltfor that as well.Other than that - consider migrate to SSL authentication instead and set the user on the channel through MCA - that might be easier to configure in JNDI.\n"} +{"text": "### Human: My script is,#!/bin/bash\n\nsu mqm\necho \"DISPLAY QLOCAL () CURDEPTH\" | runmqsc QUEUEMANAGERsame command works in putty but not through script.### Assistant: putty is interactive command line. Try the below. bash variables can be used.#!/bin/bash\nsu - mqm -c \"echo 'DISPLAY QLOCAL () CURDEPTH'|runmqsc QUEUEMANAGER\"\n"} +{"text": "### Human: What is the command(or process) for loading a xml file in a queue. I am using Websphere MQ6 in AIX. Thanks in advance.### Assistant: I suggest you modify a MQ Java sample (shipped with MQ) for this job. You will have to write piece of code to read the data in the XML file into a buffer and pass that buffer to MQQueue.Put method call.\n"} +{"text": "### Human: I am using Websphere java classes to implement jms in my application.Sender code :MQQueueConnectionFactory connectionFactory = new MQQueueConnectionFactory();\n connectionFactory.setHostName(environment.getProperty(MQ_CONNECTION_HOSTNAME));\n connectionFactory.setPort(Integer.parseInt(environment.getProperty(MQ_CONNECTION_PORT)));\n connectionFactory.setQueueManager(environment.getProperty(MQ_CONNECTION_QMANAGER));\n connectionFactory.setChannel(environment.getProperty(MQ_CONNECTION_CHANNEL));\n connectionFactory.setTransportType(1);\n final String username = environment.getProperty(MQ_CONNECTION_USERNAME);\n final String password = environment.getProperty(MQ_CONNECTION_PASSWORD);\n MQQueueConnection connection = null;\n if(username != null && username.trim().length() > 0 && password != null && password.trim().length() > 0) {\n connection = (MQQueueConnection) connectionFactory.createQueueConnection(username, password);\n }\n else {\n connection = (MQQueueConnection) connectionFactory.createQueueConnection();\n }\n senderSession = (MQQueueSession) connection.createQueueSession(true, Session.AUTO_ACKNOWLEDGE); \n MQQueue queue = (MQQueue) senderSession.createQueue(\"queue:///\" + environment.getProperty(MQ_CONNECTION_QUEUE));\n MQQueueSender sender = (MQQueueSender) senderSession.createSender(queue);\n JMSMessage message = (JMSMessage)senderSession.createTextMessage(messageContent);\n connection.start(); \n sender.send(message);\n message.acknowledge()Receiver Code :final MQQueueConnection connection = (MQQueueConnection) (useAuth ? connectionFactory.createQueueConnection(username, password) : connectionFactory.createQueueConnection());\n connection.start();\n final MQQueueSession receiverSession = (MQQueueSession) connection.createQueueSession(true, Session.CLIENT_ACKNOWLEDGE);\n final MQQueue queue = MQQueue)receiverSession.createQueue(queueName);\n MQQueueReceiver receiver = createReceiver(session, queue);\n receiver.setMessageListener(listener);When I send the message using these settings message listener never receives any message.\nBut when i open both the sessions with transacted as false, everything seems to work fine.\nI can understand the reason.I want to have transactional session.Let me know in case any other details are required### Assistant: If you want to use a local transaction (syncpoint) then after you send the message you need to commit it.\ni.e.senderSession.commit();\n"} +{"text": "### Human: I'm looking forward to implement a somewhat intelligent MQ comms module, which should be tolerant for the outages in the network connection. Basically it should try to reconnect each 5 seconds if connection was lost.The problem is the following. I use the following code for reading:queueMessage = new MQMessage();\n queueMessage.Format = MQC.MQFMT_STRING;\n queueGetMessageOptions = new MQGetMessageOptions();\n queueGetMessageOptions.Options = MQC.MQGMO_SYNCPOINT + MQC.MQGMO_WAIT + MQC.MQGMO_FAIL_IF_QUIESCING;\n queueGetMessageOptions.WaitInterval = 50;\n producerQueue.Get(queueMessage, queueGetMessageOptions);\n msg = queueMessage.ReadBytes(queueMessage.MessageLength);(Of course I successfully connect to the queuemanager before etc.)I got the following issue: when this routine runs, but at the time of.Getthere's no connection, the code simply hangs and stays in the.Get.\nI use a timer to see if there's a timeout (in theory even that shouldn't be necessary, is that right?) and at the timeout I try to reconnect. BUT when this timeout expires, I still see that the queuemanager reports that it's connected, while its clearly not (no physical connection is present anymore). This issue has popped up since I use SYNCPOINT, and I experience the same when I cut connection during writing, or in this case I try to force a Disconnect on the queuemanager. So please help, what settings shall I use to avoid getting stuck inGetandPutand rather have anMQExceptionthrown or something controllable? \nThanks!UPDATE: I used the following code to connect to the QueueManager.Hashtable props = new Hashtable();\nprops.Add(MQC.HOST_NAME_PROPERTY, Host);\nprops.Add(MQC.PORT_PROPERTY, Port);\nprops.Add(MQC.CHANNEL_PROPERTY, ChannelInfo);\nif(User!=\"\") props.Add(MQC.USER_ID_PROPERTY, User);\nif(Password!=\"\") props.Add(MQC.PASSWORD_PROPERTY, Password);\nprops.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\n\nqueueManager = new MQQueueManager(QueueManagerName, props);\nproducerQueue = queueManager.AccessQueue(\nProducerQueueName,\nMQC.MQOO_INPUT_AS_Q_DEF // open queue for input\n+ MQC.MQOO_FAIL_IF_QUIESCING); // but not if MQM stopping\nconsumerQueue = queueManager.AccessQueue(\nConsumerQueueName,\nMQC.MQOO_OUTPUT + MQC.MQOO_BROWSE + MQC.MQOO_INPUT_AS_Q_DEF // open queue for output\n+ MQC.MQOO_FAIL_IF_QUIESCING); // but not if MQM stoppingNeedless to say that normally the code works well. Read/Write, connect/disconnect works as it should, I only have to figure out the current issue.\nThanks!### Assistant: What version of MQ are you using? For automatic reconnection to work the queue manager need to be at least at MQ v701 and MQ .NET client needs to be a MQ v7.1 level.Assuming you are using MQ v7.1 .NET client, you need to specify reconnect option during connection create. You will need to enable reconnection by adding something like:props.Add(MQC.CONNECT_OPTIONS_PROPERTY, MQC.MQCNO_RECONNECT);Reconnection can be enabled/disabled from mqclient.ini file also.But what is surprising is why the Get/Put are hanging when there is no network connection. Hope you are not connecting a queue manager running on the same machine as your application. There is no need to set any timer or something like that. You can issue MQ calls and if there is anything wrong with connection, an exception will be thrown.Update:I think you are referring toIsConnectedproperty ofMQQueueManagerclass. The documentation says the value of this property: \"If true, a connection to the queue manager has been made, and is not known to be broken. Any calls to IsConnected do not actively attempt to reach the queue manager, so it is possible that physical connectivity can break, but IsConnected can still return true. The IsConnected state is only updated when activity, for example, putting a message, getting a message, is performed on the queue manager.\nIf false, a connection to the queue manager has not been made, or has been broken, or has been disconnected.\"As you can see aTruevalue does not mean the connection is still ON. My suggestion would be to call a method, Put/Get and handle any exception thrown.Put/Get/Disconnect calls hanging appears to be a problem. My suggestion would be raise a PMR with IBM.\n"} +{"text": "### Human: I am trying to validate if the WebsphereMQ feature (MQ Triggering) for remote execution of commands on z/OS can be achieved using ActiveMQ. Broadly, I think this will require custom java coding to leverage new frameworks/libs like JCICS (I think this needs CICS Tx Gateway v4.2).Broadly, need to validate the below steps :a) Install ActiveMQ on z/OSb) Write Java code to invoke the CKTI Task Initiator or Trigger Monitor in CICS to execute a command on z/OS using JCICS.I Need to validate the above and correct or add new steps.### Assistant: Why would you write Java code to invoke CKTI in order to start a CICS transaction? If your Java code is running, can't you use the issue() method ofStartRequestto start a CICS transaction?I think your design will turn out to be...message arrives on ActiveMQsend HTTP message to CICSURIMAP definition causes your JCICS code to be invokedJCICS code does a StartRequest.issue() to begin business logicSend a response to original HTTP message indicating success or failure of issue()\n"} +{"text": "### Human: I'm using a JMeter withJMS Point-to-Pointsampler, and I've a MQ queue with listener port2222(non standard1414). JMeter retrieves queue connection details from IBM WebSphere Application Sever by Provider URL, and connection factory class:com.ibm.websphere.naming.WsnInitialContextFactoryMy question is: How to define that port number in to JMeter plugin? Because I've got in \nJMeter logs messages about trying to create connection to1414?### Assistant: Try going to:Start by adding the sampler JMS Point-to-Point to the Point-to-Point\n element (Add --> Sampler --> JMS Point-to-Point). Then, select the JMS\n Point-to-Point sampler element in the tree.and than set the property:Provider URL tcp://$HOSTNAME:$PORT\n"} +{"text": "### Human: The question is aboutthe value of ccsid from QMGR. When doing this configuration, how many \nones can be used in total? How do i know what kind of ccsid i'm able to choose from? Is there any way to find it out?Thanks in advance### Assistant: Accordint go IBM WebSphere MQ 7.0 Infocenter, the following applies to queue manager option CCSID (Coded Charset ID):The coded character set identifier for the queue manager. The CCSID is the identifier used with all character string fields defined by the API. It does not apply to application data carried in the text of messages unless the CCSID in the message descriptor is set to the value MQCCSI_Q_MGR when the message is put to a queue.Specify a value in the range1 through 65 535. The CCSID must specify a value that is defined for use on your platform, and use a character set that is appropriate to the platform.I think the bold part answers the first part of your question (how many can be used), although it should be noted that you can only use one particular CCSID for your queue manager.You can only use CCSIDs valid for your platform (you did not mention which OS the queue manager is running on). SeeWebSphere MQ / Application Programming Reference / Code Page Conversionsfor a list of supported conversions on a platform of your choice.\n"} +{"text": "### Human: I have deployed my application on WebSphere and it is up and running and so are the queues associated with the application.When I put messages on the queue I do not see any processing in SystemOut.log file of the app server. This queue is supposed to process the message and then forward it to another queue.Please tell me which log file to check the processing of the message being done my application.### Assistant: A really simple verification would be to inhibit the consumption of the messages.\nThen your produced messages will stay in the queue.\n"} +{"text": "### Human: Are the WCF / .Net demos provided with IBM MQ still applicable if you use JMS with IBM MQ? Or do I need to write directly to JMS from .Net? (Very ignorant here if you couldn't tell). If I have to write to JMS directly then I guess i could use JNBridge or something.Any info is greatly appreciated.### Assistant: Yes, they still apply. You'll find that you have much better performance using a direct DLL for the server instead of a bridge, since the DLL directly implements the underlying messaging protocol for the server.\n"} +{"text": "### Human: I've handling some legacy applications running on WMB and am trying to work out how to find which main flows a particular subflow belongs to. Seems an obvious thing to be able to do but I can't seem to find it???? GrrrrI'm using Broker Application Development 6.0.2### Assistant: The toolkit does support the feature in v7 I think - you can use the Impact Analysis to identify this.I think there's a search string you can use... I used to have it saved somewhere. You basically want to search inside all of the .msgflow files as text / xml and find references to the name of your subflow file.\n"} +{"text": "### Human: Have been stuck with this problem for a few hours now, anyone any ideas?java.lang.NoSuchMethodError: com.ibm.mq.MQException.(Ljava/lang/String;Ljava/lang/String;II)V\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:223)\n at com.ibm.msg.client.wmq.internal.WMQMessageConsumer.checkJmqiCallSuccess(WMQMessageConsumer.java:123)\n at com.ibm.msg.client.wmq.internal.WMQConsumerShadow.getMsg(WMQConsumerShadow.java:1198)\n at com.ibm.msg.client.wmq.internal.WMQSyncConsumerShadow.receiveInternal(WMQSyncConsumerShadow.java:233)\n at com.ibm.msg.client.wmq.internal.WMQConsumerShadow.receive(WMQConsumerShadow.java:922)\n at com.ibm.msg.client.wmq.internal.WMQMessageConsumer.receive(WMQMessageConsumer.java:450)\n at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl.receiveInboundMessage(JmsMessageConsumerImpl.java:742)\n at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl.receive(JmsMessageConsumerImpl.java:423)\n at com.ibm.mq.jms.MQMessageConsumer.receive(MQMessageConsumer.java:258)Am getting this error when i put the message using MQ native libraries and i read them using JMS API's. The jms read fails throwing the exception above. I am also using jms Selector which seems to be causing the problem. with out the selector everything works fine. TIA.### Assistant: Finally i was able to resolve this, it all had to do with how the selector is created. The difference was that MQ API's have correlation id as bytes array where as JMS takes it as a string. Due to this the Selector was unable to select the message and was throwing the posted error. The error is not at all debug friendly hence had to do a lot of trial and error. Anyways now this works so i am glad. Below is the code change i had to do for this://String selector = \"JMSCorrelationID = '\" + corleationID + \"'\"; before changeStringBuffer fBuf = new StringBuffer(\"JMSCorrelationID = 'ID:\");\n byte[] correlBytes = corleationID.getBytes();\n for(int i=0; i<24; i++) {\n if (i>=correlBytes.length) {\n fBuf.append(\"00\");\n } else {\n byte b = correlBytes[i];\n String hexStr = Integer.toHexString(b);\n // -ve values produce 8 char results\n if (hexStr.length()>2) hexStr = hexStr.substring(hexStr.length()-2);\n // small values produce 1 char results\n if (hexStr.length()<2) fBuf.append(\"0\");\n fBuf.append(hexStr);\n }\n }\n fBuf.append(\"'\");\n String filter = fBuf.toString();\n System.out.println(\"creating receiver with filter: \"+filter);\n QueueReceiver queueReceiver = queueSession.createReceiver(inQueue,filter);// QueueReceiver queueReceiver = queueSession.createReceiver(inQueue, selector);Referred the code from IBM docs.\n"} +{"text": "### Human: here is my situation.I want to have a browse function for messages pending on a durable subscription which is using managed queues (so I can not access the subscription's queue directly).If this was a queue, I would simply use something likeremoteDestination = session.QueueManager.AccessQueue(\n remoteQueueName,\n MQC.MQOO_BROWSE // request browse mode\n + MQC.MQOO_FAIL_IF_QUIESCING // but not if MQM stopping\n + MQC.MQOO_INQUIRE // request inquire permissions to read stats\n );However, on a durablesub'd topic, there is no available BROWSE flagremoteDestination = session.QueueManager.AccessTopic(\n remoteTopicName,\n remoteTopicObject, \n MQC.MQOO_BROWSE //can not use an MQOO option here!!!\n + MQC.MQSO_CREATE // create the topic if not already created\n + MQC.MQSO_ANY_USERID // allow any user to reattach to this subscription in the future\n // otherwise, only the user who created the subscription can reattach\n + MQC.MQSO_ALTER // create (or reattach) to subscription requesting rights to make changes\n + MQC.MQSO_FAIL_IF_QUIESCING // if the server is shutting down, fail \n + MQC.MQSO_DURABLE // the subscription is durable\n + MQC.MQSO_MANAGED, // the queue manager will create consup\n \"\", // alternate user ID\n subscriptionName // name of the subscription\n );Sooooo, I am simply wondering if this is possible? I'm guessing there must be SOME way for an app to tell what and how many messages its about to consume from a durable subscription before it re-attaches!?Note that the purpose of all this is allow a service application to display to its interactive user all of the \"pending\" messages in its durable subscription in case of trouble shooting.Thank you in advance to anyone who can help out!Cheers,\nChris### Assistant: You can inquire on the subscription to obtain the name of the associated managed queue, then browse or inquire on that queue using normal methods. You are correct that there is no browse API for a durable subscription.\n"} +{"text": "### Human: So my Java process communicates with a remote queue. What happens is at the end of every day, the sender channel on the receiving end is in a stopped state. Is there a way to start up that channel in Java, before accessing the remote queue?### Assistant: I went ahead and found an answer. I have to define a trigger on the transmission queue that will start the sender channel.Here are some links that helped:Google SearchGoogle MQ User GroupIBM MQSeries Tutorial\n"} +{"text": "### Human: I've been looking for a good JMS introduction for the person who knows IBM MQ (MQSeries) very well. She is very experienced working with MQ-based systems on mainframe, but she asked me about the overview of the JMS to see how JMS relates to MQ and what is important when implementedin the application using JMS provided by MQ. Any URLs would be useful.### Assistant: Book:\nMQSeries Programming PatternsSome Tutorials:http://www.academictutorials.com/jms/jsm-mqseries.aspJMS/MQSeries Samples :http://www-304.ibm.com/jct01005c/isv/tech/sampmq.html#javaAn important issue while installing MQSerieshttp://www.simongbrown.com/blog/2003/11/27/setting_up_jms_with_websphere_mq.html\n"} +{"text": "### Human: We currently use LoadRunner for performance testing our web apps, but we also have some server side processes we need to test.Background:We call these processes our \"engines\". One engine receives messages by polling an IBM WebSpere MQ queue for messages. It takes a message off the queue, processes it, and puts the result on an outbound queue. We currently test this engine via a TCL script that reads a file that contains the messages, puts the messages on the inbound queue, then polls the outbound queue for the results.The other engine receives messages via a web service. The web service writes the message to a table in our database. The engine polls the database table for new messages, takes a message and processes it, and puts the result back into the database. We currently test this engine via a VBScript script that reads a file that contains the messages, sends the message to the web service, then keeps querying the web service for the result unitl it's ready.Question:We'd like to do away with the TCL and VBScript scripts and standardize on LoadRunner so that we have one tool to manage all our performance tests.I know LoadRunner supports a Web Services protocol \"out of the box\", but I'm not sure how to use it. Does anyone know of any examples of how to use LoadRunner to test a web service?Does LoadRunner have a protocol for MQ? Is it possible to use a LoadRunner Vuser to drive load (put messages) into an MQ queue? Would we need to purchase something from HP or some other vendor to do this?Thanks :)### Assistant: There is an add-in for LoadRunner in the incuded software to interface with MQ series and put the messages directly on the queue. Web services are fully supported also, and VBScript is supported too,perhaps using QTPro for the script and a GUI user in LoadRunner?\nColin.\n"} +{"text": "### Human: Using .NET 4.7.2, IBM WebSphere MQ Classes for .Net version 7.0.1.13 (amqmdnet.dll), and a DigiCert SSL, the last line of the following code issues\nerror 2012 \"MQRC_ENVIRONMENT_ERROR\" when attempting to connect to a remote MQ queue manager. I have verified the queue manager name, the CIPHER_SPEC, port, etc.var properties = new Hashtable\n {\n { MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED },\n { MQC.HOST_NAME_PROPERTY, \"hostname.com\" },\n { MQC.PORT_PROPERTY, \"1417\" },\n { MQC.CHANNEL_PROPERTY, \"12345678_SND.C1\" },\n { MQC.SSL_CIPHER_SPEC_PROPERTY, \"TLS_RSA_WITH_AES_256_CBC_SHA256\" },\n { MQC.SSL_CERT_STORE_PROPERTY, \"C:\\\\Temp\\\\my-ssl.pfx\" }\n };\n\n var queueManager = new MQQueueManager(\"QM\", properties);I believe I am at least connecting with the queue manager enough for it to issue an SSL error both when I don't specify an SSL_CIPHER_SPEC_PROPERTY:Remote CipherSpec error for channel '12345678_SND.C1'. The remote\nend of channel '12345678_SND.C1' has had a CipherSpec error. The\nchannel did not start. Review the error logs on the remote system to\ndiscover the problem with the CipherSpec.... and when I do specify an SSL_CIPHER_SPEC_PROPERTY but not an SSL_CERT_STORE_PROPERTY:The path and stem name for the SSL key repository have not been\nspecified. The directory path and file stem name for the SSL key\nrepository have not been specified. On a MQ client system there is no\ndefault location for this file. SSL connectivity is therefore\nimpossible as this file cannot be accessed. Use the MQSSLKEYR\nenvironment variable or MQCONNX API call to specify the directory path\nand file stem name for the SSL key repository.Am I wrong in assuming these errors are coming from the queue manager? If that's the case I believe I'm dealing with strictly an SSL error (wrong format, needs password, etc.). Any MQ from .Net help greatly appreciated!### Assistant: IBM MQ Managed .NET SSL is supported only from v8.0. If you need to use an older version you need to use unmanaged mode. But 7.0.1 is out of support. Use a latest version of the Client.\n"} +{"text": "### Human: Hi I am new to Jmeter and I am trying to use Jmeter to do some performance testing on IBM MQ docker.I have setup IBM MQ docker following this:https://developer.ibm.com/tutorials/mq-connect-app-queue-manager-containers/My apps can consume and publish to the broker so its working fine.I am trying out Jmeter for performance testing and I have setup the Jmeter(5.6.2) with the jmx file provided following the pdf guide.https://github.com/ibm-messaging/mqperf/tree/gh-pages/jmeterAfter running the GUI, it seems working fine.But when I run it in cli, it seem to be giving me errors. And the result seems weird by having more received msg than send. It could be due to retry but I am not sure. The following is the command I used:jmeter.bat -n -t \"C:\\Users\\alex\\Desktop\\all jmeter stuff\\jmeter test plan jmx files\\MQ-Sender-Receiver-Plan.jmx\" -l \"C:\\Users\\alex\\Desktop\\all jmeter stuff\\jmeter test plan jmx files\\results.jtl\" -j \"C:\\Users\\alex\\Desktop\\all jmeter stuff\\jmeter test plan jmx files\\log.jtl\"I have the cli logs here. Thanks in advance for any helps!2023-07-12 18:28:32,787 INFO o.a.j.u.JMeterUtils: Setting Locale to en_EN\n2023-07-12 18:28:32,799 INFO o.a.j.JMeter: Loading user properties from: user.properties\n2023-07-12 18:28:32,799 INFO o.a.j.JMeter: Loading system properties from: system.properties\n2023-07-12 18:28:32,804 INFO o.a.j.JMeter: Copyright (c) 1998-2023 The Apache Software Foundation\n2023-07-12 18:28:32,804 INFO o.a.j.JMeter: Version 5.6.2\n2023-07-12 18:28:32,804 INFO o.a.j.JMeter: java.version=11.0.19\n2023-07-12 18:28:32,804 INFO o.a.j.JMeter: java.vm.name=Java HotSpot(TM) 64-Bit Server VM\n2023-07-12 18:28:32,804 INFO o.a.j.JMeter: os.name=Windows 10\n2023-07-12 18:28:32,804 INFO o.a.j.JMeter: os.arch=amd64\n2023-07-12 18:28:32,804 INFO o.a.j.JMeter: os.version=10.0\n2023-07-12 18:28:32,813 INFO o.a.j.JMeter: file.encoding=Cp1252\n2023-07-12 18:28:32,813 INFO o.a.j.JMeter: java.awt.headless=true\n2023-07-12 18:28:32,813 INFO o.a.j.JMeter: Max memory =4294967296\n2023-07-12 18:28:32,813 INFO o.a.j.JMeter: Available Processors =12\n2023-07-12 18:28:32,818 INFO o.a.j.JMeter: Default Locale=English (EN)\n2023-07-12 18:28:32,818 INFO o.a.j.JMeter: JMeter Locale=English (EN)\n2023-07-12 18:28:32,818 INFO o.a.j.JMeter: JMeterHome=C:\\Users\\alex\\Desktop\\all jmeter stuff\\apache-jmeter-5.6.2\n2023-07-12 18:28:32,818 INFO o.a.j.JMeter: user.dir =C:\\Users\\alex\\Desktop\\all jmeter stuff\\apache-jmeter-5.6.2\\bin\n2023-07-12 18:28:32,818 INFO o.a.j.JMeter: PWD =C:\\Users\\alex\\Desktop\\all jmeter stuff\\apache-jmeter-5.6.2\\bin\n2023-07-12 18:28:32,819 INFO o.a.j.JMeter: IP: 202.188.100.169 Name: P_IFSLT2650 FullName: parkview-100-169.tm.net.my\n2023-07-12 18:28:32,828 INFO o.a.j.s.FileServer: Default base='C:\\Users\\alex\\Desktop\\all jmeter stuff\\apache-jmeter-5.6.2\\bin'\n2023-07-12 18:28:32,829 INFO o.a.j.s.FileServer: Set new base='C:\\Users\\alex\\Desktop\\all jmeter stuff\\jmeter test plan jmx files'\n2023-07-12 18:28:32,926 INFO o.a.j.s.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2\n2023-07-12 18:28:32,941 INFO o.a.j.s.SaveService: Using SaveService properties version 5.0\n2023-07-12 18:28:32,944 INFO o.a.j.s.SaveService: Using SaveService properties file encoding UTF-8\n2023-07-12 18:28:32,946 INFO o.a.j.s.SaveService: Loading file: C:\\Users\\alex\\Desktop\\all jmeter stuff\\jmeter test plan jmx files\\MQ-Sender-Receiver-Plan_no_diode - Copy.jmx\n2023-07-12 18:28:33,010 INFO o.a.j.JMeter: Creating summariser \n2023-07-12 18:28:33,020 INFO o.a.j.e.StandardJMeterEngine: Running the test!\n2023-07-12 18:28:33,021 INFO o.a.j.s.SampleEvent: List of sample_variables: []\n2023-07-12 18:28:33,021 INFO o.a.j.s.SampleEvent: List of sample_variables: []\n2023-07-12 18:28:33,028 INFO o.a.j.e.u.CompoundVariable: Note: Function class names must contain the string: '.functions.'\n2023-07-12 18:28:33,028 INFO o.a.j.e.u.CompoundVariable: Note: Function class names must not contain the string: '.gui.'\n2023-07-12 18:28:33,225 INFO o.a.j.t.TestPlan: added C:\\Users\\alex\\Desktop\\all jmeter stuff\\apache-jmeter-5.6.2\\lib\\mqjars\\com.ibm.mq.allclient.jar to classpath\n2023-07-12 18:28:33,225 INFO o.a.j.t.TestPlan: added C:\\Users\\alex\\Desktop\\all jmeter stuff\\apache-jmeter-5.6.2\\lib\\mqjars\\jms.jar to classpath\n2023-07-12 18:28:33,226 INFO o.a.j.t.TestPlan: added C:\\Users\\alex\\Desktop\\all jmeter stuff\\apache-jmeter-5.6.2\\lib\\mqjars\\org.json.jar to classpath\n2023-07-12 18:28:33,434 INFO o.a.j.JMeter: Running test (1689157713434)\n2023-07-12 18:28:33,435 INFO o.a.j.e.StandardJMeterEngine: Starting setUp thread groups\n2023-07-12 18:28:33,435 INFO o.a.j.e.StandardJMeterEngine: Starting setUp ThreadGroup: 1 : setUp Thread Group (Sender Connections) \n2023-07-12 18:28:33,435 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group setUp Thread Group (Sender Connections).\n2023-07-12 18:28:33,435 INFO o.a.j.e.StandardJMeterEngine: Test will stop abruptly on error\n2023-07-12 18:28:33,435 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 delayedStart=false\n2023-07-12 18:28:33,438 INFO o.a.j.t.ThreadGroup: Started thread group number 1\n2023-07-12 18:28:33,438 INFO o.a.j.e.StandardJMeterEngine: Starting setUp ThreadGroup: 2 : setUp Thread Group (Receiver Connections) \n2023-07-12 18:28:33,438 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group setUp Thread Group (Receiver Connections).\n2023-07-12 18:28:33,438 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error\n2023-07-12 18:28:33,438 INFO o.a.j.t.ThreadGroup: Starting thread group... number=2 threads=1 ramp-up=1 delayedStart=false\n2023-07-12 18:28:33,440 INFO o.a.j.t.ThreadGroup: Started thread group number 2\n2023-07-12 18:28:33,441 INFO o.a.j.e.StandardJMeterEngine: Waiting for all setup thread groups to exit\n2023-07-12 18:28:33,444 INFO o.a.j.t.JMeterThread: Thread started: setUp Thread Group (Receiver Connections) 2-1\n2023-07-12 18:28:33,444 INFO o.a.j.t.JMeterThread: Thread started: setUp Thread Group (Sender Connections) 1-1\n2023-07-12 18:28:33,446 INFO o.a.j.s.SampleResult: Note: Sample TimeStamps are START times\n2023-07-12 18:28:33,446 INFO o.a.j.s.SampleResult: sampleresult.default.encoding is set to UTF-8\n2023-07-12 18:28:33,446 INFO o.a.j.s.SampleResult: sampleresult.useNanoTime=true\n2023-07-12 18:28:33,446 INFO o.a.j.s.SampleResult: sampleresult.nanoThreadSleep=5000\n2023-07-12 18:28:34,740 INFO o.a.j.p.j.s.J.Create Sender Connections to Queue Manager: ####### Sender connection #0 to queue manager QM1 established.\n2023-07-12 18:28:34,740 INFO o.a.j.p.j.s.J.Create Receiver Connections to Queue Manager: ####### Receiver connection #0 to queue manager QM1 established.\n2023-07-12 18:28:34,752 INFO o.a.j.t.JMeterThread: Thread is done: setUp Thread Group (Sender Connections) 1-1\n2023-07-12 18:28:34,752 INFO o.a.j.t.JMeterThread: Thread finished: setUp Thread Group (Sender Connections) 1-1\n2023-07-12 18:28:34,753 INFO o.a.j.r.Summariser: summary + 1 in 00:00:01 = 0.8/s Avg: 1303 Min: 1303 Max: 1303 Err: 0 (0.00%) Active: 1 Started: 2 Finished: 1\n2023-07-12 18:28:34,753 INFO o.a.j.t.JMeterThread: Thread is done: setUp Thread Group (Receiver Connections) 2-1\n2023-07-12 18:28:34,753 INFO o.a.j.t.JMeterThread: Thread finished: setUp Thread Group (Receiver Connections) 2-1\n2023-07-12 18:28:34,754 INFO o.a.j.e.StandardJMeterEngine: All Setup Threads have ended\n2023-07-12 18:28:34,770 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Senders\n2023-07-12 18:28:34,770 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Senders.\n2023-07-12 18:28:34,770 INFO o.a.j.e.StandardJMeterEngine: Test will stop abruptly on error\n2023-07-12 18:28:34,770 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 delayedStart=false\n2023-07-12 18:28:34,771 INFO o.a.j.t.ThreadGroup: Started thread group number 1\n2023-07-12 18:28:34,771 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 2 : Receivers\n2023-07-12 18:28:34,771 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Receivers.\n2023-07-12 18:28:34,771 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error\n2023-07-12 18:28:34,771 INFO o.a.j.t.ThreadGroup: Starting thread group... number=2 threads=1 ramp-up=1 delayedStart=false\n2023-07-12 18:28:34,772 INFO o.a.j.t.JMeterThread: Thread started: Senders 1-1\n2023-07-12 18:28:34,772 INFO o.a.j.t.ThreadGroup: Started thread group number 2\n2023-07-12 18:28:34,772 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started\n2023-07-12 18:28:34,773 INFO o.a.j.t.JMeterThread: Thread started: Receivers 2-1\n2023-07-12 18:29:00,002 INFO o.a.j.r.Summariser: summary + 4986 in 00:00:25 = 197.5/s Avg: 2 Min: 1 Max: 1303 Err: 0 (0.00%) Active: 2 Started: 2 Finished: 0\n2023-07-12 18:29:00,003 INFO o.a.j.r.Summariser: summary = 4987 in 00:00:27 = 187.7/s Avg: 3 Min: 1 Max: 1303 Err: 0 (0.00%)\n2023-07-12 18:29:30,002 INFO o.a.j.r.Summariser: summary + 6000 in 00:00:30 = 200.0/s Avg: 2 Min: 1 Max: 9 Err: 0 (0.00%) Active: 2 Started: 2 Finished: 0\n2023-07-12 18:29:30,003 INFO o.a.j.r.Summariser: summary = 10987 in 00:00:57 = 194.2/s Avg: 2 Min: 1 Max: 1303 Err: 0 (0.00%)\n2023-07-12 18:29:34,771 INFO o.a.j.t.JMeterThread: Stopping because end time detected by thread: Senders 1-1\n2023-07-12 18:29:34,772 INFO o.a.j.t.JMeterThread: Thread finished: Senders 1-1\n2023-07-12 18:29:39,809 INFO o.a.j.p.j.s.J.Receive Messages: ############ consumer.receive timed out (timeout value: 5000)\n2023-07-12 18:29:44,823 INFO o.a.j.p.j.s.J.Receive Messages: ############ consumer.receive timed out (timeout value: 5000)\n2023-07-12 18:29:49,837 INFO o.a.j.p.j.s.J.Receive Messages: ############ consumer.receive timed out (timeout value: 5000)\n2023-07-12 18:29:54,852 INFO o.a.j.p.j.s.J.Receive Messages: ############ consumer.receive timed out (timeout value: 5000)\n2023-07-12 18:29:59,870 INFO o.a.j.p.j.s.J.Receive Messages: ############ consumer.receive timed out (timeout value: 5000)\n2023-07-12 18:30:04,886 INFO o.a.j.p.j.s.J.Receive Messages: ############ consumer.receive timed out (timeout value: 5000)\n2023-07-12 18:30:04,886 INFO o.a.j.r.Summariser: summary + 961 in 00:00:35 = 27.5/s Avg: 33 Min: 1 Max: 5031 Err: 6 (0.62%) Active: 1 Started: 2 Finished: 1\n2023-07-12 18:30:04,888 INFO o.a.j.r.Summariser: summary = 11948 in 00:01:31 = 130.6/s Avg: 5 Min: 1 Max: 5031 Err: 6 (0.05%)\n2023-07-12 18:30:09,903 INFO o.a.j.p.j.s.J.Receive Messages: ############ consumer.receive timed out (timeout value: 5000)\n2023-07-12 18:30:14,915 INFO o.a.j.p.j.s.J.Receive Messages: ############ consumer.receive timed out (timeout value: 5000)\n2023-07-12 18:30:19,929 INFO o.a.j.p.j.s.J.Receive Messages: ############ consumer.receive timed out (timeout value: 5000)\n2023-07-12 18:30:24,946 INFO o.a.j.p.j.s.J.Receive Messages: ############ consumer.receive timed out (timeout value: 5000)\n2023-07-12 18:30:29,961 INFO o.a.j.p.j.s.J.Receive Messages: ############ consumer.receive timed out (timeout value: 5000)\n2023-07-12 18:30:34,982 INFO o.a.j.p.j.s.J.Receive Messages: ############ consumer.receive timed out (timeout value: 5000)\n2023-07-12 18:30:34,983 INFO o.a.j.r.Summariser: summary + 6 in 00:00:30 = 0.2/s Avg: 5015 Min: 5012 Max: 5020 Err: 6 (100.00%) Active: 1 Started: 2 Finished: 1\n2023-07-12 18:30:34,984 INFO o.a.j.r.Summariser: summary = 11954 in 00:02:02 = 98.3/s Avg: 7 Min: 1 Max: 5031 Err: 12 (0.10%)\n2023-07-12 18:30:34,985 INFO o.a.j.t.JMeterThread: Stopping because end time detected by thread: Receivers 2-1\n2023-07-12 18:30:34,986 INFO o.a.j.t.JMeterThread: Thread finished: Receivers 2-1\n2023-07-12 18:30:34,986 INFO o.a.j.e.StandardJMeterEngine: Starting tearDown thread groups\n2023-07-12 18:30:34,986 INFO o.a.j.e.StandardJMeterEngine: Starting tearDown ThreadGroup: 1 : tearDown Thread Group (Sender Connections)\n2023-07-12 18:30:34,986 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group tearDown Thread Group (Sender Connections).\n2023-07-12 18:30:34,986 INFO o.a.j.e.StandardJMeterEngine: Test will stop abruptly on error\n2023-07-12 18:30:34,987 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 delayedStart=false\n2023-07-12 18:30:34,989 INFO o.a.j.t.ThreadGroup: Started thread group number 1\n2023-07-12 18:30:34,989 INFO o.a.j.e.StandardJMeterEngine: Starting tearDown ThreadGroup: 2 : tearDown Thread Group (Receiver Connections)\n2023-07-12 18:30:34,989 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group tearDown Thread Group (Receiver Connections).\n2023-07-12 18:30:34,990 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error\n2023-07-12 18:30:34,990 INFO o.a.j.t.ThreadGroup: Starting thread group... number=2 threads=1 ramp-up=1 delayedStart=false\n2023-07-12 18:30:34,990 INFO o.a.j.t.JMeterThread: Thread started: tearDown Thread Group (Sender Connections) 1-1\n2023-07-12 18:30:34,991 INFO o.a.j.t.ThreadGroup: Started thread group number 2\n2023-07-12 18:30:34,991 INFO o.a.j.t.JMeterThread: Thread started: tearDown Thread Group (Receiver Connections) 2-1\n2023-07-12 18:30:35,042 INFO o.a.j.p.j.s.J.Close Receiver Connections: ###### Receiver Connection Closed\n2023-07-12 18:30:35,042 INFO o.a.j.p.j.s.J.Close Sender Connections: ###### Sender Connection closed\n2023-07-12 18:30:35,043 INFO o.a.j.t.JMeterThread: Thread is done: tearDown Thread Group (Sender Connections) 1-1\n2023-07-12 18:30:35,043 INFO o.a.j.t.JMeterThread: Thread is done: tearDown Thread Group (Receiver Connections) 2-1\n2023-07-12 18:30:35,043 INFO o.a.j.t.JMeterThread: Thread finished: tearDown Thread Group (Sender Connections) 1-1\n2023-07-12 18:30:35,043 INFO o.a.j.t.JMeterThread: Thread finished: tearDown Thread Group (Receiver Connections) 2-1\n2023-07-12 18:30:35,043 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test\n2023-07-12 18:30:35,048 INFO o.a.j.r.Summariser: summary + 2 in 00:00:00 = 30.8/s Avg: 50 Min: 49 Max: 51 Err: 0 (0.00%) Active: 0 Started: 2 Finished: 2\n2023-07-12 18:30:35,049 INFO o.a.j.r.Summariser: summary = 11956 in 00:02:02 = 98.3/s Avg: 7 Min: 1 Max: 5031 Err: 12 (0.10%)### Assistant: Looking into the code:def consumer=vars.getObject(\"Consumer\");\ndef session=vars.getObject(\"ReceiverSession\")\n \ndef msg = consumer.receive(\"${receive_timeout}\" as Integer) \n\nif(msg!=null) {\n if(\"${transacted}\".equals(\"true\")) session.commit()\n \n log.debug(\"########### Message Received\"+msg)\n\n SampleResult.setResponseData(msg.toString())\n SampleResult.setDataType(org.apache.jmeter.samplers.SampleResult.TEXT)\n} else {\n log.info(\"############ consumer.receive timed out (timeout value: \" + \"${receive_timeout}\" + \")\")\n //Mark timeout as 'error' to enable filtering out in listeners (to just analyse successful receive rate etc)\n SampleResult.setSuccessful(false)\n}it appears that you will get the following error:############ consumer.receive timed out (timeout value: 5000)when the receiver thread fails to retrieve the message withing 5 seconds timeout.So first thing I would check is yourMQ broker container logsIn generalJMeter in non-GUI mode has much better performance than in GUI modeso it might be the case it just overloads your MQ broker instance and it cannot properly respond on message receive requests.Apart from checking the logs you can additionally ensure that the broker has enough headroom to operate in terms of CPU, RAM, Network, Disk, etc. It can be done using container monitoring solution likedocker statsorJMeter PerfMon Plugin. If this is the case you might need to increasecontainer limitsorDocker engine\n"} +{"text": "### Human: I am doing seedstack ibm mq configuration through yaml fileBut i am not able to find any paramter related message commitBecause ibm mq needs to commit it.As it is message is pending@JmsMessageListener(connection = \"connection1\", destinationName = \"${queue.myqueue}\", destinationType = DestinationType.QUEUE)\npublic class MyMessageListener implements javax.jms.MessageListener {\n private static final Logger LOGGER = LogManager.getLogger();\n\n @Override\n @Transactional\n public void onMessage(Message message) {\n try {\n if (message instanceof TextMessage) {\n try {\n TextMessage textMessage = (TextMessage) message; \n final String messageInXML = textMessage.getText();### Assistant: I am not sure how much the yaml configuration is doing for you, but if the messages are pending then the connection is transactional and a commit or rollback needs to happen.You don't share any yaml or java code, but what ever you have isn't performing neither a commit nor a rollback by default, which is odd. I would expect a rollback should an uncaught exception be thrown, with a default action of commit on connection close.Looking at Seedstack documentation it seems that a normal pattern is for a session to be injected, and neither connection nor session ever closed. Which in turn indicates that you may need to perform a commit in your code.If you have code that looks like:@Inject\n private Session session;\n\n @Override\n @Transactional\n @JmsConnection(\"connection1\")\n public void sendMessage() {\n Destination queue = session.createQueue(\"queue1\");\n MessageProducer producer = session.createProducer(queue);\n TextMessage message = session.createTextMessage();\n message.setText(stringMessage);\n producer.send(message);\n }My initial thoughts are that the annotation@Transactionalshould run a commit by default on exit of the method, but if it isn't then the commit needs to be on the session:@Inject\n private Session session;\n\n @Override\n @Transactional\n @JmsConnection(\"connection1\")\n public void sendMessage() {\n Destination queue = session.createQueue(\"queue1\");\n MessageProducer producer = session.createProducer(queue);\n TextMessage message = session.createTextMessage();\n message.setText(stringMessage);\n producer.send(message);\n session.commit();\n }\n"} +{"text": "### Human: I installed wmq.jmsra Resource adapter to Payara 5.2022.5 application server. I created a connector connection pool../asadmin create-connector-connection-pool --raname wmq.jmsra --connectiondefinition javax.jms.ConnectionFactory --transactionsupport XATransaction --property transportType=CLIENT:queueManager=QMANAGER:hostName=HOSTIP:port=PORT:channel=CHANNEL:username=USER:password=PASSWORD:applicationName=APPNAME wmq.jmsra-pool\n\n./asadmin create-connector-resource --poolname wmq.jmsra-pool jms/JmsConnectionFactoryEverything was working, I was debugging the application via remote. Time to time, I redeploy my application which uses the connection pool. All of a sudden, Payara started to throw the following exception. It was interesting because 5 minutes before it worked.I restart queue manager, removed pool definition, undeployed wmq.jmsra and configured it all over again. Nothing is changed. Restarted the domain.It says it can't find the com.ibm.mq.jmqi.remote.api.RemoteFAP class however I can see it in the jmqi jar file of the wmq.jmsra application that is deployed.Later I restarted everything, even my local computer, and worked but started to fail after a while.Do anyone have similar issues?[2023-06-07T12:46:33.739+0300] [Payara 5.2022.5] [SEVERE] [] [] [tid: _ThreadID=346 _ThreadName=Thread-39] [timeMillis: 1686131193739] [levelValue: 1000] [[\n com.ibm.msg.client.jms.DetailedJMSException: MQJCA1011: Failed to allocate a JMS connection.\nAn internal error caused an attempt to allocate a connection to fail.\nSee the linked exception for details of the failure.\n at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:184)\n at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:135)\n at com.ibm.mq.connector.outbound.ConnectionFactoryImpl.createManagedJMSConnection(ConnectionFactoryImpl.java:402)\n at com.ibm.mq.connector.outbound.ConnectionFactoryImpl.createConnectionInternal(ConnectionFactoryImpl.java:252)\n at com.ibm.mq.connector.outbound.ConnectionFactoryImpl.createConnection(ConnectionFactoryImpl.java:225)\n at com.ibm.mq.connector.outbound.ConnectionFactoryImpl.createConnection(ConnectionFactoryImpl.java:201)\n at com.heirloomcomputing.ecs.mqi.jms.module.StandardJMSModule.createConnection(StandardJMSModule.java:206)\n at com.heirloomcomputing.ecs.mqi.jms.module.StandardJMSModule.obtainConnection(StandardJMSModule.java:437)\n at com.heirloomcomputing.ecs.mqi.jms.JMSConnectionManager.mqConnect(JMSConnectionManager.java:61)\n at com.heirloomcomputing.ecs.mqi.MQIConnectionManagerAbstract.createConnection(MQIConnectionManagerAbstract.java:221)\n at com.heirloomcomputing.ecs.mqi.MQIConnectionManagerAbstract.mqConnect(MQIConnectionManagerAbstract.java:280)\n ......\n at com.heirloomcomputing.etp.transaction.services.IntervalControl$1.run(IntervalControl.java:390)\nCaused by: com.sun.appserv.connectors.internal.api.PoolingException: MQJCA1011: Failed to allocate a JMS connection., error code: MQJCA1011\n at com.sun.enterprise.resource.pool.datastructure.RWLockDataStructure.addResource(RWLockDataStructure.java:108)\n at com.sun.enterprise.resource.pool.ConnectionPool.addResource(ConnectionPool.java:288)\n at com.sun.enterprise.resource.pool.ConnectionPool.createResourceAndAddToPool(ConnectionPool.java:1532)\n at com.sun.enterprise.resource.pool.ConnectionPool.createResources(ConnectionPool.java:957)\n at com.sun.enterprise.resource.pool.ConnectionPool.initPool(ConnectionPool.java:236)\n at com.sun.enterprise.resource.pool.ConnectionPool.internalGetResource(ConnectionPool.java:527)\n at com.sun.enterprise.resource.pool.ConnectionPool.getResource(ConnectionPool.java:388)\n at com.sun.enterprise.resource.pool.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:244)\n at com.sun.enterprise.resource.pool.PoolManagerImpl.getResource(PoolManagerImpl.java:171)\n at com.sun.enterprise.connectors.ConnectionManagerImpl.getResource(ConnectionManagerImpl.java:354)\n at com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:307)\n at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:196)\n at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:171)\n at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:166)\n at com.ibm.mq.connector.outbound.ConnectionFactoryImpl.createManagedJMSConnection(ConnectionFactoryImpl.java:309)\n ... 22 more\nCaused by: com.sun.appserv.connectors.internal.api.PoolingException: MQJCA1011: Failed to allocate a JMS connection., error code: MQJCA1011\n at com.sun.enterprise.resource.pool.ConnectionPool.createSingleResource(ConnectionPool.java:932)\n at com.sun.enterprise.resource.pool.ConnectionPool.createResource(ConnectionPool.java:1209)\n at com.sun.enterprise.resource.pool.datastructure.RWLockDataStructure.addResource(RWLockDataStructure.java:100)\n ... 36 more\nCaused by: com.sun.appserv.connectors.internal.api.PoolingException: MQJCA1011: Failed to allocate a JMS connection., error code: MQJCA1011\n at com.sun.enterprise.resource.allocator.ConnectorAllocator.createResource(ConnectorAllocator.java:184)\n at com.sun.enterprise.resource.pool.ConnectionPool.createSingleResource(ConnectionPool.java:919)\n ... 38 more\nCaused by: com.ibm.mq.connector.DetailedResourceException: MQJCA1011: Failed to allocate a JMS connection., error code: MQJCA1011 An internal error caused an attempt to allocate a connection to fail. See the linked exception for details of the failure.\n at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:169)\n at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:135)\n at com.ibm.mq.connector.ConnectionBuilder.createConnection(ConnectionBuilder.java:162)\n at com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl.createConnection(ManagedConnectionFactoryImpl.java:655)\n at com.ibm.mq.connector.outbound.ManagedConnectionImpl.(ManagedConnectionImpl.java:212)\n at com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl.createManagedConnection(ManagedConnectionFactoryImpl.java:248)\n at com.sun.enterprise.resource.allocator.ConnectorAllocator.createResource(ConnectorAllocator.java:164)\n ... 39 more\nCaused by: com.ibm.msg.client.jms.DetailedJMSException: JMSFMQ6312: An exception occurred in the Java(tm) MQI.\nThe Java(tm) MQI has thrown an exception describing the problem. \nSee the linked exception for further information.\n at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\n at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)\n at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\n at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)\n at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)\n at com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:334)\n at com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:226)\n at com.ibm.msg.client.wmq.factories.WMQXAConnectionFactory.createV7ProviderConnection(WMQXAConnectionFactory.java:172)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:8023)\n at com.ibm.msg.client.wmq.factories.WMQXAConnectionFactory.createProviderXAConnection(WMQXAConnectionFactory.java:98)\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createXAConnectionInternal(JmsConnectionFactoryImpl.java:385)\n at com.ibm.mq.jms.MQXAConnectionFactory.createXAConnection(MQXAConnectionFactory.java:137)\n at com.ibm.mq.connector.ConnectionBuilder.createConnection(ConnectionBuilder.java:134)\n ... 43 more\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2195;AMQ9546: Error return code received. [1=java.lang.NoSuchMethodException[com.ibm.mq.jmqi.remote.api.RemoteFAP.(com.ibm.mq.jmqi.JmqiEnvironment,int)],3=Class.getConstructor0]\n at com.ibm.mq.jmqi.JmqiEnvironment.getInstance(JmqiEnvironment.java:855)\n at com.ibm.mq.jmqi.JmqiEnvironment.getMQI(JmqiEnvironment.java:699)\n at com.ibm.msg.client.wmq.factories.WMQXAConnectionFactory.createV7ProviderConnection(WMQXAConnectionFactory.java:164)\n ... 48 more\nCaused by: java.lang.NoSuchMethodException: com.ibm.mq.jmqi.remote.api.RemoteFAP.(com.ibm.mq.jmqi.JmqiEnvironment,int)\n at java.base/java.lang.Class.getConstructor0(Class.java:3585)\n at java.base/java.lang.Class.getConstructor(Class.java:2271)\n at com.ibm.mq.jmqi.JmqiEnvironment.getInstance(JmqiEnvironment.java:761)\n ... 50 more\n]]I am trying to create JMS connection pool with wmq.jmsra resource adapter at Payara 5.### Assistant: This error occurs if MQ jar's are embedded into the application in addition to having installed them to the application server.\n"} +{"text": "### Human: We successfully use IBMMQDotnetClient in out .NET application to connect with IBM MQ 7.5. The application runs as a specific user (for example, \"ibm_mq_manager_user\") on a Windows server or a developer's Windows desktop. The .NET code snippet is:var queueManagerOptions = new Hashtable {\n { MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED },\n { MQC.HOST_NAME_PROPERTY, _settings.HostName },\n { MQC.CHANNEL_PROPERTY, _settings.ChannelName },\n { MQC.PORT_PROPERTY, _settings.Port }\n};\nvar mqQueueManager = new MQQueueManager(_settings.QueueManagerName, queueManagerOptions);We are moving the application to a Linux server where it runs as another user. The code produces an errorMQRC_Q_MGR_NOT_AVAILABLE.I guess, I should specify the user \"ibm_mq_manager_user\" in queueManagerOptions. However, the next change causes an errorMQRC_NOT_AUTHORIZEDeven on a developer's Windows desktop when the application runs as another user:var queueManagerOptions = new Hashtable {\n { MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED },\n { MQC.HOST_NAME_PROPERTY, _settings.HostName },\n { MQC.CHANNEL_PROPERTY, _settings.ChannelName },\n { MQC.PORT_PROPERTY, _settings.Port },\n { MQC.USER_ID_PROPERTY, \"ibm_mq_manager_user\" } // the change\n};\nvar mqQueueManager = new MQQueueManager(_settings.QueueManagerName, queueManagerOptions);What should I do to successfully connect to the IBM MQ Manager in the application that runs as another user than \"ibm_mq_manager_user\" (change Windows authentication to login/password authentication)?### Assistant: The code produces an errorMQRC_Q_MGR_NOT_AVAILABLE.That reason code means that either the queue manager is not running or you are using the wrong hostname (IP address) or port number.the next change causes an errorMQRC_NOT_AUTHORIZEDeven on a developer's Windows desktop when the application runs as another user:Putting the UserId & Password in the connection parameters is ONLY used for authentication.For .NET application, authorization (not authentication) is performed against the UserId that the application is running under.If you want the queue manager to use the UserId that you set in the connection properties, then you MUST change ADOPTCTX to YES.You should read the following IBM MQ pages:https://www.ibm.com/docs/en/ibm-mq/latest?topic=authentication-connection-configurationhttps://www.ibm.com/docs/en/ibm-mq/latest?topic=records-interaction-chlauth-connauth\n"} +{"text": "### Human: I am usinghttps://github.com/ibm-messaging/mq-containerto start IBM MQ on local dev machine. Here is my docker-compose:version: '2'\n\nservices:\n ibmmq:\n image: icr.io/ibm-messaging/mq:9.3.2.1-r1\n volumes:\n - ./config.mqsc:/etc/mqm/config.mqsc\n environment:\n - LICENSE=accept\n - MQ_QMGR_NAME=QM1\n - MQ_ADMIN_PASSWORD=passw0rd\n ports:\n - 1414:1414\n - 9443:9443Now, I am trying to connect to it using JMSToolBox without success:Logs from mq-container:ibmmq-ibmmq-1 | 2023-05-16T08:19:51.019Z AMQ9722W: Plain text communication is enabled.\nibmmq-ibmmq-1 | 2023-05-16T08:19:51.042Z AMQ5806I: Queued Publish/Subscribe Daemon started for queue manager QM1. [CommentInsert1(QM1)]\nibmmq-ibmmq-1 | 2023-05-16T08:19:56.432Z AMQ8077W: Entity 'admin' has insufficient authority to access object QM1 [qmgr]. [CommentInsert1(admin), CommentInsert2(QM1 [qmgr]), CommentInsert3(connect)]\nibmmq-ibmmq-1 | 2023-05-16T08:19:56.432Z AMQ9557E: Queue Manager User ID initialization failed for 'mqm'. [ArithInsert1(2), ArithInsert2(2035), CommentInsert1(mqm), CommentInsert2(admin), CommentInsert3(admin)]What I am doing wrong? How to send a message to MQ using JMSToolBox?Note:\nI took those settings from default Spring Boot configurationhttps://github.com/ibm-messaging/mq-jms-spring/blob/master/mq-jms-spring-boot-starter/src/main/java/com/ibm/mq/spring/boot/MQConfigurationProperties.javabecause my@JmsListener(which I want to test sending a message to it) connects to this queue perfectly fine.### Assistant: As mentionned before, you need to useDEV.APP.SVRCONNchannelAny reason you are using com.ibm.mq.cfg.useIBMCipherMappings=true?For my own connection, MQ v9.2.4 is deployed in OpenShift and I use in JTB:channel: DEV.APP.SVRCONN\nqueueManager: \ncom.ibm.mq.cfg.useIBMCipherMappings: false\nsslCipherSuite: TLS_RSA_WITH_AES_256_CBC_SHA256At the console, give some rights to the user used by JTB (\"app\"):-> Manage > Queues \n-> SYSTEM.ADMIN.COMMAND.QUEUE, View Configuration > Security \n -> Add+, add user \"app\" +Admin acces \n-> SYSTEM.DEFAULT.MODEL.QUEUE\n -> Add+, add user \"app\" +Admin acces(I'm the author of JMSToolBox)\n"} +{"text": "### Human: We are migrating some queues to allow a new consumer to read the messages\nWe have the following setup in a cluster\n2 Full repos QMF1 and QMF2 with a Queue Alias (QAF)\n2 Partial repos QMB1 and QMB2 with a Cluster Queue Local (QLB)Message from APP1 put messages to the QAF queues with a target of QLB, application APP2 consumes the messages from QLB.Routes then areAPP1 -> QAF (QMF1) -> QLB (QMB1) -> APP2\nAPP1 -> QAF (QMF1) -> QLB (QMB2) -> APP2\nAPP1 -> QAF (QMF2) -> QLB (QMB1) -> APP2\nAPP1 -> QAF (QMF2) -> QLB (QMB2) -> APP2In order to achieve the migration without changing the Applications configuration we have introduced a new Partial QMGR QMN1 and additional Cluster Queue Alias QAN with a non-Clustered QLB, this allows the QAF TARGET to be changed from QLB to QANRoutes ideally isAPP1 -> QAF (QMF1) -> QAN (QMN1) -> QLB (QMN1) -> APP3Initial low volume test can see this is working OK, however when looking at the queues available to QMN1 we have the following\nQMGR QMN1 hasQLB on QMN1, Local queue\nQLB on QMB1, cluster queue \nQLB on QMB2, cluster queueIs this now going to be an issue when volume of traffic is introduced, will it be possible for the below scenarios to also workAPP1 -> QAN (QMN1) -> QLB (QMB1) -> APP2\nAPP1 -> QAN (QMN1) -> QLB (QMB2) -> APP2### Assistant: When opening a queue, a matching local, non-clustered queue is selected ahead of any clustered queues.In the configuration described, this means that messages sent to QMN1 with a target queue name of QLB will be put to the local queue instance and the clustered queues will not be considered.Reference:https://www.ibm.com/docs/en/ibm-mq/9.3?topic=call-name-resolution\n"} +{"text": "### Human: Spring supplies a testing framework to simulate at least in some part the actual calling of implemented web services, one such approach is using MockMvc. Similarly, if I needed to simulate a Postgres database, I can do an in memory H2 database, ignoring various idiosyncracies that sometimes come up.If my resource is not a database, but a Websphere MQ endpoint, would an ApacheMQ be a good test? At the moment, I'm not striving for performance, but want to know the overall framework is good. If all I did was switch from a Spring test profile to a the non-test, the main code would work.### Assistant: You can stand up a developer edition MQ queue manager. There are several options, but a container would be the easiest to set-up. Seehttps://developer.ibm.com/series/mq-ready-set-connect/for how, and other options.\n"} +{"text": "### Human: I am on a Mac Silicon machine, and am getting aAMQ8146E: IBM MQ queue manager not availableerror when I try to userunmqsc.I have installed the MacOS toolkit for MQ fromhttps://ibm.biz/mqdevmacclientand updated PATH and DYLD_LIBRARY_PATH.I have obtained a JSON CCDT.I have downloaded a qmgrcert_yyyymm.pem file.I have created the .kdb keystore and imported the queue manager certificate.I have made sure thatMQSERVERisnotset.I have set and exportedMQCCDTURLandMQSSLKEYRbut when I runrunmqsc -c -u mid -w 60 QM1I get theAMQ8146Eerror.I see this is the queue manager logs ------ amqrmrsa.c : 631 --------------------------------------------------------\n03/07/2023 04:03:32 PM - Process(637.10948) User(mqm) Program(amqrmppa)\n Host(qm-...............-ibm-mq-0) Installation(Installation1)\n VRMF(9.3.1.0) QMgr(QM1)\n Time(2023-03-07T16:03:32.933Z)\n RemoteHost(10.74.8.95)\n ArithInsert1(420)\n CommentInsert1(CLOUD.ADMIN.SVRCONN)\n CommentInsert2(gsk_secure_soc_read)\n CommentInsert3(10-74-8-95 (10.74.8.95))\n \nAMQ9665E: SSL connection closed by remote end of channel 'CLOUD.ADMIN.SVRCONN'.\n\nEXPLANATION:\nThe SSL or TLS connection was closed by the remote host '10-74-8-95\n(10.74.8.95)' during the secure socket handshake. The channel is\n'CLOUD.ADMIN.SVRCONN'; in some cases its name cannot be determined and so is\nshown as '????'. The channel did not start.\nACTION:\nCheck the remote end of the channel for SSL and TLS errors. Fix them and\nrestart the channel.\n----- amqccisa.c : 12150 ------------------------------------------------------\n03/07/2023 04:03:32 PM - Process(637.10948) User(mqm) Program(amqrmppa)\n Host(qm-...............-ibm-mq-0) Installation(Installation1)\n VRMF(9.3.1.0) QMgr(QM1)\n Time(2023-03-07T16:03:32.933Z)\n CommentInsert1(CLOUD.ADMIN.SVRCONN)\n CommentInsert2(637)\n CommentInsert3(10.74.8.95)\n \nAMQ9999E: Channel 'CLOUD.ADMIN.SVRCONN' to host '10.74.8.95' ended abnormally.\n\nEXPLANATION:\nThe channel program running under process ID 637 for channel\n'CLOUD.ADMIN.SVRCONN' ended abnormally. The host name is '10.74.8.95'; in some\ncases the host name cannot be determined and so is shown as '????'.\nACTION:\nLook at previous error messages for the channel program in the error logs to\ndetermine the cause of the failure. Note that this message can be excluded\ncompletely or suppressed by tuning the \"ExcludeMessage\" or \"SuppressMessage\"\nattributes under the \"QMErrorLog\" stanza in qm.ini. Further information can be\nfound in the System Administration Guide.### Assistant: The README says: when running on Apple Silicon processors, the IBM MQ MacOS Toolkit utilises OpenSSL to provide TLS services.In this case you just need to switch from.kdbto.PEMformat.If you are working with an MQ on Cloud instance, the default for the certificate download is.PEMformat. To userunmqscin client mode, you would then exportMQCCDTURLandMQSSLKEYRe.g.,export MQSSLKEYR=/qmgrcert_yyyymm.pemTake a look at theREADME.Clientfile in/opt/mqm/for more info on how to convert other certificate types to.PEMformat.\n"} +{"text": "### Human: We use IBM MQ for some integration between various micro services. The applications are quite critical and we aim for zero down times. We have a cluster of three Queue Managers each one running on a different server (on a separate AWS availability zones) sayQM1 on sever1, QM2 on server2 and QM3 on server3.We configure threeConnectionFactorylike below (note the connection name list differences):var connectionFactory1 = new MQQueueConnectionFactory();\nconnectionFactory1.setConnectionNameList(\"server1,server2,server3\");\nconectionFactory1.setPort(1414);\n....\nvar connectionFactory2 = new MQQueueConnectionFactory();\nconnectionFactory2.setConnectionNameList(\"server2,server3,server1\");\nconectionFactory2.setPort(1414);\n....\nvar connectionFactory3 = new MQQueueConnectionFactory();\nconnectionFactory3.setConnectionNameList(\"server3,server1,server2\");\nconectionFactory3.setPort(1414);\n....The idea behind this setup is to be able to utilize all the three Queue Managers at the same time. The first connection factory will consume fromQM1, the second connection factory will consume fromQM2, and so on.From time to time the servers running IBM Queue Managers need to be patched and restarted. When this happens, obviously the queue managers needs to be shut down.\nWhile a Queue Manager is down all the traffic is redirected through the other two Queue Managers in the cluster so the flow of the messages never stops.Whileserver1is down:connectionFactory1switches toserver2,server3so consuming fromQM2connectionFactory2switches toserver2,server3so consuming fromQM2connectionFactory3switches toserver3,server2so consuming fromQM3After patching server1 we start QM1.The issue we have is that the three connection factories stay switched as above without reconnecting toQM1at all. The only one way we were able to restore the desired state was by restarting the application which is not really a good/acceptable solution.In our client code we implemented some resiliency patterns to find out when the QM1 comes back up and resetconnectionFactory1(springCachingConnectionFactorywrapped aroundMQQueueConnectionFactory) as well as stopping and started all listener containers consuming for that QM1 as prefered queue manager but this had no effect. The only way we could do it was to actually restart Spring Application Context but this is similar to actually restarting the application. And when you have many such applications this is really not a good solution.I noticed thatMQQueueConnectionFactoryhas a methodsetClientReconnectOptions(int options) throws javax.jms.JMSExceptionbut reading the comment of that method did not make it very clear to me if that can be used for what we want.Thank you in advance for your inputs.### Assistant: Reconnect options are for re-making the connection after a failure. It will not affect re-making the connection just because the set of connections is unbalanced.For more about reconnectable clients, seeReconnectable clientsin the IBM Docs.This is not an easy problem to solve from inside the application because it does not know about the whole environment. That is why IBM MQ now has a feature called Uniform Clusters with Application Rebalancing which does EXACTLY this. When you start up the recycled queue manager, the cluster (which has a picture of the whole set of client connected applications) notices the imbalance and tells some of the applications to go elsewhere. It utilises the client application ability to reconnect as per the above options, but the driver to move to another queue manager comes from the queue manager it is currently connected to, rather than being determined by the client.The Uniform Clusters feature and Application Balancing were added in IBM MQ V9.1.2 and enhanced in several of the subsequent CD releases. The first LTS release to provide it would therefore be IBM MQ V9.2.0.For more about Uniform Clusters, seeAbout uniform clustersin the IBM Docs.\n"} +{"text": "### Human: In my project, I am using apache camel + ibm mq + spring boot for messaging. I am getting a compile time err which I am not able to resolve.com.ibm.mq.jms.MQConnectionFactory mqQueueConnectionFactoy = new MQQueueConnectionFactory();\n// set all the properties to above mqQueueConnectionFactoy such as queue manager etc.\nCachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory(mqQueueConnectionFactoy);Now on the second line I am getting this err:Now on the second line I am getting this err:\n'CachingConnectionFactory(jakarta.jms.ConnectionFactory)' in 'org.springframework.jms.connection.CachingConnectionFactory' cannot be applied to '(com.ibm.mq.jms.MQConnectionFactory)'I have googled a lot but not able to find any such example. Any help would be appreciate. My build.gradle has below dependencies.// Camel\n implementation 'org.apache.camel.springboot:camel-spring-boot-starter:4.0.0-M1'\n implementation('org.apache.camel.springboot:camel-servlet-starter:4.0.0-M1')\n implementation('org.apache.camel.springboot:camel-jaxb-starter:4.0.0-M1')\n implementation(\"org.apache.camel:camel-jms:4.0.0-M1\")\n implementation(\"org.apache.camel:camel-core:4.0.0-M1\")\n\n // IBM MQ\n implementation(\"javax.jms:javax.jms-api:2.0.1\")\n implementation(\"com.ibm.mq:com.ibm.mq.allclient:9.1.0.5\")\n implementation(\"com.ibm.ims:udb:15.1.31\")\n implementation(\"javax.xml.bind:jaxb-api:2.4.0-b180830.0359\")### Assistant: You will need to replace yourcom.ibm.mq.allclientdependency withcom.ibm.mq.jakarta.clientand replacejavax.jms-api:2.0.1withjakarta.jms-apiAlahttps://www.ibm.com/docs/en/ibm-mq/9.3?topic=umcjm-obtaining-mq-classes-jms-mq-classes-jakarta-messaging-separatelySeehttps://mvnrepository.com/artifact/com.ibm.mq/com.ibm.mq.jakarta.clientandhttps://mvnrepository.com/artifact/jakarta.jms/jakarta.jms-apifor latest versions.\n"} +{"text": "### Human: ContextI am new to IBM MQ. I am trying to understand why a Consumer is Nack'ing a message. It's worth mentioning that I don't have direct access to the consumer.The problem I am trying to solveIn particular, one of the consumers is Nack'ing a message and putting it back to the Queue. But I am unable to know where to find the reason the message was not acknowledged. Where should I expect this (exception?) to be logged?I am happy to provide further details if needed.### Assistant: There are rare circumstances where the Queue Manager rolls back transactions (all I can think of is to release log space or when it terminated unexpectedly). By far the largest number of cases it is the consuming application which rolls back the transaction, and I believe this is what you also assume when you say it would not acknowledge the message.\nTo answer the question: get the logs of this application!\n"} +{"text": "### Human: I'm currently trying to build a messaging application using JMS Listener and IBM MQ, and I need to ensure that I can run two instances of the same listener at the same time. However, I want to make sure that the second instance waits until the first instance has fully processed and acknowledged the message.\nI'm using Spring Boot for my application, JMS Listener and IBM MQ.Below is the my config class which is annotated with @component and @EnableJMSpublic class jmsconfig{\n\n @Bean\n public MQConnectionfactory getConnectionFactory(){\n MQConnectionFactory connectionFactory = new MQConnectionFactory();\n connectionFactory.setQueueManagerName(\"AA\");\n connectionFactory.setExpirationTimeOut(3600000);\n connectionFactory.setPerformExpiration(true);\n connectionFactory.setPerformValidation(true);\n connectionFactory.setPerformOptimalSizeCheck(false);\n connectionFactory.setValidationTimeOut(180000);\n connectionFactory.setMinIdle(3);\n connectionFactory.setMaxIdle(5);\n reurn connectionFactory ;\n }\n \n @Bean(name=\"jmsListenerContainerFactory\")\n public JmsListenerContainerFactory jmsListenerContainerFactory(MQConnectionfactory mqConnectionfactory){\n DefaultJmsListenerContainerFactory containerFactory = new DefaultJmsListenerContainerFactory();\n containerFactory.setConnectionFactor(mqConnectionfactory);\n containerFactory.setSessionTransacted(true);\n containerFactory.setSessionAcknowledgementMode(Session.CLIENT_ACKNOWLEDE)\n reurn containerFactory ;\n }\n \n}Listener code:@Component\n public class Receiver {\n \n public sttaic int count = 0;\n \n @JmsListener(destination = \"${inwardQueueName}\", containerFactory = \"jmsListenerContainerFactory\")\n public void receiveMessage(javax.jms.Message message) throws javax.jms.JMSException {\n String messagetxt = \"\";\n OrderObject order = null;\n if (message instanceof javax.jms.TextMessage) {\n messagetxt = ((TextMessage)message).getText();\n OrderObject order = //code to covert messagetxt to object\n System.out.println(\"Message pciked up with Order Id : \" +order.getOrderId)\n TimeUnit.SECONDS.sleep(15);\n count++;\n if(order.getOrderId==1){\n if(count<=4){\n throw new Exception(\"Exception occurred\");\n }\n }\n }\n TimeUnit.SECONDS.sleep(15);\n System.out.println(\"Message Acknowledged for orderId: \" +order.getOrderId)\n message.acknowledge();\n }\n }I start the first instance and pushes first message to MQ with orderId 1. It prints the below statement and then waits for 15 secondsMessage picked up with Order Id : 1Immediately, I start the second instance and then pushes second message to MQ with orderId 2. I can see the below output on the console.Message picked up withorderId 2\nMessage Acknowledged for orderId: 2After some time, when the first instance completes(since there is a wait of 15 sec), I can see the below output.Message pciked up with Order Id : 1\nMessage pciked up with Order Id : 1\nMessage pciked up with Order Id : 1\nMessage Acknowledged for orderId: 1With the above output, the Second instance is picking up second message from the MQ in parallel and process them while the first instance is still processing the first message.Can anyone help with what is wrong with the above implementation?### Assistant: Based on your description it looks like message 2 shouldn't be processed until the actions needed for message 1 have completed, once they have then it doesn't matter which listener works on message 2. Sequencing is key and not which listener does the processing.To do this, message 2 needs to be tied into message 1.One way would be for the producer app not to place message 2 on the queue until the processing for message 1 has been approved.Another way would be to tie message 2 with message 1 (maybe via specific queues or via properties, or via priority, or a permutation of these) such that they are always read as a pair and as part of a transaction.IE.Start TransactionEnsure both messages are read together, making sure that some other process, or listener can't or doesn't see message 2. Only the@JMSListenerthat receives message 1 would know how to obtain message 2, which it does using normal JMS Get logic.Process message 1Process message 2Commit, so both messages can be removed.You could commit between message 1 & 2, but if there is a failure, how do you detect that message 1 was processed so you can process message 2. Logic to start processing from message 2 gets very complicated if you commit here.\n"} +{"text": "### Human: I am getting below error when I am executingsetmqauton IBM-MQ queue managerbash-4.4$ setmqaut -m QM1 -t qmgr -p mqadmin +connect\nAMQ7026E: A principal or group name was invalid.### Assistant: The error basically returns that MQ was not able to find user 'mqadmin'. Please check the queue manager CONNAUTH value for the configured authentication method. If the default 'SYSTEM.DEFAULT.AUTHINFO.IDPWOS' is used then check within the machine to see if the user 'mqadmin' is available. If you are using LDAP for authentication then check if that 'mqadmin' is available on ldap server and MQ is able to contact ldap server.\n"} +{"text": "### Human: issue: connecting with spring boot to ibmmq , working ibmmq on dockor version 9.1.5-r2in online environment: connecting is enabled ,all is fine.in offline environment channel name is not recognized, getting channel unknown error - 'MQRC_UNKNOWN_CHANNEL_NAME'channel name DEV.ADMIN.SVRCONN2 questions:why offline is different and how it can be fixed?connected to container with docker exec, how can i find the actual channel name of the queue manager.Thanks.### Assistant: To find the channel name:shell into the containerset the environment by runningsetmqenvSeehttps://www.ibm.com/docs/en/ibm-mq/latest?topic=reference-setmqenv-set-mq-environmentrunrunmqscIn therunmqscprompt rundisplay channel (*)Seehttps://www.ibm.com/docs/en/ibm-mq/latest?topic=reference-display-channel-display-channel-definitionAlternatively, you could just log into the MQ Console on https://localhost:9443/ibmmq/console\nand list the system channels.If you are using the IBM MQ Advanced for Developers image fromicr.io/ibm-messaging/mq:latestthen the channelsDEV.APP.SVRCONNandDEV.ADMIN.SVRCONNwill have been created for you. Apps will normally useDEV.APP.SVRCONNIf you have built the image locally based on instructions fromhttps://github.com/ibm-messaging/mq-container/blob/master/docs/building.mdthen you need to have runmake build-devserver. If you ranmake build-advancedserverthen the defaultDEVchannels will not have been created.\n"} +{"text": "### Human: I have IBM App Connect Enterprice Toolkit on my Win 10 machine. Works OK.But now I need to use IBM MQ queues. And that seems to need some MQ libraries installed on my setup.How can I install those missing libraries?There probably is a installation package, but I just cant find one.### Assistant: The main link you want ishttps://developer.ibm.com/articles/mq-downloads/, which will lead you tohttps://developer.ibm.com/tutorials/mq-connect-app-queue-manager-windows/which will lead you tohttps://ibm.biz/mqdevwindowsThe final one is the download, but I'd recommend going through the steps in the second link for help on how to get it all set up.\n"} +{"text": "### Human: I was following IBM tutorial \"Getting Started with IBM App Connect Enterprise 12\". (https://www.youtube.com/watch?v=6sj2FR31PQM&t=1006s)Great tutor, as IBM videos are. BUT :\"BIP2684E\" : A component was configured to use IBM MQ, but required MQ libraries are not available.I have MQ broker running locally in docker container (IBM dev image) and ACE toolkit with MQ-policy.What do I need to do to have those missing libraries ?Required libraries for IBM ACE Toolkit (server) to be able to connect to IBM MQ server ? Please ??I have googled couple of hours and all I can find from IBM documentations is how to configure this and that.But \"missing libraries\" ?!!?!### Assistant: You need to install MQ to use features that connect to MQ:https://www.ibm.com/docs/en/app-connect/12.0?topic=messages-interaction-between-app-connect-enterprise-mq\n"} +{"text": "### Human: Effectively, I need to monitor a queue and swap over its consumer to a stub when the actual consumer is disconnected for a length of time. I think I can get by by just seeing what IP addresses are connected to the queue in question. I've gone through the documentation but can't see how to do that in pymqi.CheersA method that tells me the status of a queue including IP addresses### Assistant: It's possible but not that simple.The MQSC commands that would give you that level of admin information would be something like \"DISPLAY QSTATUS(qname) TYPE(HANDLE)\". Which could be converted into PCF messges that could then be sent, and the response parsed, using pymqi. Working with PCF is not the easiest thing but it can be done.Alternatively, you could use the REST API if that's enabled on the qmgr - REST can be done from just about any language environment or even scripted with curl.Depending on what you really need, then perhaps simply doing an MQINQ to getMQIA_OPEN_INPUT/OUTPUT_COUNTvalues would be sufficient. You can then just see if anyone has the queue open.\n"} +{"text": "### Human: Attempts to connect to IBM MQ queues.Below is the code responsible for creating the connection:ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;\nIConnection connectionMQ;\n\nfactoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\nIConnectionFactory cf = factoryFactory.CreateConnectionFactory();\n\ncf.SetStringProperty(XMSC.WMQ_HOST_NAME, \"host\");\ncf.SetIntProperty(XMSC.WMQ_PORT, port);\ncf.SetStringProperty(XMSC.WMQ_CHANNEL, \"channel\");\ncf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);\ncf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, \"queueManager\"); \ncf.SetStringProperty(XMSC.WMQ_SSL_PEER_NAME, \"sslPeerName\"); \ncf.SetStringProperty(XMSC.WMQ_SSL_CIPHER_SPEC, \"TLS_RSA_WITH_AES_256_CBC_SHA256\"); \ncf.SetStringProperty(XMSC.WMQ_CCSID, \"ccSid\");\ncf.SetStringProperty(XMSC.WMQ_SSL_KEY_REPOSITORY, \"*USER\");\ncf.SetStringProperty(XMSC.WMQ_SSL_CLIENT_CERT_LABEL, \"clientCertLabel\");\n\nconnectionMQ = cf.CreateConnection();Error visible on the server side:AMQ9631E: The CipherSpec negotiated during the SSL handshake does not\nmatch the required CipherSpec for channel 'channel'.EXPLANATION: There is a mismatch between the CipherSpecs on the local\nand remote ends of channel 'channel'. The channel will not run until\nthis mismatch is resolved. The CipherSpec required in the local\nchannel definition is 'TLS_RSA_WITH_AES_256_CBC_SHA256'. The name of\nthe CipherSpec negotiated during the SSL handshake is\n'TLS_RSA_WITH_AES_256_GCM_SHA384'. A code is displayed if the name of\nthe negotiated CipherSpec cannot be determined. ACTION: Change the\nchannel definitions for 'channel' so the two ends have matching\nCipherSpecs and restart the channel. When using the 'ANY' type\nCipherSpecs ensure that the Client CipherSpec value would meet the\nrequirements for the 'TLS_RSA_WITH_AES_256_CBC_SHA256' CipherSpec set\non the channel 'channel'. If the client is set to use the 'ANY' type\nCipherSpecs then the TLS handshake may use a higher protocol than is\nallowed by the channel channel definition CipherSpec. If the\ncertificate in use by one end of the channel is a Global Server\nCertificate, then the negotiated CipherSpec may not match that\nspecified on either end of the channel. This is because the SSL\nprotocol allows a Global Server Certificate to automatically negotiate\na higher level of encryption. In these cases specify a CipherSpec\nwhich meets the requirements of the Global Server Certificate.Why, despite the fact that via .net I pass TLS_RSA_WITH_AES_256_CBC_SHA256, you can see TLS_RSA_WITH_AES_256_GCM_SHA384 in the server-side logs?Client is on redhat.### Assistant: For IBM MQ/XMS .NET Clients, the Cipher Set at the application level is used to determine the TLS version only.Client Running on Windows:IBM MQ/XMS .NET client rely on the Microsoft's SSLStreams for SSL Communication.To set a preferred Cipher the Windows Group Policy has to be enabled and edited to use a specific Cipher. After it is enabled and edited the machine has to be restarted to pickup the changes. Please note that the change in the Windows Group Policy is applicable to all the applications running on the Machine.Following KC page has more information on ithttps://www.ibm.com/docs/en/ibm-mq/9.1?topic=client-cipherspec-support-managed-netFor a client running on LinuxOn Linux .NET uses openssl for SSL Communications, so to set the CipherSpec preferences the Openssl config file has to be edited\n"} +{"text": "### Human: I'm wondering what is the best way to replace and old ibm batch java application:In fact , I have a java application which contains basically two classes and can be started using two shell files; a shell to send and message and another one to consume messages present in the Queue.sendMessage.ksh => start the application and calls send method in the SendMessage class.\nreceiveMessage.ksh => start the application and calls receive method in the ReceiveMessage class.these two shells are scheduled.I want to use a spring boot application with MQ V9 but I don't know how to process sending and retrieving messages in the best way ? with REST endpoints ? @jmsListener ?Thanks.### Assistant: For Spring you will be using Spring-JMS, so step 1 will be to familiarise yourself with Spring-JMS.To use IBM MQ you will need to set the JMS dependency tomq-jms-spring-boot-starter, for how and which attribute properties to set, see the documentation athttps://github.com/ibm-messaging/mq-jms-springFor usage samples seehttps://github.com/ibm-messaging/mq-dev-patterns/tree/master/Spring-JMSThe 101 sample has the minimal code needed to get a schedule based producer and consumer running.\n"} +{"text": "### Human: I am very new to JMS & JNDI, and I'm trying to receive message from a queue programatically, but I am not sure how I can connect to the server. I have Websphere console UI where I login to manage all my queues. This console UI is hosted atlinux-server:7276. Below is the UI linkhttps://my-server:9043/ibm/consoleI have referred to the sample classes from IBM MQJmsJndiConsumer:String contextFactory = \"com.sun.jndi.ldap.LdapCtxFactory\";\nString initialContextUrl = \"ldap://my-server:9043\"\nHashtable environment = new Hashtable();\nenvironment.put(Context.INITIAL_CONTEXT_FACTORY, contextFactory);\nenvironment.put(Context.PROVIDER_URL, initialContextUrl);\nenvironment.put(Context.SECURITY_PRINCIPAL, userName);\nenvironment.put(Context.SECURITY_CREDENTIALS, password); \nInitialContext context = new InitialContext(environment);It always throws an error in the contextConnection or outbound has closed.The queue I am trying to connect to has these details:Connection factories : jms/atConnectionFactory\nqueue-manager : appit-node.Sit-TBus\nBus name : TBus\nqueue name : jms/appitone-event\nBootstrap Member : linux-server:7276### Assistant: You're usingmy-server:9043forbothyour HTTPS and LDAP server. Both of these can't be using the same port on the same machine so one of them must be wrong which is almost certainly why it's failing.\n"} +{"text": "### Human: I've created a queue manager namedTEST1and in this queue manager i've created a channel namedTEST1for server connection SVRCONN. My channel is created successfully but channel does not able to start.When i tried to start the channel using MQ explorer is shows channel is starting but it doesn't start.Kindly help me on this. I've also checks queue manager logs but doesn't found any useful.### Assistant: A SVRCONN only runs when you connect a client application to it. It will not go into Running state from a START CHANNEL command. The START CHANNEL command is only needed if it was STOPPED by another command and you needed to undo that and put it back into a state where it is able to run when an application connects.To test this out, set an environment variable as follows:-set MQSERVER=TEST/TCP/localhost(port-of-your-listener)then run the following IBM Supplied sample application:-amqsputc SYSTEM.DEFAULT.LOCAL.QUEUE TEST1this application will wait for you to type in something to become the message text. While it is waiting, the application is connected to the queue manager and you should see the SVRCONN channel in Running status.In order to see the channel in Running Status your application must stay connected. If you run the application, and let it complete, and thus close the connection, before you look at the channel status you will not see anything.Try the example above just to prove to yourself that your SVRCONN does go into Running status, and then go back to your own application to see what the difference is. Is it short running? Is it definitely using the client connection and not local bindings?\n"} +{"text": "### Human: I want to change MaxChannels value, it is inside the qm.ini file. Is there any option with helm variable or do i need to rebuild image?### Assistant: If you are using the IBM sample Helm Chart availablehere, you can specify a qm.ini within a Kubernetes configMap and then reference this as part of the Helm deployment. Each of the samples already reference a qm.ini which you can use as an example. The qm.ini is created within a ConfigMaphere, and referencedhere.\n"} +{"text": "### Human: I am trying to implement read ahead functionality for my client. They get a bunch of messages from IBM MQ Queues. Trying to read multiple messages at a time since they are non-persistent messages. I am unable to call the setReadAhead method provided by MQDestination.I tried finding any alternate way of doing this, but looks like no one uses ibm mq that much. Maybe I am doing it wrong. Using version ibm 9.1, and currently without the commented line in the code it reads messages one at a time.Any help is appreciated!Thanksvoid initMQConnection(String queueName) throws JMSException {\n MQQueueConnectionFactory factory = new MQQueueConnectionFactory();\n factory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);\n factory.setQueueManager(jms_property.getProperty(queueManager));\n factory.setHostName(jms_property.getProperty(host));\n factory.setPort(jms_property.getProperty(port));\n factory.setChannel(jms_property.getProperty(channel));\n\n QueueConnection qConn = factory.createQueueConnection(username, password);\n\n QueueSession session = qConn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\n Destination destination = session.createQueue(queueName);\n\n ((MQDestination) destination).setReadAheadAllowed(); // --> Unable to use this method (Cannot Resolve Method)\n\n MessageConsumer mc = session.createConsumer(destination);\n qConn.start();\n }In the code where I am using messageConsumer, I callmc.recieve(1000);### Assistant: You can read/get only one message at a time, not multiple messages.The read ahead feature enables underlyingMQ client library to receive multiple non-persistent messages and buffer in it's memory. This is done to avoid MQ client making calls over the network to MQ server to receive one message at a time. The received messages are buffered in the MQ client memory and delivered one at a time to client application when a consumer.receive() call is made. Read more here on Read Ahead:https://www.ibm.com/docs/en/ibm-mq/9.3?topic=application-using-read-ahead-in-clientReadAhead is a IBM MQ speicific function. You will need to cast the JMS Destination to MQQueue type. For example:((MQQueue) destination).setReadAheadAllowed();I don't see what packages have been imported, it appears thatcom.ibm.mq.MQDestinationhas been imported.setReadAheadAllowedis not a member ofcom.ibm.mq.MQDestinationclass. Instead it is a member ofcom.ibm.mq.jms.MQDestinationclass.\n"} +{"text": "### Human: I have a queue with a huge message throughput. I would like to create new queue for lower environments. This new queue shouldn't be a 1-to-1 copy since it is going to cost too much. I would like to copy every nth (e.g. 5th) message to the copied queue. Can this be done?### Assistant: There is the new feature called \u201cstreaming queues\u201d introduced with MQ V. 9.2.3 / 9.3.0. It allows you to let each message which is put to a specific queue duplicated to another queue (the stream queue). To configure it you would need to set two new parameters of your original target queue: STREAMQ( ) to specify the stream queue and STRMQOS( ) to decide for the quality of service (refer to the doc).Though, to achieve your requirement (\u201cevery nth message\u201d), your application which processes the messages of the stream queue would need to only work with the data of every nth message and delete the rest, if you really want to process only a subset of them.I know this is not a perfect answer to your question, as this solution comes with redundant queuing of messages you don\u2019t want, but I am not aware of any other out-of-the-box solution.\n"} +{"text": "### Human: I am writing a .NET Console application, our goal is keep a message on the queue and read the message. the message header should contain User Name & Password. I try to pass the Message with below code it is not working.hashTable.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);\n hashTable.Add(MQC.HOST_NAME_PROPERTY, strServerName);\n hashTable.Add(MQC.CHANNEL_PROPERTY, strChannelName);\n hashTable.Add(MQC.PORT_PROPERTY, 1414); \n hashTable.Add(MQC.USER_ID_PROPERTY, \"XXXXXX\");\n hashTable.Add(MQC.PASSWORD_PROPERTY, \"XXXXXX\");\n hashTable.Add(MQC.USE_MQCSP_AUTHENTICATION_PROPERTY, true); \n queueManager = new MQQueueManager(strQueueManagerName,hashTable); \n queue = queueManager.AccessQueue(requestQueue, MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING);\n requestMessage = new MQMessage(); \n \n requestMessage.WriteString(StrAPICMessage);\n requestMessage.Format = MQC.MQFMT_STRING;\n requestMessage.MessageType = MQC.MQMT_REQUEST;\n requestMessage.Report = MQC.MQRO_COPY_MSG_ID_TO_CORREL_ID;\n requestMessage.ReplyToQueueName = responseQueue;\n requestMessage.ReplyToQueueManagerName = strQueueManagerName;\n queuePutMessageOptions = new MQPutMessageOptions();\n queue.Put(requestMessage, queuePutMessageOptions);In the Message Descriptor it is taking the default value mentioned MQ Server. it is not takeing my UserName \"XXXXX\"I have tried using the CSICS Bridge header also unable to send the message with my application Service account + Password.\nhelp me on this scenario.### Assistant: See \"MQCSP authentication mode\" here:https://www.ibm.com/docs/en/ibm-mq/latest?topic=authentication-connection-java-clientIt says:In this mode, the client-side user ID is sent as well as the user ID and password to be authenticated, so you are able to use ADOPTCTX(NO). The user ID and password are available to a server-connection security exit in the MQCSP structure that is provided in the MQCXP structure.\"client-side user ID\" means the UserId that the application is running under. Therefore, if you are authenticating with a different UserId than the one that the application is running under.Therefore, you (or your MQAdmin) will need to change ADOPTCTX to YES.\n"} +{"text": "### Human: I had written a java code to consume messages from IBM MQ.. but while executing the code some times only one message is getting consumed and the process is stopping .. some times no messages are not getting consumed at all.. i had written an asynchronous connection using setMessageListener() but i am not sure where the program is getting wrong. The below codepublic class MQConnectivity implements MessageListener {\n \n MQQueueConnectionFactory factory = new MQQueueConnectionFactory();\n QueueConnection con;\n Queue queue;\n QueueSession session;\n QueueReceiver receiver;\n \n public void init() {\n try {\n factory.setHostName(\"******\");\n factory.setPort(123);\n factory.setChannel(\"Channel1\");\n factory.setQueueManager(\"queue_manager\");\n factory.setTransportType(new Integer(WMQConstants.WMQ_CM_CLIENT));\n con=factory.createQueueConnection(\"user1\",\" password1\");\n queue= new MQQueue(\"myQueue\");\n session=con.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\n receiver=session.createReceiver(queue);\n receiver.setMessageListener(this);\n System.out.println(\"=======connection happened=========\");\n con.start();\n System.out.println(\"=======connection started=========\");\n }catch(Exception ex) {\n System.out.println(\"exception is : \"+ex);\n }\n }\n public static void main(String[] args) {\n // TODO Auto-generated method stub\n new MQConnectivity().init();\n\n }\n @Override\n public void onMessage(Message msg) {\n // TODO Auto-generated method stub\n try {\n System.out.println(\"Inside onMessage method\");\n TextMessage txtMsg=(TextMessage)msg;\n System.out.println(txtMsg.getText());\n }catch(Exception ex) {\n System.out.println(\"error in onMessage\"+ex);\n }\n }\n\n}### Assistant: I can see two problems in your code.There is no connection.Start() method call after setting message listener. Without calling connection.Start method, message delivery will not start. I wonder how application received message(s) without Start().Your application is exiting immediately after\"System.out.println(\"=======connection happened=========\");\".Since onMessage method gets called on a separate thread, you need to make your main thread wait till message processing is complete.Tweak your applications to something like://... other code\n\n receiver.setMessageListener(this);\n con.start();\n System.out.println(\"=======connection happened=========\");\n // Wait for a key to be hit.\n System.in.read();Hope this helps.Further updates 8th July:You have two threads in your application:Main thread that creates connection, consumer and a message listener. Attaches the message listener to a consumer.Message listner thread - this is invoked by MQ libraries to deliver messages to your application.The main thread controls the life cycle of your application. If that ends, all other threads in your application also end. Dont expect the message listner thread to run even after main thread ends. This is basic threading concepts, nothing specific to message listener. There is no issue here with message listener, it is working as designed.JMS is an API specification only, not an implementation. Many vendors like MQ JMS implement the specifications.Instead of using asynchronous consumer, you might want to use synchronous consumer.recieve() or consumer.receiveNoWait() methods on the main thread itself. These APIs retrieve messages if available or return null if there are no messages. You can check for null and exit.Hope this helps.\n"} +{"text": "### Human: I know the DefaultMessageListenerContainer polls by design. And that the receiveTimeout which sets the polling interval defaults to 1 second.The way I understand it is that the DMLC will issue a get, and waits the 'receiveTimeout' defined interval (1 second) before it times out and issues another get.From what I have read, we can set thisreceiveTimoutvalue to a larger value and have NO effect on messages getting picked up from the MQ because the active 'get' will sit on the listener until a message arrives... and once/if the timeout interval expires it will just submit another get which remains active on the queue until a message arrives.So my questions is,what is the benefit of a smaller receiveTimout interval? If we are always going to process a message when it arrives, why on earth would we want to poll the queue every second?We are running many large applications, and the polling is simply running the CPU usage/bill through the roof, and I cannot find a justification for this.### Assistant: Yes - the 1 second receive timeout can be very CPU intensive with a large number of queues.The general idea for the DefaultMessageListenerContainer was to wait for a bit (1 second seems to be a very short wait period), and then, if you don't get a message, it actually tears everything down and does a full reconnect. This is kind of a poor-mans error handling. \"If I haven't heard from the broker, assume that something is broken, drop everything and reconnect\". If the reconnect were not so expensive, it might not be a bad strategy. Or if you have only one queue. Or maybe you are expecting 10 messages a second and do want to reconnect if a second goes by. If you have a reasonable number of destinations, the reconnect traffic can get downright abusive.For IBM MQ, failures on the JMS connection/session are reliably picked up. You don't have the, \"it just sits there not getting any messages for some reason\" scenario. So setting the timeout to 10 minutes (whatever) would be fine.Note that if you are running in a JEE application server, and your JMS connections are managed by the JCA, then that layer is responsible for detecting bad connections and you don't have to worry about it up in the application layer.With Camel and for SpringBootGitHubmight be useful.\n"} +{"text": "### Human: As stated inhttps://github.com/ibm-messaging/mq-docker/blob/master/README.mdwhen I add a user I get permission denied [ useradd: Permission denied.\nuseradd: cannot lock /etc/group; try again later.]It seems I can only add the user as root.\nI switched as root user [ by providing \"-u 0\" ] while executing the docker container and tried. It is also not possible in that way.Any idea to add an user inside mqm group of IBM MQ Docker container?useradd user101 -G mqm && \\\necho user101:passw0rd | chpasswd### Assistant: I think this is a duplicate ofibmcom/mq. \"useradd: group 'mqm' does not exist\" error for new image versionMQ Custom Docker Image - MQM Group Not Foundandibmcom/mq docker image backward compatibility issueIn summaryFrom 9.1.5 the container does not use OS based users or groups. This\nis to conform to cloud best practices. Instead a file based system is\nbeing used. This is so that when you roll-out the container in a cloud\ninto production you can switch to an LDAP based system.From 9.1.5 container uses htpasswd, with the relevant file in /etc/mqm/\n"} +{"text": "### Human: I am currently able to connect to a IBM MQ using IBMXMSDotnetClient by specifying the connection properties directly in the c# code like below.XMSFactoryFactory factory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\nIConnectionFactory connFactory = factory.CreateConnectionFactory();\nconnFactory.SetStringProperty(XMSC.WMQ_HOST_NAME, \"xxx\");\nconnFactory.SetIntProperty(XMSC.WMQ_PORT, 1414);\nconnFactory.SetStringProperty(XMSC.WMQ_CHANNEL, \"xxx\");\nconnFactory.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);\nconnFactory.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, \"xxx\");But in Java, it seems that it can be done by JNDI bindings file.From what I can see, it looks like that JNDI is something like TNS file (which specifies the connection details such host, port, SID, etc.) used by the client to connect to server in Oracle.Is my understanding correct?If it is the case,is it possible to connect to the IBM MQ by JNDI bindings files using IBMXMSDotnetClient?All examples I can find is to set the connection properties (connFactory.SetXXXProperty) directly.### Assistant: I have this snippet to create initial context and use it to create connection factory and sessions. Hope it will get you started.InitialContext ic = null;\n IConnectionFactory confac = null;\n IConnection conn = null;\n ISession sess = null;\n IMessageConsumer cons = null;\n IDestination dest = null;\n\n try\n {\n System.Collections.Hashtable env = new System.Collections.Hashtable();\n // Set the URL or PATH where the bindings file is located\n env[XMSC.IC_URL] = \"file://c:/mqbindings/.bindings\";\n // Initialize the context\n ic = new InitialContext(env);\n // Lookup for the connection factory name\n confac = (IConnectionFactory)ic.Lookup(\"myconfactoryname\");\n // Create connection using the details from connection factory\n conn = (IConnection)confac.CreateConnection();\n // Create an auto ack session\n sess = conn.CreateSession(false, AcknowledgeMode.AutoAcknowledge);\n // Lookup for the destination\n dest = (IDestination)ic.Lookup(\"myqueue\");\n // ... rest of the code - create consumer or producer\n } \n catch (XMSException xmsE)\n {\n // Handle exception\n }\n"} +{"text": "### Human: Is there any open-source tool or plugin to monitor MQGET calls?More specifically we need to monitor Total MQGET operations on MQ Manager for some specific queues.Checked the link provided withHow to monitoring MQPUT and MQGET?but dint find any.### Assistant: There are two options that immediately come to mind for monitoring the total number of MQGET operations on a queue.RESET QSTATSQueue StatisticsA comparison between these two methods is discussedhere. I won't repeat the whole post, but the pertinent comparison is thus.Reset QStatsQueue StatisticsPolls the Command Server. Care should be taken if you are monitoring large numbers of queues at high frequencies using this method because of the incurred load on the queue manager. However, for single queue high frequency graphs, this may be more suitable as you would you not likely want to set Accounting and Statistics intervals to really short timeframes, such as a minute or less.Information is pushed by the Queue Manager as Accounting and Statistics messages, at configured intervals, and it therefore incurs less load on the queue manager.Can only be consumed by one user as RESET QSTATS is destructiveCan be consumed by any number of usersUsing RESET QSTATS will interfere with the collection of Performance EventsUsing Queue Statistics does not interfere with any other data collectionAvailable on z/OS (turn on performance events to use it) and Distributed platformsOnly available on Distributed platforms, not on z/OSConfiguration is very simple to monitor a small number of queues, but becomes unwieldly to monitor many/all queuesConfiguration requires a small amount of initial set up, but once set up, monitoring the entire queue manager is no more effort than monitoring a single queueSimple MQ Administrative tools usually have RESET QSTATS. You need something to process Accounting and Statistics messages if you want to use Queue Statistics.\n"} +{"text": "### Human: I'm migrating a BizTalk 2013 R2 env to BizTalk 2020 and facing an issue with the adapter MQSC. The flow uses the IBM client installed with Host Integration 2020. We notice the add of 2 new properties on the adapterWe left these properties with the default values, but when sending a message with a one way MQSC send port it remains active and the following error is logged twice in the event log:The Messaging Engine encountered an error while deleting one or more messages.Has anyone faced this issue?### Assistant: @JoshMc No error in queue manager logs.\nI solved the issue by changing only the \"IBM MQ Client Type\" property to \"IBM MQ .Net Client\"\n"} +{"text": "### Human: I have a working nodejs application connected with IBM MQ using pub/ sub to receive messages sent on a topic. I want to now scale the application to have multiple instances running such that only one of the instances gets the published message. I could find outsharedsubscriptionproperty mentioned by IBM, but I cannot find any reference details for a nodejs based implementation.I am currently usingibm-messaging/mq-mqi-nodejsfor connectivity, but any other library is also fine as long as it is nodejs based.### Assistant: Node.js is layer on top of the MQI, so you should use the MQI way of subscription sharing rather than the JMS way.Look at theMQSO_GROUP_SUBoption on the Sub call.If you supply some of your code, I can update this answer to show you the updates you might need. I am not a Node.js expert, only an MQI expert.\n"} +{"text": "### Human: We plan to migrate our on-premise MQ servers hosted in VMware servers to azure VM. Can I use the Azure Migrate tool to migrate IBM MQ from on-premise to Azure cloud### Assistant: Azure Migrate can be used as a Migration tool for any on-premises VMs running on VMWare/Hyper-V as well as for physical servers provided, they are running on azure supported operating system.Here is a list of supported OS for migrating VMs to azure under azure Migrate.https://learn.microsoft.com/en-us/azure/migrate/migrate-support-matrix-vmware-migration#vm-requirements-agentlesshttps://learn.microsoft.com/en-us/azure/migrate/migrate-support-matrix-vmware-migration#vm-requirements-agent-basedNote: There are 2 different ways you can replicate the VMs, agent-based and agent-less for details refer to:Azure Migrate agentless migration of VMware virtual machinesAgent-based migration architecturePlease note azure migrate replicates the disks from on-premises to azure and during migration phase the VM is created using the replicated disks. Any additional configuration for your application inside the VMs needs to be taken care separately.For more details refer to:https://learn.microsoft.com/en-us/azure/migrate/migrate-services-overview\n"} +{"text": "### Human: I have started my migration of spring version from 4.3.29.RELEASE to 5.3.29 I have fixed some of the issues with servlet and AbstractClientHttpRequest files but I was facing some issue with .binding files, I see they were loading as part of application context after migrating the spring version to 5.3.19 , with the older version of Spring 4.3.29.RELEASE I was able to bring up my application with out any issues. Now with 5.3.19 when I start my application I am getting below issue.03-May-2022 10:11:00.537 SEVERE [main] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [org.springframework.web.context.ContextLoaderListener]\n org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'TestMgmtDAO': Unsatisfied dependency expressed through field 'editorService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'editorService': Unsatisfied dependency expressed through field 'trentonMessagePublisher'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'trentonMessagePublisher' defined in class path resource [config/queue-config.xml]: Cannot resolve reference to bean 'jmsTemplate' while setting bean property 'jmsTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jmsTemplate' defined in class path resource [config/queue-config.xml]: Cannot resolve reference to bean 'connectionFactory' while setting bean property 'connectionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connectionFactory' defined in class path resource [config/queue-config.xml]: Cannot resolve reference to bean 'testConnectionFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testConnectionFactory' defined in class path resource [config/queue-config.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name [TEST_QMGR_QCF] is not bound in this Context. Unable to find [TEST_QMGR_QCF].\nRelated cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testConnectionFactory' defined in class path resource [config/queue-config.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name [TEST_QMGR_QCF] is not bound in this Context. Unable to find [TEST_QMGR_QCF].\nRelated cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myTestQueue' defined in class path resource [config/queue-config.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name [Q_OUTBOUND_TEST.CHECK_TO_QUEUETON] is not bound in this Context. Unable to find [Q_OUTBOUND_TEST.CHECK_TO_QUEUETON].My Sample .binding file is below , I am using IBM MQ.TEST_QMGR_QCF/RefAddr/1/Type=XXX\nTEST_QMGR_QCF/RefAddr/2/Content=XXXX\nTEST_QMGR_QCF/RefAddr/3/Content=TEST.TEST.TLS\nTEST_QMGR_QCF/RefAddr/4/Content=true\nTEST_QMGR_QCF/RefAddr/5/Content=0\nTEST_QMGR_QCF/RefAddr/9/Type=TCM\nTEST_QMGR_QCF/RefAddr/91/Type=TMVersion of the the IBM Mq jar files used are.\n org.springframework.amqp\n spring-amqp\n 1.7.10.RELEASE\n \n\n \n com.ibm.mq\n com.ibm.mq.allclient\n 9.2.2.0\n I have com.sun.jndi.fscontext.RefFSContextFactory entry to to load my .binding files in my beans.xml like below.\n \n \n com.sun.jndi.fscontext.RefFSContextFactory\n file:///C:/Local\n \n \n\n\n \n \nThis is where I see with older version of Spring I was able to load the .bindings but with upgrade unable to load.### Assistant: The best that I can do is to try to point you in the right direction. The.bindingsfile uses thecom.sun.jndi.fscontext.RefFSContextFactoryto provide a JNDI like lookup that is initialized from your.bindingsfile.You can find some references hereIBMandSun.Note that the jar filesfscontext.jarandproviderutil.jarare provided with the IBM MQ distribution in the/opt/mqm/java/libdirectory. These are the Sun jars needed for the file system context. These files are not, however, provided by thecom.ibm.mq.allclientmaven artifact.These jars must have been provided in your older version. You can find them in Maven Central:com.sun.messaging.mq\nfscontext\njar\n4.6-b01Note that the two jars seem to have been merged into the one jar in this artifact. Ensure that these Sun classes are in your current project.Then, you'll need to find where you are doing something like (from the Sun link):// Create the environment for constructing the initial JNDI \n// naming context.\nHashtable env = new Hashtable();\n \n// Store the environment attributes that tell JNDI which initial context\n// factory to use and where to find the provider.// \nenv.put(Context.INITIAL_CONTEXT_FACTORY, \n \"com.sun.jndi.fscontext.RefFSContextFactory\");\nenv.put(Context.PROVIDER_URL, \"file:///C:/imq_admin_objects\");\n \n// Create the initial context.\nContext ctx = new InitialContext(env);\n \n// Look up the connection factory object in the JNDI object store.\nString CF_LOOKUP_NAME = \"MyConnectionFactory\";\nConnectionFactory myFactory = (ConnectionFactory) ctx.lookup\n (CF_LOOKUP_NAME);in your code. Note that the.bindingsfile name is expected, and that the location specified is a directory where the.bindingsfile is located.\n"} +{"text": "### Human: I am working on a spring boot project which is related to financial domain.I am using MQ Visual Edit Software to inject a financial message in a queue and test the message.Able to successfully connected to Queue manager server and import the message.But the messages which are import are text files containing the information in the form of xml representation.Message Type\n============\nMQMT_DATAGRAM\nMQMT_REQUEST\nMQMT_REPLY\nMQMT_REPORT\nMQMT_MQE_FIELDS\nMQMT_SYSTEM_LAST\nMQMT_APPL_FIRST\nMQMT_MQE_FIELDS_FROM_MQECan you explain what is the Message Type we should chose and how to test message in a queue?### Assistant: Wow. You are using a really old & outdated release of MQ Visual Edit. Note: Be careful, as it may not support newer releases of MQ. You should be using the latest release of MQ Visual Edit.Message Type is defined in the IBM MQ Knowledge Centerhere. From the docs:MQMT_DATAGRAMThe message is one that does not require a reply.MQMT_REQUESTThe message is one that requires a reply.Specify the name of the queue to which to send the reply in the ReplyToQ field. The Report field indicates how to set the MsgId and CorrelId of the reply.MQMT_REPLYThe message is the reply to an earlier request message (MQMT_REQUEST). The message must be sent to the queue indicated by the ReplyToQ field of the request message. Use the Report field of the request to control how to set the MsgId and CorrelId of the reply.\n"} +{"text": "### Human: I wanted to create IBM queues from REST endpoint as described in documentationhttps://www.ibm.com/docs/en/ibm-mq/9.1?topic=applications-creating-destinations-in-jms-applicationIBM version - 9.1.0.5Queue Manager is started and listener is runningApplication and IBM server are on the same hostAuthorization is turned off on the server sideConnection and session is successfully created but the problem is that I'm not able to create queue directly in the server (queue is not listed in /var/mqm/qmgrs/QMGR/queues). In the application I see that the object with expected fields is created but it's not propagated to WebSphere. There is no error in AMQERR01.LOG.Do you know what could be wrong with my configuration?Do I need to use PCF to accomplish this?I was trying a lot of ways to create queue (some examples below):MQQueueConnectionFactory mqQueueConnectionFactory = new MQQueueConnectionFactory();\n mqQueueConnectionFactory.setQueueManager(\"QMGR\");\n mqQueueConnectionFactory.setHostName(\"X.X.X.X\");\n mqQueueConnectionFactory.setChannel(\"CHANNEL.X\");\n mqQueueConnectionFactory.setTransportType(com.ibm.mq.jms.JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);\n QueueConnection queueConnection = mqQueueConnectionFactory.createQueueConnection();\n QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\n queueSession.createQueue(name);\n----------------------------------------------------------------------------------------\n JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\n JmsConnectionFactory cf = ff.createConnectionFactory();\n cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, \"X.X.X.X\");\n cf.setIntProperty(WMQConstants.WMQ_PORT, 1414);\n cf.setStringProperty(WMQConstants.WMQ_CHANNEL, \"CHANNEL.X\");\n cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\n cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, \"QMGR\");\n cf.setStringProperty(WMQConstants.WMQ_APPLICATIONNAME, \"MQ provider\");\n cf.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, false);\n JMSContext context = cf.createContext();\n Destination destination = context.createQueue(\"queue:///\" + name);\n System.out.println(destination.toString());I was able to achieve this functionality with python pymqi libray but I need to do it in Java:import pymqi\nfrom flask import Flask\n\napp = Flask(__name__)\nHOST = 'X.X.X.X'\nPORT = '1414'\nCONN_INFO = '%s(%s)' % (HOST, PORT)\nQUEUE_MANAGER = 'QMGR'\n\n\n@app.route('/queue//')\ndef create_queue(channel_name, queue_name):\n queue_type = pymqi.CMQC.MQQT_LOCAL\n max_depth = 123456\n\n args = {pymqi.CMQC.MQCA_Q_NAME: queue_name.encode('ascii'),\n pymqi.CMQC.MQIA_Q_TYPE: queue_type,\n pymqi.CMQC.MQIA_MAX_Q_DEPTH: max_depth}\n\n qmgr = pymqi.connect(QUEUE_MANAGER, channel_name.encode('ascii'), CONN_INFO)\n\n pcf = pymqi.PCFExecute(qmgr)\n pcf.MQCMD_CREATE_Q(args)\n\n qmgr.disconnect()\n return \"OK\"\n\napp.run(host='0.0.0.0', port=8080)### Assistant: cf.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, false);In this day & age, that's a bad idea. Your program should be supplying a valid UserId and Password when connecting to a remote queue manager.You can create IBM MQ queues using PCF via JMS but it is a lot more complicated.Here is a fully functioning Java/PCF (non-JMS) program that creates a queue.import java.io.IOException;\nimport java.text.SimpleDateFormat;\nimport java.util.Date;\nimport java.util.Hashtable;\n\nimport com.ibm.mq.MQException;\nimport com.ibm.mq.MQQueueManager;\nimport com.ibm.mq.constants.CMQC;\nimport com.ibm.mq.constants.MQConstants;\nimport com.ibm.mq.headers.MQDataException;\nimport com.ibm.mq.headers.pcf.PCFException;\nimport com.ibm.mq.headers.pcf.PCFMessage;\nimport com.ibm.mq.headers.pcf.PCFMessageAgent;\n\n/**\n * Program Name\n * MQCreateQueue01\n *\n * Description\n * This java class issues a PCF \"create queue\" request message to create a local queue \n * specifying: queue type, max message length & max queue depth on a remote queue manager. \n * \n * This PCF code is equivalent to issuing the runmqsc command of:\n * DEFINE QL('TEST.QUEUE') MAXMSGL(10485760) MAXDEPTH(12345)\n *\n * Sample Command Line Parameters\n * -m MQA1 -q Queue_Name -h 127.0.0.1 -p 1414 -c TEST.CHL -u UserID -x Password\n *\n * @author Roger Lacroix\n */\npublic class MQCreateQueue01\n{\n private static final SimpleDateFormat LOGGER_TIMESTAMP = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss.SSS\");\n\n private Hashtable params;\n private Hashtable mqht;\n\n public MQCreateQueue01()\n {\n super();\n params = new Hashtable();\n mqht = new Hashtable();\n }\n\n /**\n * Make sure the required parameters are present.\n * @return true/false\n */\n private boolean allParamsPresent()\n {\n boolean b = params.containsKey(\"-h\") && params.containsKey(\"-p\") &&\n params.containsKey(\"-c\") && params.containsKey(\"-m\") &&\n params.containsKey(\"-q\") &&\n params.containsKey(\"-u\") && params.containsKey(\"-x\");\n if (b)\n {\n try\n {\n Integer.parseInt((String) params.get(\"-p\"));\n }\n catch (NumberFormatException e)\n {\n b = false;\n }\n }\n\n return b;\n }\n\n /**\n * Extract the command-line parameters and initialize the MQ HashTable.\n * @param args\n * @throws IllegalArgumentException\n */\n private void init(String[] args) throws IllegalArgumentException\n {\n int port = 1414;\n if (args.length > 0 && (args.length % 2) == 0)\n {\n for (int i = 0; i < args.length; i += 2)\n {\n params.put(args[i], args[i + 1]);\n }\n }\n else\n {\n throw new IllegalArgumentException();\n }\n\n if (allParamsPresent())\n {\n try\n {\n port = Integer.parseInt((String) params.get(\"-p\"));\n }\n catch (NumberFormatException e)\n {\n port = 1414;\n }\n \n mqht.put(CMQC.CHANNEL_PROPERTY, params.get(\"-c\"));\n mqht.put(CMQC.HOST_NAME_PROPERTY, params.get(\"-h\"));\n mqht.put(CMQC.PORT_PROPERTY, new Integer(port));\n mqht.put(CMQC.USER_ID_PROPERTY, params.get(\"-u\"));\n mqht.put(CMQC.PASSWORD_PROPERTY, params.get(\"-x\"));\n\n // I don't want to see MQ exceptions at the console.\n MQException.log = null;\n }\n else\n {\n throw new IllegalArgumentException();\n }\n }\n \n /**\n * Handle connecting to the queue manager, issuing PCF command then \n * looping through PCF response messages and disconnecting from \n * the queue manager. \n */\n private void doPCF()\n {\n String qMgrName = (String) params.get(\"-m\");\n String qName = (String) params.get(\"-q\");\n\n MQQueueManager qMgr = null;\n PCFMessageAgent agent = null;\n PCFMessage request = null;\n \n try\n {\n qMgr = new MQQueueManager(qMgrName, mqht);\n logger(\"successfully connected to \"+ qMgrName);\n\n agent = new PCFMessageAgent(qMgr);\n logger(\"successfully created agent\");\n \n // https://www.ibm.com/docs/en/ibm-mq/latest?topic=formats-change-copy-create-queue\n \n request = new PCFMessage(MQConstants.MQCMD_CREATE_Q);\n\n // Specify the queue name to be created.\n request.addParameter(MQConstants.MQCA_Q_NAME, qName);\n \n // Add parameter to request local queue\n request.addParameter(MQConstants.MQIA_Q_TYPE, MQConstants.MQQT_LOCAL);\n \n // Add parameter to set the max message length to be 10MB\n request.addParameter(MQConstants.MQIA_MAX_MSG_LENGTH, 10 * 1024 * 1024);\n \n // Add parameter to set the max queue depth to be 12,345\n request.addParameter(MQConstants.MQIA_MAX_Q_DEPTH, 12345);\n\n agent.send(request);\n \n logger(\"successfully created queue: \" + qName);\n }\n catch (PCFException pcfe) \n {\n if (pcfe.reasonCode == MQConstants.MQRCCF_OBJECT_ALREADY_EXISTS) \n logger(\"Error: The queue '\" + qName+ \"' already exists on the queue manager '\" + qMgrName + \"'.\");\n else\n logger(\"CC=\" +pcfe.completionCode + \" [\" + MQConstants.lookupCompCode(pcfe.completionCode) + \"] : RC=\" + pcfe.reasonCode + \" [\"+MQConstants.lookupReasonCode(pcfe.reasonCode)+\"]\");\n }\n\n catch (MQException e)\n {\n logger(\"CC=\" +e.completionCode + \" [\" + MQConstants.lookupCompCode(e.completionCode) + \"] : RC=\" + e.reasonCode + \" [\"+MQConstants.lookupReasonCode(e.reasonCode)+\"]\");\n }\n catch (IOException e)\n {\n logger(\"IOException:\" +e.getLocalizedMessage());\n }\n catch (MQDataException e)\n {\n logger(\"MQDataException:\" +e.getLocalizedMessage());\n }\n catch (Exception e)\n {\n logger(\"Exception:\" +e.getLocalizedMessage());\n }\n finally\n {\n try\n {\n if (agent != null)\n {\n agent.disconnect();\n logger(\"disconnected from agent\");\n }\n }\n catch (MQDataException e)\n {\n logger(\"CC=\" +e.completionCode + \" : RC=\" + e.reasonCode);\n }\n\n try\n {\n if (qMgr != null)\n {\n qMgr.disconnect();\n logger(\"disconnected from \"+ qMgrName);\n }\n }\n catch (MQException e)\n {\n logger(\"CC=\" +e.completionCode + \" : RC=\" + e.reasonCode);\n }\n }\n }\n\n /**\n * A simple logger method\n * @param data\n */\n public static void logger(String data)\n {\n String className = Thread.currentThread().getStackTrace()[2].getClassName();\n\n // Remove the package info.\n if ( (className != null) && (className.lastIndexOf('.') != -1) )\n className = className.substring(className.lastIndexOf('.')+1);\n\n System.out.println(LOGGER_TIMESTAMP.format(new Date())+\" \"+className+\": \"+Thread.currentThread().getStackTrace()[2].getMethodName()+\": \"+data);\n }\n\n public static void main(String[] args)\n {\n MQCreateQueue01 mqlqs = new MQCreateQueue01();\n \n try\n {\n mqlqs.init(args);\n mqlqs.doPCF();\n }\n catch (IllegalArgumentException e)\n {\n logger(\"Usage: java MQCreateQueue01 -m QueueManagerName -q Queue_Name -h host -p port -c channel -u UserID -x Password\");\n System.exit(1);\n }\n\n System.exit(0);\n }\n}\n"} +{"text": "### Human: Currently, my program is processing the messages being received from a queue but we encountered a xml file that has an error and what happens is it keeps looping on the same message and retrying to process it.I would like to move the message to dead letter queue when a message like this occurs again.What I did right now is that I created a class that will \"producer.send(destination, msg)\" to the dead queue and call this function on the try-catch but it seems that it is not working.### Assistant: As @JoshMc hinted you should be treating the error messages as poison messages. For that you will need to enable transactions, and invoke a rollback for the error message.ie. logic that looks like// Create a connection factory\nJmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\n\nJmsConnectionFactory cf = ff.createConnectionFactory();\n\n//Set connection properties\n...\n\ncontext = cf.createContext(JMSContext.SESSION_TRANSACTED);\ntry {\n ... \n // Message Processing\n ...\n // All is OK\n context.commit();\n} catch (Exception e) {\n // Message processing failed\n context.rollback();\n}If a backout queue and backout threshold is set then the poison message is put on to the backout queue (BOQNAME) after BOTHRESH attempts at handling the message.All this is done for you, by the underlying MQ Client code.There is an explanation in this article -https://developer.ibm.com/articles/an-introduction-to-local-transactions-using-mq-and-jms/which also links to sample code here -https://github.com/ibm-messaging/mq-dev-patterns/tree/master/transactions/JMS/SE\n"} +{"text": "### Human: Starting with the help provided by the information fromthisarticle, I have implemented an IBM MQ Point-to-Point testing solution using JMeter with JSR223 Samplers, Interthread Communication Plugin to pass information between consumer and producer threads and the help of some awesome people in the stack overflow community. The main feature besides what the article above shows is that this solution synchronizes threads made by the Producer thread group with threads from the Consumer Thread group in order to calculate how long a specific message took to be put from one request queue to another response queue.\nIn this solution I only use one connection and session for the \"Request Producing\" Threads inside a Producer thread group and one other connection and session for the \"Request Consuming\" Threads. These connections and sessions are created at the beginning.The producer setUp Thread group which executes only once at the beginning of the test, ends with these lines which create these 3 objects which I can grab in the Producer Thread group and use them to Produce one or more messages and send to one input queue:System.getProperties().put(\"SessionInbound\", sessInboundQueue)\nSystem.getProperties().put(\"ConnectionInbound\", connInboundQueue)\nSystem.getProperties().put(\"DestinationInbound\", destinationInboundQueue)Similarly, the \"consumer setUp Thread group\" which executes only once at the beginning of the test, ends with these lines which create these 3 objects which I can grab in the Consumer Thread group and use them to Consume one or more specific messages from the output queue:System.getProperties().put(\"SessionOutbound\", sessOutboundQueue)\nSystem.getProperties().put(\"ConnectionOutbound\", connOutboundQueue)\nSystem.getProperties().put(\"DestinationOutbound\", destinationOutboundQueue)Then, in the Producer I essentially do this:def sessInboundQueue = System.getProperties().get(\"SessionInbound\")\ndef destinationInboundQueue = System.getProperties().get(\"DestinationInbound\")\n\nproducer = sessInboundQueue.createProducer(destinationInboundQueue)\n...\nproducer.close()And, in the Consumer I essentially do this:def sess = System.getProperties().get(\"SessionOutbound\")\ndef destination = System.getProperties().get(\"DestinationOutbound\")\n\nconsumer = sess.createConsumer(destination, \"JMSCorrelationID='\" + inboundMessageId + \"'\" )\n....\nconsumer.close()And at the very end of the test I have 2 tearDown Thread Groups: one for the InboundQueue connection created initially in the setUp Thread Group and one for the OutboundQueue connection:System.getProperties().get(\"SessionInbound\").close()\nSystem.getProperties().get(\"ConnectionInbound\").close()\n\n\n\nSystem.getProperties().get(\"SessionOutbound\").close()\nSystem.getProperties().get(\"ConnectionOutbound\").close()So, I used essentially one single connection and session object through which to send all the threads which Put many messages per second on input queue1 and one single connection and session object through which I Get many targeted messages from output queue1.Now, the problem is that I should also test the system's capacity to handle multiple concurrent requests coming via multiple connections at the same time.I think using just one connection can be a bottleneck, but also creating a connection for each thread is too much.I need something like this table I made below. Currently I only handle the first line, except that all requesters use the same connection (a requester being just some string value in the payload).My thought is that I should define different connection details and wrap them up under a producer1-N and a consumer1-N and based on each Requester1-N string (which comes differently for each thread from a CSV file), to use the needed producer1-N and consumer1-N (which sends/consumes to/from queue 1-N) based on the above excel mapping.How can this above-explained situation be managed in the easiest way in JMeter?Does anyone see a better approach to the problem?I would greatly appreciate any advice.### Assistant: Your JMeter test must represent real-life system usage as close as possible so you need to open as many connections as the upstream system will open and send the same amount of messages of the same size as it will be in reality.I have no idea regarding what exactly you're trying to test (hopefully it's not IBMMQ itself) hence cannot come up with comprehensive solution, the options I can think of are in:Each JMeter thread (virtual user) is a separate upstream component which sends messages to the IBMMQ instance, in this case you need to create a Producer instance per virtual user. Just add current thread number as a prefix or postfix to the properties holding the sessions, i.e. instead of:props.put(\"SessionInbound\", sessInboundQueue)do something like:props.put(\"SessionInbound_\" + ctx.getThreadNum(), sessInboundQueue)wherectxstands for JMeterContextclass instance, seeJavaDocfor full documentation on all possible functionsOpening a connection is quite an \"expensive\" process that's why normal developers go forConnection Poolpattern, most probably real producers will have this implemented somehow so you need to know the details and configure your JMeter script accordingly. Check outConnection pooling in IBM MQ classes for JavaandExamples of using the connection pool. If you like to copy and paste the code you can get some fromSupplying a different connection pool in IBM MQ classes for Javapage\n"} +{"text": "### Human: I'm upgrading an OpenLiberty application to Jakarta EE 9.1 that integrates with IBM MQ using it's JMS resource adapter.Resource adapter is declared in theserver.xmllike this:This error blows up when the server starts:[INFO] [ERROR] J2CA7002E: An exception occurred while installing the resource adapter wmqjmsra.\nThe exception message is: java.lang.NoClassDefFoundError: javax/resource/spi/ResourceAdapterAs I mentioned I'm using Jakarta EE 9.1, so it is expected that classjavax.resource.spi.ResourceAdapterwill not be available since it has been renamed toimport jakarta.resource.spi.ResourceAdapterfollowing the new standard.Mypom.xmldependencyes:\n \n jakarta.platform\n jakarta.jakartaee-api\n 9.1.0\n provided\n \nThe IBM MQResource Adapter documentationdoesn't mention support for Jakarta EE, yetit is supportedin IBM Liberty.So what would be a possible fix for this?I'm using the latest IBM MQ Resource Adapter version 9.2.5.0, downloaded usingthese instructions, and running the latest OpenLiberty build 22.0.0.4 and JDK 17.### Assistant: MQ does not yet ship a JMS3/Jakarta implementation. Version 9.3 has just been announced for availability in June and one of the features there is expected to be a JMS3 variant.The current RA says it is supported in \"any JavaEE 7.0 compliant version of IBM WebSphere Application Server Liberty.\" Which obviously excludes the Jakarta EE systems for now.\n"} +{"text": "### Human: I use the command dis ql(WY) and see CURDEPTH is full, what should I do about it### Assistant: Queue is full because there is no application consuming messages from it. You canIdentify the application putting messages into this queue and determine if the messages were indented for this queue.If the messages were meant for this queue, was there any application configured to consume messages from this queue? If there was one, is the application running, if it is running why is it not consuming? if not why it is not running, start it.Clear the queue if you think messages are not important. Disable message put to this queue.Edit:Your screenshot shows IPPROCS(10) and OPPROCS(1) which means the queue is opened by 10 applications for GETting and 1 application for PUTting messages. But still the queue is full. It may be that application is not consuming messages but application is not reporting errors properly.You can look at last message get date and time statistics on the queue using the DISPLAY QSTATUS command. Lookherefor details.\n"} +{"text": "### Human: I'm trying to enable two way SSL encryption between JMS client and IBM MQ using a server conn channel called \"KAU.CONN\" , I have already generated client certificate and queue manager certificates using two different self signers. below are the steps I used to generate certificate and key stored in both side. when the MQ channelsSSLCAUTHoption set toOPTIONALconnectivity works fine. Appreciate any leads for the possible cause.IBM MQ version = 9.2 (trial version)\nJDK( jms client ) = 1.8Error in eclipse:Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2059;AMQ9503: Channel negotiation failed. [3=KAU.CONN]\n at com.ibm.mq.jmqi.remote.impl.RemoteConnection.analyseErrorSegment(RemoteConnection.java:4464)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnection.receiveTSH(RemoteConnection.java:3199)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnection.initSess(RemoteConnection.java:1274)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnection.connect(RemoteConnection.java:895)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSessionFromNewConnection(RemoteConnectionSpecification.java:416)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSession(RemoteConnectionSpecification.java:312)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnectionPool.getSession(RemoteConnectionPool.java:146)\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1761)\n ... 61 moreSSL inplementationQUEUE MANAGERCommands used to create CA's certificaterunmqckm -keydb -create -db myCA.kdb -type cms -pw mycakeypassword -stash\nrunmqckm -cert -create -db myCA.kdb -type cms -label \"myCAcertificate\" -dn \"CN=demmoCA,O=DemmoOrg,OU=DemmoDepartment,L=DemmoLocation,C=UK\" -expire 1000 -size 1024\nrunmqckm -cert -extract -db myCA.kdb -type cms -label \"myCAcertificate\" -target myCAcertfile.cer -format ascii -stashedIssuing a certificate to a queue managerrunmqckm -keydb -create -db myqmgr.kdb -type cms -pw kautstpassword -stash\nrunmqckm -certreq -create -db myqmgr.kdb -type cms -dn \"CN=KAU.TST,O=IBM,OU=WMQ,L=Hursley,C=UK\" -label \"ibmwebspheremqmyqmgr\" -file kauqmgercsr.req -stashed\nrunmqckm -cert -sign -db myCA.kdb -label \"myCAcertificate\" -expire 365 -format ascii -file kauqmgercsr.req -target kauqmgr.cer -stashed\nrunmqckm -cert -receive -db myqmgr.kdb -type cms -file kauqmgr.cer -stashedJMS CLIENT SIDEAdding the queue manager's certificate(generated above) to client's keystore (after creating client's keystore)keytool -keystore kautstclient.jks -genkey -alias winclientcert -storepass clientpassword\nkeytool -import -keystore kautstclient.jks -file myCAcertfile.cer -alias myCAcertificatecreating a another CA's keys,certificate for jms clientopenssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365generating certificate for clientkeytool -certreq -v -alias winclientcert -file kauclient.csr -keypass clientpassword -storepass clientpassword -keystore kautstclient.jks\nopenssl x509 -req -in kauclient.csr -CA cert.pem -CAkey key.pem -CAcreateserial -out kauclientown.crt\nkeytool -import -v -alias kauclientowncert -file kauclientown.crt -keystore kautstclient.jks -keypass clientpassword -storepass clientpasswordFinally Adding client certificate's signer certificate to the queue manager's kdbrunmqckm -cert -add -db myqmgr.kdb -file cert.pem -label kauclientsignercertificateThese are my JMS client's SSL property settingsSystem.setProperty(\"javax.net.ssl.trustStorePassword\", \"clientpassword\" );\nSystem.setProperty(\"javax.net.ssl.keyStorePassword\", \"clientpassword\" );\nSystem.setProperty(\"javax.net.ssl.keyStore\", \"D:\\\\mq-message-handler-1.0\\\\ssl\\\\kautstclient.jks\" );\n \nSystem.setProperty(\"com.ibm.mq.cfg.useIBMCipherMappings\", \"false\" );\nSystem.setProperty(\"jdk.security.allowNonCaAnchor\",\"true\");\nSystem.setProperty(\"javax.net.ssl.trustStore\",\"D:\\\\mq-message-handler-1.0\\\\ssl\\\\kautstclient.jks\");\ncf.setStringProperty(WMQConstants.WMQ_SSL_CIPHER_SUITE, \"TLS_RSA_WITH_AES_256_GCM_SHA384\");Certificate details in client's keystore and qmgr's keystoreplease note my jms client is running in windows but I have used linux server to generate key/cert files and I'm more familiar with linux commands.Certificates in database /tmp/client/kautstclient.jks: \n winclientcert\n kauclientowncert\n mycacertificate\n\n\nCertificates in database /var/mqm/qmgrs/KAU!TST/ssl/myqmgr.kdb:\n ibmwebspheremqmyqmgr\n \"CN=demmoCA, O=DemmoOrg, OU=DemmoDepartment, L=DemmoLocation, C=UK\"\n kauclientsignercertificate\n\n\n[mqm@192 ssl]$ runmqakm -cert -list -db myqmgr.kdb -stashed\nCertificates found\n* default, - personal, ! trusted, # secret key\n! \"CN=demmoCA, O=DemmoOrg, OU=DemmoDepartment, L=DemmoLocation, C=UK\"\n! kauclientsignercertificate\n- ibmwebspheremqmyqmgr### Assistant: Perhaps it is not finding your trustStore.Apparently, you can check whether the JVM is using the configuredtrustStoreby using the following property:-Djavax.net.debug=all, which will turn on a debug message.After the app starts, it will print out a message like:javax.net.ssl|DEBUG|11|parallel-1|2021-04-17 21:25:13.827 CST|TrustStoreManager.java:112|trustStore is: C:/path/to/the/trustStore\n"} +{"text": "### Human: I am issuingINQUIRE_CHANNEL_STATUScommand via PCF , I am getting Byte sent, Byte Received.\nNow I want to also obtain the the channel status. Would I get that under MQCFST ?After the MQGET, I am not seeingMQIACH_CHANNEL_STATUS = PCF_TYPE(String).Has anyone come across of this ?### Assistant: Bytes sent (MQIACH_BYTES_SENT) and bytes received (MQIACH_BYTES_RCVD) are both numbers/integers, so they are conveyed to you in theMQCFINstructure (MQ Command Format INteger).The channel status field (MQIACH_CHANNEL_STATUS) which tells you whether the channel is running (MQCHS_RUNNING) or retrying (MQCHS_RETRYING) or so on, is also an integer, so it will not be in anMQCFST(MQ Command Format STring) but it will also be in anMQCFINjust as the bytes sent and bytes received values are.You can discover the types and attribute constants for all the fields that come back as part of anMQCMD_INQUIRE_CHANNEL_STATUSPCF command response message, by viewingthis pagein IBM Docs.You have not provided any code snippet in your question, nor any hint of what language you are using, so I have not put any code in this answer, but if you update your question to show the code you are using, I will update this answer accordingly.\n"} +{"text": "### Human: I deployed a Java application on a JBoss server which allows to connect to WebSphere MQ server using the ressource adapter provided by WebSphere MQ. During the app start I had the problemCaused by: javax.naming.NamingException: WFLYNAM0027: Failed instantiate InitialContextFactory:at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)\n at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\n at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)\n at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\n at org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)\n at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\n at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)\n at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)\n at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)\n at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)\n at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)\n at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)\n at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)\n at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)\n at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)\n at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)\n at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)\n at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)\n at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)\n at io.undertow.server.Connectors.executeRootHandler(Connectors.java:360)\n at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)\n at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)\n at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)\n at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)\n at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)\n at java.lang.Thread.run(Thread.java:748)\nCaused by: javax.naming.NamingException: WFLYNAM0027: Failed instantiate InitialContextFactory com.ibm.websphere.naming.WsnInitialContextFactory from classloader ModuleClassLoader for Module \"JmsTest.war\" from Service Module Loader [Root exception is java.lang.ClassNotFoundException: com.ibm.websphere.naming.WsnInitialContextFactory from [Module \"deployment.JmsTest.war\" from Service Module Loader]]Here's my java code below :Properties properties = new Properties();\nproperties.put(Context.SECURITY_PRINCIPAL, user);\nproperties.put(Context.SECURITY_CREDENTIALS, password);\nproperties.put(Context.INITIAL_CONTEXT_FACTORY, \"com.ibm.websphere.naming.WsnInitialContextFactory\");\nproperties.put(Context.URL_PKG_PREFIXES, \"com.ibm.ws.naming\");\nproperties.put(Context.PROVIDER_URL, \"remote://192.16.70.10:1234\");\nnamingContext = new InitialContext(properties);\nMQConnectionFactory cf = new MQConnectionFactory();\ncf.setTransportType(WMQConstants.WMQ_CM_CLIENT);\ncf.setHostName(mqHostName);\ncf.setPort(Integer.parseInt(mqListenerPort));\ncf.setQueueManager(mqQueueManagerName);\ncf.setChannel(mqChannelName);\nMQConnectionFactory factory = cf;\nconnection = factory.createConnection(user, password);\nconnection.start();\nsessionConsumer = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);\nqueue = namingContext.lookup(queue);Can anyone help me? Any suggestion would be appreciated!### Assistant: The root cause is:java.lang.ClassNotFoundException: com.ibm.websphere.naming.WsnInitialContextFactoryThis means that the application's classloader can't find this class.However, one of themain benefitsof using a JCA resource adapter is that you don't need to include provider-specific details in your code. In other words, you shouldn't be looking up JNDI resources directly on WebSphere MQ in your application code at all. All that stuff should be configured and bound into JNDI via the JCA resource adapter which you've deployed. Then you can perform alocalJNDI lookup to access resources on the remote WebSphere MQ server. Then you're application won't need access to any provider-specific classes or configuration details. It can just use the Java EE APIs as they were designed to be used.\n"} +{"text": "### Human: i have this error when i upload my repository to Jenkis, i does not detect the ibm mq library it sends me the following error, i have not been able to fix it.attached error.Copying blob sha256:97518928ae5f3d52d4164b314a7e73654eb686ecd8aafa0b79acd980773a740d\nCopying blob sha256:884acb06399854759d90ca69f71f6ba3d3be88de193ec78501d4e57a517ca7d9\nCopying blob sha256:a3930deb173dc6fe50792f24f5a7b18b7b35e5483cc2200d3ee3781663078fc8\nCopying config sha256:37a1b854e294c8d6e1b0519b02e7ab3e991194dde8bb9004ccf8f230fb40bf81\nWriting manifest to image destination\nStoring signatures\nAdding transient rw bind mount for /run/secrets/rhsm\nAdding transient rw bind mount for /run/secrets/etc-pki-entitlement\nAdding transient rw bind mount for /run/secrets/redhat.repo\nSTEP 1: FROM node:16-alpine3.14\nSTEP 2: WORKDIR /usr/src/app\n\nSTEP 3: COPY package*.json ./\n--> ee1cee5da5a\nSTEP 4: RUN npm install\nnpm notice \nnpm notice New minor version of npm available! 8.3.1 -> 8.5.2\nnpm notice Changelog: \nnpm notice Run `npm install -g npm@8.5.2` to update!\nnpm notice \nnpm ERR! code 1\nnpm ERR! path /usr/src/app/node_modules/ffi-napi\nnpm ERR! command failed\nnpm ERR! command sh -c node-gyp-build\nnpm ERR! gyp info it worked if it ends with ok\nnpm ERR! gyp info using node-gyp@8.4.1\nnpm ERR! gyp info using node@16.14.0 | linux | x64\nnpm ERR! gyp ERR! find Python \nnpm ERR! gyp ERR! find Python Python is not set from command line or npm configuration\nnpm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON\nnpm ERR! gyp ERR! find Python checking if \"python3\" can be used\nnpm ERR! gyp ERR! find Python - \"python3\" is not in PATH or produced an error\nnpm ERR! gyp ERR! find Python checking if \"python\" can be used\nnpm ERR! gyp ERR! find Python - \"python\" is not in PATH or produced an error\nnpm ERR! gyp ERR! find Python \nnpm ERR! gyp ERR! find Python **********************************************************\nnpm ERR! gyp ERR! find Python You need to install the latest version of Python.\nnpm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,\nnpm ERR! gyp ERR! find Python you can try one of the following options:\nnpm ERR! gyp ERR! find Python - Use the switch --python=\"/path/to/pythonexecutable\"\nnpm ERR! gyp ERR! find Python (accepted by both node-gyp and npm)\nnpm ERR! gyp ERR! find Python - Set the environment variable PYTHON\nnpm ERR! gyp ERR! find Python - Set the npm configuration variable python:\nnpm ERR! gyp ERR! find Python npm config set python \"/path/to/pythonexecutable\"\nnpm ERR! gyp ERR! find Python For more information consult the documentation at:\nnpm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation\nnpm ERR! gyp ERR! find Python **********************************************************\nnpm ERR! gyp ERR! find Python \nnpm ERR! gyp ERR! configure error \nnpm ERR! gyp ERR! stack Error: Could not find any Python installation to use\nnpm ERR! gyp ERR! stack at PythonFinder.fail (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:330:47)\nnpm ERR! gyp ERR! stack at PythonFinder.runChecks (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:159:21)\nnpm ERR! gyp ERR! stack at PythonFinder. (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:202:16)\nnpm ERR! gyp ERR! stack at PythonFinder.execFileCallback (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:294:16)\nnpm ERR! gyp ERR! stack at exithandler (node:child_process:406:5)\nnpm ERR! gyp ERR! stack at ChildProcess.errorhandler (node:child_process:418:5)\nnpm ERR! gyp ERR! stack at ChildProcess.emit (node:events:520:28)\nnpm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)\nnpm ERR! gyp ERR! stack at onErrorNT (node:internal/child_process:478:16)\nnpm ERR! gyp ERR! stack at processTicksAndRejections (node:internal/process/task_queues:83:21)\nnpm ERR! gyp ERR! System Linux 3.10.0-1160.53.1.el7.x86_64\nnpm ERR! gyp ERR! command \"/usr/local/bin/node\" \"/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"rebuild\"\nnpm ERR! gyp ERR! cwd /usr/src/app/node_modules/ffi-napi\nnpm ERR! gyp ERR! node -v v16.14.0\nnpm ERR! gyp ERR! node-gyp -v v8.4.1\nnpm ERR! gyp ERR! not ok\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR! /root/.npm/_logs/2022-03-03T19_33_05_255Z-debug-0.log\nerror: build error: error building at STEP \"RUN npm install\": error while running runtime: exit status 1I have been researching this problem in different places, to see if I can find a solution to this.I leave the links below.enter link description here### Assistant: Looks like the nested dependencynode-gyprequires python.Fromhttps://github.com/nodejs/docker-node/issues/282RUN apk update && apk add python g++ make && rm -rf /var/cache/apk/*though as you are basing on a node image you might just be able to get away withRUN apk update && apk add pythonAlternatively you can take a look at this sampleDockerfile-https://github.com/ibm-messaging/mq-mqi-nodejs/blob/master/samples/Dockerfile\n"} +{"text": "### Human: How to implement IBM MQ with Nodejs?Hello everyone, I need to implement a script that from nodejs can connect ibm qm this remotely, I have seen several documentation on the internet and seen for repository but it is not very clear to me, I could better clarifythis is the information that I have consulted:enter link description hereenter link description here### Assistant: There is an npm library that you can use -https://www.npmjs.com/package/ibmmqwhich has samples in its GitHub home repository -https://github.com/ibm-messaging/mq-mqi-nodejsFurther usage samples are available in the IBM MQ pattern samples repository -https://github.com/ibm-messaging/mq-dev-patterns/tree/master/Node.jsThe patterns repository also has examples on how to connect over REST using theaxiosnpm module -https://github.com/ibm-messaging/mq-dev-patterns/blob/master/serverless/openwhisk/mq-package/src/utillib/mqrestapi.js\n"} +{"text": "### Human: I'm trying to connect my java based application to the IBM MQ queue manager through the MQ client. SSL is already configured at MQ Server which is managed by third-party, Now to configure the SSL on the client-side I need Keystore & Truststore in .jks form.Could you please let me know the process of generating the Keystore & Truststore required for SSL communication b/w IBM MQ server & client?What is the Userid in Keystore & Truststore is it the alias name?### Assistant: There is a tutorial that will guide you through the process of creating a JMS Keystore -https://developer.ibm.com/tutorials/mq-secure-msgs-tls/but it doesn't need to be. You could use a .p12 Truststore, and there is a guide that shows how -https://github.com/ibm-messaging/mq-dev-samples/blob/master/README.mdboth usekeytool.\n"} +{"text": "### Human: I have following method to send a message to MQ , when the queue name is incorrect it throws MQRC_UNKNOWN_OBJECT_NAME error, but I want to pass the custom error (something like \"queue name is not found\") and let the user to continue with a correct queue name. I tried to capture the message send not successful scenario by returning the mqSend() method as false. but it doesn't work as I expected. Can someone help me out here? ( please note I'm setting the required MQ properties(QUEUE_NAME,QMGR,CHANNEL,HOST,PORT) separately.public boolean mqSend()\n {\n \n\n \n\n \n String APP_USER = \"\"; // User name that application uses to connect to MQ\n String APP_PASSWORD = \"\"; // Password that the application uses to connect to MQ\n\n \n // Variables\n JMSContext context = null;\n Destination destination = null;\n JMSProducer producer = null;\n //JMSConsumer consumer = null;\n \n \n try {\n // Create a connection factory\n JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\n JmsConnectionFactory cf = ff.createConnectionFactory();\n\n // Set the properties\n cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, HOST);\n cf.setIntProperty(WMQConstants.WMQ_PORT, PORT);\n cf.setStringProperty(WMQConstants.WMQ_CHANNEL, CHANNEL);\n cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\n cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, QMGR);\n cf.setStringProperty(WMQConstants.WMQ_APPLICATIONNAME, \"Manual message publihser\");\n cf.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, true);\n cf.setStringProperty(WMQConstants.USERID, APP_USER);\n cf.setStringProperty(WMQConstants.PASSWORD, APP_PASSWORD);\n \n //cf.setStringProperty(WMQConstants.WMQ_SSL_CIPHER_SUITE, \"*TLS12\");\n\n // Create JMS objects\n context = cf.createContext();\n \n destination = context.createQueue(\"queue:///\" + QUEUE_NAME);\n ((MQDestination)destination).setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ);\n \n\n //long uniqueNumber = System.currentTimeMillis() % 1000;\n //TextMessage message = context.createTextMessage(\"Your lucky number today is \" + uniqueNumber);\n TextMessage message = context.createTextMessage(MESSAGE);\n \n \n producer = context.createProducer();\n producer.send(destination, message);\n System.out.println(\" : Sent message details:\\n\" + message);\n\n //consumer = context.createConsumer(destination); // autoclosable\n //String receivedMessage = consumer.receiveBody(String.class, 15000); // in ms or 15 seconds\n\n //System.out.println(\"\\nReceived message:\\n\" + receivedMessage);\n\n context.close();\nreturn true;\n //recordSuccess();\n } catch (JMSException jmsex) {\n //recordFailure(jmsex);\n System.out.println(\"JMS/MQ error OCCURED!!!!\");\nreturn false;\n }\n \n\n //System.exit(status);\n \n \n }### Assistant: Wrap theproducer.sendcall in its own try/catch and look forMQRC_UNKNOWN_OBJECT_NAMEor other errors such asMQRC_NOT_AUTHORIZEDorMQRC_Q_FULL.\n"} +{"text": "### Human: There is a IBM MQ topic which accepts two types of messages Orders and Shipments.\nI have a Springboot subscriber app which is interested in subscribing only the Shipment message type.Below is how I am routing the channel. If the inbound message is neither of above types it will be thrown to errorChannel that I have.\nHere if I do not have orderChannel app will throw an error saying no proper channel for the inbound message.How do I silently ignore the messages of type order here?@Bean\n@ServiceActivator(inputChannel = \"routerChannel\")\npublic HeaderValueRouter router() throws Exception {\n HeaderValueRouter router = new HeaderValueRouter(messageType);\n router.setChannelMapping(shipment, \"shipmentChannel\");\n router.setChannelMapping(order, \"orderChannel\");\n router.setDefaultOutputChannel(invalidHeaderValueChannel);\n return router;\n}Currently I have the below code snippet which I need to have just to avoid the error when there was a Order message.@ServiceActivator(inputChannel = \"orderChannel\")\npublic void getInboundOrderMessage(Message message) throws Exception {\n\n logger.info(\"Inbound Order message...\");\n String payload = (String) message.getPayload();\n logger.info(\"Order Header: {}, payload: \\n{}\", pMessage.getHeaders(), payload);\n}Below is how I have the MsgDrivenChannelAdapter defined@MessageEndpoint\npublic class MsgDrivenChannelAdapter {\n\n private AbstractMessageListenerContainer messageListenerContainer;\n private DirectChannel inboundErrorChannel;\n private DirectChannel routerChannel;\n\n public MsgDrivenChannelAdapter(AbstractMessageListenerContainer pMessageListenerContainer,\n DirectChannel pInboundErrorChannel,\n DirectChannel pRouterChannel) {\n this.messageListenerContainer = pMessageListenerContainer;\n this.inboundErrorChannel = pInboundErrorChannel;\n this.routerChannel = pRouterChannel;\n }\n\n @Bean\n public IntegrationFlow jmsInboundFlow() throws Exception {\n return IntegrationFlows.from(Jms.messageDrivenChannelAdapter(messageListenerContainer)\n .errorChannel(inboundErrorChannel))\n .channel(routerChannel)\n .get();\n }\n}Is there anyway I can avoid this? thanks in advance### Assistant: See this option on the router:/**\n * When true (default), if a resolved channel key does not exist in the channel map,\n * the key itself is used as the channel name, which we will attempt to resolve to a\n * channel. Set to false to disable this feature. This could be useful to prevent\n * malicious actors from generating a message that could cause the message to be\n * routed to an unexpected channel, such as one upstream of the router, which would\n * cause a stack overflow.\n * @param channelKeyFallback false to disable the fall back.\n * @since 5.2\n */\npublic void setChannelKeyFallback(boolean channelKeyFallback) {So, it does not fallback to theorderas a channel name.Then it will return asnullfrom the mapping and the logic goes like this:if (!sent) {\n getDefaultOutputChannel();\n if (this.defaultOutputChannel != null) {\n this.messagingTemplate.send(this.defaultOutputChannel, message);\n }\n else {\n throw new MessageDeliveryException(message, \"No channel resolved by router '\" + this\n + \"' and no 'defaultOutputChannel' defined.\");\n }\n }If you want just to ignore it and don't want to have thatMessageDeliveryException, configure adefaultOutputChannelas anullChannel.But better to consider amessageSelectorfor the listener container, so it does not pull messages from a topic which it is not interested in.\n"} +{"text": "### Human: I use IBM XMS to connect to a third party to send and receive messages.UPDATE:Client .Net Core 3.1IBM XMS library version from Nuget. Tried 9.2.4 and 9.1.5 with same resultsSame code used to work fine a week ago - so something must have changed in the MQ manager or somewhere in my infrastructureSSL and client certificatesI have been using a receive with timeout for a while without problems but since last week I started to not see any messages to pick - even when they were there - but once I changed to the not timeout receive method I started again to pick messages every 5 minutes.Looking at the XMS logs I can see the messages are actually read almost immediately with and without timeout but that XMS seems to be deciding to wait for those 5 minutes before returning the message...I haven't changed anything in my side and the third party reassures they haven't either.My question is: given the below code used to receive is there anything there that may be the cause of the 5 minutes wait? Any ideas on things I can try? I can share the XMS logs too if that helps.// This is used to set the default properties in the factory before calling the receive method\n private void SetConnectionProperties(IConnectionFactory cf)\n {\n cf.SetStringProperty(XMSC.WMQ_HOST_NAME, _mqConfiguration.Host);\n cf.SetIntProperty(XMSC.WMQ_PORT, _mqConfiguration.Port);\n cf.SetStringProperty(XMSC.WMQ_CHANNEL, _mqConfiguration.Channel);\n cf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, _mqConfiguration.QueueManager);\n cf.SetStringProperty(XMSC.WMQ_SSL_CLIENT_CERT_LABEL, _mqConfiguration.CertificateLabel);\n cf.SetStringProperty(XMSC.WMQ_SSL_KEY_REPOSITORY, _mqConfiguration.KeyRepository);\n cf.SetStringProperty(XMSC.WMQ_SSL_CIPHER_SPEC, _mqConfiguration.CipherSuite);\n\n cf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);\n cf.SetIntProperty(XMSC.WMQ_CLIENT_RECONNECT_OPTIONS, XMSC.WMQ_CLIENT_RECONNECT);\n cf.SetIntProperty(XMSC.WMQ_CLIENT_RECONNECT_TIMEOUT, XMSC.WMQ_CLIENT_RECONNECT_TIMEOUT_DEFAULT);\n }\n \n public IEnumerable ReceiveMessage()\n {\n using var connection = _connectionFactory.CreateConnection();\n using var session = connection.CreateSession(false, AcknowledgeMode.AutoAcknowledge);\n using var destination = session.CreateQueue(_mqConfiguration.ReceiveQueue);\n using var consumer = session.CreateConsumer(destination);\n\n connection.Start();\n\n var result = new List();\n var keepRunning = true;\n while (keepRunning)\n {\n try\n {\n var sw = new Stopwatch();\n sw.Start();\n\n var message = _mqConfiguration.ConsumerTimeoutMs == 0 ? consumer.Receive() \n : consumer.Receive(_mqConfiguration.ConsumerTimeoutMs);\n\n if (message != null)\n {\n result.Add(message);\n _messageLogger.LogInMessage(message);\n var ellapsedMillis = sw.ElapsedMilliseconds;\n if (_mqConfiguration.ConsumerTimeoutMs == 0)\n {\n keepRunning = false;\n }\n }\n else\n {\n keepRunning = false;\n }\n }\n catch (Exception e)\n {\n // We log the exception\n keepRunning = false;\n }\n }\n\n consumer.Close();\n destination.Dispose();\n session.Dispose();\n connection.Close();\n\n return result;\n }### Assistant: The symptoms look like a match for APARIJ20591: Managed .NET SSL application making MQGET calls unexpectedly receives MQRC_CONNECTION_BROKEN when running in .NET Core. This impacts messages larger than 15kb and IBM MQ .net standard (core) libraries using TLS channels. See also thisthread. This will be fixed in 9.2.0.5, no CDS release is listed.It states:Setting the heartbeat interval to lower values may reduce the frequency of occurrence.If your .NET application is not using a CCDT you can lower the heartbeat by having the SVRCONN channel's HBINT lowered and reconnecting your application.\n"} +{"text": "### Human: I use IBM.XMS (9.1.0.0) to get the message from the queue from my .NET application.\nUnder the session, I get the message from the queue then insert into the database (SQL server), if one step failed, the session will roll back. The message will return to the queue so I can get it the next time. This works fine until one day, one message is lost and the MQ log said:IBM.XMS.XMSException: CWSMQ0067E: Rollback failed. The Backout()\noperation on the underlying queue manager object failed.Linked Exception : CompCode: 2, Reason: 2018I'm not sure if this error is the cause, so my question is: what happens if \"Rollback failed\" exception appears, may the message return back to the queue or not?### Assistant: In general: If you haven't committed your message, but not rolled back sucessfully either, the message will be rolled back automatically at some later point of time, when your session gets invalid.\nRegarding your specific case:\nMQRC 2018 indicates the connection handle is not valid. This might happen if the connection to the Queue Manager could not have been established, thus the handle to the connection is not valid, but you further want to proceed with an operation using this invalid handle. Such an operation includes invoking a roll back.\nYou say, if one step failed, you invoke the rollback. Is obtaining the session to MQ part of these steps leading to a rollback? This would explain 2018. Don't attempt a rollback on a session which has not successfully been established. It is useless as there is nothing to rollback and it comes with 2018.\n"} +{"text": "### Human: I have the following JMeter context:In one Concurrency Thread Group 1, I have a JSR223 Sampler which sends request messages to an MQ queue1 and always gets the JMSMessageID and an epochTimestamp (derived from JMS_IBM_PutDate + JMS_IBM_PutTime) and puts them into one variable. Underneath this Sampler is an Inter-Thread Communication PostProcessor element which gets the data from this variable and puts it into a FIFO QUEUE.In another Concurrency Thread Group 2, I have another JSR223 Sampler with code to get the response messages for all the messages sent on MQ queue 1 from an MQ queue2.\nTo do this, (and be able to calculate the response time fore each message) before the JSR223 Sampler executes, I use the Inter-Thread Communication PreProcessor element which gets a message ID and a timestamp from the FIFO queue (60 seconds timeout) and passes it over to a variable with which the JSR223 Sampler can work to calculate the request-response time for each message.I want to stress-test the system, which is why I am gradually dynamically increasing the Requests per second at every 1 minute (for script testing purposes) in both thread groups, like so:I use thetstFeedbackfunction of Concurrency Thread Group for this:${__tstFeedback(ThroughputShapingTimerIn,1,1000,10)}My problem is this:When I gradually increase the desired TPS load, during the first 4 target TPS steps, the Consumer threads keep up (synchronized) with the Producer threads, but as the time passes and load increases, the consumer threads seem to be taking more time to find and consume the messages. It's as though the load of the consumer treads is no longer able to keep up with the load of the producer threads, despite both thread groups having the same load pattern. This eventually causes the queue2 which is keeping the response messages to get full. Here is a visual representation of what I mean:The Consumer samples end up being much less than the producer samples. My expectation is that they should be more or less equal...I need to understand how I can go about to debug this script and isolate the cause:I think that something happens at the inter-thread synchronization level because sometimes I am getting null values from the FIFO queue into the consumer threads - I need to understand what gets put into that FIFO queue and what gets taken off of that FIFO queue.\nHow can I print what is present in the FIFO list at each iteration?Does anyone have any suggestions for what could be the cause of this behavior and how to mitigate it?Any help/suggestion is greatly appreciated.### Assistant: First of all take a look atjmeter.log file, you have at least 865 errors there so I strongly doubt your Groovy scripts are doing what they're supposed to be doingDon't run your test in GUI mode, it's only for tests development and debugging, when it comes to execution you should be using command-line non-GUI modeWhen you call__fifoPop()you can save the value into a JMeter Variable like${__fifoPop(queue-name,some-variable)}, the variable can be visualized usingDebug Sampler. The size of the queue can be checked using__fifoSize()functionAlternatively my expectation is that such a Groovy expert as you shouldn't have any problems printing queue items in Groovy code:\n"} +{"text": "### Human: We have an IBM MQ Internet Pass-Thru V2.1.0.1(MQIPT) configured within our organization that consumes the messages published by an external organization 'X'. The external organization 'X' has distributed this MQIPT to use within our premises. We are trying to consume the messages published by 'X' to an IBM MQ (fully licensed) hosted on their side via the MQIPT hosted in our premises.We have used the .NET library 'XMS.Net' (https://www.ibm.com/support/pages/xms-net-%E2%80%93-overview) to consume the messages via MQIPT. The licensing says it is free for a period of 90 days.In this configuration, what is the licensing requirement that we need for using the XMS.NET IBM C# library?Can anybody tell me if we need to purchase any licenses in addition to what 'X' already has? If yes, how much does it usually cost?\nI am trying to get help from IBM, but considering their prioritization, I hope I can get a quicker answer from here.### Assistant: Your question covers 2 separate products, MQ Client and MQ IPT.XMS.Net is part of the MQ Client for .Net, which is a free product:https://www.ibm.com/docs/en/ibm-mq/9.2?topic=information-mq-client-net-licenseBut MQIPT requires a license. Though I don't think it is licensed on its own, but as part of a full MQ license:\n\"If you have purchased IBM MQ entitlement, you can install as many copies as required of MQIPT. MQIPT installations are not counted against your purchased IBM MQ entitlement.\"https://www.ibm.com/docs/en/ibm-mq/9.1?topic=overview-mq-internet-pass-thruYou will need to ask IBM whether the MQ license of company X covers the MQIPT installations in your network (unlikely), or what is the minimum MQ license you need to purchase to use MQIPT.\n"} +{"text": "### Human: I wrote a console app on .NET, to read without consuming the messages from an IBM MQ queue.Worked perfect.Now, I need to migrate that app into .NET Core. Can't figure out why it is extremely slow.How it works:target framework .NET Core 3.1IBMMQDotNetClient NuGet package installedcreated a helper class, static, with a static constructor where I initialise MQEnvironment properties like so:MQEnvironment.CertificateLabel = \"ibmwebsphere\"; // this is the friendlyname on mmc certificate\n MQEnvironment.SSLKeyRepository = \"*SYSTEM\";added a method called Init where I initialise connection to MQManager like so:Hashtable properties = new Hashtable();\n properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\n properties.Add(MQC.HOST_NAME_PROPERTY, hostName); // I read the hostName from a config file\n properties.Add(MQC.PORT_PROPERTY, port); // I read the port from a config file\n properties.Add(MQC.CHANNEL_PROPERTY, channelName); // I read the channel from a config file\n properties.Add(MQC.SSL_CIPHER_SPEC_PROPERTY, cipherSpec); // I read the cipher spec from a config file, it's something like TLS_RSA_WITH_AES_256_CBC_SHA256Then, I'm going to create a connection to the queue manager using the connection, and read messages one by one until coming to end of the queue.var queueManager = new MQQueueManager(qm, properties); // I read the qm from a config file\nvar queue = queueManager.AccessQueue(queueName, MQC.MQOO_BROWSE + MQC.MQOO_FAIL_IF_QUIESCING); // I read the queueName from a config file\nvar mqGMO = new MQGetMessageOptions();\nmqGMO.Options = MQC.MQGMO_FAIL_IF_QUIESCING + MQC.MQGMO_NO_WAIT + MQC.MQGMO_BROWSE_NEXT; mqGMO.MatchOptions = MQC.MQMO_NONE;\n\n\ntry {\n\n while (true) {\n\n MQMessage queueMessage = new MQMessage();\n queue.Get(queueMessage, mqGMO); // code gets apparently stuck on this line, \n// overprocessing, for many minutes until it gets to the next line, \n// even though I mentioned \"NO_WAIT\" in the options. \n// Note this only happens for .NET Core, but not in .NET framework. \n var message = queueMessage.ReadString(queueMessage.MessageLength);\n string fileName = message.Substring(0,3); // some processing here to extract some info from each message\n }\n}\ncatch(MQException ex) \n{\n if(err.ReasonCode.CompareTo(MQC.MQRC_NO_MSG_AVAILABLE) == 0)\n {\n // harmless exception to indicate there are no messages on the queue\n }\n}\ncatch(Exception ex)\n{\n Console.WriteLine(ex);\n}Of course it would be preferable to use a listener, not sure how to do that yet, it would be part of optimising, but for now - why is working so slow on line:queue.Get(queueMessage, mqGMO);// but, again, as mentioned, only with the amqmdnetstd.dll (.NET Core), because if I use amqmdnet.dll (.NET framework), it works super fast, and it's supposed to be the other way around.I do need to use .NET Standard/Core because I will run this in Linux, currently testing in Windows.### Assistant: Don't use the MQEnvironment class as it is not threaded safe. Also, don't mix and match between MQEnvironment class and using MQ HashTable. Put your SSL/TLS information as a property in the MQ HashTable.i.e.properties.Add(MQC.SSL_PEER_NAME_PROPERTY, \"ibmwebsphere\");\nproperties.Add(MQC.SSL_CERT_STORE_PROPERTY, \"*SYSTEM\");There isn't enough of your code to test to see why it might be failing.I wrote and posted a blog item called:IBM MQ For .NET Core Primer. In the blog post, I included a fully functioning C# MQ example (MQTest62L.cs) that was built and run using .NET Core v3.1 and everything worked perfectly (see very bottom of post). Hence, I would suggest you follow my instructions, download, compile and run MQTest62L.cs to see if the issue is your code or MQ Client library.Note: I was using Windows 10 Pro, IBM MQ v9.2.0.0 and .NET Core v3.1.415.\n"} +{"text": "### Human: I am stuck at using SSL in IBM Websphere MQ (9.2).\nI am building a client library for MQ and to get more familiar with MQ on the server side I have installedIBM MQ Developer editionand ran the supplied scripts to create a 'default' MQ server instance.Created an client connection for theDEV.APP.SVRCONNserver connectionCreated apersonal certificateby using the IBM Key management tool and named itibmwebspheremqEnabled SSL on theQueue Manager(QM1) and labelled itibmwebspheremqUpdated the SSL configuration for theDEV.APP.SVRCONNchannel and set thecipherspecproperty toTLS 1.2, 256-bit Secure Hash Algorithm, 128-bit AES encryption (TLS_RSA_WITH_AES_128_CBC_SHA256)and made SSL required.Tested my settings with:amqssslc -l ibmwebspheremq -k C:\\ProgramData\\IBM\\MQ\\qmgrs\\QM1\\ssl\\key -c DEV.APP.SVRCONN -x 127.0.0.1 -s TLS_RSA_WITH_AES_128_CBC_SHA256 -m QM1And that gave me:Sample AMQSSSLC start\nConnecting to queue manager QM1\nUsing the server connection channel DEV.APP.SVRCONN\non connection name 127.0.0.1.\nUsing SSL CipherSpec TLS_RSA_WITH_AES_128_CBC_SHA256\nUsing SSL key repository stem C:\\ProgramData\\IBM\\MQ\\qmgrs\\QM1\\ssl\\key\nCertificate Label: ibmwebspheremq\nNo OCSP configuration specified.\nMQCONNX ended with reason code 2035Error details (from log):The active values of the channel were 'MCAUSER(app) CLNTUSER(Wilko)\nSSLPEER(SERIALNUMBER=61:9B:A4:3E,CN=DESKTOP-ROH98N2,C=NL)\nSSLCERTI(CN=DESKTOP-ROH98N2,C=NL) ADDRESS(DESKTOP-ROH98N2)'. The\nMATCH(RUNCHECK) mode of the DISPLAY CHLAUTH MQSC command can be used to\nidentify the relevant CHLAUTH record.\nACTION:\nEnsure that the application provides a valid user ID and password, or change\nthe queue manager connection authority (CONNAUTH) configuration to OPTIONAL to\nallow client applications to connect which have not supplied a user ID and\npassword. \n----- cmqxrmsa.c : 2086 -------------------------------------------------------\n22/11/2021 15:51:37 - Process(15880.45) User(MUSR_MQADMIN) Program(amqrmppa.exe)\n Host(DESKTOP-ROH98N2) Installation(Installation1)\n VRMF(9.2.3.0) QMgr(QM1)\n Time(2021-11-22T14:51:37.594Z)\n CommentInsert1(DEV.APP.SVRCONN)\n CommentInsert2(15880(1112))\n CommentInsert3(127.0.0.1)\n \nAMQ9999E: Channel 'DEV.APP.SVRCONN' to host '127.0.0.1' ended abnormally.\n\nEXPLANATION:\nThe channel program running under process ID 15880(1112) for channel\n'DEV.APP.SVRCONN' ended abnormally. The host name is '127.0.0.1'; in some cases\nthe host name cannot be determined and so is shown as '????'.\nACTION:\nLook at previous error messages for the channel program in the error logs to\ndetermine the cause of the failure. Note that this message can be excluded\ncompletely or suppressed by tuning the \"ExcludeMessage\" or \"SuppressMessage\"\nattributes under the \"QMErrorLog\" stanza in qm.ini. Further information can be\nfound in the System Administration Guide. \n----- amqrmrsa.c : 630 --------------------------------------------------------I am kind of stuck, I also saw in the log that there is PEER related info dumped, but I am not sing the SSLPEER settings (I just want to let everyone connect with the same certificate).EDIT 2:Output fromRUNMQSC QM1and commandDISPLAY QMGR CONNAUTH:1 : DISPLAY QMGR CONNAUTH\nAMQ8408I: Display Queue Manager details.\n QMNAME(QM1) CONNAUTH(DEV.AUTHINFO)Output fromRUNMQSC QM1and commandDISPLAY AUTHINFO(name-from-previous-command):3 : DISPLAY AUTHINFO(DEV.AUTHINFO)\nAMQ8566I: Display authentication information details.\n AUTHINFO(DEV.AUTHINFO) AUTHTYPE(IDPWOS)\n ADOPTCTX(YES) DESCR( )\n CHCKCLNT(REQDADM) CHCKLOCL(OPTIONAL)\n FAILDLAY(1) AUTHENMD(OS)\n ALTDATE(2021-11-18) ALTTIME(15.09.20)Output fromDISPLAY CHLAUTH(*):4 : DISPLAY CHLAUTH(*)\nAMQ8878I: Display channel authentication record details.\n CHLAUTH(DEV.ADMIN.SVRCONN) TYPE(USERMAP)\n CLNTUSER(admin) USERSRC(CHANNEL)\nAMQ8878I: Display channel authentication record details.\n CHLAUTH(DEV.ADMIN.SVRCONN) TYPE(BLOCKUSER)\n USERLIST(nobody)\nAMQ8878I: Display channel authentication record details.\n CHLAUTH(DEV.APP.SVRCONN) TYPE(ADDRESSMAP)\n ADDRESS(*) USERSRC(CHANNEL)\n CHCKCLNT(REQUIRED)\nAMQ8878I: Display channel authentication record details.\n CHLAUTH(SYSTEM.ADMIN.SVRCONN) TYPE(ADDRESSMAP)\n ADDRESS(*) USERSRC(CHANNEL)\nAMQ8878I: Display channel authentication record details.\n CHLAUTH(SYSTEM.*) TYPE(ADDRESSMAP)\n ADDRESS(*) USERSRC(NOACCESS)I was expecting not having to provide username and password when using certificates. What am I missing here?### Assistant: Your queue manager is configured to mandate passwords for any client connections that are trying to run with a resolved MCAUSER that is privileged. That is whatCHCKCLNT(REQDADM)on yourAUTHINFO(DEV.AUTHINFO)does.In addition, yourCHLAUTHrule for theDEV.APP.SVRCONNchannel has upgraded this further to mandate passwords forALLconnections using that channel.If your intent is to have channels that supply a certificate not be subject to this mandate, then you should add a further, more specific,CHLAUTHrule, something along these lines:-SET CHLAUTH(DEV.APP.SVRCONN) TYPE(SSLPEERMAP) +\n SSLPEER('SERIALNUMBER=61:9B:A4:3E,CN=DESKTOP-ROH98N2,C=NL') +\n SSLCERTI('CN=DESKTOP-ROH98N2,C=NL') CHCKCLNT(ASQMGR) USERSRC(CHANNEL)Bear in mind that if this connection is asserting a privileged user id, it will still be required to supply a password from the system-wide setting ofCHCKCLNT(REQDADM).Remember, if you are ever unsure whichCHLAUTHrule you are matching against, all those details you saw in the error message can be used to form aDISPLAY CHLAUTHcommand to discover exactly which rule you have matched. Read more about that inI\u2019m being blocked by CHLAUTH \u2013 how can I work out why?\n"} +{"text": "### Human: I am testing IBM MQ using JMeter and able to establish the connection with queue to send requests over it. However, I need to set\"JMS_IBM_LAST_MSG_IN_GROUP\"property as true for one of the message but unable to do so. I am using below piece of code while sending request or trying to set the property to true but it remains set to it's default value i.e. false when I am checking in backend. Any clue what I am missing here.Note: Connection is being established in another sampler and making use of that connection here. This code is working fine to send any request, just that property is not getting set to true.import java.time.Instant\nimport com.ibm.msg.client.jms.JmsConstants\n\ndef sess = System.getProperties().get(\"Session\") \ndef destination = System.getProperties().get(\"Destination\")\ndef producer = sess.createProducer(destination)\ndef rnd = new Random(System.currentTimeMillis())\ndef payload = String.format('${groupid}|${sequencenumber}|rest of the payload|')\n\ndef msg = sess.createTextMessage(payload) \nprintln('Payload --> ' + payload)\nmsg.setBooleanProperty(JmsConstants.JMS_IBM_LAST_MSG_IN_GROUP,true)\n\ndef start = Instant.now()\nproducer.send(msg)\ndef stop = Instant.now()\nproducer.close()\nSampleResult.setResponseData(msg.toString())\nSampleResult.setDataType( org.apache.jmeter.samplers.SampleResult.TEXT) \nSampleResult.setLatency( stop.toEpochMilli() - start.toEpochMilli())### Assistant: Your code does not include anything to set the Group ID or sequence number. I assume we have all the relevant code shown, in which case, I think you are missing code something along these lines:msg.setStringProperty(\"JMSXGroupID\", groupid);\nmsg.setIntProperty(\"JMSXGroupSeq\", sequencenumber);\n"} +{"text": "### Human: I have a consumer application that uses IBMMQ to consume messages from the queue manager. I have no control over the publisher, only the consumer. Here is the part of the code for my consumer:while(true) {\n message = (TextMessage) queueReceiver.receive(200);\n \n if (message != null) {\n messageFile = messageTypeToListenerMapping.get(type).generateMessageNameAndWriteToDisk(message.getText(), source, saveDirectory);\n } else {\n break;\n }This code works fine and is able to retrieve the message as aTextMessageobject for almost all of my queues except for one queue. When the application attempts to retrieve a message from this queue, I get this error:2021-10-05 22:12:31.831 DEBUG 30050 --- [nio-8181-exec-8] o.s.web.servlet.DispatcherServlet : GET \"/retrieveAllMessagesFromQueue\", parameters={}\n2021-10-05 22:12:31.832 DEBUG 30050 --- [nio-8181-exec-8] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to public java.util.Map>> ,\n2021-10-05 22:12:36.882 DEBUG 30050 --- [nio-8181-exec-8] .m.m.a.ExceptionHandlerExceptionResolver : Using @ExceptionHandler public Exception.ApiErrorResponse Octopus.controller.OctopusRestController.handleJmsException(javax.jms.JMSException)\n2021-10-05 22:12:36.899 DEBUG 30050 --- [nio-8181-exec-8] m.m.a.RequestResponseBodyMethodProcessor : Using 'application/json', given [*/*] and supported [application/json, application/*+json, application/json, application/*+json]\n2021-10-05 22:12:36.899 DEBUG 30050 --- [nio-8181-exec-8] m.m.a.RequestResponseBodyMethodProcessor : Writing [com.ApiErrorResponse@4be14d5e]\n2021-10-05 22:12:36.900 DEBUG 30050 --- [nio-8181-exec-8] .m.m.a.ExceptionHandlerExceptionResolver : Resolved [com.ibm.msg.client.jms.DetailedJMSException: JMSCMQ1049: The character set '1208(UTF-8) Unmappable Action: REPORT, Unmappable Replacement: 63, spaceByte: 32' cannot convert some or all of the string '[B@47412132'\nAn attempt was made to send or receive string data using a character set not capable of translating the strings content.\nOnly encode a message using a character set known to be appropriate for the string data being transmitted.]\n2021-10-05 22:12:36.901 DEBUG 30050 --- [nio-8181-exec-8] o.s.web.servlet.DispatcherServlet : Completed 500 INTERNAL_SERVER_ERRORAfter doing some debugging, I found that the error occurs when this code is executed:message.getText()I believe that perhaps the message being put into the queue by the publisher contains some sort of special characters which the application is unable to handle. So I tried to see if I could consume the message for this specific queue usingBytesMessageinstead. Here is the code below:BytesMessage byteMessage;\n\nbyteMessage = (BytesMessage) queueReceiver.receive(200);\nint TEXT_LENGTH = new Long(byteMessage.getBodyLength()).intValue();\nbyte[] text_bytes = new byte[TEXT_LENGTH];\nbyteMessage.readBytes(text_bytes, TEXT_LENGTH);\nString codePage = byteMessage.getStringProperty(WMQConstants.JMS_IBM_CHARACTER_SET);\nString textString = new String(text_bytes, codePage);\n\n if (textString != null) {\n messageFile = messageTypeToListenerMapping.get(type).generateMessageNameAndWriteToDisk(textString, source, saveDirectory)\n } else {\n break;\n }However I am coming across this error:2021-10-27 22:29:34.046 DEBUG 20987 --- [nio-8181-exec-1] o.s.web.servlet.DispatcherServlet : Failed to complete request: java.lang.ClassCastException: com.ibm.jms.JMSTextMessage cannot be cast to javax.jms.BytesMessage\n2021-10-27 22:29:34.053 ERROR 20987 --- [nio-8181-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.ClassCastException: com.ibm.jms.JMSTextMessage cannot be cast to javax.jms.BytesMessage] with root cause\njava.lang.ClassCastException: com.ibm.jms.JMSTextMessage cannot be cast to javax.jms.BytesMessageFrom what I understand, the message cannot be casted fromTextMessagetoByteMessage, which also means that the publisher sent the message as aTextMessage. If the publisher sent the message as aTextMessage, then why am I coming across this issue in the first place? I am a bit confused with all of this and would appreciate some guidance.EDIT:\nI have ranamqsbcgas requested by @MoragHughson and here are the details to one of the messages:MQGET of message number 14861, CompCode:0 Reason:0\n****Message descriptor****\n\n StrucId : 'MD ' Version : 2\n Report : 0 MsgType : 8\n Expiry : -1 Feedback : 0\n Encoding : 546 CodedCharSetId : 1208\n Format : 'MQSTR '\n Priority : 0 Persistence : 1\n MsgId : X'414D5120514D2E44303014D5120514D2E443030A0EF121'\n CorrelId : X'000000000000000000000000000000000000000000000000'\n BackoutCount : 0\n ReplyToQ : ' '\n ReplyToQMgr : 'QM.1010101_4642 '\n ** Identity Context\n UserIdentifier : 'user2 '\n AccountingToken :\n X'0A31303030303639333331639333331639333331004568490000000000000006'\n ApplIdentityData : ' '\n ** Origin Context\n PutApplType : '6'\n PutApplName : 'mqm_sender '\n PutDate : '00000000' PutTime : '00000000'\n ApplOriginData : ' '\n\n GroupId : X'000000000000000000000000000000000000000000000000'\n MsgSeqNumber : '1'\n Offset : '0'\n MsgFlags : '0'\n OriginalLength : '-1'\n\n**** Message ****\n\n length - 64 of 64 bytes\n\n00000000: 0000 0000 B3DC B059 6400 0000 524D 5320 '.....\u0730Yd...RMS '\n00000010: 2052 3235 3139 3435 3734 3437 3030 3030 ' R25194574470000'\n00000020: 3120 2020 2020 2020 2020 2020 2020 2032 '1 2'\n00000030: 3032 3131 3032 3231 3431 3333 3730 3020 '021102214133700 '\n\n\n\n No more messages\n MQCLOSEIt appears that the CodedCharSetId is 1208, which seems to be UTF-8. If that is the case, then TextMessages should work fine if i am not mistaken?### Assistant: So, you have an interesting problem & I've been down this road before.It is the opposite of what George Costanza from Friends would say: \"it's me not you\". In your case, it is the sender and not you.There are 3 important pieces of information from the amqsbcg dump:Encoding : 546 CodedCharSetId : 1208\nFormat : 'MQSTR '\n00000000: 0000 0000 B3DC B059 6400 0000 524D 5320 '.....?Yd...RMS '(1) That message is not a JMS (aka MQRFH2) message but JMS/MQ layer will turn it into a JMS message for the application.If the MQMD Format field is set to \"MQSTR \" then the MQ/JMS layer will create a TextMessage.If the MQMD Format field is set to \" \" (all blank) then the MQ/JMS layer will create a BytesMessage.(2) Since the incoming message's MQMD Format field is set to \"MQSTR \", the JMS/MQ layer will attempt to convert it from the CCSID of 1208 to the CCSID of your JVM. The problem comes from the fact that you have non-alphanumeric data in your message. Lots of binary zeroes in the first 12 bytes.You have 2 options:(1) Ask the sender to stop including non-alphanumeric data in the message.(2) If the non-alphanumeric data is important then tell the sender to set the message's MQMD Format field to \" \" (all blank). Then when you get the message, you simply cast it as BytesMessage.Most likely some junior programmer copied code from StackOverflow or somewhere else and used it without understanding what the code did.Note to future MQ developers/programmers:If your message payload has non-alphanumeric data thennever everset the message's MQMD Format field to \"MQSTR \".\n"} +{"text": "### Human: I have a remote IBM MQ instance set up with 2 queues. Behind them is a System Under Test which always picks up messages put on the INBOUND.QUEUE\" does some processing and places a response message on the \"OUTBOUND.QUEUE\".I wish to test the response times of this SuT. To achieve this I need to put in place this scenario:JMeter sends some message with ID1 to a queue named \"INBOUND.QUEUE\"The System under test takes the message from \"INBOUND.QUEUE\", does some processing and places the response on \"OUTBOUND.QUEUE\"JMeter checks and asserts that a response has been received for the message with ID1 on the queue named \"OUTBOUND.QUEUE\" within X secondsView response time results in Aggregate Report ListenerIn JMeter I have a setup very similar to the one described in thisarticle, using JSR223 test elements with groovy code to interact with the IBM MQ Queues - throughJMS, if my understanding is correct. The difference from the article is that in order to consume messages from the outbound queue, I have another setUp Thread Group which sets up another connection for the \"OUTBOUND.QUEUE\" from which I consume the messages and another tearDown Thread Group which closes this connection at the end.On a high-level my setup looks like this:It works so far, but it blindly consumes messages and I need to ensure that I'm reading (consuming) the response continuation of each initial message so that I may calculate the response or processing time of the SuT for each complete request-response flow.\nI understood that I can useJMS Correlation IDfor this purpose but I don't know how.What method can I use to get this Correlation ID at message creation and consumption time?Do I need some data structure to put all the Correlation IDs at the message creation time so that I can put a condition like IF msg.getStringProperty(\"JMS_CorreationID\") is IN list of produced ids, remove it from this data structure, then get the JMS_IBM_PUTTIME property to determine the timestamp for the \"first\" message, then finally calculate the timestamp delta between the current time and the time for the first message ?Once I would do this, how can I configure the JSR223 Sampler (Consumer) in the 2nd Thread Group viaSampleResultclass instance so it would report not its own execution time but the delta between JMS_IBM_PUTTIME and the current time (which would represent the processing time)?Finally, once this is done, how can I include into the load test report only this 2nd JSR223 Sampler (Consumer)?Is this logic correct/too complex?\nAny help or some code examples would be greatly appreciated.### Assistant: Normally you're supposed to be asking only one question in one post, I don't think anyone is willing to write a book to answer all the questions you have (and doing your job for you for free)If you want to use JMS Correlation ID you need to explicitly callMessage.setJMSCorrelationID()function in the producer and correspondingly read it asMessage.getJMSCorrelationID()in the consumerYep, you can either useInter-Thread Communication Pluginorpropsshorthand forJMeter Propertiesclass instanceYou can useJSR223 PostProcessor, add it as a child of the JSR223 Sampler and useprev.elapsedTime = 123456, replace123456with the actual delta between sent and received message with the given correlation IDYou can useSampleResult.setIgnore()function, this way the JSR223 Sampler where you call this function will neither be displayed in Listeners nor in .jtl results file.\n"} +{"text": "### Human: I have a local IBM MQ instance set up with some default queues.Using JMeter 5.4.1, I first want to send messages to one of these queues to test that the connection works.1. Is it possible with IBM MQ or does it only work with Active MQ?The test scenario I wish to achieve is this:JMeter sends some message with ID1 to a queue named \"DEV.QUEUE.1\"The System under test takes the message from \"DEV.QUEUE.1\", does some processing and places the response on \"DEV.QUEUE.2\"JMeter checks and asserts that a response has been received for the message with ID1 on the queue named \"DEV.QUEUE.2\" within X secondsView results in Aggregate Report2. Is this achievable with JMS Point-to-Point Sampler?I've checked the official JMeter documentation, but I don't understand what connection details I need to place in each of the sampler's configuration fields.JMS Resources\nQueueConnection Factory:\nJNDI name Request queue:\nJNDI name Receive queue:\nNumber of samples to aggregate\nJMS Selector\n....\netc...I was able to connect to one queue and send messages using custom code in a JSR223 Sampler.\nThese are the connection details I have used to create the connection:def hostName = \"127.0.0.1\"\ndef hostPort = 1414\ndef channelName = \"DEV.APP.SVRCONN\"\ndef queueManagerName = \"QM1\"\ndef queueName = \"DEV.QUEUE.1\"\n\ndef ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER)\ndef cf = ff.createConnectionFactory()\n\ncf.setStringProperty(WMQConstants.WMQ_HOST_NAME, hostName)\ncf.setIntProperty(WMQConstants.WMQ_PORT, hostPort)\ncf.setStringProperty(WMQConstants.WMQ_CHANNEL, channelName)\ncf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT)\ncf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, queueManagerName)\n\ndef connInboundQueue = cf.createConnection(\"mquser\", \"secretpassword\")\ndef sessInboundQueue = connInboundQueue.createSession(false, Session.AUTO_ACKNOWLEDGE)\ndef destinationInboundQueue = sessInboundQueue.createQueue(queueName)\nconnInboundQueue.start()I'm guessing that I can map these connection credentials to this JMS Point-to-Point Sampler so that I can achieve the same connection, I just don't know how.So to sum up:1a. How can I achieve connection to my two queues using the JMS Point-to-Point Sampler?2a. How can the JMS Point-to-Point Sampler be configured for the scenario I have described above?I would appreciate any help.### Assistant: I don't think it's currently possible, the options are in:Usemqmeter - MQ JMeter Extension, it will provide a customJava RequestsamplerContinue with JSR223 Test Elements, example producer and consumer code snippets can be found inIBM MQ testing with JMeter - Learn Howarticle\n"} +{"text": "### Human: Hi I am trying to IBM MQ using JMS. I am getting below errorJMSWMQ0018: Failed to connect to queue manager 'SM2T' with connection mode 'Client' and host name 'null'Here is my code:public void putMessageToqueue() throws JMSException {\n JMSContext context = null;\n Destination destination = null;\n JMSProducer producer = null;\n JMSConsumer consumer = null;\n \n JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\n JmsConnectionFactory cf = ff.createConnectionFactory();\n\n // Set the properties\n cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, queueHost);\n cf.setIntProperty(WMQConstants.WMQ_PORT, port);\n cf.setStringProperty(WMQConstants.WMQ_CHANNEL, queueChannel);\n cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\n cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, queueManager);\n cf.setStringProperty(WMQConstants.WMQ_APPLICATIONNAME, \"JmsPutGet (JMS)\");\n cf.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, true);\n cf.setStringProperty(WMQConstants.USERID, queueUser);\n cf.setStringProperty(WMQConstants.PASSWORD, queueUser);\n cf.setStringProperty(WMQConstants.WMQ_SSL_CIPHER_SUITE, \"TLS_RSA_WITH_AES_128_CBC_SHA256\");\n cf.setStringProperty(\"javax.net.ssl.trustStore\", trustStore);\n cf.setStringProperty(\"javax.net.ssl.keyStore\", trustStore);\n cf.setStringProperty(\"javax.net.ssl.keyStorePassword\", \"\");\n cf.setStringProperty(\"com.ibm.mq.cfg.useIBMCipherMappings\", \"false\");\n \n \n context = cf.createContext();\n destination = context.createQueue(\"queue:///\" + queueName);\n\n long uniqueNumber = System.currentTimeMillis() % 1000;\n TextMessage message = context.createTextMessage(\"Your lucky number today is \" + uniqueNumber);\n producer = context.createProducer();\n producer.send(destination, message);\n System.out.println(\"Sent message:\\n\" + message);\n\n context.close();\n\n //recordSuccess();\n \n }### Assistant: There are a bunch of issues with your code. It looks like you copied & pasted code from a couple of different sources but you left out some important code.Problems:I don't see where you created a connectionI don't see where you started the connectionI don't see where you created a sessionThe TLS/SSL trusted store & key store values do not belong to the connection factory but rather they should be JVM system environment variables.i.e.System.setProperty(\"javax.net.ssl.trustStore\", trustedStore);\nSystem.setProperty(\"javax.net.ssl.trustStorePassword\", trustedStorePasswd);\n\nSystem.setProperty(\"javax.net.ssl.keyStore\", keyStore);\nSystem.setProperty(\"javax.net.ssl.keyStorePassword\", keyStorePasswd);Also, if you are using a trusted store or key store then itMUSThave a valid password. And you only need a key store if you are using mutual authentication.The IBM Cipher Mappings value does not belong to the connection factory but rather it should be JVM system environment variable.i.e.System.setProperty(\"com.ibm.mq.cfg.useIBMCipherMappings\", \"false\");Note: JVM system environment variables can be externized to the Java application and passed on the command line.java -Djavax.net.ssl.trustStore=mytrustedstore -Djavax.net.ssl.trustStorePassword=mytrustedstorepwd -Dcom.ibm.mq.cfg.useIBMCipherMappings=false blah blah blahHere is a fully functioning MQ/JMS application that builds the connection factory from scratch.import java.text.SimpleDateFormat;\nimport java.util.Date;\nimport java.util.Hashtable;\n\nimport javax.jms.*;\n\nimport com.ibm.msg.client.jms.*;\nimport com.ibm.msg.client.wmq.*;\n\n/**\n * Program Name\n * MQTestJMS51\n *\n * Description\n * This java JMS class will connect to a remote queue manager and put a message to a queue.\n * This code will create the Connection Factory from scratch.\n *\n * Sample Command Line Parameters\n * -m MQA1 -h 127.0.0.1 -p 1414 -c TEST.CHL -q TEST.Q1 -u UserID -x Password\n *\n * @author Roger Lacroix\n */\npublic class MQTestJMS51\n{\n private static final SimpleDateFormat LOGGER_TIMESTAMP = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss.SSS\");\n private Hashtable params;\n\n public MQTestJMS51()\n {\n super();\n params = new Hashtable();\n }\n\n /**\n * Make sure the required parameters are present.\n * @return true/false\n */\n private boolean allParamsPresent()\n {\n boolean b = params.containsKey(\"-h\") && params.containsKey(\"-p\") &&\n params.containsKey(\"-c\") && params.containsKey(\"-m\") &&\n params.containsKey(\"-q\") &&\n params.containsKey(\"-u\") && params.containsKey(\"-x\");\n \n return b;\n }\n\n /**\n * Extract the command-line parameters and initialize the MQ variables.\n * @param args\n * @throws IllegalArgumentException\n */\n private void init(String[] args) throws IllegalArgumentException\n {\n if (args.length > 0 && (args.length % 2) == 0)\n {\n for (int i = 0; i < args.length; i += 2)\n {\n params.put(args[i], args[i + 1]);\n }\n }\n else\n {\n throw new IllegalArgumentException();\n }\n\n if (!allParamsPresent())\n {\n throw new IllegalArgumentException();\n }\n }\n\n /**\n * Create a connection to the queue manager then publish a message to a queue.\n */\n private void handleIt() \n {\n Connection conn = null;\n Session session = null;\n Destination destination = null;\n MessageProducer producer = null;\n \n try\n {\n /*\n * Set JVM system environment variables\n */\n System.setProperty(\"com.ibm.mq.cfg.useIBMCipherMappings\", \"false\");\n \n// System.setProperty(\"javax.net.ssl.trustStore\", trustedStore);\n// System.setProperty(\"javax.net.ssl.trustStorePassword\", trustedStorePasswd);\n \n JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\n JmsConnectionFactory cf = ff.createConnectionFactory();\n\n // Set the properties\n cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, (String) params.get(\"-h\"));\n try\n {\n cf.setIntProperty(WMQConstants.WMQ_PORT, Integer.parseInt((String) params.get(\"-p\")));\n }\n catch (NumberFormatException e)\n {\n cf.setIntProperty(WMQConstants.WMQ_PORT, 1414);\n }\n \n cf.setStringProperty(WMQConstants.WMQ_CHANNEL, (String) params.get(\"-c\"));\n cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\n cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, (String) params.get(\"-m\"));\n cf.setStringProperty(WMQConstants.WMQ_APPLICATIONNAME, \"MQTestJMS51\");\n cf.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, true);\n \n cf.setStringProperty(WMQConstants.USERID, (String) params.get(\"-u\"));\n cf.setStringProperty(WMQConstants.PASSWORD, (String) params.get(\"-x\"));\n \n// cf.setStringProperty(WMQConstants.WMQ_SSL_CIPHER_SUITE, \"TLS_RSA_WITH_AES_128_CBC_SHA256\");\n \n conn = cf.createConnection((String) params.get(\"-u\"), (String) params.get(\"-x\"));\n logger(\"created connection.\");\n \n // Start the connection\n conn.start();\n logger(\"started connection.\");\n\n session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);\n logger(\"created session.\");\n\n /*\n * targetClient=0 means it is sending a JMS message\n * targetClient=1 means it is sending an MQ message (non JMS)\n */\n destination = session.createQueue(\"queue://\" + (String) params.get(\"-m\") + \"/\" + (String) params.get(\"-q\") + \"?targetClient=0\");\n logger(\"created destination.\");\n\n producer = session.createProducer(destination);\n logger(\"created producer.\");\n \n sendMsg(session, producer);\n }\n catch (JMSException e)\n {\n if (e != null)\n {\n logger(e.getLocalizedMessage());\n e.printStackTrace();\n \n Exception gle = e.getLinkedException();\n if (gle != null)\n logger(gle.getLocalizedMessage());\n }\n }\n finally\n {\n try\n {\n if (producer != null)\n {\n producer.close();\n logger(\"closed producer.\");\n }\n }\n catch (Exception e)\n {\n logger(\"producer.close() : \" + e.getLocalizedMessage());\n }\n\n try\n {\n if (session != null)\n {\n session.close();\n logger(\"closed session.\");\n }\n }\n catch (Exception e)\n {\n logger(\"session.close() : \" + e.getLocalizedMessage());\n }\n\n try\n {\n if (conn != null)\n {\n conn.stop();\n logger(\"stopped connection.\");\n }\n }\n catch (Exception e)\n {\n logger(\"conn.stop() : \" + e.getLocalizedMessage());\n }\n\n try\n {\n if (conn != null)\n {\n conn.close();\n logger(\"closed connection.\");\n }\n }\n catch (Exception e)\n {\n logger(\"connection.close() : \" + e.getLocalizedMessage());\n }\n }\n }\n\n /**\n * Send a message to a queue.\n */\n private void sendMsg(Session session, MessageProducer producer)\n {\n try\n {\n long uniqueNumber = System.currentTimeMillis() % 1000;\n TextMessage msg = session.createTextMessage(\"Your lucky number today is \" + uniqueNumber);\n\n producer.send(msg);\n logger(\"Sent message: \" + msg);\n }\n catch (JMSException e)\n {\n if (e != null)\n {\n logger(e.getLocalizedMessage());\n e.printStackTrace();\n \n Exception gle = e.getLinkedException();\n if (gle != null)\n logger(gle.getLocalizedMessage());\n }\n }\n }\n\n /**\n * A simple logger method\n * @param data\n */\n public static void logger(String data)\n {\n String className = Thread.currentThread().getStackTrace()[2].getClassName();\n\n // Remove the package info.\n if ( (className != null) && (className.lastIndexOf('.') != -1) )\n className = className.substring(className.lastIndexOf('.')+1);\n\n System.out.println(LOGGER_TIMESTAMP.format(new Date())+\" \"+className+\": \"+Thread.currentThread().getStackTrace()[2].getMethodName()+\": \"+data);\n }\n\n /**\n * main line\n * @param args\n */\n public static void main(String[] args)\n {\n logger(\"starting...\");\n try\n {\n MQTestJMS51 tj = new MQTestJMS51();\n tj.init(args);\n tj.handleIt();\n }\n catch (IllegalArgumentException e)\n {\n logger(\"Usage: java MQTestJMS51 -m QueueManagerName -h host -p port -c channel -q Queue_Name -u UserID -x Password\");\n }\n catch (Exception e)\n {\n logger(e.getLocalizedMessage());\n e.printStackTrace();\n }\n logger(\"ending...\");\n }\n}\n"} +{"text": "### Human: I'm trying to install MQ source & sink connectors for our confluent cloud. I've done this for on-prem apache kafka but doing the same of cloud seems to be different. Following the confluent documents says I need to have a platform installed on my local, which I did, and then to run a confluent-hub install which does install the connector on my local and then use the json for distributed instance.\nMy problem is when I run the json, it says the class for mq was not found, I tried to point the CLASSPATH to the dir where the jars are but still get the same error. How do I run this successfully?--\nERROR Uncaught exception in REST call to /connectors (org.apache.kafka.connect.runtime.rest.errors.ConnectExceptionMapper:61)\norg.apache.kafka.connect.errors.ConnectException: Failed to find any class that implements Connector and which name matches io.confluent.connect.ibm.mq.IbmMQSourceConnector,Also want to understand how installing connector on local would apply to my cloud cluster? Not sure what I'm missing!### Assistant: Confluent Cloud doesn't support custom connector installation, last I checked. They need to explicitly support and offer it.I assume you're reading some documentation that indicates you need to run your own Connect cluster (not necessarily locally), where you have full control over the connectors that are installed\n"} +{"text": "### Human: I'm using .NET Core to write a Worker Service (Worker Services in .NET) which will connect to a IBM MQ queue to read messages of it. This will be done continuously in a long running process (process will be running until service is stopped).My questing is: What kind ofconnection-strategy is the recommendedusage when runninglong processeswith IBM MQ?I see three alternatives:One connection throughout the application lifetimeOpen the connectiononceat application start. Keep reading messages of the\nqueue. Close the connection when the application stops. If the\nconnection accidentally stops, use the appropriate autoconnect flags\nto reconnect to the queue automatically (if possible).Open a new connection for every read from the queueEvery time we need to read from the queue, open a new connection to the queue and queue-manager and read one message. Close both connections when reading is done.Open a new connection and process items in the queue until emptyOpen a connection when we want to process messages. Process all messages in the queue until all messages are processed. When all messages are processed, close the connection.Alternative two doesn't seem like an option. But what is therecommendedconnection procedure in this scenario for both queueandqueue-manager?### Assistant: Although not the \"official\" connection procedure for a long running connection, I settled onoption 1:One connection throughout the application lifetimewith the appropriate connection-flags for handling automatic reconnect.\n"} +{"text": "### Human: I am new to MQ and I am using thisdocker imagewith the default setting.\nI need to connect through a java application (but without websphere).I use theappuser. This one can connect to the \"DEV.APP.SVRCONN\" channel without problem but i need to create a temporary queue (in order to get a response) and it fail to create it with the following error :JMSWMQ2008: Failed to open MQ queue 'SYSTEM.DEFAULT.MODEL.QUEUE'Cause by this error :com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED').I checked with the MQ Manager and the \"SYSTEM.DEFAULT.MODEL.QUEUE\" does not exist, should i need to create it ?### Assistant: According to theDefault developer configuration, users inmqclientgroup (which will be what you are using) have been given access to all queues and topics starting withDEV.**and haveput,get,pub,sub,browseandinqpermissions.You are trying to use a queue that does not start withDEV.**so you will first need to set appropriate authority for the users in themqclientgroup to do this. They will also needdspauthority in order to create a temporary queue from a model.SET AUTHREC GROUP('mqclient') OBJTYPE(QUEUE) PROFILE(SYSTEM.DEFAULT.MODEL.QUEUE) AUTHADD(GET,PUT,DSP)\n"} +{"text": "### Human: I need to test the performance of messages which are sent on one \"inbound\" MQ1 and then later (after some processing) received on another outbound MQ2.\nI need to somehow generate a report similar to Aggregate Report Listener in Jmeter to display the average \"response time\" or \"processing time\" (that is the time between when a message with a given unique ID was placed on an inbound queue and when a different message with the same unique id was consumed from a different outbound MQ) and the Throughput.\nI believe this falls into the Asynchronous category.I have some Jmeter experience and limited scripting knowledge - I am hoping to use this tool to solve my problem using the inter-thread-communication-plugin-in-jmeter.Inspired by the example and comments fromthisandthisarticles,\nmy current high-level approach is to have a thread group controlling the insertion of messages on the inbound queue using the JSR223 Sampler with groovy code and another thread group controlling the consumption of messages from another outbound queue.\nI have set up the scripts to put and consume messages, but I am having difficulties in implementing the part with moving the information from one thread to the other and also to \"conditionally\" consume the message from the outbound queue only if it contains the unique message which I am looking for based on a variable generated by the 1st Thread group. If the message id is not found in 4 seconds I would like to throw an assertion and fail the sampler.In Jmeter, in the Test Plan element I have defined a \"message\" variable.\nIn the JSR223 Sampler I use vars.put(\"message\", payload) to get the message content just before sending it to the Inbound queue (using producer.send(msg)) and then use it in Jmeter \"Response Assertion\" with \"text message\" selection and \"Not Equals\" just to execute this pattern ${__fifoPut(input_queue,${message})} which puts the message value to an FIFO \"input_queue\" (inter-thread-communication-plugin-in-jmeter).Now, once I put this message in the FIFO queue, in the 2nd Tread that consumes the messages from the outbound queue I need some way to call ${__fifoPop(input_queue,${message})} in the script (and this does not work in the JSR223 Sampler) but only if the content of the message has the message Id that I am looking for in order to map the 1st message on queue1 with one of the messages from queue2. However in the script, I use consumer.receive(1000) method which directly consumes the message and thus removes it from the queue. Is there any way to just read messages from the queue without consuming them?Problems summary:My first problem is to solve the synchronization issue of one message sent to MQ1 by thread1 with another message consumed from MQ2 by thread2.The 2nd problem is how to calculate the time difference between when a message was placed on MQ1 and when the corresponding same message was received/consumed on the MQ2.The 3rd problem is how to display this information in the same way as the Aggregate Report would in Jmeter. I would need to prove that a certain message was sent and received/consumed within x seconds under system load + calculate the Throughput in transactions per second.Does anyone know how I could solve these issues?### Assistant: Why would you need the \"synchronization\" given you're testing an \"asynchronous\" system? If you want to ensure that you're reading the continuation of the initial message you can consider usingJMS Correlation IDfor thisTheIBM MQ testing with JMeter - Learn How(referenced by you, by the way) suggests usingJMS_IBM_PUTDATEandJMS_IBM_PUTTIMEproperties to determine the timestamp for the \"first\" messageGiven you have timestamp delta between the current time and the time for the first message sending you can configure the JSR223 Sampler in 2nd Thread Group viaSampleResultclass instance so it would report not its own execution time but the delta betweenJMS_IBM_PUTTIMEand the current time. Once done you can include into your load test report only this 2nd JSR223 Sampler\n"} +{"text": "### Human: we start using pymqi instead of the java implementation.\nin java we had the option for 'QueueManager.close()'.is there an option to close the queue manager using pymqi?\nI saw that inside __ del __ function we close the queue manager and then call disconnect, what if I want just to close without disconnecting? (also, I don't want to set the disconnect_on_exit to False, just want to have an option to call only to close)### Assistant: What do you think that calling Close on a qmgr is meant to do? There's not really any such operation defined.In the MQI, the only time you need to MQCLOSE an object is after you have MQOPENed it. And the only useful thing you can do with an MQOPEN on the qmgr object is to do an MQINQ against it. There's no QueueManager.open() function defined in this wrapper.In the pymqi implementation, it looks like the QueueManager.inquire() function internally does an MQOPEN for the qmgr object and stashes the resultant hObj, It then does the corresponding MQCLOSE during the disconnect process. So that's why it doesn't need to be exposed.\n"} +{"text": "### Human: We have multiple application environments (development, QA, UAT, etc) that need to connect to fewer provider environments through MQ. For example, the provider only has one test (we'll call it TEST1) environment to which all of the client application environments need to interact. It is imperative that each client environment only receives MQ responses to the messages sent by that respective environment. This is a high volume scenario so correlating message IDs has been ruled out.Right now TEST1 has a queue set up and is functional, but if one of the client app's environments wants to use it the others have to be shut off so that messaging doesn't overlap.Does MQ support a model having multiple clients connect to a single queue while preserving the client-specific messaging? If so, where is that controlled (i.e. the channel, queue manager, etc)? If not, is the only solution to set up additional queues for each corresponding client?### Assistant: Over the many years I have worked with IBM MQ, I have gone back and forth on this issue. I've come to the conclusion that sharing a queue just makes life more difficult. Queues should be handed out like candy on Halloween. If an application team says that they have 10 components to their application then the MQAdmin should give them 10 queues. To the queue manager or server or CPU or hard disk, there is no difference in resource usage.Also, use an MQ naming standard that makes sense and is easy to apply security to. i.e. for HR (Human Resource) departmentHR.PAYROLL.SALARYHR.PAYROLL.DEDUCTIONSHR.PAYROLL.BENEFITSHR.EMPLOYEE.DETAILSHR.EMPLOYEE.REVIEWSetc...\n"} +{"text": "### Human: I have a Spring application and I want to connect to IBM MQ usingJmsListener. This is my configuration:package com.in28minutes.example.layering.model;\n\nimport com.ibm.mq.jms.JMSC;\nimport com.ibm.mq.jms.MQQueueConnectionFactory;\nimport org.springframework.beans.factory.annotation.Qualifier;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.jms.annotation.EnableJms;\nimport org.springframework.jms.config.DefaultJmsListenerContainerFactory;\nimport org.springframework.jms.config.JmsListenerContainerFactory;\nimport org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter;\n\nimport javax.jms.ConnectionFactory;\n\n@Configuration\n@EnableJms\npublic class Qm1Config {\n\n @Bean\n public MQQueueConnectionFactory qm1ConnectionFactory() {\n MQQueueConnectionFactory cf = new MQQueueConnectionFactory();\n try {\n cf.setHostName(\"localhost\");\n cf.setPort(1414);\n cf.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);\n cf.setQueueManager(\"QM1\");\n cf.setChannel(\"DEV.ADMIN.SVRCONN\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n return cf;\n }\n\n @Bean\n UserCredentialsConnectionFactoryAdapter userCredentialsConnectionFactoryAdapter(@Qualifier(\"qm1ConnectionFactory\") ConnectionFactory connectionFactory) {\n UserCredentialsConnectionFactoryAdapter userCredentialsConnectionFactoryAdapter = new UserCredentialsConnectionFactoryAdapter();\n userCredentialsConnectionFactoryAdapter.setUsername(\"admin\");\n userCredentialsConnectionFactoryAdapter.setPassword(\"passw0rd\");\n userCredentialsConnectionFactoryAdapter.setTargetConnectionFactory(connectionFactory);\n return userCredentialsConnectionFactoryAdapter;\n }\n\n @Bean\n public JmsListenerContainerFactory qm1JmsListenerContainerFactory(@Qualifier(\"userCredentialsConnectionFactoryAdapter\") UserCredentialsConnectionFactoryAdapter userCredentialsConnectionFactoryAdapter) {\n DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();\n factory.setConnectionFactory(userCredentialsConnectionFactoryAdapter);\n return factory;\n }\n}This is my consumer:package com.in28minutes.example.layering.model;\n\nimport org.springframework.jms.annotation.JmsListener;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class QueueConsumer {\n\n @JmsListener(destination = \"DEV.QUEUE.1\", containerFactory = \"qm1JmsListenerContainerFactory\")\n public void receive1(String text) {\n System.out.println(\"Received from qm1: \" + text);\n }\n\n}I have deployed the application into TomEE plus container, and I have sent few messages to the queue:I have also added the below entries in the servlet-context.xml\n\n \n \nHowever, application did not consume these messages. How do I fix this?Update#1I have annotated the consumer class with @EnableJMS@Component\n@EnableJms\npublic class QueueConsumer {\n\n @JmsListener(destination = \"DEV.QUEUE.1\", containerFactory = \"qm1JmsListenerContainerFactory\")\n public void receive1(String text) {\n System.out.println(\"Received from qm1: \" + text);\n }\n\n}still I am not getting the messages### Assistant: can you try adding@EnableJmson QueueConsumer class?\n"} +{"text": "### Human: Any help or hint would be greatly appreciated it!!Where is the IBM MQ logs locate on the solaris box MQ SERVER ?Based on ibm documentation:\nBased on ibm documentation online url there should be an errors folder.https://www.ibm.com/docs/en/ibm-mq/9.1?topic=windows-error-log-directories### Assistant: As JoshMc said, the queue manager related information is under /var/mqm/ directory.i.e./var/mqm/errors/directory has log files for general MQ issues and where you will find FDC files./var/mqm/qmgrs/{QMgrName}/errors/directory contains the log files related to a particular queue manager.\n"} +{"text": "### Human: We're running Websphere MQ 9.1 and our Telemetry (MQTT) channel is configured to require SSL Authentication.Our certificates have lifespans of just a few months and we want to automate the process of replacing these certificates. I can easily create a new .kdb file and place in the SSLKEYR location, but this doesn't automatically make the channel use the new certificates.I have tried theREFRESH SECURITY TYPE(SSL)command and this command succeeds (output:AMQ8560I: IBM MQ security cache refreshed.) I would think thisshouldwork, see:https://www.ibm.com/docs/en/ibm-mq/9.1?topic=authorities-refreshing-tls-securityRefreshing TLS securityIf you make a change to the key repository, you can refresh the copy of the key repository that is held in memory while a channel is running, without restarting the channel. When you refresh the cached copy of the key repository, the TLS channels that are currently running on the queue manager are updated with the new information.About this taskWhen a channel is secured using TLS, the digital certificates and their associated private keys are stored in the key repository. A copy of the key repository is held in memory while a channel is running. If you make a change to the key repository, you can refresh the copy of the key repository that is held in memory without restarting the channel.When you refresh the cached copy of the key repository, all TLS channels that are currently running are updated:Sender, server, and cluster-sender channels that use TLS are allowed to complete the current batch of messages. The channels then run the SSL handshake again with the refreshed view of the key repository.All other channel types that use TLS are stopped. If the partner end of the stopped channel has retry values defined, the channel retries and runs the SSL handshake again. The new SSL handshake uses the refreshed view of the contents of the key repository, the location of the LDAP server to be used for the Certificate Revocation Lists, and the location of the key repository. In the case of server-connection channel, the client application loses its connection to the queue manager and has to reconnect to continue.However - when I replace the KDB with a keyrepository with different certificates and I refresh the security, my clients still reconnect after I purge them from the channel. When I restart the channel, the clients stay offline as expected.Why doesn't refresh security work in this case (because its a telemetry channel?) and is there a way to solve this puzzle without stopping and starting the channel?### Assistant: In IBM MQ, MQTT components are called MQXR. There are 3 log files you can check:(1)Windows: {MQ_DATA_PATH}\\qmgrs\\{qmgr_name}\\mqxr.stdout\nWindows: {MQ_DATA_PATH}\\qmgrs\\{qmgr_name}\\mqxr.stderr\n\nUnix: {MQ_DATA_PATH}/qmgrs/{qmgr_name}/mqxr.stdout\nUnix: {MQ_DATA_PATH}/qmgrs/{qmgr_name}/mqxr.stderr(2)Windows: {MQ_DATA_PATH}\\qmgrs\\{qmgr_name}\\errors\\mqxr_0.log\n\nUnix: {MQ_DATA_PATH}/qmgrs/{qmgr_name}/errors/mqxr_0.logThe log file mqxr_0.log should have any error messages related to refreshing security.Here's an interesting note from theMQ Knowledge Center:All other channel types using TLS are stopped with aSTOP CHANNEL MODE(FORCE) STATUS(INACTIVE)command. If the partner end of the stopped message channel has retry values defined, the channel retries and the new TLS handshake uses the refreshed view of the contents of the TLS key repository, the location of the LDAP server to be used for Certification Revocation Lists, and the location of the key repository. In the case of a server-connection channel, the client application loses its connection to the queue manager and has to reconnect in order to continue.So, you issuing the stop channel command is basically what the note said the refresh security command will do.Finally, you should probably open a PMR (help ticket) with IBM to see what they say and possibly fix the issue if it is a bug.\n"} +{"text": "### Human: I am building an api which is supposed to send message to an IBM MQ and receive the response from another queue. But the operation has to appear synchronous to the caller of the api. I'm using Mule 3.9.2.Seems Mule 4 has a connector called IBM MQ connector which has a publish conume operation to achieve this -https://docs.mulesoft.com/ibm-mq-connector/1.6/ibm-mq-publish-consume. But how do i get this done in Mule 3.9.2.\nI'm currently trying to get this done with the WMQ connector and using a request-reply pattern but with no success.Tried using request-reply,Also had it on a separate flow,### Assistant: Got it working by using the request-response exchange pattern available in the WMQ connector in 3.9.\n"} +{"text": "### Human: I am trying to connect to IBM MQ and post message. getting below exception but the same code works in development environment.org.springframework.jms.connection.SingleConnectionFactory.createSession(SingleConnectionFactory.java:437)\ncom.ibm.mq.jms.MQQueueConnection.createSession(MQQueueConnection.java:154) ~[com.ibm.mq.allclient-9.0.4.0.jar:9.0.4.0 - p904-L171030.1\ncom.ibm.mq.jms.MQQueueConnection.createQueueSession(MQQueueConnection.java:130) ~[com.ibm.mq.allclient-9.0.4.0.jar:9.0.4.0 - p904-L171030.1]\ncom.ibm.mq.jms.MQQueueSession.(MQQueueSession.java:58) ~[com.ibm.mq.allclient-9.0.4.0.jar:9.0.4.0 - p904-L171030.1]\ncom.ibm.mq.jms.MQSession.(MQSession.java:262) ~[com.ibm.mq.allclient-9.0.4.0.jar:9.0.4.0 - p904-L171030.1]\\\\n\\\ncom.ibm.mq.jms.MQSession.getTransacted(MQSession.java:876) ~[com.ibm.mq.allclient-9.0.4.0.jar:9.0.4.0 - p904-L171030.1]\nCaused by: java.lang.NullPointerExceptionBasically, the session is becoming null in other regions when we are trying to post a message from Spring JMS Template to IBM MQ.from java,public void sendNotificationsMessageToQueue(String jsonMessage) \n { \n jmsTemplate(Queue, new MessageCreator(){ \n @Override public Message createMessage(Session session) throws JMSException\n { \n return session.createTextMessage(jsonMessage); \n } });From XML: \n \n ### Assistant: It worked after removing spring jms template and written new class for obtaining IBM MQ connection.\n"} +{"text": "### Human: I have an application which uses IBM MQ to send out the request in a queue manager to a particularsystem B.\nThe response corresponding to that request is then received back fromsystem Bby the application in a sync call and then further business processing happens.Since we are working on the offshore region, we do not actually send out the request tosystem Bbut rather capture it ourselves using theMQJExplorertool and send back the response, which kind of simulates the prod. behaviour.The problem here is, or i would say, the overhead is that we have to manually open the mqjexplorer tool, check the request, take a particular attribute from the request(lets sayID), and send backID+1so that the application recognizes the response is forID-1request.I would like to know if this particular thing can be automated, with some other tool, where i can define like whenever any such kind of request is received in for eg:MQ001queue manager and itsREQqueue, just extract theIDattribute, do aID+1and send back the response inRESPqueue of same qm.### Assistant: There are a pair of IBM supplied samples that come with IBM MQ:-amqsreq0.c- Sample C program that puts request messages to a message queue and shows the replies (example using REPLY queue)amqsecha.c- Sample C program - echo messages to reply to queueThey are supplied to allow you to try out a request/reply application.You already have the equivalent app to do the job thatamqsreq0.cdoes, and you could adaptamqsecha.cto extract yourIDattribute, increment it, and then the sample already has the code to send the reply back.It can be automated by running as a triggered application too.\n"} +{"text": "### Human: We are seeing that for about 175 channels that are open to queue manager there are about 450 amqrmppa processes running, I'm not sure that is how the ratio should be? If this is too high what's the best way to troubleshoot this and be able to pin point which IP has opened how many amqrmppa processes?We are using MQ v9.1.0.6 on rhel7 machine.### Assistant: To understand which channels are running inside whichamqrmppaprocesses, use the following command:-DISPLAY CHSTATUS(*) JOBNAMEwhich will give you output like:-AMQ8417I: Display Channel Status details. \n CHANNEL(MQG1.TO.MQG2) CHLTYPE(SDR) \n CONNAME(127.0.0.1(1702)) CURRENT \n JOBNAME(00007DFC00000001) RQMNAME(MQG2) \n STATUS(RUNNING) SUBSTATE(MQGET) \n XMITQ(MQG2)Looking at theJOBNAMEfield, it is two hex values (on Windows and Unix anyway) containing the process ID of theamqrmppaprocess, in my example0x00007DFCand then the thread ID within that process.If you view all your channel status records in a tool that allows you to sort the output by any field, then do so, and sort by Job Name to see all the channels grouped by the process ID they are running inside.It is rather surprising that you have moreamqrmppaprocesses running that you have active channels. Usually there would be lessamqrmppaprocesses than channels because several channels will run inside oneamqrmppa(ReMote Pool Process). This suggests that perhaps you have earlier had many more channels and thus needed many moreamqrmppaprocesses, but now most of those channels have ended. I would have expected an \"empty\"amqrmppaprocess to end when it no longer had anything to do, a small number will stay around for new channels that start later, but not 200 of them.\n"} +{"text": "### Human: On AIX and Linux , MQ MFT agent files are all owned by mqm, and subsequently the agent processes run as mqm in the process list.\nIn addition, when the agent connects to an MQ Manager, the connection user is mqm. Due to security - I would like to have a different user appear in the connections to the MQ manager.\nIs there a way to run an MQ MFT agent as the mqm user, but the outbound connections to the MQ Manager are done as a different user, for example mqmftuser001, rather than mqm?### Assistant: You can use MQMFTCredentials.xml file to map a local user to mquserid for connecting to agent queue manager. For example -.The file can need to be placed in a secure folder where no user other than the one that starts the agent has access permissions. Generally it will be users home directory, $HOME.You can override the default credential path by setting the agent propertyagentQMgrAuthenticationCredentialsFile. The path specified for the property must be secure as mentioned before.\n"} +{"text": "### Human: I work with pymqi, version 1.12.0I tried to put msg with correlId into a queue, when I get back the msg, I recived just part of the correlId (first 24 chars).\nI saw that the length of the correlId defined under CMQC: MQ_CORREL_ID_LENGTH=24How can I change the default length so it would fit different correlIds length?### Assistant: The MQMD CorrelId is fixed at 24 bytes (not characters). That can't be changed. Different language bindings may do different things with inputs that are not exactly that length (padding/truncation) and may or may not give error returns, but 24 is the underlying length.\n"} +{"text": "### Human: I have a file .mqsc with a commands for create queues(ibm mq).How to run a script by kubectl?kubectl exec -n test -it mq-0 -- /bin/bash -f create_queues.mqscdoesn't work.log:/bin/bash: create_queues.mqsc: No such file or directory command terminated with exit code 127### Assistant: Most probably your script is not under the \"/\" directory in docker. You need to find whole path after that you need to execute script\n"} +{"text": "### Human: In my use case I need to do request-reply call to a remote system via managed queues. Using Spring Boot and IBM's MQ starter I have the problem that the application wants to create dynamic/temporary reply queues instead of using the already existing managed queue.Configuration is set up here@EnableJms\n@Configuration\npublic class QueueConfiguration {\n\n @Bean\n public MQQueueConnectionFactory connectionFactory() throws JMSException {\n MQQueueConnectionFactory factory = new MQQueueConnectionFactory();\n factory.setTransportType(CT_WMQ); // is 1\n factory.setHostName(queueProperties.getHost());\n factory.setPort(queueProperties.getPort());\n factory.setChannel(queueProperties.getChannel()); // combo of ${queueManager}%${channel}\n return factory;\n }\n\n @Bean\n public JmsMessagingTemplate messagingTemplate(ConnectionFactory connectionFactory) {\n JmsMessagingTemplate jmt = new JmsMessagingTemplate(connectionFactory);\n jmt.setDefaultDestinationName(queueProperties.getQueueName());\n return jmt;\n }\n\n @Bean\n public Jaxb2Marshaller marshaller() {\n Jaxb2Marshaller marshaller = new Jaxb2Marshaller();\n marshaller.setPackagesToScan(\"com.foo.model\");\n return marshaller;\n }\n\n @Bean\n public MessageConverter messageConverter(Jaxb2Marshaller marshaller) {\n MarshallingMessageConverter converter = new MarshallingMessageConverter();\n converter.setMarshaller(marshaller);\n converter.setUnmarshaller(marshaller);\n return converter;\n }\n}Usage is pretty straight forward: Take the object convert and send it. Wait for response receive\nand convert it.@Component\npublic class ExampleSenderReceiver {\n\n @Autowired\n private JmsMessagingTemplate jmsMessagingTemplate;\n\n @Override\n @SneakyThrows\n public ResponseExample sendAndReceive(RequestExample request, String correlationId) {\n MessagePostProcessor mpp = message -> {\n message = MessageBuilder.fromMessage(message)\n .setHeader(JmsHeaders.CORRELATION_ID, correlationId)\n // .setHeader(JmsHeaders.REPLY_TO, \"DEV.QUEUE.3\") this triggers queue creation\n .build();\n return message;\n };\n String destination = Objects.requireNonNull(jmsMessagingTemplate.getDefaultDestinationName());\n return jmsMessagingTemplate.convertSendAndReceive(destination, request, ResponseExample.class, mpp);\n }I read already a lot of IBM documentation and think, I need to set themessage typeto \"MQMT_REQUEST\" but I do not find the right spot to do so.UpdateAdded Spring Integration asGary proposedand added a configuration for JmsOutboundGateway@Bean\n public MessageChannel requestChannel() {\n return new DirectChannel();\n }\n\n @Bean\n public QueueChannel responseChannel() {\n return new QueueChannel();\n }\n\n @Bean\n @ServiceActivator(inputChannel = \"requestChannel\" )\n public JmsOutboundGateway jmsOutboundGateway( ConnectionFactory connectionFactory) {\n JmsOutboundGateway gateway = new JmsOutboundGateway();\n gateway.setConnectionFactory(connectionFactory);\n gateway.setRequestDestinationName(\"REQUEST\");\n gateway.setReplyDestinationName(\"RESPONSE\");\n gateway.setReplyChannel(responseChannel());\n gateway.setCorrelationKey(\"JMSCorrelationID*\");\n gateway.setIdleReplyContainerTimeout(2, TimeUnit.SECONDS);\n return gateway;\n }And adapted my ExampleSenderReceiver class@Autowired\n @Qualifier(\"requestChannel\")\n private MessageChannel requestChannel;\n \n @Autowired\n @Qualifier(\"responseChannel\")\n private QueueChannel responseChannel;\n\n @Override\n @SneakyThrows\n public ResponseExample sendAndReceive(RequestExample request, String correlationId) {\n String xmlContent = \"the marshalled request object\"; \n\n Map header = new HashMap<>();\n header.put(JmsHeaders.CORRELATION_ID, correlationId);\n\n GenericMessage message1 = new GenericMessage<>(xmlContent, header);\n requestChannel.send(message1);\n log.info(\"send done\" );\n\n Message receive = responseChannel.receive(1500);\n if(null != receive){\n log.info(\"incoming: {}\", receive.toString());\n }\n }The important part isgateway.setCorrelationKey(\"JMSCorrelationID*\");Without that line the correlationId was not propagated correct.Next step is re-adding MessageConverters and make it nice again.Thank you.### Assistant: The default JmsTemplate (used by theJmsMessagingTemplate) always uses a temporary reply queue. You can subclass it and overridedoSendAndReceive(Session session, Destination destination, MessageCreator messageCreator)to use your managed queue instead.However, it will only work if you have one request outstanding at a time (e.g. all run on a single thread). You will also have to add code for discarding \"late\" arrivals by checking the correlation id.You can use async sends instead and handle replies on a listener container and correlate the replies to the requests.Consider usingspring-integration-jmsand its outbound gateway instead - it has much more flexibility in reply queue handling (and does all the correlation for you).https://docs.spring.io/spring-integration/reference/html/jms.html#jms-outbound-gateway\n"} +{"text": "### Human: I need to receive 'n' number of messages per every second from IBM MQ. Example : I need to receive maximum 10 messages per second.I want to use DefaultMessageListnerContainer of spring.Can this be achieved by setting the below configurations?### Assistant: You might be better usingJmsTemplate.receiveAndConvert()instead of a message-driven architecture, if you want to control the rate of message consumption.\n"} +{"text": "### Human: I'm trying to implement a service which receives messages from a tcp socket, puts them on one of two permanent queues, polls for replies on a dynamically created queue, and sends replies back over the socket. This works fine with one socket. However, there is a requirement the the tcp connection end after a fixed duration, so that the tcp client needs to reconnect. This works a few times, but the forth, fifth, ... MQ connection or queue setup crashes the server. The same happens if I try to serve more then two clients concurrently. This is NOT a E_CONN_RESET which results in an uncatchable error on the server (btw I don't understand why it is not possible to catch this event!). I suppose that IBM's client dll creates new threads from time to time which node cannot handle.My machine runs Windows 10 Pro (latest updates) and has IBM MQ 9.2.1, node 15.11.0, and the current ibmmq node library installed.\nHere is what node prints before it ends:#\n# Fatal error in , line 0\n# Check failed: result.second.\n#\n#\n#\n#FailureMessage Object: 0000008001AFDBB0\n 1: 00007FF6D5C54BFF napi_wrap+159807\n 2: 00007FF6D5B76CFF v8::CFunction::ReturnInfo+2271\n 3: 00007FF6D6808522 V8_Fatal+162\n 4: 00007FF6D6279F6D v8::internal::BackingStore::Reallocate+653\n 5: 00007FF6D64D2F09 v8::ArrayBuffer::GetBackingStore+137\n 6: 00007FF6D5AFF146 v8::internal::OrderedHashTable::OrderedHashTable+27766\n 7: 00007FF6D6498ACF v8::internal::Builtins::builtin_handle+316399\n 8: 00007FF6D6498054 v8::internal::Builtins::builtin_handle+313716\n 9: 00007FF6D6498355 v8::internal::Builtins::builtin_handle+314485\n10: 00007FF6D6498193 v8::internal::Builtins::builtin_handle+314035\n11: 00007FF6D6573E2D v8::internal::SetupIsolateDelegate::SetupHeap+456973\n12: 00007FF6D650C6B2 v8::internal::SetupIsolateDelegate::SetupHeap+33170\n13: 00007FF6D650C6B2 v8::internal::SetupIsolateDelegate::SetupHeap+33170\n14: 00007FF6D650C6B2 v8::internal::SetupIsolateDelegate::SetupHeap+33170\n15: 00007FF6D650C6B2 v8::internal::SetupIsolateDelegate::SetupHeap+33170\n16: 00007FF6D650C6B2 v8::internal::SetupIsolateDelegate::SetupHeap+33170\n17: 00007FF6D650C6B2 v8::internal::SetupIsolateDelegate::SetupHeap+33170\n18: 00007FF6D650C6B2 v8::internal::SetupIsolateDelegate::SetupHeap+33170\n19: 00007FF6D650C6B2 v8::internal::SetupIsolateDelegate::SetupHeap+33170\n20: 00007FF6D650C6B2 v8::internal::SetupIsolateDelegate::SetupHeap+33170\n21: 00007FF6D6504E89 v8::internal::SetupIsolateDelegate::SetupHeap+2409\n22: 00007FF6D650C6B2 v8::internal::SetupIsolateDelegate::SetupHeap+33170\n23: 00007FF6D650C6B2 v8::internal::SetupIsolateDelegate::SetupHeap+33170\n24: 00007FF6D650C6B2 v8::internal::SetupIsolateDelegate::SetupHeap+33170\n25: 00007FF6D650C6B2 v8::internal::SetupIsolateDelegate::SetupHeap+33170\n26: 00007FF6D650A36E v8::internal::SetupIsolateDelegate::SetupHeap+24142\n27: 00007FF6D6509F5C v8::internal::SetupIsolateDelegate::SetupHeap+23100\n28: 00007FF6D63D3BBD v8::internal::Execution::CallWasm+1645\n29: 00007FF6D63D342F v8::internal::Execution::Call+191\n30: 00007FF6D64C6737 v8::Function::Call+615\n31: 00007FF6D5C7C2EB node::CallbackScope::~CallbackScope+1691\n32: 00007FF6D5C73834 napi_wrap+285812\n33: 00007FF6D5B08273 v8::internal::MicrotaskQueue::microtasks_policy+20675\n34: 00007FF6D5B08DED v8::internal::MicrotaskQueue::microtasks_policy+23613\n35: 00007FF6D5B03719 v8::internal::MicrotaskQueue::microtasks_policy+1385\n36: 00007FF6D5C9619B uv_tty_set_vterm_state+9227\n37: 00007FF6D5CAC08C uv_loop_init+924\n38: 00007FF6D5CAC39A uv_run+202\n39: 00007FF6D5C7B6C4 node::SpinEventLoop+308\n40: 00007FF6D5BA34B7 EVP_CIPHER_CTX_buf_noconst+51927\n41: 00007FF6D5C1BB9B node::Start+283\n42: 00007FF6D5A4832C RC4_options+346668\n43: 00007FF6D6A8683C v8::internal::compiler::RepresentationChanger::Uint32OverflowOperatorFor+153276\n44: 00007FF8575C7034 BaseThreadInitThunk+20\n45: 00007FF858762651 RtlUserThreadStart+33I could try to spawn a new process instead of running the code always within the same node instance which is likely to work. However, I think it is important to know what happens anyway, and if there is a way to avoid such crashes. In particular, although nothing crashed so far if there is only a single connection which is not reniewed, I think some paranoia should be in place: can I trust that node.js (ibmmq.js) will not crash with only three queues accessed? Has somebody an idea about this?Related to this, I could observe that a test routine crashed too after trying to access a dynamic queue a couple of times which does not exist any more.### Assistant: This is almost certainly because of an issue in the ref-napi dependency. Seehttps://github.com/node-ffi-napi/ref-napi/issues/47for example.A PR got merged in that repo yesterday that appears to resolve it, so the ibmmq package will get updated soon to reference that new version\n"} +{"text": "### Human: One of our end application which has JMS lower version want to connect to IBM MQ upgraded version V9.2. Can it still use old version of JMS or upgrade to new version 2.0?### Assistant: IBM MQ v8.0 and later require the JMS 2.0 jms.jar.IBM MQ 7.5 and lower require the JMS 1.1 jms.jar.JMS 2.0 will work with JMS 1.1 code.See the IBM MQ 9.2 Knowledge Center linkIBM MQ>Developing applications>Developing JMS and Java applications>Using IBM MQ classes for JMS>Writing IBM MQ classes for JMS applications.JMS 2.0 introduces a simplified API, while also retaining the classic API, from JMS 1.1.\n"} +{"text": "### Human: I have a Camel client using the JMS Component to connect with IBMMQ.I need toSend a JMSCorrelationID with a fixed value.Correlate the Reply message by JMSMessageID.My configuration is:.setHeader(\"CamelJmsDestinationName\", \"queue:///requestQueue.AQ?targetClient=1\")\n.setHeader(\"JMSCorrelationID\", \"SomeValue\")\n.to(\"jms:queue:requestQueue.AQ?useMessageIDAsCorrelationID=true&replyTo=ResponseQueue\")The issue is that JMSCorrelationID is null when useMessageIDAsCorrelationID=trueJMSMessageID: ID:c3e2d840d8d4e3f14040404040404040d95c7873193bef06\n JMSTimestamp: 1614870096440\n JMSCorrelationID: nullWhen useMessageIDAsCorrelationID=false the JMSCorrelationID is set as intended, but I get a timeout on correlation. How to use both?### Assistant: As a way around the issue I made the following changes to the .to() endpoint options:exchangePattern=InOnlyincludeSentJMSMessageID=trueThen the message is sent with a JMSCorrelationID, but without waiting on the reply. Thereafter I set a pollEnrich() dynamically with a simple expression using the JMSMessageID created by the broker which is filtered by a JMS Selector:selector=JMSMessageID='${header.JMSMessageID}The Camel route:.setHeader(\"CamelJmsDestinationName\", \"queue:///requestQueue.AQ?targetClient=1\")\n.setHeader(\"JMSCorrelationID\", \"SomeValue\")\n.to(\"jms://RequestQueue?useMessageIDAsCorrelationID=false&exchangePattern=InOnly&replyTo=ReplyQueue&includeSentJMSMessageID=true\")\n.pollEnrich().simple(\"jms://ReplyQueue?selector=JMSMessageID='${header.JMSMessageID}').timeout(20000)\n.log(\"${body}\")\n"} +{"text": "### Human: Would appreciate if anyone is able to assist/provide some sort of a guide/tutorial for using IBM IIB (Integrated Toolkit) and IBM MQ, making use of MQ Input Node, Compute Node and MQ Output Node, such that when a message is put on the input queue, it will be routed to an output queue based on the MQRFH2 headers and USR properties set/defined in the compute node (ESQL file)E.g. If MQRFH2/USR = 1, route message to Queue 1, IF MQRFH2/USR = 2, route message to Queue 2, etc.Thanks in advance.### Assistant: Please readAccessing the MQRFH2 headerandPopulating Destination in the local environment tree.Then you could write your ESQL like this: (assuming the RFH2 routing variable is namedKer)CREATE COMPUTE MODULE Routing_Compute\n CREATE FUNCTION Main() RETURNS BOOLEAN\n BEGIN\n SET OutputLocalEnvironment.Destination.MQ.DestinationData[1].queueName =\n CASE InputRoot.MQRFH2.usr.Ker\n WHEN '1' THEN 'Q1'\n WHEN '2' THEN 'Q2'\n ELSE 'Q3'\n END;\n RETURN TRUE;\n END;\nEND MODULE;Remember to change the default node configuration like this:Compute: SetCompute modetoLocalEnvironmentMQ Ouput: SetDestination modetoDestination ListExample: If input message headerKerhas value2, then it will be routed to queueQ2.\n"} +{"text": "### Human: I'm working on a microservice in java that puts messages on a queue. Since I use JMS, message segmentation isn't possible to use to handle big messages. I was wondering, does message grouping also allow me to handle big messages? By big messages I mean messages bigger than the MaxMsgLength.### Assistant: JMS itself has no support for \"message segmentation.\" However, JMS implementations can implement functionality which goesbeyondthe specification. For example,ActiveMQ Artemis supports arbitrarily large messageswhereby it takes a single, large message and breaks it up into chunks which it streams over the wire and onto disk so that the message is never held in memory at once. Of course, all this is done behind the scenes. The client application just works with the JMS API like it normally would.Now, if you wanted to break the large message upmanuallyand send it as many smaller, individual JMS messages then I could see where message grouping would help in reassembling the message because each message in the group would be consumed serially by a single consumer. However, it's also possible that the consumer might fail part-way through consuming the whole group so you'll need to ensure you consumeallthe messages in the group before you acknowledgeanyof them otherwise you risk losing pieces of the large message which you can never get back. In any case, the consumer will have to know how to reassemble the message once it gets all the pieces together but that could be as simple as appending the bytes of each message in order into a buffer.\n"} +{"text": "### Human: We with my colleague built mqreply.sh fromhttps://github.com/ibm-messaging/mq-rfhutil/tree/master/mqperfBut we don't suggest that command mqreply has timeout after which process with command is closed.I attach our file with params for executing mqreply:[header]\nqname=DEV.QUEUE.1\nqmgr=QM1\nmsgcount=10\nmsgtype=2\nformat=\"MQSTR\"\ncodepage=1208\npersist=0\nreplyq=DEV.QUEUE.2\nsleeptime=1000\nmaxWaitTime=5\nmaxtime=60\nwaitTime=60\nreplyFilename=/tmp/msqtoload.datI try to set maxWaitTime and maxtime, waitTime, but it doesn't affect timeout for life of process.Can you say how can I let mqreply doesn't close or maybe increase timeout?Thank you### Assistant: The while loop around the MQGET in the mqreply sample you link to does this:-while ((compcode == MQCC_OK) && (0 == terminate) && ((0 == parms.totcount) || (msgsRead < parms.totcount)))\n{Also, the MQGET will only wait for 1 seconds. There is a comment thus:-/* since we have a signal handler installed, we do not want to be in an MQGET for a long time */This suggests that if you want to keep mqreply open and running for longer, you need to specifymsgcountas a number bigger than 10.\n"} +{"text": "### Human: I have a MQ queue which has 2K odd records which needs to be unloaded into a file and check why these were not consumed by our INBOUND process.\nAnd I tried to unload the records into a file using the below command example:qload -m ABCDE -iQueue1 -f/var/tmp/Queue1.qloadAnd further I tried to zip the file in linux. extarcted it into windows and when I open the file in windows it is not readable.Could you kindly suggest any command to unload a queue into file with redable form?### Assistant: The below command can be used to make files readble:qload -fDEBVRPHV.CIBREP.DEAD.LETTER.qload_1 -fredable_file -dA \nqload -fDEBVRPHV.CIBREP.DEAD.LETTER.qload_1 -fredable_file_trial -da\n\nwhere :\n-d ]\na Add ASCII columns to HEX file\nA Write output file in ASCII lines rather than HEX\n"} +{"text": "### Human: I have a code that reads from the IBM MQ queue manager but I want to be read from IBM MQ without removing the message from the queue, only after I send acknowledge to IBM MQ I want to remove the messagethis is my IBM reader code :public class IBMReaderStub extends AbstractReader {\n private JMSContext context = null;\n JMSConsumer consumer;\n Destination destination;\n \n public IBMReaderStub(String queueName) {\n this(queueName, new IBMListener());\n }\n \n public IBMReaderStub(String queueName, IBMListener onMessage) {\n super(ConfigurationManager.getString(HOST), ConfigurationManager.getInt(PORT, DEFAULT_IBM_PORT), queueName, new QueueWithThreadPool(), onMessage);\n }\n \n @Override\n protected void initializeConsumer() {\n try {\n JmsConnectionFactory jmsConnectionFactory = createJmsConnectionFactory();\n context = jmsConnectionFactory.createContext();\n destination = context.createQueue(\"queue:///\" + getQueueName()); // Set the producer and consumer destination to be the same... not true in general\n consumer = context.createConsumer(destination);\n } catch (Exception e) {\n System.out.println(e);\n }\n listen();\n }\n\n @Override\n public void listen() {\n consumer.setMessageListener(getOnMessage());\n }\n\n private JmsConnectionFactory createJmsConnectionFactory() throws Exception {\n JmsFactoryFactory jmsFactory = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\n JmsConnectionFactory jmsConnectionFactory = jmsFactory.createConnectionFactory();\n jmsConnectionFactory.setStringProperty(WMQConstants.WMQ_HOST_NAME, this.getHost());\n jmsConnectionFactory.setIntProperty(WMQConstants.WMQ_PORT, getPort());\n jmsConnectionFactory.setStringProperty(WMQConstants.WMQ_CHANNEL, ConfigurationManager.getString(CHANNEL_NAME));\n jmsConnectionFactory.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, ConfigurationManager.getString(QUEUE_MANAGER_NAME));\n jmsConnectionFactory.setStringProperty(WMQConstants.WMQ_APPLICATIONNAME, ConfigurationManager.getString(APPLICATION_NAME));\n jmsConnectionFactory.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\n return jmsConnectionFactory;\n }\n \n public static void main(String[] args) {\n try {\n IBMReaderStub reader = new IBMReaderStub(\"hey\");\n IBMReaderStub reader2 = new IBMReaderStub(\"hey\");\n reader.listen();\n reader2.listen();\n\n } catch (Exception e) {\n System.out.println(e);\n }\n }\n}### Assistant: IBM MQ provides transactional access to messages, so you need to create a transacted session, and then you can commit or roll back message gets or puts as needed.https://www.ibm.com/support/knowledgecenter/SSFKSJ_9.1.0/com.ibm.mq.dev.doc/q032210_.htmlhttps://www.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.dev.doc/q032220_.htm\n"} +{"text": "### Human: I am having a connection problem when I am trying to set up a connection to a IBM MQ V6 QueueManager and a .net client using IBM.XMS namespace inAzure Function.I am setting up the connection like this:XMSFactoryFactory xff = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\nIConnectionFactory cf = xff.CreateConnectionFactory();\ncf.SetStringProperty(XMSC.WMQ_HOST_NAME, \"servername.ibmcloud.com\");\ncf.SetIntProperty(XMSC.WMQ_PORT, 1415);\ncf.SetStringProperty(XMSC.WMQ_CHANNEL, \"SYSTEM.SSL.SVRCONN\");\ncf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT); //Managed Client\ncf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, \"OM_QMGR\");\ncf.SetIntProperty(XMSC.WMQ_BROKER_VERSION, XMSC.WMQ_BROKER_V1);\ncf.SetStringProperty(XMSC.WMQ_CONNECTION_NAME_LIST, \"servername.ibmcloud.com(1415)\");\ncf.SetStringProperty(XMSC.WMQ_SSL_CLIENT_CERT_LABEL, \"ibmwebspheremqsystem\");\ncf.SetStringProperty(XMSC.WMQ_SSL_CIPHER_SPEC, \"TLS_RSA_WITH_AES_128_CBC_SHA256\");\ncf.SetStringProperty(XMSC.WMQ_SSL_KEY_REPOSITORY, \"*SYSTEM\");\n\nreturn cf.CreateConnection();This works properly when I run it in my local machine where pfx certificate is installed in my MMC console.\nOm my local system it is working properly, as it is able to find the WMQ_SSL_KEY_REPOSITORY from \"System\".I have added the pfx certificate in Azure Function under \"Private Key Certificates\", and it appears as healthy, just like this Imagebut when I call the cf.CreateConnection I get an error 2538: MQRC_HOST_NOT_AVAILABLE as an exception.\nI know the issue is because of WMQ_SSL_KEY_REPOSITORY property, I am not sure what to provide in place of \"*SYSTEM\" so that this works properly on Azure Function.Any help regarding this will be appreciated.\nThank you all.### Assistant: This question was solved in the comments by JoshMc.The above code works with Azure Function with just one modification.\nPut*USERas the value ofXMSC.WMQ_SSL_KEY_REPOSITORYinstead of*SYSTEMand this should work on Azure Function.\n"} +{"text": "### Human: I have scriptdefine qlocal (ABCREQUEST)\ndefine qlocal (XYZREQUEST)in filemqconfig.inI am running therunmqsccommand in linux VM where I have installed IBM MQ version 9.2.0.0 as followssudo runmqsc VOLPAY_STDS < /home/adminuser/mqconfig.inI see the following output:5724-H72 (C) Copyright IBM Corp. 1994,2020.\nStarting MQSC for queue manager VOLPAY_STDS.\nAMQ8135E: Not authorized.\n\nNo MQSC commands read.### Assistant: This really isn't an MQ issue. You are having a file permission issue.sudo runmqsc VOLPAY_STDS < /home/adminuser/mqconfig.inWhen you issue this command, runmqsc is now running under 'mqm' account and not your account.I also applied chmod 777 to the file mqconfig.in.Ok. But 'mqm' does not have permission to access the directory tree '/home/adminuser/'.You need to put your 'mqconfig.in' file in a directory that mqm has read access to. If you don't know of one then use /tmp/ (or /var/tmp/ ) directory.\n"} +{"text": "### Human: ERROR:Cause: JMSCC0111: WebSphere MQ classes for JMS attempted to set a pre-existing client ID on a Connection or JMSContext.It is durable consumer. I understand that this error comes when more than one consumer tries to consume with same clientID. But my requirement is to have multiple consumers for same topic. Same events should not be consumed by both consumers.### Assistant: The code relating to the comments becomes:import org.springframework.jms.config.DefaultJmsListenerContainerFactory;\nimport org.springframework.jms.config.JmsListenerContainerFactory;\nimport org.springframework.jms.connection.SingleConnectionFactory;\n\n @Bean\n public JmsListenerContainerFactory myPubSubContainerFactory(SingleConnectionFactory scf) {\n DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();\n\n scf.setClientId(\"ABCD\");;\n factory.setConnectionFactory(scf);\n\n factory.setPubSubDomain(true); // sub\n factory.setSubscriptionDurable(true);\n factory.setSubscriptionShared(true);\n\n return factory;\n }Note the use ofSingleConnectionFactoryto set the ClientID. If you set it on theDefaultJmsListenerContainerFactoryfactory, you will get an error telling you to set it onSingleConnectionFactory.The listener then is :@JmsListener(destination = \"${topic.value}\", containerFactory = \"myPubSubContainerFactory\")\n public void subscribe(String message) {\n ...\n }\n"} +{"text": "### Human: I have the following topics which are created on IBM MQ docker version:dev/test/sys1 dev/test/sys2I am trying to create subscriber from XMS .NET APIs using the following code:destination = sessionWMQ.CreateTopic(\"dev/test/#\");The following exception appears, it is related to permissions based \"Reason: 2035\", but I am not able to figure out what is the permission I have to grant and from whereXMSException caught: IBM.XMS.IllegalStateException: Failed to\nsubscribe to topic dev/# using MQSUB. There may have been a problem\ncreating the subscription due to it being used by another message\nconsumer. Make sure any message consumers using this subscription are\nclosed before trying to create a new subscription under the same name.\nPlease see the linked exception for more information.### Assistant: If you receive an error 2035 (MQRC_NOT_AUTHORIZED) there will be a corresponding message in the queue manager error logAMQERR01.LOG. It will say something like this:-AMQ8009: Entity 'mqgusr1' has insufficient authority to access topic string\n'dev/test/#'.\n\nEXPLANATION:\nThe specified entity is not authorized to access the required topic. The\nfollowing requested permissions are unauthorized: sub\nACTION:\nEnsure that the correct level of authority has been set for this entity against\nappropriate topic objects, or ensure that the entity is a member of a privileged\ngroup.Specifically this error message will tell you the user id, the object name, and the missing authorization. Using this information, you canalmostconstruct the command you need. You do need one more peice of information and that is the group name that the user is in that you wish to grant the authority on. It is always recommended that you use group names and not user names when granting authorities or you may end up with too many authorities to manage, or perhaps worse, more users than you expected gaining the authority you granted as a result of the primary group of the user being something like 'staff'.Here's the command, assuming that 'mqgusr1' in my error message, is in the group 'mqgapp' and that group is suitable for being granted authority to subscribe to a topic.SET AUTHREC PROFILE(SYSTEM.BASE.TOPIC) OBJTYPE(TOPIC) GROUP('mqgapp') AUTHADD(SUB)It is worth mentioning at this point that adding topic related authorities to the SYSTEM.BASE.TOPIC results in the group in question being able to useanytopic available - this object represents the root of the topic tree. If you wish to restrict access to only certain parts of the topic tree (recommended), then you should instead create a topic object for the section of the topic tree you want to use, and then grant authority there instead, thus the following commands:SET AUTHREC PROFILE(SYSTEM.BASE.TOPIC) OBJTYPE(TOPIC) GROUP('mqgapp') AUTHRMV(SUB)\nDEFINE TOPIC(DEV.TEST) TOPICSTR('dev/test')\nSET AUTHREC PROFILE(DEV.TEST) OBJTYPE(TOPIC) GROUP('mqgapp') AUTHADD(SUB)\n"} +{"text": "### Human: I have installed the docker version of IBM MQ based on the following linkhttps://developer.ibm.com/tutorials/mq-connect-app-queue-manager-containers/Then I created new topic with the following specs:\nName: PROD.TEST\nTopic 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\n= 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\nsubscribe to topic dev/test/ using MQSUB. There may have been a\nproblem creating the subscription due to it being used by another\nmessage consumer. Make sure any message consumers using this\nsubscription are closed before trying to create a new subscription\nunder the same name.Linked Exception : CompCode: 2, Reason: 2035### Assistant: 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 explainedhereYou 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 theSET AUTHRECcommand. 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.\n"} +{"text": "### Human: Currently Microfocus server and IBM MQ are hosted in different servers and linked by MQSERVER environmental variable in Microfocus.\nWhat configuration need to be changed in Microfocus to connect to IBM MQ hosted on same server?I tried changing the MQSERVER variable to new server details, but it failed due to 2538 unable to find mq host.### Assistant: Assuming that your code does not provide any of the connection details, which given you are usingMQSERVERenvironment variable, suggests it does not; then you can switch from a client connection to a local bindings connection by:-Removing theMQSERVERenvironment variable(Optionally) setting theMQ_CONNECT_TYPEenvironment variable toLOCAL\n"} +{"text": "### Human: This question is regarding designing a solution based on IBM MQ.I have multiple systems (for example say 3) which are going to speak to a single IBM MQ server remotely,\ni.e the client systems are running in different machines.What is the best practice for designing the solution,Have 3 Queue Managers running on 3 different ports to have 3 channels dedicated to each\nsystemHave a single Queue Manager with 3 different channels, dedicated to each system.What is a good solution design practice? Any guidance will be very much helpful.Thanks in advance,\nYasothar### Assistant: Since all systems are within your organization, I would go with 1 queue manager. The big mistake people make is to try and share queues, channels, UserIds, etc. between applications.The first thing to do is setup channel authentication (CHLAUTH) rules and enable connection authentication (CONNAUTH), so that you have proper MQ security in place. Since all systems are internal, you may or may not want to use TLS/SSL on the channels for data encryption between clients and the queue manager.Don\u2019t look at everything from 30,000 feet but rather break everything down to individual applications or micro applications. Assign each application their own queue, channel and UserId. Absolutely, positively, do NOT share channels or UserIds between applications.Create a naming standard for your queues and channels, so that it is easy to identify who they belong to. I like naming things by division/department/group/function/component. Hence, it forms a nice tree of what you have defined and applications are using.Note: I\u2019m not a big fan of putting queue manager name or hostname or MQ object name (i.e. QUEUE or CHANNEL) in the name of channels or queues.i.e. Channel names:HR.PAYROLL\nHR.RECRUITMENT\nHR.TRAININGi.e. Queue names:HR.PAYROLL.TAXES.FEDERAL\nHR.PAYROLL.TAXES.STATE\nHR.PAYROLL.TAXES.SOCIAL.SECURITY\n"} +{"text": "### Human: I have some limitation that I can only have 1 partition of kafka topic which I can listen and still need to improve throughput of message processing and send that message MQ in end during that processingSo once I receive message in kafkaListener, I have used Asycn for further processing (that is for storing message in Db and later post to MQ).Issue I see Session cache is not working , as once I read from kafkalistner it opens up new thread to do further work and once it reaches to JMS send method, after certain point I end with MQ error \"max connections reach channel capacity\" I thin MQRC 2537Not sure what would be issue and I am using com.ibm.mq /mq-jms-spring-boot-starter as dependencyI have set Session cache to 20 and Async to 30 , does this means it will still try to create 10 more JMS connection, if all 30 threads task comes at almost same timeMy understanding to SessionCache is that , only that many max session connection will be created only ..and out of 30 ..10 threads need to wait for JMS session to be availablePlease assist , we are using Spring boot### Assistant: I think the problem here is that you end up with too many connections being opened. All the pooling is done in the background for you by spring-jms, and it appears that your pool size exceeds the number of connections that the channel is configured for.You will need to apply a throttle, by reducing the connection pool. There are caching properties that you can set formq-jms-spring-boot-starter. Seehttps://github.com/ibm-messaging/mq-jms-springeg.ibm.mq.pool.enabled=true\nibm.mq.pool.maxConnections=5\nibm.mq.pool.blockIfFull=true\nibm.mq.pool.blockIfFullTimeout=60You will need to determine sensible values for your envrionment.\n"} +{"text": "### Human: javax.JMS version 2.0.1Provider : ibm.mq v9.0Framework : Java Spring bootFrom what I know, onMessage() is asynchronous. I am successfully retrying the message send. However, the re-sending of messages happens instantaneously after a message failure. Ideally I want the retry to happen in a sliding window style eg. First retry after 20 seconds, second retry after 40 etc.How can I achieve thiswithouta Thread.Sleep() which, I presume, will block the entire Java thread and is not something I want at all ?Code is something like thisfinal int TIME_TO_WAIT = 20;\n\npublic void onMessage(Message , message)\n{\n :\n :\n int t = message.getIntProperty(\"JMSXDeliveryCount\");\n if(t > 1)\n {\n // Figure out a way to wait for (TIME_TO_WAIT * t)\n \n }\n\n}\ncatch(Exception e)\n{\n // Do some logging/cleanup etc.\n throw new RunimeException(e);// this causes a message retry\n}### Assistant: I would suggest you use exponential backoff in the retry logic, but you would need to use theDelivery Delayfeature.Define a custom JmsTemplate that will use delay property from the message, you should add retry count in the message property as well so that you can delay as per your need like 20, 40, 80, 160, etcpublic class DelayedJmsTemplate extends JmsTemplate {\n public static String DELAY_PROPERTY_NAME = \"deliveryDelay\";\n \n @Override\n protected void doSend(MessageProducer producer, Message message) throws JMSException {\n long delay = -1;\n if (message.propertyExists(DELAY_PROPERTY_NAME)) {\n delay = message.getLongProperty(DELAY_PROPERTY_NAME);\n }\n if (delay >= 0) {\n producer.setDeliveryDelay(delay);\n }\n if (isExplicitQosEnabled()) {\n producer.send(message, getDeliveryMode(), getPriority(), getTimeToLive());\n } else {\n producer.send(message);\n }\n }\n}Define Components, that will have the capability fo re-enqueue of the message, you can define this interface in the base message listener. The handleException method should do all the tasks of enqueue and computing delay etc. You may not always interested in enqueuing, in some cases, you would discard messages as well.You can see a similar post-processing logic herehttps://github.com/sonus21/rqueue/blob/4c9c5c88f02e5cf0ac4b16129fe5b880411d7afc/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/PostProcessingHandler.java@Component\n@Sl4j\npublic class MessageListener {\n private final JmsTemplate jmsTemplate;\n \n @Autowired\n public MessageListener(JmsTemplate jmsTemplate) {\n this.jmsTemplate = jmsTemplate;\n }\n \n @JmsListener(destination = \"myDestination\")\n public void onMessage(Message message) throws JMSException {\n try {\n // do something\n } catch (Exception e) {\n handleException(\"myDestination\", message, e);\n }\n }\n \n // Decide whether the message should be ignored due to many retries etc\n private boolean shouldBeIgnored(String destination, Message message) {\n return false;\n }\n \n // add logic to compute delay\n private long getDelay(String destination, Message message, int deliveryCount) {\n return 100L;\n }\n \n private void handleException(String destination, Message message, Exception e) throws JMSException {\n if (shouldBeIgnored(destination, message)) {\n log.info(\"destination: {}, message: {} is ignored \", destination, message, e);\n return;\n }\n if (message.propertyExists(\"JMSXDeliveryCount\")) {\n int t = message.getIntProperty(\"JMSXDeliveryCount\");\n long delay = getDelay(destination, message, t + 1);\n\n message.setLongProperty(DELAY_PROPERTY_NAME, delay);\n message.setIntProperty(\"JMSXDeliveryCount\", t + 1);\n jmsTemplate.send(destination, session -> message);\n } else {\n // no delivery count, is this the first message or should be ignored?\n }\n }\n}\n"} +{"text": "### Human: I am working on migrating ear application to liberty. It is a web appliation that uses JMS with MQ messaging provider.For example in my stage.config.xml, we have following properties:MQQueue(0).CCSID \nMQQueue(0).baseQueueName \nMQQueue(0).jndiName \nMQQueue(0).name \nMQQueueConnectionFactory(0).CCSID \nMQQueueConnectionFactory(0).channel \nMQQueueConnectionFactory(0).connectionPool.ConnectionPool(0).maxConnections \nMQQueueConnectionFactory(0).description \nMQQueueConnectionFactory(0).host \nMQQueueConnectionFactory(0).jndiName \nMQQueueConnectionFactory(0).name\nMQQueueConnectionFactory(0).port\nMQQueueConnectionFactory(0).provider\nMQQueueConnectionFactory(0).queueManager\nMQQueueConnectionFactory(0).sessionPool.ConnectionPool(0).maxConnections\nMQQueueConnectionFactory(0).transportType\n jsp-2.3\n localConnector-1.0\n jndi-1.0\n jdbc-4.1\n samlWeb-2.0\n wasJmsClient-2.0\n wasJmsClient-1.1\n wmqJmsClient-1.1\n jndi-1.0\n jmsMdb-3.1\n \n \n \n \n jsf-2.2\n \n \n \n \n \n \n \n \n \n Exception I get : NameNotFoundException: Intermediate context does not exist: jms/xyzCan anyone please guide on what all parameters/Configurations I have to use in Server.xml for this to work.Kindly help.### Assistant: There are several issues with yourserver.xml:duplicatedjndi-1.0featuremixedwasJmsClientandwmqJmsClient- if you only usemqthan removewasmixed versions ofwasJmsClient- use only one if you need to connect to internal queues alsoin features - where did you find such construct, I do not believe it is supportedfinally you are usingjms\\xyzonce as QCF name, and once as context name. It is incorrect. Change your QCF jndi name to something differnet e.g.jms\\xyz\\qcfUPDATE based on commentsCheck how you are using JMS classes.Here is config and code I used for connecting to MQ:server.xmlfragment:jms-2.0Java code to send message:@ApplicationScoped\npublic class JMSHelper {\n private static Logger logger = Logger.getLogger(JMSHelper.class.getName());\n \n @Inject\n @JMSConnectionFactory(\"jms/myapp/NotificationQueueConnectionFactory\")\n private JMSContext jmsContext;\n \n @Resource(lookup = \"jms/myapp/NotificationQueue\")\n private Queue queue;\n \n @Transactional\n void invokeJMS(Object json) throws JMSException, NamingException {\n\n String contents = json.toString();\n logger.info(\"Sending \"+contents+\" to \"+queue.getQueueName());\n jmsContext.createProducer().send(queue, contents);\n logger.info(\"JMS Message sent successfully!\");\n }\n \n}\n"} +{"text": "### Human: Hi in connecting with MQ for Jboss 7.2.4 Getting below error please assist2020-07-31 08:33:48,343 INFO [org.jboss.as.connector.deployers.RaXmlDeployer] (Controller Boot Thread) wmq.jmsra.rar: '.\n2020-07-31 08:33:48,346 ERROR [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0215: Failed to resume activity org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent$1@b1f771. To resume normal operation it is recommended that you restart the server.: java.lang.RuntimeException: WFLYEJB0501: Failed to activate MDB PaymentListener\n at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent.activate(MessageDrivenComponent.java:279)\n at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent.access$300(MessageDrivenComponent.java:63)\n at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent$1.resume(MessageDrivenComponent.java:109)\n at org.jboss.as.server.suspend.SuspendController.resume(SuspendController.java:126)\n at org.jboss.as.server.ServerService.finishBoot(ServerService.java:420)\n at org.jboss.as.server.ServerService.boot(ServerService.java:388)\n at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:372)\n at java.lang.Thread.run(Thread.java:745)\nCaused by: com.ibm.mq.connector.DetailedResourceAdapterInternalException: MQJCA1011: Failed to allocate a JMS connection., error code: MQJCA1011 An internal error caused an attempt to allocate a connection to fail. See the linked exception for details of the failure.\n at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:134)\n at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:105)\n at com.ibm.mq.connector.inbound.ConnectionHandler.allocateConnection(ConnectionHandler.java:301)\n at com.ibm.mq.connector.inbound.MessageEndpointDeployment.acquireConnection(MessageEndpointDeployment.java:279)\n at com.ibm.mq.connector.inbound.MessageEndpointDeployment.(MessageEndpointDeployment.java:231)\n at com.ibm.mq.connector.ResourceAdapterImpl.endpointActivation(ResourceAdapterImpl.java:380)\n at org.jboss.jca.core.rar.EndpointImpl.activate(EndpointImpl.java:208)\n at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent.activate(MessageDrivenComponent.java:277)\n ... 7 more\nCaused by: com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0018: Failed to connect to queue manager 'QM_SSL' with connection mode 'Client' and host name 'null'.\nCheck the queue manager is started and if running in client mode, check there is a listener running. Please see the linked exception for more information.\n at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:585)\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:221)\n at com.ibm.msg.client.wmq.internal.WMQConnection.getConnectOptions(WMQConnection.java:1373)\n at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:343)\n at com.ibm.msg.client.wmq.internal.WMQXAConnection.(WMQXAConnection.java:75)\n at com.ibm.msg.client.wmq.factories.WMQXAConnectionFactory.createV7ProviderConnection(WMQXAConnectionFactory.java:195)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6254)\n at com.ibm.msg.client.wmq.factories.WMQXAConnectionFactory.createProviderXAConnection(WMQXAConnectionFactory.java:107)\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createXAConnectionInternal(JmsConnectionFactoryImpl.java:378)\n at com.ibm.mq.jms.MQXAConnectionFactory.createXAConnection(MQXAConnectionFactory.java:129)\n at com.ibm.mq.connector.inbound.ConnectionHandler.allocateConnection(ConnectionHandler.java:203)\n ... 12 more\nCaused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2400' ('MQRC_UNSUPPORTED_CIPHER_SUITE').\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:209)### Assistant: It looks like the cipher spec defined on your Connection Factory is not compatible with the cipher suites configured on your MQ channel or supported by IBM MQ.You can check the Connection Factory settings in you application server config. To inspect the channel, you could either use the IBM MQ Console orrunmqsc and thenDISPLAY CHANNEL('')to find the value ofSSLCIPH( ).This page in the IBM MQ Knowledge Centreoutlines the cipher naming policies and interoperability. It might also be worth taking a look at thealias options here.If you are using a non-IBM JRE, then check you have set the JVM property-Dcom.ibm.mq.cfg.useIBMCipherMappings=falsefor your application server runtime.There is a simple IBM MQ TLS tutorialherewhich contains a more detailed overview and includes some useful links.\n"} +{"text": "### Human: How do I discover the Queue depth, and other metrics about queues, from IBM MQ using java with standard IBM MQ libraries?### Assistant: Try out the below sample code snippet for fetching the queue depth.String mqQMgr = \"\";\nString mqQueue = \"\";\n\nMQEnvironment.hostname = \"\";\nMQEnvironment.port = \"\";\nMQEnvironment.channel = \"\"; \nMQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES);\n\nMQQueueManager qMgr = new MQQueueManager(mqQMgr);\nMQQueue destQueue = qMgr.accessQueue(mqQueue, openOptions);\n\nint depth = destQueue.getCurrentDepth();\ndestQueue.close();\nqMgr.disconnect();A full code version (Change your parameters accordingly, like Bindings or client mode, options etc ) :import com.ibm.mq.*;\n\npublic class QueueManager {\n\n private final String host;\n private final int port;\n private final String channel;\n private final String manager;\n private final MQQueueManager qmgr;\n\n public QueueManager(String host, int port, String channel, String manager) throws MQException {\n this.host = host;\n this.port = port;\n this.channel = channel;\n this.manager = manager;\n this.qmgr = createQueueManager();\n }\n\n\n private MQQueueManager createQueueManager() throws MQException {\n MQEnvironment.channel = channel;\n MQEnvironment.port = port;\n MQEnvironment.hostname = host;\n MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES);\n return new MQQueueManager(manager);\n }\n\n // This method will return the Queue Depth\n public int queueDepth(String queueName) {\n int depth = -1;\n int openOptions = MQC.MQOO_INQUIRE + MQC.MQOO_FAIL_IF_QUIESCING;\n MQQueue queue = null;\n try {\n queue = qmgr.accessQueue(queueName, openOptions);\n depth = queue.getCurrentDepth();\n }\n catch (MQException e)\n {\n System.out.println(\"CC=\" +e.completionCode + \" : RC=\" + e.reasonCode);\n }\n finally {\n try {\n if (queue != null)\n queue.close();\n }\n catch (MQException e) {\n System.out.println(\"CC=\" +e.completionCode + \" : RC=\" + e.reasonCode);\n }\n }\n\n return depth;\n }\n\n ........ Other Methods .......\n}\n"} +{"text": "### Human: I\u2019m using MQ Visual Edit V3 to inject financial messages in a queue.I\u2019m able to inject one message but not several messages.The separator I use is\\n. 1 message = 1 rowBut when I inject several messages only one is put in the queue and the content is the concatenation of all the messages.Can you explain me how to send many messages in one go please?### Assistant: On theImport Filewindow, useEvery line of each fileoption rather than using the '\\n' delimiter.Currently, theImport Filewindow does not support '\\n' delimiter. I'll add it to the user request list.MQ Visual Edit does support explicitly using HEX values for CRLF or LF i.e. 0D0A or 0A in the Delimiter field. Just remember to selectDelimited Fileand thenHexadecimal Delimiter\n"} +{"text": "### Human: I am struggling connecting a Logic App to MQ in the IBM Cloud.I created a Queue Manager in MQ and want to send some test message to any of the default queues.The Logic App connector wants the Queue Manager, Channel and Queue.I created a Channel of Type Receiver, not sure why this is needed, but created it.When I try to connect I got an error.Tried using the port as well, (tried 30127 and 1414, 30127 the port assigned to the Queue Manager) and received an error, though a different error.This is my first time working with MQ, so any help would be much appreciated.### Assistant: You don't need a channel of type RECEIVER, instead you need a channel of type SVRCONN. In your screenshot that asks for a 'Channel Name' with description 'The channel to connect to the queue manager on' it must be a channel of type SVRCONN whose name you supply in that field.Could you update your question to show how you used the port? If the port number is not 1414, then you will certainly need to supply it as well.\n"} +{"text": "### Human: good afternoon!I know we can start trigger monitor with non mqm user using scripts.\nI would like to know if there is a way to setup a service to start the trigger monitor when qmgr starts, and using a different user id from mqm.Regards### Assistant: When using a SERVICE object in IBM MQ, the command you run (i.e. what you place in theSTARTCMDattribute) is run with mqm authority. This is stated explicitly inKnowledge Center.Attention:This command allows a user to run an arbitrary command with mqm authority. If granted rights to use this command, a malicious or careless user could define a service which damages your systems or data, for example, by deleting essential files.If you have a script that does what you need, you can put the script in theSTARTCMDattribute. If that script changes the user ID, and then runs the program, then as long as the mqm group user ID has permission to do what is in the script, won't that still work?\n"} +{"text": "### Human: I am writing to an MQ queue from Java and I am intermittently get the error response below. I am using IBM MQ version 9.What could be the cause of this as its intermittent and the queue / queue manager being written to exists and was running during this time.[INFO ] 2020-06-13 22:48:03.752+0300 [main] [e5643f16-94ea-436f-ad71-54bee1c91381] MQWriteFile - Finished establishing a connection to DB\n[INFO ] 2020-06-13 22:48:03.752+0300 [main] [e5643f16-94ea-436f-ad71-54bee1c91381] MQWriteFile - init\n[INFO ] 2020-06-13 22:48:03.758+0300 [main] [e5643f16-94ea-436f-ad71-54bee1c91381] MQWriteFile - 5. Before calling write.selectQMgr()\n[INFO ] 2020-06-13 22:48:03.864+0300 [main] [e5643f16-94ea-436f-ad71-54bee1c91381] MQWriteFile - 6. After selecting Queue Manager name\n[DEBUG] 2020-06-13 22:48:03.876+0300 [main] [e5643f16-94ea-436f-ad71-54bee1c91381] MQWriteFile - ReasonCode:2085\n[DEBUG] 2020-06-13 22:48:03.877+0300 [main] [e5643f16-94ea-436f-ad71-54bee1c91381] MQWriteFile - Completion Code:2\n[ERROR] 2020-06-13 22:48:03.877+0300 [main] [e5643f16-94ea-436f-ad71-54bee1c91381] MQWriteFile - Message:MQJE001: Completion Code '2', Reason '2085'.\ncom.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2085'\n at com.ibm.mq.MQDestination.open(MQDestination.java:322) ~[com.ibm.mq.jar:9.0.0.5 - p900-005-180821]\n at com.ibm.mq.MQQueue.(MQQueue.java:236) ~[com.ibm.mq.jar:9.0.0.5 - p900-005-180821]\n at com.ibm.mq.MQQueueManager.accessQueue(MQQueueManager.java:3288) ~[com.ibm.mq.jar:9.0.0.5 - p900-005-180821]\n at custom.MQWriteFile.write(MQWriteFile.java:364) ~[PGPEncryptedSOAPWMQWriter.jar:?]\n at custom.MQWriteFile.(MQWriteFile.java:221) [PGPEncryptedSOAPWMQWriter.jar:?]\n at custom.PGPEncryptedSOAPWMQWriter.main(PGPEncryptedSOAPWMQWriter.java:69) [PGPEncryptedSOAPWMQWriter.jar:?]\n[INFO ] 2020-06-13 22:48:03.879+0300 [main] [e5643f16-94ea-436f-ad71-54bee1c91381] MQWriteFile - LogStatusInDB\n[DEBUG] 2020-06-13 22:48:03.911+0300 [main] [e5643f16-94ea-436f-ad71-54bee1c91381] MQWriteFile - Reason Code Desc:MQRC_UNKNOWN_OBJECT_NAME\n[DEBUG] 2020-06-13 22:48:03.911+0300 [main] [e5643f16-94ea-436f-ad71-54bee1c91381] MQWriteFile - Completion Code Desc:MQCC_FAILED\n[DEBUG] 2020-06-13 22:48:03.911+0300 [main] [e5643f16-94ea-436f-ad71-54bee1c91381] MQWriteFile - Returning with:3### Assistant: Most likely the cause will be logic flow related with variables or objects falling out of scope, then coming back into scope with reset / default values.The traces that you are running, will tell you which values your code is actually using. You will most likely need to add logging into your application to determine why the values are being lost.\n"} +{"text": "### Human: We have defined BackOut queue for each main queue. The poison messages are added into BackOut queue automatically as we are using JMS. \nBut few valid messages are also considered as poison messages due to temporary infrastructure/DB issues and added into BackOut queue.Now I want to move those poison messages from BackOut queue to the main queue. Does anyone have any utility or any JMS/IBM MQ classes which can do it in less code?I want it do it through java code.### Assistant: I'm not sure why you would want to write Java code to move messages when there are already existing tools to do it for you:(1) If the poison messages have the Dead Letter Header prefixed to the message then use theIBM MQ Dead Letter Queue Handler(runmqdlq).(2) If the poison messages do NOT have the Dead Letter Header prefixed to the message then usedmpmqmsg utilityas JoshMc pointed out. Note: You need to be at IBM MQ v8.0 or higher. If you are using an older release of IBM MQ then you can use a commercial program likeMQ Batch ToolkitorQLoad.\n"} +{"text": "### Human: I recently inherited a testing framework using PYMQI to put a message on IBM Websphere Queue. I fixed most of the code i need by going through this linkhttps://dsuch.github.io/pymqi/examples.html#how-to-correlate-request-and-response-messages-using-correlationidThe only pending issue is the format of correlation ID. I tried quite a few options but MQ is converting the correlation ID Into byte array (seems IBM MQ default setting) before throwing it on the Q. All my downstream systems are looking for a HEX value and is breaking.I am stuck on this for a few days now. Is there a way to force the correlation ID in message properties?.Please let me knowRegards\nAravind@JoshMc thanks a lot for the reply. It is proprietary code so little difficult to paste whole thing however here is the relevant piece. Downstream system is looking at this JMS Correlation ID to increment and put back in the queue. When i am sending this through below code it hits queue gets converted to byte array however downstream system read validation fails. I want this to hit the queue as a HEX value as in it should be the exact value i pass and not byte array.queue = self._open_write_queue(queue_name)\n\nput_mqmd = pymqi.md()\nput_mqmd.Format = CMQC.MQFMT_STRING\nCCSID = 1202\n\n put_opts = pymqi.pmo()\n# Set the MsgType to request.\n# put_mqmd[\"MsgType\"] = CMQC.MQMT_REQUEST\nput_mqmd[\"MsgId\"] = '00002Y0001T1'\nput_mqmd[\"CorrelId\"] = '00002Y0001T1'\n\n put_opts = pymqi.PMO(Options=CMQC.MQPMO_NO_SYNCPOINT +\n CMQC.MQPMO_FAIL_IF_QUIESCING + CMQC.MQRO_PASS_CORREL_ID)\n queue.put(message, put_mqmd, put_opts)when I put a message through to the queue, it is getting posted successfully, but does not get processed by the downstream system:In the screenshot above the first message in the queue was posted using app JMSToolBox- which has the correlationId as expected by the downstream systems. The second message was posted using robot framework/pymqi - which has the correlation-id displayed ID:30303..... Also please note that the JMSDestination is displayed as null for the second message.(For the first message posted manually has the as 'JMSDestination: queue:///QueueName'Now i have two issues - CorrelationId not coming up as i expect and the JMSDestination:null. I'm not sure how I can set the destination using pymqi library(or is this set at Q-Manager level) Any help is much appreciated.Screenshot of message sent by JMSToolBox:Screenshot of message sent using robotframework-pymqi:The only difference I find in the two messages now is the JMSDestination:Null in the JMSHeader for the message sent using Pymqi. I also tried changing the PROPCTL setting for the queue- but did not help.Is there a I can send the java properties using pymqi?### Assistant: As the comments indicate, the correlation id needs to be a byte array padded out to 24 bytes or 48 hexadecimals. SoPython 2 & 3 compatible wayput_mqmd[\"CorrelId\"] = 'Aravind'.ljust(24).encode('utf-8')Python 3 only wayput_mqmd[\"CorrelId\"] = bytes('Aravind'.ljust(24), 'utf-8')but the easiest way is to let the underlying client generate it for you by passing inCMQC.MQPMO_NEW_CORREL_ID. I can't tell you where in your code, because you haven't shown that bit, but there are samples in thepymqidocumentation.\n"} +{"text": "### Human: I want to create a high availability cluster. But i cant find any steps to create one from the IBM documentation.I followedthisguide to create the cluster.BothQMare deployed with docker-compose:version: '3.7'\nservices:\n london:\n build:\n context: ./config/london\n environment:\n LICENSE: \"accept\"\n MQ_QMGR_NAME: \"QM1\"\n MQ_ENABLE_METRICS: \"true\"\n ports:\n - 9443:9443 # web view\n - 9157:9157 # metrics\n\n newyork:\n build:\n context: ./config/newyork\n environment:\n LICENSE: \"accept\"\n MQ_QMGR_NAME: \"QM2\"\n MQ_ENABLE_METRICS: \"true\"\n ports:\n - 9553:9443 # web view\n - 9158:9157 # metrics\n depends_on:\n - londonDockerfile for both images:FROM ibmcom/mq\n\nCOPY init.mqsc /etc/mqm/20-init.mqscHere is the config for thelondonMQ instance:* cluster config\nALTER QMGR +\n REPOS(INVENTORY) +\n PSCLUS(ENABLED)\n\nDEFINE LISTENER(LONDON_LS) +\n TRPTYPE(TCP) +\n CONTROL(QMGR)\n\nDEFINE CHANNEL(INVENTORY.LONDON) +\n CHLTYPE(CLUSRCVR) +\n TRPTYPE(TCP) +\n CONNAME('london(1414)') +\n CLUSTER(INVENTORY) +\n DESCR('TCP Cluster-receiver channel for queue manager LONDON')\n\nDEFINE CHANNEL(INVENTORY.NEWYORK) +\n CHLTYPE(CLUSSDR) +\n TRPTYPE(TCP) +\n CONNAME('newyork(1414)') +\n CLUSTER(INVENTORY) +\n DESCR('TCP Cluster-sender channel from LONDON to repository at NEWYORK')\n\nSET CHLAUTH('INVENTORY.LONDON') +\n TYPE(QMGRMAP) +\n QMNAME(QM2) +\n USERSRC(CHANNEL) +\n ADDRESS('*')and here for thenewyorkinstance:* cluster config\nALTER QMGR +\n REPOS(INVENTORY) +\n PSCLUS(ENABLED)\n\nDEFINE LISTENER(NEWYORK_LS) +\n TRPTYPE(TCP) +\n CONTROL(QMGR)\n\nDEFINE CHANNEL(INVENTORY.NEWYORK) +\n CHLTYPE(CLUSRCVR) +\n TRPTYPE(TCP) +\n CONNAME('newyork(1414)') +\n CLUSTER(INVENTORY) +\n DESCR('TCP Cluster-receiver channel for queue manager NEWYORK')\n\nDEFINE CHANNEL(INVENTORY.LONDON) +\n CHLTYPE(CLUSSDR) +\n TRPTYPE(TCP) +\n CONNAME('london(1414)') +\n CLUSTER(INVENTORY) +\n DESCR('TCP Cluster-sender channel from NEWYORK to repository at LONDON')\n\nSET CHLAUTH('INVENTORY.NEWYORK') +\n TYPE (QMGRMAP) +\n QMNAME(QM1) +\n USERSRC(CHANNEL) +\n ADDRESS('*')I want to have a topic in which my applications can write/read from regardless of theQMthey are connected to.\nIs this even possible and if so could you share theMQSCcommands or a link to a example setup.### Assistant: MQ clustering is about load balancing connectivity between queue managers.You could have for example a clustered queue that is defined on LONDON and NEWYORK, this could be PUT(ENABLED) on both (hot/hot) and message sent to that queue by cluster members will be in general round robin between the two instances.If you want it to be hot/warm, then you would PUT(DISABLE) one of the two instances for example LONDON, then you would direct your application to connect and read from NEWYORK, if NEWYORK went down, you could PUT(ENABLED) the queue on LONDON and message from that point forward will go to LONDON and you can direct your application to LONDON (note that any message that were sitting on the queue on NEWYORK will only be available when NEWYORK is recovered. MQ does not replicate the messages to both queue managers.With pub/sub it is slightly different in that all queue managers in the cluster will know about clustered topics, and if any subscriber on any QM in the cluster subscribes to that TOPIC a proxy subscription will be made by the subscriber QM, if any publishes happen to that topic on any queue manager a copy will be directed to each local subscriber as well as any QMs with a proxy subscription in place, the subscriber QM will then deliver the message to any subscribers local to it (so only one proxy sub even if multiple subscribers on that same QM).If you had non-durable subscribers they could then subscribe to the topic on any QM and receive messages published after the subscription is created but not before.If you required that you receive messages when the subscriber is not connected you would need a durable subscription and that would be tied to the specific queue manager it was made on.You may want to look at RDQM which does provide replication between nodes, but is not compatible with containers.\n"} +{"text": "### Human: This is an existing monolith app and fix is required without a drastic change of the setup.Project setup:project 1 (config) - > where all mq-xml files are present (e.g - ibm_mq_config.xml)e.g - content of dev_bm_mq.xml${hname}\n \n \n ${port}\n \n \n ${qmgr}\n \n \n 1\n\n \n \n \n\n\n\n\n\n\n\n\n\n\n\n \n \n \n \n ${myQUEUE}\n \n \n false\n \n \n 20000\n \n\n \n \n ${myQUEUE}\n \n \n \n \n \n \n \n \n \n****Project B (App)****loads the spring xml from project config as below:\nWebContent/WEB-INF/spring/sprint-context.xm...Server logs with message sent with JMeterHeader2020-04-21 11:07:59.913 DEBUG 48093 --- [DefaultMessageListenerContainer-2] \n c.b.i.c.listeners.AbstractAgiListener : Receive message on MQ with header : {someargs}MessageRFH \u00a8\u00ff\u00ff\u00ff\u00fe \u00b8 jms_bytes 8queue:///myqueue\n0 mysender...Any idea how to solve it please? Thank you.### Assistant: The \"JMeter object\" you should use isJSR223 SamplerDownload the relevant version of thecom.ibm.mq.allclientlibrary (with dependencies) and drop it toJMeter ClasspathRestart JMeter to pick the libraries upAdd JSR223 Sampler to your Test PlanCreate the message according to your requirements and publish it to the queue. Reference code:import com.ibm.mq.MQAsyncStatus\nimport com.ibm.mq.MQMessage\nimport com.ibm.mq.MQPutMessageOptions\nimport com.ibm.mq.MQQueueManager\nimport com.ibm.mq.constants.CMQC\nimport com.ibm.mq.constants.MQConstants\nimport com.ibm.mq.headers.MQRFH2\n\ndef mqProps = new Hashtable()\nmqProps.put(MQConstants.CHANNEL_PROPERTY, 'DEV.APP.SVRCONN')\nmqProps.put(MQConstants.PORT_PROPERTY, 1414)\nmqProps.put(MQConstants.HOST_NAME_PROPERTY, '192.168.99.100')\n\ndef qManager = 'QM1'\ndef queueName = 'DEV.QUEUE.1'\n\n\ndef qMgr = new MQQueueManager(qManager, mqProps)\ndef openOptions = MQConstants.MQOO_OUTPUT | MQConstants.MQOO_INPUT_AS_Q_DEF\ndef queue = qMgr.accessQueue(queueName, openOptions)\n\ndef pmo = new MQPutMessageOptions()\npmo.options = MQConstants.MQPMO_ASYNC_RESPONSE\ndef message = new MQMessage()\ndef rfh2 = new MQRFH2()\nrfh2.setEncoding(CMQC.MQENC_NATIVE)\nrfh2.setCodedCharSetId(CMQC.MQCCSI_INHERIT)\nrfh2.setFormat(CMQC.MQFMT_STRING)\nrfh2.setNameValueCCSID(1208)\nrfh2.setFieldValue('your', 'data', 'here')\nrfh2.write(message)\n\nqueue.put(message, pmo)\nqueue.close()\n\nMQAsyncStatus asyncStatus = qMgr.getAsyncStatus()\nlog.info('Successfully published: ' + asyncStatus.putSuccessCount + ' message(s)')References:MQRFH2 classHandling IBM MQ message headers with IBM MQ classes for JavaIBM MQ testing with JMeter - Learn How\n"} +{"text": "### Human: Use case : I want to load IBM or RabbitMq configuration based on a broker value (env variable). My listeners (Message Driven POJO) are working individually. This is required because my DeV and Test runs on Rabbit and QA and Prod Runs on IBM.App: Spring BootI am thinking of loading the properties based on env.Appconfig.java@Configuration\n @ConfigurationProperties(classpath: application-${spring.profile.active}-{config-broker}.properties)\n\n//Broker value can be IBM, Rabbit or None\n\npublic MQQueueConnectionFactory mqQueueConnectionFactory(){\n..\n}Question: How do I make sure I load only IBM and Rabbit config and not load both.Is there a way to load only one App config class and Message Listeners.PS : with single config(ibm/rabbit), I am able to load and start my listener without any issues.### Assistant: As the others have said, you should likely change your setup and use IBM MQ Advanced for development.To answer your question, though, you could simply annotate your@Beansor whole@Configurationclasses with@ConditionalOnProperty, like@ConditionalOnProperty(name = \"spring.profile.active\", havingValue = \"dev\")\n@Bean\n// RabbitMQ...\n"} +{"text": "### Human: I'm sending XML to an IBM MQ Queue that contains a CDATA section. That CDATA section contains these special characters:$\u00a7)#\u00dc\u00d6&!^. For some reason, they are showing up within the MQ Queue as$\ufffd)#\ufffd\ufffd&!^. This causes the other send to take it off the queue with these characters and ending up having an invalid signature because the messages no longer match up.We've verified that the message when we do a.Put()does contain an XML string with those special characters. I've ensured that the message has.CharacterSetproperty assigned to it that matches what we will eventually pull off the queue.What other places can possibly be auto-encoding the special characters when it's put on the queue? Our application is in a .NET windows environment, but the MQ server is on a Linux box. Is this something to consider?string xmlMsg = \"$\u00a7)#\u00dc\u00d6&!^]]\"; // This is in a CDATA section.\nmQMessage = new MQMessage\n{\n CharacterSet = 1208,\n};\n\nmQMessage.WriteBytes(xmlMsg);\n\n_queue.Put(mQMessage);### Assistant: By default MQ doesn't change the character set of your message. So by default it is the responsibility of the sending and receiving applications to agree and maintain a character set that suits both.You can request MQ to do character set conversion either in the receiving application, when that calls a get, or on the sender channels when the message is transmitted between queue managers. But even if you request character set conversion from MQ, it is still the sending applications responsibility to actually write the data into the message using the character set the application is setting on the MQ message header.Based on your code it seems your sending application doesn't use the correct character set when it writes the bytes to the message. If you use WriteBytes, you need to manually convert the string into bytes using the desired character set.I'd suggest you to use the WriteString method, which is designed to use the chracter set specified in the CharacterSet property:The WriteString method converts from Unicode to the character set encoded in CharacterSet. If CharacterSet is set to its default value, MQC.MQCCSI_Q_MGR, which is 0, no conversion takes place and CharacterSet is set to 1200. If you set CharacterSet to some other value, WriteString converts from Unicode to the alternate value.https://www.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.ref.dev.doc/q111220_.htmAnd by the way, for debugging character set issues you have to be very careful what tools you use to check the message, as your tool needs to be able to interpret the character set of the message. For example MQ Explorer uses the character set of your workstation where you run it, so it will show every message with that one character set, so is not suitable to debug these issues. The best is to get the message off the queue without asking the QM for conversion with rfhutil for example, save it to a file and look at it with a hex editor.\n"} +{"text": "### Human: I have to configure a backout queue for the MQ input node in my application.I created one local queue as a backout queue, but don't know how to assign it.Also, how to check the backout threshold and direct the message to backout queue if the count exceeds.### Assistant: Using RUNMQSC run the followingALTER QL() BOQNAME() BOTHRESH()For example the following sets backout queue BACKQ with a threshold of 5.ALTER QL(MAINQ) BOQNAME(BACKQ) BOTHRESH(5)\n"} +{"text": "### Human: Can someone please advise how I can resolve this issue. I am seeing this error on my WAS application SystemOut.logs.### Assistant: Section 5.5.1 of the EJB 3.2 Specification indicates that Timer service and Timer methods are not accessible from the constructor, during injection, or post construct.ejbCreatewould be the post construct method for the bean, so calling TimerService.getTimers() is not permitted.Basically, you'll need to move that call to a message listener method. That doesn't work so well if you really need to do that as part of application start.Would it work to use a non-persistent automatic timer, such that it would be created automatically for you whenever the application starts? (i.e@Schedule)\n"} +{"text": "### Human: I am trying to use phpamqplib or pecl amqp to send messages to IBM MQ trough amqp protocol.With phpamqplib I get:3/21/20 19:04:28.965 AMQXR0021W: Client 'null' at network address '......' disconnected abnormally\u00a0\nwith exception 'Received fatal alert: unknown_ca'.I am specifying the cacert and have imported it in the keystore.Pecl amqp - cannot find working example with ssl .Is there some php library that I can use for IBM MQ?Thank you### Assistant: IBM has a support document on using PHP with IBM MQhere.In the document, they usePECL.There are other PHP/IBM MQ user projects in GitHub:amabnl / php-mqseriesrstmpw / ibmmq\n"} +{"text": "### Human: Unable to give the permission 'chg' to theSYSTEM.AUTH.DATA.QUEUE. We tried giving usingsetmqautwithmqmsuper user access but no luck! Currently it is flooding ourAMQERR*error logs. Need your help on this.### Assistant: TheSYSTEM.AUTH.DATA.QUEUEis very restricted. This is because it holds the data that is your authority rules. You cannot givechgpermission to a non-privileged user ID and a privileged user ID already has the ability to change.IBM Knowledge Center says:-Authorization data is stored on a local queue called SYSTEM.AUTH.DATA.QUEUE. Access to this queue is restricted to users in the mqm group, and additionally on Windows, to users in the Administrators group, and users logged in with the SYSTEM ID. User access to the queue cannot be changed.If you need to make a change to this queue (you don't say why), then you can only do it using a privileged user id, e.g. a member of the mqm group.\n"} +{"text": "### Human: While trying to create the context, this code throws the exception below:package com.mycompany.mq.client;\n\nimport static org.junit.Assert.assertEquals;\n\nimport java.io.File;\nimport java.io.FileNotFoundException;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.logging.Logger;\n\nimport javax.jms.JMSConsumer;\nimport javax.jms.JMSContext;\nimport javax.jms.JMSProducer;\nimport javax.jms.Queue;\nimport javax.jms.TextMessage;\n\nimport org.junit.Assert;\nimport org.junit.Test;\nimport com.ibm.msg.client.jms.JmsConnectionFactory;\nimport com.ibm.msg.client.jms.JmsFactoryFactory;\nimport com.ibm.msg.client.wmq.WMQConstants;\nimport com.prowidesoftware.swift.io.RJEReader;\nimport com.prowidesoftware.swift.model.SwiftMessage;\n\npublic class FileScanner {\n\n private static final Logger logger = Logger.getLogger(\"RJEFileParser\");\n\n @Test\n public void testPublish() throws Exception {\n\n int count=0;\n\n long m1,m2;\n\n // Create a connection factory\n JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);\n JmsConnectionFactory cf = ff.createConnectionFactory();\n // Set the properties\n String s;\n s=Config.get(\"HOST\"); // 10.32.1.69\n cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, s);\n s=Config.get(\"PORT\"); // 1414\n cf.setIntProperty(WMQConstants.WMQ_PORT, Integer.parseInt(s));\n s=Config.get(\"CHANNEL\"); // MQCLI.CLNTCONN\n cf.setStringProperty(WMQConstants.WMQ_CHANNEL, s);\n cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\n s=Config.get(\"QMGR\"); // RJE_PerfTest\n cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, s);\n cf.setStringProperty(WMQConstants.WMQ_APPLICATIONNAME, \"mq-cli\");\n cf.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, true);\n s=Config.get(\"APP_USER\"); // app\n cf.setStringProperty(WMQConstants.USERID, s);\n s=Config.get(\"APP_PASSWORD\"); // password\n cf.setStringProperty(WMQConstants.PASSWORD, s);\n\n // Create JMS objects\n\n try {\n\n JMSContext context = cf.createContext(); // Throws exception\n ... \n } catch (FileNotFoundException e) {\n e.printStackTrace();\n Assert.fail(e.getMessage());\n } catch (IOException e) {\n e.printStackTrace();\n Assert.fail(e.getMessage());\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail(e.getMessage());\n }\n }\n\n}The exception thrown:com.ibm.msg.client.jms.DetailedJMSRuntimeException: JMSWMQ0018: Failed\n to connect to queue manager 'RJE_PerfTest' with connection mode\n 'Client' and host name '10.32.1.69(1414)'. Check the queue manager is\n started and if running in client mode, check there is a listener\n running. Please see the linked exception for more information. at\n com.ibm.msg.client.jms.DetailedJMSException.getUnchecked(DetailedJMSException.java:267)\n at\n com.ibm.msg.client.jms.internal.JmsErrorUtils.convertJMSException(JmsErrorUtils.java:173)\n at\n com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createContext(JmsConnectionFactoryImpl.java:478)\n at\n com.mycompany.mq.client.FileScanner.testPublish(FileScanner.java:61)\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at\n sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n at\n sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n at java.lang.reflect.Method.invoke(Method.java:498) at\n org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)\n at\n org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)\n at\n org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)\n at\n org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)\n at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at\n org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)\n at\n org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)\n at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at\n org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at\n org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at\n org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at\n org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at\n org.junit.runners.ParentRunner.run(ParentRunner.java:363) at\n org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89)\n at\n org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)\n at\n org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)\n at\n org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)\n at\n org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)\n at\n org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)\n Caused by: com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with\n compcode '2' ('MQCC_FAILED') reason '2540'\n ('MQRC_UNKNOWN_CHANNEL_NAME'). at\n com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:203)\n at\n com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:424)\n at\n com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:8475)\n at\n com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:7815)\n at\n com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl._createConnection(JmsConnectionFactoryImpl.java:303)\n at\n com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createContext(JmsConnectionFactoryImpl.java:444)\n ... 24 more Caused by: com.ibm.mq.jmqi.JmqiException:\n CC=2;RC=2540;AMQ9204: Connection to host '10.32.1.69(1414)' rejected.\n [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2540;AMQ9520: Channel not\n defined remotely.\n [3=MQCLI.CLNTCONN]],3=10.32.1.69(1414),5=RemoteConnection.analyseErrorSegment]\n at\n com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:2314)\n at\n com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1285)\n at\n com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.jmqiConnect(InterceptedJmqiImpl.java:377)\n at com.ibm.mq.ese.jmqi.ESEJMQI.jmqiConnect(ESEJMQI.java:562) at\n com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:357)\n ... 28 more Caused by: com.ibm.mq.jmqi.JmqiException:\n CC=2;RC=2540;AMQ9520: Channel not defined remotely. [3=MQCLI.CLNTCONN]\n at\n com.ibm.mq.jmqi.remote.impl.RemoteConnection.analyseErrorSegment(RemoteConnection.java:4464)\n at\n com.ibm.mq.jmqi.remote.impl.RemoteConnection.receiveTSH(RemoteConnection.java:3199)\n at\n com.ibm.mq.jmqi.remote.impl.RemoteConnection.initSess(RemoteConnection.java:1274)\n at\n com.ibm.mq.jmqi.remote.impl.RemoteConnection.connect(RemoteConnection.java:895)\n at\n com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSessionFromNewConnection(RemoteConnectionSpecification.java:416)\n at\n com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSession(RemoteConnectionSpecification.java:312)\n at\n com.ibm.mq.jmqi.remote.impl.RemoteConnectionPool.getSession(RemoteConnectionPool.java:146)\n at\n com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1761)\n ... 32 moreDIS CHANNEL ('MQCLI.CLNTCONN')\n 3 : DIS CHANNEL ('MQCLI.CLNTCONN')\nAMQ8414: Display Channel details.\n CHANNEL(MQCLI.CLNTCONN) CHLTYPE(CLNTCONN)\n AFFINITY(PREFERRED) ALTDATE(2020-03-06)\n ALTTIME(11.34.36) CERTLABL( )\n CLNTWGHT(0) COMPHDR(NONE)\n COMPMSG(NONE) CONNAME(10.32.1.69)\n DEFRECON(NO) DESCR( )\n HBINT(300) KAINT(AUTO)\n LOCLADDR( ) MAXMSGL(4194304)\n MODENAME( ) PASSWORD( )\n QMNAME(RJE_PerfTest) RCVDATA( )\n RCVEXIT( ) SCYDATA( )\n SCYEXIT( ) SENDDATA( )\n SENDEXIT( ) SHARECNV(10)\n SSLCIPH( ) SSLPEER( )\n TPNAME( ) TRPTYPE(TCP)\n USERID( )With the Queue Manager configured asDIS QMGR\n 2 : DIS QMGR\nAMQ8408: Display Queue Manager details.\n QMNAME(RJE_PerfTest) ACCTCONO(DISABLED)\n ACCTINT(1800) ACCTMQI(OFF)\n ACCTQ(OFF) ACTIVREC(MSG)\n ACTVCONO(DISABLED) ACTVTRC(OFF)\n ALTDATE(2020-03-04) ALTTIME(15.48.24)\n AUTHOREV(DISABLED) CCSID(437)\n CERTLABL(ibmwebspheremqrje_perftest) CERTVPOL(ANY)\n CHAD(DISABLED) CHADEV(DISABLED)\n CHADEXIT( ) CHLEV(DISABLED)\n CHLAUTH(ENABLED) CLWLDATA( )\n CLWLEXIT( ) CLWLLEN(100)\n CLWLMRUC(999999999) CLWLUSEQ(LOCAL)\n CMDEV(DISABLED) CMDLEVEL(800)\n COMMANDQ(SYSTEM.ADMIN.COMMAND.QUEUE) CONFIGEV(DISABLED)\n CONNAUTH(SYSTEM.DEFAULT.AUTHINFO.IDPWOS)\n CRDATE(2020-02-20) CRTIME(16.25.00)\n CUSTOM( ) DEADQ( )\n DEFCLXQ(SCTQ) DEFXMITQ( )\n DESCR( ) DISTL(YES)\n INHIBTEV(DISABLED) IPADDRV(IPV4)\n LOCALEV(DISABLED) LOGGEREV(DISABLED)\n MARKINT(5000) MAXHANDS(256)\n MAXMSGL(104857600) MAXPROPL(NOLIMIT)\n MAXPRTY(9) MAXUMSGS(10000)\n MONACLS(QMGR) MONCHL(OFF)\n MONQ(OFF) PARENT( )\n PERFMEV(DISABLED) PLATFORM(WINDOWSNT)\n PSMODE(ENABLED) PSCLUS(ENABLED)\n PSNPMSG(DISCARD) PSNPRES(NORMAL)\n PSRTYCNT(5) PSSYNCPT(IFPER)\n QMID(RJE_PerfTest_2020-02-20_16.25.00)\n REMOTEEV(DISABLED) REPOS( )\n REPOSNL( ) REVDNS(ENABLED)\n ROUTEREC(MSG) SCHINIT(QMGR)\n SCMDSERV(QMGR) SPLCAP(DISABLED)\n SSLCRLNL( ) SSLCRYP( )\n SSLEV(DISABLED) SSLFIPS(NO)\n SSLKEYR(C:\\ProgramData\\IBM\\MQ\\qmgrs\\RJE_PerfTest\\ssl\\key)\n SSLRKEYC(0) STATACLS(QMGR)\n STATCHL(OFF) STATINT(1800)\n STATMQI(OFF) STATQ(OFF)\n STRSTPEV(ENABLED) SUITEB(NONE)\n SYNCPT TREELIFE(1800)\n TRIGINT(999999999) VERSION(08000005)\n XRCAP(NO)The connectivity works fine.How to troubleshoot this problem?Thanks in advance.### Assistant: This error comes out of a basic confusion between the channel types.The client connection channel configured in the server is for something else, as pointed out in this forum:https://www.tek-tips.com/viewthread.cfm?qid=248122\"When you say you created a 'Client Connection' on the Queue Manager,\n do you mean you created a channel with type CLNTCONN? This needs to be\n type SVRCONN to allow client connections. CLNTCONN channels are never\n use dby QMgrs - they are only there to create Channel Tables for\n clients.\"The client connection requires a server connection channel, created as explained here>https://www.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q031730_.htmDEFINE CHANNEL(SWFMQ.CHANNEL) CHLTYPE(SVRCONN) TRPTYPE(TCP)\n 7 : DEFINE CHANNEL(SWFMQ.CHANNEL) CHLTYPE(SVRCONN) TRPTYPE(TCP)\nAMQ8014: WebSphere MQ channel created.Now my channel looks:DIS CHANNEL ('SWFMQ.CHANNEL')\n 8 : DIS CHANNEL ('SWFMQ.CHANNEL')\nAMQ8414: Display Channel details.\n CHANNEL(SWFMQ.CHANNEL) CHLTYPE(SVRCONN)\n ALTDATE(2020-03-06) ALTTIME(13.09.41)\n CERTLABL( ) COMPHDR(NONE)\n COMPMSG(NONE) DESCR( )\n DISCINT(0) HBINT(300)\n KAINT(AUTO) MAXINST(999999999)\n MAXINSTC(999999999) MAXMSGL(4194304)\n MCAUSER( ) MONCHL(QMGR)\n RCVDATA( ) RCVEXIT( )\n SCYDATA( ) SCYEXIT( )\n SENDDATA( ) SENDEXIT( )\n SHARECNV(10) SSLCAUTH(REQUIRED)\n SSLCIPH( ) SSLPEER( )\n TRPTYPE(TCP)\n"} +{"text": "### Human: I am getting below error while pushing a message from apache camel component to IBM-MQ.Error:-\nCaused by: com.ibm.msg.client.jms.DetailedMessageFormatException: JMSCC0050: The property name 'JMS_Solace_DeadMsgQueueEligible' is reserved and cannot be set.Below are my pom jars i am using -2.21.0\n2.21.0\n2.21.0I am running the application using spring boot container.### Assistant: Try to remove that header, something a like:from solace\n removeHeaders(\"JMS_Solace*\")\n to ibmmq\n"} +{"text": "### Human: I am trying to read messages from MQ all at once by iterating through it. Currently I am only able to read one message at a time. I want to have a counter which will control how many times the loop will get executed or something like a while loop which will terminate when the queue is empty or else will continue reading message.public string ReadMessages()\n {\n MQQueue mqDestination;\n String Readmessage = null;\n QueueManagerName = ConfigurationManager.AppSettings[\"QueueManagername\"];\n Hashtable properties = new Hashtable();\n properties.Add(MQC.HOST_NAME_PROPERTY, ConfigurationManager.AppSettings[\"Connection\"]);\n properties.Add(MQC.PORT_PROPERTY, ConfigurationManager.AppSettings[\"PortNo\"]);\n properties.Add(MQC.CHANNEL_PROPERTY, ConfigurationManager.AppSettings[\"Channelname\"]); \n properties.Add(MQC.MQCA_TOPIC_NAME, ConfigurationManager.AppSettings[\"Queuename\"]);\n\n properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\n queueManager = new MQQueueManager(QueueManagerName, properties);\n\n int openOptionsForGet = (MQC.MQSO_CREATE\n + (MQC.MQSO_FAIL_IF_QUIESCING\n + (MQC.MQSO_MANAGED\n + (MQC.MQSO_NON_DURABLE + MQC.MQMO_NONE))));\n\n\n MQGetMessageOptions Gmo;\n MQMessage RetrievedMessage;\n RetrievedMessage = new MQMessage();\n try\n {\n RetrievedMessage = new MQMessage();\n Gmo = new MQGetMessageOptions();\n //Queue Name\n mqDestination = queueManager.AccessQueue(ConfigurationManager.AppSettings[\"QueueName\"], openOptionsForGet);\n mqDestination.Get(RetrievedMessage, Gmo);\n string message = RetrievedMessage.ReadString(RetrievedMessage.MessageLength);\n queueManager.Disconnect();\n }\n catch (MQException ex)\n {\n switch (ex.ReasonCode)\n {\n case IBM.WMQ.MQC.MQRC_NO_MSG_AVAILABLE:\n Library.ErrorLogs(\"error\" + \"No message available.\");\n break;\n case IBM.WMQ.MQC.MQRC_Q_MGR_QUIESCING:\n case IBM.WMQ.MQC.MQRC_Q_MGR_STOPPING:\n Library.ErrorLogs(\"error\" + \"Queue Manager Stopping: \" + ConfigurationManager.AppSettings[\"QueueManagername\"] + \"\\t\" + ex.Message);\n break;\n case IBM.WMQ.MQC.MQRC_Q_MGR_NOT_ACTIVE:\n case IBM.WMQ.MQC.MQRC_Q_MGR_NOT_AVAILABLE:\n Library.ErrorLogs(\"error\" + \"Queue Manager not available: \" + ConfigurationManager.AppSettings[\"QueueManagername\"] + \"\\t\" + ex.Message);\n break;\n default:\n Library.ErrorLogs(\"error\" + \" Error reading topic: \" + ConfigurationManager.AppSettings[\"Queuename\"] + \"\\t\" + ex.Message);\n break;\n }\n\n }\n catch (Exception ex)\n {\n // Console.WriteLine(\"MQException caught. \" + mqE.ToString());\n Library.ErrorLogs(\"error\" + ex.Message);\n queueManager.Disconnect();\n\n }\n return Readmessage;\n\n\n }### Assistant: (1) You cannot get all the messages from a queue at once. You need to retrieve each message individually. MQ is not a database.(2) You have topic code in your sample. Are you getting messages from a queue or topic. There is a difference.Here is a fully functioning CS/.NET/MQ sample program to retrieve all messages on a queue:using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Configuration;\nusing System.Text;\nusing IBM.WMQ;\n\n/// Program Name\n/// MQTest72\n///\n/// Description\n/// This C# class will connect to a remote queue manager\n/// and get messages from a queue using a managed .NET environment.\n///\n/// \n/// Roger Lacroix\n/// \nnamespace MQTest72\n{\n class MQTest72\n {\n private Hashtable qMgrProp = null;\n private System.String qManager;\n private System.String inputQName;\n\n /*\n * The constructor\n */\n public MQTest72()\n : base()\n {\n }\n\n /// Make sure the required parameters are present.\n /// true/false\n /// \n private bool allParamsPresent()\n {\n bool b = false;\n\n if ( (ConfigurationManager.AppSettings[\"ConnectionName\"] != null) &&\n (ConfigurationManager.AppSettings[\"Port\"] != null) &&\n (ConfigurationManager.AppSettings[\"ChannelName\"] != null) &&\n (ConfigurationManager.AppSettings[\"QMgrName\"] != null) &&\n (ConfigurationManager.AppSettings[\"QueueName\"] != null) )\n {\n try\n {\n System.Int32.Parse(ConfigurationManager.AppSettings[\"Port\"]);\n b = true;\n }\n catch (System.FormatException e)\n {\n b = false;\n }\n }\n\n return b;\n }\n\n /// Extract the configuration applicaiton settings and initialize the MQ variables.\n /// \n /// \n /// IllegalArgumentException \n private void init(System.String[] args)\n {\n if (allParamsPresent())\n {\n qManager = ConfigurationManager.AppSettings[\"QMgrName\"];\n inputQName = ConfigurationManager.AppSettings[\"QueueName\"];\n\n qMgrProp = new Hashtable();\n qMgrProp.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\n\n qMgrProp.Add(MQC.HOST_NAME_PROPERTY, ConfigurationManager.AppSettings[\"ConnectionName\"]);\n qMgrProp.Add(MQC.CHANNEL_PROPERTY, ConfigurationManager.AppSettings[\"ChannelName\"]);\n\n try\n {\n qMgrProp.Add(MQC.PORT_PROPERTY, System.Int32.Parse(ConfigurationManager.AppSettings[\"Port\"]));\n }\n catch (System.FormatException e)\n {\n qMgrProp.Add(MQC.PORT_PROPERTY, 1414);\n }\n\n if (ConfigurationManager.AppSettings[\"UserId\"] != null)\n qMgrProp.Add(MQC.USER_ID_PROPERTY, ConfigurationManager.AppSettings[\"UserId\"]);\n\n if (ConfigurationManager.AppSettings[\"Password\"] != null)\n qMgrProp.Add(MQC.PASSWORD_PROPERTY, ConfigurationManager.AppSettings[\"Password\"]);\n\n logger(\"Parameters:\");\n logger(\" QMgrName ='\" + qManager + \"'\");\n logger(\" Queue Name ='\" + inputQName + \"'\");\n\n logger(\"Connection values:\");\n foreach (DictionaryEntry de in qMgrProp)\n {\n logger(\" \" + de.Key + \" = '\" + de.Value + \"'\");\n }\n }\n else\n {\n throw new System.ArgumentException();\n }\n }\n\n /// Connect, open queue, retrieve all messages, close queue and disconnect.\n /// MQException \n private void handleIt()\n {\n MQQueueManager qMgr = null;\n MQQueue inQ = null;\n int openOptions = MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING;\n\n try\n {\n qMgr = new MQQueueManager(qManager, qMgrProp);\n logger(\"MQTest72 successfully connected to \" + qManager);\n\n inQ = qMgr.AccessQueue(inputQName, openOptions);\n logger(\"MQTest72 successfully opened \" + inputQName);\n\n retrieveAll(inQ);\n }\n catch (MQException mqex)\n {\n logger(\"MQTest72 CC=\" + mqex.CompletionCode + \" : RC=\" + mqex.ReasonCode);\n }\n catch (System.IO.IOException ioex)\n {\n logger(\"MQTest72 ioex=\" + ioex);\n }\n finally\n {\n try\n {\n if (inQ != null)\n {\n inQ.Close();\n logger(\"MQTest72 closed: \" + inputQName);\n }\n }\n catch (MQException mqex)\n {\n logger(\"MQTest72 CC=\" + mqex.CompletionCode + \" : RC=\" + mqex.ReasonCode);\n }\n\n try\n {\n if (qMgr != null)\n {\n qMgr.Disconnect();\n logger(\"MQTest72 disconnected from \" + qManager);\n }\n }\n catch (MQException mqex)\n {\n logger(\"MQTest72 CC=\" + mqex.CompletionCode + \" : RC=\" + mqex.ReasonCode);\n }\n }\n }\n\n /// Retrieve all messages from a queue or until a 'QUIT' message is received.\n /// \n /// \n private void retrieveAll(MQQueue inQ)\n {\n bool flag = true;\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.Options |= MQC.MQGMO_NO_WAIT | MQC.MQGMO_FAIL_IF_QUIESCING;\n MQMessage msg = null;\n\n while (flag)\n {\n try\n {\n msg = new MQMessage();\n inQ.Get(msg, gmo);\n if (msg.Feedback == MQC.MQFB_QUIT)\n {\n flag = false;\n logger(\"received quit message - exiting loop\");\n }\n else\n logger(\"Message Data: \" + msg.ReadString(msg.MessageLength));\n }\n catch (MQException mqex)\n {\n logger(\"CC=\" + mqex.CompletionCode + \" : RC=\" + mqex.ReasonCode);\n if (mqex.Reason == MQC.MQRC_NO_MSG_AVAILABLE)\n {\n // no meesage - life is good\n flag = false;\n logger(\"no more meesages - exiting loop\");\n }\n else\n {\n flag = false; // severe error - time to exit\n }\n }\n catch (System.IO.IOException ioex)\n {\n logger(\"ioex=\" + ioex);\n }\n }\n }\n\n /// Output the log message to stdio.\n /// \n /// \n private void logger(String data)\n {\n DateTime myDateTime = DateTime.Now;\n System.Console.Out.WriteLine(myDateTime.ToString(\"yyyy/MM/dd HH:mm:ss.fff\") + \" \" + this.GetType().Name + \": \" + data);\n }\n\n /// main line\n /// \n /// \n // [STAThread]\n public static void Main(System.String[] args)\n {\n MQTest72 mqt = new MQTest72();\n\n try\n {\n mqt.init(args);\n mqt.handleIt();\n }\n catch (System.ArgumentException e)\n {\n System.Console.Out.WriteLine(\"Usage: MQTest72 -h host -p port -c channel -m QueueManagerName -q QueueName [-u userID] [-x passwd]\");\n System.Environment.Exit(1);\n }\n catch (MQException e)\n {\n System.Console.Out.WriteLine(e);\n System.Environment.Exit(1);\n }\n\n System.Environment.Exit(0);\n }\n }\n}\n"} +{"text": "### Human: I am getting below error while putting some data on Reply Queue. My Application flow is I have a MQ Listener(Spring Boot Container) in place which keeps on listening to a REQ Queue and process the data once received on REQ Queue and finally puts the processed data on the REPLY Queue.In my case, the issue is coming while sending the data on REP Queue after certain number of request and reply flows and I am sure while it reaches the MAX HANDLE count this issue starts coming. For temporary fix, now I am restarting my MQ Listener container.Can someone help on where can I check the MAXHANDS count(I assume its configured at MQ end) and is there any way to check after how many counts the issue is getting reproduced?Note: I am consuming IBMMQ and all Queue Infrastructure is managed by the MQ Team.Error Details:Caused by: com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with\n compcode '2' ('MQCC_FAILED') reason '2017'\n ('MQRC_HANDLE_NOT_AVAILABLE').Immediate help much appreciated.public class MessageHandlerImplRCC implements SessionAwareMessageListener {\n @Override public void onMessage(Message message, Session session) {\n TextMessage imbMqReplyMessage = session.createTextMessage();\n imbMqReplyMessage.setJMSMessageID(message.getJMSMessageID());\n imbMqReplyMessage.setJMSCorrelationID(message.getJMSMessageID());\n imbMqReplyMessage.setText(dlmToDemiMappedString);\n MessageProducer messageProducerIBM = session.createProducer(message.getJMSReplyTo());\n messageProducerIBM.send(imbMqReplyMessage);\n message.acknowledge();\n }\n}### Assistant: To see how many handles one task can have open, use the following MQSC command:-DISPLAY QMGR MAXHANDSBy default this is 256. Rather than increasing this however, you should be closing off handles that you are no longer using.Issue the following MQSC command to find your connection.DISPLAY CONN(*) TYPE(CONN) APPLTAGand look for your application name in theAPPLTAGfield, then copy out theCONNvalue and issue this MQSC command:DISPLAY CONN(paste-in-conn-value) TYPE(ALL)and you will see all the queues you have opened. If you don't think you need to keep them all open, then close off the ones you don't need, for example by using:-messageProducerIBM.close();Restarting the listener has the effect of closing them all off, which sets your number of handles back to zero.\n"} +{"text": "### Human: Now, my app receives all available messages in a Queue manager. I collect them locally and process one by one. \nCould do I configure it to receive one message, do some work (it can take some time), delete the received message, repeat? Is this behavior possible with IBM MQ?\nThe code was updatedfunction listenToMQ() {\n const qMgr = inbound.queueManagerName;\n const qName = inbound.queueName;\n const connName = inbound.host;\n\n const cno = new mq.MQCNO();\n const sco = new mq.MQSCO();\n const csp = new mq.MQCSP();\n const cd = new mq.MQCD();\n cno.SecurityParms = csp;\n csp.UserId = inbound.userID;\n csp.authenticationType = 0;\n cno.Options |= MQC.MQCNO_CLIENT_BINDING;\n cd.ConnectionName = connName;\n cd.ChannelName = inbound.channelName;\n cd.SSLClientAuth = MQC.MQSCA_OPTIONAL;\n cd.MaxMsgLength = 104857600;\n cno.ClientConn = cd;\n cno.SSLConfig = sco;\n\n mq.setTuningParameters({\n syncMQICompat: true });\n\n mq.Connx(qMgr, cno, function(err, hConn) {\n if (err) {\n logger.errorLogger().error(err.message);\n } else {\n const od = new mq.MQOD();\n od.ObjectName = qName;\n od.ObjectType = MQC.MQOT_Q;\n const openOptions = MQC.MQOO_BROWSE;\n mq.Open(hConn, od, openOptions, function(err, hObj) {\n queueHandle = hObj;\n if (err) {\n logger.errorLogger().error(err.message);\n } else {\n getMessages();\n }\n });\n } }); }\n\n\n function getMessages() {\n const md = new mq.MQMD();\n const gmo = new mq.MQGMO();\n\n gmo.Options =\n MQC.MQGMO_NO_SYNCPOINT |\n MQC.MQGMO_MQWI_UNLIMITED |\n MQC.MQGMO_CONVERT |\n MQC.MQGMO_FAIL_IF_QUIESCING;\n gmo.Options |= MQC.MQGMO_BROWSE_FIRST;\n\n gmo.MatchOptions = MQC.MQMO_NONE;\n\n mq.setTuningParameters({\n getLoopPollTimeMs: 500 }); mq.Get(queueHandle, md, gmo, getCB); }\n\n\n\n function getCB(err, hObj, gmo, md, buf, hConn) {\n if (md.Format == \"MQSTR\") {\n console.log(md);\n const message = decoder.write(buf);\n updateDB(getMetaFeed(message));\n } \n mq.Cmit(hConn);\n }\n\n gmo.Options &= ~MQC.MQGMO_BROWSE_FIRST;\n gmo.Options |= MQC.MQGMO_BROWSE_NEXT; }### Assistant: Yes, most certainly you can.Your application can get one message, perhaps using syncpoint if it is a message that drives some work that needs done, do the work and then when the work is done commit the get of the message and then go and get the next one. If the work that needs to be done is also transactional (e.g. update a database), then a global transaction could be used to commit both the MQ message and the update of the other transactional resource at the same time.The code you show in your question appears to be doing a browse of messages (queue opened withMQOO_BROWSEand then messages read usingMQGMO_BROWSE_FIRSTand thenMQGMO_BROWSE_NEXT). I'm not sure how or when your application currently removes the messages from the queue?Your current code appears to be processing the messages one by one already, so the only changes needed would be to the get options (and to add a commit call).\n"} +{"text": "### Human: I created a queue manager, queue, channel(Server-connection).\nWhen I try to send a message, see this error:\ncom.ibm.msg.client.jms.DetailedIllegalStateException: JMSWMQ0018: Failed to connect to queue manager 'MY_LOCAL_QM' with connection mode 'Client' and host name 'epspa(1401)'.\nCheck the queue manager is started and if running in client mode, check there is a listener running. Please see the linked exception for more information.Maybe I need to set a user to queue manager? Because I use the same java code, but try to connect to another queue manager, and it works fine. But it doesn't work with my queue manager. \nIBM MQ installed on another PC.private static final String HOST = \"epspa\";\nprivate static final int PORT = 1401;\nprivate static final String CHANNEL = \"API.SVRCONN_LOCAL\";\nprivate static final String QMN = \"MY_LOCAL_QM\";\nprivate static final String QUEUE_NAME = \"API.QUEUE_NAME\";\nprivate static final String message =\"message\";\n\npublic static String sendMessage(String message) {\n String result = \"Error\";\n try {\n MQQueueConnectionFactory cf = new MQQueueConnectionFactory();\n cf.setHostName(HOST);\n cf.setChannel(CHANNEL);\n cf.setPort(PORT);\n cf.setQueueManager(QMN);\n cf.setTransportType(WMQConstants.WMQ_MESSAGE_BODY_MQ);\n\n Destination destination = null;\n MessageProducer producer = null;\n\n Connection c = cf.createConnection();\n Session s = c.createSession(false, Session.AUTO_ACKNOWLEDGE);\n destination = s.createQueue(QUEUE_NAME);\n producer = s.createProducer(destination);\n TextMessage tmo = s.createTextMessage();\n\n\n ((MQDestination) destination).setMessageBodyStyle\n (WMQConstants.WMQ_MESSAGE_BODY_MQ);\n\n tmo.setIntProperty(WMQConstants.JMS_IBM_CHARACTER_SET, 1208);\n tmo.setIntProperty(WMQConstants.JMS_IBM_ENCODING,546);\n tmo.setText(message);\n producer.send(tmo);\n\n result = \"Success!\";\n } catch (JMSException e) {\n e.printStackTrace();\n } catch (Exception e) {\n e.printStackTrace();\n }\n return result;\n}### Assistant: cf.setTransportType(WMQConstants.WMQ_MESSAGE_BODY_MQ);Well, that's not correct. It should be:cf.setTransportType(WMQConstants.WMQ_CM_CLIENT);JMSWMQ0018: Failed to connect to queue managerA JMS error does not give enough details about what MQ is complaining about. You need to output the LinkedException.catch (JMSException e)\n{\n if (e != null)\n {\n System.err.println(\"getLinkedException()=\" + e.getLinkedException());\n System.err.println(e.getLocalizedMessage());\n e.printStackTrace();\n }\n}Are you sure that port # of 1401 is correct? The default port # for MQ is 1414. Start runmqsc against your queue manager. i.e.runmqsc MY_LOCAL_QMthen issue the following command:DIS LISTENER(LISTENER.TCP)what value is given for the PORT attribute?tmo.setIntProperty(WMQConstants.JMS_IBM_CHARACTER_SET, 1208);\n tmo.setIntProperty(WMQConstants.JMS_IBM_ENCODING,546);Why are you setting the CCSID and Encoding? Why don't you let JMS & MQ take care of it?Here is a fully functioning JMS program that puts a message to a queue:import java.text.SimpleDateFormat;\nimport java.util.Date;\nimport java.util.Hashtable;\nimport javax.jms.*;\n\nimport com.ibm.mq.jms.*;\nimport com.ibm.msg.client.wmq.WMQConstants;\n\n/**\n * Program Name\n * MQTestJMS11\n *\n * Description\n * This java JMS class will connect to a remote queue manager and put a message to a queue.\n *\n * Sample Command Line Parameters\n * -m MQA1 -h 127.0.0.1 -p 1414 -c TEST.CHL -q TEST.Q1 -u UserID -x Password\n *\n * @author Roger Lacroix\n */\npublic class MQTestJMS11\n{\n private static final SimpleDateFormat LOGGER_TIMESTAMP = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss.SSS\");\n\n private Hashtable params;\n private MQQueueConnectionFactory mqQCF = null;\n\n\n /**\n * The constructor\n */\n public MQTestJMS11()\n {\n super();\n params = new Hashtable();\n }\n\n /**\n * Make sure the required parameters are present.\n * @return true/false\n */\n private boolean allParamsPresent()\n {\n boolean b = params.containsKey(\"-h\") && params.containsKey(\"-p\") &&\n params.containsKey(\"-c\") && params.containsKey(\"-m\") &&\n params.containsKey(\"-q\") &&\n params.containsKey(\"-u\") && params.containsKey(\"-x\");\n if (b)\n {\n try\n {\n Integer.parseInt((String) params.get(\"-p\"));\n }\n catch (NumberFormatException e)\n {\n b = false;\n }\n }\n\n return b;\n }\n\n /**\n * Extract the command-line parameters and initialize the MQ variables.\n * @param args\n * @throws IllegalArgumentException\n */\n private void init(String[] args) throws IllegalArgumentException\n {\n if (args.length > 0 && (args.length % 2) == 0)\n {\n for (int i = 0; i < args.length; i += 2)\n {\n params.put(args[i], args[i + 1]);\n }\n }\n else\n {\n throw new IllegalArgumentException();\n }\n\n if (allParamsPresent())\n {\n try\n {\n mqQCF = new MQQueueConnectionFactory();\n mqQCF.setQueueManager((String) params.get(\"-m\"));\n mqQCF.setHostName((String) params.get(\"-h\"));\n mqQCF.setChannel((String) params.get(\"-c\"));\n mqQCF.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n try\n {\n mqQCF.setPort(Integer.parseInt((String) params.get(\"-p\")));\n }\n catch (NumberFormatException e)\n {\n mqQCF.setPort(1414);\n }\n }\n catch (JMSException e)\n {\n if (e != null)\n {\n MQTestJMS11.logger(\"getLinkedException()=\" + e.getLinkedException());\n MQTestJMS11.logger(e.getLocalizedMessage());\n e.printStackTrace();\n }\n throw new IllegalArgumentException();\n }\n catch (Exception e)\n {\n MQTestJMS11.logger(e.getLocalizedMessage());\n e.printStackTrace();\n throw new IllegalArgumentException();\n }\n }\n else\n {\n throw new IllegalArgumentException();\n }\n }\n\n /**\n * Test the connection to the queue manager.\n * @throws MQException\n */\n private void testConn()\n {\n QueueConnection conn = null;\n QueueSession session = null;\n Queue myQ = null;\n\n try\n {\n conn = mqQCF.createQueueConnection((String) params.get(\"-u\"), (String) params.get(\"-x\"));\n conn.start();\n\n session = conn.createQueueSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);\n MQTestJMS11.logger(\"successfully connected.\");\n\n myQ = session.createQueue((String) params.get(\"-q\"));\n\n MQDestination mqd = (MQDestination) myQ;\n mqd.setTargetClient(WMQConstants.WMQ_CLIENT_JMS_COMPLIANT);\n// mqd.setTargetClient(WMQConstants.WMQ_CLIENT_NONJMS_MQ);\n\n sendMsg( session, myQ);\n }\n catch (JMSException e)\n {\n if (e != null)\n {\n MQTestJMS11.logger(\"getLinkedException()=\" + e.getLinkedException());\n MQTestJMS11.logger(e.getLocalizedMessage());\n e.printStackTrace();\n }\n }\n catch (Exception e)\n {\n MQTestJMS11.logger(e.getLocalizedMessage());\n e.printStackTrace();\n }\n finally\n {\n try\n {\n if (session != null)\n session.close();\n }\n catch (Exception ex)\n {\n MQTestJMS11.logger(\"session.close() : \" + ex.getLocalizedMessage());\n }\n\n try\n {\n if (conn != null)\n conn.stop();\n }\n catch (Exception ex)\n {\n MQTestJMS11.logger(\"connection.stop() : \" + ex.getLocalizedMessage());\n }\n\n try\n {\n if (conn != null)\n conn.close();\n }\n catch (Exception ex)\n {\n MQTestJMS11.logger(\"connection.close() : \" + ex.getLocalizedMessage());\n }\n }\n }\n\n /**\n * Send a message to a queue.\n * @throws MQException\n */\n private void sendMsg(QueueSession session, Queue myQ) throws JMSException\n {\n QueueSender sender = null;\n\n try\n {\n TextMessage msg = session.createTextMessage();\n msg.setText(\"Nice simple test. Time in 'ms' is -> \" + System.currentTimeMillis());\n // msg.setJMSReplyTo(tq);\n // msg.setJMSDeliveryMode( DeliveryMode.NON_PERSISTENT);\n\n MQTestJMS11.logger(\"Sending request to \" + myQ.getQueueName());\n MQTestJMS11.logger(\"\");\n\n sender = session.createSender(myQ);\n sender.send(msg);\n }\n finally\n {\n try\n {\n if (sender != null)\n sender.close();\n }\n catch (Exception ex)\n {\n MQTestJMS11.logger(\"sender.close() : \" + ex.getLocalizedMessage());\n }\n }\n }\n\n /**\n * A simple logger method\n * @param data\n */\n public static void logger(String data)\n {\n String className = Thread.currentThread().getStackTrace()[2].getClassName();\n\n // Remove the package info.\n if ( (className != null) && (className.lastIndexOf('.') != -1) )\n className = className.substring(className.lastIndexOf('.')+1);\n\n System.out.println(LOGGER_TIMESTAMP.format(new Date())+\" \"+className+\": \"+Thread.currentThread().getStackTrace()[2].getMethodName()+\": \"+data);\n }\n\n /**\n * mainline\n * @param args\n */\n public static void main(String[] args)\n {\n MQTestJMS11 write = new MQTestJMS11();\n\n try\n {\n write.init(args);\n write.testConn();\n }\n catch (IllegalArgumentException e)\n {\n MQTestJMS11.logger(\"Usage: java MQTestJMS11 -m QueueManagerName -h host -p port -c channel -q JMS_Queue_Name -u UserID -x Password\");\n System.exit(1);\n }\n catch (Exception e)\n {\n MQTestJMS11.logger(e.getLocalizedMessage());\n System.exit(1);\n }\n\n System.exit(0);\n }\n}\n"} +{"text": "### Human: I always get an MalformedInputException, when read an Queue-Meassage with JMS.My code is:Message message = mqMessageConsumer.receiveNoWait();\nwhile (message != null) {\n if (message instanceof TextMessage) {\n String inputTmp = ((TextMessage) message).getText();\n[...]I think the Problem is the Message, it starts with Hex-Representation of the length x'02A8', and he can't convert it:.y(CipherSuiteList.java:79)\n at sun.security.ssl.SSLSocketImpl.setEnabledCipherSuites(SSLSocketImpl.java:2495)\n at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.makeSocketSecure(RemoteTCPConnection.java:2084)\n ... 47 common frames omittedI think the problem is to supply the-Dcom.ibm.mq.cfg.preferTLS=truevariable to nifi process. I tried to add it intobootstrap.confbut it didn' t help.Is there a any other way to supply-Dcom.ibm.mq.cfg.preferTLS=truevariable into ibm jms client jar? I really stuck with this problem, so any help would be very beneficial. Thank you### Assistant: The problem you are having is that IBM MQ classes for JMS (com.ibm.mq.allclient.jar) can work with both IBM Java JSSE and non-IBM (ex: Oracle) Java JSSE. Ciphersuite names are different between the two Java JSSE implementations. For the most part where Oracle follows the IETF naming standards and the prefix of the ciphersuite isTLS_, IBM replaces this withSSL_.A table documenting how the IBM MQSVRCONNchannelCIPHERSPECname maps to the IBM and Oracle Java JSSE ciphersuite name can be found in IBM's Knowledge center:IBM MQ > Developing applications > Developing JMS and Java applications > Using IBM MQ classes for JMS > Writing IBM MQ classes for JMS applications > Accessing IBM MQ features from an IBM MQ classes for JMS application > Using TLS with IBM MQ classes for JMS > TLS CipherSpecs and CipherSuites in IBM MQ classes for JMSFor example theCIPHERSPECyou providedTLS_RSA_WITH_AES_256_CBC_SHA256has this entry in the table.CipherSpec |Equivalent CipherSuite (IBM JRE) |Equivalent CipherSuite (Oracle JRE) |Protocol |FIPS 140-2 compatible |\n--------------------------------+---------------------------------+------------------------------------+---------+----------------------|\nTLS_RSA_WITH_AES_256_CBC_SHA256 |SSL_RSA_WITH_AES_256_CBC_SHA256 |TLS_RSA_WITH_AES_256_CBC_SHA256 |TLS v1.2 |yes |You are running into two issues:First, in order to tell the IBM MQ Classes for JMS that you want it to use the Oracle ciphersuite mapping you need to set the Java system propertycom.ibm.mq.cfg.useIBMCipherMappingsto the valuefalse(Note the default istrue).This can be done in your code:System.setProperty(\"com.ibm.mq.cfg.useIBMCipherMappings\", \"false\");or on the command line:-Dcom.ibm.mq.cfg.useIBMCipherMappings=falseSecond, when you use JMSAdmin to generate the binding file, it will by default will take the ciphersuite name you provide and \"convert\" it into the IBM ciphersuite name. So when you specifiedTLS_RSA_WITH_AES_256_CBC_SHA256it converted it toSSL_RSA_WITH_AES_256_CBC_SHA256in the resulting binding file.To fix this you need to edit theJMSAdminand look for a line like this:$AMQJAVA -Dcom.ibm.msg.client.commonservices.log.outputName=$MQ_JAVA_DATA_PATH/log -Dcom.ibm.msg.client.commonservices.trace.outputName=$MQ_JAVA_DATA_PATH/trace -DMQ_JAVA_INSTALL_PATH=$MQ_JAVA_INSTALL_PATH com.ibm.mq.jms.admin.JMSAdmin $*You will need to add-Dcom.ibm.mq.cfg.useIBMCipherMappings=falseto the line line like this:$AMQJAVA -Dcom.ibm.mq.cfg.useIBMCipherMappings=false -Dcom.ibm.msg.client.commonservices.log.outputName=$MQ_JAVA_DATA_PATH/log -Dcom.ibm.msg.client.commonservices.trace.outputName=$MQ_JAVA_DATA_PATH/trace -DMQ_JAVA_INSTALL_PATH=$MQ_JAVA_INSTALL_PATH com.ibm.mq.jms.admin.JMSAdmin $*Fixing the first issue will allow IBM MQ Classes for JMS to use the Oracle ciphersuite mappings.Fixing the second issue will allow the generation of a binding file that contains a proper Oracle ciphersuite name.Currently the error returned isRC=2393which meansMQRC_SSL_INITIALIZATION_ERROR, this is because IBM MQ classes for Java thinks it should use IBM ciphersuite mappings and sends theSSL_RSA_WITH_AES_256_CBC_SHA256ciphersuite name to the Oracle Java which then returns the error you are receiving,Unsupported ciphersuite SSL_RSA_WITH_AES_256_CBC_SHA256, because Oracle Java does not know of a ciphersuite by that name.Note if you were to fix only one of the two issues, then then the IBM MQ classes for JMS would returnRC=2400which meansMQRC_UNSUPPORTED_CIPHER_SUITEbefore even calling out to the Java JSSE.\n"} +{"text": "### Human: IBM internally monitor services which is offered on cloud but somehow I need to get status of middleware services such as kafka,API Connect etc. It will help me to automate things if some service stopped/not accessable.### Assistant: To monitor your provisioned instances of these services you could exercise them. For example on API Connect create an API called /health and curl the API to verify it is working. For kafka create a topic to check the health.\n"} +{"text": "### Human: Current setup is QM1 (queue manager 1) is having local definition Q1 (mq 1). On QM2, Q1 is configured as remote queue. This configuration works fine. That means any app connecting to QM2 can use name Q1 and those messages gets forwarded to QM1 through distributed Mq setup(channels, transmit queues).I want to know if I create new Q1 as local queue on QM2 , will mqput calls forward messages to both Queues?### Assistant: You cannot issue 1 MQPUT and have the message go to more than 1 queue unless you have configured a distribution list or configured the queue to be under Pub/Sub but not all fields of the MQMD are copied.If you want to replicate messages (for a backup or SLA mechanism) including the MQMD fields then you need to look at a product likeMQ Message Replication.\n"} +{"text": "### Human: Hey guys so I've been trying to get my docker-compose.yml file to just cat the contents of a local file before it boots up the IBM-MQ server but I can't seem to get the MQ server to work correctly. I have a simple helloworld.txt in the files folder that just consists of HELLO WORLD in it that I'm trying to cat.version: '3'\n\nmq:\n image: ibmcom/mq:latest\n ports:\n - \"1414:1414\"\n environment:\n - LICENSE=accept\n - MQ_QMGR_NAME=MQA01\n volumes:\n - ./files:/var/mqm\n stdin_open: true\n tty: true\n restart: always\n command: >\n sh -c \"cat helloworld.txt\"But running docker-compose up gives the below error -mq_1 | 2019-09-11T18:15:24.360Z CPU architecture: amd64\nmq_1 | 2019-09-11T18:15:24.360Z Linux kernel version: 4.15.0-20-generic\nmq_1 | 2019-09-11T18:15:24.360Z Container runtime: docker\nmq_1 | 2019-09-11T18:15:24.361Z Base image: Red Hat Enterprise Linux Server 7.6 (Maipo)\nmq_1 | 2019-09-11T18:15:24.365Z Running as user ID 888 () with primary group 888, and supplementary groups 0\nmq_1 | 2019-09-11T18:15:24.365Z Capabilities (bounding set): chown,dac_override,fowner,fsetid,kill,setgid,setuid,setpcap,net_bind_service,net_raw,sys_chroot,mknod,audit_write,setfcap\nmq_1 | 2019-09-11T18:15:24.366Z seccomp enforcing mode: filtering\nmq_1 | 2019-09-11T18:15:24.366Z Process security attributes: docker-default (enforce)\nmq_1 | 2019-09-11T18:15:24.366Z Detected 'ext4' volume mounted to /mnt/mqm/data\nmq_1 | 2019-09-11T18:15:24.467Z Set password for \"admin\" user\nmq_1 | 2019-09-11T18:15:24.579Z Using queue manager name: MQA01\nmq_1 | 2019-09-11T18:15:24.580Z Error: Unable to change ownership of /mnt/mqm/data\nmq_1 | 2019-09-11T18:15:24.580Z chown /mnt/mqm/data: operation not permittedEDIT - I changed volumes tovolumes:\n - ./files/helloworld.txt:/usr/local/tomcat/webapps/helloworld.txtBut now it just seems like the manager runs indefinitely and the shell command cat helloworld.txt is never run.### Assistant: Error: Unable to change ownership of /mnt/mqm/dataRunning with the default configuration and a volumeThe above example will not persist any configuration data or messages\n across container runs. In order to do this, you need to use a volume.\n For example, you can create a volume with the following command:docker volume create qm1dataYou can then run a queue manager using this volume as follows:docker run \\\n --env LICENSE=accept \\\n --env MQ_QMGR_NAME=QM1 \\\n --publish 1414:1414 \\\n --publish 9443:9443 \\\n --detach \\\n --volume qm1data:/mnt/mqm \\\n ibmcom/mqor afterdocker volume create qm1datavolume once created thenimage: ibmcom/mq:latest\n ports:\n - \"1414:1414\"\n environment:\n - LICENSE=accept\n - MQ_QMGR_NAME=MQA01\n volumes:\n - qm1data:/var/mqm\n stdin_open: true\n tty: true\n restart: alwaysThe Docker image always uses /mnt/mqm for MQ data, which is correctly linked for you under /var/mqm at runtime.This is to handle problems with file permissions on some platforms.running-with-the-default-configuration-and-a-volume\n"} +{"text": "### Human: I'm trying to connect over TLS to IBM MQ with JMS. I'm setting TLS_RSA_WITH_AES_256_CBC_SHA256 as SSL cipher spec on the channel in the IBM MQ console.On the connection factory I do this:cf.setSSLCipherSuite(\"TLS_RSA_WITH_AES_256_CBC_SHA256\")And I get:Caused by: com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2400' ('MQRC_UNSUPPORTED_CIPHER_SUITE')`I've walked through the steps here:https://developer.ibm.com/answers/questions/472052/how-do-i-configure-ssl-tls-between-java-client-and/I'm unsure if this error means the handshake is failing (due to cert/keystore misconfiguration) or something else.### Assistant: I think you might need to useSSL_RSA_WITH_AES_256_CBC_SHA256 instead of TLS_RSA_WITH_AES_256_CBC_SHA256.TheKnowledge Centerdocuments the differences between IBM and Oracle JREs.\n"} +{"text": "### Human: I've got messages from queue by using IBM MQ. I got object MQMessage and parse it. In this way, I have byte stream of message body, also I have MQMD properties. So, how can I get this properties in byte array too?//Getting MQMessage\nMQQueue queue = ...\nMQMessage msg = new MQMessage();\nqueue.get(msg, options, size);\n\n//For example this prop\nString replyQueue = msg.replyToQueueName;I need it, because in some cases some props don't read correctly with default \"UTF-8\" encoding, but it should.\nSo,MQMessage.readFully(byte[] b)only give me the message body asbyte[], I would like to get the message headers such as MQMD and RFH2.### Assistant: All of the MQMD properties can be accessed as:byte[] correlId = msg.correlationId;\nbyte[] msglId = msg.messageId;\nString format = msg.format;\nint expiry = msg.expiry;\nString replyQueue = msg.replyToQueueName;There are 2 ways to deal with a JMS (aka MQRFH2) message:Retrieve it as a message with named propertiesRetrieve it as an MQRFH2 messageTo get the JMS message as a \"message with named properties\", just add an MQGMO option of:gmo.options += CMQC.MQGMO_PROPERTIES_IN_HANDLE;Then you can retrieve any named property using a getter method. i.e. to retrieve the string property called StackOverflow, you would do:String someValue = msg.getStringProperty(\"StackOverflow\")To retrieve the JMS message as an MQRFH2, just add an MQGMO of (this is the default):gmo.options += CMQC.MQGMO_PROPERTIES_FORCE_MQRFH2;Then you need to pass the message to the MQRFH2 class and go from there:msg.seek(0);\nMQRFH2 rfh2 = new MQRFH2(msg);\nString format = rfh2.getFormat();\nString[] folderStrings = rfh2.getFolderStrings();\nfor (String folder : folderStrings)\nSystem.out.println(\"Folder: \"+folder);\n"} +{"text": "### Human: I am working with developing a platform for enabling a user for adding stubs to a repo. The stubs use IBM MQ for message queuing. I need to provide the facility to display all the queues under a given queue manager namely say \"MQSQ16X0\" so that the user gets to choose the queue.I tried following this link -Get ClusterName of MQ Queue using Javabut this wasn't of help.### Assistant: Use the Admin REST API -GET /ibmmq/rest/v1/admin/qmgr/{qmgrName}/queueRetrieves details of all queues that are defined in the named queue\n manager, optionally specifying which queue attributes are retrieved.Unfortunately you need a MQ server to access the swagger page. Its easier if you create an instance in the cloud. Then the url for the swagger page will behttps://host:port/ibm/api/explorerThere is a tutorial that guides you through using the REST API -https://developer.ibm.com/messaging/learn-mq/mq-tutorials/ibm-mq-messaging-rest-api/\n"} +{"text": "### Human: I have an environment of MQ on docker container. I have created Queue manager QM_TEST with the help of following link :https://www-01.ibm.com/support/docview.wss?uid=swg21623113I can not connect the queue manager from MQ explorer from windows. Following error of channel is coming when connecting Q manager.Could not establish a connection to the queue manager. Channel name not recognized (AMQ4871)\n Severity: 10 (Warning)\n Explanation: The attempt to connect to the queue manager failed. The queue manager did not recognize the channel name.Snap1Snap2Snap3Snap4Snap5AMQ5052I: The queue manager task 'QPUBSUB-CTRLR' has started.\n\nEXPLANATION:\nThe publish/subscribe utility task manager has started the QPUBSUB-CTRLR task.\nThis task has now started 1 times.\nACTION:\nNone.\n----- amqzmut0.c : 1629 -------------------------------------------------------\n06/14/19 05:21:34 - Process(62260.30) User(mqm) Program(amqzmuc0)\n Host(ibmmqdkrdev) Installation(Installation1)\n VRMF(9.1.1.0) QMgr(QM_TEST)\n Time(2019-06-14T05:21:34.722Z)\n ArithInsert2(1)\n CommentInsert1(TOPIC-TREE)\n\nAMQ5051I: The queue manager task 'TOPIC-TREE' has started.\n\nEXPLANATION:\nThe critical utility task manager has started the TOPIC-TREE task. This task\nhas now started 1 times.\nACTION:\nNone.\n----- amqzmut0.c : 1629 -------------------------------------------------------\n06/14/19 05:21:34 - Process(62260.34) User(mqm) Program(amqzmuc0)\n Host(ibmmqdkrdev) Installation(Installation1)\n VRMF(9.1.1.0) QMgr(QM_TEST)\n Time(2019-06-14T05:21:34.722Z)\n ArithInsert2(1)\n CommentInsert1(MULTICAST)\n\nAMQ5051I: The queue manager task 'MULTICAST' has started.\n\nEXPLANATION:\nThe critical utility task manager has started the MULTICAST task. This task has\nnow started 1 times.\nACTION:\nNone.\n----- amqzmut0.c : 1629 -------------------------------------------------------\n06/14/19 05:21:34 - Process(62260.31) User(mqm) Program(amqzmuc0)\n Host(ibmmqdkrdev) Installation(Installation1)\n VRMF(9.1.1.0) QMgr(QM_TEST)\n Time(2019-06-14T05:21:34.722Z)\n ArithInsert2(1)\n CommentInsert1(RESOURCE_MONITOR)\n\nAMQ5051I: The queue manager task 'RESOURCE_MONITOR' has started.\n\nEXPLANATION:\nThe critical utility task manager has started the RESOURCE_MONITOR task. This\ntask has now started 1 times.\nACTION:\nNone.\n----- amqzmut0.c : 1629 -------------------------------------------------------\n06/14/19 05:21:34 - Process(62260.33) User(mqm) Program(amqzmuc0)\n Host(ibmmqdkrdev) Installation(Installation1)\n VRMF(9.1.1.0) QMgr(QM_TEST)\n Time(2019-06-14T05:21:34.723Z)\n ArithInsert2(1)\n CommentInsert1(PRESERVED-Q)\n\nAMQ5051I: The queue manager task 'PRESERVED-Q' has started.\n\nEXPLANATION:\nThe critical utility task manager has started the PRESERVED-Q task. This task\nhas now started 1 times.\nACTION:\nNone.\n----- amqzmut0.c : 1629 -------------------------------------------------------\n06/14/19 05:21:34 - Process(62299.5) User(mqm) Program(amqzmuf0)\n Host(ibmmqdkrdev) Installation(Installation1)\n VRMF(9.1.1.0) QMgr(QM_TEST)\n Time(2019-06-14T05:21:34.723Z)\n ArithInsert2(1)\n CommentInsert1(QPUBSUB-QUEUE-NLCACHE)\n\nAMQ5052I: The queue manager task 'QPUBSUB-QUEUE-NLCACHE' has started.\n\nEXPLANATION:\nThe publish/subscribe utility task manager has started the\nQPUBSUB-QUEUE-NLCACHE task. This task has now started 1 times.\nACTION:\nNone.\n----- amqzmut0.c : 1629 -------------------------------------------------------\n06/14/19 05:21:34 - Process(62299.7) User(mqm) Program(amqzmuf0)\n Host(ibmmqdkrdev) Installation(Installation1)\n VRMF(9.1.1.0) QMgr(QM_TEST)\n Time(2019-06-14T05:21:34.724Z)\n ArithInsert2(1)\n CommentInsert1(PUBSUB-DAEMON)\n\nAMQ5052I: The queue manager task 'PUBSUB-DAEMON' has started.\n\nEXPLANATION:\nThe publish/subscribe utility task manager has started the PUBSUB-DAEMON task.\nThis task has now started 1 times.\nACTION:\nNone.\n----- amqzmut0.c : 1629 -------------------------------------------------------\n06/14/19 05:21:34 - Process(62299.7) User(mqm) Program(amqzmuf0)\n Host(ibmmqdkrdev) Installation(Installation1)\n VRMF(9.1.1.0) QMgr(QM_TEST)\n Time(2019-06-14T05:21:34.724Z)\n CommentInsert1(IBM MQ Distributed Pub/Sub Controller)\n\nAMQ5975I: 'IBM MQ Distributed Pub/Sub Controller' has started.\n\nEXPLANATION:\n'IBM MQ Distributed Pub/Sub Controller' has started.\nACTION:\nNone.\n----- cmqxzmup.c : 3951 -------------------------------------------------------\n06/14/19 05:21:34 - Process(62260.32) User(mqm) Program(amqzmuc0)\n Host(ibmmqdkrdev) Installation(Installation1)\n VRMF(9.1.1.0) QMgr(QM_TEST)\n Time(2019-06-14T05:21:34.726Z)\n ArithInsert2(1)\n CommentInsert1(Q-DELETION)\n\nAMQ5051I: The queue manager task 'Q-DELETION' has started.\n\nEXPLANATION:\nThe critical utility task manager has started the Q-DELETION task. This task\nhas now started 1 times.\nACTION:\nNone.\n----- amqzmut0.c : 1629 -------------------------------------------------------\n06/14/19 05:21:34 - Process(62299.8) User(mqm) Program(amqzmuf0)\n Host(ibmmqdkrdev) Installation(Installation1)\n VRMF(9.1.1.0) QMgr(QM_TEST)\n Time(2019-06-14T05:21:34.731Z)\n CommentInsert1(IBM MQ Distributed Pub/Sub Fan Out Task)\n\nAMQ5975I: 'IBM MQ Distributed Pub/Sub Fan Out Task' has started.\n\nEXPLANATION:\n'IBM MQ Distributed Pub/Sub Fan Out Task' has started.\nACTION:\nNone.\n----- cmqxzmup.c : 383 --------------------------------------------------------\n06/14/19 05:21:34 - Process(62299.9) User(mqm) Program(amqzmuf0)\n Host(ibmmqdkrdev) Installation(Installation1)\n VRMF(9.1.1.0) QMgr(QM_TEST)\n Time(2019-06-14T05:21:34.733Z)\n CommentInsert1(IBM MQ Distributed Pub/Sub Command Task)\n\nAMQ5975I: 'IBM MQ Distributed Pub/Sub Command Task' has started.\n\nEXPLANATION:\n'IBM MQ Distributed Pub/Sub Command Task' has started.\nACTION:\nNone.\n----- cmqxzmup.c : 383 --------------------------------------------------------\n06/14/19 05:21:34 - Process(62299.10) User(mqm) Program(amqzmuf0)\n Host(ibmmqdkrdev) Installation(Installation1)\n VRMF(9.1.1.0) QMgr(QM_TEST)\n Time(2019-06-14T05:21:34.735Z)\n CommentInsert1(IBM MQ Distributed Pub/Sub Publish Task)\n\nAMQ5975I: 'IBM MQ Distributed Pub/Sub Publish Task' has started.\n\nEXPLANATION:\n'IBM MQ Distributed Pub/Sub Publish Task' has started.\nACTION:\nNone.\n----- cmqxzmup.c : 383 --------------------------------------------------------\n06/14/19 05:21:34 - Process(62321.1) User(mqm) Program(amqzmgr0)\n Host(ibmmqdkrdev) Installation(Installation1)\n VRMF(9.1.1.0) QMgr(QM_TEST)\n Time(2019-06-14T05:21:34.746Z)\n ArithInsert1(62332)\n CommentInsert1(SYSTEM.CHANNEL.INITQ)\n\nAMQ5022I: The channel initiator has started. ProcessId(62332).\n\nEXPLANATION:\nThe channel initiator process has started.\nACTION:\nNone.\n----- amqzmgr0.c : 2934 -------------------------------------------------------\n06/14/19 05:21:34 - Process(62321.1) User(mqm) Program(amqzmgr0)\n Host(ibmmqdkrdev) Installation(Installation1)\n VRMF(9.1.1.0) QMgr(QM_TEST)\n Time(2019-06-14T05:21:34.749Z)\n ArithInsert1(62335)\n CommentInsert1(SYSTEM.CMDSERVER.1)\n\nAMQ5024I: The command server has started. ProcessId(62335).\n\nEXPLANATION:\nThe command server process has started.\nACTION:\nNone.\n----- amqzmgr0.c : 2943 -------------------------------------------------------\n06/14/19 05:21:34 - Process(62332.1) User(mqm) Program(runmqchi)\n Host(ibmmqdkrdev) Installation(Installation1)\n VRMF(9.1.1.0) QMgr(QM_TEST)\n Time(2019-06-14T05:21:34.798Z)\n CommentInsert1(SYSTEM.CHANNEL.INITQ)\n\nAMQ8024I: IBM MQ channel initiator started.\n\nEXPLANATION:\nThe channel initiator for queue SYSTEM.CHANNEL.INITQ has been started.\nACTION:\nNone.\n----- amqrimna.c : 866 --------------------------------------------------------\n06/14/19 05:21:34 - Process(62324.1) User(mqm) Program(amqfqpub)\n Host(ibmmqdkrdev) Installation(Installation1)\n VRMF(9.1.1.0) QMgr(QM_TEST)\n Time(2019-06-14T05:21:34.800Z)\n CommentInsert1(QM_TEST)\n\nAMQ5806I: Queued Publish/Subscribe Daemon started for queue manager QM_TEST.\n\nEXPLANATION:\nQueued Publish/Subscribe Daemon started for queue manager QM_TEST.\nACTION:\nNone.\n----- cmqxfcxc.c : 1397 -------------------------------------------------------\n06/14/19 05:22:16 - Process(62321.1) User(mqm) Program(amqzmgr0)\n Host(ibmmqdkrdev) Installation(Installation1)\n VRMF(9.1.1.0) QMgr(QM_TEST)\n Time(2019-06-14T05:22:16.457Z)\n ArithInsert1(62392)\n CommentInsert1(TCP.LISTENER)\n\nAMQ5026I: The listener 'TCP.LISTENER' has started. ProcessId(62392).\n\nEXPLANATION:\nThe listener process has started.\nACTION:\nNone.\n----- amqzmgr0.c : 2951 -------------------------------------------------------\n06/14/19 05:22:25 - Process(62392.1) User(mqm) Program(runmqlsr)\n Host(ibmmqdkrdev) Installation(Installation1)\n VRMF(9.1.1.0) QMgr(QM_TEST)\n Time(2019-06-14T05:22:25.488Z)\n ArithInsert1(1414) ArithInsert2(98)\n CommentInsert1(bind)\n CommentInsert2(TCP/IP)\n CommentInsert3(:)\n\nAMQ9218E: The TCP/IP listener program could not bind to port number 1414.\n\nEXPLANATION:\nAn attempt to bind the TCP/IP socket to the listener port was unsuccessful.\nACTION:\nThe failure could be due to another program, including other MQ listeners,\nusing the same port number. The return code from the 'bind' call for port :1414\nwas 98. Record these values and tell the systems administrator.\n----- amqclita.c : 748 --------------------------------------------------------\n06/14/19 05:22:25 - Process(62321.1) User(mqm) Program(amqzmgr0)\n Host(ibmmqdkrdev) Installation(Installation1)\n VRMF(9.1.1.0) QMgr(QM_TEST)\n Time(2019-06-14T05:22:25.493Z)\n ArithInsert1(62392)\n CommentInsert1(TCP.LISTENER)\n\nAMQ5027I: The listener 'TCP.LISTENER' has ended. ProcessId(62392).\n\nEXPLANATION:\nThe listener process has ended.\nACTION:\nNone.Could not establish a connection to the queue manager. Channel name not recognized (AMQ4871)\n Severity: 10 (Warning)\n Explanation: The attempt to connect to the queue manager failed. The queue manager did not recognize the channel name.### Assistant: The error message is telling you that the channel has not been defined on the queue manager. If you believe that the channel is already defined on the queue manager, another reason could be that your client (MQ Explorer in this case) is not actually connecting to the queue manager you think it is connecting to. In which case, the channel is not defined because it is the wrong queue manager.The default channel that MQ Explorer uses is not defined by default on a queue manager in order to ensure that it is not open to abuse by an unauthorized user.If you look in the queue managerAMQERR01.LOGyou will see a similar error message which also lists the channel name that does not exist.To define the channel, use therunmqsctool on the queue manager machine, and type in the following MQSC command.DEFINE CHANNEL(SYSTEM.ADMIN.SVRCONN) CHLTYPE(SVRCONN) DESCR('Channel for MQ Explorer connectivity')\n"} +{"text": "### Human: I was able to browse through usingJmsPutGetwith below browse selector for my IBM mq messages.context.createBrowser(context.createQueue(\"queue:///\" + QUEUE_NAME), \"JMSCorrelationID='ID:c9d5e2d7c5c3e3c9d6d54040404040404040404040404040'\")I am trying to do the same using spring jms using JmsListener annotationUpdate :changing selector to JMSCorrelationID='ID:c9d5e2d7c5c3e3c9d6d54040404040404040404040404040'\" made it work. I tried that a day before, thought didn't work.@JmsListener(\n destination = \"DevQueue01\",\n containerFactory = \"myContainerFactory\",\n selector = \"JMSCorrelationID='c9d5e2d7c5c3e3c9d6d54040404040404040404040404040'\"\n )\n public void processInspection(@Valid Inspection bean) {\n System.out.println(\"In process inspections : \\n\\n\" + bean);\n}### Assistant: After changing selector to below made it work. I tried that a day before, thought didn't work.JMSCorrelationID='ID:c9d5e2d7c5c3e3c9d6d54040404040404040404040404040'\"\n"} +{"text": "### Human: I am working on consumer for IBM MQ messages, I want to make each message processing transactional after reading with acknowledgement.Once I read each message from IBM MQ - i need to invoke about 4 to 5 different rest services. There will be approximately 1500 - 2000 inserts in different tables through services.If any of the service fails for any reason, I want to roll back previous inserts happened in processing that particular message and leave message in Queue.How can I achieve the same? I am quite new to IBM MQs/JmsI am planning to do it by browsing through messages usingQueueBrowser queueBrowser = context.createBrowser(queue, \"JMSCorrelationID='ID:c9d5e2d7c5c3e3c9d6d54040404040404040404040404040c9d5e2d7c5c3e3c9d6d54040404040404040404040404040'\");### Assistant: If all these queues are on the same MQ Queue Manager, you should use 'local JMS transactions' for this. So create your IBM MQ JMS connection and make your session transacted (first argument is set totrue):session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE);Note: The second argument is ignored in case the first argument is true.Create your JMS queues and the receiver and then read your first message, for example:Message msg = msgConsumer.receive(100);This implicitly starts an MQ transaction on the first message received if there is no current transaction.Next do your processing and if all goes well, call commit.If not, rollback the transaction and you will see all rolled back messages again. So it could work something like this:Session session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE);\nMessageConsumer msgConsumer = session.createConsumer(destination, null);\nwhile( !isStopped() ) {\n\n try {\n\n Message msg = msgConsumer.receive(100);\n if( msg!=null ) { \n ... call your REST services ...\n session.commit();\n }\n ... test for end condition ...\n }\n catch (Exception e) {\n ... error handling ...\n session.rollback();\n }\n}\n"} +{"text": "### Human: I have a requirement where I need to consume Kafka Topic and write it into MQ Topic. Can someone advise me the best way to do it, I am new to Kafka.I have read about theIBM MQ Connectorin confluent but could not get the idea how to implement it.### Assistant: The best way to move data from Kafka to MQ is to use the IBM MQ sink connector:https://github.com/ibm-messaging/kafka-connect-mq-sinkThis is a Kafka Connect connector. The README contains details forbuildingandrunningit.\n"} +{"text": "### Human: I'm connecting to a remote mq queue using pymqi. I'm using put method as normal but I would like to know if there are some way to set something symilar as JMSReplyTo on JMS system to get a synchronous response of my message.The request queue and the response are created in the remote mq where I'm connecting.### Assistant: Yes you can set ReplyToQ (JMSReplyTo) and No, there is no one-call function for getting synchronous response.Look examplepageor example insourceIs short:# Prepare a Message Descriptor for the request message.\nmd = pymqi.MD()\nmd.ReplyToQ = dyn_queue_name\n\n# Send the message.\nqueue = pymqi.Queue(qmgr, request_queue)\nqueue.put(message, md)\n"} +{"text": "### Human: This question already has an answer here:WebsphereMQ with .Net Core 2.2(1 answer)Closed4 years ago.I am writing a .NET Core (2.1) Windows Service which will be listening for messages from IBM MQ.Could anyone point me to a link to a repository with an example, article or at least decent documentation?### Assistant: Please checkthisother SO post explaining how to obtain the IBM MQ .NET client libraries.That being said, IBM has a nice page onGetting started with IBM MQ classes for .NETandIBM MQ samples.\n"} +{"text": "### Human: Can anyone please help me in retrieving message headers from the message coming from Websphere IBM MQ ?We are using JMS OnMessage method to browse the MQ and the type of message received from MQ is \"BytesMessage\". We want to iterate through the RFH message headers and collect them.We have tried using MQHeaders to iterate over the MQMessage but could not as it was throwing an exception.Please advice me.### Assistant: a good place to start reading ishttps://www.ibm.com/support/knowledgecenter/en/SSFKSJ_8.0.0/com.ibm.mq.dev.doc/q031990_.htmwhich explains how IBM MQ implements JMS.Next you should print out your received JMS Message with toString() or iterate through your properties and check the properties you receive. Depending on RFH or RFH2 you will see different fields.You can find explanations for these fields inhttps://www.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.dev.doc/q032000_.htmandhttps://www.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.dev.doc/q032060_.htm\n"} +{"text": "### Human: I'm in the process of migrating a MQ V7.5.0.3 to MQ V9.1.0.2. According to literature, there is no direct path for this migration. I would need to migrate from V7.5 to V9.0 and then finally to V9.1I would like to fast path this and go directly to V9.1 by:dmpmqcfg V7.5 objectsdelete qmgr the dmpmqcfg was issued\n againstuninstall V7.5Install V9.1 and fixpacscreate new\n qmgr(same name as V7.5 instance) using the V7.5 dmpmqcfg outputSince this is a transitory migration to the latest level, it would seem that going through brief multiple Version installs just to do a MQ migration, is a lot more work than necessary.My question is: If I bypass the multiple version migration process and perform the fastpath steps I mentioned above, will the end result be the same as if I did the multiple migrations?Currently I have V7.5 and V9.1 installed side by side. Then I realized I would need to first go to V9.0, which I would like to avoid if possible. I could try the dmpmqcfg and create a new QMGR with it on V9.1, but I'm not sure that answers my question.### Assistant: If you choose to create brand new queue managers instead of migrating your existing queue managers, you may find that you end up with slightly different attributes at the end of the day.There are a number of cases where IBM MQ has a different default for a new attribute's default value depending one whether you have created a brand new queue manager or whether you have migrated it up to the new level.I can think of one in IBM MQ V8, the CONNAUTH attribute. I believe it is left blank if you migrate up (thus turning off user ID and password checking) and is set to point to the 'SYSTEM.DEFAULT.AUTHINFO.IDPWOS' object if you create a brand new queue manager (turning on user ID and password checking and mandating a password must be supplied by any remote connections).Such things would not be caught bydmpmqcfgbecause it's a new attribute over and above what the V7.5 objects you dumped out would have.\n"} +{"text": "### Human: Using apache camel I am sending mesasge to IBM QueueQ001IN, but at the other end the application is validating for the destination and they are expecting destination asQ001INhowever they are receiving as queue:///Q001IN instead of Q001IN....\n.to(\"jms:Q001IN\")\n.end()Is there anyway I can override this to remove queue:/// ?I tried below but it does not work..setHeader(\"destination\", simple(\"QUEUE_NAME\"))\n.setHeader(\"destinationName\", simple(\"QUEUE_NAME\"))\n.to(\"jms:Q001IN\")### Assistant: Your receiver application receives aJMS Destinationobject, aJMS Queue, to be exact. What you see as \"queue:///\" is the toString() of that object. If you want to get to the queue name, you must (unfortunately), cast the destination object tojavax.jms.Queueand then use methodQueue.getQueueName(). I'm not sure about your receiving application, but let's saydestcontains the JMSDestination of your received Message:import javax.jms.Queue\nQueue q = (Queue)dest;\nString qName = q.getQueueName();\n"} +{"text": "### Human: Will message selectors work with receiveNowait() method too for synchronous process. it works with receive() method but wanted to know for receiveNoWait for IBM mq.\nMessage selector is added while creating consumer.EDIT 1:\nI have tested with receiveNowait() method, and the selector is not working. I don't know the problem is with my selector or the receivenowait method. following is the selector I have used:String messageSelector = \"JMSTimestamp <= \" + System.currentTimeMillis() - 180000;\n receiver = (MessageConsumer) session.createConsumer(replyQueue, messageSelector);that means, receiver has to receive the messages only which are 3 minutes older than current time.\nCan anyone figure out what is the issue.EDIT 2:\nafter complete testing , i have found that problem is with selector, what can be the correct usage of JMSTimeStamp in selector expression?### Assistant: pepared The system.currnetTimeMillis() value is not updated when the selector is run.Here you are fixing the \"current\" timestamp when you initialize the selector.\nYou should do a query like \"endValidityDate <= (JMSTimestamp-24601000)\" for your query (same problem than any SQL query with fixed values instead of dynamic ones).\n"} +{"text": "### Human: I am looking for detailed description on how IBM MQ Client or listener get the messages from MQ Server when new messages are placed on MQ Queue or Topic.How the connection between MQ Client and MQ Server are created?Does MQ Client initiates the connection with Server or does server initiates the connection to its consumer?In case we have connection pool defined on MQ Client, how client knows that it has to create more connections with Server as the messages are increasing on Server? How Client know about the messages on Server?Is there a communication from Server to Client which tells client that new messages have arrived?I am looking for these details not the details on how this is setup or how to setup MQ Channels or Listeners. I am looking for how it works behind the scene.If someone can point me to the right direction or documentation, it would be great.### Assistant: It's hard to speak definitively about how the IBM WebSphereMQ client & server work since they're closed source, but based on my experience with other messaging implementations I can provide a general explanation.A JMS connection is initiated by a client to a server. A JMS client uses ajavax.jms.ConnectionFactoryto create ajavax.jms.Connectionwhich is the connection between the client and server.Typically when a client uses a pool the pool is either filled \"eagerly\" (which means a certain number of connections are created when the pool is initialized to fill it to a certain level) or \"lazily\" (which means the pool is filled with connections one-by-one as clients request them from the pool). If a client requests a connection from the pool and if all the connections in the pool are being used and the maximum size of connections allowed by the pool hasn't been reached then another connection will be created. If the pool has reached its maximum allowed size (i.e no more connections can be created) then the client requesting a connection will have to wait for another client to return their connection to the pool at which point the pool will then give it to the waiting client.A JMS client can find out about messages on the server in a few different ways.If the JMS client wants to ask the server occasionally about the messages it has on a particular queue it can create ajavax.jms.Consumerand use thereceive()method. This method can wait forever for a message to arrive on the queue or it can take a timeout parameter so that if a message doesn't arrive in the specified timeout the call toreceive()will return.If the JMS client wants to receive a message from a particular queue as soon as the message arrives on the queue then it can create ajavax.jms.MessageListenerimplementation and register it on the queue. When such a listener is registered on a queue then when a message arrives on the queue the server will send the message to the listener. This is sometimes referred to as a \"callback\" since the server is \"calling back\" to the client.\n"} +{"text": "### Human: I just want to double-check what the exact steps are for updating the MQ Resource Adapter in JBoss.I can find a lot of guides on how to deploy it and configure it, but none on updating it.I have got JBoss 6.3 and MQ RA 7.5.0.5 (need to update to RA 7.5.0.9). Is it just a matter of stopping the application server, removing wmq.jmsra.rar from the deployment directory, copying the new wmq.jmsra.rar version in there and starting up JBoss?### Assistant: Moving from 7.5.0.5 to 7.5.0.9 is a very small update so I wouldn't expect there would be any configuration updates required. The process you outlined (i.e. stop JBoss, update rar, start JBoss) should be perfectly fine.\n"} +{"text": "### Human: I have a camel route which retrieves messages ( in xml format) from an IBM MQ and writes its equivalent entity object into database. Now, i have a requirement to check if my camel route is up and running to retrieve messages from the IBM MQ at any point of time.I have an UI app which needs to know at regular interval( lets say every 60 seconds) if camel route is able retrieve messages from Queue fine or not. My UI app should get a success REST response if my route is up and running to retrieve messages fine at that point of time. My UI app can trigger a dummy payload to IBM MQ. That is possible. Is there any way to acheive this requirement?### Assistant: You can use for example theInquire Channel StatusorInquire Queue StatusProgrammable Command Format (PCF) messages. There are a lot of otherPCFmessages available to programmatically monitor IBM MQ. Have a look at thePCFMessageAgentclass to get an idea of how to use PCF messages in Java.\n"} +{"text": "### Human: I am using IBM MQMFT hosted on-premise and I have a request to transfer a new file from one server to the other.\nBoth servers already have MQ agents and are already sending some files across.\nI would like to be able to add this new file configuration so that the file can also be picked up.Please advise the steps required to achieve this. Do I just edit the agent's XML?### Assistant: If you simply wish to send a file from one agent to another, and those agents are already configured...Use the fteCreateTransfer command for a 'one off':https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_8.0.0/com.ibm.wmqfte.doc/start_new_transfer_cmd.htmConsider a resource monitor (via fteCreateMonitor) or scheduled transfer (via fteCreateTransfer) if you're doing it on a regular basis:https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_8.0.0/com.ibm.wmqfte.doc/create_monitor_cmd.htm\n"} +{"text": "### Human: i would like to connect to mqseries server having this infothe queue 's name :\"myqueue\"connection name:\"myconnectionName\"client channel :\"mychannel\"server name:\"myServerName\"do i also need to know the queuemanager? or can i use \"default\" and i am also getting this error messageUnable to load DLL 'mqic32.dll' or one of its dependencies:\n The specified module could not be found. (Exception from HRESULT:\n 0x8007007E)'static MQQueueManager queueManager;\n static MQQueueManager qManager;\n static MQQueue queue;\n MQMessage queueMessage;\n MQGetMessageOptions queueGetMessageOptions;\n MQPutMessageOptions queuePutMessageOptions;\n static string QueueName;\n static void Main(string[] args)\n {\n Connect();\n }\n static void Connect()\n {\n var builder = new ConfigurationBuilder()\n .SetBasePath(Directory.GetCurrentDirectory())\n .AddJsonFile(\"AppSettings.json\", true, true).Build();\n\n // Read the Mqseries \"connection string\" from App.config file.\n var queueManagerName = builder[\"queueManagerName\"];\n var MQChannel = builder[\"MQChannel\"];\n var queueName = builder[\"QueueName\"];\n string connectionName = builder[\"ConnectionName\"];\n MQAccess(queueName, \"Default\", connectionName, MQChannel);\n Console.WriteLine(\"Connected to MQ Queue Manager\");\n }\n public static void MQAccess(string queueName, string queueManager, string connection, string channel)\n {\n QueueName = queueName;\n\n qManager = new MQQueueManager(queueManager, channel, connection);\n\n queue = qManager.AccessQueue(QueueName, MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING);\n }### Assistant: .NET core support was added in MQ v9.1.1. Again as @JasonE said, you need to use MQ .NET Managed mode only.Sample code:Hashtable properties;\nMQQueueManager queueManager = null;\ntry {\n properties = new Hashtable();\n properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\n properties.Add(MQC.HOST_NAME_PROPERTY, hostName);\n properties.Add(MQC.PORT_PROPERTY, port);\n properties.Add(MQC.CHANNEL_PROPERTY, channelName);\n properties.Add(MQC.USER_ID_PROPERTY, userName);\n properties.Add(MQC.PASSWORD_PROPERTY, pwd);\n\n MQQueueManager queueManager = new MQQueueManager(queueManagerName, properties);\n\n}catch(MQException mqex) {\n // Console out exception\n}\n"} +{"text": "### Human: I'm using @EnableJms and @JmsListener annotation to register a queue listener in my application, basing onthistutorial. I'm connecting to IBM MQ, getting connection factory using jndi. I have read about acknowledge modes etc. but still it's a new thing to me. And my problem is that the message is not being returned to a queue (the listener is never called again).@Bean\npublic DefaultJmsListenerContainerFactory jmsListenerContainerFactory() {\n DefaultJmsListenerContainerFactory factory \n = new DefaultJmsListenerContainerFactory();\n factory.setConnectionFactory(connectionFactory());\n factory.setSessionTransacted(true);\n factory.setSessionAcknowledgeMode(Session.AUTO_ACKNOWLEDGE); //I have tried also CLIENT_ACKNOWLEDGE\n return factory;\n}\n\n\n@JmsListener(containerFactory = \"jmsListenerContainerFactory\", destination = \"myQueue\")\n@SendTo(\"secondQueue\")\npublic String testListener(String message){\n if(true) throw new NullPointerException();\n else return message;\n}Any help would be much appreciated. \nI would have also a second question. From what I understand if I would like to implement any operation on a database, only way to rollback a commit (if something went wrong after this) would be to create a transaction manager? If not, I would need to detect a duplicated message.### Assistant: First set the acknowledgement mode toSession.CLIENT_ACKNOWLEDGEand when receiving the messages, if it's processed correctly then just callmessage.acknowledge()method or else don't call.It will automatically stay in the queue and you don't need to resend it.You need to useimport javax.jms.Message\n"} +{"text": "### Human: i have issues connecting my spring boot app to mq on icp so how can i define theibm.mq.connName=mymq-ibm-mq(30803)because i always get this execption :Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2538;AMQ9204: Connection to host \u201810.0.0.1(1414)\u2019 rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2538;AMQ9213: A communications error for \u2018TCP\u2019 occurred. [1=java.net.ConnectException[Connection refused (Connection refused)],3=connnectUsingLocalAddress,4=TCP,5=Socket.connect]],3=10.0.0.1(1414),5=RemoteTCPConnection.connnectUsingLocalAddress]how can i get the correct host and the port ?this is my application.properties :ibm.mq.queueManager=QM1\nibm.mq.channel=DEV.ADMIN.SVRCONN\nibm.mq.connName=mymq-ibm-mq(30803)\nibm.mq.user=admin\nibm.mq.password=passw0rdthis is the output of kubectl describe serviceName: mymq-ibm-mq\nNamespace: lab\nLabels: app=ibm-mq\nchart=ibm-mqadvanced-server-dev\nheritage=Tiller\nrelease=mymq\nAnnotations:\nSelector: app=ibm-mq,release=mymq\nType: NodePort\nIP: 10.1.0.24\nPort: console-https 9443/TCP\nTargetPort: 9443/TCP\nNodePort: console-https 32575/TCP\nEndpoints: 10.2.9.53:9443\nPort: qmgr 1414/TCP\nTargetPort: 1414/TCP\nNodePort: qmgr 30803/TCP\nEndpoints: 10.2.9.53:1414\nSession Affinity: None\nExternal Traffic Policy: Cluster### Assistant: I'm pretty sure the MQ Connection port should be 1414 and not 30803. Try this:ibm.mq.connName=mymq-ibm-mq(1414)\n"} +{"text": "### Human: Fromthisstackoverflow question i understand abatchis sent out one at a time (without bother pipeline in this discussion), meaning, a secondbatchwon't be sent until the first one is delivered.My follow up question is, what condition starts abatch creation process. If i understand correctly (i could obviously be wrong....), abatchis created/cut, or let's call it abatch creation processiscompleted, ifBATCHSZ reached, orBATCHLIM reached, orBATCHINT (=/=0) reached, orXMIT-Q is empty, but what starts abatch creation process. Is thebatch creation processsynchronous or asynchronous to batch transfer? Doesbatch creation processstart only after the previous batch is delivered (synchronous), or it's totally decoupled from the previous batch (eg. while the previous batch is still in transfer)?This is a sibling/follow up question to1. The intention is to estimate our QRepl-MQ-transfer upper limit. As documented in entry \"[added on Dec.20]\" in the first (self-)answer in1, our observation seems support thebatch creation processstarts synchronously AFTER the previous batch transfer is complete, but i couldn't find ibm references documenting the details......Thanks for your help.### Assistant: our observation seems support the batch creation process starts\n synchronously AFTER the previous batch transfer is complete, but i\n couldn't find ibm references documenting the details.Yes that is how it works. If a 2nd batch started before the 1st batch finished then you would have newer messages jumping in front of older messages, which could cause all kinds of issues.Yes, I know, applications are not suppose to rely on messages coming in a logical order (i.e. 1,2,3,etc.) but they do.Think of MCA (Message Channel Agent) which is the process getting messages from the XMIT the same as a security guard at a store on Black Friday. He lets in 50 people form the line (batch). After many people leave the store, he lets in another 50 people into the store. Would you want ASYNC batching of the line at the store - absolutely not. The security guard wants order not chaos.The same is true for MQ's MCA. It creates a batch of \"n\" messages, sends them, acknowledges them, then goes onto the next batch.\n"} +{"text": "### Human: We are using Spring-Boot and Apache camel to connect to IBM MQ. We need to set expiry in MQMessages so that if we do not get any response , the message should expire in 60 sec. We have added header like below :setHeader(WMQConstants.WMQ_EXPIRY, constant(600));But the header is being added like :\nID-ff9c1ce374f9-1544430870241-0-2\n60000it is not adding to MQMD header and while browsing the message it is showing the expiry value as \"-1\" i.e the message will never expire.Could you please tell me how to set MQMD header in Apache Camel?### Assistant: Looking at theCamel JMS manualand having successfully used IBM MQ message expiry via Spring JMS template, you probably have to set the Camel optionsexplicitQosEnabled=trueandtimeToLive=60000for a 60 seconds time-to-live.\n"} +{"text": "### Human: I am new to the messaging queue implementation.I have implemented IBM messaging queue(MQ) in my application.Problem statement:When this MQ is not able to handle certain number of messages MQ throws timeout exception.Due to a technical limitation of my system I am unable to catch the exact exception class.Means that I simply declare catch(Exception e) ..but I would like to know exactly which exception class should be use to handle timeout error.### Assistant: I think you need some MQ training or you need to do a lot of reading on MQ.There is no such thing as a timeout on an MQPUT. I would say you have some poorly written code and you are confusing MQ with your poorly written code. Are you logging ALL interactions?If your code is Java/JMS then you should have the following exception:catch (JMSException e)\n{\n System.err.println(e.getLocalizedMessage());\n if (e != null)\n System.err.println(\"getLinkedException()=\" + e.getLinkedException());\n}If your code is plain Java then you should have the following exception:catch (MQException e)\n{\n System.err.println(e.getLocalizedMessage());\n System.err.println(\"CC = \" + e.completionCode + \" : RC = \" + e.reasonCode + \" [\" + MQConstants.lookup(e.reasonCode, \"MQRC_.*\") +\"]\");\n}\n"} +{"text": "### Human: We are using Bitronix XA as the jta transaction manager in our spring boot app. Problem is that it is making multiple connections that eats up resources on the MQ server. We are using IBM websphere as MQ server. For some reason Bitronix is not honouring the poolsize that we have given. Another observation is that connection leaks happen when we receive or send a burst of messages concurrently. Below are the configurations in code. Please advise how to solve the connection leak problem.PoolingConnectionFactory:PoolingConnectionFactory connectionFactory = new PoolingConnectionFactory();\n connectionFactory.setClassName(\"com.ibm.mq.jms.MQXAQueueConnectionFactory\");\n connectionFactory.setUniqueName(XA_FACTORY_NAME);\n connectionFactory.setAllowLocalTransactions(false);\n connectionFactory.setTestConnections(true);\n connectionFactory.setUser(user);\n connectionFactory.setPassword(password);\n connectionFactory.setMaxPoolSize(20);\n Properties driverProperties = connectionFactory.getDriverProperties();\n driverProperties.setProperty(\"port\", ...);\n driverProperties.setProperty(\"transportType\", ...);\n driverProperties.setProperty(\"channel\", ...);\n driverProperties.setProperty(\"hostName\", ...);\n driverProperties.setProperty(\"queueManager\", ...);Btm configs:@Bean\n @Profile({\"cloud\", \"local\"})\n @DependsOn(\"instanceInfo\")\n public bitronix.tm.Configuration btmConfig() {\n bitronix.tm.Configuration btmConfig = TransactionManagerServices.getConfiguration();\n btmConfig.setDisableJmx(true);\n btmConfig.setServerId(instanceInfo);\n return btmConfig;\n }\n\n @Bean\n @DependsOn(\"btmConfig\")\n public BitronixTransactionManager bitronixTransactionManager() {\n BitronixTransactionManager transactionManager = TransactionManagerServices.getTransactionManager();\n return transactionManager;\n }Messagecontainerused in SpringIntegrationFlows:private DefaultMessageListenerContainer createMessageContainer(MessageListenerAdapter messageListenerAdapter,\n ConnectionFactory connectionFactory, String queue, JtaTransactionManager jtaTransactionManager) {\n DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();\n container.setMessageListener(messageListenerAdapter);\n container.setConnectionFactory(connectionFactory);\n container.setDestinationName(queue);\n container.setSessionTransacted(true);\n container.setTransactionManager(jtaTransactionManager);\n container.setErrorHandler(containerErrorHandler);\n return container;\n }PoolingDataSourcefor DB connection:public PoolingDataSource createPooledDataSource(String driverClassName, String userName, String password, String jdbcURL, String validationQuery) { \n PoolingDataSource dataSource = new PoolingDataSource();\n dataSource.setUniqueName(\"dataSource\");\n dataSource.setMaxIdleTime(8);\n dataSource.setMinPoolSize(1);\n dataSource.setMaxPoolSize(20);\n dataSource.setTestQuery(validationQuery);\n dataSource.getDriverProperties().setProperty(\"user\", userName);\n dataSource.getDriverProperties().setProperty(\"password\", password);\n dataSource.getDriverProperties().setProperty(\"URL\", jdbcURL);\n dataSource.setClassName(driverClassName);\n dataSource.setTestQuery(validationQuery);\n dataSource.setAllowLocalTransactions(true);\n dataSource.init();\n return dataSource;\n}### Assistant: Sounds like IBMMQ pulled connection and session pooling out of their client jar, as described inthistechnote. This could explain higher thanmaxPoolSizeconnection counts, especially if you don't poolxaSessions explicitly. BTMmaxPoolSizeapplies toJmsPooledConnection, but those addtional connections could come fromxaSessions and not controlled bymaxPoolSize.I'm not familiar Spring or you setup, but read recommendations of usingCachingConnectionFactory(eg.ref-1,ref-2), and seems like IBMMQ added certain support for this (githublink, especiallyhowsection. I don't have any experience using them though....).Btw, ShareConversation can be used to control number of connections as well, which defaults to 10 on server side. IBM doc (link) mentions a potential 15% perf penalty using it.\n"} +{"text": "### Human: We have a standalone java application using third-party tool to manage connection pooling, which worked for us in v6_client + v6_server setup for a long time.Now we are trying to migrate from v6 to v9 (yes, we are pretty late to the party.....), and found v9_client connection to v6_server connection is constantly interrupted, meaning:Socket created by XAQueueConnectionFactory#createXAConnection() is always closed immediately, and the created XAConnection seems to be unaware of it.Due to socket close mentioned above, XASession created from the XAConnection.createXASession() always creates a new socket and close the socket after XASession.close().We went throught the complete list of tunables for v9_client (XAQCF \n column inhttps://www.ibm.com/support/knowledgecenter/SSFKSJ_9.0.0/com.ibm.mq.ref.dev.doc/q111800_.html) and only spot two potential new configs we haven't used in v6_client,SHARECONVALLOWEDandPROVIDERVERSION. Unfortunately neither helps us out..... Specifically:We tried setShareConvAllowed(WMQConstants.WMQ_SHARE_CONV_ALLOWED_[YES/NO]) Considering there's no SHARECNV property in v6_server side, not a surprise.We tried \"Migration/Restricted/Normal Mode\" by setProviderVersion(\"[6/7/8\") ([7/8] throws exceptions, as expected....).Just wondering if anybody else had similar experience and could share some insights. We tried v9_server+v9_client and haven't seen any similar problem, so that could also be our eventual solution.....Btw, the WMQ is hosted on linux (RedHat), and we only use products of MQXAQueueConnectionFactory on client side (ibm mq class for jms).Thanks.Additional details/updates.[update-1]--[playgrond setup]v9_client jars:javax.jms-api-2.0.jar\ncom.ibm.mq.allclient(-9.0.0.[1/5]).jarv6_client jars:in additionto v9_client jars, introduced the following jars in eclipse classpathcom.ibm.dhbcore-1.0.jar \ncom.ibm.mq.pcf-6.0.3.jar\ncom.ibm.mqjms-6.0.2.2.jar\ncom.ibm.mq-6.0.2.2.jar\ncom.ibm.mqetclient-6.0.2.2.jar\nconnector.jar\njta-1.1.jarTesting code - single thread:import javax.jms.*;\nimport com.ibm.mq.jms.*;\nimport com.ibm.msg.client.wmq.WMQConstants;\n\npublic class MQSeries_simpleAuditQ {\n\n private static String queueManager = \"QM.RCTQ.ALL.01\";\n private static String host = \"localhost\";\n private static int port = 26005; \n\n public static void main(String[] args) throws JMSException {\n MQXAQueueConnectionFactory queueFactory= new MQXAQueueConnectionFactory();\n\n System.out.println(\"\\n\\n\\n*******************\\nqueueFactory implementation version: \" + \n queueFactory.getClass().getPackage().getImplementationVersion() + \"*****************\\n\\n\\n\");\n\n queueFactory.setHostName(host);\n queueFactory.setPort(port);\n queueFactory.setQueueManager(queueManager);\n queueFactory.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n if (queueFactory.getClass().getPackage().getImplementationVersion().split(\"\\\\.\")[0].equals(\"9\")) {\n queueFactory.setProviderVersion(\"6\");\n //queueFactory.setShareConvAllowed(WMQConstants.WMQ_SHARE_CONV_ALLOWED_YES);\n } \n XASession xaSession;\n javax.jms.QueueConnection xaQueueConnection;\n try {\n // Obtain a QueueConnection\n System.out.println(\"Creating Connection...\");\n xaQueueConnection = (QueueConnection)queueFactory.createXAConnection(\" \", \"\");\n xaQueueConnection.start();\n\n for (int counter=0; counter<2; counter++) {\n try {\n xaSession = ((XAConnection)xaQueueConnection).createXASession();\n xaSession.close();\n } catch (Exception ex) {\n System.out.println(ex);\n }\n } \n System.out.println(\"Closing connection.... \");\n xaQueueConnection.close();\n } catch (Exception e) {\n System.out.println(\"Error processing \" + e.getMessage());\n } \n\n }\n}--[observations]\nv6_client only created and close a single socket, while v9_client (both 9.0.0.[1/5]):socket created and closed right afterxaQueueConnection = (QueueConnection)queueFactory.createXAConnection(\" \", \"\");in the inner for loop, socket created right afterxaSession = ((XAConnection)xaQueueConnection).createXASession();, and closed afterxaSession.close();Naively i was expecting socket remains open untilxaQueueConnection.close().[update-2]\nUsingqueueFactory.setProviderVersion(\"9\");andqueueFactory.setShareConvAllowed(WMQConstants.WMQ_SHARE_CONV_ALLOWED_YES);for v9_server+v9_client, we don't see the same constant socket close issue in v6_server+v9_client, which is a good news.[update-3]MCAUSERon attribute for allSVRCONNchannel on v6_server. Same on v9_server (which doesn't have the same socket close problem when connected with the same v9_client).display channel (SYSTEM.ADMIN.SVRCONN)\n MCAUSER(mqm) \n\ndisplay channel (SYSTEM.AUTO.SVRCONN)\n MCAUSER( ) \n\ndisplay channel (SYSTEM.DEF.SVRCONN)\n MCAUSER( )[update-4]I tried setting MCAUSER() tomqm, then using both(blank) andmqmfrom client side, both can create connections, but still seeing the same unexpected socket close using v9_client+v6_user. After updating MCAUSER(), i always addedrefresh security, and restart the qmgr.I also tried setting system variable to blank in eclipse before creating the connection using blank user, didn't help either.[update-5]Limiting our discussion to v9_client+v9_server. The async testing code below generates a ton of xasession create/close request, using limited number of existing connections. Using SHARECNV(1) we would also end up with unaffordable high TIME_WAIT count, but using larger than 1 SHARECNV (eg. 10) might introduce extra performance penalty......Async testing codeimport java.util.ArrayList;\nimport java.util.concurrent.Callable;\nimport java.util.concurrent.ExecutorService;\nimport java.util.concurrent.Executors;\nimport java.util.concurrent.FutureTask;\n\nimport javax.jms.*;\nimport com.ibm.mq.jms.*;\nimport com.ibm.msg.client.wmq.WMQConstants;\n\npublic class MQSeries_simpleAuditQ_Async_v9 {\n\nprivate static String queueManager = \"QM.ALPQ.ALL.01\";\nprivate static int port = 26010; \n\nprivate static String host = \"localhost\";\n\nprivate static int connCount = 20;\nprivate static int amp = 100;\nprivate static ExecutorService amplifier = Executors.newFixedThreadPool(amp);\n\npublic static void main(String[] args) throws JMSException {\n MQXAQueueConnectionFactory queueFactory= new MQXAQueueConnectionFactory();\n\n System.out.println(\"\\n\\n\\n*******************\\nqueueFactory implementation version: \" + \n queueFactory.getClass().getPackage().getImplementationVersion() + \"*****************\\n\\n\\n\");\n\n queueFactory.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n if (queueFactory.getClass().getPackage().getImplementationVersion().split(\"\\\\.\")[0].equals(\"9\")) {\n queueFactory.setProviderVersion(\"9\");\n queueFactory.setShareConvAllowed(WMQConstants.WMQ_SHARE_CONV_ALLOWED_YES);\n } \n\n queueFactory.setHostName(host);\n queueFactory.setPort(port);\n queueFactory.setQueueManager(queueManager);\n //queueFactory.setChannel(\"\");\n\n ArrayList xaQueueConnections = new ArrayList();\n try {\n // Obtain a QueueConnection\n System.out.println(\"Creating Connection...\");\n //System.setProperty(\"user.name\", \"mqm\");\n //System.out.println(\"system username: \" + System.getProperty(\"user.name\"));\n for (int ct=0; ct totalElapsedTimeRecord = new ArrayList();\n ArrayList> taskBuffer = new ArrayList>();\n\n for (int loop=0; loop <= 10; loop++) {\n try {\n for (int i=0; i xaSessionPoker = new FutureTask(new XASessionPoker(xaQueueConnections.get(idx)));\n amplifier.submit(xaSessionPoker);\n taskBuffer.add(xaSessionPoker); \n }\n System.out.println(\"loop \" + loop + \" completed\");\n\n } catch (Exception ex) {\n System.out.println(ex);\n }\n } \n\n for (FutureTask xaSessionPoker : taskBuffer) {\n totalElapsedTimeRecord.add(xaSessionPoker.get());\n }\n System.out.println(\"Average xaSession poking time: \" + calcAverage(totalElapsedTimeRecord));\n\n System.out.println(\"Closing connections.... \");\n for (QueueConnection xaQueueConnection : xaQueueConnections) {\n xaQueueConnection.close();\n }\n } catch (Exception e) {\n System.out.println(\"Error processing \" + e.getMessage());\n } \n\n amplifier.shutdown();\n}\n\nprivate static double calcAverage(ArrayList myArr) {\n double sum = 0;\n for (Double val : myArr) {\n sum += val;\n }\n return sum/myArr.size();\n}\n\n// create and close session through QueueConnection object passed in.\nprivate static class XASessionPoker implements Callable {\n\n // conn instance of MQXAQueueConnection. ref. QueueProviderService\n private QueueConnection conn;\n\n XASessionPoker(QueueConnection conn) {\n this.conn = conn;\n }\n @Override\n public Double call() throws Exception {\n XASession xaSession;\n double elapsed = 0;\n try {\n final long start = System.currentTimeMillis();\n\n // ref. DualSessionWrapper\n // xaSession instance of MQXAQueueSession\n xaSession = ((XAConnection) conn).createXASession();\n\n xaSession.close();\n final long end = System.currentTimeMillis();\n elapsed = (end - start) / 1000.0;\n } catch (Exception e) {\n // TODO Auto-generated catch block\n System.out.println(e);\n }\n return elapsed;\n } \n}\n}### Assistant: We found the root cause is a combination ofno more session pooling+bitronix TM doesn't offer session pooling across TX. Specifically (in our case), bitronix managesJmsPooledConnectionpooling, but everytime a (xa)session is used (underJmsPooledConnection), a new socket is created (createXASession()) and closed (xaSession.close()).One solution, is to wrap the jmsconnectionwith(xa)sessionpool, similar to what's been done inhttps://github.com/messaginghub/pooled-jms/tree/master/pooled-jms/src/main/java/org/messaginghub/pooled/jmshttp://bjansen.github.io/java/2018/03/04/high-performance-mq-jms.htmlalso suggests SpringCachingConnectionFactoryworks well, which sounds like a speical case of the first solution.\n"} +{"text": "### Human: I want MQseries server version 7.0 or below version 8.0 for 32 bit window version.I am not able to find any archives and link to download old version of MSMQseries to use in 32 bit version.Please provide link of archives and other links to provide information, where do I download MQseries. Thanks in advance.### Assistant: MQ 7.0 reached EOL on 30 Apr 2015 so your support options are very limited, consider the 8.0 product which is supported until 2020-04-30. If you must use 7.0, as it is a licensed product, you'll need to download it fromPassPort Advantage (PPA)Consult the appropriateIBM KnowledgeCenterfor information on installing usage.\n"} +{"text": "### Human: I'm working on a microservice in Java to connect to an IBM Websphere MQ V8.0 through SSL. However, I am seeing this error in the logs:JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2059' ('MQRC_Q_MGR_NOT_AVAILABLE')At the MQ end the error isCSQX673Eand the reason is:The SSL or TLS channel's channel-name is configured to use certificate label: cert-label. However, the remote peer did not send the necessary information to allow the local channel to use the correct certificate. The remote host is conn-id.Can somebody please let me know how to pass this parameter, using Java.As per my understanding,CERTLABLis not a part of the certificate.### Assistant: Note the information below is documented the same in MQ v8.0.0, v9.0.0, and v9.1.0 knowledge centers.IBM Documents that in the\nIBM MQ 8.0.0 Knowledge center pageIBM MQ>Security>Security overview>IBM MQ security mechanisms>Security protocols in IBM MQ>The SSL or TLS key repository>Digital certificate labels, understanding the requirementsthe following:IBM MQ Version 8.0 supports the use of multiple certificates on the\n same queue manager, using a per-channel certificate label attribute.\n Inbound channels to the queue manager (for example, server connection\n or receiver) rely on detecting the channel name using TLS Server Name\n Indication (SNI), in order to present the correct certificate from the\n queue manager.The same page also documents this:Note that inbound channels (including receiver, cluster-receiver,\n unqualified server, and server-connection channels) only send the\n configured certificate if the IBM MQ version of the remote peer fully\n supports certificate label configuration, and the channel is using a\n TLS CipherSpec.In all other cases, the queue manager CERTLABL parameter determines\n the certificate sent. In particular, the following only ever receive\n the certificate configured by the CERTLABL parameter of the queue\n manager, regardless of the channel-specific label setting:All current Java and JMS clients.Versions of IBM MQ prior to Version 8.0.IBM also documents the similar information in the IBM MQ 8.0.0 Knowledge center pageIBM MQ>Reference>Configuration reference>Channel attributes>Channel attributes in alphabetical order>Certificate label (CERTLABL):Inbound channels (including RCVR, CLUSRCVR, unqualified SERVER, and\n SVRCONN channels) will only send the configured certificate if the\n IBM\u00ae MQ version of the remote peer fully supports certificate label\n configuration and the channel is using a TLS CipherSpec. If that is\n not the case, the queue manager CERTLABL attribute determines the\n certificate sent. This restriction is because the certificate label\n selection mechanism for inbound channels depends upon a TLS protocol\n extension that is not supported in all cases.In particular,Java\u2122\n clients, JMS clients, and all versions of IBM MQ prior to Version 8.0\n do not support the required protocol extension and will only ever\n receive the certificate configured by the queue manager CERTLABL\n attribute, regardless of the channel-specific label setting.As you stated Java 8 does support SNI, but apparently IBM has not yet implemented the feature in the IBM MQ Classes for Java or IBM MQ Classes for JMS.One possible solution I can think of is that you could figure out which underlying function MQ calls to create the TLS session and override this to set the SNI attribute to a value that MQ will recognize on the queue manger with code like the following:SSLParameters params = sslSocket.getSSLParameters();\nparams.setServerNames(serverNames);\nsslSocket.setSSLParameters(params);IBM has documented the format that the channel name is passed in the SNI in the Technote \"IBM WebSphere MQ: How does MQ provide multiple certificates (CERTLABL) capability\":The SNI address used by MQ is based upon the channel name that is\n being requested, followed by a suffix of \".chl.mq.ibm.com\".MQ channel names are mapped to be valid SNI names as follows:Upper case letters A-Z are folded to lower caseDigits 0 through 9 are left unchangedAll other characters including lower-case letters a-z are converted into their 2-digit hexadecimal ASCII character code followed by a\n hyphen.lower case letters a through z map to \"61-\" through \"7a-\" respectivelypercent (%) maps to \"25-\"hyphen (-) maps to \"2d-\"dot (.) maps to \"2e-\"forward slash (/) maps to \"2f-\"underscore (_) maps to \"5f-\"On EBCDIC platforms, the channel name is converted to ASCII before\n this mapping is applied. As an example, channel name \"TO.QMGR1\" maps\n to an SNI address of \"to2e-qmgr1.chl.mq.ibm.com\".By contrast, the lower case channel name \"to.qmgr1\" maps onto SNI\n address of \"74-6f-2e-71-6d-67-72-1.chl.mq.ibm.com\".\n"} +{"text": "### Human: I'm looking at using MQ V9.1 for Developers (the free download). I'm sure there are restrictions re: it's sue in some ways - maybe number of messages a queue can process but can't seem to find this information. Can anyone help please?### Assistant: IBM MQ Advanced for Developers gives you full access to all of the MQ and MQ Advanced capabilities, with no restrictions in performance or capacity. The limitation is in support (unless you purchase that) and what it can be used for (development and unit testing only).The details are in the license agreement (http://www14.software.ibm.com/cgi-bin/weblap/lap.pl?li_formnum=L-APIG-AV6HPW):\"If the Program is designated as for \"Developers\", the Program can only be deployed as part of Licensee's internal development and unit testing on a developer machine. A developer machine is a physical or virtual desktop environment, running a primary operating system and the Program, both of which are accessible and used by no more than one specified developer. Licensee is not authorized to use the Program for processing production workloads, simulating production workloads or testing scalability of any code, application or system. Licensee is not authorized to use any part of the Program for any other purposes without acquiring the appropriate production entitlements. \"\n"} +{"text": "### Human: I created a windows service that will connect to remote MQ and get the message as MQSTR format but after getting the message I didn't closed connection to remote MQ . My windows service will continuously check if data is available in remote MQ or not but after getting one message I need to restart my service to get the another message from remote MQ . Can anyone tell me what I need to do to get message constantly from remote MQ . Any clue or any link will do fine . Please HelpMy C# windows service code is like this :Program.csusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.ServiceProcess;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace MQ_listner\n{\n static class Program\n {\n static void Main()\n {\n ServiceBase[] ServicesToRun;\n ServicesToRun = new ServiceBase[]\n {\n new Service1()\n };\n ServiceBase.Run(ServicesToRun);\n\n\n }\n }\n}Service1.csusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Data;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.ServiceProcess;\nusing System.Text;\nusing System.Threading;\nusing System.Threading.Tasks;\n\n\nnamespace MQ_listner\n{\n public partial class Service1 : ServiceBase\n {\n private MQReader MQReader;\n private string _serviceName = \"MQ_Listener\";\n private DateTime _TimeStart;\n private bool _run = true; \n private Thread _thread;\n int WaitWhenStop = 0;\n private DateTime _TimeEnd;\n private TimeSpan _TimeDifference;\n private TimeSpan _TimeElasped = new TimeSpan(0);\n\n\n\n public Service1()\n {\n InitializeComponent();\n }\n\n protected override void OnStart(string[] args)\n {\n try\n {\n EventLog.WriteEntry(_serviceName + \"was started at\" + _TimeStart.ToString());\n _run = true;\n\n _thread = new Thread(new ThreadStart(StartMQListenerService));\n _thread.IsBackground = true;\n _thread.Start();\n }\n catch (Exception ex)\n {\n EventLog.WriteEntry(_serviceName + \"was not started . Error Message : \" + ex.ToString());\n }\n\n\n }\n\n protected override void OnStop()\n {\n _run = false;\n _thread.Join(WaitWhenStop);\n\n _TimeEnd = DateTime.Now;\n _TimeDifference = _TimeEnd.Subtract(_TimeStart); \n _TimeElasped = _TimeElasped.Add(_TimeDifference);\n EventLog.WriteEntry(_serviceName + \"was stopped at \" + _TimeEnd.ToString() + \"\\r\\n ran for total time :\" + _TimeElasped.ToString());\n }\n\n\n // MQ connection service \n\n public void StartMQListenerService()\n {\n try\n {\n if (_run)\n {\n if (MQReader == null)\n {\n MQReader = new MQReader();\n MQReader.InitializeConnections();\n EventLog.WriteEntry(_serviceName + \"MQ connection is established\");\n }\n }\n }\n catch (Exception ex)\n {\n System.Diagnostics.EventLog.WriteEntry(_serviceName, ex.ToString());\n System.Diagnostics.ProcessStartInfo startinfo = new System.Diagnostics.ProcessStartInfo();\n startinfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;\n startinfo.FileName = \"NET\";\n startinfo.Arguments = \"stop\" + this.ServiceName;\n Process.Start(startinfo);\n }\n }\n }\n}\n\n\n****MQReader.cs****\n\nusing System;\nusing IBM.WMQ;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Xml;\nusing System.Linq;\nusing System.Xml.Linq;\nusing System.Configuration;\n\nnamespace MQ_listner\n{\n internal class MQReader\n {\n public MQReader()\n {\n }\n public void InitializeConnections()\n {\n\n MQQueueManager queueManager;\n MQMessage queueMessage;\n MQGetMessageOptions queueGetMessageOptions;\n MQQueue queue;\n\n\n string QueueName;\n string QueueManagerName;\n string ChannelInfo;\n string channelName;\n string PortNumber;\n string transportType;\n string connectionName;\n\n QueueManagerName = ConfigurationManager.AppSettings[\"QueueManager\"]; \n QueueName = ConfigurationManager.AppSettings[\"Queuename\"];\n ChannelInfo = ConfigurationManager.AppSettings[\"ChannelInformation\"];\n PortNumber = ConfigurationManager.AppSettings[\"Port\"];\n char[] separator = { '/' };\n string[] ChannelParams;\n ChannelParams = ChannelInfo.Split(separator);\n channelName = ConfigurationManager.AppSettings[\"Channel\"];\n transportType = ConfigurationManager.AppSettings[\"TransportType\"];\n connectionName = ConfigurationManager.AppSettings[\"ConnectionName\"];\n String strReturn = \"\";\n\n try\n {\n queueManager = new MQQueueManager(QueueManagerName,\n channelName, connectionName);\n strReturn = \"Connected Successfully\";\n\n queue = queueManager.AccessQueue(QueueName,\n MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING);\n queueMessage = new MQMessage();\n queueMessage.Format = MQC.MQFMT_STRING;\n queueGetMessageOptions = new MQGetMessageOptions();\n queue.Get(queueMessage, queueGetMessageOptions);\n strReturn = queueMessage.ReadString(queueMessage.MessageLength);\n }\n catch (MQException exp)\n {\n strReturn = \"Exception: \" + exp.Message;\n }\n\n string path1 = @\"C:\\documents\\Example.txt\";\n System.IO.File.WriteAllText(path1, strReturn);\n\n }\n }\n}Can anyone tell me what is wrong in my code? Do I need anything to add here to get message constantly from remote MQ . Please Help . Any link or clue will do fine .EDITafter certain amount of time I need to restart my service to fetch data from remote mq . Can you tell me why windows service needs to restart to fetch data . Any clue? any idea ?### Assistant: Where is your queue close and queue manager disconnect? If you connect and/or open something, youmustmake sure you close and disconnect from it. I would strongly suggest you take an MQ programming course. Or go to theMQ Technical Conferencewhich has sessions on programming MQ.I posted a fully functioning C# MQ program that retrieves all of the messages on a queue atMQQueueManager message poolingHere is an updated version of your MQReader class that should give you the right idea. Note: I did not test it. I leave that for you. :)Also, you should be putting your connection information in a Hashtable and pass the Hashtable to the MQQueueManager class.using System;\nusing IBM.WMQ;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Xml;\nusing System.Linq;\nusing System.Xml.Linq;\nusing System.Configuration;\n\nnamespace MQ_listner\n{\n internal class MQReader\n {\n private MQQueueManager qManager = null;\n private MQMessage inQ = null;\n private bool running = true;\n\n public MQReader()\n {\n }\n\n public bool InitQMgrAndQueue()\n {\n bool flag = true;\n Hashtable qMgrProp = new Hashtable();\n qMgrProp.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\n qMgrProp.Add(MQC.HOST_NAME_PROPERTY, ConfigurationManager.AppSettings[\"ConnectionName\"]);\n qMgrProp.Add(MQC.CHANNEL_PROPERTY, ConfigurationManager.AppSettings[\"Channel\"]);\n\n try\n {\n if (ConfigurationManager.AppSettings[\"Port\"] != null)\n qMgrProp.Add(MQC.PORT_PROPERTY, System.Int32.Parse(ConfigurationManager.AppSettings[\"Port\"]));\n else\n qMgrProp.Add(MQC.PORT_PROPERTY, 1414);\n }\n catch (System.FormatException e)\n {\n qMgrProp.Add(MQC.PORT_PROPERTY, 1414);\n }\n\n if (ConfigurationManager.AppSettings[\"UserID\"] != null)\n qMgrProp.Add(MQC.USER_ID_PROPERTY, ConfigurationManager.AppSettings[\"UserID\"]);\n\n if (ConfigurationManager.AppSettings[\"Password\"] != null)\n qMgrProp.Add(MQC.PASSWORD_PROPERTY, ConfigurationManager.AppSettings[\"Password\"]);\n\n try\n {\n qManager = new MQQueueManager(ConfigurationManager.AppSettings[\"QueueManager\"],\n qMgrProp);\n System.Console.Out.WriteLine(\"Connected Successfully\");\n\n inQ = qManager.AccessQueue(ConfigurationManager.AppSettings[\"Queuename\"],\n MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING);\n System.Console.Out.WriteLine(\"Open queue Successfully\");\n }\n catch (MQException exp)\n {\n System.Console.Out.WriteLine(\"MQException CC=\" + mqex.CompletionCode + \" : RC=\" + mqex.ReasonCode);\n flag = false;\n }\n\n return flag;\n }\n\n public void LoopThruMessages()\n {\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.Options |= MQC.MQGMO_WAIT | MQC.MQGMO_FAIL_IF_QUIESCING;\n gmo.WaitInterval = 2500; // 2.5 seconds wait time or use MQC.MQEI_UNLIMITED to wait forever\n MQMessage msg = null;\n\n while (running)\n {\n try\n {\n msg = new MQMessage();\n inQ.Get(msg, gmo);\n System.Console.Out.WriteLine(\"Message Data: \" + msg.ReadString(msg.MessageLength));\n }\n catch (MQException mqex)\n {\n if (mqex.Reason == MQC.MQRC_NO_MSG_AVAILABLE)\n {\n // no meesage - life is good - loop again\n }\n else\n {\n running = false; // severe error - time to exit\n System.Console.Out.WriteLine(\"MQException CC=\" + mqex.CompletionCode + \" : RC=\" + mqex.ReasonCode);\n }\n }\n catch (System.IO.IOException ioex)\n {\n System.Console.Out.WriteLine(\"ioex=\" + ioex);\n }\n }\n\n try\n {\n if (inQ != null)\n {\n inQ.Close();\n System.Console.Out.WriteLine(\"Closed queue\");\n }\n }\n catch (MQException mqex)\n {\n System.Console.Out.WriteLine(\"MQException CC=\" + mqex.CompletionCode + \" : RC=\" + mqex.ReasonCode);\n }\n\n try\n {\n if (qMgr != null)\n {\n qMgr.Disconnect();\n System.Console.Out.WriteLine(\"disconnected from queue manager\");\n }\n }\n catch (MQException mqex)\n {\n System.Console.Out.WriteLine(\"MQException CC=\" + mqex.CompletionCode + \" : RC=\" + mqex.ReasonCode);\n }\n }\n\n public void StopIt()\n {\n running = false;\n }\n }\n}Whenever you stop the service, make sure it calls the StopIt method in MQReader.\n"} +{"text": "### Human: We are getting below INFO message at splunk.[00004390] debug [java ] [messaging ] Could not find method\n getJMSDestination in class com.ibm.mq.jms.MQQueue.I googled it but couldn't get proper clarity.https://developer.ibm.com/answers/questions/264880/jms-messages-in-websphere-native-stderrlog/There is nogetJMSDestination()method incom.ibm.mq.jms.MQQueue. ButgetJMSDestination()method is available injavax.jms.Messagewe are using tanuki wrapper with tc server. we are getting below INFO log at wrapper.log. Looks like it's JVM log but not sure why this info log are displaying in wrapper.log. any help here?INFO | jvm 1 | 2018/06/25 11:16:17 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org\nINFO | jvm 1 | 2018/06/25 11:16:17 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.\nINFO | jvm 1 | 2018/06/25 11:16:17 | \nINFO | jvm 1 | 2018/06/25 11:16:18 | Jun 25, 2018 11:16:18 AM org.apache.catalina.startup.Catalina load\nINFO | jvm 1 | 2018/06/25 11:16:18 | INFO: Initialization processed in 873 ms\nINFO | jvm 1 | 2018/06/25 11:16:19 | 2018-06-25 11:16:19 [000004a0] info [native] License = license ok; \nINFO | jvm 1 | 2018/06/25 11:16:34 | Jun 25, 2018 11:16:34 AM org.apache.catalina.startup.Catalina start\nINFO | jvm 1 | 2018/06/25 11:16:34 | INFO: Server startup in 16173 ms\nINFO | jvm 1 | 2018/06/25 11:20:10 | 2018-06-25 11:20:10 [00001cb8] debug [java ] [messaging ] Could not find method getJMSDestination in class com.ibm.mq.jms.MQQueue\nINFO | jvm 1 | 2018/06/25 11:20:24 | 2018-06-25 11:20:24 [00001cb8] debug [java ] [messaging ] Could not find method getJMSDestination in class com.ibm.mq.jms.MQQueue### Assistant: Please note that your MQ queue (com.ibm.mq.jms.MQQueue) is a JMS Endpoint, not a JMS Message. The closes method you have on a JMS queue is getQueueName().\nIf you want to actual message, your App should use the MQ message, not the queue itself\n"} +{"text": "### Human: I was reading some information about the difference between the message channels and the message queues,I understand that the channel is used for connecting to a queue\n manager and not to a queue.So the channel can retrieve/send message to different queues or just a particular queue? But when a producer needs to place a message into a queue, it specifies the name of the queue and the queue manager, but if that information was specified by the producer is not needed that the channel knows that information, right?When is has a Publish/Subscribe messaging style, is always used a sender/receiver channel?### Assistant: Amessage channelconnects together two queue managers. There are various different pairs of channel types that have slightly different behaviours, but all those types which send from one queue manager to the other are the same from the perspective of your question. For the rest of this answer I will use the SENDER-RECEIVER pair.A SENDER channel willALWAYSread from one queue - a transmission queue. It is named on the SENDER channel definition. The transmission queue is a safe storage area for the message until it is successfully transmitted to the the target queue manager.An application connected to the sending queue manager can put messages to many different queues on the target queue manager and they will all, initially, be stored on the transmission queue.This is possible because the queue manager adds a special header (called a transmission header - MQXQH) to the front of the message while it resides on the transmission queue. This header contains the target queue name and the target queue manager name as provided originally by the message producer. The channel does not know this information, it is provided by the producer.Once the channel has moved the message across the network to the target queue manager, the RECEIVER channel removes the transmission header and uses the data in it, the queue name and queue manager name, to put the message to the appropriate queue.In this way a single channel pair can deliver messages to many different queues.\n"} +{"text": "### Human: Please provide your suggestion for following statement:I need to do a MQ Websphere performance testing. The MQ's are installed on a remote machine.\nI need to configure with JMeter and need to pass data in format of XML and CSV files to MQ.\nJMeter is installed on my local machine.\nI searched online for configurations, where I found following options of configuring it:JMS Point-to-Point sampler.JSR223 SamplerJMS Publisher/SubscriberThe current MQ which I have, has following configuration data:\u201chost name\u201d \n\u201cservice port\u201d \n\u201cchannel name\u201d \n\u201cqueue manager name\u201d \n\u201cqueue name\u201d\n\u201cuserid\u201d and \u201cpassword\u201dCould any one please suggest the best possible way of configuring MQ and sending the test data files.\nDo I have to install the MQ on my local machine too? Also, kindly provide a link/list of necessary jar files required for the same.Note: JMeter version is 3.0(r1743807) and IBM MQ Websphere version is : 7.5### Assistant: I believe the only way isJSR223 Sampler.You can obtain the necessary MQ Client JAR files fromIBM Fix Central. Once done copy them toJMeter Classpath. If you really want/have to continue with JMeter 3.1 you will also needgroovy-all.jarIf you're looking for some sample code check outRunning the MQPubSubApiSample Java sampleand/orIBM MQ testing with JMeter - Learn HowAccording to JMeter Best Practices youshould always stick to the latest version of JMeterso consider upgrading to JMeter 4.0 (or whatever version is available onJMeter Downloads Page\n"} +{"text": "### Human: I am using Spring JMS and have a@JmsListenerannotated method that handles incoming messages and also responds to them.The issue is that I need to set the delivery mode toNON_PERSISTENTand the default of the used IBM MQ library isPERSISTENTwhich could only be changed when calling the (internal)sendmethod.In a different question here on stackoverflow it was mentioned that it is possible to set the delivery mode of aJmsTemplate, but unfortunately the template is not used for@JmsListenerannotated method.After debugging I found theMessagingMessageListenerAdapterthat has apostProcessProducermethod I can overwrite to manually change the settings of the createdMessageProducer. Unfortunately it is quite complicated to extend this class and let spring use it. I got it working, but I doubt this is the best solution and having this in place this will set the delivery mode for all my@JmsListenermethods toNON_PERSISTENT(not yet an issue for me, but maybe in the future):// bean definition in my @Configuration class:\n\n@Bean(name = JmsListenerConfigUtils.JMS_LISTENER_ANNOTATION_PROCESSOR_BEAN_NAME)\n@Role(BeanDefinition.ROLE_INFRASTRUCTURE)\npublic JmsListenerAnnotationBeanPostProcessor jmsListenerAnnotationProcessor() {\n return new JmsListenerAnnotationBeanPostProcessor() {\n @Override\n protected MethodJmsListenerEndpoint createMethodJmsListenerEndpoint() {\n return new MethodJmsListenerEndpoint() {\n\n @Override\n protected MessagingMessageListenerAdapter createMessageListenerInstance() {\n return new MessagingMessageListenerAdapter() {\n\n @Override\n protected void postProcessProducer(MessageProducer producer, Message response)\n throws JMSException {\n super.postProcessProducer(producer, response);\n\n producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);\n }\n\n };\n }\n\n };\n }\n };\n}Is there an easier way to set the delivery mode when I am using@JmsListener? I found a lot of classes where I can set the delivery mode, but I haven't found any way to do this on one of the beans I had to define to get my JMS setup running (like theJmsListenerContainerFactoryorConnectionFactory).EDIT: Unfortunately we are using Spring 4.x and can't update to 5.x### Assistant: With Spring 5 (currently 5.0.6), you can now set aQosSettingsobject in the container factory'sresponseQosSettingspropertydocs here; scroll down a bit.Finally if you need to specify some QoS values for the response such as the priority or the time to live, you can configure the JmsListenerContainerFactory accordingly:public class QosSettings {\n\n private int deliveryMode;\n\n private int priority;\n\n private long timeToLive;\n\n ...\n\n}\n"} +{"text": "### Human: Please let me know if it is possible to send messages to IBM MQ via MQIPT (Internet pass through) in nodejs. I checked the documentation of the modulehttps://www.npmjs.com/package/mqlightand did not find any option to specify details like queue manager name, channel name etc, which I think is required to connect to MQ. The use case is to push message to MQ from lambda deployed in AWS cloud.### Assistant: MQ IPT only understands the MQ protocol, coming from an MQ client. Not the MQ Light (AMQP) protocol.So for a NodeJS program, you can either use the MQ Light API with a different proxy mechanism in the DMZ, or use the MQ NodeJS package ('npm install ibmmq', and which prereqs the MQ C client library) and which could go through MQ IPT.\n"} +{"text": "### Human: Hi I am new to Spring integration. I want to write code from scratch to read message from one JMS queue and send it to seven different queue. \nI need to use IBM Mq. Can anyone share the sample code with me. I have written below xml. \nI have created one reader queue and seven writer queue. And used recipient-list-router to route it from reader queue to writer queue.Can somebody confirms whether its right or wrong.jms-xml.This adapter reads message from one queue and duplicate it and writes it in multiple queues.\n\n ]]>\n\n\n\n \n \n \n \n \n\n\n\n\n \n \n\n\n\n \n \n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n\n \n \n\n\n\n\n\n\n\n\n\n\n-->\n \n \n \n \n \n \n \n\n\n\n\n\n \n \n \n### Assistant: Have you had a chance to visit SI samples repohttps://github.com/spring-projects/spring-integration-samples? There are several examples for JMShttps://github.com/spring-projects/spring-integration-samples/tree/master/basic/jms\n"} +{"text": "### Human: I'm trying to implement a destructive reading from WebSphere, i.e. I read message that should be then immediately deleted from the queue.I written the code that worked fine until I started to mess with messages. For example, the last one was \"add one message, read it, wait on empty queue, then add two messages\". In my scenario this program should read the first message, wait until something appears, and then read it too.However, the problem is that I've got a situation where I'm stuck. I have a message in the queue but I can't read if with BROWSE nor with CURSOR. Here is my code:MQEnvironment.UserId = _queueSettings.UserName;\nMQEnvironment.Password = _queueSettings.Password;\n\n\nvar manager = new MQQueueManager(_queueSettings.QueueManagerName, _queueSettings.ChannelName, _queueSettings.ConnectionName);\nvar queue = manager.AccessQueue(_queueSettings.QueueName, MQC.MQOO_FAIL_IF_QUIESCING | MQC.MQOO_INPUT_SHARED | MQC.MQOO_BROWSE);\n\nvar browseFirstOptions = new MQGetMessageOptions { Options = MQC.MQGMO_BROWSE_FIRST };\nvar cursorOptions = new MQGetMessageOptions { Options = MQC.MQGMO_MSG_UNDER_CURSOR };\n\nvar currentOptions = browseFirstOptions;\n\nwhile (!cancellationToken.IsCancellationRequested)\n{\n var logger = _contextlessLogger.ForContext(\"requestId\", Guid.NewGuid());\n try\n {\n var msg = new MQMessage();\n queue.Get(msg, currentOptions);\n\n if (currentOptions == browseFirstOptions)\n {\n currentOptions = cursorOptions;\n continue;\n }\n\n string messageText = msg.ReadString(msg.MessageLength);\n RunProcessingTask(logger, messageText);\n }\n catch (MQException ex) when (IsNoMessagesException(ex) && currentOptions != browseFirstOptions)\n {\n currentOptions = browseFirstOptions;\n }\n catch (MQException ex) when (IsNoMessagesException(ex))\n {\n const int sleepIntervalMs = 5000;\n _contextlessLogger.Information(\"No messages in the queue. Sleeping for {sleepIntervalMs}ms\", sleepIntervalMs);\n await Task.Delay(sleepIntervalMs);\n }\n catch (Exception ex)\n {\n logger.Error(ex, \"Unexpected error occured\");\n }\n}\n\nprivate static bool IsNoMessagesException(MQException exception) =>\n exception.ReasonCode == MQC.MQRC_NO_MSG_AVAILABLE\n || exception.ReasonCode == MQC.MQRC_NO_MSG_UNDER_CURSOR;I just get2033or2034while I can see in UI that there is a message.How could it be done? Maybe I'm doing the wrong thing?I added Java tag as well because their code doesn't differ at all, for example I usedthis codeas reference.### Assistant: while I can see in UI that there is a message.I assume you see current queue depth of 1.If you put a message on a queue, IBM MQ increments current queue depth immediately, i.e.beforeyou commit the transaction. But you can get the message onlyafterthe transaction commit.\n"} +{"text": "### Human: I created application which can connect, send or read messages from queue. In this moment I want to show message (not read!) from queue. Can you help me with this issue?\nI should use MQC.MQOO_BROWSE parameter when I try get access to queue?I tried create method like below:public ShowMessage ShowMessagesFromQueue(IRequiredParameters parameters)\n{\n ShowMessage queue;\n try\n {\n queue = new ShowMessage(_manager.AccessQueue(parameters.QueueName, MQC.MQOO_INQUIRE | MQC.MQOO_FAIL_IF_QUIESCING | MQC.MQOO_BROWSE));\n Console.WriteLine(\"Message from queue: \"); \n }\n catch (MQException exp)\n {\n Console.WriteLine(exp.Message);\n throw;\n }\n}and I don't know how should I implement class below:public class ShowMessage\n{\n private MQQueue _queue;\n public ShowMessage(MQQueue queue)\n {\n _queue = queue;\n }\n\npublic string Show()\n{\n var message = new MQMessage();\n try\n {\n return message.ReadString(message.(dontKnowWhatUseHere);\n }\n catch (MQException exp)\n {\n Console.WriteLine(exp.Message);\n throw;\n }\n}This is good idea?### Assistant: Ok I resolved it.\nIn my Show method I had to add more option like below:public void Show()\n{\n var message = new MQMessage();\n try\n {\n var getMessageOptions = new MQGetMessageOptions();\n getMessageOptions.Options = MQC.MQGMO_BROWSE_FIRST;\n _queue.Get(message, getMessageOptions);\n var msg = message.ReadString(message.MessageLength);\n Console.WriteLine(\"Preview of message: \" + msg);\n }\n catch (MQException exp)\n {\n Console.WriteLine(exp.Message);\n throw;\n }\n}\n"} +{"text": "### Human: I'm trying to browse messages in a DLQ and I get the 2080 error.Please share your expertise on this issue.1:root@hostname:/root # ./amqsbcg SYSTEM.DEAD.LETTER.QUEUE QM.ABCDEFG\n\nAMQSBCG0 - starts here\n**********************\n\n MQOPEN - 'SYSTEM.DEAD.LETTER.QUEUE'\n\n MQGET 1, failed with CompCode:1 Reason:2080\n MQCLOSE\n MQDISC1:root@hostname:/root # mqrc 2080\n\n 2080 0x00000820 MQRC_TRUNCATED_MSG_FAILED### Assistant: Try thedmpmqmsgutility that comes with MQ V8 and above.The following invocation as an example...dmpmqmsg -m QM.ABCDEFG -i SYSTEM.DEAD.LETTER.QUEUE -f myfile.txtThis will give you a hex dump of the message after the MQMD is dumped out. amqsbcg would also only give you a hex dump of the message, so in both cases you are still going to have to pick your DLQ reason code out from the hex message.\n"} +{"text": "### Human: I'm trying to get the transactional .NET monitor sample to work from the IBM WebSphere 9.0 documentation (see Using the .NET monitor, page 675 of the folowing document:ftp://public.dhe.ibm.com/software/integration/wmq/docs/V9.0/PDFs/mq90.develop.pdf)I managed to compile everything ok (targetting .NET 2.0), but when running the monitor with runmqdnm as follows, I get an exception:runmqdnm -m myqmgr -q myqueue -a TransactionalMonitor.dll -c TransactionalMonitor.Monitor \n5724-H72 (C) Copyright IBM Corp. 1994, 2017.\nAMQ8377: Unexpected error 2354 was received by the application.I'm running the sample directly on my MQ server, which is a Windows Server 2012 R2 machine with IBM MQ 9.0.0.3 server installed.For reference, the code I implemented:using System.EnterpriseServices;\nusing IBM.WMQ;\nusing IBM.WMQMonitor;\n\n[assembly: ApplicationName(\"TransactionalMonitor\")]\n\nnamespace TransactionalMonitor\n{\n [Transaction(TransactionOption.Required)]\n public class Monitor : ServicedComponent, IMQObjectTrigger\n {\n [AutoComplete(true)]\n public void Execute(MQQueueManager qmgr, MQQueue queue, MQMessage message, string param)\n {\n System.Console.WriteLine(\"SETTING COMMIT\");\n ContextUtil.SetComplete();\n }\n }\n}When removing the transactional stuff the sample works OK.\nWhat am I doing wrong?### Assistant: You don't say what release of IBM MQ you are actually using (you mention MQ V9 documentation).I would compile your exit with the OLDEST release of .NET that you have. People try and use the latest & greatest but most times it will not work.i.e. For 64-bit DLLC:\\WINDOWS\\Microsoft.NET\\Framework64\\v2.0.50727\\csc.exe /nologo /t:library /platform:x64 /r:System.dll /r:\"%MQ_FILE_PATH%\\bin\\amqmdnet.dll\" /out:TransactionalMonitor.dll TransactionalMonitor.cs\n"} +{"text": "### Human: Error below occurs when accessing MQ server via .NET Client. Login credential is not asked when CCDT is created. But MQ server is looking for it for some reason.I cannot find any information that covers both CCDT and the error below together.IBM.WMQ.MQException: MQRC_NOT_AUTHORIZED\n\n----- cmqxrsrv.c : 2356 -------------------------------------------------------\n 17/04/2018 23:50:44 - Process(1848.16) User(SYSTEM) Program(amqzlaa0.exe)\n Host(APPLE) Installation(Installation1)\n VRMF(8.0.0.5) QMgr(LocalQM)\n\n AMQ5540: Application 'bin\\Debug\\Producer.exe' did not supply a user ID\n and password\n\n EXPLANATION:\n The queue manager is configured to require a user ID and password, but none was\n supplied.\n ACTION:\n Ensure that the application provides a valid user ID and password, or change\n the queue manager configuration to OPTIONAL to allow applications to connect\n which have not supplied a user ID and password. \n ----- amqzfuca.c : 4311 -------------------------------------------------------\n 17/04/2018 23:50:44 - Process(1848.16) User(SYSTEM) Program(amqzlaa0.exe)\n Host(APPLE) Installation(Installation1)\n VRMF(8.0.0.5) QMgr(LocalQM)\n\n AMQ5541: The failed authentication check was caused by the queue manager\n CONNAUTH CHCKCLNT(REQDADM) configuration.\n\n EXPLANATION:\n The user ID 'mqclient' and its password were checked because the user ID is\n privileged and the queue manager connection authority (CONNAUTH) configuration\n refers to an authentication information (AUTHINFO) object named\n 'SYSTEM.DEFAULT.AUTHINFO.IDPWOS' with CHCKCLNT(REQDADM). \n\n This message accompanies a previous error to clarify the reason for the user ID\n and password check.\n ACTION:\n Refer to the previous error for more information. \n\n Ensure that a password is specified by the client application and that the\n password is correct for the user ID. The authentication configuration of the\n queue manager connection determines the user ID repository. For example, the\n local operating system user database or an LDAP server. \n\n To avoid the authentication check, you can either use an unprivileged user ID\n or amend the authentication configuration of the queue manager. You can amend\n the CHCKCLNT attribute in the CHLAUTH record, but you should generally not\n allow unauthenticated remote access. \n -------------------------------------------------------------------------------\n 17/04/2018 23:50:45 - Process(14900.9) User(SYSTEM) Program(amqrmppa.exe)\n Host(APPLE) Installation(Installation1)\n VRMF(8.0.0.5) QMgr(LocalQM)\n\n AMQ9557: Queue Manager User ID initialization failed for 'mqclient'.\n\n EXPLANATION:\n The call to initialize the User ID 'mqclient' failed with CompCode 2 and Reason\n 2035.\n ACTION:\n Correct the error and try again. \n----- cmqxrsrv.c : 2356 -------------------------------------------------------Server SetupCCDT file is created by following the links below:Setting up the server using IBM MQ ExplorerServer-connection Channel: LOCAL.DEF.SVRCONN\n\nMCA User ID: emptySetting up the client using IBM MQ ExplorerClinet channe: LOCAL.DEF.SVRCONN\n\nQueue Manager name: LocalQM\n\nConnection name: 192.168.1.9(1415)192.168.1.9 is localhost address1415 is queue manager,LocalQM, TCP port.SET CCDT Environment1C:\\Users\\'#.lp\\source>SET MQCHLLIB=C:\\ProgramData\\IBM\\MQ\\qmgrs\\LocalQM\\@ipcc\n\nC:\\Users\\'#.lp\\source>SET MQCHLTAB=AMQCLCHL.TABPut AMQCLCHL.TAB also to C:\\ProgramData\\IBM\\MQ (I don't know why which might not be correct, because error on log file:AMQ9518: File 'C:\\ProgramData\\IBM\\MQ\\AMQCLCHL.TAB' not found.)IBM MQ.NETThe code is below fromhereMQQueueManager qm = null;\n System.Environment.SetEnvironmentVariable(\"MQCHLLIB\", \"C:\\\\ProgramData\\\\IBM\\\\MQ\\\\qmgrs\\\\LocalQM\\\\@ipcc\");\n System.Environment.SetEnvironmentVariable(\"MQCHLTAB\", \"AMQCLCHL.TAB\");\n\n try\n {\n Hashtable props = new Hashtable();\n props.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);\n qm = new MQQueueManager(\"LocalQM\",props);\n MQQueue queue1 = qm.AccessQueue(\"LocalQueue\", MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING);\n MQMessage msg = new MQMessage();\n msg.WriteUTF(\"Hello this message is from .net client\");\n queue1.Put(msg);\n queue1.Close();\n qm.Disconnect();\n }\n catch (Exception ex)\n {\n Console.Write(ex);\n }IBM MQ V8 on Windows 10MQ.NET Client V8 on Windows 10Creating a client channel definition tableUsing a client channel definition table with .NETThis thread is related toMQRC_Q_MGR_NAME_ERRORUpdate 1Following the link below. But it seems info on mqccred.ini is not used by MQ Server. Because the same error occurs.Client side security exit to insert user ID and password ( mqccred )Setup steps:1 Create mqccred.ini (D:\\mqccred.ini)QueueManager:\n Name=LocalQM\n User=mqclient\n password=password2 Set Windows Environment variableset MQCCRED=D:\\mqccred.ini3 Using mqccredDEFINE CHANNEL(LOCAL.DEF.SVRCONN) CHLTYPE(clntconn) +\nCONNAME(127.0.0.1) +\nQMNAME(LocalQM) +\nSCYEXIT('mqccred(ChlExit)') +\nREPLACE4 Set ADOPTCTX(YES)ALTER AUTHINFO(SYSTEM.DEFAULT.AUTHINFO.IDPWOS) AUTHTYPE(IDPWOS) ADOPTCTX(YES)UPDATE 2I updated MQ objects to uppercase, and still get the same error as above, but have new error log message below:Do I need to write exit program in .NET according toUsing channel exits in IBM MQ .NET?22/04/2018 22:37:15 - Process(11904.1) User('#.lp) Program(mMq.Producer.exe)\n Host(APPLE) Installation(Installation1)\n VRMF(8.0.0.5)\nAMQ9535: User exit not valid.\n\nEXPLANATION:\nChannel program 'LOCAL.DEF.SVRCONN' ended because user exit 'mqccred(ChlExit)'\nis not valid. \nArchitecture of the exit library does not match the process's architecture\n which is '' bit.\nACTION:\nEnsure that the user exit is specified correctly in the channel definition, and\nthat the user exit program is correct and available. \n----- IBM.WMQ.MQChannelExitHandler.LoadExit : 0 -------------------------------\n22/04/2018 22:38:21 - Process(5720.1) User('#.lp) Program(mMq.Producer.exe)\n Host(APPLE) Installation(Installation1)\n VRMF(8.0.0.5)\nAMQ9535: User exit not valid.\n\nEXPLANATION:\nChannel program 'LOCAL.DEF.SVRCONN' ended because user exit 'mqccred(ChlExit)'\nis not valid. \nArchitecture of the exit library does not match the process's architecture\n which is '' bit.\nACTION:\nEnsure that the user exit is specified correctly in the channel definition, and\nthat the user exit program is correct and available. \n----- IBM.WMQ.MQChannelExitHandler.LoadExit : 0 -------------------------------UPDATE 3I have a different error below when MCA user ID is set to a Windows user.IBM.WMQ.MQException: MQRC_Q_MGR_NOT_AVAILABLE\n\n22/04/2018 22:38:21 - Process(5720.1) User('#.lp) Program(mMq.Producer.exe)\n Host(APPLE) Installation(Installation1)\n VRMF(8.0.0.5)\nAMQ9535: User exit not valid.\n\nEXPLANATION:\nChannel program 'LOCAL.DEF.SVRCONN' ended because user exit 'mqccred(ChlExit)'\nis not valid. \nArchitecture of the exit library does not match the process's architecture\n which is '' bit.\nACTION:\nEnsure that the user exit is specified correctly in the channel definition, and\nthat the user exit program is correct and available. \n----- IBM.WMQ.MQChannelExitHandler.LoadExit : 0 -------------------------------Update 4Sorry for the confusion. Update 2 and 3 are the same. Both updates should have the same error: MQRC_Q_MGR_NOT_AVAILABLE, which comes after update 1. I put MQRC_NOT_AUTHORIZED by mistake.### Assistant: The usage of a CCDT doesn't eliminate the need to prove identity to the queue manager. The first error you presented is because by default MQ requires a password for admin users.There are four levels of CONNAUTH for client connections over the network:CHCKCLNT(REQDADM)this is the default value. Any user with MQ administrative authority must provide a valid password. In addition any user without administrative authority that does provide a password must provide a valid password.CHKCLNT(OPTIONAL)this is similar #1 but does not REQUIRE a password for users with MQ administrative authority. Any user Admin or not that provided a password must provide a valid password, with this value an administrative user would not be required to send a password.CHCKCLNT(REQUIRED)this value means that all users must provide a valid password.CHCKCLNT(NONE)no users are required to provide a password, and even if they do provide a password it will not be validated.You can set this value for the entire queue manager on theAUTHINFOobject set as theCONNAUTHvalue on theQMGR. If you set it toREQADMINorOPTIONALyou can then uplift it for specific channels via aCHLAUTHrule to a stricter value such asREQUIRED. You can not set it lower.If you disable security you have no security and anyone with access to your network can connect to your queue manager.You have a few options to keep security enabled:You could use a client security exit specified on the CLNTCONN to pass credentials such as mqcred.You could use a client side certificate with TLS and map it to a MCAUSER on the SVRCONN.Note based on yourUpdate 1you were specifyingQMNAME(LocalQM), because there are no single quotes around the name MQ will fold this to UPPERCASE and set this asLOCALQM.As Roger pointed out you also did not specify port 1415 on your CONNAME . You indicated you had problems with this you need to put single quotes around the CONNAME value if there are(or)characters in it.Note based on yourUPDATE 2(Below gathered from comments that were moved to Chat):Under the MQ installation directory normally underProgram FilesorProgram Files(x86)you should find a sub-directory calledTools\\c\\Samples\\mqccred, this should have sub-directories for 32bit (lib) and 64bit (lib64). You should copy the file fromlibto theexitsdirectory and fromlib64to theexits64directory.You only need a native .NET exit if you are using Managed .NET client mode which you indicate you are not using by havingprops.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);UPDATE 2abased on your comment:Sorry, I am usingMQC.TRANSPORT_MQSERIES_MANAGED. I copied from\n other thread. Does it mean I need to write .NET exit?mqcred will not work with Managed mode .NET, to use a exit to provide the credentials you would need to write the equivalent in .net.It would be much simpler to specify the credentials in your program via properties than to write a Managed mode exit similar to mqcred.Roger's answer to \"Sending message on IBM MQ: Hangs on AccessQueue\" provides a excellent sample that demonstrates passing the username and password in Managed mode. You can still get the connection details from the CCDT.if (inParms.ContainsKey(\"-u\"))\n qMgrProp.Add(MQC.USER_ID_PROPERTY, ((System.String)inParms[\"-u\"]));\n\n if (inParms.ContainsKey(\"-x\"))\n qMgrProp.Add(MQC.PASSWORD_PROPERTY, ((System.String)inParms[\"-x\"]));\n\n if ( (inParms.ContainsKey(\"-u\")) && (inParms.ContainsKey(\"-x\")) )\n qMgrProp.Add(MQC.USE_MQCSP_AUTHENTICATION_PROPERTY, true);\n"} +{"text": "### Human: I'm trying to connect to IBMMQ using my nodejs code, following the instructions from the linkhttps://github.com/ibm-messaging/mq-mqi-nodejs. I really don't understand why do we need to install MQ on client machine as per this step here'It also requires the MQ C client libraries to be installed that you can get from your MQ installation media or from this site.' When I go and the there I see those instructions for installation is for MQ server. But without this MQ C library it is throwing me exception.I don't really have any local queue, I don't understand why do I need to install all that in my local machine. All I want is that just send messages to the remote queue.Has anyone used this before, if so how.### Assistant: The latest version of the README for that package on github includes another link which points at the Redist client packages which are now available more easily. As Josh says, those can be unpacked without neededing a full install process. Of course, if you unpack those in a local directory, you need to remember to run setmqenv as the default locations for discovering the libraries won't work.\n"} +{"text": "### Human: I need to use CCDT file for MQ.NET client to connect to MQ Server, both are running locally, but got error below.IBM.WMQ.MQException: MQRC_Q_MGR_NAME_ERROR CompCode: 2, Reason: 2058Please find below the server setup, and MQ.NET client.Server SetupI setup and created CCDT file following the links below:Setting up the server using IBM MQ ExplorerServer-connection Channel: LOCAL.DEF.SVRCONNMCA User ID: I tried either omitting it or providing it. And either member of mqm or not of it.Setting up the client using IBM MQ ExplorerClinet channe: LOCAL.DEF.SVRCONNQueue Manager name: LocalQMConnection name: 192.168.1.9 (1415)192.168.1.9 is localhost address1415 is queue manager,LocalQM, TCP port.IBM MQ.NETThe code is below fromhereMQQueueManager qm = null;\n System.Environment.SetEnvironmentVariable(\"MQCHLLIB\", \"C:\\\\ProgramData\\\\IBM\\\\MQ\\\\qmgrs\\\\LocalQM\\\\@ipcc\");\n System.Environment.SetEnvironmentVariable(\"MQCHLTAB\", \"AMQCLCHL.TAB\");\n\n try\n {\n Hashtable props = new Hashtable();\n props.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);\n qm = new MQQueueManager(\"LocalQM\",props);\n MQQueue queue1 = qm.AccessQueue(\"LocalQueue\", MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING);\n MQMessage msg = new MQMessage();\n msg.WriteUTF(\"Hello this message is from .net client\");\n queue1.Put(msg);\n queue1.Close();\n qm.Disconnect();\n }\n catch (Exception ex)\n {\n Console.Write(ex);\n }IBM MQ V8 on Windows 10MQ.NET Client V8 on Windows 10Creating a client channel definition tableUsing a client channel definition table with .NETUPDATEIf I change to below without using CCDT, it works.var properties = new Hashtable\n {\n {MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED }, \n { MQC.HOST_NAME_PROPERTY, \"192.168.1.9\" }, //\"localhost\" },\n { MQC.PORT_PROPERTY, \"1415\"},\n { MQC.CHANNEL_PROPERTY, \"LOCAL.DEF.SVRCONN\" },\n {MQC.USER_ID_PROPERTY, \"xxx\" }, //usrename\n {MQC.PASSWORD_PROPERTY, \"xxx\" } //password\n };\n _queueManager = new MQQueueManager(_queueManagerName, properties);UPDATE 2I changed queue manager to LocalQMC:\\Users\\'#.lp\\source>SET MQCHLLIB=C:\\ProgramData\\IBM\\MQ\\qmgrs\\LocalQM\\@ipcc\n\nC:\\Users\\'#.lp\\source>SET MQCHLTAB=AMQCLCHL.TAB\n\nC:\\Users\\'#.lp\\source>echo DIS CHL(LOCAL.DEF.SVRCONN) CHLTYPE(CLNTCONN) ALL | runmqsc -n\n5724-H72 (C) Copyright IBM Corp. 1994, 2015.\nStarting local MQSC for 'AMQCLCHL.TAB '.\n\n 1 : DIS CHL(LOCAL.DEF.SVRCONN) CHLTYPE(CLNTCONN) ALL\nAMQ8414: Display Channel details.\n CHANNEL(LOCAL.DEF.SVRCONN) CHLTYPE(CLNTCONN)\n AFFINITY(PREFERRED) ALTDATE(2018-04-16)\n ALTTIME(22.16.03) CERTLABL( )\n CLNTWGHT(0) COMPHDR(NONE)\n COMPMSG(NONE) CONNAME(192.168.1.9 (1415))\n DEFRECON(NO) DESCR( )\n HBINT(300) KAINT(AUTO)\n LOCLADDR( ) MAXMSGL(4194304)\n MODENAME( ) PASSWORD( )\n QMNAME(LocalQM) RCVDATA( )\n RCVEXIT( ) SCYDATA( )\n SCYEXIT( ) SENDDATA( )\n SENDEXIT( ) SHARECNV(10)\n SSLCIPH( ) SSLPEER( )\n TPNAME( ) TRPTYPE(TCP)\n USERID( )\nNo commands have a syntax error.\n\nC:\\Users\\'#.lp\\source>UPDATE 3: MQRC_NOT_AUTHORIZED is Not resolvedI changed192.168.1.9 (1415) -> 192.168.1.9(1415)Put AMQCLCHL.TAB also to C:\\ProgramData\\IBM\\MQ (I don't know why which might not be correct, because error on log file:AMQ9518: File 'C:\\ProgramData\\IBM\\MQ\\AMQCLCHL.TAB' not found.)3 I tried \nMCA User Id ->1 mqlclient who is memeber of mqm2 mqlclient who is not memeber of mqm3 emptyBut still got error. Below is exception and error for 3.1IBM.WMQ.MQException: MQRC_NOT_AUTHORIZED\n\n----- cmqxrsrv.c : 2356 -------------------------------------------------------\n17/04/2018 23:50:44 - Process(1848.16) User(SYSTEM) Program(amqzlaa0.exe)\n Host(APPLE) Installation(Installation1)\n VRMF(8.0.0.5) QMgr(LocalQM)\n\nAMQ5540: Application 'bin\\Debug\\Producer.exe' did not supply a user ID\nand password\n\nEXPLANATION:\nThe queue manager is configured to require a user ID and password, but none was\nsupplied.\nACTION:\nEnsure that the application provides a valid user ID and password, or change\nthe queue manager configuration to OPTIONAL to allow applications to connect\nwhich have not supplied a user ID and password. \n----- amqzfuca.c : 4311 -------------------------------------------------------\n17/04/2018 23:50:44 - Process(1848.16) User(SYSTEM) Program(amqzlaa0.exe)\n Host(APPLE) Installation(Installation1)\n VRMF(8.0.0.5) QMgr(LocalQM)\n\nAMQ5541: The failed authentication check was caused by the queue manager\nCONNAUTH CHCKCLNT(REQDADM) configuration.\n\nEXPLANATION:\nThe user ID 'mqclient' and its password were checked because the user ID is\nprivileged and the queue manager connection authority (CONNAUTH) configuration\nrefers to an authentication information (AUTHINFO) object named\n'SYSTEM.DEFAULT.AUTHINFO.IDPWOS' with CHCKCLNT(REQDADM). \n\nThis message accompanies a previous error to clarify the reason for the user ID\nand password check.\nACTION:\nRefer to the previous error for more information. \n\nEnsure that a password is specified by the client application and that the\npassword is correct for the user ID. The authentication configuration of the\nqueue manager connection determines the user ID repository. For example, the\nlocal operating system user database or an LDAP server. \n\nTo avoid the authentication check, you can either use an unprivileged user ID\nor amend the authentication configuration of the queue manager. You can amend\nthe CHCKCLNT attribute in the CHLAUTH record, but you should generally not\nallow unauthenticated remote access. \n-------------------------------------------------------------------------------\n17/04/2018 23:50:45 - Process(14900.9) User(SYSTEM) Program(amqrmppa.exe)\n Host(APPLE) Installation(Installation1)\n VRMF(8.0.0.5) QMgr(LocalQM)\n\nAMQ9557: Queue Manager User ID initialization failed for 'mqclient'.\n\nEXPLANATION:\nThe call to initialize the User ID 'mqclient' failed with CompCode 2 and Reason\n2035.\nACTION:\nCorrect the error and try again. \n----- cmqxrsrv.c : 2356 -------------------------------------------------------### Assistant: OP added the following information to the question in UPDATE 2:SET MQCHLLIB=C:\\ProgramData\\IBM\\MQ\\qmgrs\\QM1\\@ipccSET MQCHLTAB=AMQCLCHL.TABecho DIS CHL(LOCAL.DEF.SVRCONN) CHLTYPE(CLNTCONN) ALL | runmqsc -nI see two possible issues with the CCDT:You have a space in theCONNAMEbetween the IP and the open parenthesis. This may be causing MQ to disregard the port 1415 and use the default port 1414, it also may ignore the space and it may not be a problem, I have never tested with a space.COMPMSG(NONE) CONNAME(192.168.1.9 (1415))TheQMNAMEof theCLNTCONNchannel should match what you are specifying in the call tonew MQQueueManager, so this should sayQM1notLocalQM, this is likely the direct reason for your2058error, but #1 may cause an issue as well once you fix #2.QMNAME(LocalQM) RCVDATA( )There are also other uses for QMNAME where you can specify a group name or a blank. See my answer to \"Connecting to IBM MQ using CCDT file in JMS\" for more details on this. The answer is related to JMS but the information presented for thesetQueueManagerwould be the same as the first parameter to your call tonew MQQueueManager.\n"} +{"text": "### Human: I use xms.net 8.0.0.8 and I want to start multithread xms listener in web application.I start processmessage code with using new Thread t=new Thread()...but something goes wrong,and threads are stuck and not read message?If someone has multithread xms sample for web application can share or tell my mistake?Or is this any bug for multithread in xms?public void ProcessMessage()\n {\n try\n {\n\n ConnectionFactory = WsHelper.CreateConnectionFactoryWMQ();\n Connection = WsHelper.CreateConnection(ConnectionFactory);\n if (QueueMessage.MessageCallType == MessageCallType.WithoutControl)\n Session = WsHelper.CreateSessionWithAutoAcknowledge(Connection);\n else\n Session = WsHelper.CreateSessionWithSessionTransaction(Connection);\n Destination = WsHelper.CreateDestination(Session, QueueMessage.QueueName);\n MessageConsumer = WsHelper.CreateConsumer(Session, Destination, QueueMessage);\n\n MessageListener messageListener = new MessageListener(NewMessageProcess);\n MessageConsumer.MessageListener = messageListener;\n this.Connection.Start();\n\n while (true)\n {\n if (stopping)\n {\n MessageConsumer.Close();\n return;\n }\n\n Thread.Sleep(1000);\n }\n }\n catch(ThreadAbortException ex)\n {\n throw ex;\n }\n catch (Exception ex)\n {\n throw ex;\n }\n\n }\n private void NewMessageProcess(IBM.XMS.IMessage msg)\n {### Assistant: None of that looks right. Multi-threading requires in-depth programming knowledge. Where is your ThreadStart? Make sure each thread is performing its own connection to the queue manager. Also, are you defining 1 MessageListener for all threads or does each thread have its own MessageListener? Because it looks like you are using 1 for all threads which defeats multi-threading.Did you read the MQ Knowledge Center on MessageListener and how to handle mutlit-threading:https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.xms.doc/xms_cmesdel_async.htm\n"} +{"text": "### Human: I use websphere mq xms.net infrastructure to async message listening.My problem is sometimes there are messages in queue but xms cannot read them on time and waiting 1,2... 5 minutes wait and then get the message.Is there any configuration on xms for that something like event poll interval time ...?Sometimes I got message directly sometimes not?### Assistant: You are using XMS .NET version 8.0.0.8. I am not sure what value you have set for the XMSC.WMQ_PROVIDER_VERSION property. The default value is \"unpspecified\" as documentedhere.Update:Apologies. I just checked documentation and IBM.XMS.XMSC.WMQ_POLLING_INTERVAL is valid for MQ 7 and above.However XMSC.RTT_BROKER_PING_INTERVAL property is not valid when connecting MQ queue manager. It is valid only for Real Time Transport of Message Broker and RTT is no longer supported.Are you connecting to MQ v6 queue manager by any chance?I suggest you to not set IBM.XMS.XMSC.WMQ_POLLING_INTERVAL property. The messages should be delivered as soon as they arrive in queue and application is ready to receive.\n"} +{"text": "### Human: I am trying to write my test message to MQ, but failed to do so.Sharing the source-code and error:source-codeimport com.ibm.mq.MQEnvironment;\nimport com.ibm.mq.MQMessage;\nimport com.ibm.mq.MQPutMessageOptions;\nimport com.ibm.mq.MQQueueManager;\nimport com.ibm.mq.MQQueue;\nimport com.ibm.mq.MQC;\n\npublic class MQResponseWriter {\n\n public static void main(String[] args) {\n\n try {\n int openOptions = MQC.MQOO_INQUIRE | MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT;\n MQEnvironment.hostname = \"myserver_name\";\n MQEnvironment.port = 1417;\n MQEnvironment.channel = \"my_channel_name\";\n //MQEnvironment.properties.put(CMQC.USER_ID_PROPERTY, \"admin\");\n //MQEnvironment.properties.put(CMQC.PASSWORD_PROPERTY, \"passw0rd\"); \n //MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES);\n MQQueueManager queueManager;\n queueManager = new MQQueueManager(\"queue_manger_name\");\n MQQueue destQueue = queueManager.accessQueue(\"queue_name\", openOptions);\n MQMessage hello_world = new MQMessage();\n hello_world.writeUTF(\"Blah...blah...bleah...test message no.1...!\");\n MQPutMessageOptions pmo = new MQPutMessageOptions();\n destQueue.put(hello_world, pmo);\n destQueue.close();\n queueManager.disconnect();\n System.out.println(\"------------------------success...\"); \n } catch (Exception e) {\n System.out.println(\"Exception: \" + e);\n e.printStackTrace();\n }\n\n }\n\n}error messageMQJE001: An MQException occurred: Completion Code 2, Reason 2195\nMQJE007: IO error reading message data\nError occured during API call - reason code0\nMQJE001: Completion Code 2, Reason 2009\nMQJE001: Completion Code 2, Reason 2018\nException: com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2009\ncom.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2009\n at com.ibm.mq.MQQueueManager.(MQQueueManager.java:922)\n at com.ibm.mq.MQManagedConnectionJ11.getConnection(MQManagedConnectionJ11.java:426)\n at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:180)\n at com.ibm.mq.MQQueueManager.obtainBaseMQQueueManager(MQQueueManager.java:771)\n at com.ibm.mq.MQQueueManager.construct(MQQueueManager.java:705)\n at com.ibm.mq.MQQueueManager.(MQQueueManager.java:434)\n at com.module.main.MQResponseWriter.main(MQResponseWriter.java:24)What might be main cause of above error and solution if any??### Assistant: I don't know how many times I need to post it @ StackOverflow but do NOT use the MQEnvironment class, as it is NOT thread safe. Use a Hashtable instead. Here is a working example:import java.io.IOException;\nimport java.util.Hashtable;\n\nimport com.ibm.mq.MQException;\nimport com.ibm.mq.MQMessage;\nimport com.ibm.mq.MQPutMessageOptions;\nimport com.ibm.mq.MQQueue;\nimport com.ibm.mq.MQQueueManager;\nimport com.ibm.mq.constants.CMQC;\n\n/**\n * Program Name\n * MQTest11\n *\n * Description\n * This java class will connect to a remote queue manager with the\n * MQ setting stored in a HashTable and put a message to a queue.\n *\n * Sample Command Line Parameters\n * -m MQA1 -h 127.0.0.1 -p 1414 -c TEST.CHL -q TEST.Q1 -u UserID -x Password\n *\n * @author Roger Lacroix\n */\npublic class MQTest11\n{\n private Hashtable params;\n private Hashtable mqht;\n private String qManager;\n private String outputQName;\n\n /**\n * The constructor\n */\n public MQTest11()\n {\n super();\n params = new Hashtable();\n mqht = new Hashtable();\n }\n\n /**\n * Make sure the required parameters are present.\n * @return true/false\n */\n private boolean allParamsPresent()\n {\n boolean b = params.containsKey(\"-h\") && params.containsKey(\"-p\") &&\n params.containsKey(\"-c\") && params.containsKey(\"-m\") &&\n params.containsKey(\"-q\") &&\n params.containsKey(\"-u\") && params.containsKey(\"-x\");\n if (b)\n {\n try\n {\n Integer.parseInt((String) params.get(\"-p\"));\n }\n catch (NumberFormatException e)\n {\n b = false;\n }\n }\n\n return b;\n }\n\n /**\n * Extract the command-line parameters and initialize the MQ HashTable.\n * @param args\n * @throws IllegalArgumentException\n */\n private void init(String[] args) throws IllegalArgumentException\n {\n int port = 1414;\n if (args.length > 0 && (args.length % 2) == 0)\n {\n for (int i = 0; i < args.length; i += 2)\n {\n params.put(args[i], args[i + 1]);\n }\n }\n else\n {\n throw new IllegalArgumentException();\n }\n\n if (allParamsPresent())\n {\n qManager = (String) params.get(\"-m\");\n outputQName = (String) params.get(\"-q\");\n\n try\n {\n port = Integer.parseInt((String) params.get(\"-p\"));\n }\n catch (NumberFormatException e)\n {\n port = 1414;\n }\n\n mqht.put(CMQC.CHANNEL_PROPERTY, params.get(\"-c\"));\n mqht.put(CMQC.HOST_NAME_PROPERTY, params.get(\"-h\"));\n mqht.put(CMQC.PORT_PROPERTY, new Integer(port));\n mqht.put(CMQC.USER_ID_PROPERTY, params.get(\"-u\"));\n mqht.put(CMQC.PASSWORD_PROPERTY, params.get(\"-x\"));\n\n // I don't want to see MQ exceptions at the console.\n MQException.log = null;\n }\n else\n {\n throw new IllegalArgumentException();\n }\n }\n\n /**\n * Connect, open queue, write a message, close queue and disconnect.\n *\n * @throws MQException\n */\n private void testSend()\n {\n MQQueueManager qMgr = null;\n MQQueue queue = null;\n String line;\n int openOptions = CMQC.MQOO_OUTPUT + CMQC.MQOO_FAIL_IF_QUIESCING;\n MQPutMessageOptions pmo = new MQPutMessageOptions();\n\n try\n {\n qMgr = new MQQueueManager(qManager, mqht);\n System.out.println(\"MQTest11 successfully connected to \"+ qManager);\n\n queue = qMgr.accessQueue(outputQName, openOptions);\n System.out.println(\"MQTest11 successfully opened \"+ outputQName);\n\n // Define a simple MQ message, and write some text in UTF format..\n MQMessage sendmsg = new MQMessage();\n sendmsg.format = CMQC.MQFMT_STRING;\n sendmsg.feedback = CMQC.MQFB_NONE;\n sendmsg.messageType = CMQC.MQMT_DATAGRAM;\n\n line = \"This is a test message embedded in the MQTest11 program.\";\n\n sendmsg.messageId = CMQC.MQMI_NONE;\n sendmsg.correlationId = CMQC.MQCI_NONE;\n sendmsg.writeString(line);\n\n // put the message on the queue\n\n queue.put(sendmsg, pmo);\n System.out.println(\"Message Data>>>\" + line);\n }\n catch (MQException e)\n {\n System.out.println(\"MQTest11 cc=\" +e.completionCode + \" : rc=\" + e.reasonCode);\n }\n catch (IOException e)\n {\n System.out.println(\"MQTest11 IOException:\" +e.getLocalizedMessage());\n }\n finally\n {\n try\n {\n queue.close();\n System.out.println(\"MQTest11 closed: \"+ outputQName);\n }\n catch (MQException e)\n {\n System.out.println(\"MQTest11 cc=\" +e.completionCode + \" : rc=\" + e.reasonCode);\n }\n try\n {\n qMgr.disconnect();\n System.out.println(\"MQTest11 disconnected from \"+ qManager);\n }\n catch (MQException e)\n {\n System.out.println(\"MQTest11 cc=\" +e.completionCode + \" : rc=\" + e.reasonCode);\n }\n }\n }\n\n /**\n * main line\n * @param args\n */\n public static void main(String[] args)\n {\n MQTest11 write = new MQTest11();\n\n try\n {\n write.init(args);\n write.testSend();\n }\n catch (IllegalArgumentException e)\n {\n System.err.println(\"Usage: java MQTest11 -m QueueManagerName -h host -p port -c channel -q QueueName -u UserID -x Password\");\n System.exit(1);\n }\n\n System.exit(0);\n }\n}\n"} +{"text": "### Human: I am able to send the message through the Java Test class. Able to see the string message in the console. But while updating it in log, I am getting a null response. I am getting this error \"Invalid Demand Code\". Can anyone help me with this?And can anyone suggest me how to convert fromJMSTextMessagetoJMSBytesMessageIBM MQ Send Bytes message through Java Test Class.Any help would be helpfulMQQueueConnectionFactory cf = new MQQueueConnectionFactory();\n cf.setHostName(\"\");\n cf.setPort();\n cf.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);\n cf.setQueueManager(\"\");\n cf.setChannel(\"\");\n\n MQQueueConnection connection = (MQQueueConnection) cf.createQueueConnection();\n MQQueueSession session = (MQQueueSession) connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\n MQQueue queue = (MQQueue) session.createQueue(\"\");\n MQQueueSender sender = (MQQueueSender) session.createSender(queue);\n\n long uniqueNumber = System.currentTimeMillis() % 1000;\n\n JMSTextMessage message = (JMSTextMessage) session.createTextMessage(\"B+VCTR||*RPI/LAX/8548|16MAR+B+\"); \n\n connection.start();\n\n System.out.println(\"before Sent message:\\\\n\" + message);\n\n sender.send(message);\n System.out.println(\"Sent message:\\\\n\" + message);\n\n sender.close();\n session.close();\n connection.close();\n\n System.out.println(\"\\\\nSUCCESS\\\\n\");\n }\n catch (JMSException jmsex) {\n System.out.println(jmsex);\n System.out.println(\"\\\\nFAILURE2\\\\n\");\n }\n catch (Exception ex) {\n System.out.println(ex);\n System.out.println(\"\\\\nFAILURE1\\\\n\");\n }\n }\n}### Assistant: Following two methods demonstrate how to pass UTF-8 encoded text in BytesMessage:Message createBytesMessage(Session session, String text) throws JMSException {\n Charset charset = Charset.forName(\"UTF-8\"); \n byte[] data = text.getBytes(charset);\n\n BytesMessage bmsg = session.createBytesMessage();\n bmsg.writeBytes(data);\n return bmsg;\n}\n\nString readBytesMessage(BytesMessage bmsg) throws JMSException {\n int len = (int) bmsg.getBodyLength();\n byte[] data = new byte[len];\n bmsg.readBytes(data);\n\n Charset charset = Charset.forName(\"UTF-8\");\n String text = new String(data, charset);\n return text;\n}Essentially a BytesMessage is used to send a byte array. To pass a text using BytesMessages start with converting text to bytes. Here I have used UTF-8 encoding to encode text. Any other will do; just use the same charset for reading and writing. You can even parametrize charset by sending charset name as string property of message (the same idea as HTTP charset parameter).When dealing with TextMessages, IBM MQ willimplicitly do message conversion and encoding.Most of the time this is undesired behavior as it will not treat unicode characters well. Rules of this conversions are describedhere. To avoid this behavior use BytesMessages to pass text.So how to convert TextMessage to BytesMessage?Read text from TextMessage. Than send it as a new BytesMessage.\n"} +{"text": "### Human: I'm a little bit confused with authentication methods in IBM MQ. \nIt looks like the system encourage to use LDAP.I tested it and it works fine.But is it possible to have just simple combination of login + password?Just setup login and password for queue manager and then used it during connection.### Assistant: You can either use user ID and password checked against the queue manager O/S or checked against the LDAP server the queue manager is using.It depends on how your queue manager is configured. Issue the following commands to discover which.DISPLAY QMGR CONNAUTH\n\nDISPLAY AUTHINFO() ALL\n"} +{"text": "### Human: I am trying to lookup for a connectionFactory in a code which is deployed as part of osgi bundle in servicemix (karaf)final Hashtable jndiContext = new Hashtable();\njndiContext.put(Context.INITIAL_CONTEXT_FACTORY,\"com.sun.jndi.ldap.LdapCtxFactory\");\njndiContext.put(Context.SECURITY_AUTHENTICATION, \"none\");\njndiContext.put(Context.PROVIDER_URL, pJndiLDAPserver);\nctx = new InitialContext(jndiContext);\nConnectionFactory lResult = (ConnectionFactory) ctx.lookup(pJndiCFname);The issue I am facing is -when I do a ctx.lookup(\"xyz\") - It gives me a object of javax.naming.Reference instead of MQconnectionFactory. (The same code works perfectly fine as standalone java application)Also, ctx = new InitialContext(jndiContext) gives me an object of InitialContext with defaultInitContext as -\norg.apache.aries.jndi.DelegateContext. Ideally it should give me defaultInitiContext as LdapCtx (as my provider url is a Ldap server)I have the following dependency in my pom.xml -\n javax.jms\n javax.jms-api\n 2.0\n \n \n com.ibm.mq.osgi\n java\n 9.0.0.0\n \n \n com.ibm.msg.client.osgi.jms\n prereq\n 9.0.0.0\n \n \n com.ibm.msg.client.osgi\n jms\n 9.0.0.0\n \n \n com.ibm.msg.client.osgi.commonservices\n j2se\n 9.0.0.0\n \n \n com.ibm.mq.osgi\n allclient\n 9.0.0.0\n \n \n com.ibm.mq.osgi\n allclientprereqs\n 9.0.0.0\n \n \n com.ibm.msg.client.osgi\n nls\n 9.0.0.0\n \n \n com.ibm.msg.client.osgi.wmq\n nls\n 9.0.0.0\n \n \n com.ibm.msg.client.osgi.wmq\n prereq\n 9.0.0.0\n \n \n com.ibm.msg.client.osgi\n wmq\n 9.0.0.0\n \n \n com.csg.npms.pilatus\n pilatus-common\n 0.1-SNAPSHOT\n provided\n \n \n org.ops4j.pax.logging\n pax-logging-api\n 1.8.5\n provided\n \n \n org.osgi\n org.osgi.core\n 4.3.1\n provided\n \n \n javax.ws.rs\n javax.ws.rs-api\n 2.0-m09\n provided\n \n \n com.fasterxml.jackson.core\n jackson-databind\n 2.1.4\n provided\n and the same com.ibm dependency has been installed as part of karaf bundles.So, therefore w.r.t abouve point 2, how can I bypass default jndi aries lookup in Karaf (org.apache.aries.jndi.DelegateContext), so that it gives me LdapContextFactory Object instead of DelegateContext. Am I missing any jars as part of mq in karaf.### Assistant: This is the key part of the error:Unresolved requirements: [[org.apache.qpid.jms.client [464](R 464.8)] osgi.wiring.package; (&(osgi.wiring.package=javax.jms (version>=1.1.0)(!(version>=2.0.0)))This says that the bundle namedorg.apache.qpid.jms.clientcannot be resolved because it imports the packagejavax.jmsbut there is no other bundle that exports the packagejavax.jms. In OSGi, every import must be matched by an export of that package. Additionally there is a version constraint: you need version[1.1.0, 2.0.0), i.e at least 1.1.0 but less than 2.0.0.I would suggest using the following bundle from Maven Central:https://search.maven.org/#artifactdetails%7Corg.jboss.spec.javax.jms%7Cjboss-jms-api_1.1_spec%7C1.0.1.Final%7Cjar.\n"} +{"text": "### Human: If your architecture relays on IBM MQ as a messaging system, can you use MassTransit to publish messages or handle sagas?### Assistant: No, MassTransit does not include support for IBM MQ. Just Azure Service Bus or RabbitMQ. However, MassTransit is open source, and you are welcome to add the support yourself.\n"} +{"text": "### Human: I use webpshere mq and c# client to connect it.\nIs it possible to read multiple message in one get method?If not what is the best way to read parallel in mqCan anyone share c# example of this.(My Mq version is 8)### Assistant: You can only read 1 message at a time.Here is a C# sample to get a message from a queue running under 'managed mode':using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Text;\nusing IBM.WMQ;\n\n/// Program Name\n/// MQTest02\n///\n/// Description\n/// This C# class will connect to a remote queue manager\n/// and get a message from a queue using a managed .NET environment.\n///\n/// Sample Command Line Parameters\n/// -h 127.0.0.1 -p 1414 -c TEST.CHL -m MQA1 -q TEST.Q1 -u tester -x mypwd\n/// \n/// Roger Lacroix, Capitalware Inc.\n/// \nnamespace MQTest02\n{\n class MQTest02\n {\n private Hashtable inParms = null;\n private Hashtable qMgrProp = null;\n private System.String qManager;\n private System.String outputQName;\n\n /*\n * The constructor\n */\n public MQTest02()\n : base()\n {\n }\n\n /// Make sure the required parameters are present.\n /// true/false\n /// \n private bool allParamsPresent()\n {\n bool b = inParms.ContainsKey(\"-h\") && inParms.ContainsKey(\"-p\") &&\n inParms.ContainsKey(\"-c\") && inParms.ContainsKey(\"-m\") &&\n inParms.ContainsKey(\"-q\");\n if (b)\n {\n try\n {\n System.Int32.Parse((System.String)inParms[\"-p\"]);\n }\n catch (System.FormatException e)\n {\n b = false;\n }\n }\n\n return b;\n }\n\n /// Extract the command-line parameters and initialize the MQ variables.\n /// \n /// \n /// IllegalArgumentException \n private void init(System.String[] args)\n {\n inParms = Hashtable.Synchronized(new Hashtable());\n if (args.Length > 0 && (args.Length % 2) == 0)\n {\n for (int i = 0; i < args.Length; i += 2)\n {\n inParms[args[i]] = args[i + 1];\n }\n }\n else\n {\n throw new System.ArgumentException();\n }\n\n if (allParamsPresent())\n {\n qManager = ((System.String)inParms[\"-m\"]);\n outputQName = ((System.String)inParms[\"-q\"]);\n\n qMgrProp = new Hashtable();\n qMgrProp.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);\n\n qMgrProp.Add(MQC.HOST_NAME_PROPERTY, ((System.String)inParms[\"-h\"]));\n qMgrProp.Add(MQC.CHANNEL_PROPERTY, ((System.String)inParms[\"-c\"]));\n\n try\n {\n qMgrProp.Add(MQC.PORT_PROPERTY, System.Int32.Parse((System.String)inParms[\"-p\"]));\n }\n catch (System.FormatException e)\n {\n qMgrProp.Add(MQC.PORT_PROPERTY, 1414);\n }\n\n if (inParms.ContainsKey(\"-u\"))\n qMgrProp.Add(MQC.USER_ID_PROPERTY, ((System.String)inParms[\"-u\"]));\n\n if (inParms.ContainsKey(\"-x\"))\n qMgrProp.Add(MQC.PASSWORD_PROPERTY, ((System.String)inParms[\"-x\"]));\n\n System.Console.Out.WriteLine(\"MQTest02:\");\n Console.WriteLine(\" QMgrName ='{0}'\", qManager);\n Console.WriteLine(\" Output QName ='{0}'\", outputQName);\n\n System.Console.Out.WriteLine(\"QMgr Property values:\");\n foreach (DictionaryEntry de in qMgrProp)\n {\n Console.WriteLine(\" {0} = '{1}'\", de.Key, de.Value);\n }\n }\n else\n {\n throw new System.ArgumentException();\n }\n }\n\n /// Connect, open queue, read a message, close queue and disconnect.\n ///\n /// \n /// MQException \n private void testReceive()\n {\n MQQueueManager qMgr = null;\n MQQueue queue = null;\n int openOptions = MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING;\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n MQMessage receiveMsg = null;\n\n try\n {\n qMgr = new MQQueueManager(qManager, qMgrProp);\n System.Console.Out.WriteLine(\"MQTest02 successfully connected to \" + qManager);\n\n queue = qMgr.AccessQueue(outputQName, openOptions, null, null, null); // no alternate user id\n System.Console.Out.WriteLine(\"MQTest02 successfully opened \" + outputQName);\n\n receiveMsg = new MQMessage();\n\n queue.Get(receiveMsg, gmo);\n System.Console.Out.WriteLine(\"Message Data>>>\" + receiveMsg.ReadString(receiveMsg.MessageLength));\n }\n catch (MQException mqex)\n {\n System.Console.Out.WriteLine(\"MQTest02 cc=\" + mqex.CompletionCode + \" : rc=\" + mqex.ReasonCode);\n }\n catch (System.IO.IOException ioex)\n {\n System.Console.Out.WriteLine(\"MQTest02 ioex=\" + ioex);\n }\n finally\n {\n try\n {\n queue.Close();\n System.Console.Out.WriteLine(\"MQTest02 closed: \" + outputQName);\n }\n catch (MQException mqex)\n {\n System.Console.Out.WriteLine(\"MQTest02 cc=\" + mqex.CompletionCode + \" : rc=\" + mqex.ReasonCode);\n }\n try\n {\n qMgr.Disconnect();\n System.Console.Out.WriteLine(\"MQTest02 disconnected from \" + qManager);\n }\n catch (MQException mqex)\n {\n System.Console.Out.WriteLine(\"MQTest02 cc=\" + mqex.CompletionCode + \" : rc=\" + mqex.ReasonCode);\n }\n }\n }\n\n /// main line\n /// \n /// \n // [STAThread]\n public static void Main(System.String[] args)\n {\n MQTest02 mqt = new MQTest02();\n\n try\n {\n mqt.init(args);\n mqt.testReceive();\n }\n catch (System.ArgumentException e)\n {\n System.Console.Out.WriteLine(\"Usage: MQTest02 -h host -p port -c channel -m QueueManagerName -q QueueName [-u userID] [-x passwd]\");\n System.Environment.Exit(1);\n }\n catch (MQException e)\n {\n System.Console.Out.WriteLine(e);\n System.Environment.Exit(1);\n }\n\n System.Environment.Exit(0);\n }\n }\n}\n"} +{"text": "### Human: The Context:I'm hoping I'm missing something simple. I am a novice in IBM MQMy organisation distributes XML messages via IBM Websphere MQ. Each message represents a record that I simply want to save to a file and clear from the queue.The current mechanism we have is a poorly understood and overly complex Java program that seems to use both MQ libraries and JMS to do this.I am hoping to move this to something simpler and easier to maintain, but I can't seem to find a generic 'IBM MQ Client' that can do things like connect to a queue and save the messages. It seems like you have to use binaries or DLLS and build an application around it.I tried Python as that's closer to my understanding but PyMQI is only for Python 2 (which we don't use) and requires a C compiler which always seems to refuse to work.The question:Is there a program out there in windows to simply access a queue and save the messages to a file? We connect periodically so I can just wrap a scheduled task around it.### Assistant: IBM MQ queue manager and clients communicate using a proprietary protocol, so you definitely need to use IBM MQ Client binaries (dlls or lib or jars depending on language you are comfortable with) to put/get messages to/from a queue.I am sure the JMSToolbox mentioned by @titou10 runs on top of IBM MQ JMS jars.\n"} +{"text": "### Human: I think title is confusing. I try to explain it in detail. \nI have a big xml file that contains a lot of messages for queue. The structure looks like: <'objects'><...>.....<...><'/objects'>. It's an array of objects tags and one item of objects is a message. I want to put this file that should be broken into a separate messages into queue(mq) by using rfhutil.\nI know it's possible but I'm confused about delimiter. The whole menu looks puzzled. \nIs anyone using rfhutil and mq? Maybe you have a guide for that. I couldn't find any information about rfhutil. \nI hope I explained well.there is a pic of rfhutil menu. load Q### Assistant: \"Load Q\" option is used to send all messages from file which was previously created with \"Save Q\" option. It will not properly parse your custom xml. Even if you format xml in a way that is parsable by custom delimiter, xml still contains only message payload and lacks message headers.However rfhutil is part of lagergerIH03 SupportPackand there you will find:additional software to send multiple custom messages like mqputa manual how to do it (ih03.doc)Simplest \"out of head\" solution would be to split xml in multiple smaller files and than send them all with one mqput2 command.\n"} +{"text": "### Human: jmeter, jms point to point : error:Response message: java.lang.IllegalStateException: QueueConnectionFactory expected, but got com.ibm.mq.jms.MQConnectionFactoryconfig:1. jmeter3.32. All the jars available in websphere mq 8.0 -installed folder are pasted in apache-jmeter-3.3\\lib folderalso added javax.jms-api-2.0.1 in apache-jmeter-3.3\\lib folderinitial context factory setup in MQ Explorerjmeter config -JDK 1.8MQ explorer : Eclipse SDK v3.6.2Followed all the steps as described in :JMeter configuration for IBM MQ 8JMeter 3.2 Point-to-Point configuration for IBM MQ 8 => Java Exception### Assistant: I believe you don't need that many jars, you should download the relevant8.x.x.x-WS-MQ-Install-Java-All.jarpackage from theFix Centraland come up with libraries like:com.ibm.mq.allclient.jarcom.ibm.mq.traceControl.jarfscontext.jarjms.jarJSON4J.jarproviderutil.jarI also think you should usecom.ibm.msg.client.jms.JmsFactoryFactorySeeIBM MQ testing with JMeter - Learn Howarticle for detailed JMeter configuration instructions for IBM MQ load testing\n"} +{"text": "### Human: Getting MQJCA1025 error while starting up the Asynchronous Listener/reader on IBM-MQ as -com.ibm.msg.client.jms.DetailedIllegalStateException: MQJCA1025: The\n message consumer must not have a message listener. An application\n attempted to set a message listener for a JMS message consumer. This\n exception occurs only if the application is running in a managed\n environment. Modify the application so that it does use a message\n listener.Below is the init method where listener setup is done -public void init(){\n ConnectionFactory qConnectionFactory = null;\n Connection connection = null;\n try{\n Context ctx = new InitialContext();\n qConnectionFactory = (ConnectionFactory) ctx.lookup(\"java:jboss/Connection\");\n Destination receiverQueue = null;\n if(null != qConnectionFactory){\n connection = qConnectionFactory.createConnection();\n if(null !=connection){\n receiverQueue = (Destination) ctx.lookup(\"java:jboss/RESPONSE\");\n if(null != receiverQueue){\n Session session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE);\n if(null != session){ \n MessageConsumer consumer = session.createConsumer(receiverQueue);\n consumer.setMessageListener(this);\n connection.start();\n }\n }\n }\n }\n }\n catch(Exception e){\n System.out.println(e);\n }\n }IBM resolution athttp://www-01.ibm.com/support/docview.wss?uid=swg21610734doesn't mentions the fix to be made at listener/client side### Assistant: MQJCA1025 error message says don't do the following:consumer.setMessageListener(this);The link you give is very clear:CauseCalling setMessageListener() method in a managed environment is a violation of J2EE specification, and therefore should not be used.Resolving the problemYour JMS application needs to be altered to not call setMessageListener() method.Instead, Activation Specifications are provided for the functionality which this method provides\n"} +{"text": "### Human: We are trying to preserve TimeToLive/JMSExpiration in our messages during moving them from AMQ queue to IBM MQ Series queue, currently we use: jmsBridgeConnectors in AMQ to move the messages but the expiration is not preserved.\nI know that AMQ suggests to rather use Camel instead of jmsBridgeConnectors to bridge AMQ to external messaging systems, but I have no experience with Camel.Did anyone face similar issue and have some working solution, either with jmsBridgeConnectors or Camel?Many thanks in advance\nBest Regards\nLukasz### Assistant: If you use Camel and its JMS component, then you can turn onpreserveMessageQoswhich will then transfer the expiration detail. See more details in the Camel documentation (see the table of the option):http://camel.apache.org/jmsIn terms of the JMS bridge, I assume you refer to the AMQ JMS bridge?http://activemq.apache.org/jms-to-jms-bridge.html- I am not sure if you can configure to keep the expiration or not. Others here at SO may know, or you can dive into the source code, or try to ask on the ActiveMQ user mailing list.\n"} +{"text": "### Human: Is there any method/api to get JMS message receipt time (Not delivery, Not publish timestamp) ? Or i need to fix it manually inonMessage(Message msg)method ?### Assistant: Yep, there is no \"receive timestamp\" in JMS api, some more specific JMS implementations may provide this feature, however if you want to stay on specification level - you need to put down this data yourself.\n"} +{"text": "### Human: Hi I am trying to use batch file to clear message from queue. I have list of queues in a file. I am able to read a file in batch program and clear the queue. If the file contains more than one queue to be cleared , I am able to store them in an array , But Passing the array element to MQ command is not working. Please advise. New to batch scripting, so the methodCode :for /f %%G in (file.txt) do (\n set /a count+=1\n set fileName[!count!]=%%~G\n call set n=!count!\n)\nrem echo !fileName[%count%]!\n\nfor /L %%i in (1,1,%n%) do (\necho !fileName[%%i]!\necho display qlocal(!fileName[%%i]!) | runmqsc %1\n)I have setlocal enabledelayedexpansion enableextensions in the code , and in the above piece echo statement works properly , It is displaying all contents of the array. but it is not getting passed to display qlocal.New to stackoverflow , if the posting format is not proper apologies.### Assistant: Useecho display qlocal(!fileName[%%i]!^) | runmqsc %1The caret^\"escapes\" the)so thatcmdsees it as a standard character and does not pair it with the(infor /L ... do (which closes thedoblock.\n"} +{"text": "### Human: I'm new with MQ Series and then tried to start with the \"Hello World\"https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q030200_.htmI execute it with linux as follow :helloworld pQueueName QueueName SYSTEM.DEF.SVRCONN/TCP/hostname\\(1414\\)I get this error messageImqQueuemanager::connect failed with reset reason code 2058.The API say this error code is due to a wrong queue manager name.http://www-01.ibm.com/support/docview.wss?uid=swg21166938Then : Why do I have a such message and what do they mean by \"wrong queue manager name\"?### Assistant: No, queue manager and queues must be created explicitly before you can use them. The setName method points to queue manager to connect to and does not create a queue manager.Watch this video from T.Rob on how to install MQ and use it -https://www.youtube.com/watch?v=wSCHLBftjDw&pbjreload=10. In the video Linux OS is used. That's OK. You can skip the setup part (up to 2 minutes and 20 seconds or so) and start following from crtmqm command.\n"} +{"text": "### Human: I am working with MQClient 7.5.0.5, with MQ API for .net application.If I open an MQManager connection using WMQ.MQQueueManager not in a transaction scope,\nThe connection will not participate in any transaction I open later on.\nHowever, if the connect is done within a transaction scope, the connection will participate in any other transaction scopes later (unrelated to the first transaction scope the connection was opened in).\nto explain further:I have a DoWork method:void DoWork(MQManager mqManager)\n{\n //Write to DB\n ......\n queue = mqManager.AccessQueue(queueName, MQOO_OUTPUT)\n\n MQPutMessageOptions op = new MQPutMessageOptions();\n op.options = MQPMO_SYNCPOINT;\n queue.Put(msg, options);\n queue.Close();\n}When the code is like this, the connection does not participate in transaction:mqManager = new MQManager(\"MgName\",\"ChName\",\"Srv(port)\");\nusing(scope = new transaction scope)\n{\n DoWork(mqManager)\n scope.complete();\n}\nmqManager.dossconnect();When the code is like this, the connection participate in both transactions:MQManager mqManager = null;\nusing(scope1 = new transaction scope)\n{\n mqManager = new MQManager(\"MgName\",\"ChName\",\"Srv(port)\");\n scope.complete()\n}\nusing(scope = new transaction scope)\n{\n DoWork(mqManager);\n scope.complete();\n}\nmqManager.dossconnect();Why is that? \nI cannot find documentation on this subject. \nAll I found was IBM documentation claiming that : \"A connection might participate in several transactions, but only one transaction is active at any point of time.\"\nBut nothing about when or how to open the connection.\nI would expect it to be like a DB connection, which participated only in the transaction scope it is opened in, but here the MQmanager connection participates in any transaction, only if it was opened within a transaction scope to begin with....Can anyone explain this to me?### Assistant: There were couple of APAR's in this area.APAR IT16143introduced changes in the MQ.NET XA Samples that were shipped with MQ.And the other APAR is IT16606. As per the XA specification, a connection can participate only in one\nactive transaction at a given time. The error MQRC_GLOBAL_UOW_CONFLICT\nis reported if a previous transaction for a connection is still active\nwhen the connection is used inside another unit of work. In order to\nprevent this error, the application should be designed in a way that 2\ntransactional unit does not share the same connection handle\nsimultaneously.Following link talks more about transactions.https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q029290_.htm\n"} +{"text": "### Human: Is there a way to split large message payloads and send through Spring JmsTemplate?IBM MQ supports splitting large payloads via properties JMSX_GROUPID, JMS_IBM_LAST_MSG_IN_GROUP yet there seems to be now way (could not find any resources) of how to send large files over JMS.My queue max size is set at 4Mb, and I have to send messages of over 100Mb as a ByteMessage.### Assistant: I managed to get it working by using different properties name as following:JMSXGroupID\nJMSXGroupSeq\nJMS_IBM_Last_Msg_In_GroupHeader of the messages is properly setup.\n"} +{"text": "### Human: I am calling Date() object before writing into MQ. This is way I am capturing IN time of MQ. How to calculate out time of MQ?### Assistant: The simplest solution is to get an MQ message tracking solution. There are lots available and you can find a list here:http://www.capitalware.com/mq_tools_comm.html#mqtrkCOA is Confirmation of Arrival - when the message is put into the destination queueCOD is Confirmation of Delivery - when the receiving application performs an MQGETCreating a COA/COD solution to your problem is not that difficult or complicated. I've created many SLA solutions for customers when I was a consultant that used MQ's COA/COD.If the messages stay within the same queue manager then life is super easy. If not, then you need to know that the COD message (not COA) is returned using the original message's UserId. So you need to plan to have the correct security permission or the COD message will land in the DLQ (Dead Letter Queue).Find yourself a database to use - it can be your corporate one or a simple one like SQLite, H2, etc.The first question people ask is how to tie everything together. i.e. what key. Simple, use the MQMD MessageId. When the application does an MQPUT, the MQMD MessageId is populated.Second, make sure the original message has the following MQMD fields completed: replyToQueueName, replyToQueueManagerName and report.Third, the COA and COD messages will have the original message's MessageId in their MQMD CorrelId field.You can go with either 3 or 4 timestamps. The extra timestamp can be the time right before you do the MQPUT. Let's say you want 4 timestamps then:Timestamp right before the MQPUTTimestamp returned in the MQMD's putDateTime from the MQPUTCOA Timestamp returned in the MQMD's putDateTime - matching MessageId is in CorrelIdCOD Timestamp returned in the MQMD's putDateTime - matching MessageId is in CorrelIdSimple. Now each row in your DB has a complete SLA record for the history of that message. You can write simple SQL to determine:how long it took MQ to deliver the message i.e. timestamp #4 minus\ntimestamp #1 (or #2)how long it stayed in the queue before the receiving application pick it up i.e. timestamp #4 minus timestamp #3 - when there is finger pointing, this is an important number!!!when someone says 'we never got your message' - timestamp #4 is your proofFinally, if you are expecting a response (reply) message back (assuming the original MessageId is in the CorrelId) then you could add that timestamp to the DB as a 5th timestamp. i.e. Timestamp #5 minus timestamp #1 (or #2) would give you the round-trip time (request-response).\n"} +{"text": "### Human: I am using IBM MQ version 7.5 (trial version)I have created a two queue managers (QM1 and QM2)Under the QM1:port : 1421Queues: q1(local queue)channel: ch1 (receiver)Under the QM2:port :1422Queues:q2(transmission queue),q3(remote queue)channel:ch1 (sender)I can send the messages throughQM2's queueq3toQM1's queueq1. I can also receive and browse the messages through theq2.But when I use the java to read the messages from q1 I have an errorMQJE001: An MQException occurred: Completion Code 2, Reason 2009 \nMQJE016: MQ queue manager closed channel immediately during connect \nClosure reason = 2009 \nMQJE001: Completion Code 2, Reason 2009When I check with the IBM site they said it can cause the due to the below reasonshttp://www-01.ibm.com/support/docview.wss?uid=swg21226703A firewall has terminated the connection.An IOException caused the socket to be closed.An explicit action caused the socket to be closed by one end.The queue manager is offline.The maximum number of channels allowed by the queue manager are already open.A configuration problem in the Queue Connection Factory (QCF).But all of the above are looks good in my system. what I missing , Kindly let me know.public static void main(String[] args) throws MQException {\n\nMQEnvironment.hostname=\"localhost\";\nMQEnvironment.channel=\"ch1\";\nMQEnvironment.port=1421;\nMQQueueManager qMgr= new MQQueueManager(\"QM1\");\nMQQueue outputQueue =qMgr.accessQueue(\"q1\", MQC.MQOO_INQUIRE | MQC.MQOO_BROWSE | MQC.MQOO_INPUT_AS_Q_DEF);\n\n\n//Checking for messages in queue\nint i=outputQueue.getCurrentDepth();\nSystem.out.println(\"Number of messages in queue: \"+i);\n\n\noutputQueue.close();\nqMgr.close();\nqMgr.disconnect();\n}Adding:version of the jar :C:\\Program Files (x86)\\IBM\\WebSphere MQ\\java\\lib>java -cp ./com.ibm.mq.jar com.ibm.mq.MQJavaLevelName: WebSphere MQ classes for JavaVersion: 7.5.0.2Level: p750-002-130627Build Type: ProductionAfter changing the channel I have received the below error----- amqrmrsa.c : 898 --------------------------------------------------------\n10/20/2017 02:17:37 - Process(16340.40) User(MUSR_MQADMIN) Program(amqrmppa.exe)\n Host(user1) Installation(Installation1)\n VRMF(7.5.0.2) QMgr(Receiver)\n\nAMQ9777: Channel was blocked\n\nEXPLANATION:\nThe inbound channel 'SYSTEM.DEF.SVRCONN' was blocked from address '127.0.0.1'\nbecause the active values of the channel matched a record configured with\nUSERSRC(NOACCESS). The active values of the channel were 'CLNTUSER(fresher)'.\nACTION:\nContact the systems administrator, who should examine the channel\nauthentication records to ensure that the correct settings have been\nconfigured. The ALTER QMGR CHLAUTH switch is used to control whether channel\nauthentication records are used. The command DISPLAY CHLAUTH can be used to\nquery the channel authentication records. \n----- cmqxrmsa.c : 926 --------------------------------------------------------\n10/20/2017 02:17:37 - Process(16340.40) User(MUSR_MQADMIN) Program(amqrmppa.exe)\n Host(user1) Installation(Installation1)\n VRMF(7.5.0.2) QMgr(Receiver)\n\nAMQ9999: Channel 'SYSTEM.DEF.SVRCONN' to host 'user1 (127.0.0.1)' ended\nabnormally.\n\nEXPLANATION:\nThe channel program running under process ID 16340(5348) for channel\n'SYSTEM.DEF.SVRCONN' ended abnormally. The host name is 'user1\n(127.0.0.1)'; in some cases the host name cannot be determined and so is shown\nas '????'.\nACTION:\nLook at previous error messages for the channel program in the error logs to\ndetermine the cause of the failure. Note that this message can be excluded\ncompletely or suppressed by tuning the \"ExcludeMessage\" or \"SuppressMessage\"\nattributes under the \"QMErrorLog\" stanza in qm.ini. Further information can be\nfound in the System Administration Guide. \n----- amqrmrsa.c : 898 --------------------------------------------------------### Assistant: channel: ch1 (receiver)MQEnvironment.channel=\"ch1\";An MQ Client application cannot use a RECEIVER channel to connect to a queue manager. The application needs to connect to a SVRCONN channel.Secondly, it is a bad idea to use lowercase names for MQ objects. MQ will automatically uppercase names that are not in quotes. So, to avoid problems, use uppercase names.\n"} +{"text": "### Human: I am facing a problem, which is that i want to set all the MQ details for MQ node in IBM Integration Bus from ESQL file. As I have all the MQ details are setup in database so I would get details from there and set to MQ node so the messages will go to queue dynamically.I read some stuff about LocalEnvironment variables I have set it in ESQL file but the values of those variables are not reflecting on MQ node. Below is the way I am setting up my node property;SET OutputRoot.MQMD.ReplyToQ = 'AMLQUEUE2';As I am using 'MQReply' Node for sending messages. I would like to set the hostname because I am looking for the hostname property but its not there I think. Please help.### Assistant: This ReplyToQ only works with you are using MQReply Node to output the message.For setting a dynamic destination queue you must use \"Destination List\" in a MQOutput Node.In the MQOutput Documatation search for Destination Mode -->MQOutputFor populating the Local Environment for setting a destination list see theaddToMQDestinationList procedure.\n"} +{"text": "### Human: I want to removed the ibm.mq.client lib dependencies forgetandputmessages in to IBM MQ. So i hope to make REST call for put and get messages.I went throughWebSphere MQ bridge for HTTPthis is not worked for me, This will gave to me WebSphere Application Server dependence(not able to deploy on the Apache tomcat server). could please let me know how can i use reset API call to get and put message to IBM MQ with out ibm lib/server dependence### Assistant: At the time of writing this answer, MQ V9.0.3.0 is the latest release of the MQ Continuous Delivery product stream. This version does not offer a REST API to put/get messages beyond that provided by the MQ bridge for HTTP (which was deprecated at MQ v8).Are you a member of the IBM MQ Beta Programme? (It might be called the Early Access Programme, I can't remember).http://www-05.ibm.com/uk/earlyprograms/There are lots of interesting things you can learn about what may be coming next and you'll have the opportunity to participate in shaping the plans and provided feedback on what you hear about!\n"} +{"text": "### Human: I am using IBM MQ V7 API for passing message in message queue. Currently we are passing only body using IBM MQ .now I have to pass Name and value in header before loading in queue.\nI checked in many place the solution they provide using JMS api message.setStringProperty(Name,value).Please check my code (smilar to write() function) in below url.https://www.google.co.in/amp/s/endrasenn.wordpress.com/2010/01/27/readwrite-to-ibm-mq-sample-java-code/amp/### Assistant: There are 2 different MQ APIs available for coding Java applications:IBM MQ for classes for JavaIBM MQ for classes for JMSBoth of them (MQ V7 or higher) support adding a name/value pair as a property. And yes, the property does go in the USR folder of the MQRFH2 header.But you should not think in terms of header and payload data. Don't worry yourself on how MQ handles it but think in terms of name/value properties and payload data.Updated: Oct 3rd, 2017.First, go read the methods ofMQMessageclass. There are 26 set***Property methods. It is very straightforward if you read the MQ docs.MQMessage sendmsg = new MQMessage();\nsendmsg.setStringProperty(\"test\", \"value\");\n"} +{"text": "### Human: I'm trying to create a JAX-RPC client with JMS / IBM MQ transport.I'm using the following guide as reference:https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q033020_.htmI have received the wsdl from an external party. It contains only http bindings, but we are required to use JMS/IBM MQ transport. The endpoint is .NET and IBM MQ 8.I use Axis 1.4 to generate classes from wsdl.\nWhen I try to test the web service call with the endpoint URL provided by external party:public static void main(String[] args) throws MalformedURLException, ServiceException, RemoteException {\n com.ibm.mq.soap.Register.extension();\n Wf1AGwImplLocator locator = new Wf1AGwImplLocator();\n IWf1AGw impl = locator.getBasicHttpBinding_IWf1aGw(\n new URL(\"jms:/queue?destination=QG.WF1AGW.REQ&connectionFactory=clientChannel(WIP.SVRCONN)clientConnection((1414), (1414))&initialContextFactory=com.ibm.mq.jms.Nojndi&replyDestination=QP.ABBSVC.WF1AGW.RESP&timeToLive=30000&persistence=1\"));\n\n impl.dispatch(\"\", \"\", \"\", \"\", \"\",false, \"\", \"\", 1, Calendar.getInstance(), false, \"\", \"\");\n}I get the following error:cannotConnect; nested exception is: \n java.lang.IllegalArgumentException: noCFName\n at org.apache.axis.transport.jms.JMSConnectorManager.getConnector(JMSConnectorManager.java:122)\n at org.apache.axis.transport.jms.JMSTransport.setupMessageContextImpl(JMSTransport.java:163)\n at org.apache.axis.client.Transport.setupMessageContext(Transport.java:46)\n at org.apache.axis.client.Call.invoke(Call.java:2738)\n at org.apache.axis.client.Call.invoke(Call.java:2443)\n at org.apache.axis.client.Call.invoke(Call.java:2366)\n at org.apache.axis.client.Call.invoke(Call.java:1812)\n at com.test.BasicHttpBinding_IWf1AGwStub.dispatch(BasicHttpBinding_IWf1AGwStub.java:201)\n at com.test.Test.main(Test.java:19)\nCaused by: java.lang.IllegalArgumentException: noCFName\n at org.apache.axis.components.jms.JNDIVendorAdapter.getConnectionFactory(JNDIVendorAdapter.java:71)\n at org.apache.axis.components.jms.JNDIVendorAdapter.getQueueConnectionFactory(JNDIVendorAdapter.java:55)\n at org.apache.axis.transport.jms.JMSConnectorFactory.createConnector(JMSConnectorFactory.java:227)\n at org.apache.axis.transport.jms.JMSConnectorFactory.createClientConnector(JMSConnectorFactory.java:178)\n at org.apache.axis.transport.jms.JMSConnectorManager.getConnector(JMSConnectorManager.java:107)The error text suggests that I need to name the QCF even though this is a nojndi QCF? How can I solve this?### Assistant: Needed to add a client-config.wsdd to my project and add the following line:To override the client-config in axis.jar. I thought this was already done in this call:com.ibm.mq.soap.Register.extension();It still complained about the connection factory. Apparently it didn't understand the URL and I had to replace all&with&and remove the ports(it defaults to 1414 anyway..)EDIT:\nThe IllegalArgumentException: noCFName occurs because of the ORDER of the external libraries. The jars in MQ_INSTALLATION_PATH/java/lib must be compiled before the jars in MQ_INSTALLATION_PATH/java/lib/soap.\n"} +{"text": "### Human: I am trying to use JMeter to test IBM MQ 8.0\nDoes anyone have an example (maybe a screenshot) of the various parameters I need? I found several examples, but very inconsistent...\nMore precisely, what should I fill in?QueueConnection Factory?JNDI name Request Queue: some example shows a queue name; some a JNDI name. Now what?JMS selector?Any JMS properties?Any JNDI properties?InitialContext Factory?I assume I want to use \"myserver\" at port 50000, with user \"myuser\" and password \"mypassword\".### Assistant: The trick is to configure a JNDI context in MQExplorer before, and basically set the names of JNDI objects created there:The following works for me with JMeter 3.2:And don't forget to add the MQ JAR to the test plan:\n"} +{"text": "### Human: i have to send a message to IBM queue. I have written a normal producer class to push the message to queue as :-Session session = queueConnection.createSession(true,\n QueueSession.AUTO_ACKNOWLEDGE);\n Destination destination =\n session.createQueue(\"test.queue\");\n MessageProducer producer = session.createProducer(destination);\n\n TextMessage message = session.createTextMessage(\"test\");\n producer.send(message);\n\n // Close the session\n session.close();Now, suppose due to some reason Queue which is present inside QueueManager is down or IBM MQ broker is down or there is a network issue which leads to send message failure.Is there a mechanism in JMS/IBM MQ which can retry automatically to send the message ( basically retry mechanism ) and retry some defined number of times before finally give up to send the message to IBM MQ broker?### Assistant: IBM MQ JMS Client (other IBM MQ clients as well) has a feature wherein if a connection IBM MQ Queue Manager breaks for any reason, the client attempts to reconnect to queue manager till a specified amount of time. See here:https://www.ibm.com/support/knowledgecenter/SSFKSJ_9.0.0/com.ibm.mq.dev.doc/q032520_.htm. You will need to configure connection factory to enable to re-connection.For example, if connection to queue manager breaks while executingproducer.sendmethod, the IBM MQ JMS client automatically attempts to reconnect to queue manager and send the message.In IBM MQ, a queue can not go down, it can become in-accessible though, for example if queue is full or put/get on queue has disabled etc.\n"} +{"text": "### Human: I am able to successfully integrate ActiveMQ(in bound message driven channel) and Kafka (as outbound channel). It working fine.Now, since Both ActiveMQ and MQ Series are JMS compliant, i thought transition would be easier. But, its throwing below error :Setup of JMS Message listener invoker failed for destination 'queue://abcd' - trying to recover - Cause: JMSQ1112: The operation for a domain specific object was not valid. The operation 'createConsumer' is not valid for type 'com.ibm.mq.jms.MQQueue'My spring integration config looks like below:\n\n\n \n\n\n \n \nAnd my respective code looks like below:public MQQueueConnectionFactory jmsConnectionfactory() {\n\n MQQueueConnectionFactory jmsFactory = new MQQueueConnectionFactory();\n jmsFactory.setHostName(hostname);\n jmsFactory.setPort(1444);\n jmsFactory.setQueueManager(//valid queue manager);\n jmsFactory.setChannel(//valid channel name);\n jmsFactory.setTransportType(1);\n jmsFactory.setSSLCipherSuite(// valid suite);\n return jmsFactory;\n }\n\n @Bean\n public DefaultMessageListenerContainer requestListenerContainer() {\n\n DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();\n container.setConnectionFactory(jmsConnectionfactory());\n container.setSessionTransacted(true);\n container.setDestination(helloJMSQueue());\n return container;\n }\n\n\n @Bean\n public Queue helloJMSQueue() {\n return new MQQueue(HELLO_QUEUE);\n }Why I am getting this error ? I saw some posts that it is due to pubLocal value not available in jmsTemplate w.r.t MQQueue but that was dated back to 2005 and i noticed the change has been released.### Assistant: Use justcontainer.setDestinationName(HELLO_QUEUE)instead and let the container to resolve it properly overSession.\n"} +{"text": "### Human: trying to set up Queue Connection factory on WAS 7 and 8.5.5 with SSLMQ channel cipherspec is tls_rsa_with_aes_128_cbc_sha256.but whenever I try specifying the respective suit on WAS as ssl_rsa_with_aes_128_cbc_sha256 , I get a MQSC_UNSUPPORTED_CIPHER_SUITE.cipher tls_rsa_with_aes_128_cbc_sha works just fine .( not SHA256 )I have tried enabling TLSv1.2 on WAS.tried insataling unristricted jars as well.what am I missing ?? looking forward to hear ..\n-AJ### Assistant: WebSphere Application Server (WSAS) V7.0 ships the WebSphere MQ V7.0.1 JCA Resource Adapter (WMQ RA).The V7.0.1 MQ RA does not support the TLS CipherSuite:SSL_RSA_WITH_AES_128_CBC_SHA256This is why your application is getting an exception with the MQ reason code, MQRC_UNSUPPORTED_CIPHER_SUITE, when using WSAS V7.0.WSAS V8.5.5 on the other hand ships the WMQ V7.1 RA and support for the above CipherSuite was added in the V7.1.0.3 Fix Pack release. WSAS V8.5.5.2 ships the MQ V7.1.0.4 RA so this version of later should have the capability to use the SSL_RSA_WITH_AES_128_CBC_SHA256 Java CipherSuite.\n"} +{"text": "### Human: I have been trying to connect to IBM MQ from JMeter JMS publisher. Unable to find corrert \"Initial context factory\" and \"connection factory\" values to use without JNDI properties. I have all MQ jars present in LIB folder.I have the following information-host name - Venus, Port - 21717, Destination Queue name - request.queue,Queue manager - venus.QMGR,channel - venus.server.chl\n(no authorization required).My requirement - To connect to IBM MQ using JMS publisher with above details. But I am not able to sort out on what to give for Provider URL, Initial context factory and connection factory. Can you please help as this has been bugging me for past two weeks and couldn't find a solution yet?\nIt would be great if you can tell me on where to populate the above values in JMS publisher as well for connecting to IBM MQ.I have tried with user.classpath=/folder/with/mq/jars as well but it is not working and all jars are in place with JMeter restart still no luck.Note: I have gone through all sites in these two weeks but couldn't get any luck.### Assistant: Example configuration steps would be something like:Addjavax.jms-api.-x.x.x jartoJMeter ClasspathAddmq-allclient-x.x.x.x.jarto JMeter ClasspathAddJSR223 Samplerto your Test PlanPut the following code into \"Script\" area:import com.ibm.jms.JMSTextMessage;\nimport com.ibm.mq.jms.*;\nimport com.ibm.msg.client.wmq.WMQConstants;\n\nimport javax.jms.JMSException;\nimport javax.jms.Session;\n\nMQQueueConnectionFactory cf = new MQQueueConnectionFactory();\ncf.setHostName(\"your_IBMMQ_host\");\ncf.setPort(1414); // or other port\ncf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);\ncf.setQueueManager(\"your_IBMMQ_queue_manager\");\ncf.setChannel(\"your_IBMMQ_channel\");\ncf.setStringProperty(WMQConstants.USERID, \"your_IBMMQ_username\");\ncf.setStringProperty(WMQConstants.PASSWORD, \"your_IBMMQ_password\");\nconnection = (MQQueueConnection) cf.createQueueConnection();\nMQQueueSession session = (MQQueueSession) connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\nMQQueue queue = (MQQueue) session.createQueue(\"queue:///your_IBMMQ_queue\");\nMQQueueSender sender = (MQQueueSender) session.createSender(queue);\nJMSTextMessage message = (JMSTextMessage) session.createTextMessage(\"your_message_body\");\nconnection.start();\nsender.send(message);More information:What is installed for IBM MQ classes for JavaApache Groovy - Why and How You Should Use ItSimplest sample applications using WebSphere MQ JMS\n"} +{"text": "### Human: I intended to use AMS to encrypt/decrypt MQ messages. I have successfully installed MQ Server v9 on server, and have implemented a client application.\nMy application has two usersaliceandbob, both of them use the samekeystore.jks.The problem is, I have new requirement that each user should use it own certificate, channel, and queue for more secure and not cause impact to each other. That meansaliceshould usealice's private key, andbobshould usebob's private keyseparately when calling to MQ server.Could you give me some ideas how to do that kind of business?For more details, in my case the application has many users of its own, and each user should have a separate private key for calling to MQ server.E.g:customer -> calling to application -> login as alice -> use certificate_1 -> calling to MQ server.customer -> calling to application -> login as bob -> use certificate_2 -> calling to MQ server.--- Update for more detail information. I'm using Java Client for JMS library. Hope it could give some help.### Assistant: The fact that you are using users called alice and bob suggests you may already have seen the Quick Start Guide in Knowledge Center. However, in case you haven't, it provides a complete step-by-step walk-through of how to set up alice and bob with their own keystores and how to exchange their certificates so that they can authenticate the messages from each other.If you have already followed one of these guides and had trouble understanding how to make separate keys and keystores, please provide more detail in your question, so we can help more directly.Quick Start Guide for AMS on UNIX platformsQuick Start Guide for AMS on Windows platformsQuick Start Guide for AMS with Java clients\n"} +{"text": "### Human: Way 1 : Third-party messaging providerI use Websphere application Server 8.5.5 and I configured the queue by creatingmyJMS provideras mentioned in thelink1andlink2(In classpath :where I used fscontext jar and required required ibm jms jars and ).QueueConnectionFactorywith my jms provider.In application I use jms to put meesages to the queue.@Resource(lookup = \"jms/ConnectionFactory\")\n private static QueueConnectionFactory connectionFactory;\n\n @Resource(lookup = \"jms/Queue\")\n private static Queue queue;\n\n public void putMessagesToQueue() { \n try {\n // create a queue connection\n QueueConnection queueConn = connFactory.createQueueConnection();\n ......... \n } catch(JMSException exp) {\n // Handle this exception\n } finally { \n if(queueConn != null) { \n // close the queue connection\n queueConn.close();\n } else {\n System.out.println(\"Queue connection is null\");\n }\n }I get the below exception at line connFactory.createQueueConnection(). I see the sysout in final block is getting printed as \"Queue connection is null\".Exception :javax.jms.JMSException: Failed to create queue connection\n at com.ibm.ejs.jms.JMSCMUtils.mapToJMSException(JMSCMUtils.java:140) ~[com.ibm.ws.runtime.jar:na]\n at com.ibm.ejs.jms.JMSQueueConnectionFactoryHandle.createQueueConnection(JMSQueueConnectionFactoryHandle.java:91) ~[com.ibm.ws.runtime.jar:na]\n\ngetLinkedException()=javax.resource.spi.ResourceAllocationException: Expected QueueConnectionFactory\n\nCaused by: java.lang.ClassCastException: com.ibm.mq.jms.MQConnectionFactory incompatible with javax.jms.QueueConnectionFactory\n at com.ibm.ejs.jms.JMSManagedQueueConnection.createConnection(JMSManagedQueueConnection.java:157) ~[com.ibm.ws.runtime.jar:na]\n at com.ibm.ejs.jms.JMSManagedConnection.(JMSManagedConnection.java:352) ~[com.ibm.ws.runtime.jar:na]\n at com.ibm.ejs.jms.JMSManagedQueueConnection.(JMSManagedQueueConnection.java:72) ~[com.ibm.ws.runtime.jar:na]\n at com.ibm.ejs.jms.GenericJMSManagedQueueConnectionFactory.createManagedConnection(GenericJMSManagedQueueConnectionFactory.java:92) ~[com.ibm.ws.runtime.jar:na]\n at com.ibm.ejs.jms.JMSManagedConnectionFactory.createManagedConnection(JMSManagedConnectionFactory.java:687) ~[com.ibm.ws.runtime.jar:na]\n at com.ibm.ejs.j2c.FreePool.createManagedConnectionWithMCWrapper(FreePool.java:2160) ~[com.ibm.ws.runtime.jar:na]\n at com.ibm.ejs.j2c.FreePool.createOrWaitForConnection(FreePool.java:1838) ~[com.ibm.ws.runtime.jar:na]\n at com.ibm.ejs.j2c.PoolManager.reserve(PoolManager.java:3816) ~[com.ibm.ws.runtime.jar:na]\n at com.ibm.ejs.j2c.PoolManager.reserve(PoolManager.java:3092) ~[com.ibm.ws.runtime.jar:na]\n at com.ibm.ejs.j2c.ConnectionManager.allocateMCWrapper(ConnectionManager.java:1548) ~[com.ibm.ws.runtime.jar:na]\n at com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.java:1031) ~[com.ibm.ws.runtime.jar:na]\n at com.ibm.ejs.jms.JMSQueueConnectionFactoryHandle.createQueueConnection(JMSQueueConnectionFactoryHandle.java:85) ~[com.ibm.ws.runtime.jar:na]Way 2 : WebSphere MQ messaging providerI used the same code in application to put messages to queue but with different provider which is (WebSphere MQ messaging provider) and created queue Connection factory with that provider and Queue manager, hostname, port and all details I have added inQueueConnectionFactory.In this case I see I don't see any error and I'm successfully able to write in to the queue.Question :Why is it not working in way 1? I need to work in way 1 not in way 2.### Assistant: Based on comments from OP @AlagammalP, non-IBM MQ supplied providerutil.jar and fscontext.jar were added to the class path.WAS (Websphere Application Server) comes with the IBM MQ resource adapter included which includes these.Remove the non-IBM MQ supplied providerutil.jar and fscontext.jar that were added to the class path as they are causing your issue:Caused by: java.lang.ClassCastException: com.ibm.mq.jms.MQConnectionFactory incompatible with javax.jms.QueueConnectionFactory\n"} +{"text": "### Human: I have installed the IBM MQ versionmqadv_dev901_linux_x86-64.tar.gzin my ubuntu system by following the link:https://hub.docker.com/r/ibmcom/mq/~/dockerfile/which hasMQSeriesWeb-9.0.1-0.x86_64.rpmalso installed. I am able to open the UI but not able to Login into it. Checked the user id and password available in file at following location but unable to login:/opt/mqm/web/mq/samp/configuration/basic_registry.xml.\nDefaultUseridand password is admin and admin respectively.\nAnotheruseridand password is reader and reader also.Please suggest how to proceed.### Assistant: The user is \"admin\" but the password should be \"passw0rd\"\n"} +{"text": "### Human: Collector node issue: I am currently using collector node to group messages (XML's). My requirement is to collect messages till the last message is received. (Reading from file input)Control terminal: I'm sending a control message to stop collection and propagate to next node. But this doesn't work. As it still waits for timeout/quantity condition to be satisfied.MY QUESTION: What condition can I use to collect messages till the last message received?### Assistant: Add a separate input terminal on the Collector node that is used to complete a collection. Once you send a message to the second terminal, the collection is complete and propagated.\n"} +{"text": "### Human: I have an existing java batch process running on windows that writes to an MQSeries queue. \nWorks fine in v7, but fails using v8.0.0.3.Using these jar files:\ncom.ibm.mq.allclient-8.0.0.3.jar\njavax.jms-api-2.0.1.jar\nTried running with both and just the allclient jar, but repeatedly get this error:Exception in thread \"main\" java.util.ServiceConfigurationError: java.nio.charset.spi.CharsetProvider: Provider com.ibm.mq.jmqi.CustomCharsetProvider not a subtype\n at java.util.ServiceLoader.fail(ServiceLoader.java:239)\n at java.util.ServiceLoader.access$300(ServiceLoader.java:185)\n at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:376)\n at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)\n at java.util.ServiceLoader$1.next(ServiceLoader.java:480)\n at java.nio.charset.Charset$1.getNext(Charset.java:352)\n at java.nio.charset.Charset$1.hasNext(Charset.java:365)\n at java.nio.charset.Charset$2.run(Charset.java:410)\n at java.nio.charset.Charset$2.run(Charset.java:407)\n at java.security.AccessController.doPrivileged(Native Method)\n at java.nio.charset.Charset.lookupViaProviders(Charset.java:406)\n at java.nio.charset.Charset.lookup2(Charset.java:477)\n at java.nio.charset.Charset.lookup(Charset.java:464)\n at java.nio.charset.Charset.forName(Charset.java:528)\n at com.ibm.mq.jmqi.system.JmqiCodepage$JmqiCodepageFactory.initializeCodepage(JmqiCodepage.java:194)\n at com.ibm.mq.jmqi.system.JmqiCodepage$JmqiCodepageFactory.getByName(JmqiCodepage.java:181)\n at com.ibm.mq.jmqi.system.JmqiCodepage.getJmqiCodepage(JmqiCodepage.java:661)\n at com.ibm.mq.jmqi.system.JmqiCodepage.getJmqiCodepage(JmqiCodepage.java:637)\n at com.ibm.mq.jmqi.JmqiEnvironment.getJmqiCodepage(JmqiEnvironment.java:294)\n at com.ibm.mq.jmqi.JmqiEnvironment.lookupDefaultCharset(JmqiEnvironment.java:361)\n at com.ibm.mq.jmqi.JmqiEnvironment.(JmqiEnvironment.java:262)\n at com.ibm.mq.jmqi.system.JmqiSystemEnvironment.(JmqiSystemEnvironment.java:76)\n at com.ibm.mq.jmqi.JmqiFactory.getInstance(JmqiFactory.java:122)\n at com.ibm.mq.internal.MQCommonServices.(MQCommonServices.java:146)\n at com.ibm.mq.MQSESSION.getJmqiEnv(MQSESSION.java:141)\n at com.ibm.mq.MQSimpleConnectionManager.(MQSimpleConnectionManager.java:95)\n at com.ibm.mq.MQEnvironment.(MQEnvironment.java:569)my code made a call to MQenvironment### Assistant: This usually occurs when there are conflicting MQ jars which consists of the same classes. You have to remove the unnecessary mq jars before runnig the application\n"} +{"text": "### Human: Can someone explain different ways of configuring message listener.\nI know two ways:Spring Jms ListenerEJB MDB way.Are there any other ways (should be applicable to both IBM MQ and Active MQ)?### Assistant: For the first question, your proposed ways are good ones withCamel JMS.For the second question take a look atJava JMS mix messaging implementationsif you want to use the same client without changing anything you have to use AMQP ptotocol wich is designed for this.here is 2 examples :ActiveMQ AMQP with JMS transformer leveraging spring IntegrationUnable to access ActiveMQ using JMS based code and amqp 1.0\n"} +{"text": "### Human: I'm able connect IBM Queue directly but when u tried to connect from mule getting the below error and not able to deploy. I'm getting the below errorERROR 2017-04-25 06:45:13,582 \n[main]org.mule.retry.notifiers.ConnectNotifier: Failed to connect/reconnect: \nWebSphereMQConnector\n{\n name=WMQ2\n lifecycle=initialise\nthis=5e7abaf7\nnumberOfConcurrentTransactedReceivers=4\ncreateMultipleTransactedReceivers=true\nconnected=false\nsupportedProtocols=[wmq]\nserviceOverrides=\n}\n. Root Exception was: Connection timed out: connect. Type: class java.net.ConnectException\n\n\nERROR 2017-04-25 06:50:23,943 [main] org.mule.module.launcher.application.DefaultMuleApplication: \n************************************************\nMessage : JMSWMQ0018: Failed to connect to queue manager 'RQACBRKB' with connection mode 'Client' and host name '172.11.11.11(6912)'.\nJMS Code : JMSWMQ0018\nElement : /WMQ2 @ app:config.xml:14 (WMQ)\n--------------------------------------------------------------------------------\nRoot Exception stack trace:\njava.net.ConnectException: Connection timed out: connect\nat java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)\nat java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)\nat java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)\nat java.net.AbstractPlainSocketImpl.connect(Unknown Source)\nat java.net.PlainSocketImpl.connect(Unknown Source)\n\n\n at java.net.SocksSocketImpl.connect(Unknown Source)\ncom.ibm.mq.jmqi.JmqiException: CC=2;RC=2538;AMQ9213: A communications error for occurred [1=java.net.ConnectException[Connection timed out: connect],3=rbitbrka.apl.com] at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.connnectUsingLocalAddress(RemoteTCPConnection.java:810) ~[?:?]PFB connector details:\n \nWhen i telnet the ip and port getting below error:C:\\Users\\111>telnet 172.11.11.11 6912\nConnecting To 172.11.11.11...Could not open connection to the host, on port 6912: Connect failedBut when i ping getting responceC:\\Users\\111>ping 172.11.11.11### Assistant: The pertinent pieces of information from your provided error are:-JMSWMQ0018: Failed to connect to queue manager 'RQACBRKB'\nwith connection mode 'Client' and host name '172.11.11.11(6912)'.\n\ncom.ibm.mq.jmqi.JmqiException: CC=2;RC=2538;MQRC 2538 isMQRC_HOST_NOT_AVAILABLEwhich is explained in Knowledge Center. In there it mentions the most common reasons for this error:-The listener has not been started on the remote system. (please check that your listener is running on port 6912 on the machine at IP address 172.11.11.11)The connection name in the client channel definition is incorrect. (the connection name your client is using is '172.11.11.11(6912)' - is this correct?)The network is currently unavailable.A firewall blocking the port, or protocol-specific traffic.The security call initializing the IBM MQ client is blocked by a security exit on the SVRCONN channel at the server.\n"} +{"text": "### Human: I am trying to find, if there is any way how to configure the IBM MQ server from .NET?Is it actually even possible to remotely control the IBM MQ in other way than Webspere UI?Thanks./IP/### Assistant: Use the MQ/PCF API:https://www.ibm.com/support/knowledgecenter/SSFKSJ_9.0.0/com.ibm.mq.adm.doc/q020010_.htmHere's some examples:MQ Statistics Monitoring from C#/.NETFinding XMIT Queue Depth using WebSphere MQ Classes for .Nethttps://blogs.msdn.microsoft.com/dotnetinterop/2005/12/02/pcf-with-ibms-mq-classes-for-net/http://www.mqseries.net/phpBB2/viewtopic.php?t=60083&sid=ae7da961b41f94662324d3627ea6cc34\n"} +{"text": "### Human: I have 2 QM'sQM1[enabled TLS]QM2[basic QM]same client connects to both these QM's depends on functionality.Now issue is First QM1 is enabled with TLS and connected and working fine. When trying to connect to QM2 with same client its failing to connect.Reason is because of MQEnvironment public static class variables, and it uses same TLS values to QM2. Now i code , i disable as below , when it connect to QM2.MQEnvironment.sslSocketFactory = null;MQEnvironment.sslFipsRequired = false;MQEnvironment.sslCipherSuite = \"\";Now exception says need certificate for QM2(which , i dont need to create)AMQ9660: SSL key repository: password stash file absent or unusable.Question is like which MQEnvironment. property , i can set to remove certificate value as aboveTrying withMQEnvironment.sslCertStores = null;MQEnvironment.SSLKeyRepository = \"\";### Assistant: could you able to give code snippet for the [hash table]You do know that there is a search bar at the top of every stackoverflow.com page. Here are some examples that I have posted:Websphere MQ issue while writing a message to queue from java program2538 - MQRC_HOST_NOT_AVAILABLEJava program to connect WMQ with User Id instead of channel\n"} +{"text": "### Human: I am using Spring boot 1.5.2 and Java 8, here is how I am creating connection factory object,private MQQueueConnectionFactory ibmMQConnectionFactory() {\n MQQueueConnectionFactory ibmMQConnectionFactory = new MQQueueConnectionFactory();\n try {\n ibmMQConnectionFactory.setHostName(ibmMQHostName);\n ibmMQConnectionFactory.setPort(ibmMQPort);\n ibmMQConnectionFactory.setChannel(ibmMQChannel);\n ibmMQConnectionFactory.setQueueManager(ibmMQQueueManager);\n ibmMQConnectionFactory.setTransportType(ibmMQTransportType);\n ibmMQConnectionFactory.setSSLCipherSuite(ibmSslCipher);\n\n } catch (JMSException e) {\n e.printStackTrace();\n LOGGER.error(\"ibmMQConnectionFactory() - Exception occurred: \", e);\n } \n return ibmMQConnectionFactory;\n}If I do not use cipher suite \u201cSSL_RSA_WITH_AES_256_CBC_SHA\u201d on client side I get this error,2017-03-27 13:08:30.030 ERROR 12700 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/]. \n[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in \ncontext with path [] threw exception [Request processing failed; nested\nexception is org.springframework.jms.UncategorizedJmsException: Uncategorized\nexception occurred during JMS processing; nested exception is\ncom.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0018: Failed to connect to\nqueue manager 'XXXX' with connection mode 'Client' and host name\n'xxx.xxx.com(xxxxx)'.\nCheck the queue manager is started and if running in client mode, check there\nis a listener running. Please see the linked exception for more information.;\nnested exception is com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call \nfailed with compcode '2' ('MQCC_FAILED') reason '2397' ('MQRC_JSSE_ERROR').] \nwith root cause\ncom.ibm.mq.jmqi.JmqiException: CC=2;RC=2397;AMQ9641: Remote CipherSpec error \nfor channel 'CLIENT.xxxx' to host ''. [3=CLIENT.xxxx] at com.ibm.mq.jmqi.remote.impl.RemoteConnection.analyseErrorSegment(RemoteConnection.java:3850) ~[jmqi-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.mq.jmqi.remote.impl.RemoteConnection.receiveTSH(RemoteConnection.java:2749) ~[jmqi-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.mq.jmqi.remote.impl.RemoteConnection.initSess(RemoteConnection.java:1024) ~[jmqi-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.mq.jmqi.remote.impl.RemoteConnection.connect(RemoteConnection.java:717) ~[jmqi-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSessionFromNewConnection(RemoteConnectionSpecification.java:356) ~[jmqi-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSession(RemoteConnectionSpecification.java:265) ~[jmqi-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.mq.jmqi.remote.impl.RemoteConnectionPool.getSession(RemoteConnectionPool.java:144) ~[jmqi-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1709) ~[jmqi-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1347) ~[jmqi-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:350) ~[mqjms-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:6789) ~[mqjms-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6157) ~[mqjms-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:285) ~[mqjms-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6126) ~[mqjms-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:115) ~[mqjms-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.mq.jms.MQQueueConnectionFactory.createConnection(MQQueueConnectionFactory.java:198) ~[mqjms-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:180) ~[spring-jms-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:474) ~[spring-jms-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:570) ~[spring-jms-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.jms.core.JmsTemplate.convertAndSend(JmsTemplate.java:658) ~[spring-jms-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat com.xxx.messaging.client.JmsClientImplMemoPadER.send(JmsClientImplMemoPadER.java:49) ~[classes/:na]\nat com.xxx.messaging.controller.MessageController.sendMemoPad(MessageController.java:65) ~[classes/:na]\nat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121]\nat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121]\nat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121]\nat java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121]\nat org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133) ~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116) ~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) ~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) ~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) ~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963) ~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) ~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) ~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) ~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat javax.servlet.http.HttpServlet.service(HttpServlet.java:648) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) ~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat javax.servlet.http.HttpServlet.service(HttpServlet.java:729) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-embed-websocket-8.5.11.jar:8.5.11]\nat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:105) ~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) ~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) ~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:474) [tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349) [tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783) [tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:798) [tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1434) [tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.11.jar:8.5.11]\nat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_121]\nat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_121]\nat org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.11.jar:8.5.11]\nat java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]According to IBM documentation its solution is \u201cEnsure that there is a cipher suite set on the client matching the cipher spec on the queue manager's server connection channel.\u201dhttp://www-01.ibm.com/support/docview.wss?uid=swg21614686When I set cipher suite \u201cSSL_RSA_WITH_AES_256_CBC_SHA\u201d on client machine to match the cipher spec of queue manager \u201cTLS_RSA_WITH_AES_256_CBC_SHA\u201d, I get this error,ERROR 8424 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : \nServlet.service() for servlet [dispatcherServlet] in context with path [] \nthrew exception [Request processing failed; nested exception is\norg.springframework.jms.UncategorizedJmsException: Uncategorized exception\noccurred during JMS processing; nested exception is \ncom.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0018: Failed to connect to\nqueue manager 'XXXXX' with connection mode 'Client' and host name \n'XXX.XXXXX.com(1XXXX)'.\nCheck the queue manager is started and if running in client mode, check there \nis a listener running. Please see the linked exception for more information.;\nnested exception is com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call \nfailed with compcode '2' ('MQCC_FAILED') reason '2393'\n('MQRC_SSL_INITIALIZATION_ERROR').] with root cause\n\njava.lang.IllegalArgumentException: Unsupported ciphersuite \nSSL_RSA_WITH_AES_256_CBC_SHA\nat sun.security.ssl.CipherSuite.valueOf(CipherSuite.java:228) ~[na:1.8.0_121]\nat sun.security.ssl.CipherSuiteList.(CipherSuiteList.java:79) ~[na:1.8.0_121]\nat sun.security.ssl.SSLSocketImpl.setEnabledCipherSuites(SSLSocketImpl.java:2461) ~[na:1.8.0_121]\nat com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.makeSocketSecure(RemoteTCPConnection.java:1994) ~[jmqi-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.connnectUsingLocalAddress(RemoteTCPConnection.java:855) ~[jmqi-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:1262) ~[jmqi-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.mq.jmqi.remote.impl.RemoteConnection.connect(RemoteConnection.java:714) ~[jmqi-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSessionFromNewConnection(RemoteConnectionSpecification.java:356) ~[jmqi-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSession(RemoteConnectionSpecification.java:265) ~[jmqi-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.mq.jmqi.remote.impl.RemoteConnectionPool.getSession(RemoteConnectionPool.java:144) ~[jmqi-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1709) ~[jmqi-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1347) ~[jmqi-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:350) ~[mqjms-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:6789) ~[mqjms-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6157) ~[mqjms-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:285) ~[mqjms-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6126) ~[mqjms-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:115) ~[mqjms-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat com.ibm.mq.jms.MQQueueConnectionFactory.createConnection(MQQueueConnectionFactory.java:198) ~[mqjms-7.1.0.7.jar:7.1.0.7 - k710-007-151026]\nat org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:180) ~[spring-jms-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:474) ~[spring-jms-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:570) ~[spring-jms-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.jms.core.JmsTemplate.convertAndSend(JmsTemplate.java:658) ~[spring-jms-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat com.xxx.messaging.client.JmsClientImplMemoPadER.send(JmsClientImplMemoPadER.java:49) ~[classes/:na]\nat com.xxx.messaging.controller.MessageController.sendMemoPad(MessageController.java:65) ~[classes/:na]\nat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121]\nat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121]\nat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121]\nat java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121]\nat org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133) ~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116) ~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) ~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) ~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) ~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963) ~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) ~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) ~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) ~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat javax.servlet.http.HttpServlet.service(HttpServlet.java:648) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) ~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat javax.servlet.http.HttpServlet.service(HttpServlet.java:729) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-embed-websocket-8.5.11.jar:8.5.11]\nat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:105) ~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) ~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) ~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]\nat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) ~[tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:474) [tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349) [tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783) [tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:798) [tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1434) [tomcat-embed-core-8.5.11.jar:8.5.11]\nat org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.11.jar:8.5.11]\nat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_121]\nat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_121]\nat org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.11.jar:8.5.11]\nat java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]### Assistant: Fixed this after importing certificate using java keytoolhttps://docs.oracle.com/cd/E19509-01/820-3503/ggfen/index.html. Also download \n Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 8http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.htmland replace with your local JRE security jars\n"} +{"text": "### Human: Current version running is MQ7 in windows 2008 server. What to know about migration process steps from MQ7 to MQ8/MQ9?.New Version of MQ8/MQ9 Server to be installed and how existing Queue definition can be migrated?Will Server Installation take care of QM definition also?windows 2008 server will be good for mq9?There is a MQ-Client7 contacting MQ-Server7, so if we upgrade MQ7 to MQ9 then MQ-Client also will be upgraded to MQ9?There will be any issue in contacting MQ9-Client to MQ7 Server?dspmqver will give MQ server details , how to verify MQ-Client version?### Assistant: If you install the new version (V8 or V9) as an upgrade to the V7 installation on the same machine then then next time you start the queue manager it will be migrated to the new version.If you install the new version alongside the V7 installation on the same machine, then you have to use thesetmqmcommand to force the queue manager to move from V7 to the new version.If you install the new version on a completely different machine, the no automatic migration can take place. You will have to create a brand new queue manager and then copy across the definitions from the old one.The command to export all the object definitions is:dmpmqcfg -m QM1 -x all > DEFS.mqsThe command to import all the object definitions is:runmqsc QM1 < DEFS.mqsThe system requirements (e.g. minimum O/S levels) are documented by IBMhere.There is no requirement for the MQ Client to be the same version as the MQ Queue Manager. The MQ Client can be a higher version or a lower version than the MQ Queue Manager and still operate perfectly. The only thing to remember if the MQ Client is a higher version than the MQ Queue Manager is that new features cannot yet be used.You can see the version of the MQ Client being used when it connects to the queue manager by looking inDISPLAY CHSTATUSfor the field calledRVERSION.\n"} +{"text": "### Human: When we useMessageDrivenContext.setRollbackOnly(),Containerwill rollback the transaction contest so the message will be put back toJMSqueue.Is it required explicit put permission for that queue or as its transaction level so container will handle it without explicit put permission.I am usingIBM MQ.### Assistant: In IBM MQ when the GET operation happens under SYNCPOINT and is later backed out instead of committed it is a cancellation of the GET operation and would not require explicit PUT permission to the queue.\n"} +{"text": "### Human: I am trying to have multiple threads (Task) from a windows service to connect to same queue as subscribers so that I can process my messages faster. When I connect to my queues, I am receiving messages on my first subscribed thread and the rest are idle. Following is the code I am using to subscribe and receive messages:private MQQueueManager _queueManager;\nprivate MQQueue _queue;\nprivate MQTopic _topic;\npublic bool isSubscribed = false;\n\npublic void Subscribe()\n{\n var queueManagerName = \"myQueueManager\";\n var properties = new Hashtable();\n //Set all the properties here\n _queueManager = new MQQueueManager(queueManagerName, properties);\n\n //Conect to Queue\n _queue = _queueManager.AccessQueue(\"devQueue\", MQC.MQOO_INPUT_AS_Q_DEF);\n\n isSubscribed = true;\n while (isSubscribed)\n {\n if (cancellationToken.IsCancellationRequested)\n {\n isSubscribed = false;\n cancellationToken.ThrowIfCancellationRequested();\n }\n try\n {\n Receive(onMessageReceived);\n }\n catch (Exception ex)\n {\n Console.WriteLine(\"Exception: {0}\", ex);\n }\n } \n}\n\n\npublic override void Receive(Action onMessageReceived)\n{\n try\n {\n var dataReceived = new MQMessage();\n _queue.Get(dataReceived);\n\n T message;\n message = (T)(object)dataReceived;\n\n onMessageReceived(message); \n _queueManager.Commit();\n }\n catch (Exception ex)\n {\n throw ex;\n }\n}I also tried usingMQC.MQOO_INPUT_SHAREDfor accessing queue which did not work either. Am I missing something?### Assistant: The code you've quoted attempts to open and receive messages from a queue named \"devQueue\". If that code runs under multiple threads then the messages sent to each thread will depend, in part, how quickly the messages are processed, and which version of MQ you are connecting to.However, you mention subscribers in the question (and the code you quote declares a topic as well as the queue). Are you creating a subscription to the topic elsewhere in the app and then using this code to receive messages sent to that subscription? If so, then it's possible that your \"queue receiving\" threads are simply opening up a different queue to the one that is holding the subscription messages. How is the initial subscription being created?\n"} +{"text": "### Human: What Cipersuites and Cipher Specs, can I use for IBM MQ v9 + Oracle-JDK v8?I need more information on the FIPS parameter. When I tried with FIPS parameter, I didn't change anything in MQ level, but changed it to true in JMS client. What is use of this? How is it related to cipher-spec or cipher-suite?Getting Authorization exception in MQ9 and resolvedjust want to review below process are correct way to avoid Authorization exceptionsetmqaut -m TLSTEST.QM -t qmgr -p clientadmin +connect +dsp +inqsetmqaut -m TLSTEST.QM -t queue -p clientadmin -n '**' +put +get\n+browse +dsp +inqrunmqsc TLSTEST.QM ALTER AUTHINFO(SYSTEM.DEFAULT.AUTHINFO.IDPWOS)\nAUTHTYPE(IDPWOS) CHCKCLNT(OPTIONAL)ALTER QMGR CHLAUTH(DISABLED)REFRESH SECURITY TYPE(CONNAUTH)### Assistant: The information already provided in my answer to your question \"TLSv2 with JDk8 Ciphersuites with MQ8?regarding MQ8 + Oracle-JDK8 will apply to this question.Per a presentation given by Mark Taylor \"What\u2019s new in IBM MQ?\", the GA release of MQ v9.0.0.0 was based on MQ v8.0.0.4 plus functional changes.\u2013 Plus functional changes on top of MQ 8.0.0.4\u2026APARIV66840shows the fix is targeted for delivery in 8.0.0.2.Based on this v9.0.0.0 would have this APAR included with the same Oracle mapping available in v8.0.0.2 and higher.For information on FIPS please refer to the IBM MQ v9.0 Knowledge Center page \"Federal Information Processing Standards (FIPS).In general this caused MQ to disable weak cipherspecs.In relation to Java, the settings like sslFipsRequired would cause MQ to use TLS in preference to SSL for Cipersuites that had a dual mapping, but as of any recent version of MQ any of those Ciphersuites that had dual mapping have been disabled by default as weak Ciphersuits.IBM developerWorks blog post \"MQ Java, TLS Ciphers, Non-IBM JREs & APARs IT06775, IV66840, IT09423, IT10837 -- HELP ME PLEASE!\" has details on how the sslFipsRequired and preferTLS behavior has changed over recent APARs.\n"} +{"text": "### Human: We are moving IBM Websphere MQ to a different server(VB6 app will be in different server).\nI need to populate SET Server field.\nI am using MQAX200.DLL to connect to MQ.Please let me know how can i connect to different server from vb6.Below is the code we are currently using to connect to Queue Manager:Form1.txtstreamLog_File.WriteLine Date & \" \" & Time & \" STATUS: Attempting to connect to the MQ Queue Manager: \" & Form1.strManagerQueueName\nSet mconMQ = New MQAX200.MQQueueManager\nWith mconMQ\n\n 'Set the Name of the Queue Manager (or allow to default)\n .Name = Form1.strManagerQueueName\n\n 'Connect to Queue Manager\n .Connect\n\n 'Get Connect Method Results & Display\n mlngConnectionHandle = .ConnectionHandle\n\n 'Check Completion Code\n If .CompletionCode <> MQCC_OK Then\n Form1.txtstreamLog_File.WriteLine Date & \" \" & Time & \" ERROR: Failed to connect to Queue Manager: \" & Form1.strManagerQueueName & vbCr & _\n \"Reason Code: \" & .ReasonCode & vbCr & _\n \"Reason Text: \" & .ReasonName\n ConnectQueueManager = False\n Exit Function\n End If\nEnd With 'mconMQ\n\nForm1.txtstreamLog_File.WriteLine Date & \" \" & Time & \" STATUS: Connected to the Queue Manager successfully\"\nConnectQueueManager = True\nExit Function### Assistant: MQAX200.DLLis the dll used for IBM MQs depricated Microsoft ActiveX and VB6 connectivity. IBM MQ Classes for .NET are the recommended replacement technology.Everything I found indicates you can only use the MQSERVER environment variable to provide connection details for a single queue manager or use a MQ Channel Table pointed to by the the MQCHLLIB/MQCHLTAB environment variables if you need to connect to multiple queue managers.It has been documented in all recent versions of the Knowledge center (v7.0.1 is the oldest I could find) that MQAX (MQ ActiveX) support was stabilized at the IBM WebSphere\u00ae MQ Version 6.0 level:\nMQ v7.0.1 Knowledge Center Page \"Coding in ActiveX\":Support for ActiveX has been stabilized at the WebSphere\u00ae MQ Version 6.0 level. To exploit features introduced to WebSphere MQ later than Version 6.0, consider using .NET instead.MQ v9.0 Knowledge Center Page \"Object-oriented applications\":ActiveXThe IBM MQ ActiveX is commonly known as the MQAX. The MQAX is included as part of IBM MQ for Windows. Support for ActiveX has been stabilized at the IBM WebSphere\u00ae MQ Version 6.0 level. To exploit features introduced to IBM MQ later than Version 6.0, consider using .NET instead. Refer to Using the Component Object Model Interface (WebSphere MQ Automation Classes for ActiveX) for information about coding programs using the IBM MQ Object Model in ActiveX.In addition IBM in the \"IBM MQ V9.0 Software Announcement\" has stated:Function that is removed in IBM MQ V9.0IBM MQ support for Microsoft ActiveX and VB6IBM MQ support for Microsoft ActiveX and VB6 isdeprecated. IBM MQ Classes for .NET are the recommended replacement technology.In summary the interface you are using has been stabilized and has not been enhanced since IBM MQ v6.0 released in June 2005 and has only had defect fixes. In v9.0 it has been deprecated which indicates that IBM will remove it from a future release of the product.Note that you also can not use TLS encryption or pass a username and password to MQ using the Microsoft ActiveX libraries and would be limited in ways to secure your SVRCONN channel from unauthorized connections.I would suggest that you convert to the .NET libraries. The samples are found under the MQ installation directory intools\\dotnet\\samples.UPDATE 2017/04/17IBM MQ v9 Knowledge center page \"Deprecated, stabilized and removed features\" has now been updated to also reflect that IBM MQ support for Microsoft ActiveX and VB6 isdeprecated.Deprecation of IBM MQ support for MicrosoftActive X and Microsoft Visual Basic 6.0IBM MQ support for MicrosoftActive X and\n Microsoft Visual Basic 6.0 is deprecated. IBM MQ classes for .NET are\n the recommended replacement technology. SeeUsing the Component\n Object Model Interface (IBM MQ Automation Classes for\n ActiveX)andCoding in Visual\n Basic.\n"} +{"text": "### Human: Using PyMQI, which is fine on IBM MQ Single instance queues, but does anyone know if I can pass dual IP Addresses and Ports on the connection string and if the MQ CLient under the hood handles the IBM MW Multi Instance queue management ?### Assistant: PyMQI sits on top of the underlying MQ libraries. If you are using it with MQ v7.0 or higher then you can specify multiple connection names that are separated by a comma. It will then try each one in order and loop back to the first one if it can not connect to any of them. Some settings related to how long it will retry and how often can be set in the mqclient.ini.The IBM Knowledge center page \"Automatic client reconnection\" has good general information on the reconnect options. All of it related to the C/C++ clients applies to PyMQI.\n"} +{"text": "### Human: I think I described almost everything I need in title. So there is some WMB flows. And one wait for the answer in queue. I need to throw exception if there will be no message in queue after timeout.Thank you for your time### Assistant: Yes it is possibe, but you will need to develop it in your flows. MQ is made for asyncronous communication, so a timeout is not something which is native to it. I can think of 2 possible solutions now:Use the TimeoutControl and TimeoutNotification nodes in your flowsIn the flow which sends the request, after sending the request you add a TimeoutControl node and set up the desired timeout.\nCreate a new flow, which starts with the TimeoutNotification flow. In that flow you send your timeout error if the response has not yet been received.\nAnd to know which response has been received you can use different methods, for example the flows sending the request and receiving the response could maintain a database table, or you could store this information in a queue as well.Start waiting for the response after sending the requestSet up the response handler flow to start with an MQ Input followed by an MQ Get node. You listen for the response with the MQ Get, on which you can set a wait interval, that will be your timeout threshold. The MQ Input gets technical messages sent by the request sender flow after sending the request.\nThis is a worse solution then the first, as you will block a message flow thread while listening for the response.Or you can just make 1 flow to send the request and receive the response, receiving the response with an MQ Get node.\nThis is even worse as you will need to turn off transactionality for the MQ Output sending the request.\n"} +{"text": "### Human: I am able to send messages to ActiveMQ using SOAPUI groovy script.I followed the configuration from the linkhttps://www.soapui.org/documentation/jms/config.html&https://www.soapui.org/jms/working-with-jms-messages.htmlI could send message to Apache ActivMQ.Now I want to use IBM MQ instead of ActivMQ.1) Could you please let me know what are the changes with respect to configuration that I need to make for IBM MQ?2) The working Groovy script for ActiveMQ will work with IBM MQ as well? Or i need to modify Groovy Script?3) Could you please provide me link for sending JMS message to IBMMQ using SOAPUI?Thanks in advance.### Assistant: THis may not directly answer your questions, but depending of your use case, you could checkJMSToolBox. It's a tool that allows to automate putting message to Q Managers including IBM MQ and Apache Active MQ\n"} +{"text": "### Human: Can someone please help me with a command to find the list of queues a particular user\\group has in MQ?### Assistant: The dspmqaut command is used to display authorizations but you can't display a user group and find all the queues that way. \nTry using the dmpmqaut command which will dump all authorities to a file and you can then see the queues and which groups have access.https://www.ibm.com/support/knowledgecenter/SSFKSJ_7.1.0/com.ibm.mq.doc/fa15670_.htmUsing dmpmqaut with the -g GroupName parameter should give you the information you need. For example: dmpmqaut -m QMGRNAME -g groupname\n"} +{"text": "### Human: I am trying to run some load tests on jmeter by connecting to IBM MQ. It works fine except for a particular message which get a close to 5 MB response.So, here's the setup, I push a message from jmeter to a request queue on IBM MQ. My was app picks it up and sends a response to the response queue where the JMETER picks it up. This setup works fine, till i send a particular message whose response is close to5MB.The jmeter simply doesn't pick this response and that in turn holds up all the other messages on the response queue. \nI think thedefaultrecieve size for jmeter is4MB, but can i change it for MQ response in jmeter properties somewhere. \nI tried by making changes touser.propertiesandjmeter.propertiesin jmeter bin directory but nothing worked.### Assistant: The exception thrown is related to MQJMS. So check the linked exception for MQ reason code returned. If you are connecting to queue manager using a client mode connection, then check the MAXMSGL attribute of the Server Connection channel you are using. By default the MAXMSGL is set to 4 MB. You will need to increase the attribute value to larger messages.\n"} +{"text": "### Human: This code with amqmdnet.dll (version 8.0.0.5) works just fine (Server set SSLCAUTH to Required so certificate label setting is a must):public MQQueueManager GetWmqQueueManager(MqConfig config)\n {\n var props = new Hashtable\n {\n {MQC.HOST_NAME_PROPERTY , config.HostName},\n {MQC.PORT_PROPERTY , config.Port},\n {MQC.CHANNEL_PROPERTY , config.ChannelName},\n {MQC.SSL_CIPHER_SPEC_PROPERTY , config.SslCipherSpec},\n {MQC.SSL_PEER_NAME_PROPERTY , config.SslPeerName},\n {MQC.SSL_CERT_STORE_PROPERTY , config.SslPath},\n {MQC.SSL_CIPHER_SUITE_PROPERTY, config.SslCipherSuit}\n };\n\n MQEnvironment.CertificateLabel = config.CertLable;\n\n var queueManager = new MQQueueManager(config.QueueManagerName, props);\n return queueManager;\n }Not I want to use IBM.XML.dll (version 8.0.0.5) and this code throws \"MQRC_SSL_INITIALIZATION_ERROR\" exception with error code AMQ9642 (found in error logs):protected static IConnection GetXmsConnection(MqConfig config)\n {\n var factoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\n\n var cf = factoryFactory.CreateConnectionFactory();\n\n cf.SetStringProperty(XMSC.WMQ_HOST_NAME , config.HostName);\n cf.SetIntProperty (XMSC.WMQ_PORT , config.Port);\n cf.SetStringProperty(XMSC.WMQ_CHANNEL , config.ChannelName);\n cf.SetStringProperty(XMSC.WMQ_SSL_CIPHER_SPEC , config.SslCipherSpec);\n cf.SetStringProperty(XMSC.WMQ_SSL_PEER_NAME , config.SslPeerName);\n cf.SetStringProperty(XMSC.WMQ_SSL_KEY_REPOSITORY , config.SslPath);\n cf.SetStringProperty(XMSC.WMQ_SSL_CIPHER_SUITE , config.SslCipherSuit);\n\n cf.SetStringProperty(XMSC.WMQ_SSL_CLIENT_CERT_LABEL, config.CertLable);\n\n cf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER , config.QueueManagerName);\n cf.SetIntProperty (XMSC.WMQ_CONNECTION_MODE , XMSC.WMQ_CM_CLIENT_UNMANAGED);\n\n var con = cf.CreateConnection(); // <-- exception\n\n return con;\n }AMQ9642 says:SSLCAUTH(REQUIRED) has been specified on the server side (RCVR)\n channel definition requiring that the client (SDR) supplies a valid\n certificate.StackTrace:IBM.XMS.Client.WMQ.Factories.WmqConnectionFactory.CreateProviderConnection(XmsPropertyContext connectionProps)\n in IBM.XMS.Client.Impl.XmsConnectionFactoryImpl.CreateConnection(String userID, String password)\n in IBM.XMS.Client.Impl.XmsConnectionFactoryImpl.CreateConnection()Exception details:ErrorCode: CWSMQ0006\nCompCode : 2\nReason : 2393Question is what is wrong with second piece of code?\nAm I missing something?EDIT1:\nI'm using WebSphereMQ 8.0.0.5 and XMS is also 8.0.0.5### Assistant: This is the snippet I used. Note I passing user id and password to createConnection call because I have user authentication enabled. Without them, I would get MQRC 2035 error.fact = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\n conf = fact.CreateConnectionFactory();\n\n conf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT_UNMANAGED);\n conf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, \"QM1\");\n conf.SetStringProperty(XMSC.WMQ_HOST_NAME, \"localhost\");\n conf.SetIntProperty(XMSC.WMQ_PORT, 1414);\n conf.SetStringProperty(XMSC.WMQ_CHANNEL, \"NET.SVRCONN\");\n conf.SetStringProperty(XMSC.WMQ_SSL_KEY_REPOSITORY, \"C:\\\\ProgramData\\\\IBM\\\\MQ\\\\qmgrs\\\\QM1\\\\ssl\\\\CLIENT\");\n conf.SetStringProperty(XMSC.WMQ_SSL_CIPHER_SPEC, \"TLS_RSA_WITH_AES_128_CBC_SHA\");\n conf.SetStringProperty(XMSC.WMQ_SSL_PEER_NAME, \"CN=QM1,OU=QMHOST,OU=LAB,OU=PAS,O=COM,L=BLR,ST=KA,C=IN\");\n conf.SetStringProperty(XMSC.WMQ_SSL_CLIENT_CERT_LABEL, \"ibmwebspheremqsamantha\");\n\n mqConn = conf.CreateConnection(\"samantha\",\"Passw0ord\");\n"} +{"text": "### Human: I have an application that's work as a jms listener running in WildFly 10.1.0. I have configured the resource adapter following thisred hat reference.The application is deployed without errors and everything looks like ok, but the listener don't get any message from the queue. Randomly sometimes some messages is readed from the queue. The same code runs without any problem in tomcat.Here are my resource adapter:\n\n \n \n wmq.jmsra.rar\n \n NoTransaction\n \n \n \n SYSTEM.DEF.SVRCONN\n \n \n 172.16.41.76\n \n \n CLIENT\n \n \n QM.DEV.01\n \n \n 1415\n \n \n \n \n \n \n \n \n \n QUEUE.TEST.IN\n \n \n QM.DEV.01\n \n \n \n \n QUEUE.TEST.OUT\n \n \n QM.DEV.01\n \n \n \n \nHere is how my connection factory is retrieved:@Bean(name = \"jmsConnectionFactory\")\npublic ConnectionFactory connectionFactory() throws NamingException {\n Context ctx = new InitialContext();\n ConnectionFactory jmsConnectionFactory = (ConnectionFactory) ctx.lookup(\"java:jboss/jms/jmsConnectionFactory\");\n\n LoggerUtils.logDebug(this.getClass(), \"Looking up jms connection factory reference: '{}' -> '{}'\", getAppConfigJms().getConnectionFactoryName(), jmsConnectionFactory);\n return jmsConnectionFactory;\n}Here is how my queues are retrieved:public Queue queueLookup(String queueName) throws NamingException, JMSException {\n Context ctx = new InitialContext();\n Queue queue = (Queue) ctx.lookup(queueName);\n\n LoggerUtils.logDebug(this.getClass(), \"Looking up jms queue: '{}' -> '{}'\", queueName, queue.getQueueName());\n return queue;\n}Here is how my listener is created:public DefaultMessageListenerContainer configureListener(ConnectionFactory connectionFactory,\n Queue destinationQueue, MessageListener messageListener) throws JMSException {\n\n LoggerUtils.logDebug(this.getClass(), \"Starting jms listener '{}' for queue: '{}'\", messageListener, (destinationQueue != null ? destinationQueue.getQueueName() : null));\n\n DefaultMessageListenerContainer listenerContainer = new DefaultMessageListenerContainer();\n listenerContainer.setConnectionFactory(connectionFactory);\n listenerContainer.setDestinationName(destinationQueue.getQueueName());\n listenerContainer.setMessageListener(messageListener);\n listenerContainer.setConcurrentConsumers(getAppConfigJms().getConcurrentConsumers().intValue());\n listenerContainer.setMaxConcurrentConsumers(getAppConfigJms().getMaxConcurrentConsumers().intValue());\n return listenerContainer;\n}Has anyone had the same problem before?\nHow can I do a test in my connection factory inside WildFly?### Assistant: So, my problem was solved. Something was wrong in the Queue Manager and Queue names. After check and fix all the names everything is going well now.Here is my fixed resource adapter:\n\n \n \n wmq.jmsra.rar\n \n NoTransaction\n \n \n \n 172.16.41.76\n \n \n CLIENT\n \n \n QM.DEV.01\n \n \n 1415\n \n \n \n \n \n false\n \n \n \n \n \n \n QUEUE.TEST.IN\n \n \n QM.DEV.01\n \n \n \n \n QUEUE.TEST.OUT\n \n \n QM.DEV.01\n \n \n \n \n\n"} +{"text": "### Human: Getting the below error message when starting the secondary node and The primary node of the queue manager is always starting as Running as standby\nI want to primary node of my queue manager should show the status as Running\nAMQ7274 WebSphere MQ queue manager already has the maximum number of standby instances.### Assistant: Assuming no queue manager is running on the primary and secondary nodes then I suspect a problem is likely with the locking(lock conflict) in the file system. If any MQ process is running on the primary and secondary nodes, then kill the processes and then try starting the queue manager again. If the problem still persists, I suggest a file system repair on the server and then unmounting and mounting the file system on the client node. A workaround for the problem would be to delete the files(master, active and standby) and then restart the queue manager. If the problem is only with the lock files then the workaround would be helpful. If there is any other file system issue in the queue manager files, then only a file system repair can resolve the issue. I also suggest checking the status using the command given below before attempting any recovery.dspmq -x -m -o all\n"} +{"text": "### Human: I get the following exception when I am injecting messages into queue, which happens everytime when I inject the 512th message, the previous 511 are injected fine:Exception in thread \"main\" javax.jms.ResourceAllocationException: MQJMS2008: failed to open MQ queue 'xxxx.xx.xxxxx.xxxx'.\nat com.ibm.msg.client.wmq.v6.jms.internal.MQQueueServices.getQueueOpenException(MQQueueServices.java:907)\nat com.ibm.msg.client.wmq.v6.jms.internal.MQQueueServices.getOutputQueue(MQQueueServices.java:726)\nat com.ibm.msg.client.wmq.v6.jms.internal.JMSServicesMgr.getOutputQueue(JMSServicesMgr.java:210)\nat com.ibm.msg.client.wmq.v6.jms.internal.MQSession.createQProducer(MQSession.java:3173)\nat com.ibm.msg.client.wmq.v6.jms.internal.MQSession.createProducer(MQSession.java:2896)\nat com.ibm.msg.client.wmq.v6.jms.internal.MQSession.createProducer(MQSession.java:2953)\nat com.ibm.msg.client.jms.internal.JmsSessionImpl.createProducer(JmsSessionImpl.java:1302)\nat com.ibm.msg.client.jms.internal.JmsQueueSessionImpl.createSender(JmsQueueSessionImpl.java:131)\nat com.ibm.mq.jms.MQQueueSession.createSender(MQQueueSession.java:148)\nat com.ibm.mq.jms.MQQueueSession.createProducer(MQQueueSession.java:249)\nat com.connect.MQAction.injectMessage(MQAction.java:45)\nat pricecheck.Main.main(Main.java:73)What is the reason for this error?I am using the following method to inject a message everytime:public void injectMessage(String content) throws JMSException, IOException {\n MessageProducer producer = queueSession.createProducer(queue);\n Message msg = queueSession.createTextMessage(content);\n producer.send(msg);\n}Is it due to me creating a MessageProducer everytime?### Assistant: To know for sure we need the 'cause by' linked exception. But you're more than likely hitting some sort of resource limit as you have amajorresource leak in that you create a MessageProducer each time the function is invoked, but never close it!Add 'producer.close()' to the end of the function, preferably in a finally block, or even better create the producer once and simply use it each time the function is invoked. Creating a MessageProducer is an expensive operation so do it as little as possible to get the best performance possible.\n"} +{"text": "### Human: Please find the below code:MQEnvironment.Hostname = HostName;\n MQEnvironment.Channel = Channel;\n\n if (!string.IsNullOrEmpty(SSLKeyRepository))\n {\n MQEnvironment.SSLCipherSpec = SSLCipherSpec;\n MQEnvironment.SSLKeyRepository = SSLKeyRepository;\n }\n if (Port > 0)\n MQEnvironment.Port = Port;\n\n try\n {\n MQManager = new MQQueueManager(QueueManager);\n try\n {\n MQRequestQueue = MQManager.AccessQueue(QueueNameGet, MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING);\n MQResponseQueue = MQManager.AccessQueue(QueueNameGet, MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING); \n return true;\n }\n catch (IBM.WMQ.MQException exIBM)\n {\n CloseConnection();\n ErrorCode = exIBM.Reason;\n ErrorDescription = exIBM.Message;\n }\n }\n catch (IBM.WMQ.MQException exIBM)\n {\n CloseConnection();\n ErrorCode = exIBM.Reason;\n ErrorDescription = exIBM.Message;\n }\n catch (Exception ex)\n {\n CloseConnection();\n ErrorCode = Constants.SYSTEMEXCEPTION;\n ErrorDescription = ex.Message;\n }\n return false;Issue: I am not getting the issue when I run it for single or 2-3 times. But I get the issue when it runs in a loop for multiple times.\nAlso, I have tried to run the same piece of code for 10,000 times from the IIS server and it ran successfully.I am getting the issue only when I have this code on IIS webservice and that webservice is getting called multiple times.IBM MQ client 7.5.0.0 installed on the IIS server and I am using the dll of the same version.UPDATEError description:Error Message The handle is invalidStackTrace at System.Diagnostics.NtProcessManager.GetModuleInfos(Int32 processId, Boolean firstModuleOnly) at System.Diagnostics.Process.get_Modules() at IBM.WMQ.CommonServices.TraceEnvironment() at IBM.WMQ.CommonServices.CreateCommonServices() at IBM.WMQ.CommonServices.TraceEnabled() at IBM.WMQ.MQBase..ctor() at IBM.WMQ.MQManagedObject..ctor()### Assistant: Thanks for providing the call stack. The issue you mention is very similar to the one fixedherein MQ version 7.5.0.2. As you are at MQ v7.5.0.0, I suggest you to upgrade your MQ client to the latest level, MQ v7.5.0.7 and try.\n"} +{"text": "### Human: I have installed WebSphere MQ in my laptop and able to create MQ objects through MQ explorer.\nWhen go to command prompt and run the crtmqm from MQ home/bin . I encountered \" you are not authorised to perform this operation \"\n- I did installed MQ with my login and same login used to create MQ also.\n- tried changing run--> services.msc and modify MQ installation permissions but no luck.### Assistant: MQ CLI commands can be run by the members of the mqm group, and by the members of Administrators.\nIf your user account isn't a member of mqm, then you will need to start cmd with the option Run as Administrator.\n"} +{"text": "### Human: Hi I have a IBM MQ server 7.0.1 installed on one centralized machine. The requirement is to connect many weblogic instances to this. The weblogic version is 12.1.3.Is this possible or not. If yes how can do this configuration and in which file. I can specify only one PROVIDER_URL in JMSAdmin.config file.### Assistant: First, MQ 7.0.1 is now very old and not supported by IBM. If you're making a new deployment I recommend deploying on one of the later still supported release (7.1, 7.5, 8, or 9).MQ queue managers are capable of handling many thousands of clients, so this isn't a problem. The JMSAdmin configuration is deployed to each of the Weblogic servers, and it describes how to connect to the queue manager. You might decide to deploy the same JMSAdmin config to all of the Weblogic servers, as they could all connect to the same queue manager via the same channel.Does that make sense?\n"} +{"text": "### Human: Server OS: LinuxIBM Websphere MQ 8.0Java 8I am trying to create a java program that is on the same server as the IBM MQ. Trying to use binding mode and it's throwing me error.2016-10-05 13:20:54 ERROR LogReader:181 - JMS ERROR: JMSFMQ6312: An exception occurred in the Java(tm) MQI.\ncom.ibm.msg.client.jms.DetailedJMSException: JMSFMQ6312: An exception occurred in the Java(tm) MQI.\nThe Java(tm) MQI has thrown an exception describing the problem. \nSee the linked exception for further information.\n at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\n at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)\n at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\n at java.lang.reflect.Constructor.newInstance(Constructor.java:423)\n at com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:319)\n at com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:226)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:8445)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:7814)\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl._createConnection(JmsConnectionFactoryImpl.java:299)\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:236)\n at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6024)\n at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:136)\n at com.ibm.mq.jms.MQQueueConnectionFactory.createConnection(MQQueueConnectionFactory.java:209)\n at com.timeinc.rde.mq.LogReader.run(LogReader.java:79)\n at java.lang.Thread.run(Thread.java:745)\nCaused by: com.ibm.mq.jmqi.local.LocalMQ$4: CC=2;RC=2495;AMQ8598: Failed to load the WebSphere MQ native JNI library: 'mqjbnd'.\n at com.ibm.mq.jmqi.local.LocalMQ.loadLib(LocalMQ.java:1268)\n at com.ibm.mq.jmqi.local.LocalMQ$1.run(LocalMQ.java:309)\n at java.security.AccessController.doPrivileged(Native Method)\n at com.ibm.mq.jmqi.local.LocalMQ.initialise_inner(LocalMQ.java:259)\n at com.ibm.mq.jmqi.local.LocalMQ.initialise(LocalMQ.java:221)\n at com.ibm.mq.jmqi.local.LocalMQ.(LocalMQ.java:1350)\n at com.ibm.mq.jmqi.local.LocalServer.(LocalServer.java:230)\n at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\n at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)\n at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\n at java.lang.reflect.Constructor.newInstance(Constructor.java:423)\n at com.ibm.mq.jmqi.JmqiEnvironment.getInstance(JmqiEnvironment.java:706)\n at com.ibm.mq.jmqi.JmqiEnvironment.getMQI(JmqiEnvironment.java:640)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:8437)\n ... 8 more\nCaused by: java.lang.UnsatisfiedLinkError: no mqjbnd in java.library.path\n at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)\n at java.lang.Runtime.loadLibrary0(Runtime.java:870)\n at java.lang.System.loadLibrary(System.java:1122)\n at com.ibm.mq.jmqi.local.LocalMQ.loadLib(LocalMQ.java:1240)\n ... 21 moreI have set the environment variable using setmqenv. I was reading the JDNI set up but it seems like it's mostly for an application server(JavaEE) where it points to the mqjbnd library. All other tutor I ran across turn off security and connect via tcp.### Assistant: The problem here is that the MQ Java Native Interface (JNI) libraries that are required in order to establish BINDINGS transport mode connections are not available on the Java library path. See here in the KC:https://www.ibm.com/support/knowledgecenter/SSFKSJ_7.1.0/com.ibm.mq.doc/jm10340_.htmSo, try start your application with the Java system property:-Djava.library.path=MQ_INSTALL_DIR/java/libfor 32-bit JVMs or:-Djava.library.path=MQ_INSTALL_DIR/java/lib64if using a 64-bit JVM.This will resolve the exception, \"java.lang.UnsatisfiedLinkError: no mqjbnd in java.library.path\".\n"} +{"text": "### Human: When creating MQQueueManager object with following sslCipherSuite:MQEnvironment.sslCipherSuite = \"TLS_RSA_WITH_AES_128_CBC_SHA\";\nMQEnvironment.hostname = host;\nMQEnvironment.channel = channel;\nMQEnvironment.port = port;\niMQQueueManager = new MQQueueManager(queueMgr);it manager init raises:MQJE001: Completion Code '2', Reason '2400'which should means \" JSSE reported that it does not support the CipherSuite specified by the application\" (http://www.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.tro.doc/q044280_.htm)I've configured my Queue Manager -> Channels (Properties) -> SSL -> CipherSpec to: TLS_RSA_WITH_AES_128_CBC_SHA (TLS 1.0, Secure Hash Algorithm, 128-bit AES encryption).used platform is:JAVA 7 (1.7.0_75-b13) \nMQ 7.1 client libs (7.1.0.6-k710-006-141112)\nMQ 8.0 server (8.0.0.5)here is the stack detail:Exception in thread \"main\" com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2400'.\n at com.ibm.mq.MQManagedConnectionJ11.constructMQCD(MQManagedConnectionJ11.java:1434)\n at com.ibm.mq.MQManagedConnectionJ11.constructCNO(MQManagedConnectionJ11.java:1537)\n at com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:233)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnection(MQClientManagedConnectionFactoryJ11.java:588)\n at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnection(MQClientManagedConnectionFactoryJ11.java:630)\n at com.ibm.mq.StoredManagedConnection.(StoredManagedConnection.java:107)\n at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:205)\n at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:911)\n at com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:799)\n at com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:750)\n at com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:157)\n at com.ibm.mq.MQQueueManager.(MQQueueManager.java:681)I guess the issue is on MQ configuration side, due the fact that my jreSSLContext.getInstance(\"TLS\")\n.init(null, trustAllCerts, new SecureRandom())\n.getSupportedSSLParameters()\n.getCipherSuites()returns \"TLS_RSA_WITH_AES_128_CBC_SHA\" as one of CipherSuites. But I'm not sure what's exactly wrong on QMgr configuration. Thanks for any hints.### Assistant: You should read the following 2 IBM MQ bulletins:http://www-01.ibm.com/support/docview.wss?uid=swg21688165http://www-01.ibm.com/support/docview.wss?uid=swg21688165\n"} +{"text": "### Human: On the receiver side, I need to know how long the message stayed in the queue before I got it for processing.I'm using Java and JMS.### Assistant: Upon further searching, I found a post in this forum with a similar discussion:http://www.mqseries.net/phpBB2/viewtopic.php?t=71092&sid=97f90533407247be7150d81d550538a1It's a convoluted solution but it appears to be the only way to know when a certain incoming message was effectively received.It involves setting up an exit program that process outgoing messages, and if it is a COA, save the current timestamp (with messageId/correlationId) somewhere for later processing.But the big question is: why don't IBM implemented an \"arrival timestamp\" property in the first place? It looks a trivial thing to do...\n"} +{"text": "### Human: AppConfig.xml settings:\n\n\n\n\n \n\n\n\n \n \nI get the following errors:Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED').\n[9/26/16 13:13:35:758 CST] 000000aa SystemErr R at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:204)\n[9/26/16 13:13:35:758 CST] 000000aa SystemErr R ... 98 more\n\n\n\nCause: JMSWMQ2013: The security authentication was not valid that was supplied for QueueManager 'ABC_DEV' with connection mode 'Client' and host name 'abchost.com(1414)'.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED')What I like to find out is, is there problem in the codes or in some setting in Websphere MQ we need to configure? I wanna make sure this is not a fault in the program before I raise the problem to our Websphere MQ administrator (who by the way is just new to Websphere MQ)We are using:Websphere MQ version 9Spring JMS Version 4.2.4.RELEASEI used MQ Client to connect to MQ, and I was able to connect (via command line):C:\\Users\\me>set MQSERVER=CH.ABC_DEV/TCP/abchost.com(1414)\n\nC:\\Users\\me>set MQSAMP_USER_ID=someuser\n\nC:\\Users\\me>c:\\IBM\\MQ\\Tools\\c\\Samples\\Bin\\amqsbcgc.exe abc.queue.abc ABC_DEV\n\nEnter password: p@ssword\n\n\n\n--connected!but why cant the same user work when connecting through WAS?### Assistant: My application was also not able to connect to MQ although I provided the correct credentials. Enabling the authentication compatibility mode solved the issue.See also:IBM MQ Connection authenticationIf you are usingmq-jms-spring-boot-starteryou can add this in application.properties:ibm.mq.userAuthenticationMQCP=falseInternally this will apply this to the connection factory:cf.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, false);\n"} +{"text": "### Human: As part of new development, we are integrating with external system, which is still in the development phase. In order to test our own code, how can we stub External system response so we don't end up in surprise when the actual Integration starts? We have the agreed mapping formats.Any thoughts around the Best Practices would be great.Message Type : XMLCommunication : IBM MQ### Assistant: Assuming your mq transport will consist of you sending requests on one queue and receiving responses on another, you simply create an external process that consumes from your request queue, approximates a response and sends a response back on the response queue.\n"} +{"text": "### Human: Is it possible to use java messaging with mixed implementations.E.g.: Is it possible to connect an ActiveMQ clientdirectlyto an MQSeries(IBM) server to read/write messages from/to the message queue?### Assistant: JMS is an API specification, not a wire format specification. JMS describes the signature of APIs. It does not say how the internals should be implemented. Hence JMS client library implementations are Messaging Provider specific.A IBM MQ JMS Client knows how (i.e wire format) to communicate with IBM MQ. Similarly Active MQ JMS client knows how to speak to Active MQ JMS provider. Since the implementations are different, Active MQ JMS Client will not be communicate with IBM MQ.\n"} +{"text": "### Human: We have a C++ application connecting as client to WebSphere MQ using configurable queue manager and queue name. We have been asked to migrate to SSL channels for security reasons. So far we have taken care of configuring Sender and Receiver channels to use SSL.Do we need to move the SVRCONN channels as well to use SSL?If yes, how do we provide key-store details in code to connect to channel?I could not find any option in MQOPEN API to provide.### Assistant: I could not find any option in MQOPEN API to provide.Its not in MQOPEN but rather MQCONNX API call. It is far better to use a CCDT (Client Channel Definition Table) file because then your code just needs to issue an MQCONN API call.\n"} +{"text": "### Human: Is there a way to use the asterisk (*) syntax to subscribe to all the topics that are reports ?For example: \"MyData\\version1.0\\Reports\\(*)\"p.s : I'm using xms.class MyXmsApp\n{\n static void Main(string[] args)\n {\n MyXmsApp app = new MyXmsApp();\n app.Setup();\n Console.ReadLine();\n }\n\n public void Setup()\n {\n XMSFactoryFactory xff = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\n IConnectionFactory cf = xff.CreateConnectionFactory();\n cf.SetStringProperty(XMSC.WMQ_HOST_NAME, \"localhost\");\n cf.SetIntProperty(XMSC.WMQ_PORT, 1414);\n cf.SetStringProperty(XMSC.WMQ_CHANNEL, \"CLIENT\");\n cf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);\n cf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, \"QM_LOCAL\");\n cf.SetIntProperty(XMSC.WMQ_BROKER_VERSION, XMSC.WMQ_BROKER_V1);\n\n IConnection conn = cf.CreateConnection();\n Console.WriteLine(\"connection created\");\n ISession sess = conn.CreateSession(false, AcknowledgeMode.AutoAcknowledge);\n IDestination dest = sess.CreateQueue(\"queue://q\");\n IMessageConsumer consumer = sess.CreateConsumer(dest);\n MessageListener ml = new MessageListener(OnMessage);\n consumer.MessageListener = ml;\n conn.Start();\n Console.WriteLine(\"Consumer started\");\n }\n\n private void OnMessage(IMessage msg)\n {\n ITextMessage textMsg = (ITextMessage)msg;\n Console.Write(\"Got a message: \");\n Console.WriteLine(textMsg.Text);\n }\n}### Assistant: The wildcard character you want in MQ pub/sub is '#'. In your example subscribing to the topic string:MyData/version1.0/Reports/#Would subscribe to:MyData/version1.0/Reports/DailyReportMyData/version1.0/Reports/WeeklyReportMyData/version1.0/Reports/MonthlyReportMore information here:https://www.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.pla.doc/q005010_.htm\n"} +{"text": "### Human: I am trying to connect to remote IBM MQ server. But i receive the error Cannot load the library mqjbnd.dll. I am not sure why bindings mode is getting used. A snippet of code used is pasted below. After reading the replies at various including stack overflow found out that client mode should be used for my scenario. But i am unable to configure the client mode. Any help on this will be greatly appreciated// Create a connection to the QueueManager\n System.out.println(\"Connecting to queue manager: \" + qManager);\n MQQueueManager qMgr = new MQQueueManager(qManager);\n\n // Set up the options on the queue we wish to open\n int openOptions = MQConstants.MQOO_INPUT_AS_Q_DEF | MQConstants.MQOO_OUTPUT;\n\n // Now specify the queue that we wish to open and the open options\n System.out.println(\"Accessing queue: \" + qName);\n MQQueue queue = qMgr.accessQueue(qName, openOptions);### Assistant: When you are using client mode , series of properties will need to be set as you are connecting using TCP/IP . This for example will include , host , port and details that are needed for the program to connect to a QM over the network. An indicative example is here.Hashtable mqKeyValueProps = new Hashtable();\nmqKeyValueProps.put(CMQC.HOST_NAME_PROPERTY, hostName);\nmqKeyValueProps.put(CMQC.PORT_PROPERTY, new Integer(portNumber));\nmqKeyValueProps.put(CMQC.CHANNEL_PROPERTY, channelName);\nmqKeyValueProps.put(CMQC.USER_ID_PROPERTY, userID);\nmqKeyValueProps.put(CMQC.PASSWORD_PROPERTY, password);\ntry\n{\n\n MQQueueManager qMgr = new MQQueueManager(qManager,mqKeyValueProps);\n\n int openOptions = MQConstants.MQOO_INPUT_AS_Q_DEF | MQConstants.MQOO_OUTPUT;\n\n // Now specify the queue that we wish to open and the open options\n System.out.println(\"Accessing queue: \" + qName);\n MQQueue queue = qMgr.accessQueue(qName, openOptions);\n}\ncatch (com.ibm.mq.MQException mqex)\n{\n System.out.println(\"MQException cc=\" +mqex.completionCode + \" : rc=\" + mqex.reasonCode);\n}\n"} +{"text": "### Human: I am sending message to Websphere Message Queue, and I need to mark some messages with \"Last Message\" flag (it is default property for Message Queue). I am using IBM.XMS .NET library, but I haven't found ability to set up this property. Has anyone faced with that problem?### Assistant: UseSetBooleanPropertymethod to set \"Last Message\" flag, something likemessage.SetBooleanProperty(\"LastMessage\", true);When receiving messages, check for the same property on the message to identify if it's the \"Last Message\" or not.bool lastMessage = message.getBooleanProperty(\"LastMessage\");\n"} +{"text": "### Human: We have been doing some POCs with RabbitMQ. However there is some debate going on if we need to move away from RabbitMQ to Webshpere MQ.So ignoring the licensing factors purely from a technical standpoint can some one explain how this will work.What is the performance for Webshpere MQ vs Rabbit MQ.What are the integration aspects of Webshpere MQ with Spring framework.Internally Websphere MQ i understand uses MQI, so how does this compare with AMQP.Appreciate any pointers on the above questions.### Assistant: I can't/won't speak to performance, but it shouldn't be too hard for simple PTP and Pub/Sub use cases.RabbitMQ is much more flexible than JMS due to its many exchange types and decoupling of publishers and subscribers due to the rich exchange/binding mechanisms.You can get some of that functionality using message selectors on the consumer side.Spring (main framework) provides a JMS abstraction in the spring-jms jar - seethe Spring Framework documentation.\n"} +{"text": "### Human: I have a LOG Parser program written in java that write all required time stamps on CVS file. When I run it I am getting error message:Exception in thread \"main\" java.lang.NullPointerExceptionat LogParser.getTimeStampForABlock(LogParser.java:98)at LogParser.main(LogParser.java:45)### Assistant: Line 98,resultcan be null, so you need to check for null before this line:return result.substring(result.indexOf(\"[\")+1, result.indexOf(\"]\"));\n"} +{"text": "### Human: I have a piece of vb.net code that reads a message from an MQ queue and writes it to another queue.It does this in a transaction (using New TransactionScope()), so if the write fails the read will be rolled back.The problem is, the Transaction only seems to commit once I close the .net program.Using MQ Explorer, I see the message move, and then it shows \"Uncommitted Messages: Yes\" in the queue status (and the message remains on the new queue), until the .net program closes - at which point the message is read from the queue by another program (IIB).So, it seems to me that theTransactionScopeisn't being disposed; but I can't think why not.Here's the relevant code:WPF calls a command when a button is pressed, which calls the following method (simplified):' MQMessageDetails is just a data-storage class for message data\nFriend Function MoveMessages(messages as IEnumerable(of MQMessageDetails))\n For Each msg in messages\n Try\n Using ts As New TransactionScope()\n success = WriteMessage(msg, \"Q.OUT\")\n success = success and ReadMessage(msg)\n If success Then\n ts.Complete()\n End If\n End Using\n Catch ....\n End Try\n Next\nEnd FunctionAnd Here's what I see in MQ explorer:**Before program start**\nQ.IN - depth 2, no uncommitted messages\nQ.OUT - depth 0, no uncommitted messages\n\n**Move button clicked**\nQ.IN - depth 1, 1 uncommitted message\nQ.OUT - depth 1, 1 uncommitted message\n\n**Program closed**\nQ.IN - depth 1, no uncommitted messages\nQ.OUT - depth 0, no uncommitted messages <- the message was read by another program### Assistant: From a MQSeries perspective, .NET TransactionScope is an externally coordinated transaction. MQ will only participate in an externally coordinated transaction under certain circumstances.e.g. you might find that you need an MQ Commit when testing in a client environment, but not on your production server.For more information look at this:https://www.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.pro.doc/q003570_.htmandhttp://www.mqseries.net/phpBB2/viewtopic.php?t=49148and the IBM red books (however dated) are always a good read:http://www.redbooks.ibm.com/redbooks/pdfs/sg247012.pdf\n"} +{"text": "### Human: I want to create a Java standalone application it should be an .exe and install it in the local machine for connecting via JMS to a client Queue Manager. \nExample: The scenario is like the project should be developed to connect to active \nMQ client queue from the local machine connecting via JMS. If i put a message in the application it should connect to client Queue through QCF in a standalone application without installing in WebSphere server.Is there way to implement or any example that I can take to build this project?### Assistant: You can find a whole bunch of stand-alone JMS/MQ sample applicationsherebut really this not an JMS/MQ question but rather a Java question. You have 3 choices:Executable JAR fileUse a tool that will bundle your JAR files into an 'exe'UseExcelsior JETIf you are looking to protect your code from being decompiled then your only choice is Excelsior JET.Note: The cheap way might be to useProGuardwith option #2.\n"} +{"text": "### Human: IntroductionWe exchange income data with an external party. Each year income tax regulations change and a new message schema has to be implemented. Altogether we now have 8 different schema versions each of which are deployed in a separate 'year income tax' application and this amount increases by 1 each year.Because we pay our hosting company per installed application, we want to decrease the amount of applications installed.All these applications are functionally equal, which means we validate incoming messages, and forward valid messages into a specific MQSeries queue. Each invalid message is routed to a response queue. Each application has it's own 'valid' and 'invalid' message queues.The planOne generic application that processes all 8(+) messages. New schemas must be deployable without application changes or downtime for previous, running 'income year tax' flows.So far...I can receive multiple messages on the same BizTalk receive port (MessageType XmlDocument) and am able to validate these messages dynamically in an orchestration by calling a custom receive pipeline (XML Disassembler + XML Validator). Exceptions as well as valid messages are processed as prescribed. There are no references between the Schemas and the generic application, so schemas can be deployed without need to stop running processes. So far, so good.The orchestration has 1 receive shape, and 2 send shapes (valid, invalid).SSO contains the values for routing the 'valid' and 'invalid' messages to their correct queue. Based on the incoming messagetype SSO is questioned for the correct 'valid' or 'invalid' queuedefinition.The problemI have previously dealt with dynamic FTP, FILE, WCF and SMTP ports, which all worked flawlessly after supplying the adapter with the correct Context Properties. Even MSMQ seems to have a fairly straightforward approach on dynamically setting transport properties.However, I cannot seem to find MQSeries MQMT ContextProperties to set the queuedefinition dynamically.Microsoft does not provide much information onthis, and extensive searches on the internet hasn't provided me with anything useful (examples) either.I tried matchingIBM's docswith Microsoft's, but altogether I am now stuck.### Assistant: I would suggest to use MQSC adapter for IBM MQ integration. It is part of Host Integration Server MSI. It only requires MQ client to be installed on the server Vs MQ Server for Windows installation required by MQSeries adapter.Set the OutboundTransportLocation property in following format mqsc://{channelName}/tcp/{server{({port})/{queuemanager}/{queuename}TransportType = MQSCContext Properties - Schema can be found within assembly MQSeriesEx.MQSPropertySchemaEx with namespace (http://schemas.microsoft.com/BizTalk/2003/mqs-properties).There are only few context properties you would need to set if at all required.Channel_HeartBeatChannel_MaxMessageLengthChannel_UserIdChannel_PasswordConnectionTimeoutIf additional properties are required than use MQSeries.MQSPropertySchema context properties.\n"} +{"text": "### Human: The license cost of IBM's websphere MQ is based on the number and type of the core of the CPU. For e.g. a CPU type would be called 70 PVU. Another core of a different CPU type may be 100 PVU. IBM states a price per PVU. Depending on the PVUs on the machine, the cost is decided.If I have a physical machine with 4 cores and I install WMQ on it, I am charged X. If I create 10 docker containers on the same physical machine and allow each to utilize all 4 cores, will I be charged X or will I be charged 10X?Regards,Yash### Assistant: Happy to confirm that the answer to your query is that you would be charged X - not any multiple of it. The capacity pricing is licensing you for the capacity of the machine and it is then up to you as to how you make the most of that capacity - you can have 1, 5, 10 or more containers, or VMs or anything - and no other MQ licensing is required as you have licensed that machine capacity.\n"} +{"text": "### Human: I am trying to connect to a test instance of a Websphere MQ 7.5 server (on a Windows domain) from a C# application using the full MQ Client install, but I've had no luck. I keep getting the error code2035 MQRC_NOT_AUTHORIZEDfrom the MQ server. Initially I tried the code below:string QueueManagerName = \"myNewQManager\";\nMQEnvironment.Hostname = \"tst-mqsvr\";\nMQEnvironment.Channel = \"test.channel\";\nMQEnvironment.Port = 1414;\nMQEnvironment.UserId = \"domainUser\";\nMQEnvironment.Password = \"********\";\n//set transport properties.\nMQEnvironment.properties[MQC.TRANSPORT_PROPERTY] = MQC.TRANSPORT_MQSERIES_CLIENT;\ntry\n{\n queueManager = new MQQueueManager(QueueManagerName);\n}\ncatch(MQException mqexp)\n{\n //I get the error code 2035\n log.Error(mqexp)\n}changing to this doesn't work either:string QueueManagerName = \"myNewQManager\";\nvar queueProperties = new Hashtable();\nqueueProperties[MQC.TRANSPORT_PROPERTY] = MQC.TRANSPORT_MQSERIES_CLIENT;\nqueueProperties[MQC.HOST_NAME_PROPERTY] = \"tst-mqsvr\";\nqueueProperties[MQC.PORT_PROPERTY] = \"1414\";\nqueueProperties[MQC.CHANNEL_PROPERTY] = \"test.channel\";\nqueueProperties[MQC.USER_ID_PROPERTY] = \"domainUser\";\nqueueProperties[MQC.PASSWORD_PROPERTY] = \"*********\"; \ntry\n{\n queueManager = new MQQueueManager(QueueManagerName, queueProperties);\n}\ncatch(MQException mqexp)\n{\n //I still get the error code 2035\n log.Error(mqexp)\n}This error goes away and I can connect/put/get messages from my queue ifI manually set the MCAUSER on my channel, orI run the application as the domain user who set up the MQ server (using RunAs)However, I will not be able to use either of these two workarounds for the production set up. I am assuming I'm getting the error code 2035 because the MQ client is sending the wrong user-id. I need to be able to override (or at least determine) the flowed userid during server connection. How do I go about this?Edit: I got the errors below in my AMQERR01.log file-------------------------------------------------------------------------------\n7/6/2016 13:06:14 - Process(1380.10) User(MUSR_MQADMIN) Program(amqzlaa0.exe)\n Host(TST-MQSVR) Installation(DefaultInstall)\n VRMF(7.5.0.2) QMgr(MYNEWQMANAGER)\n\nAMQ8075: Authorization failed because the SID for entity 'sinistrian' cannot be\nobtained.\n\nEXPLANATION:\nThe Object Authority Manager was unable to obtain a SID for the specified\nentity. This could be because the local machine is not in the domain to locate\nthe entity, or because the entity does not exist.\nACTION:\nEnsure that the entity is valid, and that all necessary domain controllers are\navailable. This might mean creating the entity on the local machine. \n----- amqzfubn.c : 2273 -------------------------------------------------------\n7/6/2016 13:06:14 - Process(1380.10) User(MUSR_MQADMIN) Program(amqzlaa0.exe)\n Host(TST-MQSVR) Installation(DefaultInstall)\n VRMF(7.5.0.2) QMgr(MYNEWQMANAGER)\n\nAMQ8073: Authorization failed because SID: ((None)) could not be resolved.\n\nEXPLANATION:\nThe Object Authority Manager was unable to resolve the specified SID into\nentity and domain information.\nACTION:\nEnsure that the application provides a SID that is recognized on this system,\nthat all necessary domain controllers are available, and that the security\npolicy is set as you required. \n----- amqzfubn.c : 4397 -------------------------------------------------------\n7/6/2016 13:06:14 - Process(3008.3) User(MUSR_MQADMIN) Program(amqrmppa.exe)\n Host(TST-MQSVR) Installation(DefaultInstall)\n VRMF(7.5.0.2) QMgr(MYNEWQMANAGER)\n\nAMQ9557: Queue Manager User ID initialization failed.\n\nEXPLANATION:\nThe call to initialize the User ID failed with CompCode 2 and Reason 2035.\nACTION:\nCorrect the error and try again. \n----- cmqxrsrv.c : 1975 -------------------------------------------------------\n7/6/2016 13:06:14 - Process(3008.3) User(MUSR_MQADMIN) Program(amqrmppa.exe)\n Host(TST-MQSVR) Installation(DefaultInstall)\n VRMF(7.5.0.2) QMgr(MYNEWQMANAGER)\n\nAMQ9999: Channel 'TEST.CHANNEL' to host 'WKS-L450 (192.168.10.23)' ended\nabnormally.\n\nEXPLANATION:\nThe channel program running under process ID 3008(2192) for channel\n'TEST.CHANNEL' ended abnormally. The host name is 'WKS-L450 (192.168.10.23)';\nin some cases the host name cannot be determined and so is shown as '????'.\nACTION:\nLook at previous error messages for the channel program in the error logs to\ndetermine the cause of the failure. Note that this message can be excluded\ncompletely or suppressed by tuning the \"ExcludeMessage\" or \"SuppressMessage\"\nattributes under the \"QMErrorLog\" stanza in qm.ini. Further information can be\nfound in the System Administration Guide.### Assistant: Until version 7.5, MQ client always flows the logged-in UserId and not the UserId specified by the application, to queue manager for authorization. You will need a security exit for this scenario.This changed in MQ v8 where UserId specified by the application is flowed to the queue manager for authorization check. More details here:https://www.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.sec.doc/q113260_.htm\n"} +{"text": "### Human: I am trying to form the correct regex to capture strings out of a multi line log like -AMQ9206: Error sending data to host hic4 (10.254.101.168)(1414).orAMQ9999: Channel 'TO.MQH4' to host 'HIC4(1414)' ended abnormally.multi line log excrepts as follows -06/17/16 22:45:14 - Process(509640.1) User(mqsystem) Program(runmqchl)\n Host(mqah103p) Installation(MQAppliance)\n VRMF(8.0.0.4) QMgr(PRDCDE3A)\n\nAMQ9206: Error sending data to host hic4 (10.254.101.168)(1414).\n\n--------------------------- amqccita.c : 3166 ----------------------------------\n\n06/17/16 22:45:14 - Process(509640.1) User(mqsystem) Program(runmqchl)\n Host(mqah103p) Installation(MQAppliance)\n VRMF(8.0.0.4) QMgr(PRDCDE3A)\n\nAMQ9999: Channel 'TO.MQH4' to host 'HIC4(1414)' ended abnormally.### Assistant: Depending on the programming language, this will be expressed slightly differently, but the main trick is to enablemulti-line modein your regex. This will allow special characters like^and$to match the beginning and end of alineinstead of the beginning and end of the string.Assuming your log always has this general format ofAMQfollowed by 4 numbers, the regex would be something like:/^AMQ\\d{4}: .*$/gmRegex101 Demo\n"} +{"text": "### Human: I was trying to configure jms template to connect to WebSphere MQ. When using Websphere client jar, there are multiple options that were set like MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING etc for Queue's and PUT and GET options like MQC.MQPMO_NEW_MSG_ID , MQC.MQGMO_WAIT, MQC.MQMO_MATCH_CORREL_ID etc.,.,is there way to pass these option to JMS template ?### Assistant: These options are IBM MQ specific, so don't think they can be passed as it is to Spring. But some of these have a JMS equivalent available in Spring template.MQC.MQOO_OUTPUToption means open queue for putting messages and is equivalent to JMScreateProducerAPI.MQC.MQGMO_WAIToption is equivalent toreceive(timeout)MQC.MQMO_MATCH_CORREL_ID- is equivalent to creating a consumer with a selector\"JMSCorrelatoinID=\"\n"} +{"text": "### Human: I want to resend a Message from a Dead Letter Queue. For that, I need to convert the Dead Letter to a BytesMessage (Payload could be a ZIP or a String).What I tried so far:Get RFH2 by MQRFH2 class and seek():mqMessage.seek(0); MQRFH2 rfh2 = new MQRFH2(mqMessage); byte[]\n data = new byte[mqMessage.getDataLength()];\n mqMessage.readFully(data); System.out.println(\"Message data: \"\n +new String(data));.Get RFH2 by MQHeaderlist:MQHeaderList list = new MQHeaderList (mqMessage, true); // Step 1.\n MQDLH dlh = (MQDLH) list.get (0); // Step 2.\n int reason = dlh.getReason (); // Step 3.\n list.remove (dlh); // Step 4.\n mqMessage = new MQMessage ();\n list.write (mqMessage, true); // Step 5.\n mqMessage.format = list.getFormat (); // Step 6.\n\n MQHeaderIterator it = new MQHeaderIterator(mqMessage);\n\n while (it.hasNext()) {\n MQHeader header = it.nextHeader();\n\n System.out.println(\"Header type \" + header.type() + \": \" + header);\n }Get RFH2 by MQRFH2 class:MQHeader header = new MQRFH2(mqMessage);\n ByteArrayOutputStream out = new ByteArrayOutputStream();\n header.write(new DataOutputStream(out), CMQC.MQENC_NATIVE,\n CMQC.MQCCSI_DEFAULT); byte[] bytes = out.toByteArray(); String\n sout = new String(bytes); System.out.println(sout);Nothing worked for me: I get errors, like this one:MQJE001: Beendigungscode '2', Ursache '6114'.\nMQJE001: Beendigungscode '2', Ursache '2195'.\nch.coop.mid.hecol.DAEQHandler.exception.ZDAEQException: com.ibm.mq.headers.MQDataException: MQJE001: Beendigungscode '2', Ursache '2195'.\n at ch.coop.mid.hecol.DAEQHandler.bl.impl.ZMQQueueImpl.resendAllLetters(ZMQQueueImpl.java:52)\n at ch.coop.mid.hecol.DAEQHandler.ZStart.main(ZStart.java:20)\nCaused by: com.ibm.mq.headers.MQDataException: MQJE001: Beendigungscode '2', Ursache '2195'.\n at com.ibm.mq.headers.MQDataException.getMQDataException(MQDataException.java:316)\n at com.ibm.mq.headers.internal.Header.read(Header.java:620)\n at com.ibm.mq.headers.MQRFH2.(MQRFH2.java:113)\n at ch.coop.mid.hecol.DAEQHandler.dto.ZMessageDTO.(ZMessageDTO.java:60)\n at ch.coop.mid.hecol.DAEQHandler.bl.impl.ZMQQueueImpl.resendAllLetters(ZMQQueueImpl.java:50)\n ... 1 more\nCaused by: com.ibm.mq.headers.MQDataException: MQJE001: Beendigungscode '2', Ursache '6114'.\n at com.ibm.mq.headers.MQDataException.getMQDataException(MQDataException.java:313)\n at com.ibm.mq.headers.MQRFH2.read(MQRFH2.java:184)\n at com.ibm.mq.headers.internal.Header.read(Header.java:639)\n at com.ibm.mq.headers.internal.Header.read(Header.java:617)\n ... 4 more\nCaused by: java.io.EOFException: MQJE086: Ausnahmebedingung durch Dateiende ('MQMessage.seek()').\n at com.ibm.mq.MQMessage.seek(MQMessage.java:715)\n at com.ibm.mq.headers.internal.store.MQMessageStore.readFrom(MQMessageStore.java:274)\n at com.ibm.mq.headers.internal.Header.read(Header.java:661)\n at com.ibm.mq.headers.MQRFH2.read(MQRFH2.java:181)Is there another way to convert a Dead Letter to a BytesMessage without splitting the whole messages in to little parts an assembling them back together? This way is not very beautiful for my opinion. It's very unstable.EDIT:I can only use the version 7.5.0.0 of the mq libraries in java.### Assistant: What in the world are you doing? You seem like you are attacking the problem backwards. The message layout is MQDLH + MQRFH2 + message data.I'll assume you want to resend the \"MQRFH2 + message data\" to the original destination queue.Here is how your code should look:mqMsg.seek(0);\nMQDLH dlh = new MQDLH(mqMsg);\nSystem.out.println(\"Reason code= \"+dlh.getReason() + \" : Dest. Queue Name=\"+dlh.getDestQName());\n\nbyte[] bData = new byte[mqMsg.getDataLength()];\nmqMsg.readFully(bData);\n\n// Open the original destination queue\nint openOutputOptions = CMQC.MQOO_OUTPUT + CMQC.MQOO_FAIL_IF_QUIESCING;\nMQQueue outQ = _qMgr.accessQueue( dlh.getDestQName().trim(),\n openOutputOptions,\n dlh.getDestQMgrName().trim(),\n null,\n null );\n\n// Create a new message and set the values from DLH\nMQMessage newMsg = new MQMessage();\nnewMsg.characterSet = dlh.getCharacterSet();\nnewMsg.encoding = dlh.getEncoding();\nnewMsg.format = dlh.getFormat();\n\nnewMsg.write(bData); // write the data\n\nMQPutMessageOptions pmo = new MQPutMessageOptions();\npmo.options = CMQC.MQPMO_FAIL_IF_QUIESCING;\n\n// Put the message to the destination queue\noutQ.put(newMsg, pmo);\n\noutQ.close();\n"} +{"text": "### Human: My application is talking to two Websphere MQ systems. One is SSL enabled, the other is not. I am using wmq.jmsra.rar, the resource adapter.I am not able to write/read on both the systems. I am getting \"MQRC_UNSUPPORTED_CIPHER_SUITE\" if I set different values for sslFipsRequired property in resource adapter.Is there a way I can manage this two systems simultaneously using resource adapter?### Assistant: This is a limitation of the FIPS specification. To be FIPS compliant in Java the entire JVM must conform not just the connection you care about. It's for this reason that the non-SSL connection doesn't work.Do you really require FIPS mode, or are you using it to work around another problem?\n"} +{"text": "### Human: I am newer on the IBM websphere mq, when I started to run the server in eclipse. it always has the following error like A feature definition could not be found for mdb-3.2 or wmqjmsclient-2.0Launching defaultServer (WebSphere Application Server 8.5.5.9/wlp-1.0.12.cl50920160227-1523) on Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_77-b03 (en_US)\n[AUDIT ] CWWKE0001I: The server defaultServer has been launched.\n[AUDIT ] CWWKE0100I: This product is licensed for development, and limited production use. The full license terms can be viewed here: https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/license/base_ilan/ilan/8.5.5.9/lafiles/en.html\n[ERROR ] CWWKF0001E: A feature definition could not be found for mdb-3.2\n[ERROR ] CWWKF0001E: A feature definition could not be found for wmqjmsclient-2.0\n[AUDIT ] CWWKZ0058I: Monitoring dropins for applications. \n[err] log4j:WARN No appenders could be found for logger (com.ibm.pong.common.config.Config).\n[err] log4j:WARN Please initialize the log4j system properly.\n[err] log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.I have defined them in the server.xml\n jsp-2.3\n jdbc-4.0\n localConnector-1.0\n distributedMap-1.0\n\n ejbLite-3.2\n distributedMap-1.0\n jaxrs-2.0\n wasJmsClient-2.0\n servlet-3.1\n mdb-3.2\n wmqJmsClient-2.0\n jndi-1.0\n ssl-1.0\n ### Assistant: JDBC 4.0 is a Java EE 6 feature, and Liberty 8.5.5.9 comes with Java EE 7 features installed by default (I suspect you will find that JDBC 4.1 is already in the package you have downloaded). If you need to use JDBC 4.0, you can install it in to Liberty alongside 4.1, and select which one to use in your server.xml. Have a look at wasdev.net for how to install additional features, the page for JDBC 4.0 ishere\n"} +{"text": "### Human: I am inserting messages in a queue using WebSphere MQ tool using java code. While entering the text it will store the message in the queue. I want to validate while inserting messages whether1.the queue exists or not2.Is there any channel error3.Port number mismatch4.host address errorI want to capture these errors and store it in a text file with time stamp and service in error log.Help me how to do it.Menu insertion of messages in queueMenu based insertion of messages in queueMessage inserted in Websphere MQpublic class QueueMessage \n{\n public static Scanner sc = new Scanner(System.in);private MQQueueManager _queueManager = null;\npublic int port = 1413;\npublic String hostname = \"192.168.100.120\";\npublic String channel = \"QM_HOME.Q_LOCAL\";\npublic String qManager = \"QM_HOME\";\npublic String inputQName = \"Q_LOCAL_END\";\npublic String outputQName = \"Q_LOCAL_END\";\n\npublic QueueMessage()\n{\n super();\n}\n\npublic void init(String[] args) throws IllegalArgumentException\n{\n // Set up MQ environment\n MQEnvironment.hostname = hostname;\n System.out.println(\"HOST :\"+hostname);\n MQEnvironment.channel = channel;\n MQEnvironment.port = port;\n System.out.println(\"init\");\n}\n\npublic void selectQMgr() throws MQException \n{\n\n _queueManager = new MQQueueManager(qManager);\n\n}\n\n\npublic void write() throws MQException {\n\n int openOptions = MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING;\n try {\n MQQueue queue = _queueManager.accessQueue(outputQName, openOptions,\n null, // default q manager\n null, // no dynamic q name\n null); // no alternate user id\n\n DataInputStream input = new DataInputStream(System.in);\n\n System.out\n .println(\"MQWrite v1.0 connected and ready for input, terminate with ^Z\\n\\n\");\n // Define a simple MQ message, and write some text in UTF format..\n MQMessage sendmsg = new MQMessage();\n sendmsg.format = MQC.MQFMT_STRING;\n sendmsg.feedback = MQC.MQFB_NONE;\n sendmsg.messageType = MQC.MQMT_DATAGRAM;\n sendmsg.replyToQueueName = \"QM_LOCAL_END\";\n sendmsg.replyToQueueManagerName = qManager;\n\n MQPutMessageOptions pmo = new MQPutMessageOptions(); // accept the\n String line = null; \n\n\n\n System.out.print(\"Enter your Message: \");\n line = sc.nextLine();\n\n sendmsg.clearMessage();\n sendmsg.messageId = MQC.MQMI_NONE;\n sendmsg.correlationId = MQC.MQCI_NONE;\n sendmsg.writeString(line);\n // put the message on the queue\n queue.put(sendmsg, pmo);\n\n System.out.println(\"Message inserted: \" + line);\n queue.close();\n _queueManager.disconnect();\n\n // same\n // as MQPMO_DEFAULT constant\n\n\n\n }\n\n catch (com.ibm.mq.MQException mqex) {\n System.out.println(mqex);\n } catch (java.io.IOException ioex) {\n System.out.println(\"An MQ IO error occurred : \" + ioex);\n\n }\n}\n\nprivate void While(boolean b) {\n // TODO Auto-generated method stub\n\n}}### Assistant: using java codeStandard Java coding - you simply catch the MQException.try\n{\n _qMgr = new MQQueueManager(qMgrName, myHashTable);\n}\ncatch (MQException e)\n{\n System.err.println(\"Completion Code=\" + e.completionCode + \" Reason Code=\" + e.reasonCode);\n}Everything about MQ is documented in theMQ Knowledge Center. All of the MQ/Java classes are documented - i.e.MQQueueManager classThe #1 rule to remember is that object names (queues, channels, etc) are case sensitive. Rule #2 is that MQ is NOT a database. Rule #3, make sure your application logs ALL 'Exceptions'.1.the queue exists or notReason code of 2085 (MQRC_UNKNOWN_OBJECT_NAME)2.Is there any channel errorReason code of 2009 (MQRC_CONNECTION_BROKEN)3.Port number mismatchReason code of 2059 (MQRC_Q_MGR_NOT_AVAILABLE)4.host address errorReason code of 2538 (MQRC_HOST_NOT_AVAILABLE)\n"} +{"text": "### Human: My assignment:I have a queue-system provided by the IBM MQ-Series. I need to get all messages of a \"Dead-Letter-Queue\". The RFH2-Header and the original payload were assembled in the Dead-Letter. I the original payload is mostly a zip-file or string. Since there is the possibilty of the payload being a zip-file, I need to save the payload as a byte[] in java. The RFH2 should be a Linked HashMap.What I've got so far:public ZMessageDTO(final ZMessageType messageType, MQMessage message) throws ZDAEQException {\n this.mqMessage = message;\n this.messageType = messageType;\n\n List payloadRFH2List = this.split(\"\".getBytes(StandardCharsets.UTF_8));\n rfh2 = getRFH2OfXMLBytes(payloadRFH2List.get(0));\n payload = payloadRFH2List.get(1);\n }\n\n public boolean isMatch(byte[] pattern, byte[] input, int pos) {\n for (int i = 0; i < pattern.length; i++) {\n if (pattern[i] != input[pos + i]) {\n return false;\n }\n }\n return true;\n }\n\npublic List split(byte[] pattern) throws ZDAEQException {\n try {\n byte[] input = new byte[(int) mqMessage.getMessageLength()];\n\n for (int i = 0; i < (int) mqMessage.getMessageLength(); i++) {\n input[i] = mqMessage.readByte();\n }\n List l = new LinkedList();\n int blockStart = 0;\n for (int i = 0; i < input.length; i++) {\n if (isMatch(pattern, input, i)) {\n l.add(Arrays.copyOfRange(input, blockStart, i));\n blockStart = i + pattern.length;\n i = blockStart;\n }\n }\n l.add(Arrays.copyOfRange(input, blockStart, input.length));\n return l;\n } catch (IOException e) {\n throw new ZDAEQException(\"Couldn't split dead letter\" + e);\n }\n}What happens by now:If I create a new Message out of the data a get, it cuts the rfh2 by the 2066th char. If i call the original payload, I get a NullPointer.What's the crux?As I mentionend in the assignment, the RFH2 and the original payload are both assembled in the \"Dead-Letter-Payload\" (I hope you unterstand what I'm trying to tell). What I tried so far, is to search the payload for the-ending tag and save the two parts. I saved the first part as a String and the second part as a byte[]. I have absolutely no Idea if this works or not.My question:Is it possible to split the Dead-Letter-Payload in two parts and save the first one as a string, and the second one as a byte[]?### Assistant: The MQRFH2 structure is very complex. If you don't understand it then why aren't you using theMQRFH2class?IBM provides the MQRFH2 class so that developers don't have to deal with the structure.i.e.mqMsg.seek(0);\nMQRFH2 rfh2 = new MQRFH2(mqMsg);\nbyte[] data = new byte[mqMsg.getDataLength()];\nmqMsg.readFully(data);\nSystem.out.println(\"Message data: \"+new String(data));\n"} +{"text": "### Human: If Websphere MQ is used as a XA(Distributed Transaction) Transaction Manager using Java MQ classes, not JTA, the Java application and the WMQ, both need to reside on the same host machine. I have been told this is because shared memory is used as Inter Process Communication mechanism. The Java application and the Websphere MQ both need access to shared memory to make XA work.If we deploy WMQ in a docker container and keep our Java application in another docker container, both on the same host, will we be able to use the WMQ as a XA coordinator?Will we have to use certain special configuration of the container to get it working? Can we allow the two containers to use common shared memory?Regards,Yash### Assistant: You can use common IPC name spaces via the--ipcoption forrunandcreatedocker run -d --name=wmq wmq\ndocker run -d --ipc=container:wmq appOr a less secure host ipcdocker run -d --ipc=host wmq\ndocker run -d --ipc=host appI'm not sure of MQ's explicit support for either setup for XA but IBM do support MQ in Docker.\n"} +{"text": "### Human: I'm trying to setup a Client connection to IBM MQ and test this using the samples application wmqjava.I am able to connect in binding mode but I'm getting a 2035 unauthorised error when using client mode.The steps I've taken to set this up are:Create / run a queue managerCreate a listenerCreate a SVRConn channel (multiple attempts)I think I'm missing something with authorisation?DEF CHL('TEST2.CHANNEL') CHLTYPE(SVRCONN) TRPTYPE(TCP) MCAUSER(' ')I'm trying to connect to this on the same machine that the MQ server is running on.### Assistant: Depending on the version of IBM MQ you are using, you could be being blocked by the default CHLAUTH rule which bans client connections which assert privileged user ids, or the default CONNAUTH rule which demands a password is provided for such a client connection.ReadGetting going without turning off MQ Securityfor instructions on how to turn both off, or use both correctly.FYI: Your queue manager error log will tell you the reason you were blocked from accessing it.\n"} +{"text": "### Human: I am designing an application flow where I have to read a file (XML File) and put the data into IBM MQ (Queue). Do I need to create an HTTP request that will trigger the File read and update queue, otherwise how do I perform this task.Currently I am creating an HTTP Request and connecting it to WMQ but I am getting NULL data into the Queue. Basically the payload is NULL.This is the data I read when I browse the Queue:\nsr.org.mule.transport.NullPayload1.L5U\ufffd\ufffd\ufffd...xp### Assistant: Try like this:Whenever you use File connector at any other place than the beginning of the flow, then it becomes an outbound endpoint.Forusing File as an inbound endpointto retrieve any file, you mustuse it in the beginning of some flow & keep the flow in stopped state initiallyas:\n \n \nFor your case just change the path with your required file location.Then for furthercalling it via http, create another flow with http endpoint& use anExpression componentto start the flow containing file inbound endpoint call as :\n app.registry.filePickupFlow.start();\nThenif you wish to stop it after it completes processing, you can again use anExpression componentas:\n Thread.sleep(5000);\n app.registry.filePickupFlow.stop();\nThread.sleep() is used here just to give some time gap between flow start & stop to let the flow operation complete. You can add some other thing for maintaing this time gap or set the time according to your own usage.I guess this is what you were looking for.Regards,JJ\n"} +{"text": "### Human: I need to send a message to a MQ Cluster using .Net. How do I do it?MQEnvironment.Hostname = \"10.1.1.22\";\n MQEnvironment.Port = 1455;\n MQEnvironment.Channel = \"SOMECHANNEL\";\n MQEnvironment.ConnectionName = \"10.1.1.22(1432)\";\n MQQueueManager qm =new MQQueueManager(\"SOMEQM\");\n\n var openOptions = MQC.MQOO_INPUT_AS_Q_DEF| MQC.MQOO_OUTPUT;\n var queue = qm.AccessQueue(\"MYREQUESTQUEUE\", openOptions);Currently this is failing on the last line. What are theproper optionsto send when opening a connection to a cluster queue?### Assistant: Couple of points:1) A cluster queue may not be hosted on the queue manager to which your application is connected to.2) Messages can be put to a cluster queue that is not hosted on the queue manager your application is connected. But toGETmessages, queuemustbe hosted on the queue manager to which your application is connected to.Your application is usingMQC.MQOO_INPUT_AS_Q_DEFoption, meaning you are trying to GET messages from a queue but the that queue is not present on the queue manager your application is connected to. Hence exception is being thrown. You need to removeMQC.MQOO_INPUT_AS_Q_DEFoption and just useMQC.MQOO_OUTPUTto send/put messages to cluster queue.\n"} +{"text": "### Human: I have a requirement to send and receive messages using MQ. I have created a standalone java application (jar) to do this functionality. Now I want to run this jar all time to monitor the queue to receive messages. Is that any way to deploy this jar in tomcat and execute all time? (I have used spring batch and JMS template)### Assistant: Check out theSpring Integrationframework. You can run this standalone and leverage theto listen on your JMS queue. The message-driven endpoint wrapsJMSTemplateand should suit your needs.\n"} +{"text": "### Human: I am trying to integrate JBOSS EAP6.2.0 with IBM MQ 7.5.\nJBOSS servers are configured to run in a managed domain.With JBoss 6.2, following steps are completed:\n1. successfully deployed wmq.jmsra.rar file\n2. Created resource adapter, connection factory and destination queue.here is the snippet of the configuration:\n\nwmq.jmsra.rar\n\nNoTransaction\n\n\n2414\n\n\nlocalhost\n\n\nSYSTEM.DEF.SVRCONN\n\n\nCLIENT\n\n\nMB7QMGR\n\n\n\n\n\nfalse\n\n\n\n\n\n\nTESTQ\n\n\nMB7QMGR\n\n\n\nWith all configuration in place, I can see in the server logs that connection factory and destination is successfully bounded:\nJBAS010401: Bound JCA AdminObject [java:jboss/jms/ivt/IVTQueue] JBAS010401: Bound JCA ConnectionFactory [java:jboss/jms/ivt/IVTCF]I am able to get this connection factory in my java code but when I am trying to create connection from the factory I am getting below error:\n*17:54:06,233 INFO [stdout] (http-/10.63.78.129:8010-1) Connection factory found !!\n17:54:06,233 INFO [stdout] (http-/10.63.78.129:8010-1) Destination queue found !!\n17:54:06,385 WARN [org.jboss.jca.core.connectionmanager.pool.strategy.PoolByCri] (http-/10.63.78.129:8010-1) IJ000604: Throwable while attempting to get a new connection: null: com.ibm.mq.connector.DetailedResourceException: MQJCA1011: Failed to allocate a JMS connection., error code: MQJCA1011 An internal error caused an attempt to allocate a connection to fail. See the linked exception for details of the failure.\nat com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:129)\nat com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:105)\nat com.ibm.mq.connector.ConnectionBuilder.createConnection(ConnectionBuilder.java:197)\nat com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl.createConnection(ManagedConnectionFactoryImpl.java:434)\nat com.ibm.mq.connector.outbound.ManagedConnectionImpl.(ManagedConnectionImpl.java:138)\nat com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl.createManagedConnection(ManagedConnectionFactoryImpl.java:190)\nat org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.createConnectionEventListener(SemaphoreArrayListManagedConnectionPool.java:781)\nat org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:344)\nat org.jboss.jca.core.connectionmanager.pool.AbstractPool.getSimpleConnection(AbstractPool.java:397)\nat org.jboss.jca.core.connectionmanager.pool.AbstractPool.getConnection(AbstractPool.java:365)\nat org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:329)\nat org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:302)\nat org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:464)\nat com.ibm.mq.connector.outbound.ConnectionFactoryImpl.createManagedJMSConnection(ConnectionFactoryImpl.java:194)\nat com.ibm.mq.connector.outbound.ConnectionFactoryImpl.createConnectionInternal(ConnectionFactoryImpl.java:153)\nat com.ibm.mq.connector.outbound.ConnectionFactoryImpl.createConnection(ConnectionFactoryImpl.java:138)\nat com.ibm.mq.connector.outbound.ConnectionFactoryImpl.createConnection(ConnectionFactoryImpl.java:123)\nat com.tms.ice.apns.PutMessageToQueueUsingJNDI.putMessage(PutMessageToQueueUsingJNDI.java:31) [classes:]\nat com.tms.ice.apns.GenerateAPNSRequest.doPost(GenerateAPNSRequest.java:137) [classes:]\nat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_51]\nat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_51]\nat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_51]\nat java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_51]\nat org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:167) [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2]\nat org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:269) [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2]\nat org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:227) [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2]\nat org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:216) [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2]\nat org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:542) [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2]\nat org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524) [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2]\nat org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126) [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2]\nat org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2]\nat org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2]\nat org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2]\nat javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1]\nat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]\nat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]\nat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]\nat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]\nat org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.event(JBossWebContext.java:91)\nat org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.invoke(JBossWebContext.java:72)\nat org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]\nat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]\nat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]\nat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]\nat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]\nat org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]\nat org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]\nat org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]\nat java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51]\nCaused by: com.ibm.msg.client.jms.DetailedJMSException: JMSFMQ6312: An exception occurred in the Java(tm) MQI.\nThe Java(tm) MQI has thrown an exception describing the problem.\nSee the linked exception for further information.\nat sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_51]\nat sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [rt.jar:1.7.0_51]\nat sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.7.0_51]\nat java.lang.reflect.Constructor.newInstance(Constructor.java:526) [rt.jar:1.7.0_51]\nat com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:319) [com.ibm.mq.jmqi.jar:7.5.0.0 - p000-L120604]\nat com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:233) [com.ibm.mq.jmqi.jar:7.5.0.0 - p000-L120604]\nat com.ibm.msg.client.wmq.factories.WMQXAConnectionFactory.createV7ProviderConnection(WMQXAConnectionFactory.java:180) [com.ibm.mqjms.jar:7.5.0.0 - p000-L120604]\nat com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6254) [com.ibm.mqjms.jar:7.5.0.0 - p000-L120604]\nat com.ibm.msg.client.wmq.factories.WMQXAConnectionFactory.createProviderXAConnection(WMQXAConnectionFactory.java:107) [com.ibm.mqjms.jar:7.5.0.0 - p000-L120604]\nat com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createXAConnectionInternal(JmsConnectionFactoryImpl.java:378) [com.ibm.mqjms.jar:7.5.0.0 - p000-L120604]\nat com.ibm.mq.jms.MQXAConnectionFactory.createXAConnection(MQXAConnectionFactory.java:129) [com.ibm.mqjms.jar:7.5.0.0 - p000-L120604]\nat com.ibm.mq.connector.ConnectionBuilder.createConnection(ConnectionBuilder.java:172)\n... 46 more\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2195;AMQ9546: Error return code received. [1=java.lang.NoSuchMethodException[com.ibm.mq.jmqi.remote.api.RemoteFAP.(com.ibm.mq.jmqi.JmqiEnvironment, int)],3=Class.getConstructor0]\nat com.ibm.mq.jmqi.JmqiEnvironment.getInstance(JmqiEnvironment.java:822) [com.ibm.mq.jmqi.jar:7.5.0.0 - p000-L120604]\nat com.ibm.mq.jmqi.JmqiEnvironment.getMQI(JmqiEnvironment.java:666) [com.ibm.mq.jmqi.jar:7.5.0.0 - p000-L120604]\nat com.ibm.msg.client.wmq.factories.WMQXAConnectionFactory.createV7ProviderConnection(WMQXAConnectionFactory.java:172) [com.ibm.mqjms.jar:7.5.0.0 - p000-L120604]\n... 51 more\nCaused by: java.lang.NoSuchMethodException: com.ibm.mq.jmqi.remote.api.RemoteFAP.(com.ibm.mq.jmqi.JmqiEnvironment, int)\nat java.lang.Class.getConstructor0(Class.java:2810) [rt.jar:1.7.0_51]\nat java.lang.Class.getConstructor(Class.java:1718) [rt.jar:1.7.0_51]\nat com.ibm.mq.jmqi.JmqiEnvironment.getInstance(JmqiEnvironment.java:728) [com.ibm.mq.jmqi.jar:7.5.0.0 - p000-L120604]\n... 53 more\n17:54:06,401 INFO [stdout] (http-/10.63.78.129:8010-1) GenerateAPNSRequest.Result for posting message in the queue MQJCA1011: Failed to allocate a JMS connection.*\nI have searched multiple forums and were able to get to related topics but any solution if provided did not worked. No FDC were generated for mqrc 2195 mentioned in the stack trace and even replacing wmq.jmsra jar files from 7.0.1.13 to 7.5.0.0 did not worked.Request you all to have a look and suggest.Thanks.### Assistant: I solved an error like this by revising my code and make sure that every object is closed, also in all the catch structures.The cause was that the MQ provider accepted a limited number of connections and at some point this pool got filled up. So you will have to close first all the connections to the queue and then rerun the corrected code.\n"} +{"text": "### Human: We have a .NET application which reads from Websphere MQ.\nThe queue is local, and is managed using MQ Explorer.\nThe queue is authenticated using SSL certificates.We would like to read from the same queue from an application being written in Java. I understand that in order to access the queue using JMS, we would need to regenerate the certificates specifically for use with Java. However, we have not yet been able to do this.In order to continue with development and testing, is there a way, using MQ Explorer, to disable authentication on the queue or queue manager?I am assuming that we can access the existing queue using JMS, and do not have to setup a new queue under 'JMS Administered Objects'.Thanks### Assistant: Well it's not the queue that is TLS/SSL enabled. It's the connection (i.e. channel) to the queue manager that is TLS/SSL enabled. You can create another channel that is not TLS/SSL enabled and connect to the queue manager to get messages from that queue.\n"} +{"text": "### Human: I'm struggling to program a controller that I can switch MDB on or off. I was trying to use JNDI lookup to find the MDB instance in my Jboss server, then make it controlled. Is this possible?### Assistant: Yes, via JMX. You can find JMX beans for JMS Activation (MDB) under \"WebSphere:type=J2CMessageEndpoint,*\"Then can can \"invoke\" methods \"pause\" or \"resume\" on the MBean of the Activation\n"} +{"text": "### Human: I have an application which connect to websphere-MQ and when I set one topic is working, but I want to connect to few Topics in one application.Code in which I get messages looks:mqMsg = new MQMessage();\n opt = new MQGetMessageOptions();\n opt.Options = MQC.MQGMO_WAIT | MQC.MQGMO_BROWSE_NEXT;\n mqMsg.CorrelationId = IBM.WMQ.MQC.MQMI_NONE;\n mqMsg.MessageId = IBM.WMQ.MQC.MQMI_NONE;\n mqTopic.Get(mqMsg, opt);\n String message = mqMsg.ReadString(mqMsg.DataLength);I try make topic string like that:TOPIC_1/TOPIC_2/TOPIC_3/TOPIC_4but is not working### Assistant: Are TOPIC_1, TOPIC_2, TOPIC_3 and TOPIC_4 real topic strings?If yes you subscribe using wildcard topic stringTOPIC*.If not then you can create a parent topicPARENTand add the these topics under that. So your topic strings would look:PARENT/TOPIC_1\nPARENT/TOPIC_2and so on. Then you subscribe with topic stringPARENT/#. This would get publications for all topics underPARENT.Hope this helped.\n"} +{"text": "### Human: While I try to connect WMQ 8.0 from Home , It gives me error and getting failed while same Queue manager connects perfectly while I connect from office.Queue manager name with host and port : MB8QMGR on '192.168.26.128(2414)'\nBelow is the error connection.Could not establish a connection to the queue manager - reason 2538(AMQ4059).kindly suggest me what's wrong with this.### Assistant: In case you're not already aware, MQ Return Code 2538 isMQRC_HOST_NOT_AVAILABLE. This means that you have not managed to make the TCP/IP connection to your queue manager.This is really a networking question rather than specifically an MQ question. Your question shows the IP address of the queue manager being a 192.168 address. This is aprivate network address. This means you can't connect to it from outside that network. You'll probably find that you have 192.168 addresses at home as well, but that does not mean you are on the same network.My understanding is that even with a VPN getting you inside you company network, you still need a real IP address to connect to, but someone with more experience of private networks may be able to confirm. Talk to your network people at work and ask them how you should connect to the server your queue manager is on, from home. Once you can TCP/IP ping it successfully, then attempt to an MQ connection.\n"} +{"text": "### Human: I'm working with IBM's Websphere MQ queues and I want to connect to multiple of these, browse each ones messages, and route them all to another queue in which a different application will read from.The application that is reading from the \"main\" queue is written in Java and using Spring Boot and JMS to process the messages from the queue. I found difficulty in connecting to multiple queues with this application, so the idea was to create a router application, that would connect to multiple queues, clear the \"main\" queue, and fill it with messages from the collected queues.I began the \"router\" application in Java as well and decided to use Spring Boot, but not JMS, and still found some difficulties conceptually with this.So I'm wondering if Java is right for the job (or maybe I'm missing something fundamental). I'm also pondering a Perl script, but I'm not very (if at all) experienced with the language, but I don't want to discredit it as a viable option.So which of these two languages could prove to be:1) Maintainable2) Somewhat easy to read3) Efficientin completing a task such as the one I have described?Pros and cons of both would be nice.### Assistant: The most advanced EIP integration framework in Java is Apache Camel. I suggest using it. With Apache Camel you could write the router in form similar to this:public class Routes extends RouteBuilder {\n @Override\n public void configure() throws Exception {\n from(\"jms:InputOneQueue1\").to(\"jms:destinationQueue\");\n from(\"jms:InputOneQueue2\").to(\"jms:destinationQueue\");\n from(\"jms:InputOneQueue3\").to(\"jms:destinationQueue\");\n }\n}\n"} +{"text": "### Human: How can a receiving app control that the message is not taken out of the queue, till it sends an acknowledgement of the message? For example, a scenario where the receiving app gets the message and crashes post that, the message from MQ perspective would have been sent but the receiving app would not have yet processed it and in that sense there is a possibility of losing messages. Is there a way that we can control when MQ takes off that message from the queue?Similar question from sending app perspective, what is the SLA of MQ Light on Bluemix, so if MQLight goes down, should the sending application continue to resend (for how long) the message. How can sending app can be sure of MQLight receiving it?### Assistant: An app can use the 'Quality of service' property in a subscribe call to control the delivery guarantee for messages it receives. The following provides a good description of the details:https://developer.ibm.com/messaging/mq-light/docs/qos/In summary, if your app needs to use message acknowledgement then an 'Atleast once' quality of service should be used. Further control is then also possible by using the autoConfirm property if you need the app to control the sending of the ack itself.Likewise, when sending messages, an application can set the 'Quality of service' property of the send call to 'Atleast once' to receive an explicit accepted/rejected confirmation from the server.For a situation where the server is unavailable for a period of time, this would mean the client would continue to try to reconnect and send the message until either (1) the server is available again and accepted the message, (2) the server is available again and rejected the message, (3) the client api was changed to the stopped state by the client application or (4) the client application was terminated. In cases 1-3 the client will receive confirmation of the result.\n"} +{"text": "### Human: I want to import websphere MQ messages to my hadoop VM using Flume.I have not used MQ before and installed MQ version 8.0.0.4 on my windows machine and created JNDI binding . I have copied that JNDI binding file to the /etc/flume/conf location and created conf file for flume. Once i have started the Flume agent i am getting below error:-Caused by: com.ibm.msg.client.jms.DetailedJMSSecurityException: JMSWMQ2013: The security authentication was not valid that was supplied for QueueManager 'JMSDEMO' with connection mode 'Client' and host name 'XXX.XXX.XX.XX(1414)'Below are the errors in the Log file of Websphere MQ:-4/20/2016 22:00:18 - Process(14396.9) User(MUSR_MQADMIN) Program(amqrmppa.exe)\n Host(armaan) Installation(Installation1)\n VRMF(8.0.0.4) QMgr(JMSDEMO)\n\nAMQ9245: Unable to obtain account details for channel MCA user ID.\n\nEXPLANATION:\nWebSphere MQ was unable to obtain the account details for MCA user ID 'root'.\nThis user ID was the MCA user ID for channel 'SYSTEM.DEF.SVRCONN' on queue\nmanager 'JMSDEMO' and may have been defined in the channel definition, or\nsupplied either by a channel exit or by a client.\nACTION:\nEnsure that the user ID is correct and that it is defined on the Windows local\nsystem, the local domain or on a trusted domain. For a domain user ID, ensure\nthat all necessary domain controllers are available. \n----- cmqxrsrv.c : 2140 -------------------------------------------------------\n4/20/2016 22:00:18 - Process(6376.20) User(MUSR_MQADMIN) Program(amqzlaa0.exe)\n Host(armaan) Installation(Installation1)\n VRMF(8.0.0.4) QMgr(JMSDEMO)\n\nAMQ7227: WebSphere MQ encountered the following network error: The trust\nrelationship between this workstation and the primary domain failed.\n\nEXPLANATION:\n MQ failed to successfully complete a network operation due to the specified\nerror. If the error is encountered on systems that are part of a Windows 2000\ndomain it can indicate incorrect DNS or WINS configuration.\nACTION:\nEnsure that your network is functioning correctly. On the Windows platform\ncheck DNS and/or WINS settings to ensure that domain controllers, used for\nauthentication or authorisation functions, are accessible. \n----- amqxsecn.c : 5125 -------------------------------------------------------\n4/20/2016 22:00:18 - Process(6376.20) User(MUSR_MQADMIN) Program(amqzlaa0.exe)\n Host(armaan) Installation(Installation1)\n VRMF(8.0.0.4) QMgr(JMSDEMO)\n\nAMQ8075: Authorization failed because the SID for entity 'root' cannot be\nobtained.\n\nEXPLANATION:\nThe Object Authority Manager was unable to obtain a SID for the specified\nentity. This could be because the local machine is not in the domain to locate\nthe entity, or because the entity does not exist.\nACTION:\nEnsure that the entity is valid, and that all necessary domain controllers are\navailable. This might mean creating the entity on the local machine. \n----- amqzfubn.c : 2421 -------------------------------------------------------\n4/20/2016 22:00:18 - Process(6376.20) User(MUSR_MQADMIN) Program(amqzlaa0.exe)\n Host(armaan) Installation(Installation1)\n VRMF(8.0.0.4) QMgr(JMSDEMO)\n\nAMQ7227: WebSphere MQ encountered the following network error: The trust\nrelationship between this workstation and the primary domain failed.\n\nEXPLANATION:\n MQ failed to successfully complete a network operation due to the specified\nerror. If the error is encountered on systems that are part of a Windows 2000\ndomain it can indicate incorrect DNS or WINS configuration.\nACTION:\nEnsure that your network is functioning correctly. On the Windows platform\ncheck DNS and/or WINS settings to ensure that domain controllers, used for\nauthentication or authorisation functions, are accessible. \n----- amqxsecn.c : 5125 -------------------------------------------------------\n4/20/2016 22:00:18 - Process(6376.20) User(MUSR_MQADMIN) Program(amqzlaa0.exe)\n Host(armaan) Installation(Installation1)\n VRMF(8.0.0.4) QMgr(JMSDEMO)\n\nAMQ8075: Authorization failed because the SID for entity 'root' cannot be\nobtained.\n\nEXPLANATION:\nThe Object Authority Manager was unable to obtain a SID for the specified\nentity. This could be because the local machine is not in the domain to locate\nthe entity, or because the entity does not exist.\nACTION:\nEnsure that the entity is valid, and that all necessary domain controllers are\navailable. This might mean creating the entity on the local machine. \n----- amqzfubn.c : 2421 -------------------------------------------------------\n4/20/2016 22:00:18 - Process(14396.9) User(MUSR_MQADMIN) Program(amqrmppa.exe)\n Host(armaan) Installation(Installation1)\n VRMF(8.0.0.4) QMgr(JMSDEMO)\n\nAMQ9557: Queue Manager User ID initialization failed for 'root'.\n\nEXPLANATION:\nThe call to initialize the User ID 'root' failed with CompCode 2 and Reason\n2035.\nACTION:\nCorrect the error and try again. \n----- cmqxrsrv.c : 2321 -------------------------------------------------------I have submitted the flume command from VM as root user.\nI know i had done something wrong with MQ settings as i have noprevious experience with MQ . Please help .### Assistant: I know i had done something wrong with MQ settings as i have\n no previous experience with MQ.How about doing some self-training and read the documentation. There is a whole section in theMQ Knowledge Centerabout MQ & JMS. Please read ithere. Or you could go to the largest conference in the world solely dedicated to IBM MQ (aka WebSphere MQ & MQSeries) -MQ Technical Conference v2.0.1.6.Just put the credentials as follows:QueueConnection conn = cf.createQueueConnection(userID, password);\n"} +{"text": "### Human: I got concurrency issue while starting the JVM due to a particular app. Start-up hangs during message driven activation. I got this URLhttp://www-01.ibm.com/support/docview.wss?uid=swg1IZ68236(the same error I got for myself as mentioned in URL) and fixed as a local solution. Want to fix this issue as a permanent solution but got to know the 'ConnectionConcurrency' has been removed from v7+. Can anyone please suggest me how to fix this as a permanent solution.### Assistant: The permanent solutionisas documented in the APAR closing words; that is, a configuration change to set the value of the MQ Resource Adapter property \"ConnectionConcurrency\" to the value 1 atCellscope (if using WebSphere Application Server). There is no change code for the WebSphere MQ v7.0.1 RA (shipped in WAS v7.0 or 8.0) for this issue.Note: It does not matter what scope your Activation Specifications are actually defined at (whether that be Cell, Node or Server), the value of \"ConnectionConcurrency\" is always taken from the RA defined at Cell scope.From the WebSphere MQ v7.1 Resource Adapter (shipped in WAS v8.5), the \"ConnectionConcurrency\" attribute is always set to the value 1 to avoid the deadlock issue described by APAR IZ68236.\n"} +{"text": "### Human: Our current C# application does not use a username and password to connect toWebSphere MQ, rather a DLL contains all the security information. If this DLL exists, C# will be able to access MQ.When connecting from Java or Scala, how would one configure JMS so that rather than using a simple user\\password, like:properties.put(Context.SECURITY_PRINCIPAL, \"user\")\nproperties.put(Context.SECURITY_CREDENTIALS, \"password\")\nval ctx = new InitialContext(properties)instead it uses the DLL?Thanks### Assistant: That DLL must be containing a security exit to be used by the MQ Client.You should specify the security exit in the SECEXIT property of the MQConnectionFactory.More about setting up the MQ classes for JMS to use the security exit:https://www.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.dev.doc/q032490_.htm?lang=en\n"} +{"text": "### Human: Suppose a message is put to local MQ manager, say, MQR 1, which forward the message to a remote MQ manager, say MQR 2. When an application, say reader, gets the message from MQR2, what is the put time?I use to think put time is the time the message is put to the local queue from reader's perspective, i.e. MQR2 in this example. But I notice weird situation that the message just arrives has put time about two hours ago. This make me think it is the time when the message is put to MQR 1. Is that correct?### Assistant: Put date and time are set when the message is put on the queue. If the message 'travels' further to a remote queuemanger, the time and date is NOT updated and reflects the 'original' put time and date when the message was put on the queue. The fields belong to the initially created mq message.For the MQPUT and MQPUT1 calls, the application can specify any value. The queue manager transmits this value with the message and delivers it to the application that issues the get request for the message.from:https://www.ibm.com/support/knowledgecenter/SSB23S_1.1.0.12/gtpc2/mqmdst.html\n"} +{"text": "### Human: I am trying to integrate two systems using messaging queue (Websphere Mq). I have used camel with spring for routing purpose. Now I need to set JMSCorrelationId and JMSReplyTo header in them.\n \n\n \n\n \n\n ### Assistant: By placing the following in the middle:\n myValue\nYou can do the same thing with JMSReplyTo header.\n"} +{"text": "### Human: 11 Am currently migrating ESQL Message flow and Bar file codes from V7.1 to IIB9. For doing this I need to convert messageflows in to subflows. Then for creating bar files in mqsicreatebar command I chose 'deployAsSource' option. After creation of bar files I noticed that my bar files include all ESQL and subflows which were part of compilable main message flow which I have provided in mqsicreatebar. When I deployed this bar to execution group I noticed that every ESQL and subflows are also deployed. Ideally only main messageflow should have deployed on Execution Group. Is there anything or option am not choosing while this migration, please suggest.### Assistant: In the toolkit, open up the Bar editor.On the 'Prepare' tab, over on the right-hand side is a list of 4 checkboxes. One of these is 'Compile and in-line resources' - check this.In the main editor page, make sure that only msgflows are selected. Build and Save.When you look inside the bar file, you should only have CMF files.EDIT: OP wanted to use the cmd line for generating the bar file. Here is a command that I used:mqsicreatebar -data C:\\Users\\Adam\\IBM\\IIBT10\\workspace -b C:\\Users\\Adam\\cmd.bar -p Foo -o /Foo/foo1.msgflowThemqsicreatebarcommand documentationmight be useful for you.I think using thedeployAsSourceoption was a mistake in this case. Here's what the doc has to say about that option.-deployAsSource(Optional) Include this parameter to deploy applicable resource files without compiling them.\n When the-deployAsSourceparameter is used, any applicable resources are added to the BAR file as source files, and are not compiled into message flow .cmf files.You cannot include both the compiled (.cmf) and source (.msgflow) versions of a message flow in a BAR file.\n"} +{"text": "### Human: I installed MQ8.0.0.4 on a ubuntu(14.4) server. I am able to launch a local MQ explorer and connect to local Queue Managers. I want to connect to the same Queue Manager from a remote windows machine. When I try this I get authorization errors:Access not permitted. You are not authorized to perform this operation. (AMQ4036)\n Access not permitted. You are not authorized to perform this operation. (AMQ4036)\n Severity: 10 (Warning)\n Explanation: The queue manager security mechanism has indicated that the userid associated with this request is not authorized to access the object.This linkshows a list of auth commands to enable remote windows connection, but the page only lists upto version 7.5 for which this is applicable. Will I have to do the same setup on 8.0 as well?I already enabled remote administration using the local MQ Explorer.### Assistant: \"The queue manager security mechanism has indicated that the userid associated with this request is not authorized to access the object.\" Are you using the mqm ID or another ID? You could use theMQS_REPORT_NOAUTHorMQSAUTHERRORSsetting to get more info the authority failure.To answer your other question, I believe the settings in the link will also apply to v8 - but v8 also has additional new authority checks as well.\n"} +{"text": "### Human: I have a JBoss 6.4 EAP and a Websphere MQueue. The JBoss needs to receive messages using Message-Driven beans from the Websphere MQueue. Is there an existing library/a programmable way to let the JBoss connect to Queues where the configuration parameters of the queues and queue manager are in an oracle database? I know of theWebsphere MQ Resource adapterbut want to have the configuration in the database. This is due to organisational and access reasons.### Assistant: JBoss does not have a mechanism to fetch configuration information from a database. Having configuration properties as java system properties is supported. JBoss also has a configuration \"vault\" to store properties.Doug\n"} +{"text": "### Human: Correlation of request and response message on Q1 i.e. If Q1 sends out 100 messages to Q2 and receives 100 messages back, Q1 should be able to correlate those 100 responses back to the request. This is to ensure that response is tied back to the correct request and correct response is sent back to calling application. We are using GUID for correlation id.Set the timeout property to 50 secs. This is to achieve if the response comes back within 50 secs, send the response back to calling application. If response comes back after 50 secs, send the timeout response to calling application.I need to do a POC on it, please Help..### Assistant: Req/Resp matching : If your GUID is unique for each message then you can use the same to correlate request and response message. Other option is to get the message ID from the request and then set as correlation Id in the response message.For more details check here:IBM WebSphere MQ request/reply scenarioSample:https://www.ibm.com/developerworks/community/blogs/messaging/entry/jms_request_reply_sample?lang=enTimeout: You can specify the timeout in the receive method in JMS. The sample covers this. If you want to use C application, there are options available in MQGET call(MQGMO_WAIT with Wait Interval.)\n"} +{"text": "### Human: I tried to connect to IBM Websphere MQ 8 version using WMQInitialContextFactory.But seems like I can't connect. Does the WMQInitialContextFactory support for version 8 removed?Note : I can connect to version 7 products without issue.P.S. Before connecting to the IBM MQ I disabled the channel security using the following commands,runmqsc MyManager\nALTER QMGR CHLAUTH(DISABLED)\nREFRESH SECURITY TYPE(CONNAUTH)Seems like for Version 8 channel authentication disable approach doesn't work.The error I'm getting is \"Root exception is com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2035'.\"### Assistant: If you're not bothered about security / authentication, you might also want to disable CONNAUTH as well as CHLAUTH:ALTER QMGR CONNAUTH(' ')Then refresh security again as you originally had in your question.If that doesn't work, look in the queue manager error log for the reason why the MQ reason code 2035 (MQRC_NOT_AUTHORIZED) is being returned to the client.\n"} +{"text": "### Human: I am using MQ 7.5.0.2 and Datapower client IDG7When MQ send messages to Datapower, Datapower receive those messages using MQ front side handlers and also same way it do send messages using Backend URL\nBut the problem I am facing it when ever Datapower connects to MQ, Queue Input/Output count increases to (10 ~20) and remains same and the Handle state is INACTIVE.\nWhen I see queue details using below commands it is displaying as belowdisplay qstatus(******) type(handle)\n\n QUEUE(********) TYPE(HANDLE)\n APPLDESC(WebSphere MQ Channel)\n APPLTAG(WebSphere Datapower MQClient)\n APPLTYPE(SYSTEM) BROWSE(NO)\n CHANNEL(*****) CONNAME(******)\n ASTATE(NONE) HSTATE(INACTIVE)\n INPUT(SHARED) INQUIRE(NO)\n OUTPUT(NO) PID(25391)\n QMURID(0.1149) SET(NO)\n TID(54)\n URID(XA_FORMATID[] XA_GTRID[] XA_BQUAL[])\n URTYPE(QMGR)Can any one help me in this.It only clearing when ever i restart the queue manager but I dont want to restart the qmgr every time.### Assistant: HSTATE in INACTIVE state indicates \"No API call from a connection is currently in progress for this object. For a queue, this condition can arise when no MQGET WAIT call is in progress.\". This is likely to happen if the application(DP in this case) opened the queue and then not issuing any API calls on the opened object. Pid 25391 - is this for an amqrmppa process? Is DP expected to consume messages on this queue continuously?\n"} +{"text": "### Human: I am getting following error message while connecting to websphere server using MQ client :/opt/mqm/samp/bin/amqssslc -x 'X.X.X.10(9110)' -c QMEIGS1.VSER.SVRCONN\nQMEIGS1 -k /var/mqm/qmgrs/QMEIGS1/ssl/qmeigs1.arm -s TRIPLE_DES_SHA_USError Message :LE_DES_SHA_USSample AMQSSSLC startConnecting to the default queue managerUsing the server connection channelQMEIGS1.VSER.SVRCONNon connection name 10.87.205.70(7118).No SSL configuration specified.\n MQCONNX ended with reason code 2393We have placed.armfile in ssl dir in the path/var/mqm/qmgrs/QMEIGS1/ssl/qmeigs1.armPlease tell me what need to be done to resolve this ?we are using following Packages on client side :Client version : 8.0.0.4\nClient OS : Redhat Linux 6.x 64bit (Non GUI)Packages Installed on client :MQSeriesJRE_vserv-8.0.0-4.x86_64\nMQSeriesRuntime_vserv-8.0.0-4.x86_64\nMQSeriesGSKit_vserv-8.0.0-4.x86_64\nMQSeriesClient_vserv-8.0.0-4.x86_64\nMQSeriesSamples_vserv-8.0.0-4.x86_64Regards\nAtul### Assistant: The -k parameter on the client side (theamqssslcapplication) and the queue manager'ssslfolder should contain a.kdbfile. You appear to be using a.armfile. You should create a Key Database File (KDB) and add the certificate contained in the.armfile to that KDB, then rerun using the KDB as the target used by both client and queue manager instead of the.armfile.You can find step-by-step instructions at the following page:Running the SSL/TLS sample program\n"} +{"text": "### Human: Suppose a JMS message got to onMessage method in JMS client receiver. Broker (IBM MQ) is on other JVM. Just after that - the JMS client's JVM crushed (before ACKNOWLEDGE was made).I'm using CLIENT ACKNOWLEDGE. Not transacted.Will the broker get an exception (what exception ?) when the client crashed ?\nWill the message stay in the queue ?\nWill the message be redeliver and when/how ?### Assistant: Firstly IBM MQ does not run in a JVM. IBM MQ queue manager run-time comprises a bunch of coordinated processes.Queue managers processes does recognize termination of client applications and does clean up.When CLIENT_ACKNOWLEDGE mode is used, IBM MQ JMS client retrieves the messages from a queue under a SYNC_POINT, so the message will not be removed from the queue until it is acknowledged by the application. The message will be re-delivered when the application resumes i.e. calls connection.start() method. However a message will not be redelivered to application if it's Backout count exceeds Backout threshold (BOTHRESH). In that case the message will be moved to backout queue(BOQNAME) if defined. If for some reason message can not be move to backout queue, then the message will be moved to dead letter queue (DLQ) defined on the queue manager.\n"} +{"text": "### Human: I am using XMS .NET client 7.5 version to connect to WebSphere's multi-instance queue manager.And receiving message asynchronously and also subscribed to Exception Listener to receive any exception happening on WMQ connection.To test the Queue Manager fail over scenario, we killed the existing connection and bringing the active queue manger instance down and standby instance up. During this course of action, the connected XMS client gets the attached Exception Listener invoked. The logic inside the Exception Listener method, restart the connection. Then we are good and we start receiving the message on the queue again.However when all the 2 instances (in our case 2) present in the multi-instance queue manager restarted together, we didn't see the Exception Listener method invoked. Because of this, though there messages were present on the queue we didn't any messages.(Later we closed client application ans started again, then we started receiving the messages.)With this my questions are:Is this what excepted to happen in the scenario I described?If YES, how can get the Exception Listener method invoked even in this scenario. Do I need to set any settings on the connection factory from XMSC class?.And my last question. How .NET XMS client in specific and JMS client in general come to know connection is still valid?### Assistant: By default XMS .NET will attempt to reconnect for 30 minutes. If no connection is established within 30 minutes, an exception withMQRC_RECONNECT_FAILEDwill be thrown and no more attempts will be made. Please seehere. In such cases applications needs to issue connect call again.Regarding your question #3: It's always best to issue a call, like send or receive. If there is no connection to queue manager, then an exception will be thrown. Application handle that exception and issue a connect call again.\n"} +{"text": "### Human: I'm trying to write MQ client which will be resistant to unexpected situation.\nI have created client with client_acknowledge mode:ISession session = conn.CreateSession(false, AcknowledgeMode.ClientAcknowledge);In the XMS documentation there is information for CLIENT_ACKNOWLEDGE:The application can acknowledge the receipt of each message\n individually, or it can receive a batch of messages and call the\n Acknowledge method only for the last message it receives. When the\n Acknowledge method is called all messages received since the last time\n the method was called are acknowledged.The client fetches for example 10 messages from queue and writes them to DB.The question is how to setup this mode with acknowledge every single message ( for ensuring message delivery )?### Assistant: When a message is delivered to your application, how is it lost?Since you are dealing with two resources, why not go for a transacted session or a XA transacted session. If there is an issue with updating DB, you could do a Rollback so that messages get redelivered.UpdateIn a transacted session, acknowledge mode has no significance. Messages are acknowledged when a commit is called or rolled back when rollback is called.If connection to IBM MQ queue manager is lost, all uncommitted messages are automatically rolled back by the queue manager. So no messages are lost.\n"} +{"text": "### Human: I have a library that is giving me a message of com.ibm.mq.MQMessage type, which i add information to then send it in a queue. I can do this if I create my own MQQueueConnectionFactory in the application, but now I'm trying to set stuff up in WAS console and access in my java webapp via JNDI. How do I configure a jms resource via WAS console so that I can retrieve a com.ibm.mq.jms.MQQueueConnectionFactory instance via JNDI? Or how can I send a com.ibm.mq.MQMessage via standard javax.jms?### Assistant: There's acomplete scenariodemonstrating how to connect an application running in WebSphereApplication server to MQ in the MQ Knowledge Center. That will contain details of how to configure the JMS resources within the WAS admin panels.There's also one for theLiberty profileas well.Howeverthe com.ibm.mq.MQMessage is an object from the MQ Java Classes API - and is not a JMS Message. It's worth confirming the exact type here - as the MQ Java Classes should not ideally be used within a JavaEE environment -see this technotefor full details.\n"} +{"text": "### Human: Have a message in Websphere MQ. Have read the message and I am trying to backout the message to Input Queue. Retry threshold not yet reached. Does the MQ message automatically put into Input Q when exception occurs? This is my code:MQQueueManager qm = new MQQueueManager(\"\");\nMQQueue q = qm.accessQueue(\"\");\nMQMessage message = new MQMessage();\nq.get(message);\nSystem.out.println(\"Retry Count\"+ message.backoutCount);\nthrow new NullPointerException;Will the above code put the message to Input Queue again? In this case, it is not putting message back to Input Queue. Message is lost.### Assistant: Your message can only be backed out if it was part of a transaction to begin with. Your code doesn't use transactions.Take a look at the MQGMO options,MQGMO_SYNCPOINTandMQGMO_SYNCPOINT_IF_PERSISTENT(search for the stringMQGMO_SYNCPOINTin the below two links).MQ Java Classes CMQC constantsMQ API description of MQGMO_SYNCPOINT - applicable to all languagesAnd also the commit() and backout() methods on theMQQueueManager:MQQueueManager classand suggest you read this general purpose explanation of transactionsCommitting and backing out units of work\n"} +{"text": "### Human: I was working on File Output Node and staging files to mqsitransit directory before finish file. When I pass file name in LocalEnvironment to finish file terminal, the files from mqsitransit directory are moved to output directory.\nNow If an exception occurs before I can pass control to finish file terminal, the flow exits. In this case the files are still present in mqsitransit directory, but I don't want those file to be present there. How can I delete those files from mqsitransit directory?One solution can be by using FileRead Node to read and delete files, but this solution is not good as we have to specify input directory for this node which will be mqsitransit and as mqsitransit is used by IIB interanlly, we should not specify this path to any node.Any Solutions?### Assistant: There is not a facility for the FileOutput node to do this itself because doing so would cause data loss.If you are staging a file you are typically writing individual records to the file, these could have originated from multiple separate transactions so deleting the file would remove the results of these transactions.If you are operating in whole file mode and you get an exception in those circumstances the file will be deleted.When you say that the flow exits I am assuming that the flow is rolled back to the input node in which case presumably the input message is available for reprocessing, in which case if you generate an output file with the same file name and set the \"Action if file exists\" property to either replace the old file, or archive it with optional timestamp.I would not recommend pointing other file nodes at the mqsitransit directories as they will attempt to create locks on the same files and could impact the original flow.If you need a way to automatically cleanup files that will never be processed succesfully then you will need to raise an RFE for this feature at the following URI:https://www.ibm.com/developerworks/rfe/?PROD_ID=532\n"} +{"text": "### Human: I want to configure a Java application to work with a JMS IBM MQ queue using the bindings file.\nI am using the JMSDEMO application provided by IBM.\nIt works with a local MQ manager but I cannot make it connect to a remote one.\nI've generated the bindings file on the remote machine and copied it to my machine.I've changed the \"localhost\" in the bindings file to the remote machine name.\nHowever, the app still thinks it should connect to a local QM.\n(actually it ignores the hostname settings).Here's the IBM demo code:public static final String cfLookup = \"JMSDEMOCF\";\npublic static final String JNDITopic = \"JMSDEMOTopic\";\npublic static final String JNDIQueue = \"JMSDEMOQueue\";\npublic static final String icf =\"com.sun.jndi.fscontext.RefFSContextFactory\";........static String url = \"file:C:\\\\JMSDEMO\\\\JNDI\";..........Hashtable environment = new Hashtable();\n environment.put(Context.INITIAL_CONTEXT_FACTORY, icf);\n environment.put(Context.PROVIDER_URL, url);\n ctx = new InitialDirContext( environment );\n\n\n connFactory = (ConnectionFactory)ctx.lookup( cfLookup );\n\n\n connection = connFactory.createConnection();\n connection.start();Here are some fragments of the bindings file (JMSDEMOCF is the name of the connection factory)JMSDEMOCF/RefAddr/3/Content=\nJMSDEMOCF/RefAddr/29/Content=(the remote port)It also has the following line:JMSDEMOCF/RefAddr/116/Type=XMSC_WMQ_LOCAL_ADDRESSbut deleting it changes nothing.### Assistant: Create a new connection factory in your \"bindings file\" with MQ Explorer (why are you trying to edit the file by hand?), and specify the Transport option as MQ Client on this new connection factory (the default is Bindings, which is the local connection mode). \nOn the Connection tab specify the address of the QM, and on the Channels tab the server connection channel to be used to connect to the QM.Use the new connection factory in your application when connecting from a remote host. You may need to include some additional MQ JARs in the classpath.\n"} +{"text": "### Human: I am using spring with Websphere MQ for doing a publish / subscribe.\nAfter several tests, i can :create a non durable subcription on a topic by API and consume messagescreate a durable subcription on a topic by API and consume messagesMy goal now, it is to subscribe on an administratively subscription.\nWith Websphere Explore, I have created my administratively subscription associated to a local queue -> OKIn my application, I want to suscribe to this administratively subscription.\nI am using the same configuration like the step 2 above :\n\n \n \n \n \n\n\n \n \n\n\n \n\n\n\n\n\n \n \n \nIf i am not create the subscription, this configuration is going to create the subscription in the queue manager with this name :JMS:::And, I can consume messages.Now, if I have created the subscription in Websphere Explorer, I thinked the same configuration it is going to work.\nIn fact, the result is I have no errors during execution, but I can'nt consume the messages.I am following thistutorialfor created my differents objects in my MQ Manager.So, my questions are :is it possible to subscribe on an administratively subscription ?if yes, how to do that with Spring ?if no, what other solutions are beings?I can connect straight to the queue associated to the administratively subscription, but I think it is not a good solution.### Assistant: As JMS is being used underneath the Spring framework to talk to MQ the issue is that JMS is designed to primarily work with fully managed subscriptions, the creation of which is initiated by the client code.It is possible to used administrative subscriptions from JMS - the key is creating the subscription name in Explorer correctly to match what the MQ JMS client is creating.Information is available in thistechnoteto describe the syntax. It can be helpful as well to look at the name of the dynamic subscription that JMS creates in the case that you have working. If there happened to be one of the same name already - JMS would re-open that subscription.There is an RFE open to make this easier to use - please feel free to add your voice.\n"} +{"text": "### Human: Following is the error obtained on compiling the code$ cc -o mq mq.c\nld: 0711-317 ERROR: Undefined symbol: .MQCONN\nld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.mqconn function is defined in header file cmqc.h and the header file is included in mq.c fileHow to resolve this error which is related to linking of file?### Assistant: The fact that a functionprototypeis defined in a header file doesn't mean the function is defined in the header file. You're missing the library / object file which implements the functions prototyped incmqc.h\n"} +{"text": "### Human: I have a requirement to store large number of messages in a queue when the consumer is down and process them sequentially when the consumer is restored. I want to group together logically related messages and execute all the groups in parallel.Eg: Consider the queue below with 3 groups A, B, C. I have assigned seqnum to contents and unique groupIds to the groups correctly.\nQueue-1\nA1,A2,A3-last,B1,B2-last,C1,C2,c3,C4-lastIs it possible to Fetch A1, B1, C1 in parallel?Also currently the consumer is fetching A1, A2 and A3 correctly in order. But it is not able to fetch any content from group B or C. What might be wrong?Any suggestions will deeply help.### Assistant: First read thispagefrom the MQ Knowledge.I converted the pseudo code (from the web page above) to MQ classes for Java and changed it from a browse to a destructive get.Also, I prefer to do each group of messages under a syncpoint (assuming a reasonable sized groups).MQGetMessageOptions gmo = new MQGetMessageOptions();\nMQMessage rcvMsg = new MQMessage();\n\n/* Get the first message in a group, or a message not in a group */\ngmo.Options = CMQC.MQGMO_COMPLETE_MSG | CMQC.MQGMO_LOGICAL_ORDER | CMQC.MQGMO_ALL_MSGS_AVAILABLE | CMQC.MQGMO_WAIT | CMQC.MQGMO_SYNCPOINT;\ngmo.MatchOptions = CMQC.MQMO_MATCH_MSG_SEQ_NUMBER;\nrcvMsg.messageSequenceNumber = 1;\nrcvMsg.groupId = CMQC.MQGI_NONE;\ninQ.get(rcvMsg, gmo);\n\n/* Examine first or only message */\n ...\n\ngmo.Options = CMQC.MQGMO_COMPLETE_MSG | CMQC.MQGMO_LOGICAL_ORDER | CMQC.MQGMO_SYNCPOINT;\ndo while ((rcvMsg.messageFlags & CMQC.MQMF_MSG_IN_GROUP) == CMQC.MQMF_MSG_IN_GROUP)\n{\n rcvMsg.clearMessage();\n inQ.get(rcvMsg, gmo);\n /* Examine each remaining message in the group */\n ...\n}\nqMgr.commit();There are a couple of coding things that must be done: (1) using the right options and (2) clearing the groupId field before you get the next group.\n"} +{"text": "### Human: I have inherited an IMB MQ (V6) system that has multiple brokers. Is there a way to explore everything succinctly ?i.e. I know what queue managers are running, so without \"runmqsc\"ing each and every manager, how can i find broker names, listeners, etc ?There is the Explorer running but again points to knowing the manager and port to have it connect successfully.### Assistant: For MQ, the dmpmqcfg command can be useful to output your configuration info to a file.For the broker, try the mqsilist command to list installed brokers and their associated resources.this webpage may be of help to you:\nPerforming health checks for WebSphere Message Brokerhttp://www.ibm.com/developerworks/websphere/library/techarticles/0801_cui/0801_cui.html\n"} +{"text": "### Human: Application 1(A1) sends messages to A2 over MQ. A2 uses XA transactions so that a message dropped on the queue is picked by A2, processed and written to the DB and the whole transaction is committed at once.I would like to test whether A2 correctly maintains system consistency if the transaction fails mid-way and whether XA has been implemented correctly.I would like to stop the DB as soon as A2 picks up the message. But I am not sure whether I will have enough time to stop the DB and whether I will know for sure that the message has been picked.Any other suggestions for testing this?Thanks,Yash### Assistant: I am assuming you are using Java here, otherwise, some of this won't be applicable.The quick, pragmatic solution is to inject a delay into your process which will give you time to take your transactionally destructive action. The easiest way to do this would be to run the app in a debugger. Place a breakpoint at some suitable location (perhaps after the message has been received and the DB write is complete but not committed) and kill the DB when the debugger pauses the thread. Alternatively, add a test hook to your code whereby the thread will sleep if the MQ message has a header titled something unlikely like 'sleeponmessagereceived'.A more complex but sophisticated technique is to use error injection via some AOP tool. I would definitely look atByteman. It allows you to inject bytecode at runtime and was originally written to test XA scenarios like yours for the Arjuna transaction manager. You can inject code procedurally, or you canannotate unit testing procedures. Some of the advantages of this approach is that you can direct Byteman to trigger an error condition based on a variety of other conditions, such as nth invocation, or if a method arg is X. Also, depending on how detailed your knowledge of your transaction manager is, you can recreate a wider set of scenarios to produce some more tricky XA outcomes like Heuristic exceptions. There's some examplesherethat demonstrate how to use Byteman scripts to validate MQ XA Recovery. Thisprojectis intended to help reproducing XA failure and recovery. It is JBoss specific, but I would imagine you would be able to adapt to your environment.\n"} +{"text": "### Human: Our partner started using custom properties for messages being sent over IBM WebSphere MQ and our application developed using XMS.NET started to fail because of that.It turned out that the error is being thrown inside parsing the JMS envelope and inside the ParseJmsFolder method.This is the exception we get:IBM.XMS.XMSException: Failed to create XMS message.\nThe wrong message type or properties were specified when creating a base message.\nCheck the linked WebSphere MQ exception reason and completion code for more information.\n at IBM.XMS.Client.WMQ.WmqReceiveMarshal.ConstructProviderMessageFromRFH2(Int32 messageBodyStyle)\n at IBM.XMS.Client.WMQ.WmqReceiveMarshal.CreateProviderMessage()\n at IBM.XMS.Client.WMQ.WmqReceiveMarshal.ExportProviderMessage()\n at IBM.XMS.Client.WMQ.WmqAsyncConsumerShadow.Consumer(Phconn hconn, MQMessageDescriptor mqmd, MQGetMessageOptions mqgmo, Byte[] pBuffer, MQCBC mqcbc)\n\nLinked Exception : System.NullReferenceException: Object reference not set to an instance of an object.\n at IBM.XMS.Client.WMQ.Messages.WmqMessageBase.ParseJmsFolder(String input, Boolean persistenceFromMD)\n at IBM.XMS.Client.WMQ.WmqReceiveMarshal.ConstructProviderMessageFromRFH2(Int32 messageBodyStyle)And these are the details from tracing the issue down:[29.10.2015 11:24:32:893922 W. Europe Standard Time] 00000027 > UOW= source=IBM.XMS.Client.WMQ.Messages.WmqMessageBase method=ParseJmsFolder(String,bool) [:] org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nentry [queue://SV2098743/LQ.CORE.EVENTS21ade73268824414b8473c95ae93f7a571445934282747] [False]\n[29.10.2015 11:24:32:895922 W. Europe Standard Time] 00000027 d UOW= source=IBM.XMS.Client.WMQ.Messages.WmqMessageBase org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nParseFolderJms() : folder as string = queue://SV2098743/LQ.CORE.EVENTS21ade73268824414b8473c95ae93f7a571445934282747\n[29.10.2015 11:24:32:901923 W. Europe Standard Time] 00000027 > UOW= source=IBM.XMS.Client.WMQ.Messages.WmqMessageBase method=ParseFolderToPropertyNodes(StringBuilder) [:] org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nentry [queue://SV2098743/LQ.CORE.EVENTS21ade73268824414b8473c95ae93f7a571445934282747]\n[29.10.2015 11:24:32:903923 W. Europe Standard Time] 00000027 d UOW= source=IBM.XMS.Client.WMQ.Messages.WmqMessageBase org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nParseFolderToPropertyNodes(), Adding node values [Dst] [queue://SV2098743/LQ.CORE.EVENTS] []\n[29.10.2015 11:24:32:905923 W. Europe Standard Time] 00000027 d UOW= source=IBM.XMS.Client.WMQ.Messages.WmqMessageBase org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nParseFolderToPropertyNodes(), Adding node values [Exp] [] []\n[29.10.2015 11:24:32:906923 W. Europe Standard Time] 00000027 d UOW= source=IBM.XMS.Client.WMQ.Messages.WmqMessageBase org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nParseFolderToPropertyNodes(), Adding node values [Pri] [] []\n[29.10.2015 11:24:32:908924 W. Europe Standard Time] 00000027 d UOW= source=IBM.XMS.Client.WMQ.Messages.WmqMessageBase org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nParseFolderToPropertyNodes(), Adding node values [Dlv] [2] []\n[29.10.2015 11:24:32:910924 W. Europe Standard Time] 00000027 d UOW= source=IBM.XMS.Client.WMQ.Messages.WmqMessageBase org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nParseFolderToPropertyNodes(), Adding node values [Cid] [1ade73268824414b8473c95ae93f7a57] []\n[29.10.2015 11:24:32:911924 W. Europe Standard Time] 00000027 d UOW= source=IBM.XMS.Client.WMQ.Messages.WmqMessageBase org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nParseFolderToPropertyNodes(), Adding node values [Rto] [] []\n[29.10.2015 11:24:32:913924 W. Europe Standard Time] 00000027 d UOW= source=IBM.XMS.Client.WMQ.Messages.WmqMessageBase org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nParseFolderToPropertyNodes(), Adding node values [Gid] [] []\n[29.10.2015 11:24:32:915924 W. Europe Standard Time] 00000027 d UOW= source=IBM.XMS.Client.WMQ.Messages.WmqMessageBase org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nParseFolderToPropertyNodes(), Adding node values [Seq] [] []\n[29.10.2015 11:24:32:916924 W. Europe Standard Time] 00000027 d UOW= source=IBM.XMS.Client.WMQ.Messages.WmqMessageBase org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nParseFolderToPropertyNodes(), Adding node values [Tms] [1445934282747] []\n[29.10.2015 11:24:32:918925 W. Europe Standard Time] 00000027 < UOW= source=IBM.XMS.Client.WMQ.Messages.WmqMessageBase method=ParseFolderToPropertyNodes(StringBuilder) [:] org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nexit\n[29.10.2015 11:24:32:920925 W. Europe Standard Time] 00000027 > UOW= source=IBM.XMS.Client.WMQ.Messages.WmqMessageBase method=ExpandRefs(String) [:] org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nentry [queue://SV2098743/LQ.CORE.EVENTS]\n[29.10.2015 11:24:32:922925 W. Europe Standard Time] 00000027 < UOW= source=IBM.XMS.Client.WMQ.Messages.WmqMessageBase method=ExpandRefs(String) [:] org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nexit [queue://SV2098743/LQ.CORE.EVENTS]\n[29.10.2015 11:24:32:923925 W. Europe Standard Time] 00000027 d UOW= source=IBM.XMS.Client.WMQ.Messages.WmqMessageBase org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nParseJmsFolder(), PROP_DESTINATION_NAME [queue://SV2098743/LQ.CORE.EVENTS]\n[29.10.2015 11:24:32:925925 W. Europe Standard Time] 00000027 d UOW= source=IBM.XMS.Client.WMQ.Messages.WmqMessageBase org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nParseJmsFolder(), PROP_EXPIRATION_NAME [0]\n[29.10.2015 11:24:32:926925 W. Europe Standard Time] 00000027 d UOW= source=IBM.XMS.Client.WMQ.Messages.WmqMessageBase org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nParseJmsFolder(), PROP_PRIORITY_NAME [0]\n[29.10.2015 11:24:32:928926 W. Europe Standard Time] 00000027 d UOW= source=IBM.XMS.Client.WMQ.Messages.WmqMessageBase org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nParseJmsFolder(), PROP_DELIVERYMODE_NAME [1]\n[29.10.2015 11:24:32:929926 W. Europe Standard Time] 00000027 > UOW= source=IBM.XMS.Client.WMQ.Messages.WmqMessageBase method=ExpandRefs(String) [:] org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nentry [1ade73268824414b8473c95ae93f7a57]\n[29.10.2015 11:24:32:930926 W. Europe Standard Time] 00000027 < UOW= source=IBM.XMS.Client.WMQ.Messages.WmqMessageBase method=ExpandRefs(String) [:] org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nexit [1ade73268824414b8473c95ae93f7a57]\n[29.10.2015 11:24:32:933926 W. Europe Standard Time] 00000027 d UOW= source=IBM.XMS.Client.WMQ.Messages.WmqMessageBase org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nParseJmsFolder(), PROP_CORRELATIONID_NAME [1ade73268824414b8473c95ae93f7a57]\n[29.10.2015 11:24:32:934926 W. Europe Standard Time] 00000027 d UOW= source=IBM.XMS.Client.WMQ.Messages.WmqMessageBase org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nParseJmsFolder(), PROP_REPLYTO_NAME []\n[29.10.2015 11:24:32:935926 W. Europe Standard Time] 00000027 > UOW= source=IBM.XMS.Client.WMQ.Messages.WmqMessageBase method=ExpandRefs(String) [:] org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nentry []\n[29.10.2015 11:24:32:979931 W. Europe Standard Time] 00000027 < UOW= source=IBM.XMS.Client.WMQ.Messages.WmqMessageBase method=ExpandRefs(String) [:] org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nexit []\n[29.10.2015 11:24:32:981931 W. Europe Standard Time] 00000027 X UOW= source=IBM.XMS.Client.WMQ.Messages.WmqMessageBase org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nSystem.NullReferenceException: Object reference not set to an instance of an object.\n at IBM.XMS.Client.WMQ.Messages.WmqMessageBase.ExpandRefs(String input)\n at IBM.XMS.Client.WMQ.Messages.WmqMessageBase.ParseJmsFolder(String input, Boolean persistenceFromMD)\n[29.10.2015 11:24:32:993932 W. Europe Standard Time] 00000027 < UOW= source=IBM.XMS.Client.WMQ.Messages.WmqMessageBase method=ParseJmsFolder() [:] org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nexit\n[29.10.2015 11:24:32:995932 W. Europe Standard Time] 00000027 X UOW= source=IBM.XMS.Client.WMQ.WmqReceiveMarshal org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nSystem.NullReferenceException: Object reference not set to an instance of an object.\n at IBM.XMS.Client.WMQ.Messages.WmqMessageBase.ParseJmsFolder(String input, Boolean persistenceFromMD)\n at IBM.XMS.Client.WMQ.WmqReceiveMarshal.ConstructProviderMessageFromRFH2(Int32 messageBodyStyle)Our partner suggests to try some settings in XMS.NET regarding the JMS behaviour, but all the options we have tried end up with the same error.This is our configuration code:factory.SetStringProperty(XMSC.WMQ_HOST_NAME, \".....com\");\n factory.SetIntProperty(XMSC.WMQ_PORT, 1417);\n factory.SetStringProperty(XMSC.WMQ_CHANNEL, \"....\");\n factory.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);\n factory.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, \"....\");\n factory.SetIntProperty(XMSC.WMQ_BROKER_VERSION, XMSC.WMQ_BROKER_UNSPECIFIED);...var session = queueConnection.CreateSession(false, AcknowledgeMode.ClientAcknowledge);\n var queue = session.CreateQueue(\"....\");\n queue.SetIntProperty(XMSC.WMQ_MESSAGE_BODY, XMSC.WMQ_MESSAGE_BODY_JMS);\n var subscriber = session.CreateConsumer(queue);EDIT:This is an example message causing the issuecount=1412\n\n offset : 0 1 2 3 4 5 6 7 8 9 A B C D E F\n0x00000000 ( 0) : 52464820 00000002 00000108 00000111 : RFH........\n0x00000010 ( 16) : 000004b8 4d515354 52202020 00000000 : ..?MQSTR.......\n0x00000020 ( 32) : 000004b8 00000020 3c6d6364 3e3c4d73 : ..?....jms_text\n0x00000040 ( 64) : 3c2f6d63 643e2020 000000bc 3c6a6d73 : .....?queue://SV\n0x00000060 ( 96) : 32303938 3734332f 4c512e43 4f52452e : 2098743/LQ.CORE.\n0x00000070 ( 112) : 4556454e 54533c2f 4473743e 3c457870 : EVENTS21ade732688244\n0x000000b0 ( 176) : 31346238 34373363 39356165 39336637 : 14b8473c95ae93f7\n0x000000c0 ( 192) : 6135373c 2f436964 3e3c5274 6f3e3c2f : a57<\n0x000000e0 ( 224) : 5365713e 3c2f5365 713e3c54 6d733e31 : Seq>1\n0x000000f0 ( 240) : 34343539 33343238 32373437 3c2f546d : 445934282747H4sIAAAA\n0x00000110 ( 272) : 41414141 414a5656 57335061 4f68442b : AAAAAJVVW3PaOhD+\n0x00000120 ( 288) : 4b347a37 31706e45 4e787744 4939524a : K4z71pnENxwDI9RJ\n0x00000130 ( 304) : 4b47307a 49595135 70706670 53306659 : KG0zIYQ5ppfpS0fY\n0x00000140 ( 320) : 69394667 79315353 51386d76 50797362 : i9Fgy1SSQ8mvPysb\n0x00000150 ( 336) : 4579416b 74432b4a 64766662 5a532f66 : EyAktC+JdvfbZS/f\n0x00000160 ( 352) : 72736d48 50336e57 65675370 65434836 : rsmHP3nWegSpeCH6\n0x00000170 ( 368) : 6c6e7670 57433051 635a4677 6b666174 : lnvpWC0QcZFwkfat\n0x00000180 ( 384) : 72394e50 46783272 70545154 4363734b : r9NPFx2rpTQTCcsK\n0x00000190 ( 400) : 41583172 41387236 51496c51 586d2f34 : AX1rA8r6QIlQXm/4\n0x000001a0 ( 416) : 43454c66 67314973 68526147 45617148 : CELfg1IshRaGEaqH\n0x000001b0 ( 432) : 36723631 30487256 732b3331 656e305a : 6r610HrVs+31en0Z\n0x000001c0 ( 448) : 46336b4f 386d6e47 784e4b38 37626951 : F3kO8mnGxNK87biQ\n0x000001d0 ( 464) : 59412f77 5436526c 47657453 77746266 : YA/wT6RlGetSwtbf\n0x000001e0 ( 480) : 6f6d5437 2b674973 41556e4a 644c4d43 : omT7+gIsAUnJdLMC\n0x000001f0 ( 496) : 36684337 2b6b386d 6b75644d 62753567 : 6hC7+k8mkudMbu5g\n0x00000200 ( 512) : 59335237 55754e32 2b394559 6e675679 : Y3R7UuN2+9EYngVy\n0x00000210 ( 528) : 62334957 4f687052 78334852 73685052 : b3IWOhpRx3HRshPR\n0x00000220 ( 544) : 7773564e 71626841 384d4d4b 4a4e4e59 : wsVNqbhA8MMKJNNY\n0x00000230 ( 560) : 4f35304d 2f347365 78722b75 78365068 : O50M/4sexr+ux6Ph\n0x00000240 ( 576) : 352b4859 4f4a7843 56633452 2f433678 : 5+HYOJxCVc4R/C6x\n0x00000250 ( 592) : 53544175 71467344 397a5145 79354f51 : STAuqFsD9zQEy5OQ\n0x00000260 ( 608) : 56664462 684c7059 54656837 5635324f : VfDbhLpYTeh7V52O\n0x00000270 ( 624) : 31323637 37566d6e 48667078 4e324451 : 12677VmnHfpxN2DQ\n0x00000280 ( 640) : 39656368 43304a69 482b4c4a 7a576f4a : 9echC0JiH+LJzWoJ\n0x00000290 ( 656) : 51744451 63377975 467a6a64 304f6d36 : QtDQc7yuFzjd0Om6\n0x000002a0 ( 672) : 5164736e 39745a41 76745844 4d755532 : Qdsn9tZAvtXDMuU2\n0x000002b0 ( 688) : 547a4a59 4d434567 6f772f6a 30653134 : TzJYMCEgow/j0e14\n0x000002c0 ( 704) : 69444733 3871346a 54566533 346b3252 : iDG38q4jTVe34k2R\n0x000002d0 ( 720) : 594f7455 4d775144 54364761 70327239 : YOtUMwQDT6Gap2r9\n0x000002e0 ( 736) : 5562796e 73656c39 53366832 6231776b : Ubynsel9S6h2b1wk\n0x000002f0 ( 752) : 4d4a4441 4e435257 79347876 57706e71 : MJDANCRWy4xvWpnq\n0x00000300 ( 768) : 62694531 646f556a 655a4136 4a6b534e : biE1doUjeZA6JkSN\n0x00000310 ( 784) : 4f484263 41303858 756d3935 316f346f : OHBcA08Xum951o4o\n0x00000320 ( 800) : 37664e45 6955376b 31775441 4c413843 : 7fNEiU7k1wTALA8C\n0x00000330 ( 816) : 7250334c 51716132 68384f32 66397950 : rP3LQqa2h8O2f9yP\n0x00000340 ( 832) : 6f6e6742 4f627667 776e4133 4e765153 : ongBObvgwnA3NvQS\n0x00000350 ( 848) : 6d4d3942 62554676 67753072 78484e4b : mM9BbUFvgu0rxHNK\n0x00000360 ( 864) : 77666d55 4a6b7a71 44556162 7654616c : wfmUJkzqDUabvTal\n0x00000370 ( 880) : 72594777 70516178 4c455843 30776934 : rYGwpQaxLEXC0wi4\n0x00000380 ( 896) : 7070376a 42686575 632b4746 4c616662 : pp7jBheuc+GFLafb\n0x00000390 ( 912) : 63344e65 32373930 6e614472 58335775 : c4Ne2790naDrX3Wu\n0x000003a0 ( 928) : 726f6839 4443644d 53456741 36596f4d : roh9DCdMSEgA6YoM\n0x000003b0 ( 944) : 3237304a 4b785743 3568716b 42703656 : 270JKxWC5hqkBp6V\n0x000003c0 ( 960) : 49715866 30667843 53576177 52736b38 : IqXf0fxCSWawRsk8\n0x000003d0 ( 976) : 63614d78 715a3149 73424c46 6b576544 : caMxqZ1IsBLFkWeD\n0x000003e0 ( 992) : 477a2b61 44712b4a 33536a51 386d2b38 : Gz+aDq+J3SjQ8m+8\n0x000003f0 ( 1008) : 50635154 344d4b63 45633141 4a494b72 : PcQT4MKcEc1AJIKr\n0x00000400 ( 1024) : 6a7a6834 6f566241 63524453 2f4c4a48 : jzh4oVbAcRDS/LJH\n0x00000410 ( 1040) : 37484f51 6b7a464b 6d49484d 7564625a : 7HOQkzFKmIHMudbZ\n0x00000420 ( 1056) : 4731454f 5165666a 44496f5a 4d777630 : G1EOQefjDIoZMwv0\n0x00000430 ( 1072) : 6438446a 6550644d 4c6b486a 68527a6d : d8DjePdMLkHjhRzm\n0x00000440 ( 1088) : 6a47636e 34687742 58765766 4645712f : jGcn4hwBXvWfFEq/\n0x00000450 ( 1104) : 3556375a 582f5765 5167627a 2b684363 : 5V7ZX/WeQgbz+hCc\n0x00000460 ( 1120) : 6735414d 55713778 614a7070 525a7270 : g5AMUq7xaJppRZrp\n0x00000470 ( 1136) : 556c456b 36776b74 79657444 57562f4e : UlEk6wktyetDWV/N\n0x00000480 ( 1152) : 526d6930 64386962 6e66594f 3156777a : Rmi0d8ibnfYO1Vwz\n0x00000490 ( 1168) : 4f555043 6773534e 4b2f5554 78637635 : OUPCgsSNK/UTxcv5\n0x000004a0 ( 1184) : 556b6b45 79334855 54306850 634f6d31 : UkkEy3HUT0hPcOm1\n0x000004b0 ( 1200) : 30495634 5034326d 37794b45 7a434442 : 0IV4P42m7yKEzCDB\n0x000004c0 ( 1216) : 4838364a 6659445a 392f446f 6764457a : H86JfYDZ9/DogdEz\n0x000004d0 ( 1232) : 75787776 6670616a 4f6e734f 45675364 : uxwvfpajOnsOEgSd\n0x000004e0 ( 1248) : 73307742 346c3561 794d7273 374c5938 : s0wB4l5ayMrs7LY8\n0x000004f0 ( 1264) : 374e572b 53466256 4357435a 4b4d3279 : 7NW+SFbVCWCZKM2y\n0x00000500 ( 1280) : 5539384a 77363644 2b33696b 4a327554 : U98Jw66D+3ikJ2uT\n0x00000510 ( 1296) : 4b484956 4b573969 37497559 61727777 : KHIVKW9i7IuYarww\n0x00000520 ( 1312) : 2b564573 71585655 30745a43 4867745a : +VEsqXVU0tZCHgtZ\n0x00000530 ( 1328) : 50617261 69643249 524b306b 596a436d : Paraid2IRK0kYjCm\n0x00000540 ( 1344) : 67314562 67656836 62436b59 4463534c : g1Ebgeh6bCkYDcSL\n0x00000550 ( 1360) : 36334c2b 5a4e5a45 4748596a 38453237 : 63L+ZNZEGHYj8E27\n0x00000560 ( 1376) : 61554b43 51657954 352f3335 6b31422f : aUKCQeyT5/35k1B/\n0x00000570 ( 1392) : 412b7a6a 4c7a6e39 48393774 66794954 : A+zjLzn9H97tfyIT\n0x00000580 ( 1408) : 43414141 : CAAA### Assistant: Is the sender application a JMS (or XMS) application or they hand crafting JMS headers? What version of XMS .NET are you using? Using RFHUtil,I sent a message containing the JMS folder data your provided above and I see that XMS .NET V8.0 works fine. I also had to set the message type as jms_bytes. So I am wondering if the sender application is setting the message type correctly. Without the message type, application will get type casting error while receiving message.\n"} +{"text": "### Human: I am using IBMWebsphere MQ 7.5 in Unix system. I have installed the client on my machine and server is running on other machine. I am observing a scenario where I am able to communicate with server when running myJMS application via 'mqm' userbut facing below mentioned error when using other user.But I am able to run 'amqsputc' and 'amqsgetc' command and communicate with the server with mqm as well as other user also. I have followed all steps mentionedhttp://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.ins.doc/q009300_.htm?lang=enException:com.ibm.msg.client.jms.DetailedJMSSecurityException: JMSWMQ2013: The security authentication was not valid that was supplied for QueueManager 'TestManager' with connection mode 'Client' and host name 'x.x.x.x(9923)'.\nPlease check if the supplied username and password are correct on the QueueManager to which you are connecting.\n at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:521)\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:221)\n at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:426)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:6902)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6277)\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:285)\n at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6233)\n at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:120)\n at com.ibm.mq.jms.MQQueueConnectionFactory.createConnection(MQQueueConnectionFactory.java:203)\n at performance.IBMMQTestProducer.start(IBMMQTestProducer.java:142)\n at performance.IBMMQTestProducer.main(IBMMQTestProducer.java:177) \n\nCaused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED').**\n at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:209)\n ... 9 more\nCaused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2035;AMQ9509: Program cannot open queue manager object. [1=2035,5=???]**\n at com.ibm.mq.jmqi.internal.JmqiTools.getQueueManagerInfo(JmqiTools.java:783)\n at com.ibm.mq.jmqi.remote.impl.RemoteSession.loadInfo(RemoteSession.java:1993)\n at com.ibm.mq.jmqi.remote.impl.RemoteSession.getName(RemoteSession.java:2026)\n at com.ibm.mq.jmqi.remote.api.RemoteHconn.getName(RemoteHconn.java:728)\n at com.ibm.mq.ese.intercept.JmqiConnInterceptorImpl.validate(JmqiConnInterceptorImpl.java:321)\n at com.ibm.mq.ese.intercept.JmqiConnInterceptorImpl.afterConnect(JmqiConnInterceptorImpl.java:226)\n at com.ibm.mq.ese.intercept.JmqiConnInterceptorImpl.afterJmqiConnect(JmqiConnInterceptorImpl.java:133)\n at com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.jmqiConnect(InterceptedJmqiImpl.java:315)\n at com.ibm.mq.ese.jmqi.ESEJMQI.jmqiConnect(ESEJMQI.java:337)I am able to run it when I am running as myself and passing 'mqm' when starting the connection.connection = cf.createConnection(\"mqm\", \"pswd\");I am not getting anything in manager's log. Below is the log.------------------------------------------------------------------------------\n10/30/2015 06:50:54 AM - Process(31064.1) User(mqm) Program(strmqm)\n Host(x.x.x.x) Installation(Installation1)\n VRMF(7.5.0.2)\nAMQ7125: There are 83 days left in the trial period for this copy of WebSphere\nMQ.\n\nEXPLANATION:\nThis copy of WebSphere MQ is licensed for a limited period only.\nACTION:\nNone.### Assistant: Given that you have told us that you have successfully connected and run theamqsgetcandamqsputcclient samples using the same server-connection channel as you are attempting to use for your JMS program that suggests that this is not a connection time problem, in other words theMQCONNto the queue manager has been successful and something following that is failing. We know that you canMQPUTandMQGET(since that is what the aforementioned samples do).Something that JMS does that those simple samples do not do, is anMQINQof the queue manager. The following part of your exception makes me wonder if that is what you are tripping over:-Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2035;\nAMQ9509: Program cannot open queue manager object. [1=2035,5=???] at \ncom.ibm.mq.jmqi.internal.JmqiTools.getQueueManagerInfo(JmqiTools.java:783) atTo be completely certain you must check the queue managerAMQERR01.LOGto see what is reported there. If it is missing authorization then it will tell you there.\n"} +{"text": "### Human: I am facing this issue with IBM Websphere MQ v7.5 on Unix :WebSphere 7, configuring JMS Q connection factory without user id: MQRC_NOT_AUTHORIZEDAs mentioned in the link, I need to set the user ID to mqm in WAS admin panel. I can't have any GUI support on my system. Is there a way to do this by some commands ?Thanks,Anuj### Assistant: Your question is a bit ambiguous, but if you are looking to change the MCA user on the server connection channel of the QM used by WAS, then you can do the following on the MQ server.Start MQ command line console:runmqsc In the MQ console:alter channel() chltype(SVRCONN) mcauser()\n"} +{"text": "### Human: My configurationMDB using activation specs on WAS 7Default MQ Resource adapter configTime to time, the connection is lost between the WAS and MQ and the MDB shuts down. Is there an easy way to send emails when it happens other than by activating the tracing on the resource adapter and defining a smtp log appender?### Assistant: As far as I know there is no way to send an eMail when the connection between WebSphere and MQ is lost.But you can configure WebSphere to try to reestablish the lost connection. You can configure the number of reconnect retries as well as the time interval between two retries.\nWith the default configuration WebSphere stops retries to reestablish a lost connection after a relative short time. I asume between 20 to 30 minutes.If you use a listener port to connect your MDB to MQ you have to set properties of the listener port service. Search for MAX.RECOVERY.RETRIES and RECOVERY.RETRY.INTERVAL in online WebSphere documentation.If you use an activation specification you have to configure the properties of the built-in MQ Resource adapter. This is a tricky thing, as this resource adapter is not displayed in WebSphere amdin console per default. Open WebSphere Admin console > Resource > Resource adapter and open the preferences. There you have to click the checkbox \"show built-in resource adapter\" and then \"Apply\". You can find the recovery settings for lost connections in the MQ Resource adapter's custom properties. Be sure you select the adapter with the same scope as your activation specification.Hope that hepls.\n"} +{"text": "### Human: I'm trying to Receive a Group Message from awebsphere mq 8 Queue Managerwithin a Java mdb.\nWhen getting theLastMessageInGroupI Receive ajmsxgroupidlike'ID:45fdea5589'(getStringProperty) from the message.\nWhen I'm trying to get the other Messages of this Group I'm Using amessageconsumerwith amessageselectorwhere I'm Adding exactly thejmsxgroupidwith an additionaljmsxsequencefrom above, but When calling the methodreceiveNoWaitfrom themessageConsumerI receive aNullBytesMessageThe Funny thing is, when thegroupidis Human readable String like '20151019' it Works.So this is part of the Code.We receive lastMessage in the method onMessage of our MDB.We read the JMSXGroupID of this lastMessage with the methodString gid = lastMessage.getStringProperty(\"JMSXGroupID\").\nThen we build a selector to get the other message(s) of this group like this:String strSelector = \"JMSXGroupID='\" + gid + \"' AND JMSXGroupSeq=1\";consumer = session.createConsumer(destIncoming, strSelector);bmCurrentMessage = (BytesMessage) consumer.receiveNoWait();When the gid is like 'ID:8d74b544d5862f32156cbfe845077c02d18ba33ac51c06aa' we receive a null BytesMessage! The mq acts like the queue is empty.When the gid is like '20151015081515' we receive the other messages of the group message!Any Tips what I Should do different?Thanks so far for Reading\nThomas### Assistant: Well after long time of analysing together with MQ experts from IBM we had to install a fix package offered by IBM to fix this problem. So there was obviously no problem with our code but some problem inside the IBM code of the MQ Server 8 we were using.Now the problem is solved by installing the latest fix of IBM.Thanks to all for reading and thinking about my problem!\n"} +{"text": "### Human: In our company we are using IBM MQ server for message queueing. For the same queue we are putting both String and Object type data message with the help of methods WriteObject and WriteString.The challenge is occured when it comes to consumption(read message) of queue. Since the Get data can be both Object or String we need to decide which method to use ReadString or ReadObject on the MQMessage instance. I made workaround like firstly using ReadObject method, if an exception occured then try it with ReadString.I did not like this workaround, is there any way to identify message data type after calling MQQueue instance's Get method?Here below you can find my workaround:public object GetMessage(string queueName) {\n\n MQQueueManager queueManager = new MQQueueManager(\"queueManagerName\", \"channel\", \"connection\");\n MQGetMessageOptions queueGetMessageOptions = new MQGetMessageOptions();\n queueGetMessageOptions.Options = MQC.MQGMO_WAIT + MQC.MQGMO_FAIL_IF_QUIESCING + MQC.MQPMO_SYNCPOINT;\n\n try {\n queueRead = queueManager.AccessQueue(queueName, MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING);\n queueMessage = new MQMessage();\n queueMessage.Format = MQC.MQFMT_STRING;\n queueRead.Get(queueMessage, queueGetMessageOptions);\n\n try {\n var readObject = queueMessage.ReadObject();\n return readObject;\n } catch (SerializationException) { } // if message in queue not a object\n\n queueMessage.DataOffset = 0;\n var stringMsg = queueMessage.ReadString(queueMessage.MessageLength);\n return stringMsg;\n\n } catch (MQException exp) { \n if (exp.ReasonCode != 2033) {\n log.ErrorFormat(\"MQException: ResonCode: {0}, {1}\", exp.ReasonCode, exp.Message); \n }\n }\n return \"\";\n }### Assistant: What a horrible design.First off, why are you putting 2 different message types into the same queue? Bad, very bad idea. You should be using 2 different queues. What, does someone think queues are scarce or rare? You should be handing out queues like candy.Secondly, if you really need to go with this design then you should read the MQ Knowledge Center onMQMD structure. It contains a field called 'Message Type'. Most applications use 'Message Type' to contain either 'MQMT_DATAGRAM' or 'MQMT_REQUEST' but you can set your own values starting with 'MQMT_APPL_FIRST'.So, define a couple of constants:public const int MY_MSG_OBJECT = MQC.MQMT_APPL_FIRST + 1;\npublic const int MY_MSG_STRING = MQC.MQMT_APPL_FIRST + 2;Hence, the sending application putting a string message would do:MQMessage sendmsg = new MQMessage();\nsendmsg.Format = MQC.MQFMT_STRING;\nsendmsg.MessageType = MY_MSG_STRING;\nsendmsg.WriteString(\"This is a test message\");\nqueue.Put(sendmsg, pmo);and the sending application putting an object message would do:MQMessage sendmsg = new MQMessage();\nsendmsg.Format = MQC.MQFMT_NONE;\nsendmsg.MessageType = MY_MSG_OBJECT;\nsendmsg.WriteObject(someObject);\nqueue.Put(sendmsg, pmo);The receiving application would do:MQMessage rcvmsg = new MQMessage();\nqueue.Get(rcvmsg, gmo);\n// Check the Message Type\nif (rcvmsg.MessageType == MY_MSG_STRING)\n{\n readString = queue.ReadString();\n}\nelse if (rcvmsg.MessageType == MY_MSG_OBJECT)\n{\n readObject = queue.ReadObject();\n}\nelse\n{\n System.Console.Out.WriteLine(\"Error: Unknown message type.\");\n}\n"} +{"text": "### Human: I've below code which connects to IBM Websphere MQ that doesn't have SSL without issues and able to put/ get messages. But when I try to connect with a MQ with SSL, i'm getting error.Please note that the patch() method is to disable SSL, which gets executed but isn't disabling SSL.Rather than this, can you tell me how I can connect to the MQ that has SSL enabled channel.Note - I've the certificate files like - key.kdb, key.crl, key.rdb, key.sth and few other CA3, CA4.cer files. How do I install them and use it in my code?import com.ibm.mq.MQEnvironment;\nimport com.ibm.mq.MQMessage;\nimport com.ibm.mq.MQPutMessageOptions;\nimport com.ibm.mq.MQQueue;\nimport com.ibm.mq.MQQueueManager;\nimport com.ibm.mq.constants.CMQC;\nimport com.ibm.mq.*;\n\nimport java.io.IOException;\nimport java.net.URL;\nimport java.security.KeyManagementException;\nimport java.security.NoSuchAlgorithmException;\nimport java.security.cert.CertificateException;\nimport java.security.cert.X509Certificate;\nimport java.util.Hashtable;\n\nimport javax.net.ssl.HostnameVerifier;\nimport javax.net.ssl.HttpsURLConnection;\nimport javax.net.ssl.SSLContext;\nimport javax.net.ssl.SSLSession;\nimport javax.net.ssl.TrustManager;\nimport javax.net.ssl.X509TrustManager;\n\npublic class mq1 {\n\npublic static String host = \"localhost\";\npublic static int port = 1414;\npublic static String strchannel = \"MQ.CHL\";\npublic static String strqueuemanager = \"MQMGR\";\npublic static String strqueue = \"REQUEST.QUEUE\";\n\n@SuppressWarnings(\"deprecation\")\npublic static void main(String[] args) throws KeyManagementException, NoSuchAlgorithmException {\n//call patch() to skip SSL \npatch();\n\nint openOptions = CMQC.MQOO_BROWSE | CMQC.MQOO_INQUIRE | CMQC.MQOO_OUTPUT | CMQC.MQOO_INPUT_AS_Q_DEF ;\n\nMQEnvironment.hostname = host;\nMQEnvironment.port = port;\nMQEnvironment.channel = strchannel;\nMQEnvironment.properties.put(CMQC.TRANSPORT_PROPERTY,CMQC.TRANSPORT_MQSERIES);\n\nMQQueueManager qMgr;\ntry {\nqMgr = new MQQueueManager (strqueuemanager);\nSystem.out.println(qMgr);\nMQQueue destQueue = qMgr.accessQueue(strqueue, openOptions);\nSystem.out.println(\"Queue size:\" + destQueue.getCurrentDepth()); \nMQMessage hello_world = new MQMessage(); \nSystem.out.println(\"MQMessage message created\");\nhello_world.writeUTF(\"Sending Sample message\"); \nMQPutMessageOptions pmo = new MQPutMessageOptions();\ntry {\ndestQueue.put(hello_world,pmo);\ndestQueue.get(hello_world);\n}\ncatch (Exception e)\n{\nSystem.out.println(e.getMessage());\n}\n\nint len = hello_world.getDataLength();\nSystem.out.println(\"Length : \" + len);\nSystem.out.println(\"GET: \"+ hello_world.readString(len-1));\ndestQueue.close();\nqMgr.disconnect();\n} catch (Exception e) {\ne.printStackTrace();\n}\n}\n\n\npublic static void patch() throws KeyManagementException, NoSuchAlgorithmException {\n\nSystem.out.println(\"Calling SSL patch\");\n\nTrustManager[] trustAllCerts = new TrustManager[]{\nnew X509TrustManager() {\npublic java.security.cert.X509Certificate[] getAcceptedIssuers() {\nreturn null;\n}\n\npublic void checkClientTrusted(X509Certificate[] certs, String authType) {\n}\n\npublic void checkServerTrusted(X509Certificate[] certs, String authType) {\n}\n\n}\n};\n\nSystem.out.println(\"trustAllCerts = \"+trustAllCerts);\n\nSSLContext sc = SSLContext.getInstance(\"SSL\");\n\nSystem.out.println(\"sc before init = \"+sc);\n\nsc.init(\nnull, trustAllCerts, new java.security.SecureRandom());\nHttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());\nHostnameVerifier allHostsValid = new HostnameVerifier() {\npublic boolean verify(String hostname, javax.net.ssl.SSLSession session) {\nreturn true;\n}\n};\n\nSystem.out.println(\"sc after init= \"+sc);\nSystem.out.println(\"allHostsValid= \"+allHostsValid);\n// Install the all-trusting host verifier\nHttpsURLConnection.setDefaultHostnameVerifier(allHostsValid);\n}\n\n}### Assistant: Easiest way is not to put it in your code at all and instead utilise a Client Channel Definitiin Table (CCDT). Then you can use it without SSL and later change the CCDT to use SSL without needing to change your code at all. This is considered the best practice for client connectivity to IBM MQ.This will mean you stop using theMQEnvironmentclass to pass in things like the channel name, hostname etc, and instead use a slightly differentMQQueueManagerconstructor with two parameters, the first is the queue managers name as before, the second is the name of your CCDT file.You can read more about how to use the CCDT with Java in the official IBM MQ Knowledge Center at the following page which also includes a link to how to create the CCDT file:-Using a client channel definition table with IBM MQ classes for Java\n"} +{"text": "### Human: We are using IBM WebSphere MQ to implement simple pub/sub, with one writer putting binary protobuf messages on a queue and multiple readers browsing it. All readers are browsing (there are no destructive gets) so the messages are set to expire after 10 seconds.We are experiencing an issue messages using the .NET MQ client library, where very small messages seem to be buffered and received in a batch, rather than being received immediately as soon as they are put on the queue.We are callingGet()withMQGMO_FAIL_IF_QUIESCING | MQGMO_WAIT | MQGMO_BROWSE_FIRST/NEXTandWaitInterval = MQWI_UNLIMITED. With these flags,Get()blocks indefinitely until returning the next available message.When the messages are larger than 4KB, an unlimited blocking get behaves as expected and returns as soon as a message is available:Sender | Reader \n------------+------------\n | get \n put msg #1 | \n | <-- msg #1 \n | get \n put msg #2 | \n | <-- msg #2 \n | get \n put msg #3 | \n | <-- msg #3However when the messages are small (approx 130 bytes in our case), then get doesn't return until two or three messages are available:Sender | Reader \n------------+------------\n | get \n put msg #1 | \n put msg #2 | \n put msg #3 | \n | <-- msg #1 \n | get \n | <-- msg #2 \n | get \n | <-- msg #3The messages appear immediately in AppWatch, and are received immediately if we change from browse to destructive get. So we know it's a problem with the reader and browsing.We have identified three workarounds but they are not optimal:Pad messages to ensure they are always larger than 4KBInstead ofMQWI_UNLIMITED, callGet()in a loop withWaitInterval= e.g. 10s. This means individual messages will be received , but they will be up to 10s late.Switch to destructive read instead of browse. But this means we would need a dedicated queue per reader.Has anyone experienced this problem before?### Assistant: If the sender and receiver application are connected to a different queue manager, and the queue managers are connected via a channel, then this can be fixed by amending the BATCHLIM attribute of the channel:http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.ref.con.doc/q114230_.htmChannels transfer messages in batches, and until a batch is not committed, the messages transferred in that batch are not available for get. Batches are committed when either the number of messages, the size of the transferred messages or the time interval of the batch being open reach the threshold set on the channel.\n"} +{"text": "### Human: I am sending message from Java Code toWebsphere MQ Serverand when I am reading the same message on MQ server, it's displaying as:messageBelow is the code sending the message to MQ server:private void sendMessage() throws Exception {\n ConnectionFactory cf1 = (ConnectionFactory) new InitialContext().lookup(\"java:comp/env/jms/wmqCF\");\n\n // Lookup Queue resource from JNDI\n Queue queue = (Queue) new InitialContext().lookup(\"java:comp/env/jms/wmqQ1\");\n Connection con = cf1.createConnection();\n\n // start the connection to receive message\n con.start();\n\n // create a queue session to send a message\n Session sessionSender = con.createSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);\n\n MessageProducer send = sessionSender.createProducer(queue);\n\n TextMessage msg = sessionSender.createTextMessage(\"Liberty Sample Message\");\n\n // send a sample message\n send.send(msg);\n\n if (con != null)\n con.close();\n System.out.println(\"Send Message Completed\");\n }Expected to be displayed as:Liberty Sample Message.Any idea, what I am missing here?Thanks.### Assistant: And if you retrieve the message with another JMS program then the message data will be \"Liberty Sample Message\".You are mixing JMS and non-JMS program types..lookup(\"java:comp/env/jms/wmqQ1\");Set the 'TARGCLIENT' attribute to MQ. i.e. TARGCLIENT(MQ)Then the message data will not have the RFH2 header.\n"} +{"text": "### Human: Closed. This question needsdetails or clarity. It is not currently accepting answers.Want to improve this question?Add details and clarify the problem byediting this post.Closed7 years ago.Improve this questionOn Windows Server, the event viewer can provide several errors like 2035 or insufficient size of logs for transactions,...\nI don't see where i can find exactly the same events logs on unix ( Solaris & Redhat). Nothing on syslog, messages and audit.\nAny idea ?### Assistant: Because the 2035 is an error returned to the application, it is not something that is logged in the QMGR error logs by default. You can however enable reporting on the 2035 so that you can troubleshoot it further yourself. UseMQSAUTHERRORSto generate a FFDC detail or useMQS_REPORT_NOAUTHto better diagnose return code 2035\n"} +{"text": "### Human: In C#, using IBM WebSphere MQ, I run:var properties = new Hashtable();\nproperties.Add(MQC.HOST_NAME_PROPERTY, someHostName);\nvar queueManager = MQQueueManager(someQueueNameManager, properties);I get an exception:System.Exception: Channel and Connection MUST be specifiedObviously, it wants me to specify the channel. But I don't want to specify the channel. Is it important to specify it? I mean, When I runvar queueManager = MQQueueManager(someQueueNameManager);It works and connects to the local MQ. How can I create an MQQueueManager object that connects to a queue manager in a different host without specifying any channel? If specifying a channel is necessary, please explain why that is the case.### Assistant: You need a MQI Channel (Server Conn or Server Conn & Client Conn) to connect to a remote queue manager (ie a qmgr running on a remote host) over the network. The channel connects to the qmgr and puts/gets the messages for you. For a local qmgr, you can connect in bindings mode (and that's what you have done). This mode bypasses the network stack and connects to the qmgr using shared memory and semaphores.This is one of the basic technical concept in IBM MQ. I suggest reading the MQ primer. It's small and covers all you need to know about MQ before using it.http://www.redbooks.ibm.com/redpapers/pdfs/redp0021.pdf\n"} +{"text": "### Human: Hi I have a error when I try to create instance of MQQueueManager. The line 63 (from error) is create instance MQQueueManager.The queue is configured on machine where I can not login and I don't know that the queue is running.Is the error can deduce the cause of the failure?System.TypeInitializationException: The type initializer for 'IBM.WMQ.MQQueueManager' threw an exception. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.\n at IBM.WMQ.Nmqi.NativeManager.InitializeNativeApis(String mode)\n --- End of inner exception stack trace ---\n at IBM.WMQ.MQCommonServices..ctor()\n --- End of inner exception stack trace ---\n at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)\n at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)\n at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)\n at System.Activator.CreateInstance(Type type, Boolean nonPublic)\n at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)\n at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)\n at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)\n at IBM.WMQ.CommonServices.CreateCommonServices()\n at IBM.WMQ.CommonServices.TraceEnabled()\n at IBM.WMQ.MQBase..ctor()\n at IBM.WMQ.Nmqi.NmqiEnvironment..ctor(NmqiPropertyHandler nmqiPropertyHandler)\n at IBM.WMQ.Nmqi.NmqiFactory.GetInstance(NmqiPropertyHandler properties)\n at IBM.WMQ.MQQueueManager..cctor()\n --- End of inner exception stack trace ---\n at IBM.WMQ.MQQueueManager..ctor(String queueManagerName)\n at Ccap.Bnp.MQAdapter..ctor() in D:\\Programowanie\\Xxx\\MQAdapter.cs:line 63### Assistant: You are passing just the queue manager name to theMQQueueManagerconstructor. Have you initializedMQEnvironment? You need to initializeMQEnvironmentwhen using aMQQueueManagerconstructor that takes only the queue manager as parameter. The other way is to pass aHashtablecontaining host, port and channel properties to MQQueueManager constructor to establish a connection to a queue manager running on a different machine. If you have not initializedMQEnvironmentor not using aHashtableto pass host, port and channel properties, then theMQ.NETclient will attempt to connect to a queue manager running on the same machine as your application.Also do you have MQ Client installed on the machine where you run your application? You may be attempting to run your application with just AMQMDNET.DLL copied. This is one of the possible cause forSystem.TypeInitializationExceptionexception. The AMQMDNET.DLL has dependency on other assemblies and native libraries.I can update my answer based on your response.UpdateYou need MQ Client installed to run your application. Without the MQ Client your application will not work. Download and install MQ Client fromhere\n"} +{"text": "### Human: I've been tasked with creating a new flow and for some reason I can't access the data that is coming in from the 'IN' Queue. I'm using MessageBrokerToolkit 7.0.0.1 in windows. The test messages are the same ones that work in production.CREATE COMPUTE MODULE FLOW_Compute\n CREATE FUNCTION Main() RETURNS BOOLEAN\n BEGIN\n DECLARE TMP ROW PASSTHRU('SELECT RAWTOHEX(UTL_RAW.CAST_TO_RAW(DBMS_OBFUSCATION_TOOLKIT.md5(INPUT_STRING => CURRENT_TIMESTAMP)))UNIQUE_ID FROM DUAL'); \n DECLARE blobMSG BLOB InputRoot.BLOB.BLOB; \n DECLARE MSG CHARACTER CAST(blobMSG AS CHARACTER CCSID InputRoot.MQMD.CodedCharSetId ENCODING InputRoot.MQMD.Encoding); \n DECLARE TITLE CHAR InputRoot.XML.Request.\"MessageID\";\n\n PASSTHRU(\n 'INSERT INTO PA0101.DEBUG_TABLE VALUES(?,?,?)',\n TMP.UNIQUE_ID,\n TITLE,\n MSG,\n );\n RETURN TRUE;\nEND;The DEBUG_TABLE rows come out like:\n(pipe delimited)F69A159||| \n11C7EBF||| \n1077ADD|||Here is a sample message:\n a1f5298a-e339-423b-ac9a-4654cb46e965\n false\n \n Realtime\n 08/09/2015\n Action\n 1\n This is important\n [lots of html]\n \nWhen I try to run command line utils on the server I usually get:\nld.so.1: : fatal: libjvm.so: open failed: No such file or directory\nKilledThe code doesn't produce any warnings and the .bar file builds + deploys so I am at a loss for what could be going wrong.### Assistant: Most likely you are not using the message domain set on the input node in your ESQL.You cannot use both the XML and the BLOB domain at the same time, the input message will be parsed in one or the other domain, as configured on the input node (or ResetContentDescriptor nodes in your flow).\nSo either InputRoot.BLOB or InputRoot.XML will be NULL. And I think that you are actually using the XMLNSC domain in your input node and the messsage body parsed in that domain can be accessed under InputRoot.XMLNSC.In case you need the message body as BLOB and parsed as XML in the same flow, you should set the message domain as BLOB in the input node and parse the message latter in the flow by using the ResetContentDescriptor node, or by using the PARSE option of the CREATE in ESQL:http://www-01.ibm.com/support/knowledgecenter/api/content/nl/en-us/SSKM8N_8.0.0/com.ibm.etools.mft.doc/ak04950_.htm\n"} +{"text": "### Human: Installed:IBM Websphere MQ v7.5GlassFish v3.1.2.2MQ Explorer v7.5I'm trying to configure resource adapter for GlassFish to use Websphere MQ resources and following the instruction fromhttp://www-01.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.dev.doc/q121520_.htm. I cannot get past the final step #8 because the error is preventing EAR from deploying due to missing JNDI destination name and I cannot find the solution. However, wmq.jmsra.rar was fairly easy.Action completed:IBM Websphere MQ server started. MQ Explorer created a queue manager, QM, set up to listen on SYSTEM.DEF.SVRCONN channel with Q1 as queue name before deploying wmq.jmsra.ivt.ear on GlassFish. I still fail at this point.Any help will be appreciated with step-by-step for wmq.jmsra.ivt.ear to deploy successfully with configuration in both MQ Explorer and GlassFish servers.[#|2015-07-27T11:42:38.365-0400|SEVERE|oracle-glassfish3.1.2|javax.enterprise.resource.jms.com.sun.enterprise.connectors.jms.system|_ThreadID=81;_ThreadName=Thread-2;|Missing Destination JNDI Name|#]\n\n[#|2015-07-27T11:42:38.366-0400|SEVERE|oracle-glassfish3.1.2|javax.enterprise.system.container.ejb.mdb.com.sun.ejb.containers|_ThreadID=81;_ThreadName=Thread-2;|MDB00017: [WMQ_IVT_MDB]: Exception in creating message-driven bean container: [com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Error in Runtime DD: missing destination JNDI name]|#]\n\n[#|2015-07-27T11:42:38.366-0400|SEVERE|oracle-glassfish3.1.2|javax.enterprise.system.container.ejb.mdb.com.sun.ejb.containers|_ThreadID=81;_ThreadName=Thread-2;|com.sun.appserv.connectors.internal.api.ConnectorRuntimeException\ncom.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Error in Runtime DD: missing destination JNDI name\n at com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter.updateMDBRuntimeInfo(ActiveJmsResourceAdapter.java:1872)\n at com.sun.enterprise.connectors.inbound.ConnectorMessageBeanClient.setup(ConnectorMessageBeanClient.java:186)\n at com.sun.ejb.containers.MessageBeanContainer.(MessageBeanContainer.java:205)\n at com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:121)\n at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:230)\n at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:305)\n at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:108)\n at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:186)\n at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:264)\n at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:460)\n at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)\n at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)\n at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)\n at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)\n at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)\n at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)\n at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)\n at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)\n at org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil.java:214)\n at org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil.java:207)\n at org.glassfish.admin.rest.resources.TemplateListOfResource.createResource(TemplateListOfResource.java:148)\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n at java.lang.reflect.Method.invoke(Method.java:606)\n at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)\n at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)\n at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)\n at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)\n at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134)\n at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)\n at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134)\n at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)\n at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)\n at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)\n at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)\n at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)\n at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)\n at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)\n at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)\n at com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer._service(GrizzlyContainer.java:182)\n at com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer.service(GrizzlyContainer.java:147)\n at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:148)\n at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)\n at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)\n at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)\n at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)\n at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)\n at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)\n at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)\n at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)\n at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)\n at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)\n at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)\n at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)\n at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)\n at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)\n at com.sun.grizzly.ContextTask.run(ContextTask.java:71)\n at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)\n at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)\n at java.lang.Thread.run(Thread.java:745)\n|#]\n\n[#|2015-07-27T11:42:38.366-0400|SEVERE|oracle-glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;|Exception while invoking class org.glassfish.ejb.startup.EjbDeployer load method\njava.lang.RuntimeException: EJB Container initialization error\n at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:242)\n at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:305)\n at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:108)\n at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:186)\n at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:264)\n at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:460)\n at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)\n at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)\n at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)\n at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)\n at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)\n at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)\n at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)\n at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)\n at org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil.java:214)\n at org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil.java:207)\n at org.glassfish.admin.rest.resources.TemplateListOfResource.createResource(TemplateListOfResource.java:148)\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n at java.lang.reflect.Method.invoke(Method.java:606)\n at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)\n at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)\n at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)\n at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)\n at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134)\n at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)\n at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134)\n at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)\n at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)\n at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)\n at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)\n at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)\n at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)\n at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)\n at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)\n at com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer._service(GrizzlyContainer.java:182)\n at com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer.service(GrizzlyContainer.java:147)\n at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:148)\n at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)\n at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)\n at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)\n at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)\n at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)\n at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)\n at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)\n at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)\n at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)\n at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)\n at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)\n at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)\n at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)\n at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)\n at com.sun.grizzly.ContextTask.run(ContextTask.java:71)\n at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)\n at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)\n at java.lang.Thread.run(Thread.java:745)\nCaused by: com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Error in Runtime DD: missing destination JNDI name\n at com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter.updateMDBRuntimeInfo(ActiveJmsResourceAdapter.java:1872)\n at com.sun.enterprise.connectors.inbound.ConnectorMessageBeanClient.setup(ConnectorMessageBeanClient.java:186)\n at com.sun.ejb.containers.MessageBeanContainer.(MessageBeanContainer.java:205)\n at com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:121)\n at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:230)\n ... 56 more\n|#]### Assistant: It seems that there is a discrepancy between the IVT program page and the Glassfish setup page:By default, the IVT program expects a ConnectionFactory object to be\n bound in the JNDI namespace with the name jms/ivt/IVTCF and a Queue\n object to be bound with the name jms/ivt/IVTQueue. You can use\n different names, but if you do, you must enter the names of the\n objects on the initial page of the IVT program and modify the EAR file\n appropriately.http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.dev.doc/q031760_.htm%23q031760_?cp=SSFKSJ_8.0.0%2F1-9-5-0-3-5So I think in step 6 you should set the JNDI names for the connection factory and the queue as: jms/ivt/IVTCF and jms/ivt/IVTQueue\n"} +{"text": "### Human: I have IBM MQ Installed in /opt/mqm/. This has all the Header files and libraries and specifically the libmqic_r.so file.[aa@aa packages]# find /opt/mqm/ -name 'libmqic_r.so'\n/opt/mqm/lib64/compat/libmqic_r.so\n/opt/mqm/lib64/libmqic_r.so\n/opt/mqm/lib/compat/libmqic_r.so\n/opt/mqm/lib/libmqic_r.soTo Install PYMQI using the build and the build_ext, i have specified all the paths as below -[aa@aa pymqi-1.4]# python setup.py config --verbose --include-dirs /opt/mqm/ --libraries /opt/mqm/ --library-dirs /opt/mqm/ --noisy\nBuilding PyMQI client 64bits\nrunning config\n[aa@aa pymqi-1.4]# python setup.py build build_ext -I /opt/mqm/\nBuilding PyMQI client 64bits\nrunning build\nrunning build_py\nrunning build_extAlso on the /opt/mqm directory all permissions are RWXR_XR_X giving Read and Execute to all users. /opt/mqm in the default PATH environment variables too.Installed Packages -[aa@aajars]# yum list installed | grep MQ\nMQSeriesClient.x86_64 7.5.0-5 @/MQSeriesClient-7.5.0-5.x86_64\nMQSeriesJRE.x86_64 7.5.0-5 @/MQSeriesJRE-7.5.0-5.x86_64\nMQSeriesJava.x86_64 7.5.0-5 @/MQSeriesJava-7.5.0-5.x86_64\nMQSeriesMan.x86_64 7.5.0-5 @/MQSeriesMan-7.5.0-5.x86_64\nMQSeriesRuntime.x86_64 7.5.0-5 @/MQSeriesRuntime-7.5.0-5.x86_64\nMQSeriesSDK.x86_64 7.5.0-5 @/MQSeriesSDK-7.5.0-5.x86_64\nMQSeriesSamples.x86_64 7.5.0-5 @/MQSeriesSamples-7.5.0-5.x86_64\nMQSeriesXRClients.x86_64 7.5.0-5 @/MQSeriesXRClients-7.5.0-5.x86_64\n\n[aa@aajars]# yum list installed | grep python-dev\npython-devel.x86_64 2.6.6-51.el6 @localrepoHowever after all this is still get the below -Python 2.6.6 (r266:84292, Oct 15 2013, 07:32:41)\n[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import pymqi\nTraceback (most recent call last):\n File \"\", line 1, in \n File \"build/bdist.linux-x86_64/egg/pymqi.py\", line 109, in \n File \"build/bdist.linux-x86_64/egg/pymqe.py\", line 7, in \n File \"build/bdist.linux-x86_64/egg/pymqe.py\", line 6, in __bootstrap__\nImportError: libmqic_r.so: cannot open shared object file: No such file or directory\n>>>Any ideas why is this happening?Edit - Rebuild Log -[aa@aa pymqi-1.4]# python setup.py config --verbose --include-dirs /opt/mqm/ --libraries /opt/mqm/ --library-dirs /opt/mqm/ --noisy\nBuilding PyMQI client 64bits\nrunning config\n[aa@aa pymqi-1.4]# python setup.py build build_ext -I /opt/mqm/\nBuilding PyMQI client 64bits\nrunning build\nrunning build_py\ncreating build\ncreating build/lib.linux-x86_64-2.6\ncopying pymqi.py -> build/lib.linux-x86_64-2.6\ncopying CMQC.py -> build/lib.linux-x86_64-2.6\ncopying CMQCFC.py -> build/lib.linux-x86_64-2.6\ncopying CMQXC.py -> build/lib.linux-x86_64-2.6\ncopying CMQZC.py -> build/lib.linux-x86_64-2.6\nrunning build_ext\nbuilding 'pymqe' extension\ncreating build/temp.linux-x86_64-2.6\ngcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPYQMI_SERVERBUILD=0 -I/opt/mqm/inc -I/opt/mqm/ -I/usr/include/python2.6 -c pymqe.c -o build/temp.linux-x86_64-2.6/pymqe.o\ngcc -pthread -shared build/temp.linux-x86_64-2.6/pymqe.o -L/opt/mqm/lib64 -L/usr/lib64 -lmqic_r -lpython2.6 -o build/lib.linux-x86_64-2.6/pymqe.so\n[aa@aa pymqi-1.4]# python setup.py install --record files.txt\nBuilding PyMQI client 64bits\nrunning install\nrunning bdist_egg\nrunning egg_info\nwriting pymqi.egg-info/PKG-INFO\nwriting top-level names to pymqi.egg-info/top_level.txt\nwriting dependency_links to pymqi.egg-info/dependency_links.txt\nwriting pymqi.egg-info/PKG-INFO\nwriting top-level names to pymqi.egg-info/top_level.txt\nwriting dependency_links to pymqi.egg-info/dependency_links.txt\nreading manifest file 'pymqi.egg-info/SOURCES.txt'\nreading manifest template 'MANIFEST.in'\nwarning: no files found matching 'scripts/*.py'\nwriting manifest file 'pymqi.egg-info/SOURCES.txt'\ninstalling library code to build/bdist.linux-x86_64/egg\nrunning install_lib\nrunning build_py\nrunning build_ext\ncreating build/bdist.linux-x86_64\ncreating build/bdist.linux-x86_64/egg\ncopying build/lib.linux-x86_64-2.6/CMQZC.py -> build/bdist.linux-x86_64/egg\ncopying build/lib.linux-x86_64-2.6/CMQC.py -> build/bdist.linux-x86_64/egg\ncopying build/lib.linux-x86_64-2.6/CMQCFC.py -> build/bdist.linux-x86_64/egg\ncopying build/lib.linux-x86_64-2.6/CMQXC.py -> build/bdist.linux-x86_64/egg\ncopying build/lib.linux-x86_64-2.6/pymqe.so -> build/bdist.linux-x86_64/egg\ncopying build/lib.linux-x86_64-2.6/pymqi.py -> build/bdist.linux-x86_64/egg\nbyte-compiling build/bdist.linux-x86_64/egg/CMQZC.py to CMQZC.pyc\nbyte-compiling build/bdist.linux-x86_64/egg/CMQC.py to CMQC.pyc\nbyte-compiling build/bdist.linux-x86_64/egg/CMQCFC.py to CMQCFC.pyc\nbyte-compiling build/bdist.linux-x86_64/egg/CMQXC.py to CMQXC.pyc\nbyte-compiling build/bdist.linux-x86_64/egg/pymqi.py to pymqi.pyc\ncreating stub loader for pymqe.so\nbyte-compiling build/bdist.linux-x86_64/egg/pymqe.py to pymqe.pyc\ncreating build/bdist.linux-x86_64/egg/EGG-INFO\ncopying pymqi.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO\ncopying pymqi.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO\ncopying pymqi.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO\ncopying pymqi.egg-info/pbr.json -> build/bdist.linux-x86_64/egg/EGG-INFO\ncopying pymqi.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO\nwriting build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt\nzip_safe flag not set; analyzing archive contents...\ncreating dist\ncreating 'dist/pymqi-1.4-py2.6-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it\nremoving 'build/bdist.linux-x86_64/egg' (and everything under it)\nProcessing pymqi-1.4-py2.6-linux-x86_64.egg\nCopying pymqi-1.4-py2.6-linux-x86_64.egg to /usr/lib64/python2.6/site-packages\nAdding pymqi 1.4 to easy-install.pth file\n\nInstalled /usr/lib64/python2.6/site-packages/pymqi-1.4-py2.6-linux-x86_64.egg\nProcessing dependencies for pymqi==1.4\nFinished processing dependencies for pymqi==1.4\nwriting list of installed files to 'files.txt'\n[aa@aa pymqi-1.4]# cat files.txt\n/usr/lib64/python2.6/site-packages/pymqi-1.4-py2.6-linux-x86_64.egg\n\n[aa@aamanishm]# find /usr/lib64/python2.6/ -name '*pymqe*'\n[aa@aamanishm]#Still no pymqe created :-(Edit 2 - \nI got the pymqe.so file in /root/.python-eggs/pymqi-1.4-py2.6-linux-x86_64.egg-tmp/. I copied it to the /usr/lib64/python2.6/site-packages/ folder. After that too when I import pymqi, I still get the same same error.### Assistant: You have to add the mqm libraries to your library PATH:On AIX/LINUX edit $HOME/.profile file and add somewhere (usually at the bottom) the path to the mq libsfor Ubuntu:export LD_LIBRARY_PATH=/opt/mqm/lib64:/opt/mqm/libin order to find where the library is:ionut@N552VX:~$ locate libmqic_r.so\n/opt/mqm/lib/libmqic_r.so\n/opt/mqm/lib/compat/libmqic_r.so\n/opt/mqm/lib64/libmqic_r.so\n/opt/mqm/lib64/compat/libmqic_r.soAIX:export LIBPATH=$LIBPATH:/usr/mqm/lib64:/usr/mqm/libextracted from here:dspmqver\n[..]\n InstPath: /usr/mqm\n[..]more info the link below:http://www.ibm.com/support/knowledgecenter/SSS28S_8.2.1/API/api_configuring_unix_path.html\n"} +{"text": "### Human: I'm trying to implement an MQ Listener in a windows service and I have used the xms mq consumer sample provided in the dotnet folder from the MQ Explorer installation. I am using MQ WebSphere 7.1If I run their sample solution in console, everything works.However, in my windows service it fails with MQ Reason Code: 2063.I'm using these settings for my factorycf.SetStringProperty(XMSC.WMQ_HOST_NAME, _queueHost);\ncf.SetIntProperty(XMSC.WMQ_PORT, Convert.ToInt32(_queuePort));\ncf.SetStringProperty(XMSC.WMQ_CHANNEL, \"SYSTEM.DEF.SVRCONN\");\ncf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT_UNMANAGED);\ncf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, _queueChannel);\ncf.SetIntProperty(XMSC.WMQ_BROKER_VERSION, 0);and then this line seems to be failingIConnection connection = cf.CreateConnection(null,null);I don't want to provide any user credentials, is that possible?I've tried changing the CONNECTION_MODE to bindings and getting different errors as well.Is the sample code only working because I am running it and therefore it is using my local credentials by default? Otherwise I am using the same config in both.### Assistant: The MQ XMS client is propagating the logged on user to the queue manager, then the QM checks its authority records to determine whether that user can connect and what objects it may access.You could set the authority records to allow the user currently used to run the service, or you could set the logged on user on the windows service to match an allowed user of the queue manager, or set the MCAUSER property on the server connection channel used to connect to the queue manager, if you use client connection.Setting the MCAUSER on the server connection channel will allow anyone who can connect to that channel to impersonate the set user, so this should be used with caution, possibly with setting appropriate channel authentication records.References:http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.msc.doc/xms_rtrouble_tips.htmlhttps://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.sec.doc/q010530_.htm\n"} +{"text": "### Human: I'm trying to configure Jms and WebSphere using java and using Jboss 6.3 in remote system.But am getting ClassNotFoundException in creation of MQQueueConnection Class.Here I please fine code.\nActually M not getting proper steps that what to do,I took help from IBM Knowledge Center but that is not helpful for me.\nPlease anyone who knows about it guide me and for below code Which jar files is required?try {\n MQQueueConnectionFactory cf = new MQQueueConnectionFactory();\n\n // Config\n cf.setHostName(\"167.190.249.202\");\n cf.setPort(1422);\n cf.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n cf.setQueueManager(\"QM.EMPIRE\");\n cf.setChannel(\"EMPIRE.CONN\");\n\n MQQueueConnection connection = (MQQueueConnection) cf.createQueueConnection();\n MQQueueSession session = (MQQueueSession) connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\n MQQueue queue = (MQQueue) session.createQueue(\"queue:///Q1\");\n MQQueueSender sender = (MQQueueSender) session.createSender(queue);\n MQQueueReceiver receiver = (MQQueueReceiver) session.createReceiver(queue); \n\n long uniqueNumber = System.currentTimeMillis() % 1000;\n JMSTextMessage message = (JMSTextMessage) session.createTextMessage(\"SimplePTP \"+ uniqueNumber); \n\n // Start the connection\n connection.start();\n\n sender.send(message);\n System.out.println(\"Sent message:\\\\n\" + message);\n\n JMSMessage receivedMessage = (JMSMessage) receiver.receive(10000);\n System.out.println(\"\\\\nReceived message:\\\\n\" + receivedMessage);\n\n sender.close();\n receiver.close();\n session.close();\n connection.close();\n\n System.out.println(\"\\\\nSUCCESS\\\\n\");\n }\n catch (JMSException jmsex) {\n System.out.println(jmsex);\n System.out.println(\"\\\\nFAILURE\\\\n\");\n }\n catch (Exception ex) {\n System.out.println(ex);\n System.out.println(\"\\\\nFAILURE\\\\n\");\n }\n }\n}### Assistant: It is far better to point your CLASSPATH to where the MQ JAR files are installed rather than copy the MQ JAR files (i.e. you won't get the 'ClassNotFoundException' error).But if you do copy the MQ JAR files then for an MQ JMS application, you pretty much need all of them:com.ibm.mq.jarcom.ibm.mq.commonservices.jarcom.ibm.mq.headers.jarcom.ibm.mq.jmqi.jarcom.ibm.mq.pcf.jarcom.ibm.mqjms.jarconnector.jarfscontext.jarjms.jarjndi.jarjta.jarldap.jarproviderutil.jar\n"} +{"text": "### Human: This is a follow up onXMS.NET hanging indefinitely on factory.CreateConnection(\"username\", null);.As recommended in the comments, I installed the newest versions of MQ client and XMS.NET.\nThe application stopped hanging, now it just terminates the process after a few seconds. There is no exception beingh thrown.\nThe only information provided is the output I got when I turned full XMS logging.This happens on the call tofactory.CreateConnectionThis is the tail of the output:[26.06.2015 10:07:03:389693 W. Europe Standard Time] 00000009 > UOW= source=IBM.WMQ.Nmqi.UnmanagedNmqiMQ method=NmqiConnect(String,NmqiConnectOptions,MQConnectOptions,Hconn,Phconn,out int,out int) [:] org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nentry [SV2098743] [IBM.WMQ.Nmqi.NmqiConnectOptions] [IBM.WMQ.MQConnectOptions#00B8956A] [] [] [pCompCode : out] [pReason : out]\n[26.06.2015 10:07:03:396694 W. Europe Standard Time] 00000009 > UOW= source=IBM.WMQ.Nmqi.UnmanagedNmqiMQ method=GetUnmanagedHconn(Hconn) [:] org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nentry []\n[26.06.2015 10:07:03:400694 W. Europe Standard Time] 00000009 > UOW= source= method=GetUnmanagedHconn(NmqiEnvironment,Object,Hconn) [:] org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nentry\n[26.06.2015 10:07:03:404695 W. Europe Standard Time] 00000009 d UOW= source= org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nHconn Value:0\n[26.06.2015 10:07:03:406695 W. Europe Standard Time] 00000009 < UOW= source= method=GetUnmanagedHconn(NmqiEnvironment,Object,Hconn) rc=OK [:] org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nexit\n[26.06.2015 10:07:03:407695 W. Europe Standard Time] 00000009 < UOW= source=IBM.WMQ.Nmqi.UnmanagedNmqiMQ method=GetUnmanagedHconn(Hconn) rc=OK [:] org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nexit\n[26.06.2015 10:07:03:423697 W. Europe Standard Time] 00000009 d UOW= source=IBM.WMQ.Nmqi.NmqiStructureFormatter org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nObject ID : 'IBM.WMQ.MQConnectOptions#00B8956A'\n[26.06.2015 10:07:03:425697 W. Europe Standard Time] 00000009 d UOW= source=IBM.WMQ.Nmqi.NmqiStructureFormatter org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nversion : 5 (hex 5)\n[26.06.2015 10:07:03:427697 W. Europe Standard Time] 00000009 d UOW= source=IBM.WMQ.Nmqi.NmqiStructureFormatter org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\noptions : 64 (hex 40)\n[26.06.2015 10:07:03:429697 W. Europe Standard Time] 00000009 d UOW= source=IBM.WMQ.Nmqi.NmqiStructureFormatter org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nclientConnOffset: 0 (hex 0)\n[26.06.2015 10:07:03:430697 W. Europe Standard Time] 00000009 d UOW= source=IBM.WMQ.Nmqi.NmqiStructureFormatter org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nclientConnPtr : [490028864]\n[26.06.2015 10:07:03:431697 W. Europe Standard Time] 00000009 d UOW= source=IBM.WMQ.Nmqi.NmqiStructureFormatter org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nconnTag : 0\n[26.06.2015 10:07:03:432697 W. Europe Standard Time] 00000009 d UOW= source=IBM.WMQ.Nmqi.NmqiStructureFormatter org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\n_SSLConfigPtr : [0]\n[26.06.2015 10:07:03:433698 W. Europe Standard Time] 00000009 d UOW= source=IBM.WMQ.Nmqi.NmqiStructureFormatter org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\n_SSLConfigOffset: 0 (hex 0)\n[26.06.2015 10:07:03:434698 W. Europe Standard Time] 00000009 d UOW= source=IBM.WMQ.Nmqi.NmqiStructureFormatter org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nconnectionId : 0\n[26.06.2015 10:07:03:435698 W. Europe Standard Time] 00000009 d UOW= source=IBM.WMQ.Nmqi.NmqiStructureFormatter org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nsecurityParmsOffset: 0 (hex 0)\n[26.06.2015 10:07:03:437698 W. Europe Standard Time] 00000009 d UOW= source=IBM.WMQ.Nmqi.NmqiStructureFormatter org=IBM prod=WebSphere component=Message Service Client for .NET thread=[1 : 0]\nsecurityParmsPtr: [490004432]\nThe program '[8740] WebServiceTesting.vshost.exe' has exited with code -2147483645 (0x80000003).### Assistant: OK. What version of MQ client you installed, v7.1 or 7.5 or 8.0 MQ? I am assuming you installed MQ v8 Client. From version v7.1, XMS .NET comes bundled with MQ Client. So when you install MQ Client, XMS .NET also gets installed. Hence there is no need for separately installing IA9H (XMS .NET) client again. So please uninstall IA9H and try again.I would have expected a warning while installing IA9H when MQ Client was already installed. Apologies, I should have mentioned about this in your another question.\n"} +{"text": "### Human: I am trying to get the current Hour in local timezone in esql for a requirement by the command:set throttle_time = EXTRACT(HOUR FROM LOCAL_TIMEZONE);But it gives me an exception which is given as below:ExceptionList\nRecoverableException\n File:CHARACTER:F:\\build\\slot1\\S000_P\\src\\DataFlowEngine\\MessageServices\\ImbDataFlowNode.cpp\n Line:INTEGER:1153\n Function:CHARACTER:ImbDataFlowNode::createExceptionList\n Type:CHARACTER:ComIbmComputeNode\n Name:CHARACTER:SiebelTOSPOSRequestHandler#FCMComposite_1_7\n Label:CHARACTER:SiebelTOSPOSRequestHandler.Compute1\n Catalog:CHARACTER:BIPmsgs\n Severity:INTEGER:3\n Number:INTEGER:2230\n Text:CHARACTER:Node throwing exception\n RecoverableException\n File:CHARACTER:F:\\build\\slot1\\S000_P\\src\\DataFlowEngine\\ImbRdl\\ImbRdlStatementGroup.cpp\n Line:INTEGER:666\n Function:CHARACTER:SqlStatementGroup::execute\n Type:CHARACTER:\n Name:CHARACTER:\n Label:CHARACTER:\n Catalog:CHARACTER:BIPmsgs\n Severity:INTEGER:3\n Number:INTEGER:2488\n Text:CHARACTER:Error detected, rethrowing\n Insert\n Type:INTEGER:5\n Text:CHARACTER:.SiebelTOSPOSRequestHandler_counternode.Main\n Insert\n Type:INTEGER:5\n Text:CHARACTER:6.3\n Insert\n Type:INTEGER:5\n Text:CHARACTER:SET throttle_time = CAST(EXTRACT(HOUR FROM LOCAL_TIMEZONE) AS CHARACTER);\n RecoverableException\n File:CHARACTER:F:\\build\\slot1\\S000_P\\src\\DataFlowEngine\\ImbRdl\\ImbRdlDateTimeFunctions.cpp\n Line:INTEGER:503\n Function:CHARACTER:ExtractFnCall::extractHour\n Type:CHARACTER:\n Name:CHARACTER:\n Label:CHARACTER:\n Catalog:CHARACTER:BIPmsgs\n Severity:INTEGER:3\n Number:INTEGER:2477\n Text:CHARACTER:Cannot extract %3 field from value %4\n Insert\n Type:INTEGER:5\n Text:CHARACTER:.SiebelTOSPOSRequestHandler_counternode.Main\n Insert\n Type:INTEGER:5\n Text:CHARACTER:6.28\n Insert\n Type:INTEGER:5\n Text:CHARACTER:HOUR\n Insert\n Type:INTEGER:5\n Text:CHARACTER:INTERVAL '360' MINUTEPlease if anybody could help me, I would be thankful.\nRegards### Assistant: You say you want \"the current Hour in local timezone\".LOCAL_TIMEZONE does not return anything containing what you want. Carefully read thisarticlefor an explanation. Also, as a simple experiment, run \"SET Environment.temp = LOCAL_TIMEZONE;\" then look at what the resulting value and data type of Environment.temp is.Instead, use CURRENT_TIMESTAMP.\n"} +{"text": "### Human: I am trying to inject the MQQueueConnectionFactory defined as a JNDI resource into my spring configuration using @Resource. I am getting a ClassCastException while doing this.\nI am really confused on how to solve this. I am using JDK7 and spring 4.1.6.RELEASE. The MQ client is installed in a standard way and exported to tomcat classpath.[ERROR] [TokenId=] [2015-05-29 21:33:53.496] [DispatcherServlet] - [Context initialization failed]\norg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messagingConfig': Injection of resource dependencies failed; nested exception is org.\nspringframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'java:comp/env/jms/SSAJMSQueueConnectionFactory' must be of type [javax.jms.ConnectionFactory], but\nwas actually of type [com.ibm.mq.jms.MQQueueConnectionFactory]### Assistant: When you see a ClassCastException which doesn't make sense, where you know for example that MQQueueConnectionFactory is an extension of ConnectionFactory, then it usually points to a classloader problem.In most cases MQQueueConnectionFactory has been loaded with a different classloader to ConnectionFactory - this will cause a ClassCastException if you attempt to cast one to another even though you'd expect it to work.\n"} +{"text": "### Human: I am getting following error when i am trying to add another JNDI context factory than default IBM Web Context factory..I am using the local default musr_mqadmin user with administrative rights on the server.An unexpected error occurred connecting to the JNDI service provider.\nThe following message contains text from the JNDI service provider which might not be translated.\nError 'java.lang.NullPointerException' performing JNDI operation 'list' on object name ''. (AMQ4405)\n An unexpected error occurred connecting to the JNDI service provider.\n The following message contains text from the JNDI service provider which might not be translated.\n Error 'java.lang.NullPointerException' performing JNDI operation 'list' on object name ''. (AMQ4405)\n Severity: 30 (Severe Error)\n Explanation: An unexpected JNDI error prevented the operation from completing.\n Response: Check for FFSTs to determine the reason for the error. If symptoms persist, contact your Systems Administrator.\n If the error NullPointerException occurs when creating an object on a file system ensure that the user has the correct permissions to access the drive being used.### Assistant: ANullPointerExceptionisalwaysa bug. I suggest you open a support ticket with the software vendor so they can fix it for you.\n"} +{"text": "### Human: I am trying to fetch messages fromIBM Websphere MQusingOracle Service Bus.\nI have enabled \"XA\" connection factory in OSB and checked the \"transaction required\" check box. \nBut when I checked the \"Same transaction For Response\" check box , I'm getting \"pipelineException\".anyone aware about this issue??\nis there any guideline or document that describe the full process?(not sure am I on right track.)### Assistant: OSB is constructed in such a way that the request pipeline and the response pipeline use different threads. When is say different threads, the thread executing the request pipeline is completed as soon as it reaches the end of the request pipeline. A new thread is allocated for executing the response pipeline by weblogic.Now coming to the \"Same transaction For Response\" option, this simply means that the request and the response pipeline should use the same thread and not new threads.The \"Same transaction For Response\" option is supposed to be used when there is a very strict error monitoring (mostly in synchronous cases). for example if the flow is as below,MQ Client > OSB Application <> HTTP backend / Synchronous JMSthen,(in a scenario with \"Same transaction For Response\" not enabled) - if\nthe synchronous backend does not send a response and if there is anexception, the exception is not propagated to the OSB responsepipeline, since the request thread has completed and it doesnt matter\nwhat the response was after completion. so OSB proceeds as if nothing\nhappened with the backend.(in a scenario with \"Same transaction For Response\" enabled) - if the backend throws any errors as mentioned in the previous scenario, then the request thread which is waiting, captures the errors and then the exception is thrown to the immediate error handler that it can find. (Stage error handler, proxy error handler, system error handler - in the same order).now coming to the error that you have highlighted and with the option enabled, i guess it should be some error that has been sent from your backend. please check what is the response that you have got from your downstream and correct it accordingly.\n"} +{"text": "### Human: I got a MDB - EJB 2.1, WebSphere 7 versionContainer Managed and Auto AcknowledgedTransactions marked asNot SupportedNow how do I handle exceptions in a way that the message will be preserved during exception and redelivered later?I tried to throw runtime exception from the catch block inside my MDBonMessagemethod. But that seems to stop the MDB Listener which is unexpected.I cannot callcontext.setRollBackOnly()as there is no transaction.### Assistant: RuntimeExceptionshould be fine. Check this outMessage-driven beans - transaction support. If your Listener stops, then you have probablyMaximum retriesset to 0. Set it to something higher.\n"} +{"text": "### Human: I am using below code to connect IBM MQ...public static void CreateConnectionWithBARXMQ()\n {\n XMSFactoryFactory factoryFactory;\n IConnectionFactory cf = null;\n\n factoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\n cf = factoryFactory.CreateConnectionFactory();\n cf.SetStringProperty(XMSC.WMQ_HOST_NAME, );\n cf.SetIntProperty(XMSC.WMQ_PORT, 1422);\n cf.SetStringProperty(XMSC.WMQ_CHANNEL, );\n cf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);\n cf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, );\n cf.SetStringProperty(XMSC.WMQ_QUEUE_NAME, );\n\n cf.SetIntProperty(XMSC.WMQ_QMGR_CCSID, XMSC.CCSID_UTF8);\n\n IConnection connection = cf.CreateConnection();\n }This code is working fine with unsecured MQ channel. but when I change channel from unsecured to secured one and and security exit code as mentioned below...cf.SetStringProperty(XMSC.WMQ_SECURITY_EXIT, @\"C:\\Program Files\\IBM\\WebSphere MQ\\exits\\BCPKIJCExit_70R.dll\");it is throwing very generic error...CWSMQ0006E: An exception was received during the call to the method ConnectionFactory.CreateConnection: CompCode: 2, Reason: 2195\n. During execution of the specified method an exception was thrown by another component. See the linked exception for more information.I checked the linked exception but it has same error message as above.Can anyone tell me what's wrong here.### Assistant: The2195 return codeis ahigh-level exceptionthat is hit when errors are not caught at lower levels in the code. Very often these are generated when some external dependency such asfile accessorOs resourcesdoes notbehave as expected and the failure cascades intoWMQ.\n"} +{"text": "### Human: I have this deadlock scenario which brings the application to a complete halt, not sure whats going on, if you could show some light. Thank you\nThis is the consumer configurationreceivingTaskExecutorhas20threads.\nThis is what i see for some of the blocking threads -\"receivingTaskExecutor-19\" - Thread t@226\n java.lang.Thread.State: BLOCKED\n at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.clearResources(DefaultMessageListenerContainer.java:1142)\n - waiting to lock <1f7cd479> (a java.lang.Object) owned by \"receivingTaskExecutor-11\" t@111\n at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1002)\n at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)\n at java.lang.Thread.run(Thread.java:679)\"rceivingTaskExecutor-16\" - Thread t@184\n java.lang.Thread.State: BLOCKED\n at org.springframework.jms.listener.AbstractJmsListeningContainer.isRunning(AbstractJmsListeningContainer.java:347)\n - waiting to lock <3c616415> (a java.lang.Object) owned by \"receivingTaskExecutor-7\" t@69\n at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:995)\n at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)\n at java.lang.Thread.run(Thread.java:679)\n\n Locked ownable synchronizers:\n - locked <712a95c7> (a java.util.concurrent.ThreadPoolExecutor$Worker)\n\n----------------------------------------------------\n\n\n\"mqReceivingTaskExecutor-7\" - Thread t@69\n java.lang.Thread.State: BLOCKED\n at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.clearResources(DefaultMessageListenerContainer.java:1142)\n - waiting to lock <1f7cd479> (a java.lang.Object) owned by \"mqReceivingTaskExecutor-11\" t@111\n at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1043)\n - locked <3c616415> (a java.lang.Object)\n at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)\n at java.lang.Thread.run(Thread.java:679)\n\n Locked ownable synchronizers:\n - locked (a java.util.concurrent.ThreadPoolExecutor$Worker)\n\n---------------------------------------------------------\n\n\"receivingTaskExecutor-11\" - Thread t@111\n java.lang.Thread.State: WAITING\n at sun.misc.Unsafe.park(Native Method)\n - waiting to lock <1df1bdab> (a java.util.concurrent.locks.ReentrantLock$NonfairSync) owned by \"receivingTaskExecutor-5\" t@65\n at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)\n at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:838)\n at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:871)\n at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1201)\n at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:214)\n at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:290)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnection.requestSendLock(RemoteConnection.java:2842)\n at com.ibm.mq.jmqi.remote.impl.RemoteConnection.sendTSH(RemoteConnection.java:1812)\n at com.ibm.mq.jmqi.remote.impl.RemoteSession.sendTSH(RemoteSession.java:758)\n at com.ibm.mq.jmqi.remote.impl.RemoteSession.exchangeTSH(RemoteSession.java:1237)\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.spiNotify(RemoteFAP.java:4612)\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiNotify(RemoteFAP.java:4449)\n at com.ibm.mq.jmqi.monitoring.JmqiInterceptAdapter.jmqiNotify(JmqiInterceptAdapter.java:579)\n at com.ibm.msg.client.wmq.internal.WMQSyncConsumerShadow.setRunning(WMQSyncConsumerShadow.java:462)\n at com.ibm.msg.client.wmq.internal.WMQMessageConsumer.stop(WMQMessageConsumer.java:535)\n at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl.stopUnconditional(JmsMessageConsumerImpl.java:706)\n at com.ibm.msg.client.jms.internal.JmsSessionImpl.stop(JmsSessionImpl.java:2014)\n - locked <2a02832d> (a java.util.Collections$SynchronizedSet)\n - locked (a java.lang.Object)\n at com.ibm.msg.client.jms.internal.JmsSessionImpl.close(JmsSessionImpl.java:315)\n at com.ibm.msg.client.jms.internal.JmsConnectionImpl.close(JmsConnectionImpl.java:300)\n - locked <1b3a4f4e> (a com.ibm.msg.client.jms.internal.State)\n at com.ibm.mq.jms.MQConnection.close(MQConnection.java:98)\n at org.springframework.jms.connection.ConnectionFactoryUtils.releaseConnection(ConnectionFactoryUtils.java:80)\n at org.springframework.jms.listener.AbstractJmsListeningContainer.refreshSharedConnection(AbstractJmsListeningContainer.java:395)\n - locked <1f7cd479> (a java.lang.Object)\n at org.springframework.jms.listener.DefaultMessageListenerContainer.refreshConnectionUntilSuccessful(DefaultMessageListenerContainer.java:885)\n at org.springframework.jms.listener.DefaultMessageListenerContainer.recoverAfterListenerSetupFailure(DefaultMessageListenerContainer.java:861)\n at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1013)\n - locked <112c97d9> (a java.lang.Object)\n at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)\n at java.lang.Thread.run(Thread.java:679)\n\n Locked ownable synchronizers:\n - locked <33d65cd0> (a java.util.concurrent.ThreadPoolExecutor$Worker)\n\n - locked <6a5305e> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)\"receivingTaskExecutor-5\" - Thread t@65\n java.lang.Thread.State: BLOCKED\n at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.clearResources(DefaultMessageListenerContainer.java:1142)\n - waiting to lock <1f7cd479> (a java.lang.Object) owned by \"receivingTaskExecutor-11\" t@111\n at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1002)\n at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)\n at java.lang.Thread.run(Thread.java:679)\n\n Locked ownable synchronizers:\n - locked <19f71b53> (a java.util.concurrent.ThreadPoolExecutor$Worker)\n\n - locked <1df1bdab> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)### Assistant: This looks like a bug in the mq client library.receivingTaskExecutor-5is holding a lock owned by the client library but has no client library stack frames on its stack.receivingTaskExecutor-11is trying to acquire that lock (while holding aDMLClock; the other threads are waiting for that).So something happened in the client library onreceivingTaskExecutor-5that caused it to leave the lock locked.I suggest you contact IBM support.\n"} +{"text": "### Human: I need to clarify the behavior of the methodcreateQueue(java.lang.String queueName)from the classcom.ibm.mq.jms.MQSession.\nIf I pass an arbitrary queue name, will it create a temporary queue? In the other hand, whatStringvalue needs to be passed to get aQueueobject that represents a static queue configured in the queue manager?\nFor instance, if I have an objectdestof typeMQDestination, I could calldest.toString()or according to javadocs ordest.getStringFromDestination()(which returns a URI String). Will any of these two results work if passed to the createQueue method mentioned.The intent of my question is to properly use a Spring'sDynamicDestinationResolver(takes String and returns Destination) which behind the scenes uses this MQ specific method.Thanks for your time### Assistant: You can find the description of the JMS Session object here:http://docs.oracle.com/javaee/7/api/javax/jms/Session.htmlIn JMS Session.createQueue() does not create a physical queue on the MQ queue manager, rather it's used to connect to one which has already been defined. MQSession.createQueue(\"Q1\"); would result in a Destination object which can be used to refer to the queue 'Q1' which already exists on the queue manager.For creating a temporary queue you need to use the createTemporaryQueue() method of the MQSession object. Though you have no control over the name of said temporary queue.\n"} +{"text": "### Human: I am trying to connect to a Queue Manager via IBM WebSphere MQ Explorer. \nThe Queue Manager Name, Host, Port and Channel are all correct. But I and am getting the following error:AMQ4043MessageQueue manager not available for connection - reason .ExplanationThe attempt to connect to the queue manager failed. This could be because the queue manager is incorrectly configured to allow a connection from this system, or the connection has been broken.ResponseEnsure that the queue manager is running. If the queue manager is running on another computer, ensure it is configured to accept remote connections.When I login to the server I see that the queue manager is running:@:/home/mqm #strmqm fooQueueMgr\nWebSphere MQ queue manager running.Details:@:/home/mqm #dspmqver\nName: WebSphere MQ\nVersion: 7.0.0.0\nCMVC level: p000-L080603\nBuildType: IKAP - (Production)Any insight?### Assistant: Without seeing what the error log says for the client connection it is only a guess, but what I suspect has happened since you say \"The Queue Manager Name, Host, Port and Channel are all correct\" and it was fixed by a queue manager restart, is this:You created a listener object with the correct port number, and you made itCONTROL(QMGR)but then you did not start it, assuming that the queue manager would start it for you. When you next start the queue manager it does start it for you, but the first time, i.e. just after you define it, it does not asCONTROL(QMGR)only takes affect at queue manager start up.\n"} +{"text": "### Human: I don't have a MQ Setup on my machine - I have this log from system err. \nCan anyone please help me interpret this ?\nThe things I am looking for validation is :(1) Should the messageId be all zeroes ?\n\n (2) When we do an MQPUT , we use the MessageId to search \nwith and subsequent GET ? (validate)\n\n(3) When we do a MQPUT , the correlationId is set as all Zeroes ?(validate)This is anMQGETlog**MQGET**(Hconn,Hobj,MQMD,MQGMO,int,ByteBuffer,Pint,Pint,Pint) (**LocalMQ**) \n [:/d1b0530f] Entry \n 0x146bcc9 \n 0x6 0x163d7ed8 \n version:2 report:0 \n**msgType**:8 \n**expiry**:-1 \nfeedback:0 encoding:273 \ncodedCharSetId:0 format:'' \npriority:-1 \npersistence:2 \n**msgId**:000000000000000000000000000000000000000000000000 \n**correlId**:XXX0269A //I have truncated this\n**backoutCount**:0 \n**replyToQ**:''\n**replyToQMgr**:''### Assistant: (1) It is normal practice to zero out the Message ID prior to issuing MQPUT to indicate to the queue manager that you want it to generate a unique Message ID for your message.(2) Upon return from the MQPUT call, the MQMD will contain the generated Message ID that was created for your message. You can then use this if you need to for correlation purposes on subsequent MQGET calls.(3) For Correlation IDs on a request message it is normal for them to be zeroed out. For replies, it is normal to copy the Message ID from the request message that this is a reply for, into the Correlation ID field.\n"} +{"text": "### Human: My company has an IBM WebMQ license / server installed. They have set up a queue for me to use. I have set up a environment variable which seems to be working. I have installed the free WebMQ client and registered the MQAX200.dll file.I have searched high and low for VBScript code to send messages but all I can find is to list received messaged.Set MQSess = CreateObject( \"MQAX200.MQSession\" )\nSet QMgr = MQSess.AccessQueueManager( QueueMgrName )This code sets up the connection and accesses the queue I need to use to send the SMS. Any idea on how to actually send the SMS?Thanks### Assistant: Here is a good CodeProject resource to check out, this project has a full class demonstrating the usage.\nAlso note that the linked project is in C#, but the underlying objects are used the same way one you have a valid instance of the object.http://www.codeproject.com/Articles/14009/Interfacing-with-IBM-WebSphere-MQ-formally-IBM-MQS\n"} +{"text": "### Human: I am trying to record all message traffic on some MQ server queues for using in a test suite. Are there any tools that can be used for this purpose?I see that SoapUIPro and HermesJMS can be used for JMS testing, but can those be used for recording messages?### Assistant: I am trying to record all message traffic on some MQ server queues for using in a test suite. Are there any tools that can be used for this purpose?Do you want to record just the messages for your test or \"any and all\" messages that pass through a queue manager? If it is the latter then there is a list of solutionsherethat will do it.\n"} +{"text": "### Human: When i try to put message into the MQ, I get the following error.MQJE001: Completion Code '2', Reason '2495'.I tried to Google it up. The solution I was able to find is that this issue might arise if the JRE, Eclipse and the MQ are not compatible (Compatible as in 32 and 64 bit).Thanks in advance for pointing out where the problem could be and any suggestion regarding how to solve it will be appreciated.### Assistant: This problem usually occurs when you've configured your application to connect in BINDINGS mode (rather than CLIENT mode), and the Java MQ classes are unable to find the native library mqjbnd which is required to connect in BINDINGS mode.BINDINGS uses shared memory to communicate with the queue manager rather than TCP, and requires the mqjbnd library to do this. BINDINGS mode is faster than CLIENT.CLIENT uses TCP and doesn't require the mqjbnd native library.To have the mqjbnd library available, your application must be running on the same physical machine as the queue manager. If you're not, you must use CLIENT.If you're on 7.1+, then the easiest way is to run setmqenv to setup your environment prior to running your application. If you're on 7.0 then you need to do this manually by setting the Java library path - MQ_JAVA_LIB_PATH=/path/to/mqinstall/java/lib (or lib64 if you're a 64-bit JVM).\n"} +{"text": "### Human: The IBM documentation for WebSphere's MQ error codes says that the channel name was incorrect. Channel name? Nowhere in the doc for MQCONN says anything about channel name. It asks for the name of the Queue Manager, which I have done, and verified is correct.It is tempting to think of \"channel\" as a synonym for \"queue\". But before you can connect to a specific queue, you have to connect to the Queue Manager first, and that is the where I am encountering the error.What does \"channel\" mean in this context?Thank you### Assistant: You are connecting in Client mode (i.e. a network connection) and in order to connect via the network from your application to the queue manager, there will be some configuration to say how to do this. For example, an IP address and a port number. Along with this, there will be a channel name. You might be doing this using a MQSERVER environment variable, or the Client Channel Definition File (CCDT) for example. If the MQCHLLIB and MQCHLTAB environment variables are set, they point to the CCDT that is being used.It is in this configuration that you will find the channel name, and then you must see whether there is a channel of TYPE(SVRCONN) defined on your queue manager with the same name as the one in your client application configuration.To see more details about the error, look in the AMQERR01.LOG file both on your client machine and on the queue manager. There you will see more detailed errors about the channel name in question.\n"} +{"text": "### Human: We have a queue manager and using IBM webspehere connection is made using listener to the queue.I want to restrict the messages based on some parameter to particular JVM. I have twp JVMs. So some messages should go to first JVM and rest should go to second JVM.Can anyone help me to know how this can be achieved?Thanks!!### Assistant: Either have a queue per application (JVM) or have a correlation ID per application (JVM) on the same queue, then each application can get only some of the messages.\n"} +{"text": "### Human: Thanks for going thru this question. \nWe 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### Assistant: You can issue the commandDISPLAY SUB(*) TYPE(API) ALLto see them all.dmpmqcfgdoes not dump them out because replaying them asDEFINE SUBcommands would createTYPE(ADMIN)subscriptions.\n"} +{"text": "### Human: I'm trying to achieve message security with AMSI have two users one is a domain user xxx\\herath (192.168.10.1)\nother user is a local user in my websphere mq server machine (192.168.10.2) wmqserver\\bobmquser.I log in to wmqserver mcahine as a wmqserver\\dilantha , This user is a member of Administrator,mqm and users user groups.So I followed the instructions from following linkhttp://www-01.ibm.com/support/knowledgecenter/api/content/SSFKSJ_8.0.0/com.ibm.mq.sec.doc/q014690_.htmI created self-signed certificates and exchanged with both usersThen created .mqs folders in their respective locations and added these thingswmqserver\\bobmquser's keystore.conf\n cms.keystore = D:\\AMSKeyRepo\\key \n cms.certificate = Bobmquser_Cert\n\nxxx\\herath's keystore.conf \n cms.keystore = D:\\AMSKeyRepo\\key\n cms.certificate = Herath_CertSet the security policiesand then \nsetmqaut -m QM_AMSTest -t queue -n SYSTEM.PROTECTION.POLICY.QUEUE -p musr_mqadmin -p bobmquser +browsesetmqaut -m QM_AMSTest -t queue -n SYSTEM.PROTECTION.ERROR.QUEUE -p musr_mqadmin -p bobmquser +putWhen I try to retrieve messages by using \"amqsget XYZ QM_AMSTest\" as wmqserver\\bobmquser ,I'm getting following errors.but if I use MQExplorer UI, then I'm able to see these messages. I checked error log files in both client and server and I couldn't find anything. I already googled for reason code 2110 but I'm not able to find suitable solution for this issue.So anyone can pointing me how to fix this? Thank you.### Assistant: Typemqrc 2110or look it up in the Knowledge centre.MQRC_FORMAT_ERRORAre you on latest maintenance?\n"} +{"text": "### Human: I'm sending a message to a remote (offsite) MQ server. The recipient says they don't get the message I send, but it looks like things are good on my side. For example, if I stop the XMITQ, the messages I send pile up there until I restart it.\nIf there was a network problem (for example, if someone changed a firewall/router setting on my end) what would happen to the message I send? I would think it would end up in the dead-letter queue, but there's nothing there. It doesn't seem to make sense that an MQ message would just disappear.### Assistant: You could enable COD reports to prove that the receiving application actually consumed the message. Most problems of this sort are an issue with the consuming application having an error part way through processing the message and throwing it away.\n"} +{"text": "### Human: I am using the following sample code to create a temporary replyto queuefinal TemporaryQueue replyQueue = session.createTemporaryQueue();\nmessage.setJMSReplyTo(replyQueue);\nproducer.send(destination, message);This uses a default model queueSYSTEM.DEFAULT.MODEL.QUEUEto create the temporary dynamic queue.Please just want to know if there is way to use my own model queue instead of using the default model queue.Thanks### Assistant: Check the JavaDoc for the MQConnectionFactory - there's a model queue property on the connection factory that controls this.http://www-01.ibm.com/support/knowledgecenter/api/content/SSFKSJ_8.0.0/com.ibm.mq.javadoc.doc/WMQJMSClasses/index.html\n"} +{"text": "### Human: I want to perform MQ load testing using JMETER for JMS Point-to-Point Messaging. I am able to connect and send request message for single connection to single remote queue. Can we establish multiple channel connection using same connection factory and send message to different queues. I have establish approximately 1500 channel connection with 1500 dedicated remote queues. I am using JMETER version 2.11### Assistant: If you mean using a different uniquely named SVRCONN channels then no. The Channel specified in the connection factory can't be changed. To simulate 1 channel per connection you would need to create a connection factory for each channel.However, there is no technical reason you cannot use the same channel for multiple queues simply by referencing the same connection factory for each test. Performance wise, there really won't be a difference between using 1500 instances of the same channel and 1500 individually named channels.You may need to adjust the number of instances that that given channel and/or be started from a single client if you expect all 1500 to go at the same time.\n"} +{"text": "### Human: I need to test the message flow in SONIC and also in IBM websphere MQ. Is there any tools to test the message flow for these?Thanks,\ni2ijeya.### Assistant: Can you elaborate your question?But :if you want to test an outbound connection to Websphere MQ you can use the internal test scenario (in Sonic Workbench) and set a process with the onRamp/OffRamp Websphere MQ service(but it's not out of the box and requires the Service configuration).\nOtherwise to put a jms Message in a Sonic Queue you can use the internal JMSClient or SonicMessageManager ([http://queuemanager.nl/]it has more options and use the ESB lib not only the jms ones)if you want to send messages and get messages from Websphere MQ the easiest way is to use :\n - IBM mq tool\n - MQJExplorer [https://code.google.com/p/mqjexplorer/]Cheers\n"} +{"text": "### Human: I have a MQIIH structure that is sent through a queue manager and the receiving side (out of my control) is having problem s with receiving it after a change.MQIIH IMS information header(as perthis)Is there a way to remove the header in MQ, without using a program IIB?### Assistant: is having problems with receiving it after a change.After what change? If you change the MQIIH and it does NOT match the MQIIH structure then of course the receiving end will have a problem. Have you verified that the MQIIH structure that you are sending to the other end is correct?Note: The MQIIH structure has not changed in more than 10 years. I'm using MQ v8 and MQIIH structure is exactly the same.\n"} +{"text": "### Human: I am using queueSender.send(msg) to send the message to destination q. Here q session is not transactional and queueSender's delivery mode is default mode [i believe default is PERSISTENT]. What will happend if application is still sending message when the q has reached the max q depth. Is there any issue with the app performance? What is the best way to handle this?### Assistant: Performance turn the receiving application to make sure it keeps up with the message flow.Increase the receiving application's queue from a default depth of 5000 to 200000 (or some really large value)Make sure the sending application can handle a reason code of 2053 (MQRC_Q_FULL). i.e. pause the application or put the messages to another queue.Updated:If you are using JMS when you put a message to a full queue, you will get a JMS exception: JMSWMQ2007. If the JMSException is not null then get the LinkedException.\ni.e.catch (JMSException e)\n{\n System.err.println(e.getLocalizedMessage());\n if (e != null)\n System.err.println(\"getLinkedException()=\" + e.getLinkedException());\n}And the error messages should look like:JMSWMQ2007: Failed to send a message to destination 'TEST.Q25'.\n getLinkedException()=com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ\n call failed with compcode '2' ('MQCC_FAILED') reason '2053'\n ('MQRC_Q_FULL').\n"} +{"text": "### Human: I want to know what happen if i program a monitor to trigger a transference anytime a trigger file is found in x directory and transfer all the .txt files in x folder, what happen if this directory receive other files after the trigger file is created? are they send in the same transference? or will be send in another one?Thanks for your help in advance### Assistant: It depends on the timings between when the agent begins processing the transfer request submitted by the monitor and when the extra files are added to the directory that contains the source files to be transferred.As an example, let's say you monitor directory x to match on the trigger file, \"trigger.file\". When this file is detected by a poll of the resource monitor, it submits a managed transfer request to the agent that specifies \"*.txt\" as the source file located in directory x also. In other words, the managed transfer request submitted will transfer any file ending in .txt in directory x (because of the wildcard).Now, imagine the following timeline of events:Two .txt files (file1.txt, file2.txt) are added to directory x.The trigger file (trigger.file) is then subsequently created directory x.The resource monitor polls, detects the file \"trigger.file\" which matches the resource monitors trigger conditions.The resource monitor then submits a managed transfer request to the agent.Before the agent processes this request, a new .txt file is added to directory x (file3.txt).The agent then starts to process the managed transfer request and needs to expand the wildcard source file specification (*.txt) in a concrete list of files. So it lists directory x and picks out the files ending in .txt. At this point there are three files (file1.txt, file2.txt and file3.txt) that are included in the transfer, even though file3.txt was created after the resource monitor triggered when the trigger file was detected.Once the wildcard has been expanded and the concrete list of files determined, any new .txt file (e.g., file4.txt) will not be transferred until the trigger file is updated / replaced causing the resource monitor to trigger again.I hope this helps! If you need any further clarification, feel free to ask.\n"} +{"text": "### Human: I have the below scenario:I am putting a message in a MQ queue and some other application is polling in the same queue. I have came across a scenario like this:My application tries to put the message into the queue, but it experiencesMQJE001: An MQException occurred: Completion Code '2', Reason '2018'. I have a retry logic if my application fails to put the message into the queue. So my application tries to put the message in the queue. This time it is able to put the message in the queue again. Now the problem appear is the other application which was polling the queue for the message, received two messages.I am using MQ server version 7.0.1.8 and MQ client version 7.0.1.5.My doubts are as below:Why the message put twice in queue even though the first time I experiencedMQJE001: An MQException occurred: Completion Code '2', Reason '2018'.Is there anyautocommitflag in MQ? Where can I get more details on this? I have done google on it, but does not get proper information. I checked the below link, but nothing related to MQ autocommit flag.Committing and backing out units of workIs the difference in server version and client version matters?From theAPAR IV22989, I have seen there is a fix from IBM for MQJE001: An MQException occurred: Completion Code '2', Reason '2018'. Is this only applicable to V7.1 and V7.5?### Assistant: Firstly I'd suggest updating at least the version of the client you are using; 7.0.1.12 is the latest. Maintenance applied to the QM as well would be useful. The difference in level might be the issue but I would suggest getting a recent level would be a good practice. The design is such that the difference should not matter - especially if using client mode (TCP/IP) this provides an addedI'm assuming that this is the classes for Java and not the JMS API you are using? In this case the commit will be controlled by the choice of the syncpoint options you have selected.JMS has the concept of auto-acknowledge of messages; sounds like here the message is put outside of syncpoint (transaction) and hence appears on the queue. A problem occurs and the message is put again. Generally this is good practice for the application to respond to errors but without putting in a transaction duplicate message is a risk that is taken.\n"} +{"text": "### Human: I'm currently struggling with the Websphere Resource Adapter for MQ JMS on the JBoss AS 7.1. The adapter itself works great, but I should be able to set some properties dynamically. For example hostName etc.Currently I have to set the hostName, port etc. for the mq-connection \"hard-coded\" with a property-file.For example:mq.hostname = localhost:1421.Now my question. Is it possible to set this via coding? The problem is that I can't edit the MQ Adapter from IBM because of the copyright and the non-available source-files.My first idea was, to add a second resource adapter which gets called first and which sets the property of the IBM MQ adapter. Is that possible?### Assistant: Your first idea will work. It took me a while to figure it out, but the procedure is outlined in my answer to my questionHow can I hot deploy a resource-adapter activation in JBoss 7?Basically, you willdeploy the WMQ RAR(wmq.jmsra.rar) as is. Then you deploy a configuration only RAR which contains thera.xmlfrom the wmq.jmsra.rar archive and an ironjacamar.xml (both in the META-INF sub-folder).You can find the details in the link. Theofficialway to do this, though, is to follow the procedure outlines in the 2nd link above. I avoided this because I wanted a full WMQ RAR deployment and configuration to be deployed into a vanilla AS7 server, and the official procedure requires editing a few internal configuration files in the AS7 install.Here's an exampleWMQ ironjacamar.xml deployment descriptor.\n"} +{"text": "### Human: I have a number of Queue Managers with a number of Queues. Im using Transmission queues, sender and receiver channels to communicate and transfer messages between the different queue managers.I have been doing some testing and have found that if you put a wrong queue name in the sender channel just sits there retrying.Is there a way i can enable tracing or error logging to see that there is an error with the queue name i am trying to send to.Thanks### Assistant: The answer to the question you posed is yes - there's trace facility (strmqtrc -t detail -t all, recreate, endmqtrc, then look in the mqdata\\trace directory at the files noting that on unix you need to dspmqtrc *.TRC first to produce readable FMT files). However, thats almost certainly fartoomuch information for what you need.If you have a channel that wont start, look at the queue manager error logs first (amqerr0*.log in the mqdata\\qmgrs\\qmgrname\\errors), on BOTH sides, and then at the global errors directory (again, both sides).Generally speaking a sender channel is configured with a transmit queue where it gets the messages off, which obviously needs to exist. I would hope the amqerr0* errors file would give you enough to pin that down. You may also want to play with configuring a dead letter queue to both ends, so if the message cannot be put somewhere it can end up on there, prefixed with a header to say why. If you do this, use MQExplorer to browse the dead letter queue as I believe it expands the header for you (from memory)\n"} +{"text": "### Human: I am trying to configure a MDB in Glassfish 3.1.2 to listen on a remote JMS Queue (MQ 7 via GenericJMSRA 2.0.1).When I try to use the JNDI names to define my MDB like this@MessageDriven(activationConfig = {\n @ActivationConfigProperty(propertyName = \"destinationType\", propertyValue = \"javax.jms.Queue\"),\n @ActivationConfigProperty(propertyName = \"DestinationJndiName\", propertyValue = \"jms/MyQueue\"),\n @ActivationConfigProperty(propertyName = \"ConnectionFactoryJndiName\", propertyValue = \"jms/MyFactory\") })\n@TransactionManagement(TransactionManagementType.BEAN)\npublic class SimpleMdb implements MessageListener { ... }I get this error (minimal extract from the stacktrace):java.lang.RuntimeException: EJB Container initialization error\n at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:242)\nCaused by: java.lang.Exception\n at com.sun.enterprise.connectors.inbound.ConnectorMessageBeanClient.setup(ConnectorMessageBeanClient.java:233)\nCaused by: javax.resource.spi.InvalidPropertyException: MyFactory\n at com.sun.genericra.util.ExceptionUtils.newInvalidPropertyException(ExceptionUtils.java:42)\nCaused by: javax.naming.NameNotFoundException: MyFactory\n at com.sun.jndi.fscontext.RefFSContext.getObjectFromBindings(RefFSContext.java:400)If I use the names of the Factory and Queue as defined in the .bindings file and in the resource-adapter definition like shown below, it works fine.@MessageDriven(activationConfig = {\n @ActivationConfigProperty(propertyName = \"destinationType\", propertyValue = \"javax.jms.Queue\"),\n @ActivationConfigProperty(propertyName = \"DestinationJndiName\", propertyValue = \"SOME.REALLY.UGLY.LONG.NAME\"),\n @ActivationConfigProperty(propertyName = \"ConnectionFactoryJndiName\", propertyValue = \"THE_NAME_OF_THE_FACTORY\") })\n@TransactionManagement(TransactionManagementType.BEAN)\npublic class SimpleMdb implements MessageListener { ... }When I only replace the factory's JNDI name with the \"ugly\" one, I get the same stacktrace as above but referring to the \"MyQueue\".At the same time my setup of .bindings file, resource-adapter definition in the domain.xml (inserted via a tool) and queue usage in EJBs/Servlets seems to be fine.\nI can use the queue and its connection factory in the usual an desired way - this works fine:QueueConnectionFactory qcf = (QueueConnectionFactory) ctx.lookup(\"jms/MyFactory\");\nQueue asyncQueue = (Queue) ctx.lookup(\"jms/MyQueue\");Can someone provide insight on why this is happening? I would like to use the JNDI names like \"jms/MyQueue\" everywhere in the code - including the MDB definition.Here is the relevant section of my domain.xml:\n \n \n \n \n \n\n\n \n\n\n\n \n \nGlassFish 3.1.2.9WebSphere MQ 7genericra 2.0.1Java 1.7/JEE 6/EJB 3.1### Assistant: The general assumption is that there is something missing in the JNDI - how is the JNDI being populated? It looks like this is the File system context based on the stack trace and the .bindings file you mention.It's worth noting as well that WMQ has it's own Resource Adapter - there's no need to use the generic one here. Might be an avenue to explore?\n"} +{"text": "### Human: This question already has answers here:What is a NullReferenceException, and how do I fix it?(26 answers)Closed8 years ago.I am busy withC# MQ, i want to add text on the Q, but not sure if what i am doing is wrong. Getting the following error.An unhandled exception of type 'System.NullReferenceException'\n occurred in Data.Manager.dll, this happens at\n \"Put1Queue.Put(myPutMessage, Put1PutMsgOptions);\"Here is the code:class Program\n{\n\n static void Main(string[] args)\n {\n MQ mq = new MQ();\n Console.Read();\n }\n}\n\npublic class MQ\n{\n\n private MQQueue queue;\n private MQMessage queueMessage;\n private MQQueueManager queueManager;\n\n private string queueManagerName;\n private string host;\n private int port;\n private string channel;\n private string queueName;\n\n public String putMsg;\n public String markerMsg;\n private MQQueueManager Put1QueueManager;\n private MQPutMessageOptions Put1PutMsgOptions;\n private MQQueue Put1Queue;\n\n private MQQueueManager Put2QueueManager;\n private MQPutMessageOptions Put2PutMsgOptions;\n private MQQueue Put2Queue;\n\n private MQQueueManager myQueueManager;\n private MQPutMessageOptions myPutMsgOptions;\n private MQQueue myQueue;\n\n private Hashtable queueProperties;\n\n public MQ()\n {\n setupTestData();\n\n }\n\n public void setupTestData()\n {\n\n markerMsg = \" \\\" event_type=\\\"2\\\" external_txn_id=\\\"04255841252012-06-22-04.56.14.960000 \\\">\";\n\n try { \n // Setup connection information\n MQEnvironment.Hostname = \"SLHUBQ2.sanlam.co.za\";\n MQEnvironment.properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);\n MQEnvironment.properties.Add(MQC.CCSID_PROPERTY, 437);\n MQEnvironment.Channel = \"CLIENTS\";//\"EFL.SRVCONN\";\n MQEnvironment.Port = 1615;//lr.eval_int(\"\");\n\n\n Put1QueueManager = new MQQueueManager(\"SLHUBQ2\");\n int openOptions = MQC.MQOO_OUTPUT | MQC.MQOO_INQUIRE | MQC.MQOO_FAIL_IF_QUIESCING;\n\n Put1Queue = Put1QueueManager.AccessQueue(\"LAMDA.PERF.REQUEST\", openOptions, null, null, null);\n\n Put1PutMsgOptions = new MQPutMessageOptions();\n\n Put1PutMsgOptions.Options = MQC.MQPMO_NEW_MSG_ID | MQC.MQPMO_NEW_CORREL_ID;\n\n }\n catch (Exception error)\n {\n\n }\n\n try {\n MQMessage myPutMessage = new MQMessage();\n myPutMessage.ClearMessage();\n myPutMessage.Persistence = MQC.MQPER_PERSISTENT;\n myPutMessage.Persistence = MQC.MQPER_NOT_PERSISTENT;\n myPutMessage.CorrelationId = MQC.MQCI_NONE;\n myPutMessage.MessageId = MQC.MQMI_NONE;\n\n myPutMessage.Format = MQC.MQFMT_STRING; \n myPutMessage.ReplyToQueueName= \"LAMDA.PERF.RESPONSE\";\n\n myPutMessage.WriteString(markerMsg);\n\n\n Put1Queue.Put(myPutMessage, Put1PutMsgOptions);\n\n\n\n\n }\n catch (MQException error)\n {\n\n\n }\n\n\n try\n {\n Put1Queue.Close();\n Put1QueueManager.Disconnect();\n\n }\n catch (Exception error)\n {\n\n }\n\n\n\n }\n\n\n\n }\n}### Assistant: The problem might be in your code linePut1Queue = Put1QueueManager.AccessQueue(\"LAMDA.PERF.REQUEST\", openOptions, null, null, null);Probably 'AccessQueue' method returns 'null' result. So what you can try to check:Is your queue name is correct.Are the options correct. You may try to passMQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCINGoptions.\n"} +{"text": "### Human: I am writing a standard JEE 5 application and need to consume JMS messages from MQ server. Application server is JBOSS EAP 5.1. As this is a standard JEE application, an MDB would be good fit as message listener. MQ admin has provided a .bindings file as MQ configuration. After searching web, I am not able to find a way to use .bidings file with MDBs. I have already tried using standard activation spec. That works fine. But for that, JMS properties need to be in JBOSS or EE specific configuration files.\nCan someone please tell a way to use .bindings file with MDB?### Assistant: A .bindings file comes from the File System JNDI Context. This is the file that is written when the FileSystemContext is used to store objects in JNDI. It shouldn't really be moved around.JBOSS will have it's own JNDI provider and that won't be able to read this file. What you need is the information from the MQ sys admin of the queuemanager that you need to connect to.. i.e. the information the entered into JNDI. Presumably using JMSAdmnin or MQExplorer. Things like hostname, port, channel, any security config etc. etc.Within JBOSS you'll need to deploy the MQ Resource Adapter (a) this downloadable viahttp://www-01.ibm.com/support/docview.wss?uid=swg21633761(b) config info can be found athttp://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q031820_.htm\n"} +{"text": "### Human: Can anyone advise whether this is possible and if so how the ehcache.xml should be configured and the custom connection factory be coded? I have it working for ActiveMQ which is well documented but can find no mention of WMQ.Thanks in advance### Assistant: WebSphereMQ is also JMS compliant as ActiveMQ, so your configuration might look like this (this configuration uses providerURL pointing to localhost, customize it to your needs):\n \n\n\n"} +{"text": "### Human: I use WebSphere MQ 7.0, followed necessary steps and configured it. Can I use same .binding file in another WebSphere MQ ?WebSphere MQ\\java\\bin\\JMSAdmin.config entries as belowINITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory\nPROVIDER_URL=file:/C:/JNDI-Directory### Assistant: The .bindings file is the backing store for the FileSystem JNDI provider. You would typically conenct the JMS based applications to this to load the Connection Factories and Destinations.A single JNDI store can hold multiple objects and they don't all have to represent connections to a single Queuemanager.So if you're asking do I need another JNDI store for another queuemanager, no not necessarily.\n"} +{"text": "### Human: (First of all, sorry for my poor English)I've got MQ client (v6.0 or higher). I use mqic32.dll to connect to MQ server. I call MQCONNX to connect to the Queue Manager. MCAUser is not specified for this manager. So, I authenticated at server as a current Windows user.Well, my program option's window has a 'Test' button and 'Login' Edit. When 'Test' pressed, I call MQCONNX - MQOPEN - MQCLOSE - MQDISQ functions sequence to test the connection/queue opening. There are 2 types of users who starts my application - admin & operator. Admin sets options and performs connection tests, simple users sends and recieves MQ messages. They shoul log in Windows as different Windows users.And my question is: \nI call MQCONNX() being logged as Admin. What parameters (among MQCD struct [sub]fields) should i set for MQ server authenticate me as Operator.Yes, I can start new process (CreateProcessWithLogonW) as an Operator. But is there a decision keeping me in single process?I know, using client java- libs I can specify user. So, I think, there should be equivalent ability for mqic32.dll, am I right?### Assistant: I authenticated at server as a current Windows user.The queue manager does not authenticate an incoming connection. It will use the UserID to check if the user can do those particular actions i.e. MQCONN, MQOPEN, MQPUT, etc.. But that is not authentication.If you have not implemented an MQ security solution then anyone can connect with any UserID they want.I call MQCONNX() being logged as Admin. What parameters (among MQCD struct [sub]fields) should i set for MQ server authenticate me as Operator.You need to create a client-side security exit and use MQCSP structure but it will not do you any good if you do not have a server-side security exit to read it.Note: You cannot protect your queue manager from a client-side point of view because anyone can simply download one of the free MQ SupportPacs or one of the many free MQ applications and use it to connect to your queue manager. You need an MQ security solution that is implemented at the queue manager.\n"} +{"text": "### Human: I have an application deployed on Websphere 8.5.5.2, The application has many MDBs, those MDBs are bound to response queues on Websphere MQ 7.1 using websphere \"Activation specification\". However, I always get this error in the console and MDBs couldn't consume any messages from the queuesCWSJY0003W: MQJCA4004: Message delivery to an MDB 'null' failed with exception: 'endpoint needs to be activated.'.I tried the same application using SIB and things were perfect.What causing this error and make MDBs incapable to consume messages from the queues on MQ??### Assistant: The error messageMQJCA4004means that the message couldn't be delivered to the MDB. The last part of the exception:'endpoint needs to be activated.'is the reason why. The endpoint here is the Message Endpoint which is the endpoint the container creates to managed your MDB instance. The fact that it isn't active means that it was either deactivated due to any earlier error or is marked not to started. However, the MQ Resource Adapter should not have attempted to delivery the message in the first place unless the endpoint had at least being activated to start with.So the mostly likely reason is an earlier error (including application error) has caused the message endpoint to be deactivated. Have a look in the SystemOut.log for an earlier error and look for the warning messageCWWMQ0007W\n"} +{"text": "### Human: Currently, few java applications using SwiftMQ. The new requirement is to replace SwiftMQ with IBM MQ. Java applications uses SwifMQ with JMS. I need to change the java code which should take messages from IBM MQ.\nAs I am new to MQ, i am not aware of things needs to be considered while migrating to IBM MQ.Can we use JMS for IBM MQ? \nCan someone list the things that should be considered for migrating.### Assistant: Yes you can use JMS with IBM MQ. There is a MQ JMS client provided that provides all the libraries you need to run your JMS application. You haven't said which version of MQ you are planning to use but if it is v8 (the latest) then your application just needs to have /java/lib/com.ibm.mq.allclient.jar on the classpath to run.If your application is to run on a separate machine to the MQ QueueManager then you will need to install the MQ Client, this can be foundhere. If it is on the same machine then the MQ install can provide those libraries.In terms of modifying code, if your existing Java application was written against the JMS API then it should just work as JMS is an API specification. However, there are times when an application might need to set a specific JMS Provider property for example so there might be a few changes you need to make.\n"} +{"text": "### Human: I'm by no means an MQ expert. However, I'm assigned a task to integration 3rd party Application --> MQ --> SAP PI --> SAP ECCAs we are facing problems on PI with duplicate (JMS) message IDs, I'd like to know if it is possible to log / trace which (JMS) messages with their respective IDs were put or retrieved from a queue.My overall goal is to verify or falsify the assumption that the sending application or MQ is generating duplicate IDs.3rd party app version = 7.1\nqueue manager version = 7.5I hope this is not all too basic.### Assistant: It so happened that there was indeed a legacy MQ client program which occasionally didn't initialize all it's respective variables and hence created duplicate JMS IDs.We found that out through extensive MQ tracing which happened on each hop the message flowed through.Hope this helps somebody out there with a similar situation.\nCheers\nJens\n"} +{"text": "### Human: We are stuck in a difficult scenario in our new MQ infrastructure implementation using multi-instance queue managers using WebSphere MQ v7.5 in Linux platform.\nThe concern is our Network Team is not able to configure NFS4 and hence we are still having the NFS3 version. We understand multi-instance queue managers will not function properly with NFS3. But are there any issues if we define queue managers in multi-instance fashion in NFS3 and expect to work perfect for single instance mode.Thanks### Assistant: I would not expect you to have issues running single-node queue managers with NFS3, we do so on a regular basis. The requirement for NFS4 was for the file locking mechanism required by multi-instance queue managers to determine when the primary instance has lost control and an a secondary queue manager should take over.If you do define the queue manager as multi-instance, and the queue manager attempt to failover, it may not do so successfully, at worst it may corrupt your queue manager files.If you control the failover yourself - as in, shutdown the queue manager on one node and start it again on another node - that should work for you, as there is no file sharing taking place and all files would be shutdown on the primary node before being opened on the secondary node. You would have to make sure the secondary queue manager is NOT running in standby node -- ever.I hope this helps.Dave\n"} +{"text": "### Human: currently I am working with Apache Camel and trying to write to WMQ. But, unfortunatelly, I got above error. I found out to solve the problem, I will need to transform the character-set or encoding into \"819\" or \"ISO-8859-1\". But, I do not know how to do so in apache camel.Fyi, here is my route configuration:\n\n\n\n \n\n \n\n \n \n \n \n \n queue:///LSMH.ZKSEAP.SERVICEBUS?targetClient=1 \n \n \n \n \n \n \n \n\n \n\nThanks for your help.### Assistant: You can change the encoding like so:More info here:http://camel.apache.org/convertbodyto.html\n"} +{"text": "### Human: Some IBM websphere commands match particular object definition atrribute names, how do I know which attribute belongs to which particular IBM websphere command?\nI want to map IBM WebSphere MQ 7.5.0 command to particular definition attribute.\nFor example for Local Queue:+-----------------+------------------+\n| command name | definition name |\n+-----------------+------------------+\n| MQCA_Q_NAME | \"QLOCAL\" |\n| MQCA_Q_DESC | \"DESCR\" |\n+-----------------+------------------+That is a mapping for local queue, however, the problem is that there are a lot of attributes to map and I'm just keep guessing which attribute belogs to particular definition element. I used this pagehttp://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.ref.adm.doc/q087810_.htm?lang=ento figure out what particular element means.Is there any table where I could find MQ commands and definitions mappings or is there any more efficient way to do it?### Assistant: As far as I know, there is no direct tabular MQSC <-> PCF documentation I'm afraid... Read this discussion for some backgroundhttp://www.mqseries.net/phpBB2/viewtopic.php?p=328375&sid=70185e9883087b72ab1eabbcb99ae6ff\n"} +{"text": "### Human: After processing a message I need to set the Accounting Token on the msg. How do I set it in the outbound message. I have tried the following and it does not workmsg.setObjectProperty(JmsConstants.JMS_IBM_MQMD_ACCOUNTINGTOKEN,value)where value set is a byte[]. But when I observe the message the AccountingToken is not getting set.Is there something I am missing over here?### Assistant: After further analysis I found that the reason why it was not getting set was because the following property was not set.((JmsDestination) dest).setBooleanProperty(WMQConstants.WMQ_MQMD_WRITE_ENABLED, true);After setting the above value the accounting token was available.\n"} +{"text": "### Human: We have an application using Websphere MQ v.7.0.1. The server is on linux, the client application runs on Windows 7 and is written in Java using the MQ classes for java. One of the queues between the client and the server is exclusively for a keepalive protocol between the client and the server. For a variety of reasons we don't need to go into, this is necessary to maintain connections to the \"real back end\" of which the MQ server is only a part.The Keepalive protocol works reasonably well except in the instance when one of the servers goes down and the clients need to reconnect to it when it becomes available. Then we have problems.We have decided that our implementation of the keepalive protocol is much too complicated. The client only needs to send these keepalive messages to the server at a regular interval and need not care if they reach the server or not. If they don't, the server will takeappropriate action.Therefore, an asynchronous put suggests itself. Our first attempt at implementing it was as follows:from this:MQPutMessageOptions pmo = new MQPutMessageOptions(); // accept the defaults\nQueueKL.put(mqMessage,pmo);to this:MQPutMessageOptions pmo = new MQPutMessageOptions(); \npmo.options |= CMQC.MQPMO_ASYNC_RESPONSE; \nQueueKL.put(mqMessage,pmo);The results were an unpleasant surprise. Instead of returning immediately, the put call never returns and the thread from which it was called never shows another sign of life.Of course this call is launched in a try-catch block and we've tried to catch as a last resort any possible Throwable that could be thrown i.e.catch (Throwable t)and log it. Nothing of the sort is logged. The thread appears to be blocked there at this point, the exact opposite of what I expected to happen.I must be missing something critical in how I am implementing thiscall, (is some special setup required in the Queue or QueueManager? The IBM docs are aggravatingly sparse here) but I don't know what that is. Please help me get to the bottom of this.### Assistant: Does this help? Are you at 7.0.1.8 by any unlucky chance?http://www-01.ibm.com/support/docview.wss?uid=swg1IC85084\"This issue also affects users of the WebSphere MQ classes for\nJava who are putting messages to a WebSphere MQ queue\nspecifying MQPMO_ASYNC_RESPONSE in the PUT Message Options\n(MQPMO) structure.\"Try ensuring the client side is at 7.0.1.9 or 7.1.0.2 or higher\n"} +{"text": "### Human: I am using IBM MQ explorer to browse messages on my remote queues. I need to understand the data that comes in the Accounting Token field when I browse in MQ explorer. I see the below data00000 1A 0F D5 C4 F7 F1 C3 C8--C9 D5 F1 C5 F8 C6 F0 C1 |..XXXXCHIN1E8F0A|\n00010 C5 F0 00 1E 8F 0A E0 00--00 00 00 00 00 00 00 00 |E0.\u00b1.\\.........|I am aware that 00000 and 00010 is the line number. The rest is Hex value but I do not understand the value between |XXXXCHIN1E| This value has remote queue manager name.When I try to retrieve this value in my mule flow I only get byte[] which when I convert to Hex it is the same as above. Can someone please help me understand the value between the ||?### Assistant: Looks like a user defined one... Read the docs here:http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.ref.dev.doc/q097420_.htm?lang=enYour 32nd byte seems to be \"MQACTT_UNKNOWN\"\n"} +{"text": "### Human: I have tried enabling http authentication to a SOAPInput node in my message flow, however it does not seem to take effect. I don't have to pass any credentials and I still get a reply. These are the steps I have taken:1.) created a security profile with the following commands:## Set up the security id \nmqsisetdbparms DEV_ESB30_AP01 -n basicSecurityId -u user1 -p testPass1 \n\n## Set up the security profile \nmqsicreateconfigurableservice DEV_ESB30_AP01 -c SecurityProfiles -o orsSecurityProfile -n \"propagation,idToPropagateToTransport,transportPropagationConfig\" -v \"TRUE,STATIC ID,basicSecurityId\"2.) I set the security profile in the BAR to basicSecurityIdAm I missing something?Did I define the security profile correctly?This security profile authenticates correctly when used in a SOAPRequest node, but completely ignored in a SOAPInput node. Thanks for any help you can give.### Assistant: You need to tell broker how to authenticate by setting and authentication provider in the security profile (ie/ LDAP, WS-TRUST).The security profile you have posted just tells broker to put the ID in the properties folder, not actually to do anything with it.Note that is it not currently possible to do both WS-Security and Basic Auth at the same time so if you have a policyset configured basic auth will not work.\n"} +{"text": "### Human: I installed aWAS MQ 7.0on linux then create some QMGRs there.\nAfter a while I decide to useWAS MQ 7.5for security reasons. Then I unistall version 7.0 and install version 7.5. \nIn 7.5 I want to delete all QMGRs that I created in version 7.0, So I try to delete those QMGR but I face to this error:Queue manager 'X' is associated with a different \ninstallation ('installation0') exitvalue=62How can I delete this queue manager?### Assistant: Associate MQ v7.0 queue managers to MQ v7.5 usingsetmqmcommand and then delete.SETMQM -m -n \n"} +{"text": "### Human: This code reproduces the issue:#include \n#include \n\nint main()\n{\n try\n {\n xms::ConnectionFactory factory;\n\n factory.setIntProperty(XMSC_CONNECTION_TYPE, XMSC_CT_WMQ);\n factory.setIntProperty(XMSC_WMQ_CONNECTION_MODE, XMSC_WMQ_CM_CLIENT);\n factory.setStringProperty(XMSC_WMQ_QUEUE_MANAGER, \"my.queue.manager\");\n factory.setStringProperty(XMSC_WMQ_HOST_NAME, \"my.dev.mq\");\n factory.setStringProperty(XMSC_WMQ_CHANNEL, \"my.channel\");\n factory.setIntProperty(XMSC_WMQ_PORT, 1414);\n\n std::cout << \"Is Factory Null? => \" << factory.isNull() << std::endl;\n xms::Connection conn = factory.createConnection(); //THIS THROWS EXCEPTION\n std::cout << \"Is Factory Null? => \" << factory.isNull() << std::endl;\n }\n catch(xms::Exception const & e)\n {\n e.dump(std::cout);\n }\n}It throws exception, dumping the following message:Is Factory Null? => 0\nException:\nErrorData =\nErrorCode = 26 (XMS_E_CONNECT_FAILED)\nJMS Type = 1 (XMS_X_GENERAL_EXCEPTION)\nLinked Exception:\nErrorData = libmqic_r.so\nErrorCode = 0 (XMS_E_NONE)\nJMS Type = 1 (XMS_X_GENERAL_EXCEPTION)Any idea what is wrong with the code?Note thatdevpmmqis just an alias to the actual IP address (host). If I putanyrandom/nonsense value for it, I get the same error, which is bad because the API should have given a better error message such as\"host not found\"or something alone that line. Is there any way to enablemoreverbose diagnostics?### Assistant: XMS C/C++ internally loads WebSphere MQ client libraries. The problem here is that XMS is unable to find WebSphere MQ client librarylibmqm_r.so.What is puzzling me is that the code has setXMSC_WMQ_CONNECTION_MODEasXMSC_WMQ_CM_CLIENTbut XMS is attempting to loadlibmqm_r.so. It should have attempted to loadlibmqic_r.so.Have you installed WebSphere MQ client? Also what is the version of XMSClients can be downloaded fromhere.\n"} +{"text": "### Human: I was trying to connect two remote queue managers using IP address and port numbers. Actually one way connection established between the two queue managers but the two way connection is not established until i stopped firewalls. could any one let me know why firewalls block the connection.### Assistant: What do you mean two way connection? If you mean two sender/receiver pairs (or equivalent) on going in each direction, then it sounds like one of the firewalls is blocking inbound connections whilst letting the outbound one connect. Basically MQ needs to be able to open a connection to the listener (or equivalent) and send data to be able to connect, and if that is being blocked you dont stand a chance. (Note the other thing to watch out for with firewalls are ones which drop unused connections after a while - make sure keepalive is on, and tune the heartbeat lower than the chop period!)\n"} +{"text": "### Human: I need to add a message header to the meassage which i will push to the Tibco and IBM MQ server. Please find below the code :(TextMessage)message).setStringProperty(rs.getString(2),value);the above code adds header to message. but when i convert the message i get the below exceptionerror:com.tibco.tibjms.TibjmsTextMessage cannot be cast to javax.jms.TextMessagAnyother option to add mesage header to a message is also appriciated.### Assistant: Have you tried changing themessagevariable type fromObjecttype tojavax.jms.TextMessage?Sincecom.tibco.tibjms.TibjmsTextMessage implements javax.jms.TextMessage, that MAY allow the conversion.If this answer does not help, please supply more source code and context on the error (stacktrace, EMS message content, etc.)FYI, this declaration was extracted from the EMS tibjms.jar file:public class com.tibco.tibjms.TibjmsTextMessage\n extends com.tibco.tibjms.TibjmsMessage\n implements javax.jms.TextMessage, java.io.Serializable, \n java.lang.Cloneable, com.tibco.tibjms.TibjmsxConst{[...]}\n"} +{"text": "### Human: After installingmq v7.1trial version (server) inredhatLinux I am not able to run anymqcommands likedspmqver crtmqm. I am getting the error bellow. Could someone please advise me in this regard.AMQ8594: WebSphere MQ commands are no longer available in /usr/bin. \n\nIn order to run MQ commands you must manage your path configuration as \n\ndescribed in the WebSphere MQ product documentation. In particular review the\n\ntopic on \"Choosing a primary installation\".Thanks in advance.### Assistant: In particular review the topic on \"Choosing a primary installation\".If you follow the instructions in the MQ InfoCenter on \"Choosing a primary installation\" then everything will work just fine. If you use Google then it would take you to:http://pic.dhe.ibm.com/infocenter/wmqv7/v7r1/topic/com.ibm.mq.doc/zi00700_.htm\n"} +{"text": "### Human: I am trying to use Queue-s, so I need to set a Connection Factory, and Queue.But at the beggining, I can't go forward. I can't set the Connection Factory.I am using this link to set up a connection factory:linkBut at the 9th step I don't know what to set, this is the interface to set:If I set \"localhost\" to Hostname, then click NEXT and trying to test it, I get this message:A connection could not be made to WebSphere MQ for the following\n reason: JMSCMQ0001: WebSphere MQ call failed with compcode '2'\n ('MQCC_FAILED') reason '2059' ('MQRC_Q_MGR_NOT_AVAILABLE').So.. How could create a connection factory?### Assistant: The transport should not be client if you are trying to connect to a local qmgr in bindings mode. The application server will access the qmgr using IPC.If you are trying to connect as a client then TCP will be used in that case you need to specify the port where the qmgr listener is listening and the SVRCONN (server connection) channel to use.\n"} +{"text": "### Human: I have a app server that runs multiple camel routes that are reading messages from a JMS Queue, each route runs with different selectors.We have an app server for each group of clients. So at the end there are multiple connections created to the queue. And that seems to be affecting the read and write performance on the queue.I tried to use a connection pool, (by the way i am using WMQ), the closest I got is to use spring's CachingConnectionFactory (as described in this posthow to configure (spring) JMS connection Pool for WMQ).I was hoping that the number of connections will reduce from each app server, but that did not happen. Even though i set the size to 5 on the CCFactory, i see 10 connections created to the queue. According to the documentation on CCFactory, explicit closing of the connections is required. Is it possible or does it even make sense to close the connection that is used by a camel route that is reading from a queue? Or is there a way to tell camel routes to share the connections? I thought the use of connection pool and factory will do that, but i don't see that from happening.Can I achieve what I want to achieve?Thanks in advance.### Assistant: what you can do is have only one route reading from the queue instead of many, and then use some camel conditional logic to redirect the message to the correct processing route via direct endpoints, see also thisexample.This way there would only one consumer for the queue, instead of multiple consumers each running it's own selector.\n"} +{"text": "### Human: An MQ Input node can only connect to the MQ that is bound to the MessageBroker installation. I would like to connect to a remote MQ. I would like to avoid using the JMS Input.Would it be possible to use the MQ Service for connecting to a remote MQ?I'm using tve version 9, so actually the IIB.### Assistant: You can deliver outbound messages to remote queue managers via the broker's queue manager if suitable channels and xmit queues are setup.This however is not the same as a client connection to a remote queue manager which is not currently supported.You could use a JCN to call the MQ base API or you could raise a request for enhancement here:http://www.ibm.com/developerworks/rfe/?PROD_ID=532\n"} +{"text": "### Human: I have a question related to WINS configuration in Windows and how it affects the dcom config MQ domain service account used. My understanding is MQ is usingDomain\\serviceaccountfor the dcom configuration in Windows and we cannot enterFQDN\\serviceaccountBut when we removed WINS configuration in Windows 2008 server the Domain\\serviceaccount in MQ dcom config is no longer recognized and we were getting error when trying to register MQ service with OS. As a workaround we had to add DNS suffices which enabled the MQ service to get registered to OS.I wanted to know is this how it is supposed to work with DNS and no WINS configuration in a Windows OS? We are using MQ version 7.0.1.8 and is there any fixes in future releases where we can useFQDN\\serviceaccountin dcom config for IBM MQSeries.?### Assistant: I dont know if itsolvesthe problem, but 7.1 onwards no longer has a DCOM object anymore. The service itself is configured to run under the domain id from the PrepareWizard, look at the identities tab of the service.Why can you not enter the FQDN\\serviceaccount anyway, what breaks? If the prepare wizard doesnt let you do it, can you set it manually through the dcom MQSeries identity page (dcomcnfg, work downwards)?\n"} +{"text": "### Human: I am using JMS to put a message on MQ and an MDB that uses JMS classes ( not MQ specific classes ) to read and process the message.When I print the message ( which uses the message's toString() method, I get the output belowI want to programmatically retrive the value of 'jms_text', 'jms_bytes', etc. as the case maybe.How can I achieve that? I tried to find the properties, but that also did not give me this information.+++ SAMPLE MDB: Text Message => Testing sending message to error queue\n[3/15/14 8:54:51:988 EDT] 00000323 SystemOut O Received message: \n\n JMSMessage class: jms_text\n --------------------------\n JMSType: null\n JMSDeliveryMode: 2\n JMSExpiration: 0\n JMSPriority: 4\n JMSMessageID: ID:414d5120514458362020202020202020cc070d53025e4d22\n JMSTimestamp: 1394803436074\n JMSCorrelationID: null\n JMSDestination: queue:///XX.MY.ERR.QUEUE\n JMSReplyTo: null\n JMSRedelivered: false\n JMSXAppID: WebSphere MQ Client for Java\n JMSXDeliveryCount: 1\n JMSXUserID: b8320 \n JMS_IBM_Character_Set: UTF-8\n JMS_IBM_Encoding: 273\n JMS_IBM_Format: MQSTR \n JMS_IBM_MsgType: 8\n JMS_IBM_PutApplType: 28\n JMS_IBM_PutDate: 20140314\n JMS_IBM_PutTime: 13235615\nTesting sending message to error queueThank you for any help### Assistant: Updated:You can use theinstanceofoperator to determine the type of message. JMS defines five types of messages Text, Stream, Bytes, Map and Object. So you can check as below:if (rcvdMessage instanceof JMSTextMessage)\n msgType = \"jms_text\";\nelse if (rcvdMessage instanceof JMSStreamMessage)\n msgType = \"jms_stream\";\nelse if (rcvdMessage instanceof JMSMapMessage)\n msgType = \"jms_map\";\nelse if (rcvdMessage instanceof JMSBytesMessage)\n msgType = \"jms_bytes\";\nelse if (rcvdMessage instanceof JMSObjectMessage)\n msgType = \"jms_object\";\nelse\n msgType = \"jms_none\";\n"} +{"text": "### Human: In logging how couldlog pagesare useful and used for log writings ?appreciate any one help..!### Assistant: Log pages are an internal feature of WMQ. They are used by the queue manager to record recoverable data that is needed a queue manager restart to possibly restore objects and messages that were modified or processed since the last checkpoint.They are not directly usable by the applications or users, for the most part can be ignored.More information is available on the WMQ7 InfoCenterhttp://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp\n"} +{"text": "### Human: In a WebSphere MQ environment where five queue managers are in a hub-and-spoke configuration\nhow many channels must be created in order for the four spoke queue managers to exchange messages with the one hub queue manager hub-and-spoke configuration?Thanks,\n-Code### Assistant: If you include all the queue managers in a WMQ cluster, you will need to define \n1. on the hub:\na. CLUSRCVR channel pointing to itself\n2. on each of the 4 spokes:\na. CLUSRCVR channel pointing to itself\nb. CLUSSDR channel pointing to the hub queue manager; same name as the hub's CLUSRCVR channelThe hub qmgr should be designated as the REPOS for the cluster.See documenthttp://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzah.doc/qc10120_.htmin the WMQ V7.0 InfoCenter for complete instructions on setting up a cluster.\n"} +{"text": "### Human: I have a mule flow which reads messages from a sonic topic and publish to a Websphere MQ Topic.\nThe flow is synchronous and transacted.\nI have set maxRedelivery=\"10\" in the inboud endpoint. but it keeps on trying to redeliver.\nHere is the exception I get:ERROR 2014-03-03 15:13:08,763 [JMS Session Delivery Thread - $TMPAPPID$544239$$SESSION$0:-3441129419112818566] org.mule.exception.DefaultMessagingExceptionStrategy: \n********************************************************************************\nMessage : \"Message with id \"ID:1419c04f:da190005:1448992ACB1\" has been redelivered 1,511 times on endpoint \"jms://topic:testtopic\", which exceeds the maxRedelivery setting of 10 on the connector \"sonicMQConnectorSub\". Message payload is of type: TextMessage\nCode : MULE_ERROR--2\n--------------------------------------------------------------------------------\nException stack is:\n1. \"Message with id \"ID:1419c04f:da190005:1448992ACB1\" has been redelivered 1,511 times on endpoint \"jms://topic:testtopic\", which exceeds the maxRedelivery setting of 10 on the connector \"sonicMQConnectorSub\". Message payload is of type: TextMessage (org.mule.transport.jms.redelivery.MessageRedeliveredException)\n org.mule.transport.jms.redelivery.JmsXRedeliveryHandler:91 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/transport/jms/redelivery/MessageRedeliveredException.html)\n--------------------------------------------------------------------------------\nRoot Exception stack trace:\norg.mule.transport.jms.redelivery.MessageRedeliveredException: \"Message with id \"ID:1419c04f:da190005:1448992ACB1\" has been redelivered 1,511 times on endpoint \"jms://topic:testtopic\", which exceeds the maxRedelivery setting of 10 on the connector \"sonicMQConnectorSub\". Message payload is of type: TextMessage\n at org.mule.transport.jms.redelivery.JmsXRedeliveryHandler.handleRedelivery(JmsXRedeliveryHandler.java:91)\n at org.mule.transport.jms.MultiConsumerJmsMessageReceiver$JmsWorker.preProcessMessage(MultiConsumerJmsMessageReceiver.java:426)\n at org.mule.transport.AbstractReceiverWorker$1$1.process(AbstractReceiverWorker.java:120)\n+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)\n********************************************************************************Here is the flow I use.\n\n \n \n \n \n \n\n\n\n\n \n \n \n \n \n \n \n\n\n\n \n \n \n \n \n \n \n \n \n \n\n### Assistant: This is expected behavior, the above exception is raised when the maximum redelivery count defined in maxRedelivery has been exceeded by your JMS provider. See the answer by David Dossot here:jms Mule max redelivery exceeded\n"} +{"text": "### Human: I just recently started learning aboutspring-integrationsince I need to replace the a MDB(J2EE) application.The application is composed of mostly MDB which does, splitting, aggregating and scheduling. Which, I think is the perfect criteria to use spring-integration.I tried out some JMS examples and tried to deploy it but could not figure out how to use the jms-inbound-gateway to replace the MDB.Is there a way to do this? Or is the only option is still to use MDB and calling the spring-integration service from the MDB's onMessage?### Assistant: Use a message-driven-channel-adapter instead of an inbound gateway.With Spring Integration, gateways are for two-way (request/reply) integraton; channel adapters are for one way integration; more like MDBs.If you need to send some other JMS message downstream, use an outbound channel adapter later in the flow.It's unusual to keep the MDBs, but you can do it if you really want to, and send a message to an integration flow.\n"} +{"text": "### Human: How would you implement a Content Enricher in WebSphere MQ using Java?Given an existing input message is provided from a queue, here are some of my ideas, none of which satisfies me:Deep-clone the message object.Hereis an explanation of how it could be done, but I can't find eitherclone()orserialize()methods for the javax.jms.Message class.Take the original message, set the additional properties usingsetXXXProperty()and send it\nforward. This throws an exception suggesting that the message is\nread-only.Create a new message, iterate over properties of the\nexisting message and set them to the new message.getPropertyNames()can help to do this, but it says nothing about\ntypes of properties, so this information will be lost.### Assistant: In short, IBM integration bus can do it in a message flow... But let me provide a WMQ Java answer also:The message object that is received can be modified and sent back ... All you need to do is to read all the stuff you need from that message to some java object. For example you can use a Map for Properties. Then call clearProperties() and then set the modified properties. The issue of readonly goes away after calling clearProperties() (http://docs.oracle.com/javaee/5/api/javax/jms/Message.html#clearProperties%28%29)So a mix of (2) and (3) can help in solving the problem.\n"} +{"text": "### Human: I created a QM and Queue using the User Guide MQ-7.1. Now i want send message from a Java application so i followed the guide and created a channel but i dont know whether only Server-connection Channel should be created or anything else more to be done. When I try to access it I get an Exception.MQJE001: An MQException occurred: Completion Code 2, Reason 2035\nMQJE036: Queue manager rejected connection attempt\u201d.I got a link(http://middlewaremagic.com/jboss/?p=1490) where it tells to add MCA User ID. But i dont know how to find it. I will be very happy if any one of you help me on this--Thanks in advance### Assistant: You need only the Server Connection channel and the MCA user can be set using the MQ Explorer or the command line (runmqsc).Here is the link to runmqsc:http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=%2Fcom.ibm.mq.amqzag.doc%2Ffa11160_.htmHere is the link to the ALTER command that can be used to change the MCA user on the channel :http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzaj.doc/sc10480_.htm\n"} +{"text": "### Human: I have a WAS MQ server and some queues which have couple of messages. I have a java consumer to get those messages and everything is OK. When I want to get those messages by.net or delphiapplication; it's not working and throw anerror code 2058. When I installWAS MQ Clientin my PC; the error went away.I want to install my .net app in more than 25 clients and I do not want to installWAS MQ Clientto all of those clients. Is there a .dll or configuration or something like that to avoid installWAS MQ Client?I am using these two dll:amqmdnet.dll, amqmdxcs.dll### Assistant: Unfortunately It's not possible for now.\nSee below link for more details:.net using IBM MQ without full MQ client install\n"} +{"text": "### Human: Recently I need to develop JBOSS application which receives IBM MQ Message.It seems like use wmq.jmsra.rar and Message Driven Bean is a most common solution.\nBut I'm a little bit uncertain who is responsible of this Resouce.\nIBM? or Redhat?I'd rather develop my own queue connector daemon which read message from IBM MQ and send to JBOSS MDB using JMS.In this case, I need 2 phase commit, to commit simultaneously both IBM MQ side and JBOSS side. Can I use something like XATransaction on this process? Is there any example on Web if it's possible.Sorry, I couldn't find any example so far.Many thanks.### Assistant: wmq.jmsa.rar is released by IBM. Its found as part of the product. Go with the latest release WMQ 7.5 if possible.\nWMQ supports XA transaction. It can participate as a resource manager in a 2 phase transaction coordinated by an external transaction monitor/application server.Sample programs for Java XA transaction are not found with the installation. (I know I have seen C and Cobol XA samples).http://pic.dhe.ibm.com/infocenter/wmqv7/v7r5/index.jsp?topic=%2Fcom.ibm.mq.dev.doc%2Fq023590_.htmhttp://pic.dhe.ibm.com/infocenter/wmqv7/v7r5/index.jsp?topic=%2Fcom.ibm.mq.dev.doc%2Fq031500_.htmYou will require a local qmgr (application should run on the same server as qmgr to connect in bindings mode) or extended transactional client to connect to a remote qmgr using XA transactions.\n"} +{"text": "### Human: Basically I have two problems:Optional SSL for Queue Manager not working as expectedI have QM configured well. For testing I'm using MQIVP Java class from WebSphere MQ installation. Without SSL configured I have no problem to run MQIVP successfully. When I set up QM SSL authentication as optional it stops working, probably not so optional, any idea?Another additional property is that when using Spring and SSL authentication as required I have no problem to connect to QM without additional configuration for Spring (comparing with the one without SSL)Java SSL Logging not working as expectedAccording to thatarticleI configured trustStore and keyStore, but when trying to use SSL with MQIVP no additional logging is in the log.I have properties set:-Djavax.net.debug=all\n-Djavax.net.ssl.trustStore=\"c:\\Program Files (x86)\\IBM\\WebSphere MQ\\trustStore.jks\"\n-Djavax.net.ssl.trustStorePassword=trust\n-Djavax.net.ssl.keyStore=\"c:\\Program Files (x86)\\IBM\\WebSphere MQ\\keyStore.jks\"\n-Djavax.net.ssl.keyStorePassword=key### Assistant: I know for the keyStore you just specify the file name without the extention, so try this:-Djavax.net.ssl.keyStore=\"c:\\Program Files (x86)\\IBM\\WebSphere MQ\\keyStore\"You may also try the same for the trustStore.\n"} +{"text": "### Human: The sample program below is supposed to be started periodically and should process all messages on a queue (on another machine) as fast as possible and then stop. Each message should be processed in a separate distributed transaction as the processing will also need to access and alter multiple databases.The Managed mode seems to be too slow as it processes 1 message every 3 seconds.The Unmanaged mode has acceptable performance but I'm having 2 problems with that.1) When the program ends, the event log of the server contains hundreds of error messages, all reporting the same error:28/01/2014 15:20:49 - Process(8604.48) User(<>) Program(amqrmppa.exe) Host(<>) Installation(Server) VRMF(7.5.0.2) QMgr(<>)\n\nError on receive from host <> (<>). \n\nAn error occurred receiving data from <> (<>) over TCP/IP. This may be due to a communications failure. \n\nThe return code from the TCP/IP recv() call was 10054 (X'2746'). Record these values and tell the systems administrator.2) Running the program against a queue with a limited number of messages goes fine (except for the problem above), but but after processing a few hundreds of messages (500+) it suddenly crashes with the following exception:MQException: MQRC_UOW_ENLISTMENT_ERROR, CompCode 2, Reason: 2354The second problem is probably related to the first, but I don't see anything wrong with the code. All MQ objects are properly disconnected, closed and disposed.All help is welcome...using System;\nusing System.Collections;\nusing System.Text;\nusing System.Transactions;\nusing IBM.WMQ;\n\nnamespace WMQTest\n{\n internal class Program\n {\n private const string HostName = \"TST010\";\n private const int Port = 5021;\n private const string ChannelName = \"CL_QMSTST010\";\n private const string QueueManagerName = \"QMSTST010\";\n private const string QueueName = \"SD.TRANSX.ARCHIVE\";\n\n private static readonly MQGetMessageOptions GetMessageOptions = new MQGetMessageOptions\n {\n Options = MQC.MQGMO_WAIT + MQC.MQGMO_SYNCPOINT,\n WaitInterval = 20000\n };\n\n private static readonly TransactionOptions TransactionOptions = new TransactionOptions { Timeout = TransactionManager.DefaultTimeout, IsolationLevel = IsolationLevel.Serializable };\n\n private static void Main()\n {\n try\n {\n Console.WriteLine(\"Use managed mode?\");\n var key = Console.ReadKey(true);\n bool managedMode = key.KeyChar == 'y' || key.KeyChar == 'Y';\n var properties = new Hashtable\n {\n {MQC.HOST_NAME_PROPERTY, HostName},\n {MQC.PORT_PROPERTY, Port},\n {MQC.CHANNEL_PROPERTY, ChannelName},\n {\n MQC.TRANSPORT_PROPERTY,\n managedMode ? MQC.TRANSPORT_MQSERIES_MANAGED : MQC.TRANSPORT_MQSERIES_XACLIENT\n }\n };\n while (true)\n {\n //starting a transaction scope \n using (var transaction = managedMode\n ? new TransactionScope()\n : new TransactionScope(TransactionScopeOption.Required,\n TransactionOptions,\n EnterpriseServicesInteropOption.Full))\n {\n using (var queueManager = new MQQueueManager(QueueManagerName, properties))\n {\n using (\n MQQueue queue = queueManager.AccessQueue(QueueName,\n MQC.MQOO_INPUT_AS_Q_DEF +\n MQC.MQOO_FAIL_IF_QUIESCING))\n {\n var message = new MQMessage();\n try\n {\n queue.Get(message, GetMessageOptions);\n }\n catch (MQException ex)\n {\n if (ex.CompCode != 2 || ex.ReasonCode != MQC.MQRC_NO_MSG_AVAILABLE)\n {\n throw;\n }\n //No message available, stop\n break;\n }\n //TODO: DO SOME INTERESTING DATABASE STUFF HERE\n Console.WriteLine(Encoding.ASCII.GetString(message.MessageId));\n //\n message.ClearMessage();\n queue.Close();\n }\n queueManager.Disconnect();\n }\n transaction.Complete();\n }\n }\n }\n catch (Exception ex)\n {\n Console.WriteLine(\"EXCEPTION OCCURRED\");\n Console.WriteLine(\"==================\");\n Console.WriteLine(ex);\n }\n }\n }\n}### Assistant: There are few fixes available in the XA area. These are all for Managed mode. You may want to contact IBM to get these fixes and apply and see if that helps.http://www-01.ibm.com/support/docview.wss?rs=171&uid=swg1IC92296http://www-01.ibm.com/support/docview.wss?rs=171&uid=swg1IC92931http://www-01.ibm.com/support/docview.wss?rs=171&uid=swg1IC92932\n"} +{"text": "### Human: I'm about to refactor a broker application written for websphere MQ. In the existing application, while reading a message from the queue, the following options are being set:MQConstants.MQGMO_WAIT andwaitInterval = 1000 (milliseconds).In our application, there is no guarantee that we receive a message every second. We may not receive a message even for hours. I'm not sure why the creators of this application chose to go for waitInterval = 1000 instead of setting the waitInterval to MQWI_UNLIMITED.\nAt the moment, there is a catch block in the code which does not do anything when MQException.MQRC_NO_MSG_AVAILABLE occurs.The creators of this application were really smart people so I do not know why they opted for this approach. I'm new to MQ series, so can anyone please explain the reason behind this?### Assistant: Well its just to check the queue every second for a message. You can be more intelligent by using features like async message delivery in a thread of use some of the new features of MQ that does not do lot of polling on the Queue.\n"} +{"text": "### Human: how can i properly setup Kerberos in Websphere MQ? In the documentation, it says can useSCYEXIT('amqrspin(SCY_KERBEROS)')I suppose this attribute is defined when when create the channels? egdefine CHANNEL (...) .... SCYEXIT('amqrspin(SCY_KERBEROS)')how aboutSCYDATA('remote_principal_name')? Does this need to defined afterscyexit? What other setups do I need to consider besides these 2 channel attributes?is there other good tutorial on this subject? thanks.### Assistant: Theamqrspinsecurity exit shipped with MQ supports KERBEROS and NTLM. A channel can be defined to use the security exit asdefine channel(ABC) chltype(SVRCONN) SCYEXIT('amqrspin(SCY_KERBEROS)') SCYDATA('domusr')where 'domusr' is in the form DOMAIN\\user. The secure channel is established only if the name of the remote principal matches 'domusr'.Hereis some more information onamqrspinsecurity exit.\n"} +{"text": "### Human: I have a WTX map which puts a message on WMQ \"Q1\". There is some other application which reads the message from \"Q1\" and then processes the message and places the response on the queue specified in \"ReplyToQ\" available on MQ Header information.I am not able to find a command parameter to add the ReplyToQ in the message WTX map is placing on \"Q1\".Any thoughts?Thanks for taking the time to look at this question and helping out!### Assistant: The ReplyToQueue is sent on the message header, so you must get the message with the header (-HDR) and parse it from there on your input card.Here's the doc about the adapter's command:http://pic.dhe.ibm.com/infocenter/wtxdoc/v8r4m1/index.jspYou should have a type tree on the Examples to read the message with a header.Regards,\nBruno.\n"} +{"text": "### Human: I have a new WMQ 7.5.0.2 server on a new machineI have a client jar, taht include WMQ client jarsI replaced the old client jars with the 7.5.0.2 jars into my master client jarcom.ibm.mq.jar\n dhbcore.jar\n com.ibm.mq.headers.jar\n com.ibm.mq.jmqi.jar\n com.ibm.mqjms.jarHowever, when I run my client, I see the following:JMS Provider Name=IBM WebSphere MQ \nProvider Version=7.0.0.0 \nProvider Major Version=7 \nProvider Minor Version=0I am sure the program is connecting to the correct, and that the new client jars are 7.5.0.2Am I correct in believing that the Product Version should be 7.5.0.2 instead ofProvider Version=7.0.0.0I need to ensure I am using the correct jar files, how should I proceed?Thanks### Assistant: Provider Version=7.0.0.0Where did you get that information from?Note: Your queue manager may be v7.0.0.0 and your client application may be using v7.5.0.2 JAR files.\n"} +{"text": "### Human: I'm having some obscure performance issues when using MQ Series from a .NET WCF service.The service is multi-threaded - it receives many requests per second and puts it on the queue. Since connecting to the queue is considered costly, I decided that the service is a singleton, which connects once to the queue (as soon as it's instantiated) and then accepts many parallel calls to put messages on the queue.On my current environment, I can handle up to 850 calls per second. After this number, something starts to go very wrong. All of a sudden I start gettingtimeouterrors from WCF. All my analysis points to the fact that the PUT command is taking too long and my guess is that it is syncronizing the threads; This would mean that the more requests I have, the longer each one takes.Some samples from my code:// The objects below are members of the singleton service\n_mqQueueManager = new MQQueueManager(_config.QueueManagerName,\n channelConfig[0], channelConfig[2]);\n\n_mqQueueEscrita = _mqQueueManager.AccessQueue(_config.QueueConnectionName,\n MQC.MQOO_FAIL_IF_QUIESCING | MQC.MQOO_OUTPUT);And them comes the writing method:public void EscreverMensagemObject(object entrada_)\n {\n try\n {\n\n var mensagemMq = new MQMessage { Format = MQC.MQFMT_STRING, Expiry = MQC.MQEI_UNLIMITED };\n mensagemMq.WriteObject(entrada_);\n var opcoesMqPut = new MQPutMessageOptions();\n\n _mqQueueEscrita.Put(mensagemMq, opcoesMqPut);\n }\n catch (MQException mqEx)\n {\n if (mqEx.ReasonCode == MQC.MQRC_CONNECTION_BROKEN)\n Reconectar();\n else\n throw new Exception(string.Format(ERRO_AO_ESCREVER_MENSAGEM, mqEx.Reason, mqEx.Message), mqEx);\n }\n catch (Exception ex)\n {\n throw new Exception(string.Format(ERRO_AO_ESCREVER_MENSAGEM, ex.HResult, ex.Message), ex);\n }\n\n }That's the essence of it. Am I doing something wrong or forgetting to set some options that would help me achieve a higher performance?### Assistant: I am guessing you might be getting into a race condition when multiple threads are trying to use the same connection to put messages. I suggest you to tryMQC.MQCNO_HANDLE_SHARE_BLOCKoption when creating connection to queue manager. This option indicates that connection and object handles allocated by one thread of a process can be used by other threads belonging to the same process. However, only one thread at a time can use any particular handle; that is, only serial use of a handle is permitted. If a thread tries to use a handle that is already in use by another thread, the call blocks (waits) until the handle becomes available.More details on different MQCNO_ arehere\n"} +{"text": "### Human: Discovering list of all Queue Managers through java programs.Hi team how can we Discover list of all Queue Managers through java programs.To start with i have created 2 Queue managers and a cluster of 3 queue managers.I need to write a monitoring application for WMQ. IS there an alternative to PCF?### Assistant: Did you try out the open source project MQ Port Scan?http://www.capitalware.biz/mqps_overview.html\n"} +{"text": "### Human: I am using IBM Websphere message queue (MQ SERIES).Through my code i am sending a message to the message queue and before retriving the meaage from the other end ,I am sending another message to the same message queue,Will the previous message in the message queue is overwritten by my new message??Or it depends on the timestamp or someting else, Plesae help me out to slove this. Thanks in advance.### Assistant: As the name says,Message Queue, messages sent to a queue are appended and not overwritten and will reside in that queue until they are consumed by an application or expire if expiry time is set on messages. A sending application can set a expiry (aka Time to live) time, meaning how long a message can stay in a queue. If the message is not consumed before the time, the message expires and becomes unavailable for consumption.\n"} +{"text": "### Human: I have a JMS client that runs with 5.3 WebSphereMQ libraries and runs fine. I tried to upgrade WebSphereMQ JMS libraries to 7.5 and got the following exception:MQJMS2008: failed to open MQ queue ''.; nested exception is \n com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2035'.!This one comes up when I try to access anMQQueueinstance. I read up on the Internet that this one is a \"NOT_AUTORISED\" error. But with 5.3 we didn't use any credentials and it worked. I also read that there is a system propertycom.ibm.mq.jms.ForceUserIDwhich controls whetherMQConnectionFactorysends current user ID or just empty string, but changing this property didn't do anything for me.Let me also say that I have no control over queue manager and the administrators are reluctant to give any details. Maybe it's something simple that can be fixed by changing some simple property?### Assistant: Look at the properties of the channel used to connect to the queue manager. Both SVRCONN and CLNTCONN if define. Is there a MCAUSER(userid) defined in that channel which is available in the machine with 7.5 qmgr? This userid should be given permissions to connect to the queue manager and put/get permissions to the queue.Are you sure if there is any channel exit overriding the user setup.There are lot of changes between 5.3 and 7.5. Make sure the channel used by the application doesn't connect as mqm but as another user.The MQ Administrators must provide support in this scenario (an administrator myself). You cant fix this on your own.\n"} +{"text": "### Human: I am trying to check statistics on remote queues, however I need to connect without using the queueManagerName. I know it is possible however I have not been able to find an example or to get my code working?Hashtable properties = new Hashtable();\n properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);\n properties.Add(MQC.CHANNEL_PROPERTY, channel);\n properties.Add(MQC.HOST_NAME_PROPERTY, host);\n properties.Add(MQC.PORT_PROPERTY, port);\n\n MQQueueManager qmgr = new MQQueueManager(queueManager, properties);\n\n try\n {\n var queueDepth = qmgr.AccessQueue(userQueue,\n MQC.MQOO_INPUT_AS_Q_DEF +\n MQC.MQOO_FAIL_IF_QUIESCING +\n MQC.MQOO_INQUIRE).CurrentDepth;\n\n var maxDepth = qmgr.AccessQueue(userQueue,\n MQC.MQOO_INPUT_AS_Q_DEF +\n MQC.MQOO_FAIL_IF_QUIESCING +\n MQC.MQOO_INQUIRE).MaximumDepth;\n\n if (qmgr.IsOpen)\n qmgr.Close();\n\n Console.WriteLine(queueDepth);\n }\n finally\n {\n if (qmgr.IsOpen)\n qmgr.Close();\n }\n}### Assistant: Your sample code works perfectly fine for me and prints the queue depth correctly. I just changed this line:MQQueueManager qmgr = new MQQueueManager(queueManager, properties);to, just passing \"\" (blank) as queue manager name as your requirement was not to use queue manager name.MQQueueManager qmgr = new MQQueueManager(\"\", properties);\n"} +{"text": "### Human: I am using the IBM Supplied MQQueueManager via .Net to make various calls into our MQ Server / Queue. I was wondering what method, if any, I could use to get that information? I have looked through the methods and nothing stands out. Any suggestions would be greatly appreciated. I am hoping to get the oldest message and at what time it was enqueued.I know that MQSC Has this command which would be great to use if available in MQQueueManager:Oldest message age - The age, in seconds, of the oldest message on the queue -MSGAGEThanks,Scarpacci### Assistant: As you know we call it aQueue. Queue meansFIFO(First in-First out). And FIFO means that by default when you issue an MQGET, you will get the oldest message(which came to queue before all others). If your requirement would have been to get the latest message in the queue then you would need some effort using BROWSE_NEXT MQGMO.For getting Queue Status, you would need PCF. There are lot of examples available for PCF.\nCheckthisanswer for instance.\n"} +{"text": "### Human: In the following scenario, i'm curious as to what happens as it relates to what's in the active LOG files of the queue manager in question. Linear Logging is being used.What activity (if any) is experienced by the MQ Active LOGS, during a scenario where a queue with say, 100 messages, is being READ with a JMS context attribute (looking for a specific message) -- that, for the case of this arguement, it will NEVER find. All messages are read off the queue, but none are committed. The messages therefore were never actually deleted from the queue; does the queue manager, however, record such GET operations so as to recover these \"in flight\" conditions, should the queue manager Crash while this is happening? We recently experienced a situation where the dequeue rate from a specific queue was in the 4000-4500 msg / min range, while the queue depth was only about 2500. We surmise that more than 1 such process thread were trying to read off a JMS message by context (sort of like with correlation ID I suppose), but without any hope of ever actually finding a message it was looking for (due to a probable misconfiguration). During this time, the active LOGS filled up rapidly. Is it likely that such wanton dequeue rates as we saw were the culprit?### Assistant: MQ writes log records for persistent messages during get and put. More details can be found here:http://pic.dhe.ibm.com/infocenter/wmqv7/v7r5/topic/com.ibm.mq.dev.doc/q023070_.htm\n"} +{"text": "### Human: Many websites have architecture like:-Static content served by Web Server.Dynamic content served by Application Server.When Application server alone can server both static as well as dynamic content,\nWhy two servers are needed ?Please explain ?### Assistant: Web servers can perform more services than serving content. They can intercept the requests from the browser and responses from a multitude of application servers.Here is what I can see as scenarios where web server vs no web server can be identified.Web Server required when:Enterprise have more than one application serving users.Access control for the user is needed for several applications.Software load balancing for scaling is required.Applications serving users need to be fault tolerant.Security wise to hide the servers that user is accessing and hence the reduce the risk of threats.Static content is served to the users.Usability wise to avoid redirections to several applications that have inconsistent look and feel.A classic scenario is where external users interact with a enterprise and the enterprise uses several internal and external applications to serve the user.No web server is required when:A single application serves users in a enterprise.Access control is managed within the application.The application has its own mechanism for scaling and fault tolerance.Eg: Intranet portals serving users by processing simple interactions of users.\n"} +{"text": "### Human: I am writing a code in c# .NET which connects to IBM websphere. When tried to connect to queue manager i am getting the error:2035 (07F3) (RC2035): MQRC_NOT_AUTHORIZED error message.But with same details(Host name,port number,channel name,queue manager) i am able connect to queue manager and queue using java code.What could be the reason?Thanks in Advance### Assistant: When you connect to MQ via bindings mode, the MQ Client library uses the UserID that you are running under.When you connect to MQ via client mode, the MQ Client library uses:the UserID that is set in your code orthe value (UserID) set in the channel's MCAUSER field.You should read up on MQ security and make sure you implement it correctly. Talk to your company's MQAdmin.\n"} +{"text": "### Human: When we use a client acknowledgement mode in JMS (I am using Websphere MQ and WAS), the MDB sends the acknowledgement to whom (the docs say to the JMS server).But in this case, the JMS server means what: the WebSphere MQ which actually has all the queues and the messages or the web sphere application server that is connecting to the websphere MQ.### Assistant: Acknowledgements, no matter the type, are always sent to the JMS server. Message producers and consumers never communicate directly due to the asynchronous nature of JMS.Are you using connection factories to obtain a connection? If so, look at the broker url configuration in those factories. You should find the connection url points to WSMQ brokers. So, when you get a connection from a connection factory, the client connection goes directly to the JMS server in WSMQ.\n"} +{"text": "### Human: I have used .net C# code to put messages on the queue and get messages back. I have no problem in accessing the queue and getting messages. Now I want to have the get message calls under Transaction and used explicit transaction option to commit and rollback the messages.try\n {\n MQQueueManager queueManager;\n\n MQEnvironment.Hostname = hostName;\n MQEnvironment.Channel = channelName;\n MQEnvironment.Port = 1414;\n MQEnvironment.properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES);\n\n\n queueManager = new MQQueueManager(queueManagerName);\n\n\n // obtain a read/write queue reference\n var queue = queueManager.AccessQueue(queueName, MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_INQUIRE + MQC.MQOO_FAIL_IF_QUIESCING);\n IList Messages = new List();\n\n using (var scope = new CommittableTransaction())\n {\n CommittableTransaction.Current = scope; \n var message = new MQMessage();\n\n try\n {\n var getMessageOptions = new MQGetMessageOptions();\n getMessageOptions.Options += MQC.MQGMO_SYNCPOINT ;\n int i = queue.CurrentDepth;\n queue.Get(message,getMessageOptions); \n Console.WriteLine(message.ReadString(message.MessageLength));\n scope.Rollback();\n }\n catch (MQException mqe)\n {\n if (mqe.ReasonCode == 2033)\n {\n Console.WriteLine(\"No more message available\");\n Console.ReadLine();\n scope.Rollback();\n }\n else\n {\n Console.WriteLine(\"MQException caught: {0} - {1}\", mqe.ReasonCode, mqe.Message);\n Console.ReadLine();\n scope.Rollback();\n }\n }\n CommittableTransaction.Current = null;\n }\n\n\n // closing queue\n\n queue.Close();\n\n\n // disconnecting queue manager\n\n queueManager.Disconnect();\n Console.ReadLine();\n\n }\n\n catch (MQException mqe)\n {\n Console.WriteLine(\"\");\n Console.WriteLine(\"MQException caught: {0} - {1}\", mqe.ReasonCode, mqe.Message);\n Console.WriteLine(mqe.StackTrace);\n Console.ReadLine();\n }The first problem I faced was , related to access toSystem.Dotnet.XARecoveryqueue. Even though I had access to the queue to get messages from the queue , the program started to fail because of the access rights on the recovery queue when below line was invoked.queue.Get(messages),Then I got the access on the recovery queue and access denied problem was resolved. Now after getting the message from the queue , the messages are not roll backed afterscope.RollBack()is called.I checked in theSystem.Dotnet.XARecoveryqueue and dead letter queue and there was not nothing there as well.Why I am not able to see the rolled back messages in the WMQ message queue.### Assistant: You have ascope.Commit();afterqueue.Get(message);After getting the message you are explicitly calling the Commit. If the Get is successful, the Commit call tells the queue manager to remove the message from queue. So there is no chance of message getting rolled back.EDIT:GMO_SYNCPOINT option is missing in your code. You need to have something like thisMQGetMessageOptions getMessageOptions = new MQGetMessageOptions();\n getMessageOptions.Options += MQC.MQGMO_SYNCPOINT;\n queue.Get(message, getMessageOptions);\n"} +{"text": "### Human: Closed. This question needsdetails or clarity. It is not currently accepting answers.Want to improve this question?Add details and clarify the problem byediting this post.Closed9 years ago.Improve this questionI am new to WMB and I want to connect WMB to database. Please letme know which database will be good and please let me know the initial steps for connecting WMB to DB.Thanks\nAmit Khandelwal### Assistant: WMB connects to a database viaDSN. So, first thing you have to do is, creating a DSN.Steps to create DSN will vary from OS to OS. For windows follow these steps in thislink.After creating DSN you have to attach it to your broker. Usemqsisetdbparmsfor this purpose.After giving mqsisetdbparms, you need to restart your broker.In your message flow you have to give the same DSN name in the\n \"Database Source name property.You can check if the broker is able to connect to the database usingmqsicvpcommand.Regarding,\"which database will be good\".\nWMB works fine with all well known DB providers, like oracle, DB2 etc(As it uses DSN).But since both WMB and DB2 are IBM products, I would guess they will mingle better with each other. We are using both Oracle and DB2 and we have got no complains for any of them.Complete video Tutorial on connecting WMB to DatabaseAll these documentation from IBM is very confusing and it takes lots of efforts in make all these things together. I found this video tutorial on youtube which explains connecting wmb to database step by step.Configure Database on WebSphere Message Broker or Integration BusConnecting WMB to Database\n"} +{"text": "### Human: I am running a dynamic web project, but am encountering the following errors from Tomcat:Caused by: java.lang.NoClassDefFoundError: com/ibm/mq/MQException\n at java.lang.Class.getDeclaredFields0(Native Method)\n at java.lang.Class.privateGetDeclaredFields(Unknown Source)\n at java.lang.Class.getDeclaredFields(Unknown Source)\n at org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:106)\n at org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:261)\n at org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:140)\n at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:67)\n at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:405)\n at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881)\n at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:376)\n at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)\n at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)\n at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5269)\n at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)\n ... 6 more\nCaused by: java.lang.ClassNotFoundException: com.ibm.mq.MQException\n at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)\n at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)\n ... 20 moreI have the com.ibm.mq.jar added as an external jar. Does anyone know what's wrong?### Assistant: You need to mark that jar as needing to be deployed from your project's Deployment Assembly property page. By default, only the jars physically in the WEB-INF/lib folder will be deployed to the server.\n"} +{"text": "### Human: Issue:Having multiple consumer applications active specification attached to a single MQ on distributed VM servers is causing a null payload in a MQ Message. \nNote: See notes at the bottom. No issue with mq.Details:I have 3 Websphere applications deployed across 2 VM servers. 1 application is a publisher and the other 2 applications are consumers attached to a single MQ Manager, and MQ. \n2 consumer applications are pulling off the messages and processing them. The consumer application on the separate server receives a null payload. I have confirmed that its seems to be an issue having multiple application server instances attached to MQ. Confirmed by deploying the publisher on server 2 with consumer 2, then consumer 1 fails.Question:Has anyone tried attaching multiple MDB applications deployed on separate server instances bind to one Queue Manager and one MQ?Specifications:Websphere 7, EJB 3.0 MDB's,Transactions turned off,Queue in a queue installed on another machine.Goal:Distributed computing, scaling up against large number of messages.I'm thinking this is a configuration issue but not 100% sure where to look. I had read that you could use MQLink, but I don't see why I would need to use service bus integration.Supporting Doucmentation:[MQ Link][1UPDATE: I fixed the problem and it was a related to a combination of class loader issue with a duplicate classes. See Solution Notes below I added.EDIT HISTORY:\n- Clarified specifications, clarified question and added overall goal.\n- reference notes to solution.### Assistant: Has anyone tried attaching multiple MDB applications deployed on\n separate server instances bind to one Local MQ?Multiple MDB applications deployed on separate servers, connecting to one Queue Manager(but different queue) is a normal scenario and we have it everywhere and all applications work fine.But, I suspect what you are doing is: Multiple MDB applications deployed on separate servers, connecting to one Queue Manager andlistening to the same queue.In this case one message will be received by one consumer only.You need to create separate queue for each application and create subscriptions for each for the topic being published by your publisher.Addition:I suspect, for load balancing the problem you may be facing is that, when your first application gets the message, it doesn't issue a commit. So, there will be an uncommited message in the queue, which may be stopping your other application from getting message from the queue. When your first application finishes its processing, it issues a commit, but then again it is ready to pick the message and hence it again issues a get.In my architecture, we have implemented load balancing using multiple queue managers like below:You create 3 queue managers, sayGatewayQM,App1QMandApp2QM.Keep the three queue managers in the same cluster.Create an alias queue(shared in cluster) inGatewayQMand ask your putting app to put message in the gateway queue.Now create one local cluster queue in each of App1QM and App2QM. Read from these queues via your applications App1 and App2 respectively.This implementation provides you better security and serves a perfect load balancer.\n"} +{"text": "### Human: I have a deployed bar file in the MB in a execution group. Now i want to find out the input queue name from where the Broker flow is getting input.PlatForm : AIX### Assistant: mqsireportproperties BROKER_NAME -e EXECUTION_GROUP_NAME -d AllMessageFlows -rwhere:\nBROKER_NAME is the name of your Broker (< version 9) / Integration Node (>= version 9),\nEXECUTION_GROUP_NAME is the name of your execution group (< version 9) / Integration Server (>= version 9).This will list all the properties associated with all the message flows, both deployed to the EG and in Applications (>= version 8).To find the queue name you are interested in I suggest redirecting the output to a file and using vi or sed etc. to search for the string 'queueName' (case sensitive).for example:\nmqsireportproperties BROKER_NAME -e EXECUTION_GROUP_NAME -d AllMessageFlows -r | grep queueNameYou will get back more than one line with 'queueName' in it. Some are internal queues that you don't need to worry about, some will be ones in flows you have deployed. In order to tell which one you want you will need to inspect the output.The output lists the message flows directly on the execution group first and then the Applications. Under a tag 'Application' you will find the tag 'MessageFlow' and then the tag for the MQ Input node which will be 'ComIbmMQInputNode'. Under that you will find the 'queueName' parameter with the value you are looking for e.g. queueName='INPUT_QUEUE_NAME'. If you have more than one application you will have to find the one you are looking for, there is a 'label' parameter under each application which will be it's name. The same goes for message flows.\n"} +{"text": "### Human: I have a scenarios where one server hosts some queues under a queue manager and another server host an application which need access to those queues. The application connects using client-binding (using server-connection channel). I want to restrict the application to be able to just read from one queue and write to another queue (probably by setting an MCAUSER on the SVRCONN channel). \nWhats the minimum sufficient authorisation a user will require in this case ?### Assistant: For reading from the queue you will need to enablegetpermission on the queue from which you want allow read only. For examplesetmqaut -m QM -t queue -n READ.LOCAL.QUEUE -g groupa +inq +get -putTo allow put only:setmqaut -m QM -t queue -n WRITE.LOCAL.QUEUE -g groupa +inq -get +putThislinkfrom T-Rob's blog has more details:\n"} +{"text": "### Human: I am developing a service for JMS messaging using IBM WMQ version 7.5 as Message oriented middleware. I am in a dilemma. The IBM specification says to use WebSphere MQ JMS API in JAVA EE environment. My sender and receivers will be in remote JBoss deployments. IBM provides a resource adapter to connect via JCA. This connection requires static administration of components such as Queue managers, queue channels, queue names.Is JCA the best I can do ? Is there any other way where I can dynamically create the queues provided that I know other configuration details ? There will be multiple applications using this setup running on their own servers. If I use JCA, all have to make their own configurations. Can I make dynamic configurations ?### Assistant: Typically within the application server environment resources would be created in some JNDI context. These would be Connection Factories and Destinations.Depending on the app server, it may be possible to share this configuration across a network of individual servers. So typically there would be some set of static definitions.However within say a servlet the MQConnectionFactory can be dynamically created.In all cases the backing WMQ Resources do need to exist; though it is possible to send administrative command messages to WMQ to create queues and do other admin. The only exception is topics, accessing a topic string brings it into existence. Though this has default security properties that you might not want.\n"} +{"text": "### Human: The WebSphere Message Broker DataFlowEngine Process abnormally ends with an errorFailed to allocate memoryThis happens when the incoming XML message is roughly 12 Mb.It was also noticed that a similar incoming XML message but 10 Mb in size did not lead to this problem.I have attached 3 Examples of the .abend log file generated at the time of processing this message. They are athttp://dpaste.com/1356207/http://dpaste.com/1356208/http://dpaste.com/1356209/We have so far tried setting the jvmMaxHeapSize to 1 GB but that did not help.....the logs generated in /var/adm/log after setting this value are athttp://dpaste.com/1356210/The size of the DataFlowEngine process increases quite a lot before it abnormally ended. I was able to see it reaching to a size of 1.2 GB via NMON utility.We also tried setting the variableMQSI_FREE_MASTER_PARSERS=1based on some link I found on Google but it did not help either.What else could we do to get to the root of this issue?### Assistant: The DFE process is trying to allocate more memory in order to create a syntax element for the target of a tree copy in an ESQL compute node.The most likely explanation is that you are copying an enormous tree and the DFE needs more memory than it is allowed to allocate to process the message.It is worth bearing in mind that the size on an XML input file can be many times smaller than the size required just to store one copy of the syntax tree representing the document as in addition to the bitstream stored in each element the broker has to store pointers to parent and child elements, type data and structure data.Further this kind of data needs to be stored for every tree copy that you do meaning that even small XML input documents, if not handled properly can require a huge amount of memory to process.Judging from your abends I would say your flow is failing at the end of a section that looks like this:MQInput Node -> Compute Node -> Try/CatchNode -> Compute Node -> Compute Node -> Compute NodeI would review all of your compute nodes starting from the right most for unrequired tree copies. It is also worth reviewing the following Infocenter topic which gives hints on how to use reference variables to reduce the amount of storage required when processing repeating structures in ESQL:http://publib.boulder.ibm.com/infocenter/wmbhelp/v8r0m0/topic/com.ibm.etools.mft.doc/ac67176_.htmhttp://publib.boulder.ibm.com/infocenter/wmbhelp/v8r0m0/topic/com.ibm.etools.mft.doc/bc23802_.htm\n"} +{"text": "### Human: So, if I send a MQTT message with QoS 1 or 2 and one of the receivers to the topic that the message belongs to is offline, how long will the broker keep it in queue and try to keep resending?Is this a implementation specific detail for the message broker and the MQTT Protocol itself has no rules regarding this?### Assistant: As @knolleary says, this is entirely implementation dependent.The mosquitto broker provides an optionpersistent_client_expirationfor you to control this yourself, but will otherwise keep messages indefinitely up to a maximum quantity as defined bymax_queued_messages.\n"} +{"text": "### Human: I'm currently developing an application in C# using the IBM Websphere MQ API (v7.5) whose main goal is to getting messages from a queue and store them in a database. All is well, I know to get and browse messages. But I must process messages differently according to their priority.Is there any \"simple\" way to get only messages with a given priority ?I don't want to use a dirty trick like browsing through all the messages, storing the ID of the messages I'm interested in, and then getting them one by one. I read in the MQ documentation that we can use aselector stringto browse through particular messages using an SQL like syntax, but I don't find how to do it in C#.Thanks a lot for your help !### Assistant: As of now in MQ .NET, you can useMQC.MQMO_MATCH_MSG_IDandMQC.MQMO_MATCH_CORREL_IDmatch options to get messages that match message id or correlation id. Getting messages matching aPriorityis not available.Alternatively you switch to usingXMS .NETthat allows consumers to be created with SQL92 style selection string. For example you can create consumer with a selection string\"JMSPriority > 3 AND manufacturer = 'Jaguar'\"to receive only messages that haveJMSPriorityof 3 andmanufacturername as Jaguar.\n"} +{"text": "### Human: Friends,\n I want to connect remote IBM QM in java by binding method(JNI). Is it possible?. else\nguide me better option for implementing in java.### Assistant: Using bindings mode you can only connect to a queue manager running on the same machine as your application. In bindings mode application and queue manager use shared memory to communicate. As you may be knowing, memory can not be shared across machines.You should use the client mode connection to communicate with a remote queue manager.\n"} +{"text": "### Human: I want to check the connection in MQ (if its online/offline) using java. Could someone point me in the right direction / perhaps have example code for me to look at. What is the best way of approaching this?### Assistant: The best approach in my opinion is to make the intended MQ function call and handle the exception that is returned if connection is not available. For example you want to makeMQQueue.Putcall and you are not sure whether the connection is ON or not. You can go ahead and make the call. If a connection is not available you will get a 2009 - connection broken exception. Your application needs to handle this exception and re-establish the connection.Remember a connection might be ON before issue a MQ call but can break when the call was actually issued. So it is always better to issue MQ call and handle any exceptions.\n"} +{"text": "### Human: Trying to configure WMQ XA connection factory like\n \n \ni've copied mqjexitstub02.dll, PgmIpLayer.dll and mqjbnd.dll to one of the $PATH directories ($JAVA_HOME/bin), but exceptionCaused by: java.lang.UnsatisfiedLinkError: C:\\dev\\jdk1.6.0_39\\bin\\mqjbnd.dll: Can't find dependent libraries\nat java.lang.ClassLoader$NativeLibrary.load(Native Method)\nat java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1807)\nat java.lang.ClassLoader.loadLibrary(ClassLoader.java:1732)\nat java.lang.Runtime.loadLibrary0(Runtime.java:823)\nat java.lang.System.loadLibrary(System.java:1028)\nat com.ibm.mq.jmqi.local.LocalMQ.loadLib(LocalMQ.java:1008)\nat com.ibm.mq.jmqi.local.LocalMQ$1.run(LocalMQ.java:273)raised.here is my cygwin ldd$ ldd ~/dev/jdk1.6.0_39/bin/mqjbnd.dll\n ntdll.dll => /cygdrive/c/WINDOWS/system32/ntdll.dll (0x7c900000)\n kernel32.dll => /cygdrive/c/WINDOWS/system32/kernel32.dll (0x7c800000)\n ??? => ??? (0x1c000000)looks like the problem with ??? => ??? (0x1c000000). Anyone can help with this problem?### Assistant: i've copied mqjexitstub02.dll, PgmIpLayer.dll and mqjbnd.dll to one of\n the $PATH directories ($JAVA_HOME/bin), but exceptionYou can't do that. To connect in \"bindings mode\" means that you have a queue manager running on the same server as your application. Do not EVER copy MQ DLLs (Windows) or shared libraries (Unix/Linux) between servers. It will not work and you will spend hours wasting your time.If you want to connect in \"bindings mode\" then install the MQ Server software and create & start a queue manager.If you are confused by what you are doing then most likely you trying to connect to a queue manager on another server - this called \"connecting to a queue manager in client mode\". Therefore, install the MQ Client software and everything will work.\n"} +{"text": "### Human: I am trying to write a function that is gracefully shutting down the program which is getting the messages from the queue.The MQGET is started with MQGMO_WAIT option which suits me perfectly. However, I get an error when trying to issue another MQI call (MQCLOSE and MQDISC in this case).The error is about gracefully closing the queue to exit the program. If the MQGET call is WAITing, then the MQCLOSE is causing error 2219.Is there some kind of signal or MQI call to stop the MQGET call waiting?### Assistant: You need to use the new call-back feature in WMQ v7.1 rather than MQGET with wait. Or shorten your wait to 1 or 2 seconds and loop over a \"flag\".\n"} +{"text": "### Human: I'm having the following task: I have two clients hung on the same queue and both are able to consume all kinds of messages. The desired functionality is that a client reads the message from the queue without committing it and only commits once it finishes processing. During that the other client should not be able to process the message (non-dequeueing, blocking read = NDBR). \nPractical example:Messages put on queue, Msg1, and Msg2. Desired functionality: \nClient1 NDBR's Msg 1->Queue content (Msg1-blocked,Msg2)->Client 2 NDBR's Msg2->Queue content(Msg1-blocked,Msg2-blocked)->Client 1 finishes commits Msg1->Queue content(Msg2 - blocked)->Client 2 finishes processing, commits Msg2-> Queue empty.Is such a solution possible?### Assistant: Sure - standard stuff. It is documented in the manual. Go look up syncpoint and Commit/Backout.\n"} +{"text": "### Human: I write my own trigger monitor. It will listen to initiation queue and will get messages from it. I'd like to parse these messages. Are there any classes, methods inamqmdnet.dllthat can help me with it? Or where can I find a format of trigger messages?### Assistant: I write my own trigger monitor.Why would you want to do that? IBM supplies a trigger monitor with MQ. Or do you mean to say you are writing an application that will be started by the trigger monitor?Either way, the init message that the queue manager puts in the initialization queue is documented in the WMQ InfoCenter and the parameters passed to a trigger/started application are also documented in WMQ InfoCenter.\n"} +{"text": "### Human: How can I configure Websphere MQ to activate my component when messages arrive?I want to avoid of persistent polling of new incoming messages using some Windows Service, I do want the new massages to bepushedto me rather than the opposite.I'm working in .NET 4 environment and WCF and WAS are legitimate technologies for me to work with.### Assistant: I know this is an old thread, but as a reference for newcomers:\nAnno 2018 your best answers are to use either theWebSphere custom channel for WCFor using theWebSphere .NET Monitor.The first one automatically calls your WCF service whenever a message arrives in a certain queue, the second one calls a method in a class in an assembly you provide to process an incoming message. In both cases you don't need to worry about the queue communication, only about the processing of the incoming message.\n"} +{"text": "### Human: I want to send message to a remote IBM MQ using Jmeter for performance testing. I went through thislink. But it requires the JNDI specific details like, QueueConnection Factory, JNDI Name Request queue, Initial Context Factory & Provider URL. Whereas the queu details i have are Qmanager, Qname, hostname, channel, port as given in the code shared in thislink. Do these properties have any relation? Can i configure the Jmeter JMS test using the queue details i have?Thanks in advance.### Assistant: The first link you gave has a description using Java JMS/MQ and the second shows Java MQ (non-JMS).JMS is just an abstraction layer. In simple terms, JMS is like giving everything a nick-name. A QCF (QueueConnectionFactory) is simply an object that has all of the information to connect to a queue manager.i.e.DEFINE QCF(myQCF) QMANAGER(MQWT1) CHANNEL(TEST.CHL) HOSTNAME(127.0.0.1) PORT(1415) TRANSPORT(CLIENT) FAILIFQUIESCE(YES)A JMS queue is just a nick-name to an MQ queue.DEFINE Q(test.q) QUEUE(TEST.Q1) QMANAGER(MQWT1) TARGCLIENT(JMS) FAILIFQUIESCE(YES)Therefore, in your JMS code you simply reference your QCF (i.e. myQCF) and the JMS queue (i.e. test.q) and you are good to go.Hashtable env = new Hashtable();\nenv.put(Context.INITIAL_CONTEXT_FACTORY, \"com.sun.jndi.fscontext.RefFSContextFactory\");\nenv.put(Context.PROVIDER_URL, \"\"file:/C:/JNDI-Directory\");\n\ntry\n{\n Context ctx = new InitialContext(env);\n\n QueueConnectionFactory cf = (QueueConnectionFactory) ctx.lookup(\"myQCF\");\n Queue q = (Queue) ctx.lookup(\"test.q\");\n}\ncatch (NamingException e)\n{\n System.err.println(e.getLocalizedMessage());\n e.printStackTrace();\n}\n"} +{"text": "### Human: I am using IBM MQ & active mq in my application using Spring jms. I have a requirement to schedule a message for redelivery after x seconds.I am able to achieve it in Active mq by setting the AMQ_SCHEDULED_DELAY header. This makes the message to get delivered to the queue after a specified number of seconds.Is there anything similar in IBM MQ that I can use to achieve the above mentioned functionality ?Any help is appreciated.### Assistant: Well JMS 1.1 specification does not mention anything about delayed delivery of a message. Hence you don't have that feature in WMQ. Just released JMS 2.0 specification describes this feature.\n"} +{"text": "### Human: my xml looks like- \n - \n + \n + \n + \n - \n - \n E \n \n \n + \n + \n - \n - \n 002 \n \n Yhe full xml is herehttp://www.speedyshare.com/MgCCA/download/ItemMaster-2.xmlI need to fetch the value of Classification with attribute TYPE= \"BRAND\" but with below code, it only fetchs the classification with attribute TYPE = \"HOMOLOGATION CLASS\" which I dont want since I am calling for \"BRAND\". I tried to apply LASTMOVE but dosent work. Please tell me where I am wrong.I have to fetch other values also like codes inside the type -\"LP\" also.DECLARE rResource REFERENCE TO InputRoot.XMLNSC.*:SyncItemMaster.*:DataArea.*:ItemMaster.*:ItemMasterHeader[1]; \n SET rowCnt = rowCnt+1; \n DECLARE LineCount INTEGER 1; \n\n WHILE LASTMOVE(rResource) = TRUE DO \n SET OutputRoot.XMLNSC.root.row[rowCnt].product_Info.TyreBrandCd = THE (SELECT ITEM FIELDVALUE(T) FROM itemMaster.*:ItemMasterHeader[LineCount].*:Classification.*:Codes.*:Code AS T WHERE FIELDVALUE(itemMaster.*:ItemMasterHeader[LineCount].*:Classification.(XMLNSC.Attribute)Type) = 'BRAND'); \n SET LineCount = LineCount + 1; \n MOVE rResource NEXTSIBLING REPEAT TYPE NAME; \n END WHILE; \n RETURN TRUE; \n END;ThanksTRIED with below suggested codeHere are trace logs2013-05-10 18:32:27.218385 7732 UserTrace BIP2537I: Node 'WMB_9D1_PROD_SUB00_001.9D1_PROD': Executing statement ''SET temp = THE (SELECT T.Classification AS :Classification FROM myref AS T WHERE FIELDVALUE(T.Classification.(XMLNSC.Attribute)Type) = 'BRAND');'' at ('.WMB_9D1_PROD_SUB00_001.Main', '22.3').\n2013-05-10 18:32:27.218393 7732 UserTrace BIP2538I: Node 'WMB_9D1_PROD_SUB00_001.9D1_PROD': Evaluating expression ''THE (SELECT T.Classification AS :Classification FROM myref AS T WHERE FIELDVALUE(T.Classification.(XMLNSC.Attribute)Type) = 'BRAND')'' at ('.WMB_9D1_PROD_SUB00_001.Main', '22.14').\n2013-05-10 18:32:27.218400 7732 UserTrace BIP2572W: Node: 'WMB_9D1_PROD_SUB00_001.9D1_PROD': ('.WMB_9D1_PROD_SUB00_001.Main', '22.14') : Finding one and only SELECT result.\n2013-05-10 18:32:27.218427 7732 UserTrace BIP2539I: Node 'WMB_9D1_PROD_SUB00_001.9D1_PROD': Evaluating expression ''myref'' at ('.WMB_9D1_PROD_SUB00_001.Main', '22.48'). This resolved to ''myref''. The result was ''ROW... Root Element Type=16777216 NameSpace='' Name='ItemMasterHeader' Value=NULL''.\n2013-05-10 18:32:27.218437 7732 UserTrace BIP2539I: Node 'WMB_9D1_PROD_SUB00_001.9D1_PROD': Evaluating expression ''XMLNSC.Attribute'' at ('.WMB_9D1_PROD_SUB00_001.Main', '22.94'). This resolved to ''XMLNSC.Attribute''. The result was ''1095266992384''.\n2013-05-10 18:32:27.218446 7732 UserTrace BIP2540I: Node 'WMB_9D1_PROD_SUB00_001.9D1_PROD': Finished evaluating expression ''FIELDVALUE(T.Classification.(XMLNSC.Attribute)Type)'' at ('.WMB_9D1_PROD_SUB00_001.Main', '22.65'). The result was '''HOMOLOGATION CLASS'''.\n2013-05-10 18:32:27.218454 7732 UserTrace BIP2539I: Node 'WMB_9D1_PROD_SUB00_001.9D1_PROD': Evaluating expression ''FIELDVALUE(T.Classification.(XMLNSC.Attribute)Type) = 'BRAND''' at ('.WMB_9D1_PROD_SUB00_001.Main', '22.117'). This resolved to '''HOMOLOGATION CLASS' = 'BRAND'''. The result was ''FALSE''.\n2013-05-10 18:32:27.218461 7732 UserTrace BIP2569W: Node 'WMB_9D1_PROD_SUB00_001.9D1_PROD': ('.WMB_9D1_PROD_SUB00_001.Main', '22.14') : WHERE clause evaluated to false or unknown. Iterating FROM clause.\n2013-05-10 18:32:27.218469 7732 UserTrace BIP2570W: Node 'WMB_9D1_PROD_SUB00_001.9D1_PROD': ('.WMB_9D1_PROD_SUB00_001.Main', '22.14') : There were no items in the FROM clause satisfying the WHERE clause.\n2013-05-10 18:32:27.218503 7732 UserTrace BIP2567I: Node 'WMB_9D1_PROD_SUB00_001.9D1_PROD': Assigning NULL to ''temp'', thus deleting it.### Assistant: Try this:declare temp ROW;\n\nSET temp = THE (SELECT T.Classification FROM rResource AS T WHERE FIELDVALUE(T.Classification.(XMLNSC.Attribute)Type) = 'BRAND');\n\nOutputRoot.XMLNSC.root.row[rowCnt].product_Info.TyreBrandCd = temp.code;\n"} +{"text": "### Human: I have an xml like \n \n 033144 \n 1 \n \n \n 048429 \n 1 \n \n \n 073528 \n 1 \n \n \n 563781 \n 1 \n \n I have written like to get the values ofSET OutputRoot.XMLNSC.root.row[rowCnt].Kit_info.components.productCd = COALESCE(FIELDVALUE(orgObj.*:ListOfCAD.*:CAD.*:CADAssembly.*:CADComponent.*:CAICode[]),'0')||'_'||COALESCE(FIELDVALUE(orgObj.*:ListOfCAD.*:CAD.*:CADAssembly.*:CADComponent.*:CCIDCode[]),'0');\nSET OutputRoot.XMLNSC.root.row[rowCnt].Kit_info.components.quantity = FIELDVALUE(orgObj.*:CAIAssembly.*:CAIComponent.*:Quantity[]);the above code give me result like only one \n033144_5423 \n1 \nHow can I iterate the values to get all likeI have tried the While loop but its not working \n033144_5423 \n1 \n \n \n048429_5423 \n1 \n \n \n073528_5423 \n1 \n \n \n563781_5423 \n1 \nThanks all.### Assistant: This is very simple to achieve. Try below code:DECLARE inputRef REFERENCE TO InputRoot.XMLNSC.NS5:CAIAssembly;\n\n DECLARE Ref_CAIComponent REFERENCE TO inputRef.NS5:CAIComponent[1];\n\n --Now run the below loop\n\n WHILE LASTMOVE(Ref_CAIComponent) DO\n\n CREATE FIELD OutputRoot.XMLNSC.components[index];\n DECLARE outRef REFERENCE TO OutputRoot.XMLNSC.components[index];\n SET index=index+1;\n\n SET outRef.productCd=Ref_CAIComponent.NS5:CAICode;\n SET outRef.quantity=Ref_CAIComponent.NS5:Quantity;\n\n\n MOVE Ref_CAIComponent NEXTSIBLING REPEAT NAME;\n END WHILE;P.S.It's good practice to struggle and find solutions at your own, rather than searching for spoon feeding.\n"} +{"text": "### Human: I use this query to find my information in Oracle and it's correctly worked :SELECT A.ACTIONID,A.ACTIONNAME,A.ALLOWWRITE,A.ALLOWREAD FROM THP.TBACTION A WHERE A.ACTIONID IN ( SELECT AP.ACTIONID FROM THP.TBACTION_PROFILE AP WHERE AP.PROFID IN(SELECT P.PROFID FROM THP.TBPROFILE P WHERE P.PROFID IN(SELECT U.PROFID FROM THP.TBUSER U WHERE U.USERID=2 )));but Now I want use this Query in IBM MESSAGE BROKER on compute Node by ESQLwhat do you suggest? \ncan u please Introduce suitable solution for this question or write theirs syntax...thanks...### Assistant: The syntax for nesting itself is the same, but the query syntax is a bit different. Instead of writingFROM THP.TBACTION Ayou should writeFROM Database.THP.TBACTION AS A.\nYou can find the reference here:http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Fac06000_.htmAnd you should make sure you have specified the data source in the Data source property of the Compute Node.\n"} +{"text": "### Human: I am trying to write 2 methods to test whether the sent message in one queue is received in another queue.Send method - Sends message, for example - \"Message 123\" - to export queue with unique correlation id.Get methodThis queue will have many messages, however i want to get only the message that I sent from above based on my correlation ids.Code to check message based on correlation idproperties = new Hashtable();\n properties.Add(MQC.CONNECTION_NAME_PROPERTY, \"connection name\");\n properties.Add(MQC.TRANSPORT_PROPERTY, \"transport type\");\n properties.Add(MQC.CHANNEL_PROPERTY, \"channel name\"); \n properties.Add(MQC.CONNECT_OPTIONS_PROPERTY, MQC.MQCNO_HANDLE_SHARE_BLOCK);\n\n\n\n mqGetMsgOpts = new MQGetMessageOptions();\n mqGetMsgOpts.Options = MQC.MQGMO_BROWSE_FIRST | MQC.MQGMO_WAIT | MQC.MQOO_INQUIRE;\n mqGetMsgOpts.MatchOptions = MQC.MQMO_MATCH_CORREL_ID;\n mqGetMsgOpts.WaitInterval = 3000; //3 secs wait timeThe issue am facing is when i read messages, i get all the messages from the import queue.How do i get only the messages that i sent and validate that the message that is received in the export queue is mine?Theoretically, something like thismessage.correlationid from import queue matches message.correaltionid in the export queue.### Assistant: Your snippet does not show setting correlId when reading messages. I have this sample code that gets only the message matching given correlId.Like earlier, your snippet still hasMQC.MQOO_INQUIREforMQGMO.MQOOstands forOpen OptionswhereasMQGMOstands forGet message optionstry\n {\n importQ = qm.AccessQueue(\"Q2\", MQC.MQOO_INPUT_SHARED | MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING);\n\n // Put one message. MQ generates correlid\n MQMessage mqPutMsg = new MQMessage();\n mqPutMsg.WriteString(\"This is the first message with no app specified correl id\");\n importQ.Put(mqPutMsg);\n\n // Put another messages but with application specified correlation id\n mqPutMsg = new MQMessage();\n mqPutMsg.WriteString(\"This is the first message with application specified correl id\");\n mqPutMsg.CorrelationId = System.Text.Encoding.UTF8.GetBytes(strCorrelId);\n MQPutMessageOptions mqpmo = new MQPutMessageOptions();\n importQ.Put(mqPutMsg,mqpmo);\n\n mqPutMsg = new MQMessage();\n\n // Put another message with MQ generating correlation id\n mqPutMsg.WriteString(\"This is the second message with no app specified correl id\");\n importQ.Put(mqPutMsg);\n\n // Get only the message that matches the correl id\n MQMessage respMsg = new MQMessage();\n respMsg.CorrelationId = System.Text.Encoding.UTF8.GetBytes(strCorrelId);\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.WaitInterval = 3000;\n gmo.Options = MQC.MQGMO_WAIT;\n gmo.MatchOptions = MQC.MQMO_MATCH_CORREL_ID;\n\n importQ.Get(respMsg, gmo);\n Console.WriteLine(respMsg.ReadString(respMsg.MessageLength));\n }\n"} +{"text": "### Human: There is an issue i am facing with 32-bit windows OS(windows xp) when connected with IBM MQ 7.1 client.I am using 7.1.0.0 amqmdnet.dll (referenced from IBM\\websphere\\bin folder)\n False\n ..IBM\\WebSphereMQ\\7.1.0.0\\amqmdnet.dll\n(downloaded fromIBM link)and building my .net app using MQ.NET classes, however after deployment, if the target machine has 7.1.0.0 MQ client installed, the app throwsSystem.DllNotFoundException: Unable to load DLL 'C:\\Program\n Files\\IBM\\WebSphere MQ\\bin\\mqz.dll': The specified module could not be\n found. (Exception from HRESULT: 0x8007007E)at NativeUnmanagedType.zstSPI(Int32 hConn, Int32 verbId, Int32 hObj, Byte[] pInOut, Byte[] pIn, Byte[] pOut, Int32& compCode, Int32& reason)\n at IBM.WMQ.Nmqi.UnmanagedNmqiMQ.SPIQuerySPI(Hconn hConn, Int32 verbId, Int32& maxInOutVersion, Int32& maxInVersion, Int32& maxOutVersion, Int32& flags, Int32& pCompCode, Int32& pReason)\n at IBM.WMQ.Nmqi.UnmanagedNmqiMQ.MQCONNX(String pQMgrName, MQCNO& pConnectOpts, Hconn parentHconn, Phconn phconn, Int32& pCompCode, Int32& pReason)\n at IBM.WMQ.Nmqi.UnmanagedNmqiMQ.MQCONNX(String pQMgrName, MQConnectOptions pConnectOpts, Phconn phconn, Int32& pCompCode, Int32& pReason)\n at IBM.WMQ.MQQueueManager.Connect(String queueManagerName)\n at IBM.WMQ.MQQueueManager..ctor(String queueManagerName, Hashtable properties)My code is// mq properties\nproperties = new Hashtable();\nproperties.Add(MQC.CONNECTION_NAME_PROPERTY, \"Connection Name\");\nproperties.Add(MQC.TRANSPORT_PROPERTY, \"Transport Type\");\nproperties.Add(MQC.CHANNEL_PROPERTY, \"Channel Name\"); \nproperties.Add(MQC.CONNECT_OPTIONS_PROPERTY, MQC.MQCNO_HANDLE_SHARE_BLOCK);\n\n//To read the messages\nmqGetMsgOpts = new MQGetMessageOptions();\n\nif (mqQueue != null)\n {\n //Get options for the messsage \n mqGetMsgOpts.Options = MQC.MQGMO_BROWSE_FIRST | MQC.MQGMO_WAIT | MQC.MQOO_INQUIRE;\n mqGetMsgOpts.MatchOptions = MQC.MQMO_NONE;\n mqGetMsgOpts.WaitInterval = 5000; // 5 seconds limit for waiting\n }\n\n if (mqMsg.MessageLength > 0 && mqMsg.DataLength > 0)\n {\n messageData = mqMsg.ReadString(mqMsg.MessageLength);\n }There is browse_next after queue manager commit is called(so browse the next messsage).//To put the message\nif(mqQueue==null) \nmqQueue = mqQMgr.AccessQueue(\"Queue Name\",\n MQC.MQOO_OUTPUT | MQC.MQOO_INPUT_SHARED | MQC.MQOO_INQUIRE);\n\n mqMsg.WriteString(message);How do i resolve that error, any idea? The same piece of code works fine windows 64-bit OS. I don't have that mqz.dll inside bin folder in 64-bit OS's websphere MQ client installation folder, there it works, however it fails iin 32-bit OS.### Assistant: I just install MQ v71 client on a 64 bit machine. I can see MQZ.DLL in bothProgram Files (x86)\\IBM\\WebSphere MQ\\binandProgram Files (x86)\\IBM\\WebSphere MQ\\bin64folders.Have youinstalledthe MQ v71 client on the WinXP machine?\n"} +{"text": "### Human: I have a .NET console application that runs on a Windows Server 2008 where AutoSys and WebSphere MQ are installed (The application is used to send messages to WebSphere MQ).I'm trying to set up an AutoSys job that will call the console application every 10 minutes.If I log into the server and I run the application using the command line, the application works correctly.But if I run the application using AutoSys I get the following error:The type initializer for 'IBM.WMQ.MQQueueManager' threw an exception.\n\nStackTrace = at IBM.WMQ.MQQueueManager..ctor(String queueManagerName, Hashtable properties)\n at SendMessage.QueueJobExecutionItem.ExecuteQueueJob(QueueInfo queueInfo, CrmInfo crmInfo, LogFileInfo logFileInfo, List`1 entityList) in C:\\SendMessage\\QueueJobExecutionItem.cs:line 36\n at SendMessage.Program.StartLoad() in C:\\SendMessage\\Program.cs:line 75\n at SendMessage.Program.Main(String[] args) in C:\\SendMessage\\Program.cs:line 111\n\nError Message InnerException = The type initializer for 'IBM.WMQ.MQQueueManager' threw an exception.\n\nInnerException StackTrace = at IBM.WMQ.MQQueueManager..ctor(String queueManagerName, Hashtable properties)\n at SendMessage.QueueJobExecutionItem.ExecuteQueueJob(QueueInfo queueInfo, CrmInfo crmInfo, LogFileInfo logFileInfo, List`1 entityList) in C:\\SendMessage\\QueueJobExecutionItem.cs:line 36\n at SendMessage.Program.StartLoad() in C:\\SendMessage\\Program.cs:line 75\n at SendMessage.Program.Main(String[] args) in C:\\SendMessage\\Program.cs:line 111\n\nInnerException Source = amqmdnet\n\nError Message InnerException = Exception has been thrown by the target of an invocation.\n\nInnerException StackTrace = at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)\n at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)\n at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)\n at System.Activator.CreateInstance(Type type, Boolean nonPublic)\n at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)\n at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)\n at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)\n at IBM.WMQ.CommonServices.CreateCommonServices()\n at IBM.WMQ.CommonServices.TraceConstructor(String objectId, String sccsid)\n at IBM.WMQ.Nmqi.NmqiEnvironment..ctor(NmqiPropertyHandler nmqiPropertyHandler)\n at IBM.WMQ.Nmqi.NmqiFactory.GetInstance(NmqiPropertyHandler properties)\n at IBM.WMQ.MQQueueManager..cctor()\n\nInnerException Source = mscorlib\n\nError Message InnerException = An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)\n\nInnerException StackTrace = at IBM.WMQ.MQCommonServices.xcsInitialize(UInt16 scope, UInt16 attributes, Byte[] charName, Byte[] charPrefix, xcsHPOOL& hPool)\n at IBM.WMQ.MQCommonServices.Initialize()\n\nInnerException Source = amqmdxcsI'm using the same user when logging into the server and running AutoSys so I would have expected the application to run in the same way.I'm wondering if anyone had this issue before or if there is any configuration/parameters,etc that I may be missing in AutoSys that would make the application to work in the same way as when logged into the server.I hope this make senseThanks in advance### Assistant: The exception showsAn attempt was made to load a program with an incorrect format.and is pointing toamqmdxcs.dllThis could be either because your application is 64 bit but it is trying to load a 32 bit version of WMQ libraries or your application is 32 bit but is trying load a 64 bit version of WMQ libraries. You need check the bittage of AutoSys and set the path to load appropriate WMQ libraries.\n"} +{"text": "### Human: How do i access the remote server of queue manager from my MQ.NET?i.e. If the queue manager is IBM MQ 7x, i would like to enable auto reconnect, if not no auto reconnect. Like, is there any attribute to find the version # of MQ installed in the remote server?if remote queue manager of remote server is 7xvar mqQMgr = new MQQueueManager(\"My queue Manager\", MQC.MQCNO_RECONNECT_Q_MGR, \"my channel name\", \"my connection name\");elsevar mqQMgr = new MQQueueManager(\"My queue Manager\", \"my channel name\", \"my connection name\");### Assistant: I don't believe it is possible to determine the version of the queue manager until after you've made the connection. A couple of options would be:Have a parameter that the user sets to specify the version of MQ and if the version is greater than or equal to 7 include theMQC.MQCNO_RECONNECT_Q_MGRoption.Connect to the queue manager as though it were running an earlier version of MQ, determine the version of the queue manager usingmqQMgr.getCommandLevel()and then if it is greater or equal to 700 disconnect and reconnect to the queue manager with theMQC.MQCNO_RECONNECT_Q_MGRoption.\n"} +{"text": "### Human: When i read a message from a remote queue manager which has its coded character set id as 819, the sent message hasCodedCharSetId=1208 , am connecting via 7.x client to a 6x (remote\n queue)?How do i get 819 in the export queue instead of 1208, i don't want to hard code in the messagemqQMgr.CodedCharSetId =819;instead i want to access this coded char set id from an attribute/property(so that, it can be dynamic).### Assistant: This might help you:If you are using MQ .NET client, then the character set will always be Unicode, 1208 because .NET applications always run in Unicode.ReadString & ReadLine methods of MQMessage class convert the data in the message to the CharacterSet specified while doing Get whereas WriteString and WriteLine methods convert the given data to the CharacterSet specified during Put.\n"} +{"text": "### Human: When I switch from non-durable to durable topic subscriber, I am unable to look up the topic name that I could read before (using JNDI).It gives an error in the admin console as the topic is being looked up:An error occurred during activation of changes, please see the log for details.\nERROR: Could not activate itft-jmsmodule!ITFT-JMS-1@ItftTopic\nThe Messaging Kernel ITFT-JMS-1 has not yet been openedI am using Oracle WebLogic Server Administrative Console to set up the WebSphere queue. On the console, I made these changes:For the Persistent Stores, On the Configuration tab, Added a file store calledItftFileStoreFor the Persistent Stores, On the Configuration tab, Added a directory.For the JMS Servers, On the Configuration -> General tab, Changed the Persistent Store toItftFileStoreFor the JMS Servers, On the Configuration -> General tab -> Advanced, Checked theStore Enabledfield.For the ItftTopic, Configuration -> Override tab, ChangedDelivery Mode OverridetoPersistent.This is the code which I am running. There are some comments on the pertinent lines.public void start() throws Exception {\n try {\n\n LOG.info(\"Starting the FC MQ message consumer / listener ...\");\n\n InitialContext initialContext = getInitialContext();\n\n topicConnectionFactory = (TopicConnectionFactory) initialContext.lookup(jmsFactory);\n topicConnection = topicConnectionFactory.createTopicConnection();\n topicConnection.setClientID(clientId);\n LOG.info(\"1\"+topicConnection.getClientID());\n topicSession = topicConnection.createTopicSession(false, Session.CLIENT_ACKNOWLEDGE);\n LOG.info(\"2\"+topicConnection.getClientID());\n //topicConnection.setExceptionListener(connectionExceptionListener);\n\n jmsTopic = (Topic) initialContext.lookup(topic); // Error being thrown here\n LOG.info(\"3\"+topicConnection.getClientID());\n //topicSubscriber = topicSession.createSubscriber(jmsTopic); // Works as a non-durable subscriber\n topicSession.createDurableSubscriber(jmsTopic,subscriberName); \n LOG.info(\"4\"+topicConnection.getClientID());\n topicSubscriber.setMessageListener(messageListener);\n\n topicConnection.start();### Assistant: The fundamental aspect of the problem is that you are connecting WebLogic to a Websphere JMS topic, this has become clear with the last edit of your question but it is not clear whether you are usingWebLogic Messaging Bridgeor not. The Messaging Bridge is the proper way of configuring a foreign JMS server in WebLogic. I suggest readingthis FAQand thishow-tothat is specific for Websphere.\n"} +{"text": "### Human: I have an SLSB with connection factory and queue injected:@Stateless\npublic class MQTestBean {\n @Resource(mappedName = \"jms/MQQCF\")\n private ConnectionFactory connectionFactory;\n\n @Resource(mappedName = \"jms/testQueue\")\n private Queue testQueue;\n}I would like to be able to inquire the queue for the following attributes:current depthopen input countopen output countPlease keep in mind, that the channel's user I am using has only access to DSP, GET, PUT, INQ.### Assistant: Sorry to say but there is no way to do it. At least using the WMQ JMS client jar. \nYou can calculate a q depth indirectly by counting-while-browsing, and that's about it.For input/output count you are gonna need MQ api (MQI/PCF whatever suits you).edit:\nadded url:MQ Classes for Java\n"} +{"text": "### Human: We have an application that will be publishing messages to a single Topic. The messages are expected to be consumed by multiple Subscriber applications in the exact same order in which they were published.The complication is that each subscriber will be using a different Message Selector to filter on the messages based on their properties. The filters will be such that there is no overlap among the messages read by the subscribers.\n For e.g.Time Message Propertyt1 m1 redt2 m2 bluet3 m3 redAssuming subscriber S1 subscribes for reading color=red and S2 subscribes for reading color=blue, we need S1 to read m1 and get blocked until S2 reads m2. Only once S2 has read m2, S1 will read m3.Is this possible with Websphere MQ 7.0, and if so, what configuration should we use for the queue manager and what option should we use in the MQGET operation?Thanks,\n Yash### Assistant: In Publish/Subscribe messaging neither the publisher is aware of subscriber nor a subscriber is aware of presence of another subscriber. I don't think any messaging provider will have a feature that you are looking for.It may be simple for you to implement an event mechanism where S1 informs S2 of receiving message.\n"} +{"text": "### Human: I have MQ as an external JMS server on my Weblogic server. The thing is that I need to rollback the message and retry until backout threshold is reached. Then I need to move the message to backout queue.The MessageDrivenContext.setRollbackOnly() method takes care of that just fine. The problem, however, is with the message on the backout queue - it is uncommited.Moreover, the messages are being taken from backout queue and processed again as soon as new message appears on the main queue.This suggest me that there is something teribly wrong with my approach. I cannot, however, change the fact, that I have to retry the onMessage() with the same message a couple of times and send it to backout queue is backout threshold was reached.@MessageDriven( name=\"MQListener\", mappedName = \"jms.mq.SOME.QUEUE.NAME\",\n activationConfig = \n { \n @ActivationConfigProperty(propertyName = \"destinationType\",propertyValue = \"javax.jms.Queue\"),\n @ActivationConfigProperty(propertyName = \"destination\", propertyValue = \"jms.mq.SOME.QUEUE.NAME\"),\n @ActivationConfigProperty(propertyName = \"connectionFactoryJndiName\", propertyValue = \"jms.mq.MQ\"),\n @ActivationConfigProperty(propertyName = \"useJNDI\", propertyValue = \"true\")\n }) \npublic class MQListener implements MessageListener {\n @Resource\n private MessageDrivenContext context;\n\n @Override\n public void onMessage(Message message) {\n String messageContent=\"\";\n\n try {\n messageId = message.getJMSMessageID();\n if (message != null) {\n messageContent = ((TextMessage)message).getText();\n if(!doSomething(messageContent)){\n // doSomething fails, I need to rollback the message and try again:\n context.setRollbackOnly();\n }\n }\n } catch (Exception e) {\n throw new RuntimeException();\n }\n\n }\n\n private boolean doSomething(String messageContent){\n // ...\n }\n\n}### Assistant: I am a tyro in EJB. But from what I can see in your code snippet, I think you are missing initialization ofMessageDrivenContext. I think you will have to do eithercontext = getMessageDrivenContext(); \ncontext.setRollbackOnly();orgetMessageDrivenContext().setRollbackOnly();\n"} +{"text": "### Human: On my below codeconnect()method is able to catch the 2009 and 2059 exceptions. But when I make my queue manager or connection down to generate 2009 or 2059 MQ exception ingetMessage()method , program is getting hung or it didn't throws it . \nIt is waiting in linequeue.get(retrievedMessage, getOptions);.Do we need to add additional open option to make the code aware if a connection or queue manager is broken ?Connect()\n{MQEnvironment.hostname = hostName;\nMQEnvironment.channel = channelName;\nMQEnvironment.port = portName;\n try\n {\n qMgr = new MQQueueManager(EvtqManager); // define a queue manager object\n LOGGER.debug(\"Queue Manager \" +EvtqManager+ \" Instance Initialized\");\n int openOptions = MQC.MQOO_INQUIRE + MQC.MQOO_FAIL_IF_QUIESCING+ MQC.MQOO_INPUT_SHARED;\n queue = qMgr.accessQueue(queueName, openOptions, null,null,null); \n LOGGER.debug(\"IBM MQQueue:\"+queueName+\" is accessed\");\n getOptions = new MQGetMessageOptions();\n getOptions.options = MQC.MQGMO_NO_WAIT;\n getMessage();\n }\n catch(){\n if(MQex.reasonCode==2009 || MQex.reasonCode==2059){\n shutDown();\n Connect();\n }\n}getMessage(){\n MQMessage retrievedMessage; \n while (true) {\n try {\n retrievedMessage = new MQMessage();\n queue.get(retrievedMessage, getOptions);\n PCFMessage pcfMessage = new PCFMessage(retrievedMessage);\n }\n catch (MQException MQex) {\n if(MQex.reasonCode==2009 || MQex.reasonCode==2059){\n shutDown();\n Connect();\n }\n }\n }`### Assistant: No additional options are required. If a MQ method call is in progress and a connection to a queue manager breaks, then the method will return with reason code 2009 or other connection error related reason codes. The reason codes returned will depend on how the connection was broken, for example MQRC_Q_MGR_QUIESCING/MQRC_Q_QMGR_STOPPING will be returned if queue manager is being shutdown.The hang could be due to the time taken to detect a socket failure. So you may want to check how long does the call wait.MQRC 2059 is returned when connecting to queue manager but not while receiving messages. So you can remove the check for 2059.I am just puzzled a bit on your code. You have calls toshutdown()andConnect()insideConnectandgetMessagemethods. Don't you think this leads to recursion?\n"} +{"text": "### Human: I am in the process of configuring WebSphere MQ and SSL and then connect to it using Java and JMS/JNDI. The version I use is 6.0.1.1. Here are the steps I followed but I can't make it run because I get an SSL exception.Step 1: Configure SSL for MQ Seriesexport JAVA_HOME=/opt/mqm/ssl\ncd /var/mqm/qmgrs/MYQMGR/ssl\n# Set up the key repository\ngsk7cmd -keydb -create -db keydb.kdb -pw password -type cms -expire 1500 -stash\n# Create a self-signed personal certificate\ngsk7cmd -cert -create -db keydb.kdb -pw password -label ibmwebspheremqmyqmgr -dn \"CN=My Queue Manager,O=My Company,C=UK\" -size 1024 -x509version 3 -expire 365\n# Export your personal certificate\ngsk7cmd -cert -extract -db filename -pw password -label ibmwebspheremqmyqmgr -target myqmgr.cert.arm -format asciiStep 2: Configure SSL for Java# Generate the private/public key pair\n# keypass option is the password to protect the private key\n# storepass option is the password to protect the keystore\nkeytool -genkey -keystore keystore -storepass storepass -keypass keypass -dname \"cn=My Java Client,O=My Company,C=UK\" -alias ClientMQ -keyalg RSA -keysize 2048\n# Export the public key if you need 2-way authentification\nkeytool -export -keystore keystore -storepass storepass -alias ClientMQ -file client.cer\n# Import MQ public certificate into the truststore\n# storepass option is the password to protect the keystore\nkeytool -import -keystore truststore -storepass trustpass -keypass keypass -alias ibmwebspheremqmyqmgr -file myqmgr.cert.armStep 3: Configure MQ BindingsTheSSL.CHANNELhas been create with the command:DEFINE CHANNEL(SSL.CHANNEL) CHLTYPE(SVRCONN) TRPTYPE(TCP) SSLCIPH(RC4_SHA_US) SSLCAUTH(OPTIONAL) DESCR('Channel using SSL')JMSAdmin.configINITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory\nPROVIDER_URL=file:///opt/mqm/java/bin/JNDI\nSECURITY_AUTHENTICATION=none\n\n\ncd /opt/mqm/java/bin\n. setjmsenv\n./JMSAdmin -v -cfg JMSAdmin.config\n\nDEFINE QCF(QCF_NAME) SYNCPOINTALLGETS(YES) HOSTNAME(HOST) PORT(1414) TRANSPORT(client) QMANAGER(MYQMGR) CHANNEL(SSL.CHANNEL) SSLCIPHERSUITE(SSL_RSA_WITH_RC4_128_SHA)\nDEFINE Q(MYQNAME) QMANAGER(MYQMGR) QUEUE(LOCALQUEUE)Step 4: Figure out why I get the exceptionWhen I ran my Java app I get the following exception when callingconnectionFactory.createQueueConnection();:javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for 'xxxx:xxxxx'\ncom.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2397\njavax.net.ssl.SSLHandshakeException: Remote host closed connection during handshakeHere is the SSL trace:keyStore is : \nkeyStore type is : jks\nkeyStore provider is : \ninit keystore\ninit keymanager of type SunX509\ntrustStore is: c:\\home\\doc\\jsse\\truststore\ntrustStore type is : jks\ntrustStore provider is : \ninit truststore\nadding as trusted cert:\n Subject: CN=My Queue Manager,O=My Company,C=UK\n Issuer: CN=My Queue Manager,O=My Company,C=UK\n Algorithm: RSA; Serial number: 0x5072a61a\n Valid from Sun Oct 07 12:08:26 CEST 2012 until Tue Oct 08 12:08:26 CEST 2013\n\ntrigger seeding of SecureRandom\ndone seeding SecureRandom\n%% No cached client session\n*** ClientHello, TLSv1\nRandomCookie: GMT: 1349707178 bytes = { 204, 18, 167, 43, 13, 107, 252, 221, 191, 41, 25, 59, 207, 92, 67, 219, 251, 104, 195, 209, 7, 129, 104, 171, 139, 47, 163, 71 }\nSession ID: {}\nCipher Suites: [SSL_RSA_WITH_RC4_128_SHA]\nCompression Methods: { 0 }\n***\n[write] MD5 and SHA1 hashes: len = 45\n0000: 01 00 00 29 03 01 50 73 E6 AA CC 12 A7 2B 0D 6B ...)..Ps.....+.k\n0010: FC DD BF 29 19 3B CF 5C 43 DB FB 68 C3 D1 07 81 ...).;.\\C..h....\n0020: 68 AB 8B 2F A3 47 00 00 02 00 05 01 00 h../.G.......\nThread pool thread #0, WRITE: TLSv1 Handshake, length = 45\n[write] MD5 and SHA1 hashes: len = 44\n0000: 01 03 01 00 03 00 00 00 20 00 00 05 50 73 E6 AA ........ ...Ps..\n0010: CC 12 A7 2B 0D 6B FC DD BF 29 19 3B CF 5C 43 DB ...+.k...).;.\\C.\n0020: FB 68 C3 D1 07 81 68 AB 8B 2F A3 47 .h....h../.G\nThread pool thread #0, WRITE: SSLv2 client hello message, length = 44\n[Raw write]: length = 46\n0000: 80 2C 01 03 01 00 03 00 00 00 20 00 00 05 50 73 .,........ ...Ps\n0010: E6 AA CC 12 A7 2B 0D 6B FC DD BF 29 19 3B CF 5C .....+.k...).;.\\\n0020: 43 DB FB 68 C3 D1 07 81 68 AB 8B 2F A3 47 C..h....h../.G\nThread pool thread #0, received EOFException: error\nThread pool thread #0, handling exception: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake\nThread pool thread #0, SEND TLSv1 ALERT: fatal, description = handshake_failure\nThread pool thread #0, WRITE: TLSv1 Alert, length = 2\n[Raw write]: length = 7\n0000: 15 03 01 00 02 02 28 ......(\nThread pool thread #0, called closeSocket()\nFinalizer, called close()\nFinalizer, called closeInternal(true)OnMQside:AMQ9660: SSL key repository: password stash file absent or unusable.\n\nEXPLANATION:\nThe SSL key repository cannot be used because MQ cannot obtain a password to\naccess it. Reasons giving rise to this error include: \n(a) the key database file and password stash file are not present in the\n location configured for the key repository, \n(b) the key database file exists in the correct place but that no password\n stash file has been created for it, \n(c) the files are present in the correct place but the userid under which MQ is\n running does not have permission to read them, \n(d) one or both of the files are corrupt.But none of them applies to me.ls -ltr /var/mqm/qmgrs/MYQMGR/ssl/\ntotal 235\n-rw-r--r-- 1 mqm mqm 129 Oct 8 12:00 keydb.sth\n-rw-r--r-- 1 mqm mqm 115080 Oct 8 12:08 keydb.kdb\n-rw-r--r-- 1 mqm mqm 80 Oct 8 12:08 keydb.rdb\n-rw-r--r-- 1 mqm mqm 80 Oct 8 12:08 keydb.crl### Assistant: Stupid mistake:alter qmgr SSLKEYR('/var/mqm/qmgrs/MYQMGR/ssl/keydb')fixes the issue.\n"} +{"text": "### Human: Currently i am doing the project in RAD i.e. dynamic web project but now there is a requirement that we need to use websphere MQ for queuing the services . so in order to do queue i found to create EJB project . so i can convert dynamic web project into EJB project ?\nis there any ways to add facets to current project ?.### Assistant: I am not sure why youneedan EJB project in order to use JMS, but regardless - no, you can't change a dynamic Web project into an EJB project using RAD. Once the Dynamic Web Project facet (and its accompanying facets) is installed, you cannot remove it. You can add other facets, but you can't add the EJB facets. You will have to create a brand new RAD project and copy the code over.\n"} +{"text": "### Human: It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened,visit the help center.Closed10 years ago.can you give me a great detail description on bothSyncPointandCheckPointin MQ? What are they? How does WMQ leverage them? As Detail As possible.Thanks in advance### Assistant: I think theSyncPointis described quite wellhereandCheckPointhere\n"} +{"text": "### Human: Can I filter and get a message from a queue by its CorrelationId even if that message is not the first in the queue?### Assistant: Yes. You have to useMQGMO_MATCH_CORREL_IDmatching option onMQGetMessageOptions.MQMessage getMsg = new MQMessage();\n\n MQGetMessageOptions gmo = new MQGetMessageOptions();\n gmo.MatchOptions = MQC.MQMO_MATCH_CORREL_ID;\n\n // Copy correlationID of the message you want to receive \n getMsg.CorrelationId = correlationId;\n\n queue.Get(getMsg, gmo);Edit:CorrelationId is used to relate two messages, typically a request and reply message. So it's done this way.1) Client application sends the request message. After sending the message caches the messageId of the sent message.2) Use this messageId as a correlationId for message selection.recvdResponseMsg.CorrelationId = requestMsg.MessageId;\n gmo.MatchOptions = MQC.MQMO_MATCH_CORREL_ID;3) In the server application(which process the request message), when sending response message, just copy messageId of the request message to correlationId of the response message.responseMsg.CorrelationId = requestMsg.MessageId;\n"} +{"text": "### Human: I'm trying to work out how to approach building a \"machine\" to send and receive messages to WebSphere MQ, via Twisted. I want it to be as generic as possible, so I can reuse it for many different situations that interface with MQ.I've used Twisted before, but many years ago now and I'm trying to resurrect the knowledge I once had...The specific problem I'm having is how to implement the MQ IO using Twisted. There's a pymqi Python library that interfaces with MQ, and it provides all the interfaces I need. The MQ calls I need to implement are:initiate a connection to a specific MQ server/port/channel/queue-manager/queue combinationtake content and post it as a message to the desired queuepoll a queue and return the content of the next message in the queuesend a request to a queue manager to find the number of messages currently in a queueAll of these involve blocking calls to MQ.As I'm intending to reuse the Twisted/MQ interface many times across a range of projects, should I be looking to implement the MQ IO as a Twisted protocol, as a Twisted transport, or just call the pymqi methods via deferToThread() calls? I realise this is a very broad question with possibly no definitive answer; I'm really after advice from those who may have encountered similar challenges before (i.e. working with queueing interfaces that will always block) and found a way that works well.### Assistant: If you're going to use this functionality a lot, then having a native Twisted implementation is probably worth the effort. A wrapper based ondeferToThreadwill be less work, but it will also be harder to test and debug, perform less well, and have problems on certain platforms where Python threads don't work extremely well (eg FreeBSD).The approach to take for a native Twisted implementation is probably to implement a protocol that can speak to MQ servers and give it a rich API for interacting with channels, queues, queue managers, etc, and then build a layer on top of that which abstracts the actual network connection away from the application (as I believe mqi/pymqi largely do).\n"} +{"text": "### Human: I have given the received message length as 1000000 but still message gets truncated completed code is belowimport java.io.FileInputStream;\n\nimport javax.jms.JMSException;\nimport javax.jms.Session;\n\n\nimport com.ibm.jms.JMSMessage;\nimport com.ibm.jms.JMSTextMessage;\nimport com.ibm.mq.jms.JMSC;\nimport com.ibm.mq.jms.MQQueue;\nimport com.ibm.mq.jms.MQQueueConnection;\nimport com.ibm.mq.jms.MQQueueConnectionFactory;\nimport com.ibm.mq.jms.MQQueueReceiver;\nimport com.ibm.mq.jms.MQQueueSender;\nimport com.ibm.mq.jms.MQQueueSession;\n\n\npublic class SimplePTP {\n\n public static void main(String[] args) {\n try {\n MQQueueConnectionFactory cf = new MQQueueConnectionFactory();\nString request= null;\n // Config\n cf.setHostName(\"CTMQ9000\");\n cf.setPort(1414);\n cf.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);\n cf.setQueueManager(\"CTMQTST01\");\n cf.setChannel(\"SYSTEM.ADMIN.SVRCONN\");\n\n MQQueueConnection connection = (MQQueueConnection) cf.createQueueConnection();\n MQQueueSession session = (MQQueueSession) connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\n MQQueue queue = (MQQueue) session.createQueue(\"CONTPLAT.CPS.DELIVERYPREP.REQUEST.TEST\");\n MQQueueSender sender = (MQQueueSender) session.createSender(queue);\n MQQueue queue1 = (MQQueue) session.createQueue(\"CONTPLAT.CPS.DELIVERYPREP.RESPONSE.TEST\");\n MQQueueReceiver receiver = (MQQueueReceiver) session.createReceiver(queue1); \n\n String request =\"sdfHelp Me Name name for Photo Studio!I'm opening a portrait studio in a my town and am stuck on what to name it. I will be photographing (Portrait, wedding Photography)) children and families both at the studio and on location.sdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffsdf\"\n long uniqueNumber = System.currentTimeMillis() % 1000;\n JMSTextMessage message = (JMSTextMessage) session.createTextMessage(request); \n\n // Start the connection\n connection.start();\n\n sender.send(message);\n System.out.println(\"Sent message:\\\\n\" + message +\"lol\");\nThread.sleep(2000);\n JMSMessage receivedMessage = (JMSMessage) receiver.receive(10000000);\n System.out.println(\"\\\\nReceived message:\\\\n\" + receivedMessage);\n\n sender.close();\n receiver.close();\n session.close();\n connection.close();\n\n System.out.println(\"\\\\nSUCCESS\\\\n\");\n }\n catch (JMSException jmsex) {\n System.out.println(jmsex);\n System.out.println(\"\\\\nFAILURE\\\\n\");\n }\n catch (Exception ex) {\n System.out.println(ex);\n System.out.println(\"\\\\nFAILURE\\\\n\");\n }\n }\n}If the length of the message exceeds some limit i don't know how much , but its getting truncated , any way to increase or workaround to display complete message.### Assistant: As Germann pointed out the parameter that you pass to receive method is not the message size, it is actually the wait time in milli seconds. Meaning how long the call must wait for a message to arrive. For example if you have set the wait time as 1000, then the receive call will wait for 1 second for message to arrive. If a message arrives before 1 second, the call will return immediately and give the message to application. If a message does not arrive even after a second, then the call will return with a timeout and no message is given to application. In MQ terms you will see a 2033 reason code.How are you determining that the message is truncated? Are you getting a MQRC_TRUNCATED_MESSAGE_FAILED exception? This exception will be thrown if the application supplied buffer is not enough to fill the incoming message. MQ JMS is not expected to throw a MQRC_TRUNCATED_MESSAGE_FAILED exception as it internally handles the buffer size required and returns message to application.I am guessing that the issue could be because you are printing a JMSMessage whereas the sent message is a JMSTextMessage. JMSMessage.ToString may not be printing the whole message.\n"} +{"text": "### Human: Can any one suggest me code to write a message driven bean in C#.net to listen a MQ and process the same.### Assistant: XMS will be pretty similar to JMS. This is a \"hello, world\" example of a message listener in C# using XMS. Please include the reference IBM.XMS.dll from your websphere mq installation.On my windows installation, 32bit, it wasc:\\Program Files\\IBM\\WebSphere MQ\\bin\\IBM.XMS.dllThis sample assumes a few hardcoded settings and have no error handling, but I think you get the idea.using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing IBM.XMS;\n\nnamespace XMSTest\n{\n class MyXmsApp\n {\n static void Main(string[] args)\n {\n MyXmsApp app = new MyXmsApp();\n app.Setup();\n Console.ReadLine();\n }\n\n public void Setup()\n {\n XMSFactoryFactory xff = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\n IConnectionFactory cf = xff.CreateConnectionFactory();\n cf.SetStringProperty(XMSC.WMQ_HOST_NAME, \"localhost\");\n cf.SetIntProperty(XMSC.WMQ_PORT, 1414);\n cf.SetStringProperty(XMSC.WMQ_CHANNEL, \"CLIENT\");\n cf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);\n cf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, \"QM_LOCAL\");\n cf.SetIntProperty(XMSC.WMQ_BROKER_VERSION, XMSC.WMQ_BROKER_V1);\n\n IConnection conn = cf.CreateConnection();\n Console.WriteLine(\"connection created\");\n ISession sess = conn.CreateSession(false, AcknowledgeMode.AutoAcknowledge);\n IDestination dest = sess.CreateQueue(\"queue://q\");\n IMessageConsumer consumer = sess.CreateConsumer(dest);\n MessageListener ml = new MessageListener(OnMessage);\n consumer.MessageListener = ml;\n conn.Start();\n Console.WriteLine(\"Consumer started\");\n }\n\n private void OnMessage(IMessage msg)\n {\n ITextMessage textMsg = (ITextMessage)msg;\n Console.Write(\"Got a message: \");\n Console.WriteLine(textMsg.Text);\n }\n }\n}\n"} +{"text": "### Human: Good day. I have developed an application which works successfully on my local machine but I have run into a problem when moving out to production.The error is as follows:System.IO.FileNotFoundException: Could not load file or assembly 'IBM.XMS.Admin, Version=2.5.0.0, Culture=neutral, PublicKeyToken=d2666ab12fca862b' or one of its dependencies. The system cannot find the file specified.\n File name: 'IBM.XMS.Admin, Version=2.5.0.0, Culture=neutral, PublicKeyToken=d2666ab12fca862b'I understand where this file is - C:\\Prog... - and my .Net application is simply referencing IBM.XMS.dll which works. It's when I deploy and run I get the error above.I used the following installation instructions and restarted the system too:http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzav.doc/un10290_.htm### Assistant: Your application is built with XMS v2.5. Do you have XMS v2.5 (shipped with MQ v7.5 client) installed on the other machine?\n"} +{"text": "### Human: I installed MQ Client(7.0.1) in my computer,and write an app using c# to connect to remote Websphere MQ server.I have reference amqmdnet.dll in my project.below is my connect code:MQEnvironment.Host = ip address;MQEnvironment.Channel = channel name;\nMQEnvironment.Port = 1414;\nMQQueueManager qmgr = new MQQueueManager(\"qm name\");But when new MQQueueManager(),throw a type initializer for 'IBM.WMO.MQ.QueueManager'.\nI am very confused about the exception.\nCan you help me?### Assistant: Can you give the complete stack trace of the exception? Type initializer exception occurs when an creation of an class instance fails. This exception is basically a wrapper for an internal exception. So knowing the details of the internal exception is helpful. You can put theMQQueueManager qmgr = new MQQueueManager(\"qm name\");in atry/catchblock and print the complete exception.From what I know this exception generally occurs if WMQ Client libraries are not installed. The amqmdnet assembly refers to other WMQ libraries, for example amqxcs2.dll and if they are not installed, this exception can be thrown.You can use the dspmqver -a command output to check what has been installed.\n"} +{"text": "### Human: Is there a IBM MQ JAVA API to move messages from one queue to another?I am able to browse messages from the queue and put messages as well using Java APIs. But I want to move a message from one queue to another. Could you please give a sample code if there is any?Or do we have to dequeue the message fromqueue1and then put the message intoqueue2for moving the messages?### Assistant: You need to GET from queue 1 and then do a PUT on queue 2. If you just browse then there are chances that before yoy GET it out of queue 1, the consumer have already consumed it using GET. You can find sample code for many scenarioson this website.\n"} +{"text": "### Human: I have written a windows service application which is taking message from an IBM MQ Queue and processing it. The service works great on my system, but when I installed it on my dev machine it is not throwing any errors but still not doing anything.I am logging events and got it down to the point where a call to MQQueueManager C# class is not returning a response back. I am not allowed to install the IDE on the server so I can't debug it locally on the machine.I know this is really vague, but is there a way to figure out what is causing my code to fail? Or is it possible to debug the service remotely through my machine.Any pointers will be greatly appreciated.Thanks!### Assistant: You might look at running MQ trace to understand what's happening.\"strmqtrc -t all -t detail\" is the command.\n"} +{"text": "### Human: I need to use an MDB to fetch two kinds of messages of the same queue, one in Groups and the other NOT in groups. \nI can successfully pick up grouped messages usingJMS_IBM_Last_Msg_In_Group=true, and I now need the second MDB to fetch NON GROUPED messages ONLY but cant seem to find a way to do this.Any ideas?### Assistant: Messages in a group will have a GroupId set. So you can get only those messages whose GroupId is not set. More information in GroupIdhere.\n"} +{"text": "### Human: I want to monitor mq listener status whether is up or down. If the connection is down i want to track it down and made a changes accordingly through my program. Is there a way to achieve this using java ?### Assistant: I would consider monitoring your listener this way if using Websphere MQ :You can send messages to your listener with Programmable Command Formats known as websphere PCF.Possible UsesThese PCF classes can be used to develop applications for general-purpose WebSphere MQ administration and monitoring, or in specialized applications that need to query or alter WebSphere MQ definitions.http://www-01.ibm.com/support/docview.wss?uid=swg24000668\n"} +{"text": "### Human: My j2EE app is currently running onServiceMix. Now i want to add JMS to my app. The application should able to send/receive the JMS message to/from the queue that stays onMQSeries.mq.hostname=10.3.6.19\nmq.channel=CHANNEL\nmq.queueManager=QManager\nmq.port=1422What i would like to do is:1. Create a jndi.xml file and do configuration for jms stuff.\n 2. my app will initialize the context, look up jndi name, and create a connection, queueManager, queue. .etc\n 3. Develop send and receive methods.My question is: \n Can you tell me how to do 1st and 2nd steps. \n (the script inside ServiceMix's jndi is diffrent with tomcat's\n jndi and others.\n ServiceMix using Spring based JNDI provider.http://servicemix.apache.org/jndi-configuration.html)### Assistant: I just ran into something similar with Weblogic. The following link uses spring-dm to integrate with websphere. It also takes it to the next logical step and adds camel to the mix.http://lowry-techie.blogspot.com/2010/11/camel-integration-with-websphere-mq.htmlWithout using Spring-dm, you may run into classloader issues when trying to load the InitialContextFactory from the websphere jar (this is an issue I had with the Weblogic jar)\n"} +{"text": "### Human: The scenario is as follows:Therea are three files :test.xls\ntest.txt\ntest.docI am working with mqfte right now. When these files are transferred to another location the filenames must be as below :result_xls.txt\nresult_txt.txt\nresult_doc.txtCould anyone help on this?Can this filename renaming done with ant scripts?### Assistant: Try this:\n \n \n \n \n \n \nInput:$ find src\n src\n src/test.doc\n src/test.txt\n src/test.xlsOutput:$ find dest/\n dest/\n dest/result_doc.txt\n dest/result_txt.txt\n dest/result_xls.txt\n"} +{"text": "### Human: I'm working in a project that requires to send multiple messages to another application via asynchronous Websphere MQ messages. Actually I'm opening and closing sessions for every message I send. I appreciate your answers. By the way this is my first post here.### Assistant: In your question header, you mentioned the wordbatchedwhich made me think you might want to send all the grouped messages in a single transaction so that all messages in the group are delivered or none at all. (An atomic send). If this is an important piece, I would slightly modify Friek's (clean and concise) code as follows:Session session = connection.createSession(true, SESSION_TRANSACTED);\n....\nproducer.send(msgOne);\nproducer.send(msgTwo);\nsession.commit();\n....\n"} +{"text": "### Human: I have a message dump (binary file) from the WebSphere MQ Broker. Is there any tool I can use to open it and read message metadata (Message Descriptor, Message Header) i.e. Version, Message ID, Priority, Return Address, etc.Thanks in advance### Assistant: That depends. What did you use to dump the messages?The Q program fromSupportPac MA01will capture a queue to a file in a format that can be used to reload the messages onto the same or another queue. The same is true ofSupportPac MO71(MQMon) andSupportPac IH03(RFHUtil).Similarly, there are many 3rd party products that can dump a queue to a file such as InfraRed-360, AppWatch, QPasa! and more.If you have used one of these products to dump the queue then either the dump format should show you the message metadata or you can restore the messages to a queue and look at it there.If by \"message dump\" you mean that you have copied the disk file under the queue, then the answer is no. These files are managed by WMQ and the space is constantly being reused, reindexed and recombined. There is no external documentation on how to parse these files.If you are referring to the transaction logs then there are no documented formats for these either but Cressida makes a product that parses and replays the log files.\n"} +{"text": "### Human: I was able to browse the messages in the queues of a particular Queue Manager. At that time my listener ports down to process the messages. So I turned my listener ports to UP and restarted the servers. Now, I can not find any of the messages.What is the reason for this problem? Please help.Thanks :))### Assistant: There are two possibilities here. The first as Yeradis has noted is that the messages expired. You can verify this simply enough while browsing the messages. Look at the expiry field.The other possibility is that your listener is consuming the messages and then either discarding them or requeuing them. It is not uncommon to find a listener that consumes messages and then, either because they did not match a selector or failed some other validation immediately and silently discards them. It is difficult to diagnose this short of running a trace. If you have theMO71 SupportPacinstalled, you can look at the queue stats in real time to see how many GET operations were executed against the queue.Messages can be requeued if the listener backs the message out until the backout count threshold is exceeded and then moves the message to an exception queue or to the DLQ. In this case the messages will be found in one of these queues.\n"} +{"text": "### Human: I am using SoapUI to do performance testing of some services over JMS using WebSphere MQ as the JMS Provider. SoapUI uses HermesJMS to provide the JMS Connection details for the JMS Endpoint.I've noticed that when I call a request from SoapUI the JMS Connection is never closed. This results in hundreds ofSYSTEM.DEF.SVRCONNchannel connections.It seems to be specific to SoapUI as HermeJMS doesn't exhibit this behaviour.Has anyone else seen this?### Assistant: we made some changes in the code that hopefully help you with this problem.Check out our nightly build tomorrow (http://www.eviware.com/nightly-builds/) and let us know does it helps.best regards\nnebojsa\neviware.com\n"} +{"text": "### Human: I have created a simple WCF web service to write some messages into MQ (Websphere MQ).It was hosted in IIS 6.0 server. Service stated successfully, but while writing the message into MQ it was throwing a exception with reason code 2063.Is there any way to override the run-on user(in code) for web service ?Thank you in advance..### Assistant: The reason code2063 0x0000080f MQRC_SECURITY_ERRORrefers to something external to WMQ. For example, if configuration files are not accessible to the application, if the keystore password is incorrect or if the QMgr or application are unable to access domain resources.When accessing WMQ using one of a Windows server's administrator accounts, the account resolves on the local host and there is no need for WMQ to query the domain. However when accessing WMQ with a domain account it is necessary for the QMgr to query the domain to get the groups that the account requesting a connection is a member of. For this reason, it is common for a running QMgr to appear healthy for administrators but to fail when accessed from a domain account.One way to test if this is the issue is to make sure that the access resolves with a local account. In this example, I'll assume the QMgr is running asMUSR_MQADMIN- the default account for Windows. I'll also assume the server name isbigserver. The following test isolates the problem to either the QMgr or the application.If it is not already doing so, make the application connect in client mode. Alter the client channel used by the application withMCAUSER('MUSR_MQADMIN@bigserver')(substitute your own service account and server name) and attempt to reconnect. If you get another 2063 then the error is in the client app configuration. If you get connected then the QMgr needs to b granted rights to query the domain. There is a whole section in the manual which explains to domain admins what exactly is required. If this is the problem, please point your domain adminhere.Please do NOT leave the channel set up like this. Anyone who can access it will be a WMQ administrator! Instead, once you get it working, place the application's service account in the MCAUSER field and use setmqaut to authorize it appropriately.\n"} +{"text": "### Human: Maybe I dont know the right search terms to query with, but I cannot find instructions on how to configure glassfish 3.1 to allow me to use an external websphere mq7 server for my jms/mdb project. Can someone help me get this configured? I'll repay the community by writing a good howto document if there isn't one out there already.### Assistant: Came across this in my own semi-related Google search... didn't answer my question (nor did anything else) so I posted some instructionshere.\n"} +{"text": "### Human: I'm developing a solution to retrieve poison messages from a backout queue in Websphere 6.1.My question is: when this msg (ie. TextMessage) is re-queue from a regular queue to backout queue, what is the queue name in msg.getJMSDestination() and msg.getJMSReplyTo()?For example:\nI've got a msg with destination to myQueue. However, for some reason, this msg could not be processed (poison message) and, because websphere is configured for that, this msg is re-queued to backout queue named myBOQueue. If I retrieve this msg from myBOQueue (using MDB), and I execute((Queue) msg.getJMSDestination()).getQueueName(), what do i go: myQueue or myBOQueue? And if I execute((Queue) msg.getJMSReplyTo()).getQueueName(), what do I got?Message document:http://download.oracle.com/javaee/1.4/api/javax/jms/Message.htmlThx,\nAndre### Assistant: You want to look in vendor-specific docs. I think retry counts and poison message queues are a vendor-specific feature not included in the JMS spec.\n"} +{"text": "### Human: Closed. This question needs to be morefocused. It is not currently accepting answers.Want to improve this question?Update the question so it focuses on one problem only byediting this post.Closed4 years ago.Improve this questionHow to extract messages from MQ(message queue)?\nMessage format in my requirement isStringtype.\nPlease advice some sites.### Assistant: Have you tried:Connect MQ using Java?There are also many IBM materials about Websphere MQ. Start withUsing JavaI think you must give us more details about problems. Which version of Websphere MQ do you have? What platform? Is it local to your machine? Have you read manual and setQM_APPLEandQM_ORANGESqueues? Which Java interface do you want to use: JMS or native?\n"} +{"text": "### Human: we are sending data trough MQ from a z/OS/CICS system to an AS400.Original encoding of the message is CCSID 500 with a MQSTR Format. The client application is getting the message with the CONVERT option and CCSID 819.Data is almost converted correctly except for the end of line caracter. Any idea?\nThe z/OS is sending 0D (CR) as end of line caracter. If they had 0D+0A (CR+LF), CCSID automatically change from 500 to 437, and the end of line still ain't right on the client side.### Assistant: Have already you tried only \"0A\" (LF)? Have you tried without an expliciet CONVERT? We've never had any issues with this part of the conversion and our machine talks with windows, AIX, Linux and so. Almost all the time we do rely on automatic conversions.Also, you may want to check the USER of your job that picks the MQ message from the Queue. Most of the time the USER uses the system attributes (as defined in the appropriate SYSVAL). Maybe this userprofile has been configured very specific and different from the SYSVAL which stops the iSeries in doing the correct automatic conversion.As a simple test, FTP your data to the iSeries. That will also force an automatic conversion that uses the system tables (WRKTBL). That may show an error in that configuration.\n"} +{"text": "### Human: We have developed a custom WCF channel which communicates via IBM Websphere MQ.We have created a channel factory:public class MqChannelFactory : ChannelFactoryBaseWhich returns instances of our channel:public class MqRequestChannel : ChannelBase, IRequestChannelConnecting to the IBM MQ queue manager is an expensive operation. Currently, we do this in Channel.OnOpen().Following the guidelines for correct use of channels, we are callign ChannelFactory.CreateChannel() each time we require a channel, sending the message, then calling Channel.Close().Our assumption was, that the ChannelFactory performed pooling of channels, so that when Channel.Close() was called, the channel was not actually closed but rather returned to the pool. But, everytime we call ChannelFactory.CreateChannel, a new channel is being instantiated, and when the request is sent, the expensive channel opening is performed.So, the question: What is the best approach to prevent the channel being opened on every request?Some of the options we are investigating:Is there anyway through configuration to specify that channel pooling should take place? Should we be implementing our own channel pooling in our ChannelFactory?Should we just keep our channel open for the life of the application, sending all requests through it?Should we perform the expensive operation (connecting to the queue manager) in the channel factory , which we cache for the life of the application?### Assistant: There's really no hard and fast rule as to what the best option is. Initially, I'd say the possibly easiest solution would be to cache client channels at the application level. Depending on your implementation, that might require some synchronization work, btw.You could potentially pool connections at the ChannelFactory level. I'd be hesitant to pool entire channels (there's always some complexity there), but you could pool connections internally and have channels acquire connections when needed from the pool held by their channel factory.This does have the advantage that ClientBasealready cachesClientFactory instances as of .NET 3.0 SP1, so that might make it easier on the application code (if you're using it).The downside, though, is that that this might get harder to implementifthe endpoint address has information that is needed to open the connection to the queue manager because you can potentially create channels for different endpoint addresses from a single ChannelFactory object. Likely this means that you'll need to explicitly disallow this, or that your ChannelFactory implementation might need to keep multiple connection pools internally (one per endpoint address or something like that).\n"} +{"text": "### Human: We have programmatically created subscriber to IBM MQ AMQP TOPIC withcreateDurableSubscriberby providingclientIdand subscriber name.We start the program so it subscribes to TOPIC and stop the program. Then send the msgs to topic and again start the receiver program again but we cannot receive the msgs sent and loose the messages which should not happen in case of durable subscription..We can see amqp topic and its durable subscription when subscriber is connected using mqsc commandsDISPLAY TOPIC,DISPLAY TPSTATUS,DISPLAY TPSTATUS SUB,DISPLAY SUB SUBIDbut not when subscriber program is stopped. We have defined attributeDEFPSIST(YES)and client(producer to topic) is sending persistent messages.Where are the messages gone as we cannot see messages in durable queues of subscriber? Does it depends on expiry attribute?Output ofDISPLAY SUB SUBIDfor our subscriber when it is connected.AMQ8096: WebSphere MQ subscription inquired.\n\n\nSUBID(\"hex sub id\")\n SUB(:private:CLINET01:TOPIC01) TOPICSTR(TOPIC01)\n TOPICOBJ(SYSTEM.BASE.TOPIC) DISTYPE(RESOLVED)\n DEST(SYSTEM.MANAGED.DURABLE.5F6B5C2524FB9AED)\n DESTQMGR(qm.name) PUBAPPID( )\n SELECTOR( ) SELTYPE(NONE)\n USERDATA(010)\n PUBACCT(***************************************************)\n DESTCORL(***************************************************)\n DESTCLAS(MANAGED) DURABLE(YES)\n EXPIRY(0) PSPROP(MSGPROP)\n PUBPRTY(ASPUB) REQONLY(NO)\n SUBSCOPE(ALL) SUBLEVEL(1)\n SUBTYPE(API) VARUSER(FIXED)\n WSCHEMA(TOPIC) SUBUSER(mqm)\n CRDATE(2020-09-28) CRTIME(04:14:09)\n ALTDATE(2020-09-28) ALTTIME(04:14:09)Subscriber id has private(not sure why) and client id but not subscriber name which is sub4import javax.jms.Connection;\nimport javax.jms.ConnectionFactory;\nimport javax.jms.MessageConsumer;\nimport javax.jms.MessageProducer;\nimport javax.jms.Topic;\nimport javax.jms.Queue;\n\nimport javax.jms.Session;\nimport javax.jms.TextMessage;\nimport java.lang.String;\nimport javax.jms.Destination;\nimport javax.naming.Context;\nimport org.apache.qpid.jms.JmsConnectionFactory;\nimport javax.jms.DeliveryMode;\nimport javax.naming.InitialContext;\nimport javax.jms.Message;\n\npublic class AMQPQueueExample1 implements Runnable {\nprivate static final int DELIVERY_MODE = DeliveryMode.PERSISTENT;\n\npublic void run(){\ntry{\n Connection connection = null;\n Context context = new InitialContext();\n ConnectionFactory connectionFactory = (ConnectionFactory) context.lookup(\"myFactoryLookup\");\n connection = connectionFactory.createConnection();\n connection.setClientID(\"123\");//(\"WHATS_MY_PURPOSE3\"); // Why do we need clientID while publishing the TOPIC from consumer / publisher\n Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);\n Topic priceTopic = (Topic) context.lookup(\"myTopicLookup1\");\n MessageConsumer subscriber1 = session.createDurableSubscriber(priceTopic,\"sub420\"); //\"sub3\");\nSystem.out.println(\"TOPIC \"+priceTopic);\n\nconnection.start();\nwhile(true){\nTextMessage message1 = (TextMessage) subscriber1.receive(1000);\nif(message1!=null)\n System.out.println(\"Subscriber 1 received : \" + message1.getText());\n\n\n}\n}catch(Exception e){\ne.printStackTrace();\n}\n}\n\n public static void main(String[] args) {\n\nAMQPQueueExample1 amp=new AMQPQueueExample1();\n Thread thread = new Thread(amp);\nthread.start();\n\n\n }\n}Values are taken from jndi.properties file for context factory and provider url.### Assistant: It looks from the comments like you're using MQ 8.0.0.5? If that's the case then Apache Qpid JMS clients aren't supported with that version of MQ. I believe with that version a very basic non-durable subscribemightwork, but any other JMS methods are unlikely to.I suspect what is happening is the AMQP 1.0 flows from Qpid JMS aren't fully understood by that version of MQ, so the expiry of the subscription is being set to 0 rather than unlimited.MQ 9.2 added support for more of the JMS 2.0 spec - although not every JMS feature. There is more information about the methods which are supported here:https://www.ibm.com/support/knowledgecenter/SSFKSJ_9.2.0/com.ibm.mq.dev.doc/q125050_.htmCreating durable subscribers and/or consumers should work as you expect.\n"} +{"text": "### Human: I'm implementing a load test scenario against a IBM MQ with Gatling. \nThe setup is basically the same as mentionedhereProblem: I'm not able to initialize the requiredContextFactorywith IBM MQ - which should becom.ibm.mq.jms.context.WMQInitialContextFactory. \nTheWMQInitialContextFactorycannot be found.But mybuild.sbtis containing the IBM MQ dependency correctly (being successfully retrieved by our internal Nexus :\"com.ibm.mq\" % \"com.ibm.mq\" % \"8.0.0.3\"My gatling scenario:package com.myawesomecompany.loadtest\n\nimport com.ibm.mq._\nimport com.ibm.mq.jms.MQConnectionFactory\nimport com.ibm.mq.jms.JMSMQ_Messages\nimport com.ibm.msg.client.wmq.common.CommonConstants\nimport io.gatling.core.Predef._\nimport io.gatling.core.scenario.Simulation\nimport io.gatling.jms.Predef._\nimport javax.jms._\n\nimport scala.concurrent.duration._\n\nclass JMSLoadTest extends Simulation {\n\n val jmsConfiguration = jms\n .connectionFactoryName(\"ConnectionFactory\")\n .url(\"devmq01.company.dmz\")\n .credentials(\"mqm\", \"mqm\")\n\n .contextFactory(classOf[com.ibm.mq.jms.context.WMQInitialContrextFactory].getName) \n .listenerCount(1)\n .usePersistentDeliveryMode \n\n val scn = scenario(\"Load testing GPRSForwarder\").repeat(1) {\nexec(jms(\"testing GPRSForwarder...\").reqreply\n .queue(\"COMPANY.TEST.QUEUE\")\n .textMessage(\"00001404020611100E033102C20EBB51CC1C036EFFFF00010002323802000200FE05001400000000FFFFFFFFFFFFFFFFFF040010038B0D6912EB10CE070206110F37298C\")\n .jmsType(\"test_jms_type\")\n )\n } \n\n setUp(scn.inject(rampUsersPerSec(10) to 1000 during (2 minutes)))\n .protocols(jmsConfiguration)\n\n\n}The setup is equivalent tothis one- but instead of usingActiveMQInitalContextFactory, I'm forced to use the \"counterpart\" of IBM MQ.According toofficial dockstheWMQInitialContextFactoryshould be incom.ibm.mq.jms.contextbut it is not. Ore is there some constant inCommonConstantswhich I can use to initialize aContextFactory?Thanks a lot in advance.### Assistant: Problem: I'm not able to initialize the required ContextFactory with\n IBM MQ - which should be\n com.ibm.mq.jms.context.WMQInitialContextFactory. The\n WMQInitialContextFactory cannot be found.Do not use WMQInitialContextFactory. It was an MQ SupportPac someone created where they wanted to use MQ as the JNDI repository. It is not a good idea plus the SupportPac does not support any form of security (i.e. SSL/TLS or security exit).You should use a file based MQ JNDI. Here's a basic example:import java.util.Hashtable;\nimport javax.jms.JMSException;\nimport javax.jms.Queue;\nimport javax.jms.QueueConnection;\nimport javax.jms.QueueConnectionFactory;\nimport javax.jms.QueueSender;\nimport javax.jms.QueueSession;\nimport javax.jms.Session;\nimport javax.jms.TextMessage;\nimport javax.naming.Context;\nimport javax.naming.InitialContext;\nimport javax.naming.NamingException;\nimport com.ibm.mq.MQException;\n\n/**\n * Program Name\n * TestJMS01\n *\n * Description\n * This java JMS class will connect to a remote queue manager\n * using JNDI and put a message to a queue.\n *\n * Sample Command Line Parameters\n * -x myQCF -q dev.test.q -f C:\\JNDI-Directory\\roger\\mqjndi\n *\n * Sample MQ JNDI Commands:\n * DEFINE QCF(myQCF) QMANAGER(MQA1) CHANNEL(TEST.CHL) HOSTNAME(127.0.0.1) PORT(1415) TRANSPORT(CLIENT) FAILIFQUIESCE(YES)\n * DEFINE Q(dev.test.q) QUEUE(TEST1) QMANAGER(MQA1) TARGCLIENT(JMS) FAILIFQUIESCE(YES)\n *\n * @author Roger Lacroix, Capitalware Inc.\n */\npublic class TestJMS01\n{\n private static final String JNDI_CONTEXT = \"com.sun.jndi.fscontext.RefFSContextFactory\";\n\n private QueueConnectionFactory cf;\n private Queue q;\n private Hashtable params = null;\n private String userID = \"tester\";\n private String password = \"mypwd\";\n\n public TestJMS01() throws NamingException\n {\n super();\n }\n\n /**\n * Make sure the required parameters are present.\n * @return true/false\n */\n private boolean allParamsPresent()\n {\n return (params.containsKey(\"-x\") && params.containsKey(\"-q\") && params.containsKey(\"-f\"));\n }\n\n /**\n * Extract the command-line parameters and initialize the MQ variables.\n * @param args\n * @throws IllegalArgumentException\n */\n private void init(String[] args) throws IllegalArgumentException\n {\n params = new Hashtable(10);\n if (args.length > 0 && (args.length % 2) == 0)\n {\n for (int i = 0; i < args.length; i += 2)\n {\n params.put(args[i], args[i + 1]);\n }\n }\n else\n {\n throw new IllegalArgumentException();\n }\n\n if (allParamsPresent())\n {\n Hashtable env = new Hashtable();\n env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_CONTEXT);\n env.put(Context.PROVIDER_URL, \"file:/\"+(String) params.get(\"-f\"));\n\n try\n {\n Context ctx = new InitialContext(env);\n\n cf = (QueueConnectionFactory) ctx.lookup((String) params.get(\"-x\"));\n q = (Queue) ctx.lookup((String) params.get(\"-q\"));\n }\n catch (NamingException e)\n {\n System.err.println(e.getLocalizedMessage());\n e.printStackTrace();\n throw new IllegalArgumentException();\n }\n }\n else\n {\n throw new IllegalArgumentException();\n }\n }\n\n /**\n * Test the connection to the queue manager.\n * @throws MQException\n */\n private void testConn() throws JMSException\n {\n QueueConnection connection = null;\n QueueSession session = null;\n\n try\n {\n connection = cf.createQueueConnection(userID, password);\n connection.start();\n\n session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\n\n sendMsg(session);\n }\n catch (JMSException e)\n {\n System.err.println(\"getLinkedException()=\" + e.getLinkedException());\n System.err.println(e.getLocalizedMessage());\n e.printStackTrace();\n }\n finally\n {\n try\n {\n session.close();\n }\n catch (Exception ex)\n {\n System.err.println(\"session.close() : \" + ex.getLocalizedMessage());\n }\n\n try\n {\n connection.stop();\n }\n catch (Exception ex)\n {\n System.err.println(\"connection.stop() : \" + ex.getLocalizedMessage());\n }\n\n try\n {\n connection.close();\n }\n catch (Exception ex)\n {\n System.err.println(\"connection.close() : \" + ex.getLocalizedMessage());\n }\n }\n }\n\n /**\n * Send a message to a queue.\n * @throws MQException\n */\n private void sendMsg(QueueSession session) throws JMSException\n {\n QueueSender sender = null;\n\n try\n {\n TextMessage msg = session.createTextMessage();\n msg.setText(\"Nice simple test. Time in 'ms' is -> \" + System.currentTimeMillis());\n // msg.setJMSReplyTo(tq);\n // msg.setJMSDeliveryMode( DeliveryMode.NON_PERSISTENT);\n\n System.out.println(\"Sending request to \" + q.getQueueName());\n System.out.println();\n\n sender = session.createSender(q);\n sender.send(msg);\n }\n catch (JMSException e)\n {\n System.err.println(\"getLinkedException()=\" + e.getLinkedException());\n System.err.println(e.getLocalizedMessage());\n e.printStackTrace();\n }\n finally\n {\n try\n {\n sender.close();\n }\n catch (Exception ex)\n {\n System.err.println(\"sender.close() : \" + ex.getLocalizedMessage());\n }\n }\n }\n\n /**\n * main line\n * @param args\n */\n public static void main(String[] args)\n {\n try\n {\n TestJMS01 tj = new TestJMS01();\n tj.init(args);\n tj.testConn();\n }\n catch (IllegalArgumentException e)\n {\n System.err.println(\"Usage: java TestJMS01 -x QueueConnectionFactoryName -q JMS_Queue_Name -f path_to_MQ_JNDI\");\n System.exit(1);\n }\n catch (NamingException ex)\n {\n System.err.println(ex.getLocalizedMessage());\n ex.printStackTrace();\n }\n catch (JMSException e)\n {\n System.err.println(\"getLinkedException()=\" + e.getLinkedException());\n System.err.println(e.getLocalizedMessage());\n e.printStackTrace();\n }\n catch (Exception ex)\n {\n System.err.println(ex.getLocalizedMessage());\n ex.printStackTrace();\n }\n }\n}\n"} +{"text": "### Human: I have a dev server running IBM Websphere MQ 7.5. The issue is that users while trying to run runmqsc command getting following error :AMQ8135: Not authorized.\n\nNo MQSC commands read.\nNo commands have a syntax error.\nAll valid MQSC commands were processed.As I went through IBM Documentation, all user who are part of MQM group should be able to run this.Also I found that all non-domain accounts, ie local accounts who are part of MQM group are able to run commands. But somehow domain accounts are not working, even when they are part of MQM group. I also added these accounts to domain mqm group, still no luck.I tried running REFRESH SECURITY Command, still no luck.If anyone can provide some insight in to this , it would be great.And yes I am a total noob in IBM Websphere.### Assistant: Not sure if this helps in your case, but i tried below steps and it worked for me.Right click then Properties on MQSeriesServices from ServicesChange the logon to \"Local System Account\".Restart the service.Note: Assuming that MQM is added to user groups.\n"} +{"text": "### Human: This question's answers are acommunity effort. Edit existing answers to improve this post. It is not currently accepting new answers or interactions.I have some code and when it executes, it throws aNullReferenceException, saying:Object reference not set to an instance of an object.What does this mean, and what can I do to fix this error?### Assistant: What is the cause?Bottom LineYou are trying to use something that isnull(orNothingin VB.NET). This means you either set it tonull, or you never set it to anything at all.Like anything else,nullgets passed around. If it isnullinmethod \"A\", it could be that method \"B\" passed anulltomethod \"A\".nullcan have different meanings:Object variables that areuninitializedand hencepoint to nothing.In this case, if you access members of such objects, it causes aNullReferenceException.The developer isusingnullintentionally to indicate there is no meaningful value available.Note that C# has the concept of nullable datatypes for variables (like database tables can have nullable fields) - you can assignnullto them to indicate there is no value stored in it, for exampleint? a = null;(which is a shortcut forNullable a = null;) where the question mark indicates it is allowed to storenullin variablea. You can check that either withif (a.HasValue) {...}or withif (a==null) {...}. Nullable variables, likeathis example, allow to access the value viaa.Valueexplicitly, or just as normal viaa.Notethat accessing it viaa.Valuethrows anInvalidOperationExceptioninstead of aNullReferenceExceptionifaisnull- you should do the check beforehand, i.e. if you have another non-nullable variableint b;then you should do assignments likeif (a.HasValue) { b = a.Value; }or shorterif (a != null) { b = a; }.The rest of this article goes into more detail and shows mistakes that many programmers often make which can lead to aNullReferenceException.More SpecificallyTheruntimethrowing aNullReferenceExceptionalwaysmeans the same thing: you are trying to use a reference, and the reference is not initialized (or it wasonceinitialized, but isno longerinitialized).This means the reference isnull, and you cannot access members (such as methods) through anullreference. The simplest case:string foo = null;\nfoo.ToUpper();This will throw aNullReferenceExceptionat the second line because you can't call the instance methodToUpper()on astringreference pointing tonull.DebuggingHow do you find the source of aNullReferenceException? Apart from looking at the exception itself, which will be thrown exactly at the location where it occurs, the general rules of debugging in Visual Studio apply: place strategic breakpoints andinspect your variables, either by hovering the mouse over their names, opening a (Quick)Watch window or using the various debugging panels like Locals and Autos.If you want to find out where the reference is or isn't set, right-click its name and select \"Find All References\". You can then place a breakpoint at every found location and run your program with the debugger attached. Every time the debugger breaks on such a breakpoint, you need to determine whether you expect the reference to be non-null, inspect the variable, and verify that it points to an instance when you expect it to.By following the program flow this way, you can find the location where the instance should not be null, and why it isn't properly set.ExamplesSome common scenarios where the exception can be thrown:Genericref1.ref2.ref3.memberIf ref1 or ref2 or ref3 is null, then you'll get aNullReferenceException. If you want to solve the problem, then find out which one is null by rewriting the expression to its simpler equivalent:var r1 = ref1;\nvar r2 = r1.ref2;\nvar r3 = r2.ref3;\nr3.memberSpecifically, inHttpContext.Current.User.Identity.Name, theHttpContext.Currentcould be null, or theUserproperty could be null, or theIdentityproperty could be null.Indirectpublic class Person \n{\n public int Age { get; set; }\n}\npublic class Book \n{\n public Person Author { get; set; }\n}\npublic class Example \n{\n public void Foo() \n {\n Book b1 = new Book();\n int authorAge = b1.Author.Age; // You never initialized the Author property.\n // there is no Person to get an Age from.\n }\n}If you want to avoid the child (Person) null reference, you could initialize it in the parent (Book) object's constructor.Nested Object InitializersThe same applies to nested object initializers:Book b1 = new Book \n{ \n Author = { Age = 45 } \n};This translates to:Book b1 = new Book();\nb1.Author.Age = 45;While thenewkeyword is used, it only creates a new instance ofBook, but not a new instance ofPerson, so theAuthorthe property is stillnull.Nested Collection Initializerspublic class Person \n{\n public ICollection Books { get; set; }\n}\npublic class Book \n{\n public string Title { get; set; }\n}The nested collectionInitializersbehave the same:Person p1 = new Person \n{\n Books = {\n new Book { Title = \"Title1\" },\n new Book { Title = \"Title2\" },\n }\n};This translates to:Person p1 = new Person();\np1.Books.Add(new Book { Title = \"Title1\" });\np1.Books.Add(new Book { Title = \"Title2\" });Thenew Persononly creates an instance ofPerson, but theBookscollection is stillnull. The collectionInitializersyntax does not create a collection\nforp1.Books, it only translates to thep1.Books.Add(...)statements.Arrayint[] numbers = null;\nint n = numbers[0]; // numbers is null. There is no array to index.Array ElementsPerson[] people = new Person[5];\npeople[0].Age = 20 // people[0] is null. The array was allocated but not\n // initialized. There is no Person to set the Age for.Jagged Arrayslong[][] array = new long[1][];\narray[0][0] = 3; // is null because only the first dimension is yet initialized.\n // Use array[0] = new long[2]; first.Collection/List/DictionaryDictionary agesForNames = null;\nint age = agesForNames[\"Bob\"]; // agesForNames is null.\n // There is no Dictionary to perform the lookup.Range Variable (Indirect/Deferred)public class Person \n{\n public string Name { get; set; }\n}\nvar people = new List();\npeople.Add(null);\nvar names = from p in people select p.Name;\nstring firstName = names.First(); // Exception is thrown here, but actually occurs\n // on the line above. \"p\" is null because the\n // first element we added to the list is null.Events (C#)public class Demo\n{\n public event EventHandler StateChanged;\n \n protected virtual void OnStateChanged(EventArgs e)\n { \n StateChanged(this, e); // Exception is thrown here \n // if no event handlers have been attached\n // to StateChanged event\n }\n}(Note: The VB.NET compiler inserts null checks for event usage, so it's not necessary to check events forNothingin VB.NET.)Bad Naming Conventions:If you named fields differently from locals, you might have realized that you never initialized the field.public class Form1\n{\n private Customer customer;\n \n private void Form1_Load(object sender, EventArgs e) \n {\n Customer customer = new Customer();\n customer.Name = \"John\";\n }\n \n private void Button_Click(object sender, EventArgs e)\n {\n MessageBox.Show(customer.Name);\n }\n}This can be solved by following the convention to prefix fields with an underscore:private Customer _customer;ASP.NET Page Life cycle:public partial class Issues_Edit : System.Web.UI.Page\n{\n protected TestIssue myIssue;\n\n protected void Page_Load(object sender, EventArgs e)\n {\n if (!IsPostBack)\n {\n // Only called on first load, not when button clicked\n myIssue = new TestIssue(); \n }\n }\n \n protected void SaveButton_Click(object sender, EventArgs e)\n {\n myIssue.Entry = \"NullReferenceException here!\";\n }\n}ASP.NET Session Values// if the \"FirstName\" session value has not yet been set,\n// then this line will throw a NullReferenceException\nstring firstName = Session[\"FirstName\"].ToString();ASP.NET MVC empty view modelsIf the exception occurs when referencing a property of@Modelin anASP.NET MVC View, you need to understand that theModelgets set in your action method, when youreturna view. When you return an empty model (or model property) from your controller, the exception occurs when the views access it:// Controller\npublic class Restaurant:Controller\n{\n public ActionResult Search()\n {\n return View(); // Forgot the provide a Model here.\n }\n}\n\n// Razor view \n@foreach (var restaurantSearch in Model.RestaurantSearch) // Throws.\n{\n}\n \n

@Model.somePropertyName

WPF Control Creation Order and EventsWPFcontrols are created during the call toInitializeComponentin the order they appear in the visual tree. ANullReferenceExceptionwill be raised in the case of early-created controls with event handlers, etc., that fire duringInitializeComponentwhich reference late-created controls.For example:\n \n \n \n \n \n \n \n \n HerecomboBox1is created beforelabel1. IfcomboBox1_SelectionChangedattempts to reference `label1, it will not yet have been created.private void comboBox1_SelectionChanged(object sender, SelectionChangedEventArgs e)\n{\n label1.Content = comboBox1.SelectedIndex.ToString(); // NullReferenceException here!!\n}Changing the order of the declarations in theXAML(i.e., listinglabel1beforecomboBox1, ignoring issues of design philosophy) would at least resolve theNullReferenceExceptionhere.Cast withasvar myThing = someObject as Thing;This doesn't throw anInvalidCastExceptionbut returns anullwhen the cast fails (and whensomeObjectis itself null). So be aware of that.LINQFirstOrDefault()andSingleOrDefault()The plain versionsFirst()andSingle()throw exceptions when there is nothing. The \"OrDefault\" versions returnnullin that case. So be aware of that.foreachforeachthrows when you try to iterate on anullcollection. Usually caused by unexpectednullresult from methods that return collections.List list = null; \nforeach(var v in list) { } // NullReferenceException hereMore realistic example - select nodes from XML document. Will throw if nodes are not found but initial debugging shows that all properties valid:foreach (var node in myData.MyXml.DocumentNode.SelectNodes(\"//Data\"))Ways to AvoidExplicitly check fornulland ignorenullvalues.If you expect the reference sometimes to benull, you can check for it beingnullbefore accessing instance members:void PrintName(Person p)\n{\n if (p != null) \n {\n Console.WriteLine(p.Name);\n }\n}Explicitly check fornulland provide a default value.Methods you call expecting an instance can returnnull, for example when the object being sought cannot be found. You can choose to return a default value when this is the case:string GetCategory(Book b) \n{\n if (b == null)\n return \"Unknown\";\n return b.Category;\n}Explicitly check fornullfrom method calls and throw a custom exception.You can also throw a custom exception, only to catch it in the calling code:string GetCategory(string bookTitle) \n{\n var book = library.FindBook(bookTitle); // This may return null\n if (book == null)\n throw new BookNotFoundException(bookTitle); // Your custom exception\n return book.Category;\n}UseDebug.Assertif a value should never benull, to catch the problem earlier than the exception occurs.When you know during development that a method could, but never should returnnull, you can useDebug.Assert()to break as soon as possible when it does occur:string GetTitle(int knownBookID) \n{\n // You know this should never return null.\n var book = library.GetBook(knownBookID); \n\n // Exception will occur on the next line instead of at the end of this method.\n Debug.Assert(book != null, \"Library didn't return a book for known book ID.\");\n\n // Some other code\n\n return book.Title; // Will never throw NullReferenceException in Debug mode.\n}Though this checkwill not end up in your release build, causing it to throw theNullReferenceExceptionagain whenbook == nullat runtime in release mode.UseGetValueOrDefault()fornullablevalue types to provide a default value when they arenull.DateTime? appointment = null;\nConsole.WriteLine(appointment.GetValueOrDefault(DateTime.Now));\n// Will display the default value provided (DateTime.Now), because appointment is null.\n\nappointment = new DateTime(2022, 10, 20);\nConsole.WriteLine(appointment.GetValueOrDefault(DateTime.Now));\n// Will display the appointment date, not the defaultUse the null coalescing operator:??[C#] orIf()[VB].The shorthand to providing a default value when anullis encountered:IService CreateService(ILogger log, Int32? frobPowerLevel)\n{\n var serviceImpl = new MyService(log ?? NullLog.Instance);\n \n // Note that the above \"GetValueOrDefault()\" can also be rewritten to use\n // the coalesce operator:\n serviceImpl.FrobPowerLevel = frobPowerLevel ?? 5;\n}Use the null condition operator:?.or?[x]for arrays (available in C# 6 and VB.NET 14):This is also sometimes called the safe navigation or Elvis (after its shape) operator. If the expression on the left side of the operator is null, then the right side will not be evaluated, and null is returned instead. That means cases like this:var title = person.Title.ToUpper();If the person does not have a title, this will throw an exception because it is trying to callToUpperon a property with a null value.InC# 5and below, this can be guarded with:var title = person.Title == null ? null : person.Title.ToUpper();Now the title variable will be null instead of throwing an exception. C# 6 introduces a shorter syntax for this:var title = person.Title?.ToUpper();This will result in the title variable beingnull, and the call toToUpperis not made ifperson.Titleisnull.Of course, youstillhave to checktitlefornullor use the null condition operator together with the null coalescing operator (??) to supply a default value:// regular null check\nint titleLength = 0;\nif (title != null)\n titleLength = title.Length; // If title is null, this would throw NullReferenceException\n \n// combining the `?` and the `??` operator\nint titleLength = title?.Length ?? 0;Likewise, for arrays you can use?[i]as follows:int[] myIntArray = null;\nvar i = 5;\nint? elem = myIntArray?[i];\nif (!elem.HasValue) Console.WriteLine(\"No value\");This will do the following: IfmyIntArrayisnull, the expression returnsnulland you can safely check it. If it contains an array, it will do the same as:elem = myIntArray[i];and returns the ithelement.Use null context (available in C# 8):Introduced inC# 8, null contexts and nullable reference types perform static analysis on variables and provide a compiler warning if a value can be potentiallynullor have been set tonull. The nullable reference types allow types to be explicitly allowed to benull.The nullable annotation context and nullable warning context can be set for a project using theNullableelement in yourcsprojfile. This element configures how the compiler interprets the nullability of types and what warnings are generated. Valid settings are:enable: The nullable annotation context is enabled. The nullable warning context is enabled. Variables of a reference type, string, for example, are non-nullable. All nullability warnings are enabled.disable: The nullable annotation context is disabled. The nullable warning context is disabled. Variables of a reference type are oblivious, just like earlier versions of C#. All nullability warnings are disabled.safeonly: The nullable annotation context is enabled. The nullable warning context is safeonly. Variables of a reference type are non-nullable. All safety nullability warnings are enabled.warnings: The nullable annotation context is disabled. The nullable warning context is enabled. Variables of a reference type are oblivious. All nullability warnings are enabled.safeonlywarnings: The nullable annotation context is disabled. The nullable warning context is safeonly.\nVariables of a reference type are oblivious. All safety nullability warnings are enabled.A nullable reference type is noted using the same syntax as nullable value types: a?is appended to the type of the variable.Special techniques for debugging and fixing null derefs in iteratorsC#supports \"iterator blocks\" (called \"generators\" in some other popular languages).NullReferenceExceptioncan be particularly tricky to debug in iterator blocks because of deferred execution:public IEnumerable GetFrobs(FrobFactory f, int count)\n{\n for (int i = 0; i < count; ++i)\n yield return f.MakeFrob();\n}\n...\nFrobFactory factory = whatever;\nIEnumerable frobs = GetFrobs();\n...\nforeach(Frob frob in frobs) { ... }Ifwhateverresults innullthenMakeFrobwill throw. Now, you might think that the right thing to do is this:// DON'T DO THIS\npublic IEnumerable GetFrobs(FrobFactory f, int count)\n{\n if (f == null) \n throw new ArgumentNullException(\"f\", \"factory must not be null\");\n for (int i = 0; i < count; ++i)\n yield return f.MakeFrob();\n}Why is this wrong? Because the iterator block does not actuallyrununtil theforeach! The call toGetFrobssimply returns an object whichwhen iteratedwill run the iterator block.By writing anullcheck like this you prevent theNullReferenceException, but you move theNullArgumentExceptionto the point of theiteration, not to the point of thecall, and that isvery confusing to debug.The correct fix is:// DO THIS\npublic IEnumerable GetFrobs(FrobFactory f, int count)\n{\n // No yields in a public method that throws!\n if (f == null) \n throw new ArgumentNullException(\"f\", \"factory must not be null\");\n return GetFrobsForReal(f, count);\n}\nprivate IEnumerable GetFrobsForReal(FrobFactory f, int count)\n{\n // Yields in a private method\n Debug.Assert(f != null);\n for (int i = 0; i < count; ++i)\n yield return f.MakeFrob();\n}That is, make a private helper method that has the iterator block logic and a public surface method that does thenullcheck and returns the iterator. Now whenGetFrobsis called, thenullcheck happens immediately, and thenGetFrobsForRealexecutes when the sequence is iterated.If you examine the reference source forLINQto Objects you will see that this technique is used throughout. It is slightly more clunky to write, but it makes debugging nullity errors much easier.Optimize your code for the convenience of the caller, not the convenience of the author.A note on null dereferences in unsafe codeC#has an \"unsafe\" mode which is, as the name implies, extremely dangerous because the normal safety mechanisms which provide memory safety and type safety are not enforced.You should not be writing unsafe code unless you have a thorough and deep understanding of how memory works.In unsafe mode, you should be aware of two important facts:dereferencing a nullpointerproduces the same exception as dereferencing a nullreferencedereferencing an invalid non-null pointercanproduce that exception in some circumstancesTo understand why that is, it helps to understand how .NET producesNullReferenceExceptionin the first place. (These details apply to .NET running on Windows; other operating systems use similar mechanisms.)Memory is virtualized inWindows; each process gets a virtual memory space of many \"pages\" of memory that are tracked by the operating system. Each page of memory has flags set on it that determine how it may be used: read from, written to, executed, and so on. Thelowestpage is marked as \"produce an error if ever used in any way\".Both a null pointer and a null reference inC#are internally represented as the number zero, and so any attempt to dereference it into its corresponding memory storage causes the operating system to produce an error. The .NET runtime then detects this error and turns it into theNullReferenceException.That's why dereferencing both a null pointer and a null reference produces the same exception.What about the second point? Dereferencinganyinvalid pointer that falls in the lowest page of virtual memory causes the same operating system error, and thereby the same exception.Why does this make sense? Well, suppose we have a struct containing two ints, and an unmanaged pointer equal to null. If we attempt to dereference the second int in the struct, theCLRwill not attempt to access the storage at location zero; it will access the storage at location four. But logically this is a null dereference because we are getting to that addressviathe null.If you are working with unsafe code and you get aNullReferenceException, just be aware that the offending pointer need not be null. It can be any location in the lowest page, and this exception will be produced.\n"} +{"text": "### Human: I am using spring jms to connect to Websphere MQ. I am trying to connect through localhost not using jndi info right now.Connection names (all as an example): hostname: http://localhost:9043\ngiven hostname 12.123.0.12\n\nIn Resources->JMS->Queue connection Factories\nname: MQDemo\nJNDI name: MQDemo\n\n2 Queues:\nname: MQ.T11.UPDATE.REQUEST\nJNDI name: jms/MQ.T11.UPDATE.REQUEST\n\nname: MQ.T11.INQUIRY.REPLY\nJNDI name: jms/MQ.T11.UPDATE.REQUESTDemoMain.javaIn main method:ApplicationContext ctx = new ClassPathXmlApplicationContext(\"app-context.xml\");\n // get bean from context\n JmsMessageSender jmsMessageSender = (JmsMessageSender)ctx.getBean(\"jmsMessageSender\");\n // send to default destination \n jmsMessageSender.send();JMSMessageSender.javapackage name: com.java.geek\n\n @Autowired\n private JmsTemplate jmsTemplate;\n\n\n /**\n * send text to default destination\n * @param text\n */\n @Cacheable(\"message\")\n public void send() {\n System.out.println(\"in send\");\n jmsTemplate.send(new MessageCreator() {\n @Override\n public Message createMessage(Session session)throws JMSException {\n\n System.out.println(\"in create message\");\n Message message = (Message) session.createTextMessage(\"Hello JMS\");\n return message;\n }\n });\n\n }\n\n public JmsTemplate getJmsTemplate()\n {\n return jmsTemplate;\n }\n\n public void setJmsTemplate(JmsTemplate jmsTemplate)\n {\n this.jmsTemplate = jmsTemplate;\n }app-context.xml\n\n\n\n \n\n \n http://localhost:9043\n \n \n 1415\n \n \n MQDemo\n \n \n 1\n \n\n\n \n \n \n \n \n \n \n \n\n\n \n \n \n false \n \n \n\n \n \n \n\n \n \n \n \n \n \n \n\nI am getting an error,Exception in thread \"main\" java.lang.IllegalArgumentException: Comparison method violates its general contract!\n at java.util.TimSort.mergeLo(TimSort.java:758)\n at java.util.TimSort.mergeAt(TimSort.java:494)\n at java.util.TimSort.mergeCollapse(TimSort.java:421)\n at java.util.TimSort.sort(TimSort.java:225)\n at java.util.TimSort.sort(TimSort.java:184)\n at java.util.Arrays.sort(Arrays.java:670)\n at com.ibm.mq.constants.MQConstants.getFields(MQConstants.java:277)\n at com.ibm.mq.constants.MQConstants.lookup(MQConstants.java:204)\n at com.ibm.mq.constants.MQConstants.lookup(MQConstants.java:264)\n at com.ibm.mq.constants.MQConstants.lookup(MQConstants.java:254)\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1862)\n at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1144)\n at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:337)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:6772)\n at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6151)\n at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:280)\n at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6138)\n at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:115)\n at com.ibm.mq.jms.MQQueueConnectionFactory.createConnection(MQQueueConnectionFactory.java:198)\n at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:185)\n at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:481)\n at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:566)\n at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:557)\n at com.java.geek.JmsMessageSender.send(JmsMessageSender.java:34)\n at com.java.geek.DemoMain.main(DemoMain.java:20)which is coming at linejmsTemplate.send(new MessageCreator() {I am unable to connect to Websphere MQ. Kindly suggest where is a mistake in the code.### Assistant: This looks like an MQ defect, and seems to match the following APAR:http://www-01.ibm.com/support/docview.wss?uid=swg1IC88187Says fixed in 7.0.1.10+, 7.1.0.3+, and 7.5.0.1+ (and by implication future major versions). Upgrade the client to exceed those levels and the problem should be resolved.\n"} +{"text": "### Human: The JMS 2.0 specification saysTheJMSMessageIDheader field contains a value that uniquely\n identifies each message sent by a provider....and...The exact scope of uniqueness is provider defined. It should at least\n cover all messages for a specific installation of a provider where an\n installation is some connected set of message routers.The specification does not explicitly state that theJMSMessageIDreturned from the publish API call must match the one present in the message when it is consumed. The discussion in the spec about moving theJMSMessageIDto theJMSCorrelationIDwhen replying to a request implies that the two would be the same. If the message ID was changed between publication and consumption, this style of request/reply would fail.Certainly in the unified domain model of JMS 1.1 and now 2.0, it would not make sense for the behavior of theJMSMessageIDto change depending on whether the destination is a queue or a topic. Under the unified model, one would expect all destinations to act alike in this regard.Also, if \"provider\" as used in the first paragraph refers to the thing that is sending messages, then a publication that fanned out to 10 identical messages, with identicalJMSMessageIDvalues, would meet the spec since uniqueness is measured at the sending side.Unfortunately, the specification liberally switches between using the term \"provider\" to describe the thing sending messages versus using it to describe the vendor of the JMS transport. This is evident in the two quoted passages above. This ambiguity doesn't help matters any.At least one implementation (IBM's MQ) takes the approach that a publication fanning out to 10 messages has created 10 unique, new messages, and therefore each of these has a uniqueJMSMessageIDvalue. This is arguably consistent with the second quoted passage which requires uniqueness scoped to the provider, where \"provider\" appears to refer to the vendor implementation andnotthe thing sending messages.It is my belief that when a published message fans out to multiple subscribers the correct behavior would be that theJMSMessageIDwould be preserved in each instance of the message so that replies can be correlated as expected. In other words, I believe IBM's implementation to be non-compliant. Since the specification is ambiguous on the matter, I'm looking for an authoritative source which either states outright or strongly implies the behavior as intended by the spec, one way or the other. Depending on the response, I'll either stand down, or else raise the issue with IBM as a compliance defect.### Assistant: The term \"provider\" here is simply a reference to the specific messaging product being used, and covers both client-side and server-side components. To avoid confusion, I'll use the word JMS product vendor here.The purpose of the JMS specification is to define a Java API implemented by that messaging product. It uses loose terms like \"provider\" because the JMS spec does not define how the product is architected and is trying to avoid suggesting how the implementation should be shared between client-side and server-side components, or even whether there is a server (or cluster of servers) at all. You'll notice the spec never (well, almost never) says \"the server does this\" or \"the server does that\".The sentence about the \"exact scope of uniqueness\" is there to make it easy for the JMS product vendor to implement the code that generatesJMSMessageIDvalues. It's saying that the code that generatesJMSMessageIDvalues doesn't need to worry about ensuring that the values generated are unique across the entire universe. It's sufficient to ensure that they are unique to that particular product installation.You say that \"The specification does not explicitly state that theJMSMessageIDreturned from the publish API call must match the one present in the message when it is consumed.\"I think this is stated in Section 4.4.11 \"How message header values are set\". This states that theJMSMessageIDis set by the \"JMS provider send method\". The same section goes on to say that \"Message header fields that are defined as being set by the 'JMS provider send method' will be available on the sending client as well as on the receiving client.\"This means that after the call to send() or publish() has returned, the sending application can use the methodgetJMSMessageID()to find the message ID that was assigned to that message. When this message is received, the receiving application can use the same method, and get the same value.Each message sent to a topic is delivered to every subscriber on that topic. These subscribers will receive a separate copy of the same message, with the same body, properties and headers, includingJMSMessageIDvalue.Feel free to argue; the JMS spec is not free of ambiguities.\n"} +{"text": "### Human: I try to install WebSphere MQ v8 on Centos 7... I did have no problem instaling the server and test it. When I try to configure client every is OK until I try to put a message at queue with the following command: ./amqsputc queue manager. Here part of the log file.------------------------------------------------------------------------------- \n08/01/15 13:16:17 - Process(37991.4) User(mqm) Program(amqrmppa)\n Host(localhost.localdomain) Installation(Installation1)\n VRMF(8.0.0.0) QMgr(my.manager)\n AMQ9776: Channel was blocked by userid\n\nEXPLANATION: The inbound channel 'CANAL1' was blocked from address\n'127.0.0.1' because the active values of the channel were mapped to a\nuserid which should be blocked. The active values of the channel were\n'MCAUSER(mqm) CLNTUSER(mqm) ADDRESS(localhost)'. ACTION: Contact the\nsystems administrator, who should examine the channel authentication\nrecords to ensure that the correct settings have been configured. The\nALTER QMGR CHLAUTH switch is used to control whether channel\nauthentication records are used. The command DISPLAY CHLAUTH can be\nused to query the channel authentication records.\n----- cmqxrmsa.c : 1257 ------------------------------------------------------- \n08/01/15 13:16:17 - Process(37991.4) User(mqm) Program(amqrmppa)\n Host(localhost.localdomain) Installation(Installation1)\n VRMF(8.0.0.0) QMgr(my.manager)\n AMQ9999: Channel 'CANAL1' to host '127.0.0.1' ended abnormally.\n\nEXPLANATION: The channel program running under process ID 37991 for\nchannel 'CANAL1' ended abnormally. The host name is '127.0.0.1'; in\nsome cases the host name cannot be determined and so is shown as\n'????'. ACTION: Look at previous error messages for the channel\nprogram in the error logs to determine the cause of the failure. Note\nthat this message can be excluded completely or suppressed by tuning\nthe \"ExcludeMessage\" or \"SuppressMessage\" attributes under the\n\"QMErrorLog\" stanza in qm.ini. Further information can be found in the\nSystem Administration Guide.\n----- amqrmrsa.c : 925 --------------------------------------------------------I appreciate all the help you can give me, thanks in advance.### Assistant: It is very easy to troubleshoot the reasons why you have been blocked by a CHLAUTH rule. There is a blog post on it,I'm being blocked by CHLAUTH - how can I work out why?However, I can tell you from hereexactlywhich rule is blocking you, it is the default rule which bans remote privileged access, i.e. mqm access from client connections. If you want to have access without being privileged, readA non-privileged MQ administrator, and alternatively if you do want to allow the risky remote access from privileged users, readCHLAUTH - Allow some privileged admins\n"} +{"text": "### Human: I am using the WebSphere 7.1. I am following the below steps :Creating the queue manager using WebSphere MQ Explorer\nProcedure:Start WebSphere MQ Explorer.In the Navigator view, right-click the Queue Managers folder, then\nclick New > Queue Manager.The Create Queue Manager wizard opens.In the Queue Manager name field, type QM_APPLE.Click Next twice.Ensure that Automatic is selected from the Select type of queue\nmanager startup option.Click Next.Ensure that the Create listener configured for TCP/IP check box is\nselected.If the Finish button is not available, type another port number inthe Listen on port number field. If the current value is 1414, try\nusing a different port number, for example: 1415 or 1416. If the\ndefault port number of 1414 is not used at this stage, make a note of\nthe port number used because you will need it in later stages of this\ntutorial when QM_APPLE serves as a receiving queue manager.Click Finish.The Problem is, I am stuck in the Step 2. When i right Click I cannot find \"NEW\" option to create the Queue. Can anyone tell me Why I am not getting it?### Assistant: Do you have a Websphere MQ Server properly installed locally?\nI saw such behavior when only Websphere MQ Explorer is installed.\nIn this case the only point on step 2 is to add a remote Queue Manager.\n"} +{"text": "### Human: I am disconnecting from MQQueue and MQQueueManager with the following code:Queue.Close();\nlog.Info( \"Queue IsOpen: \" + Queue.IsOpen.ToString() );\nQueue = null;\n\nQueueManager.Disconnect();\nQueueManager.Close();\nlog.Info( \"QM IsOpen: \" + QueueManager.IsOpen.ToString() );\nlog.Info( \"QM IsConnected: \" + QueueManager.IsConnected.ToString() );\nQueueManager = null;And I get the following log entries for this:Queue IsOpen: false\nQM IsOpen: false\nQM IsConnected: falseBut after few hours when I runnetstat -ncommand from command prompt I get a long list of connections to MQ server and the State in those connections isCLOSE_WAIT.Any ideas why the TCP connections doesn't get fully closed? Are there any way that I could kill those from code? Currently I'll have to restart the client app which cleans up the open connections.WebSphere MQ version is 6.0.2.6 and the .NET libraries are from MQ 7.### Assistant: Looking in the Migration Guide there's a section calledUpgrading a WebSphere MQ client from Version 6.0 to Version 7.0which suggests a possible explanation. It states that as of v7 the TCP tuning is stored in the client configuration file. So if you have enabled TCP Keepalive in the Windows registry, the v7 client will ignore it. The format and location of the file is described inWebSphere MQ client configuration file.Of course for this to be the problem, there has to be a socket leak. You did not mention which version of WMQ V7 client you have but the Fix Pack README files do show a number of APARs related to socket leaks, failure to clean up after disconnects and so forth. None of these directly mention C# or .Net but there are enough problems around connection/disconnection issues to make it worth an upgrade.So first & easiest fix to attempt is to add TCP Keepalive to the client configuration file and see if it helps. Disable connection sharing while you are in there as well. It's not supposed to be a factor but then it's not supposed to leak sockets either. Can't hurt. Next is to applyFix Pack 7.0.1.2(latest as of this writing) and see if that fixes the problem. After that, it's PMR time. Hope that helps.\n"} +{"text": "### Human: I'm currently trying to send a bunch of simple messages to a queue with plain java.public AtomicReference doSend(String message, String queue){\n try (JMSContext context = connectionFactory.createContext()) {\n TextMessage textMessage = context.createTextMessage(message); \n final AtomicReference msg = new AtomicReference<>();\n msg.set(textMessage);\n log.info(\"Sending message to queue {}\", queue);\n context.createProducer().send(createDestination(context, queue), textMessage);\n log.info(\"Message sent to queue {}, messageId provided {}\", queue, msg.get().getJMSMessageID());\n return msg;\n }\n catch (Exception e) {\n log.error(\"Failed to send message to queue\",e);\n throw new SipJmsException(\"Failed to send message to queue\", e);\n }\n}\n\nprivate Destination createDestination(JMSContext context, String queue){\n log.debug(\"Creating destination queue {} connection\",queue);\n return context.createQueue(queue);\n}I send N messages in a row and logs show that JMSMessageId is always generated the same.[main] Sending message to queue TEST_QUEUE\n[main] Message sent to queue TEST_QUEUE, messageId provided ID:414d5120444556494d53514d20202020551c3f5d81619824\n[main] Sending message to queue TEST_QUEUE\n[main] Message sent to queue TEST_QUEUE, messageId provided ID:414d5120444556494d53514d20202020551c3f5d83619824etc.As far as I know JMSMessageId is supposed to be unique and it's collision causes problems.O'Reily book states:The JMSMessageID is a String value that uniquely identifies a message. How unique the identifier is depends on the vendor. The JMSMessageID can be useful for historical repositories in JMS consumer applications where messages need to be uniquely indexed.\nUsed in conjunction with the JMSCorrelationID, the JMSMessageID is also useful for correlating messages:\nString messageid = message.getJMSMessageID();So, why is MessageId not unique? (it's even the same between application runs).### Assistant: The message ids are unique, I marked the differing number with a*:414d5120444556494d53514d20202020551c3f5d81619824\n *\n414d5120444556494d53514d20202020551c3f5d83619824\n"} +{"text": "### Human: I build my 32 bit application file in windows 2008 server machine using visual studio 2010. this 32 bit application will useIBM wepshere MQ Client ( 7.5.0.3).while running in the debugging mode i am getting exception so i debugged using WinDbg softwaredump info is*******************************************************************************\n* *\n* Exception Analysis *\n* *\n*******************************************************************************\n\n*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\\Program Files (x86)\\IBM\\WebSphere MQ\\bin\\mqe.dll - \n\n\nFAULTING_IP: \nntdll32!RtlpCreateSplitBlock+47b\n77d23fcb 8b11 mov edx,dword ptr [ecx]\n\nEXCEPTION_RECORD: ffffffffffffffff -- (.exr 0xffffffffffffffff)\nExceptionAddress: 0000000077d23fcb (ntdll32!RtlpCreateSplitBlock+0x000000000000047b)\n ExceptionCode: c0000005 (Access violation)\n ExceptionFlags: 00000000\nNumberParameters: 2\n Parameter[0]: 0000000000000000\n Parameter[1]: 000000003b9ac9ff\nAttempt to read from address 000000003b9ac9ff\n\nCONTEXT: 0000000000000000 -- (.cxr 0x0;r)\neax=0adaff08 ebx=02960000 ecx=3b9ac9ff edx=00100000 esi=0ae2bf90 edi=02960174\neip=77d23fcb esp=079bd490 ebp=079bd4b4 iopl=0 nv up ei pl zr na pe nc\ncs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010246\nntdll32!RtlpCreateSplitBlock+0x47b:\n77d23fcb 8b11 mov edx,dword ptr [ecx] ds:002b:3b9ac9ff=????????\n\nFAULTING_THREAD: 000000000000046c\n\nPROCESS_NAME: MessageBroker.exe\n\nERROR_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%08lx referenced memory at 0x%08lx. The memory could not be %s.\n\nEXCEPTION_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%08lx referenced memory at 0x%08lx. The memory could not be %s.\n\nEXCEPTION_PARAMETER1: 0000000000000000\n\nEXCEPTION_PARAMETER2: 000000003b9ac9ff\n\nREAD_ADDRESS: 000000003b9ac9ff \n\nFOLLOWUP_IP: \nntdll32!RtlpCreateSplitBlock+47b\n77d23fcb 8b11 mov edx,dword ptr [ecx]\n\nNTGLOBALFLAG: 0\n\nAPPLICATION_VERIFIER_FLAGS: 0\n\nAPP: messagebroker.exe\n\nANALYSIS_VERSION: 6.3.9600.17298 (debuggers(dbg).141024-1500) amd64fre\n\n**BUGCHECK_STR: APPLICATION_FAULT_INVALID_POINTER_READ_ZEROED_STACK**\n\nPRIMARY_PROBLEM_CLASS: INVALID_POINTER_READ\n\nDEFAULT_BUCKET_ID: INVALID_POINTER_READ\n\nLAST_CONTROL_TRANSFER: from 0000000077d23c5a to 0000000077d23fcb\n\n**STACK_TEXT:** \n079bd4b4 77d23c5a 0ae2bf90 0adaff08 02960150 ntdll32!RtlpCreateSplitBlock+0x47b\n079bd5a0 77d23cfe 00000840 00000848 0ae2b74a ntdll32!RtlpAllocateHeap+0xb5d\n079bd624 74e04d83 02960000 00000000 00000840 ntdll32!RtlAllocateHeap+0x23a\n079bd644 008a8894 00000840 00000002 079bd800 MSVCR80!malloc+0x7a\n**WARNING: Stack unwind information not available. Following frames may be wrong.\n00000000 00000000 00000000 00000000 00000000 mqe+0x68894**\n\n\nSTACK_COMMAND: .cxr 0x0 ; kb\n\nSYMBOL_STACK_INDEX: 0\n\nSYMBOL_NAME: ntdll32!RtlpCreateSplitBlock+47b\n\nFOLLOWUP_NAME: MachineOwner\n\nMODULE_NAME: ntdll32\n\nIMAGE_NAME: ntdll32.dll\n\nDEBUG_FLR_IMAGE_TIMESTAMP: 51fb1072\n\nFAILURE_BUCKET_ID: INVALID_POINTER_READ_c0000005_ntdll32.dll!RtlpCreateSplitBlock\n\n**BUCKET_ID: X64_APPLICATION_FAULT_INVALID_POINTER_READ_ZEROED_STACK_ntdll32!RtlpCreateSplitBlock+47b**\n\nANALYSIS_SOURCE: UM\n\nFAILURE_ID_HASH_STRING: um:invalid_pointer_read_c0000005_ntdll32.dll!rtlpcreatesplitblock\n\nFAILURE_ID_HASH: {c09c2d45-666c-6fbd-b6fd-d9b79ba8c4fa}Above dump show that Mqe.dll(IBM WebSphere MQ dll) is passing invalid pointerBased on the above dump i am unable find the issue. The stack call very small so i am unable to find where my application calling MQ application ( Mqe.ddl).Please suggest me how to find the issue and how to debugging Mqe.dll.### Assistant: MQE.dll is quite possibly an innocent bystander here. It is definitely allocating memory viamalloc, and then the crash happens inside of the memory manager. This is typically a result of memory corruption that happened at some point in the past. Buffer overflow, underflow, or use-after-free are the typical reasons for heap corruption.Options to help track the issue down:Use!heap -vin WinDbg to perform a heap analysis on the minidump.Analyze the memory around where the memory manager is attempting to work, you may identify some know data (such as strings) that might give you hints as to who corrupted the memory.I would walk backwards in the assembly and figure out where the read address (0x3b9ac9ff) came from.The current registers may also contain pointers inside the heap where things are bad, you also use those as starting points for investigating.Rerun the application withPageHeapto try and catch an overflow immediately when it happens.Code review your allocations and uses of any heap memory.\n"} +{"text": "### Human: Schema:com.ibm.jms.JMSTextMessage jtm ---> f(javax.jms.Message m)I receive aJMSTextMessage, but my function parameter is an interface (Message).JMSTextMessageadded a function:getText()that doesn't exist inMessage.com.ibm.jms.JMSTextMessage implements javax.jms.MessageHow can I call thatgetText()method in myffunction? Is there a method / cast that has to be done?Of course thatm.getText()will not work becausegetText()doesn't exist inMessage.URLs:JMSTextMessageMessage### Assistant: If your m object is an instance of JMSTextMessage (you might want to have a instanceof call to check) then you can just cast it and then call the getText method like this:(JMSTextMessage)m).getText()However, you probably don't want to cast it to the actual implementation as this then restricts the portability of your code (i.e. you would have to rewrite your code for Weblogic for example). So it is better to cast your Message object to the javax.jms.TextMessage interface like this:(TextMessage)m).getText()\n"} +{"text": "### Human: I am trying to create a single connection factory, single JMS Listener and single JMS template for connecting, listening, sending data to multiple Queue Managers.I tried to access properties from yml file and running them in a loop inside MQConnectionFactory but it gets overridden by the last one.This is My configuration class which has logic for connecting to QM:@Configuration\npublic class QM1Config extends FixedBackOff {\n\n public String queueManager;\n public String queue;\n public String channel;\n public String connName;\n public String user;\n public String password;\n\n @Autowired\n MqServerConfig serverConfig;\n\n MQConnectionFactory mqQueueConnectionFactory;\n\n @Bean\n public MQConnectionFactory mqQueueConnectionFactory() {\n\n serverConfig.getActiveList().stream().map(systemName -> {\n return serverConfig.getHosts().stream().filter(host->host.getName().equalsIgnoreCase(systemName)).findFirst();\n }).filter(Optional::isPresent).forEach(host->{\n this.channel = host.get().getChannel();\n this.user = host.get().getUser();\n this.password = host.get().getPassword();\n this.queueManager = host.get().getQueueManager();\n this.queue = host.get().getQueue();\n this.connName = host.get().getConnName();\n System.out.println(channel+\" \"+connName+\" \"+queueManager+\" \"+user);\n mqQueueConnectionFactory = new MQConnectionFactory();\n try {\n\n mqQueueConnectionFactory.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n mqQueueConnectionFactory.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, false);\n mqQueueConnectionFactory.setCCSID(1208);\n mqQueueConnectionFactory.setChannel(channel);\n mqQueueConnectionFactory.setStringProperty(WMQConstants.USERID, user);\n mqQueueConnectionFactory.setStringProperty(WMQConstants.PASSWORD, password);\n mqQueueConnectionFactory.setQueueManager(queueManager);\n mqQueueConnectionFactory.setPort(host.get().getPort());\n mqQueueConnectionFactory.setHostName(host.get().getHost());\n } catch (Exception e) {\n e.printStackTrace();\n \n }\n });\n \n return mqQueueConnectionFactory;\n }\n\n\n @Bean\n public JmsListenerContainerFactory qm1JmsListenerContainerFactory(@Qualifier(\"mqQueueConnectionFactory\") MQConnectionFactory mqQueueConnectionFactory, DefaultJmsListenerContainerFactoryConfigurer configurer) throws InterruptedException {\n DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();\n factory.setExceptionListener(new MQExceptionListener());\n configurer.configure(factory, mqQueueConnectionFactory);\n return factory;\n }\n \n @Bean(\"jmsTemplate1\")\n public JmsTemplate jmsTemplate1(@Qualifier(\"mqQueueConnectionFactory\") MQConnectionFactory mqQueueConnectionFactory) {\n JmsTemplate jmsTemplate1 = new JmsTemplate(mqQueueConnectionFactory);\n return jmsTemplate1;\n }This is the Listener:@Component\npublic class QueueConsumer {\n \n @JmsListener(destination = \"${mq-processor.mq-server-list.hosts[0].queue}\" , containerFactory = \"qm1JmsListenerContainerFactory\")\n public void receive1(String text) {\n System.out.println(\"In Listener 1\");\n System.out.println(\"Received from qm1: \" + text);\n }\n \n @JmsListener(destination = \"${mq-processor.mq-server-list.hosts[1].queue}\" , containerFactory = \"qm1JmsListenerContainerFactory\")\n public void receive2(String text) {\n System.out.println(\"In Listener 2\");\n System.out.println(\"Received from qm2: \" + text);\n\n } \n}This is my YML file:mq-processor:\n mq-server-list:\n active-list: [FIRSTQM, SECONDQM]\n hosts:\n - name: FIRSTQM\n message-flow: inflow\n secure: true\n host: localhost\n port: 1417\n queueManager: QM5\n queue: Q5\n channel: AppToQM5\n user: MUSR_MQADMIN\n password: pakalu\n - name: SECONDQM\n message-flow: inflow\n host: localhost\n port: 1415\n secure: true\n queueManager: QM3\n queue: Q3\n channel: AppToQM3\n user: MUSR_MQADMIN\n password: pakaluI am able to connect to the last Queue Manager but the configurations of the previous one gets overridden with the approach I am following.While running application I get this error and I know why I am getting his error. I need help to resolve it so that it can listen to both the QM's.com.ibm.msg.client.jms.DetailedInvalidDestinationException: JMSWMQ2008: Failed to open MQ queue 'Q5'.\ncom.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2085' ('MQRC_UNKNOWN_OBJECT_NAME').Can anyone please help me with this. What do I need to do in order to have a single connection Factory, Listener and JMSTemplate for Multiple Queue Managers?### Assistant: A connection factory, in case of IBM MQ, will have connection information, like the queue manager name, host name, port number, channel among others for one queue manager. This is same for other messaging providers as well. You can think connection factory like an assembly line in automobile factory that produces one model of cars because the assembly line has been configured for that specific model. If the factory needs to produce another model, it will need to setup another assembly line.You can create seperate connection factories (and connection, session, consumer etc) for each of your queue managers.\n"} +{"text": "### Human: could you please guide on whether azure functions in c# can be used to receive messages from IBM MQ when a message is received in Queue### Assistant: You can use Azure Logic App with MQ Connector. Microsoft Connector for MQ sends and retrieves messages stored in an MQ Server on-premises, or in Azure. This connector includes a Microsoft MQ client that communicates with a remote IBM MQ server across a TCP/IP network.This documentis a starter guide to use the MQ connector.The MQ connector includes the following actions. There are no triggers.Browse a single message without deleting the message from the IBM MQ ServerBrowse a batch of messages without deleting the messages from\nthe IBM MQ ServerReceive a single message and delete the message\nfrom the IBM MQ ServerReceive a batch of messages and delete the\nmessages from the IBM MQ ServerSend a single message to the IBM MQ\nServerNote that the MQ Connector does not have any triggers. So, use another trigger to start your logic app, such as theRecurrence trigger.\n"} +{"text": "### Human: Hello im new on this type of software i had serch on Google about MQ but all what i find is that it can be install on linux windows xp ... \nso this may be stupid but is there any way to install MQ on windows server### Assistant: is there any way to install MQ on windows serverYes. If you have purchased it you should be able to download it for production use via IBM Passport Advantage, all the details can be seen here:https://www-01.ibm.com/support/docview.wss?uid=swg24043697If you only want to use it for personal developer use, you can use the free developer edition, which can be found here:https://developer.ibm.com/messaging/mq-downloads/So for clarity, 9.1 is the latest LTS (long term service) release, 9.1.1 is the latest CD (continuous delivery) release. Which is more useful depends on what you are trying to use. It is supported on a range of operating systems, including Windows.From the 9.1 SOE (System requirements), this is supported in windows server 2016 and windows server 2012r2 (that's the server o/s's as well Windows 10 and 8.1 for desktops). If you need older operating system support, you need to look at older MQ releases, such as 9.0*, 8.0* etc.\n"} +{"text": "### Human: So, I need to create a Websphere MQ setup in order to receive messages from an application hosted on a Websphere Application Server.I already created the JMS objects at MQ, using MQ Explorer. Also created the QM and the necessary queues. Ah, important info: The application user point-to-point communication.What is the purpose of the channels at Websphere? They are only used to link different Queue Managers or they can be used also to connect a client application to MQ?Which information the application must inform to connect to a queue at MQ?### Assistant: In IBM MQ (formerly WebSphere MQ), channels represent a communication link between two components. There are three distinct types of channels used in IBM MQ:Message channel, which is a unidirectional pathway between two Queue Managers.MQI channel, which is a bidirectional channel that connects an MQI (Message Queue Interface) client and a Queue Manager.AMQP channel*, which is again bidirectional and used to connect between an AMQP (Advanced Message Queuing Protocol) client and a Queue Manager.If you are new to IBM MQ, take a look at the IBM Redbook,WebSphere MQ Primer - An Introduction to Messaging and WebSphere MQ.'Channels' at the IBM Documentation for MQ:https://www.ibm.com/support/knowledgecenter/SSFKSJ_9.0.0/com.ibm.mq.explorer.doc/e_channels.htm*AMQP clients are supported from MQ v8.0.0.4 and above.\n"} +{"text": "### Human: I currently use very old version (1.3.0) of MQ API (com.ibm.mq.jar) in my project. I want to upgrade to latest MQ API. When serached on Google, I came to know that it was initially called MQSeries, later renamed to WebSphere MQ and now renamed it to IBM MQ. With the answer on similar questionhere, I got to know that latest version of IBM MQ client is 8.0.I have very little exposure on IBM MQ and I am curious to know following:One can get all the .jar files for specific version of MQ API with the corressponding MQ client version, right? i.e. once I install any client, there is \"\\java\\lib\" folder in which it has all required .jar files.What are the improvements in MQ API 8.0 over 7.5?Is Message Queue Interface just another name of MQ API?Can the same set of .jar files of any particular version e.g. 8.0 be used in Java application that run on Windows and Linux? Or is there different set of .jar files for Linux version?I saw two varients for IBM MQ client 8.0 - x64 and x86. When tried to install x86 on my Windows7 x64 OS, it gave me an error. That is ok and I understood that these are OS specific versions. But I would like to know compatibility of .jar files (MQ API) which I get from IBM MQ client 8.0 x64 with the following:Are these .jar files compatible on x86 OS?Are these .jar files compatible with JDK7 x86?I am interested in WebSphere MQ classes for Java and not WebSphere MQ classes for Java Message Service. I am using JDK7u79 on Windows7.I would really appreciate if any expert can comment on above points. Thanks.### Assistant: MQ API doesn't have a version number itself, the product (MQSeries / WebSphere MQ / IBM MQ) has the version number which defines what is in the MQ API for that version of the product. I'm not 100% sure what your quoted version number is applicable to since there isn't a V1.3 of the product. It sounds like a Java version perhaps?To answer your explicit question:-Yes, the correct jars for the release of the MQ Client you are using come with it and these are the ones you must use.There were very few, if any, changes to the MQ API in V8.0 over V7.5. There were certainly many other function changes to IBM MQ V8.0, it's just that they did not require extensions/changes to the MQ API. You can see an overview of the changes in IBM MQ V8.0here.Message Queue Interface (MQI) is the name of the procedural MQ API, used by languages such a the 'C' language or COBOL. There are also OO classes such as for Java or .NET and JMS classes.Since the jar files come with the client you install, you should just use the ones that came with the client on Windows, or the client on Linux. As of v8.0 there is a supported pure-Java installation consisting of just the jar files. Details are available atthis Technote. Use this client if the intent is to install jar files only. To make sure it is supported, install as per IBM's instructions.Again, this question suggests you are planning to move the jars around. If you use the ones that come with the client install you will be fine. @Calanais may be able to answer these last two Java related questions better than me.\n"} +{"text": "### Human: **0002bc2d SibMessage W [:] CWSJY0003W: JMSCC3036: An exception has been delivered to the\n connections exception listener: '\n Message : com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ1107: A problem with this connection has o\n ccurred. An error has occurred with the WebSphere MQ JMS connection. Use the linked exception to determine the cause of this e\n rror.\n Class : class com.ibm.msg.client.jms.DetailedJMSException\n Stack : com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:608)\n : com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:236)\n : com.ibm.msg.client.wmq.internal.WMQConnection.consumer(WMQConnection.java:851)\n : com.ibm.mq.jmqi.remote.internal.RemoteAsyncConsume.callEventHandler(RemoteAsyncConsume.java:1\n 023)\n : com.ibm.mq.jmqi.remote.internal.RemoteAsyncConsume.driveEventsEH(RemoteAsyncConsume.java:1381\n )\n : com.ibm.mq.jmqi.remote.internal.RemoteDispatchThread.run(RemoteDispatchThread.java:310)\n : com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.runTask(WorkQueueItem.java:209)\n : com.ibm.msg.client.commonservices.workqueue.SimpleWorkQueueItem.runItem(SimpleWorkQueueItem.j\n ava:100)\n : com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.run(WorkQueueItem.java:224)\n : com.ibm.ws.wmqcsi.workqueue.WorkQueueManagerImpl$WorkQueueRunnable.run(WorkQueueManagerImpl.j\n ava:648)\n : java.lang.Thread.run(Thread.java:738)\n Caused by [1] --> Message : com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED'\n ) reason '2009' ('MQRC_CONNECTION_BROKEN').\n Class : class com.ibm.mq.MQException\n Stack : com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:223)\n : com.ibm.msg.client.wmq.internal.WMQConnection.consumer(WMQConnection.java:851)\n : com.ibm.mq.jmqi.remote.internal.RemoteAsyncConsume.callEventHandler(RemoteAsyncConsume.java:1\n 023)\n : com.ibm.mq.jmqi.remote.internal.RemoteAsyncConsume.driveEventsEH(RemoteAsyncConsume.java:1381)\n : com.ibm.mq.jmqi.remote.internal.RemoteDispatchThread.run(RemoteDispatchThread.java:310)\n : com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.runTask(WorkQueueItem.java:209)\n : com.ibm.msg.client.commonservices.workqueue.SimpleWorkQueueItem.runItem(SimpleWorkQueueItem.j\n ava:100)\n : com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.run(WorkQueueItem.java:224)\n : com.ibm.ws.wmqcsi.workqueue.WorkQueueManagerImpl$WorkQueueRunnable.run(WorkQueueManagerImpl.j\n ava:648)\n : java.lang.Thread.run(Thread.java:738)\n '.Please can anybody explain what this exception means and why has this caused CPU starvation**### Assistant: Did you review your own logfile?JMSWMQ1107: A problem with this connection has occurred. An error has\n occurred with the WebSphere MQ JMS connection. Use the linked\n exception to determine the cause of this error.And further down it says:java.lang.Thread.run(Thread.java:738) Caused by [1] --> Message : \n com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with\n compcode '2' ('MQCC_FAILED' ) reason '2009'\n ('MQRC_CONNECTION_BROKEN').Did you look up MQ reason code 2009 in the MQ Information Center? Basically, it means the connection to the queue manager was lost and you need to reconnect.and why has this caused CPU starvationAny CPU starvation you are seeing has nothing to do with error but rather your code is not properly handling the error and is probably in a loop racing around and around in circles doing nothing.\n"} +{"text": "### Human: I have a consumer process which has to do heavy lifting, it is a process that takes more than 30 sec to complete. And we acknowledge the message when process is completed successfully. However, looks like queue is waiting for acknowledgement and as it does not receive the acknowledgement within time, it's putting the message back to queue and same message is consumed by other consumer instance. Are there any config that I can tweak?? I don't want to auto acknowledge the message as it's an important flow and autoscaling down of the cluster may cause message loss.I am looking if there is any config that can help me with it or is my understanding incorrect? I don't want same message getting consumed by more than one consumer. We're using IBM MQ in this instance.### Assistant: However, looks like queue is waiting for acknowledgement and as it\ndoes not receive the acknowledgement within time, it's putting the\nmessage back to queue and same message is consumed by other consumer\ninstance.Neither the queue nor the queue manager by itself puts the message back to the queue. There is one exception to that rule and that is if the client application crashes. If the queue manager determines that the application has crashed then it will rollback the message to the queue.Or are you saying that if the sending application does not receive an acknowledgement within a specified amount of time then it resends the same message? If that is the case, then tell the sending application to double or triple the wait time.\n"} +{"text": "### Human: Closed. This question needs to be morefocused. It is not currently accepting answers.Want to improve this question?Update the question so it focuses on one problem only byediting this post.Closed2 years ago.Improve this questionI am using IBM MQ and Java client application in my current assignment.I would like to know the logical relationship between IBM MQ components like queuemanager, queue, channel, and listenerTypes of channel and their practical usage.Would like to know about how queuemanager handles queues , channels and how listner listens for requests and forwards them to queue manager. Also it will be great if one explains flow between client application-mq queue manager and also the flow between two queue managers in mq hosted on two different machinesThanks,\nSagar### Assistant: Very broadly, a queue manager is a message broker -- it's a piece of software that hosts queues, etc. A queue manager is a thing you can start and stop. There can, in principle, be multiple queue managers on the same physical host.A queue is a named location which clients produce data to, and consume data from. This data is broadly referred to as messages. Each queue will belong to a specific queue manager.A channel is a connection definition -- it specifies the low-level parameters for communication between the client and the queue manager. These parameters include things like encryption methods.You ask about types of channel, but I suspect that the only type relevant to a Java programmer is the standard message channel, for which the IBM Classes For Java libraries provide a JMS interface. More recent MQ installations also have an AMQP channel which could, in principle, be used with an AMQP JMS library like Apache Qpid-JMS. However, I've never used the AMQP channel, and I'm not convinced it is widely used at present.A listener is a process that waits for connections from a client, and assigns them to the relevant queue manager.This is a huge oversimplification, however.Incidentally, many Java developers seem to struggle with IBM MQ because it pre-dates Java, and is described in a terminology that seems archaic. Java developers who havenoexposure to messaging middleware might (maybe) benefit from getting started with a messaging application like Apache ActiveMQ, that was designed for Java from the start. ActiveMQ concepts map reasonably easily onto MQ concepts, once the basic principles are understood.\n"} +{"text": "### Human: I have a hard time figuring out implementing IBM MQ Listener (on message event) using WMQ jars/code. \nI have seen JMS implementation where we have OnMessage method which gets executed whenever a message is received in a queue. I am looking for a similar option using WMQ Jars. I am going through MQGetMessageOptions class and MQC options but no luck so far. Any help would be appreciated.I am usingcom.ibm.mq-6.0.2.1.jarjar file.### Assistant: Summary:IBM MQ classes for JMS implement asynchronous message listener functionality (onMessage) using the underlying IBM MQ callback functionality since IBM MQ v7.0.The IBM MQ classes for Java do not support asynchronous message listener functionality (callback) at all.BackgroundCallback functionality was added to IBM MQ at v7.0 but IBM did not implement this feature in IBM MQ classes for Java.Please note that per the v9.0 Knowledge center page \"Using IBM MQ classes for Java\", IBM MQ Classes for Java have been functionally stabilized at the level shipped in IBM MQ Version 8.0. Since IBM MQ classes for Java didn't have this feature as of IBM MQ v8.0, it will not be added by IBM unless they change direction.The next step after IBM stabilizes a feature is deprecating the feature. It would not be advised to develop new applications with IBM MQ classes for Java, better to go with IBM MQ classes for JMS.AlternativeIf you really have a need to use IBM MQ classes for Java, you would need to poll the queue looking for messages instead of registering a callback to MQ. Note that since callback did not exist prior to MQ v7.0 the IBM MQ classes for JMS asynchronous message listener at MQ v6.0 and lower was implemented by polling the queue in background. IBM has always supported GET with a wait. Doing a simple loop that does a get with a wait of X amount of time, will only need to reach out to the queue manager as often as the wait times out or a new message lands on the queue.If you do a GET without a wait and then immediately do another GET without a wait, then this would be both expensive and not a recommended solution.The nice thing about a IBM MQ classes for JMS asynchronous message listener is that IBM has taken care of the hard work, you only need to write code to process the message, not the logic to obtain the message. Using the IBM MQ classes for JMS asynchronous message listener is in my opinion still a better approach than a properly written polling application because if nothing else you are not reinventing the wheel.Other APIsThere are of course other non-Java APIs that support callback.In C#, it has a similar situation, the original MQ.NET API (amqmdnet.dll) does not support callback, but the newer XMS.NET API (JMS like implementation in .NET) does support callback.The normal C API supports callback, but C++ does not. Anything that uses the C API libraries could technically support callback if they expose that functionality, but some things do not, for example pymqi is based on the C API libraries but does not support callback.\n"} +{"text": "### Human: I'm trying to find informations which explain how use IBM MQ with Katalon.However, I didn't found any informations about that...Do you know if it is possible? With a plugin? A custom Java/Groovy code?I hope that someone could give an answer to this question.### Assistant: You can add external librairies to your Katalon Studio (source), so you can easily write a producer / consumer in Java and then use them your test steps.You can useWebSphere MQ JMS Extensionsthat provides basic implementations.Hereis the javadoc of the package that contains everything you need, especiallyMQMessageProducerandMQMessageConsumer.\n"} +{"text": "### Human: I found several comparisons between Kafka and IBM MQ. But I didn't get all my answers yet. I have some conclusions and I need to confirm them. I know that IBM supports peer to peer. But, I'm comparing the Publisher\\Subscriber modes and let's say the same cluster size. I'm mainly about concerned how Kafka compares to IBM MQ in the following area:Scalability: Both scale horizontally. However, Kafka is more\nscalable especially when it comes to number of consumers since it's using one log for all consumers.Robustness: IBM MQ is more robust. Kafka is not stable at times and\nact clumsy. This is somehow surprised me.Throughput: Kafka has much more throughput. Although, IBM MQ has\nthroughput which enough for the vast majority of applications.Latency: I found contradictory opinions. Some people says kafka has\nless latency, while others says it has more.Availability: Both are very available.Fault tolerance: Both are fault tolerant. But Kafka wins here.Message persistence: Both persist messages. But kafka has better message persistent and it comes out of the box.Message replay: Both support message replay. I'm not sure which one is easier or better.Message ordering: Kafka only support ordering on partition level. IBM MQ supports on topic. Ordering can be done in kafka on topic level using keys.Security: Both support security. But IBM MQ has better security\nfeatures. Learning curve for devs and ops: Kafka has more training\nmaterials and less complected to learn for both devs and ops.Other: IBM MQ as a standard messaging queue is more feature rich than\nKafka. IBM MQ also support JMS which makes it more standard than\nKafka. On the other hand, Kafka fits better in big data\narchitectures, like Lambda. Also Kafka supports stream processing and\nhas connectors too.ConclusionKafka is preferred for applications which need crazy throughput or that requires integration in big data stack and where losing few messages is not a big deal. On the other hand, IBM MQ to be used in applications where robustness and stability is the key factor and that doesn't tolerate losing any messages.Note:Those are just my findings. They can be right or wrong. Please correct the wrong ones and add the missing points.### Assistant: It's very difficult to reduce a comparison of MQ and Kafka to a few bullet points. From my point of view, each has use cases which suit it particularly well. They both scale, but in different ways. They're both secure, but in different ways. They're both highly available, but in different ways. MQ doesn't do message replay. Kafka doesn't participate in global transactions.I would start with the use case and then see how well the characteristics of MQ and Kafka fit.\n"} +{"text": "### Human: As per MQ 7.5 client, minimum requirement is jdk 1.5 client want to connect with MQ. But my application is written in jdk 1.4 and client don't want to migrate application from 1.4 to 1.5. they are upgrading MQ client from 7.0.0 to 7.5. Please suggest if we have any alternate solution for this.### Assistant: This is really a question about managing software upgrades.Is it possible the client is moving to WMQ 7.5 because 7.0 has reached end of support?In that case the same business case can be made for JRE 1.4 end of support:http://www.oracle.com/technetwork/java/eol-135779.html\n"} +{"text": "### Human: There was a similar questionProcedure to migrate from IBM MQ to ActiveMQand it was closed, but I will try anyway.\nOur customers want to migrate from WebSphere MQ to Active MQ. In above mentioned question it was said that as for JMS such migration in theory will consist in apps re-configuration. Our customers say that their apps use auto-generated .bindings file. So, is it possible to make apps work with Active MQ just by editing .binding file and putting active mq's .jars to java classpath, or some other configuration is required?### Assistant: To check this , i tried the followinga) Create a WMQ bindings file use JMSAdmin. Once i created a QCF and Queue i was able to send a message via a JMS lookup and send a message.b) For the AMQ set up to generate a .bindings file , IBM had some sample code togenerate the bindings file.Once this was done i used exactly the same code to send a message and the message was perfectly sent to both AMQ and WMQHere is the sample code that i was able to interoperate.public void sendMessages() {\n\n ConnectionFactory connectionFactory;\n Connection con = null;\n Session session = null;\n MessageProducer producer = null;\n //create initial context properties\n Properties initialContextProperties = new Properties();\n initialContextProperties.put(\"java.naming.factory.initial\", \"com.sun.jndi.fscontext.RefFSContextFactory\");\n initialContextProperties.put(Context.PROVIDER_URL, \"file:/C:/JNDI-Directory/AMQ\");\n initialContextProperties.setProperty(\"transport.jms.security.authentication\", \"none\");\n\n try {\n InitialContext initialContext = new InitialContext(initialContextProperties);\n //create connection factory object\n //ivtQCF - created connection factory object in IBM-MQ\n connectionFactory = (ConnectionFactory) initialContext.lookup(\"confact2\");\n con = connectionFactory.createConnection();\n con.start();\n session = con.createSession(false, Session.AUTO_ACKNOWLEDGE);\n //localq - created queue in IBM-MQ\n Destination destination = (Destination) initialContext.lookup(\"dest\");\n producer = session.createProducer(destination);\n String msg = \"SAMPLE MESSAGE PLACED TO QUEUE\";\n TextMessage textMessage = session.createTextMessage(msg);\n producer.send(textMessage);\n con.close();\n session.close();\n producer.close();\n } catch (NamingException e) {\n throw new RuntimeException(\"Unable to send jms messages\", e);\n } catch (JMSException e) {\n throw new RuntimeException(\"Unable to send jms messages\", e);\n }\n }\n"} +{"text": "### Human: i am using Web sphere version 7.5,does that require System Broker for starting MQ service.How can i start MQ service when i access through Java code. Currently i am getting the following exceptions when access through a codeMQJE001: An MQException occurred: Completion Code 2, Reason 2009\nMQJE016: MQ queue manager closed channel immediately during connect\nClosure reason = 2009MQJE001: An MQException occurred: Completion Code 2, Reason 2009\nMQJE016: MQ queue manager closed channel immediately during connect\nClosure reason = 2009com.ibm.mq.MQException: MQJE001: An MQException occurred: Completion Code 2, Reason 2009MQJE016: MQ queue manager closed channel immediately during connect\nClosure reason = 2009the code i used is given belowpublic class Demo {\n private MQQueueManager _queueManager = null;\n public int port = 1422;\n public String hostname = \"192.168.1.5\";//IP OF HOST\n public String channel = \"QM_ORANGE.QM_APPLE\";//channel name\n public String qManager = \"QM_ORANGE\";//queue manager name\n public String inputQName = \"Q1\";//remote q type\n public String outputQName = \"QM_APPLE\";//queue manager\n\n public Demo() {\n super();\n }\n\n private void init(String[] args) throws IllegalArgumentException {\n // Set up MQ environment\n MQEnvironment.hostname = hostname;\n MQEnvironment.channel = channel;\n MQEnvironment.port = port;\n }\n\n public static void main(String[] args) {\n\n Demo readQ = new Demo();\n\n try {\n readQ.init(args);\n readQ.selectQMgr();\n readQ.read();\n readQ.write();\n } catch (IllegalArgumentException e) {\n System.out\n .println(\"Usage: java MQRead <-h host> <-p port> <-c channel> <-m QueueManagerName> <-q QueueName>\");\n System.exit(1);\n } catch (MQException e) {\n System.out.println(e);\n System.exit(1);\n }\n }\n\n private void read() throws MQException {\n int openOptions = MQC.MQOO_INQUIRE + MQC.MQOO_FAIL_IF_QUIESCING\n + MQC.MQOO_INPUT_SHARED;\n\n MQQueue queue = _queueManager.accessQueue(inputQName, openOptions,\n null, // default q manager\n null, // no dynamic q name\n null); // no alternate user id\n\n System.out.println(\"MQRead v1.0 connected.\\n\");\n\n int depth = queue.getCurrentDepth();\n System.out.println(\"Current depth: \" + depth + \"\\n\");\n if (depth == 0) {\n return;\n }\n\n MQGetMessageOptions getOptions = new MQGetMessageOptions();\n getOptions.options = MQC.MQGMO_NO_WAIT + MQC.MQGMO_FAIL_IF_QUIESCING\n + MQC.MQGMO_CONVERT;\n while (true) {\n MQMessage message = new MQMessage();\n try {\n queue.get(message, getOptions);\n byte[] b = new byte[message.getMessageLength()];\n message.readFully(b);\n System.out.println(new String(b));\n message.clearMessage();\n } catch (IOException e) {\n System.out.println(\"IOException during GET: \" + e.getMessage());\n break;\n } catch (MQException e) {\n if (e.completionCode == 2\n && e.reasonCode == MQException.MQRC_NO_MSG_AVAILABLE) {\n if (depth > 0) {\n System.out.println(\"All messages read.\");\n }\n } else {\n System.out.println(\"GET Exception: \"+e);\n }\n break;\n }\n }\n queue.close();\n _queueManager.disconnect();\n }\n\n private void selectQMgr() throws MQException {\n _queueManager = new MQQueueManager(qManager);\n }\n\n private void write() throws MQException {\n int lineNum = 0;\n int openOptions = MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING;\n try {\n MQQueue queue = _queueManager.accessQueue(outputQName, openOptions,\n null, // default q manager\n null, // no dynamic q name\n null); // no alternate user id\n\n DataInputStream input = new DataInputStream(System.in);\n\n System.out.println(\"MQWrite v1.0 connected\");\n System.out.println(\"and ready for input, terminate with ^Z\\n\\n\");\n\n // Define a simple MQ message, and write some text in UTF format..\n MQMessage sendmsg = new MQMessage();\n sendmsg.format = MQC.MQFMT_STRING;\n sendmsg.feedback = MQC.MQFB_NONE;\n sendmsg.messageType = MQC.MQMT_DATAGRAM;\n sendmsg.replyToQueueName = \"ROGER.QUEUE\";\n sendmsg.replyToQueueManagerName = qManager;\n\n MQPutMessageOptions pmo = new MQPutMessageOptions(); // accept the\n // defaults,\n // same\n // as MQPMO_DEFAULT constant\n\n String line = \"test message\";\n sendmsg.clearMessage();\n sendmsg.messageId = MQC.MQMI_NONE;\n sendmsg.correlationId = MQC.MQCI_NONE;\n sendmsg.writeString(line);\n\n // put the message on the queue\n\n queue.put(sendmsg, pmo);\n System.out.println(++lineNum + \": \" + line);\n\n queue.close();\n _queueManager.disconnect();\n\n } catch (com.ibm.mq.MQException mqex) {\n System.out.println(mqex);\n } catch (java.io.IOException ioex) {\n System.out.println(\"An MQ IO error occurred : \" + ioex);\n }\n\n }\n }i got the following error log\n9/24/2016 14:09:24 - Process(1956.7) User(MUSR_MQADMIN) Program(amqrmppa.exe)\n Host(ABHI-PC) Installation(Installation1)\n VRMF(7.5.0.2) QMgr(QM_ORANGE)AMQ9208: Error on receive from host Aneesh (192.168.0.7).EXPLANATION:\nAn error occurred receiving data from Aneesh (192.168.0.7) over TCP/IP. This\nmay be due to a communications failure.\nACTION:\nThe return code from the TCP/IP recv() call was 10054 (X'2746'). Record these\nvalues and tell the systems administrator.### Assistant: Your application is calling_queueManager.disconnect()inreadmethod. This closes the connection to queue manager. Then your application are callingaccessQueuemethod using the same disconnected _queueManager object. This will fail with connection error.Suggest you to removequeueManager.disconnect()fromreadmethod and then try.UPDATECouple of suggestions:1) Set the transport type to client by adding this lineMQEnvironment.properties.put(MQConstants.TRANSPORT_PROPERTY,CMQC.TRANSPORT_MQSERIES_CLIENT)2) Ensure the channel,QM_ORANGE.QM_APPLEyou are using is a Server Connection (SVRCONN) type channel.This question may be of help:MQ queue manager closed channel immediately during connect\n"} +{"text": "### Human: How to resolve error-'IBM WebSphere Explorer is already running(AMQ4574)'?\nI am getting this error while accessing IBM explorer through ssh.### Assistant: The issue is you cant have more than one explorer running under the same userid anymore...Read the following for the explanation and potential workaroundhttp://www-01.ibm.com/support/docview.wss?uid=swg21672390\n"} +{"text": "### Human: I am unable to connect IBM websphere MQ \nCan anyone tell me what are the initial setting need to be done in MQ to acces it from remote machine using simple java code?### Assistant: Besides the MQ samples shipped with the product, there is also a long list of Java & Java/JMS sampleshere.The recommended practice for MQ Java (non-JMS) is:Hashtable mqht = new Hashtable();\nmqht.put(CMQC.CHANNEL_PROPERTY, channelName);\nmqht.put(CMQC.HOST_NAME_PROPERTY, hostName);\nmqht.put(CMQC.PORT_PROPERTY, new Integer(portNumber));\ntry\n{\n MQQueueManager qMgr = new MQQueueManager(qMgrName, mqht);\n System.out.println(\"Successfully connected to \"+ qMgrName);\n}\ncatch (com.ibm.mq.MQException mqex)\n{\n System.out.println(\"MQException cc=\" +mqex.completionCode + \" : rc=\" + mqex.reasonCode);\n}\n"} +{"text": "### Human: I wanted to take backup of my MQ objects.The version of MQ is v6.0.1.0.OS version is Linux ip-10-0-0-136 2.6.32.19-0.3-ec2 #1 SMP 2010-09-17 20:28:21 +0200 x86_64 x86_64 x86_64 GNU/LinuxI downloaded MS03 and extracted the files as I wanted to run the command saveqmgr.When I want to compile makefile.linux I get the following error :/tmp> make -f makefile.linux\ngcc -c -DUNIX -Wall -o saveqmgr.o -I. -I/opt/mqm/inc saveqmgr.c\nmake: gcc: Command not found\nmake: *** [saveqmgr.o] Error 127How do I check what is Error 127? where do I check for errors ?The linker option set in makefile.linux isLCOPTS = -m64 -o $@ -L$(MQMLIB) -L. $(LIBS)\nLCOPTC = -m64 -o $@ -L$(MQMLIB) -L. $(LIBC)\n\n# MQM library directory\nMQMLIB = /opt/mqm/lib64Is there anything else I am missing ?### Assistant: See this table ofexit codes with special meaning.Error 127corresponds to the precedinggcc: Command not found. You apparently don't have gcc installed on your system, or you don't have it in yourPATHenvironment variable.\n"} +{"text": "### Human: what is bottom technical principles of IBM M Q Series? what is it's encapsulation? socket?Message Queue(Inter-Process Communication)? or what? some people know about that? help....Thanks### Assistant: WebSphere MQ uses an IBM proprietary wire protocol which is not publicly documented. However, it runs over TCP/IP, and can be inspected by a Wireshark filter for both WMQ v6 and v7.There's a protocol for use by low-bandwidth telemetry devices to talk to MQ called MQTT which is also proprietary but is documented by IBMhere.In the mainframe world the protocol rides on VTAM/APPC.\n"} +{"text": "### Human: I am using the@JmsListenerannotation from Spring JMS to consume messages from an IBM MQ queue, but when an exception occurs the database updates are not being rolled back. The JMS listener is only rolling back the MQ messages, i.e dequeuing the message and putting it back in the queue. How can I ensure that the database updates are also rolled back in this scenario?Sample code:@Service\n@Transactional\n@JMSListener(containerFactory=\"jmsListenerContainerFactory\",destination=\"ibm.mq.request\")\npublic class TestListener {\n\n public void receive message(String message) {\n \n 1: // convert message to object apply business logic\n\n 2: // insert into order_table;\n\n 3: // convert object back to string and put it into response queue\n 4: jmsTemplate.convertAndSend(\"ibm.mq.response\",message);\n }\n}When the listener starts, picks a message from MQ, converts it to anObject, applies some logic, and persists in the database.Issue: When an exception occurs at step 4, Listener picks up the same message (which indicates the message is still in the MQ) but the database insert did not roll back.Can someone help me how to roll back database insert/updates?JMS config file :@Bean\n public JmsTransactionManager jmsTransactionManager(MQConnectionFactory connectionFactory){\n return new JmsTransactionManager(connectionFactory);\n }\n\n @Bean\n public JmsTemplate jmsTemplate(MQConnectionFactory connectionFactory){\n JmsTemplate jmsTemplate = new JmsTemplate (connectionFactory);\n jmsTemplate.setSessionTransacted(true);\n return jmsTemplate;\n }### Assistant: TheJmsTransactionManageris only capable of managing transactions on the connections that are issued by the connection factory that it contains. In order to have synchronized transactions between JMS and your database, you will need to have a JTA transaction manager configured. This is best done by having the JTA transaction manager being thePlatformTransactionManager.With synchronized transactions, you will haveDUPS-OKfunctionality. The JMS message listener will start a transaction in a new transaction context. The JPA database persistence will then join the existing JTA transaction and there will be two transactions in the transaction context.\n"} +{"text": "### Human: There are two pgmsCOBOL CICS (Main PGM) which reads mq queue, triggers transaction and send response back.Cobol CICS DB2 (Sub PGM) which logs mq details to DB2 table which made in main PGM.The problem is when at the end of uow, only last inserted data into table(From Sub pgm) were committed but not previously inserted from previous calls.I tested with explicit commit also but results are same. But if we give syncpoint in PGM 2 which works but eventually collapses other updates done to vsam files from another sub pgms.Main Pgm (Read MQ, Write MQ) -> Sub Pgm( Logs MQ details (Q/R) to DB2 table) returns control back once inserted.Any help?### Assistant: OK -- with EXEC CICS LINK and both programs executing in the same CICS region, then the task automatically has transactionality across all resource managers, MQ as well as Db2. Your program can interfere with this by explicitly issuing the EXEC CICS SYNCPOINT command or the EXEC SQL COMMIT command.I'm not sure I'm clear on what you mean when you say \"triggers the transaction\" as an action in your main program. By \"transaction\" do you mean a unit of work/recovery or do you mean a new CICS task? How is this triggering accomplished?If your flow is simply:MQ message arrivesMain program begins execution (triggered by MQ message)Main program retrieves item from queueMain program LINKs to subprogramSubprogram issues INSERT to Db2 tableSubprogram returns to main programMain program sends MQ replyMain program retrieves next message from queueMain program LINKs to subprogramSubprogram issues INSERT to Db2 tableSubprogram returns to main programMain program sends MQ reply-- maybe repeat the GET, LINK, INSERT, RETURN, PUT sequence a couple of timesMain program returns/terminates normallyAt this point the Db2 table should have multiple inserted rows.You could optionally issue a SYNCPOINT/COMMIT after each MQ PUT command to cause the reply to flow immediately and commit the update to the Db2 table. (The original input MQ message is also permanently removed from the queue manager.)If you are still having a problem with these programs, try asking a colleague to review them to see where you might have introduced an error.If you think that CICS and/or Db2 are failing, you can open a case to IBM Support to get more assistance.\n"} +{"text": "### Human: I am upgrading my application from a regular java application to Spring boot application.I am connecting with an external application, using IBM MQ.At the old version i got anMQMessageobject and used only the feedback field. like this:MQQueue currQ = this.qMgr.accessQueue(\"myQueue\",MQC.MQOO_INQUIRE + MQC.MQOO_INPUT_SHARED + MQC.MQOO_FAIL_IF_QUIESCING);\n\nMQGetMessageOptions gmo = new MQGetMessageOptions();\ngmo.options = MQC.MQGMO_SYNCPOINT; \nMQMessage mqMsg = new MQMessage();\ncurrQ.get(mqMsg, gmo);\nSystem.out.println(\"feedback: \" + mqMsg.feedback);In my new code, I am usingJmsListener:@JmsListener(destination = \"myQueue\", containerFactory = \"jmsListenerContainerFactory\")\npublic void myQueueListener(String message) {\n System.out.println(\"feedback: \" + ???);\n}How do i get the feedback field?I have no control on the external application that sends the message.### Assistant: The chapterJMS fields and properties with corresponding MQMD fieldsexplains the header mapping. You have two options to access the headers (see alsothis answer), here is one of it:@JmsListener(destination = \"myQueue\", containerFactory = \"jmsListenerContainerFactory\")\npublic void myQueueListener(String message, @Header(\"JMS_IBM_Feedback\") Integer feedback) {\n System.out.println(\"feedback: \" + feedback);\n}\n"} +{"text": "### Human: I am currently tasked with sending data from a Java application to an IBM Message Queue.My understanding is that the IBM MQ implements the JMS spec and I therefore can talk to it using theartemis-jms-clientsince it also implements the JMS spec.Is this correct? Or do I need an IBM specific client?I was hoping to use ActiveMQ in testing since I cannot use the IBM MQ for this purpose.### Assistant: NO, it won't work but your code shouldn't be vendor specific (since it would only use the JMS API) and thus should be portable to IBM MQ once the proper classpath is set.\n"} +{"text": "### Human: I have 2 applications A and B, trying to send messages from both to one queue.\nPlaced a while loop at both places which is sending message to queue.\nif i start application A and start while loop it starts sending message to queue and consumer consumes message sent from A, now at same time if i start while loop from B application it doesn't publish messages to queue as consumer doesn't consumes any message sent from B.So can someone clear the doubt if messages are being sent at same time from multiple producers to single queue or not.PS- using IBM queue and using a single consumer.### Assistant: Yes, we can have multiple producers for single queue.\nMultiple producers can also publish messages at the same time.\n"} +{"text": "### Human: Hi I'm new on IBM MQ environment so I need your help....\nI need to develope a script that check an IBMMQ (outside my factory) queue to verify if there are messages waiting to be get from my application-server (I mean if my apllication-server lost the connection to IBMMQ for any reason, I want to be informed, in this mode I can take the correction).\nIf is possible I need the script in PowereShell or C#.\nThanks a lot.### Assistant: There is sample code that can get you started -https://github.com/ibm-messaging/mq-dev-patterns/blob/master/dotnet/dotNetGet.csreplace theCreateConsumermethod invocation withCreateBrowserie. the modified snippet becomesprivate void ReceiveMessagesFromEndpoint(IConnectionFactory cf)\n {\n IConnection connectionWMQ;\n ISession sessionWMQ;\n IDestination destination;\n IMessageBrowser browser;\n ITextMessage textMessage;\n\n // Create connection.\n connectionWMQ = cf.CreateConnection();\n Console.WriteLine(\"Connection created\");\n\n // Create session\n sessionWMQ = connectionWMQ.CreateSession(false, AcknowledgeMode.AutoAcknowledge);\n Console.WriteLine(\"Session created\");\n\n // Create destination\n destination = sessionWMQ.CreateQueue(env.Conn.queue_name);\n Console.WriteLine(\"Destination created\");\n\n // Create browser\n browser = sessionWMQ.CreateBrowser(destination);\n Console.WriteLine(\"Browser created\");\n\n ...Instructions on setup are available in the associated readme -https://github.com/ibm-messaging/mq-dev-patterns/blob/master/dotnet/README.md\n"} +{"text": "### Human: I'm trying to connect to an IBM WebSphere MQ 8.x, but what should be simple as it's with RabbitMQ seems so difficult on IBM world.I've created a Console Application (.NET Framework), referenced the amqmdnet.dll 8.0.0.10)and here's my snippetvar connectionName = \"X.X.X.X(4418)\";\n\n Hashtable properties = new Hashtable();\n properties.Add(MQC.CONNECTION_NAME_PROPERTY, connectionName);\n properties.Add(MQC.CHANNEL_PROPERTY,\"TEST_XXX_RECEIVER\");\n\n var mqQMgr = new MQQueueManager(\"DEFAULT.XXXMQCOL1\",properties );\n mqQMgr.Connect();What I got when trying to connect is IBM.WMQ.MQException: 'MQRC_Q_MGR_NAME_ERROR'For that concern the Queue name I've put the name I found on the nodeThe Channel property is a channel I've defined in the queue node of websphereI've tried to telnet on ip:port and it connectsAny suggestion?UPDATE #1Even if I do \"Start\" from context menu, it remains inactive, can this lead to the constructor's hang?UPDATE #2I've managed it. I was going wrong on two stepsI have the LISTENER.TCP stopped under the listenersI was pointing at 4418 which is the Queue Manager port and I had to point at 1414 (Listener.TCP port)Now I'm able to connect, admin you can close it### Assistant: You appear to be using sender and/or receiver channels. Use SVRCONN for clients\n"} +{"text": "### Human: I am able to establish connection to QManager using unsecure channel and was able to do what ever I want to do.But now I am trying to connect to the same QManage through secure channel; I have got the Security keys ( both public and private key ) generate from MQ server but I am not sure how to incorporate the key and establish MQ connection.I googled and found some answer which suggested the below approach but it didn't work.System.setProperty(\"javax.net.ssl.trustStore\",\"path to public key\");\nSystem.setProperty(\"javax.net.ssl.keyStore\",\"path to private key\");Exception I got.com.ibm.mq.MQException : MQJE001: Completion Code '2', Reason '2537'.I would appreciate some guidance or sample code on how to connect to QManager using security key.@JoshMc -- please find answer to your question belowAre you using IBM MQ Classes for Java or IBM MQ Classes for JMS?\nI am using IBM MQ Classes for JavaWhat version of IBM MQ are the jar files you are using from?Version 7What version of MQ is the queue manager you are attempting to connect to?Version 8Are you attempting to have MQ validate a client cert (Check the value of SSLCAUTH on the SVRCONN channel)Yes. I have public and private key generated from MQ server by MQ Admin (I have no access to MQ server) and need to use it to connect to the MQ server.Paste any errors that show up in the queue managers AMQERR01.LOG when you attempt to connect.I don't have access to the log file.Below is working code; I am able to connect to unsecure channel and send messagepublic void MQSender(){MQQueueManager QMgr = null; \n\n try {\n\n MQEnvironment.hostname = \"hostname\"; \n\n MQEnvironment.channel = \"UNSECURE\"; \n //MQEnvironment.channel = \"SECURE\";\n\n MQEnvironment.port = 8080;\n QMgr = new MQQueueManager(\"QManager\");\n\n int openOptions = MQConstants.MQOO_OUTPUT;\n MQQueue queue = QMgr.accessQueue(\"QNAME\",openOptions);\n\n MQPutMessageOptions pmo = new MQPutMessageOptions();\n pmo.options = MQConstants.MQPMO_LOGICAL_ORDER | MQConstants.MQPMO_SYNCPOINT;\n\n MQMessage message = new MQMessage();\n message.writeString(\"TEST\");\n queue.put(message, pmo);\n\n QMgr.commit();\n\n } catch (Exception e) {\n\n if(QMgr!=null){\n\n try {\n\n QMgr.backout();\n\n } catch (MQException e1) {\n\n e1.printStackTrace();\n }\n }\n\n e.printStackTrace();\n }}### Assistant: You are missing the option specifying the ciphersuite to use from your code:\nMQEnvironment.sslCipherSuiteThis knowledge center article may help:https://www.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q031220_.htmAnd do you have your trusted certs and private cert/key pair in JKS stores?\nThese should be more like:System.setProperty(\"javax.net.ssl.trustStore\",\"path to JKS file containing certificates required to validate server certificate\");System.setProperty(\"javax.net.ssl.keyStore\",\"path to JKS file containing certificate and private key of the client\");\n"} +{"text": "### Human: My issue is similar to :Spring JMS - IBM MQ has open input count issueI have set up my Message Driven Bean to have max-sessions 1 for sequential message delivery in Websphere. So i assume only one connection should be open to that queue. I do see that open input count is 2 some times. Some times its two different process as in the picture, sometimes its the same. Is it normal behavior of websphere? Please do advise. I am investigating a messsage re-ordering issue, this will be of great help.Websphere Version 8.5.1 and IBM MQ Version is 7.0\nMDB is configured via Activation Spec### Assistant: The 2 instances your queue is opened are different as one has the queue opened for browsing and the other has it open for destructive gets. So I don't really see how having it opened twice like these would affect the ordering of the messages.MQ doesn't guarantee the ordering of messages by default. If message ordering is really important you should use message groups, which explicitly define the ordering of messages in the MQMD of each message.Without message groups you need to meet a number of requirements to assume message ordering is kept by MQ.\n"} +{"text": "### Human: I need to pause the receiver queue some time (for process the already received messages) in ibm websphere queue through the ibm java api.### Assistant: If you want to stop Applications from being able to get messages from a Queue you can inhibit the Queue by setting theGETattribute on the Queue toDISABLED. This will still allow applications to put messages to the Queue but no applications will be able to get messages from the Queue. IF you want to stop messages from being able to be put to a queue you can do this by setting thePUTattribute toDISABLED.When you're ready for the applications to be able to get messages from the Queue again you set theGETattribute toENABLEDand applications will be able to get messages from the Queue.example MQSC command to setGETtoDISABLEDALTER QLOCAL('') GET(DISABLED)Be warned: If you inhibit the put or get on a Queue, applications attempting to put or get messages on that Queue will receive an error return code ofMQRC_PUT_INHIBITEDorMQRC_GET_INHIBITED. If you don't anticipate this your applications could fail.\n"} +{"text": "### Human: public string WriteMsg(string strInputMsg)\n {\n string strReturn = \"\";try\n {\n MQQueue queue = null;\n MQQueueManager QueueManagerName = null ;\n\n QueueManagerName = new MQQueueManager(\"GRBAAQM\");\n queue = QueueManagerName.AccessQueue(QueueName, MQC.MQOO_OUTPUT\n + MQC.MQOO_FAIL_IF_QUIESCING);\n\n message = strInputMsg;\n queueMessage = new MQMessage();\n\n queueMessage.WriteString(message);\n queueMessage.Format = MQC.MQFMT_STRING;\n\n queuePutMessageOptions = new MQPutMessageOptions();\n queue.Put(queueMessage, queuePutMessageOptions);\n\n strReturn = \"Message sent to the queue successfully\";\n }\n\n catch (MQException MQexp)\n {\n strReturn = \"Exception: \" + MQexp.Message;\n }\n\n catch (Exception exp)\n {\n strReturn = \"Exception: \" + exp.Message;\n }\n\n return strReturn;\n }\n\n public string ReadMsg()\n {\n String strReturn = \"\";\n\n try\n {\n MQQueue queue = null;\n MQQueueManager QueueManagerName = null;\n\n QueueManagerName = new MQQueueManager(\"GRBAAQM\");\n queue = QueueManagerName.AccessQueue(QueueName, MQC.MQOO_INPUT_AS_Q_DEF +\n MQC.MQOO_FAIL_IF_QUIESCING);\n\n queueMessage = new MQMessage();\n queueMessage.Format = MQC.MQFMT_STRING;\n\n queueGetMessageOptions = new MQGetMessageOptions();\n queue.Get(queueMessage, queueGetMessageOptions);\n\n strReturn =\n\n queueMessage.ReadString(queueMessage.MessageLength);\n }\n\n catch (MQException MQexp)\n {\n strReturn = \"Exception : \" + MQexp.Message;\n }\n\n catch (Exception exp)\n {\n strReturn = \"Exception: \" + exp.Message;\n }\n\n return strReturn;\n }These two methods in this program helps us to read the messages from queue and displays but how to insert this feature while reading message FROM queue, read only if the message count has reached 10.### Assistant: Why do you care how many messages are in the queue? MQ is NOT a database. If a message is in the queue then it should be processed. If you need to group messages together then have the sender use MQ's message grouping feature.Did you read about MQ triggering? A program can be triggered (started) based on a triggering event. i.e. Trigger-first, trigger-every & trigger-depth.\n"} +{"text": "### Human: I have got a task to send SOAP request from source A to destination B.But the problem is Source A is not ready until some time so I would send the request mimicking as if source A to Destination B. The actual problem I have is that IBM MQ is the transport layer being used to send from A to B.How can I achieve sending SOAP request onto MQ client and it delivers across the destination B.Do we need specialized tool to put SOAP message onto MQ? If so which are those tool's.Do I need to install any MQ client onto my local machine and point it towards destination B MQ client?### Assistant: You will need to use the SOAP JMS transport, with MQ as the JMS provider. You can either use client connections to an MQ queue manager, or use server connections.But either way, you need to use JMS to conform to the SOAP standard.\n"} +{"text": "### Human: THis is my first post on this forum. If I am not complying with protocols, please just let me know.C:\\>python --version\nPython 2.7.11OS: Windows version 7WMQ: 8.2I am trying to install Pythonpymqipackage. After couple hours of trying and searching the web for solutions I decided to post this question hoping to get some help. The following is the command I issue and the errors I am getting.C:>pip install pymqiCollecting pymqi\n Using cached pymqi-1.5.4.tar.gz\nRequirement already satisfied (use --upgrade to upgrade): testfixtures in c:\\python27\\lib\\site-packages (from pymqi)\nInstalling collected packages: pymqi\n Running setup.py install for pymqi ... error\n Complete output from command c:\\python27\\python.exe -u -c \"import setuptools, tokenize;__file__='c:\\\\users\\\\reyesv~1\\\\appdata\\\\local\\\\temp\\\\1\\\\pip\n-build-4qqnkt\\\\pymqi\\\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))\" install --rec\nord c:\\users\\reyesv~1\\appdata\\local\\temp\\1\\pip-u2jdz5-record\\install-record.txt --single-version-externally-managed --compile:\n Building PyMQI client 64bits\n running install\n running build\n running build_py\n creating build\n creating build\\lib.win-amd64-2.7\n creating build\\lib.win-amd64-2.7\\pymqi\n copying pymqi\\__init__.py -> build\\lib.win-amd64-2.7\\pymqi\n copying pymqi\\CMQC.py -> build\\lib.win-amd64-2.7\\pymqi\n copying pymqi\\CMQCFC.py -> build\\lib.win-amd64-2.7\\pymqi\n copying pymqi\\CMQXC.py -> build\\lib.win-amd64-2.7\\pymqi\n copying pymqi\\CMQZC.py -> build\\lib.win-amd64-2.7\\pymqi\n running build_ext\n building 'pymqi.pymqe' extension\n creating build\\temp.win-amd64-2.7\n creating build\\temp.win-amd64-2.7\\Release\n creating build\\temp.win-amd64-2.7\\Release\\pymqi\n C:\\Users\\reyesviloria362048\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe /c /nologo /Ox /MD /W3 /GS- /DND\nEBUG -DPYQMI_SERVERBUILD=0 \"-Ic:\\Program Files (x86)\\IBM\\WebSphere MQ\\tools\\c\\include\" -Ic:\\python27\\include -Ic:\\python27\\PC /Tcpymqi/pymqe.c /Fobuil\nd\\temp.win-amd64-2.7\\Release\\pymqi/pymqe.obj\n pymqe.c\n pymqi/pymqe.c(240) : error C2275: 'MQCSP' : illegal use of this type as an expression\n C:\\IBM\\WebSphere MQ\\tools\\c\\include\\cmqc.h(4072) : see declaration of 'MQCSP'\n pymqi/pymqe.c(240) : error C2146: syntax error : missing ';' before identifier 'csp'\n pymqi/pymqe.c(240) : error C2065: 'csp' : undeclared identifier\n pymqi/pymqe.c(240) : error C2059: syntax error : '{'\n pymqi/pymqe.c(247) : error C2065: 'csp' : undeclared identifier\n pymqi/pymqe.c(247) : error C2224: left of '.AuthenticationType' must have struct/union type\n pymqi/pymqe.c(248) : error C2065: 'csp' : undeclared identifier\n pymqi/pymqe.c(248) : error C2224: left of '.CSPUserIdPtr' must have struct/union type\n pymqi/pymqe.c(249) : error C2065: 'csp' : undeclared identifier\n pymqi/pymqe.c(249) : error C2224: left of '.CSPUserIdLength' must have struct/union type\n pymqi/pymqe.c(250) : error C2065: 'csp' : undeclared identifier\n pymqi/pymqe.c(250) : error C2224: left of '.CSPPasswordPtr' must have struct/union type\n pymqi/pymqe.c(251) : error C2065: 'csp' : undeclared identifier\n pymqi/pymqe.c(251) : error C2224: left of '.CSPPasswordLength' must have struct/union type\n pymqi/pymqe.c(256) : error C2065: 'csp' : undeclared identifier\n pymqi/pymqe.c(256) : warning C4133: '=' : incompatible types - from 'int *' to 'PMQCSP'\n error: command 'C:\\\\Users\\\\reyesviloria362048\\\\AppData\\\\Local\\\\Programs\\\\Common\\\\Microsoft\\\\Visual C++ for Python\\\\9.0\\\\VC\\\\Bin\\\\amd64\\\\cl.exe' fa\niled with exit status 2\n\n ----------------------------------------\nCommand \"c:\\python27\\python.exe -u -c \"import setuptools, tokenize;__file__='c:\\\\users\\\\reyesv~1\\\\appdata\\\\local\\\\temp\\\\1\\\\pip-build-4qqnkt\\\\pymqi\\\\se\ntup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))\" install --record c:\\users\\reyesv~1\\ap\npdata\\local\\temp\\1\\pip-u2jdz5-record\\install-record.txt --single-version-externally-managed --compile\" failed with error code 1 in c:\\users\\reyesv~1\\a\nppdata\\local\\temp\\1\\pip-build-4qqnkt\\pymqi\\### Assistant: You need to installMicrosoft Visual C++ compiler for Python 2.7\n"} +{"text": "### Human: We have application which is running in IBM WAS 7.x and using IBM MQ 7.x. We are planning to upgrade IBM MQ 7.x to 8.x without migrating WAS.We are using Java 6 compiled application and planning to upgrade to Java 7.I have below Questions for the same.Can IBM WAS 7.x can connect to MQ 8 without upgrading WAS ?Do we need to do anything on WAS 7.x to support Java 7 ?Any other things need to take care for MQ up-gradation ?Regards\nSubbanarasa Reddy### Assistant: WAS V7 (via the WMQ V7.0.1 JMS RA component that is included in the product) can connect to any IBM MQ queue manager, including V8 and V9 queue managers.However, I don't believe that WAS V7 supports a Java 7 runtime.If you must use Java 7, you should look to migrate to WAS V8.5 or V9.\n"} +{"text": "### Human: in a controlled environment where I don't have access to console to browse messages in MQ queues, I would like to have a Java program do it for me (browse and not consume messages). Has someone used any java API before which will browse the MQ messages? Any pointers to this will help.### Assistant: Hermes JMSis a great option, I used it as a separate installation (which I can't find now), however, it comes now embedded with SoapUI\n"} +{"text": "### Human: I am experiencing below MQ problem because of out of memory issue, still can't figure it out what is the root cause for this issue. please see the below exception and give some clues.[10/14/15 11:10:47:817 GMT+08:00] 000010e5 ConnectionEve A J2CA0056I: The Connection Manager received a fatal connection error from the Resource Adapter for resource qcf/qcfMORetry. The exception is: com.ibm.msg.client.jms.DetailedIllegalStateException: JMSWMQ1107: A problem with this connection has occurred. An error has occurred with the WebSphere MQ JMS connection. Use the linked exception to determine the cause of this error.:com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2202' ('MQRC_CONNECTION_QUIESCING').\n[10/14/15 11:10:47:882 GMT+08:00] 000010e5 SibMessage W [:] CWSJY0003W: JMSCC3034: The exception is ignored as no exception listener is registered: '\n Message : com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ1107: A problem with this connection has occurred. An error has occurred with the WebSphere MQ JMS connection. Use the linked exception to determine the cause of this error.\n Class : class com.ibm.msg.client.jms.DetailedJMSException\n Stack : com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:608)\n : com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:236)\n : com.ibm.msg.client.wmq.internal.WMQSession.disconnect(WMQSession.java:758)\n : com.ibm.msg.client.wmq.internal.WMQSession.close(WMQSession.java:718)\n : com.ibm.msg.client.jms.internal.JmsSessionImpl.close(JmsSessionImpl.java:498)\n : com.ibm.msg.client.jms.internal.JmsConnectionImpl.close(JmsConnectionImpl.java:295)\n : com.ibm.mq.jms.MQConnection.close(MQConnection.java:98)\n : com.ibm.ejs.jms.JMSManagedConnection.destroy(JMSManagedConnection.java:1147)\n : com.ibm.ejs.j2c.MCWrapper.destroy(MCWrapper.java:2054)\n : com.ibm.ejs.j2c.FreePool.cleanupAndDestroyMCWrapper(FreePool.java:748)\n : com.ibm.ejs.j2c.FreePool.getFreeConnection(FreePool.java:896)\n : com.ibm.ejs.j2c.PoolManager.reserve(PoolManager.java:2879)\n : com.ibm.ejs.j2c.PoolManager.reserve(PoolManager.java:2529)\n : com.ibm.ejs.j2c.ConnectionManager.allocateMCWrapper(ConnectionManager.java:1499)\n : com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.java:1011)\n : com.ibm.ejs.jms.JMSQueueConnectionFactoryHandle.createQueueConnection(JMSQueueConnectionFactoryHandle.java:85)\n : com.aviva.aol.messaging.adapter.MessageQueueAdapter.retryReceiveMsg(MessageQueueAdapter.java:234)\n : com.aviva.aol.messaging.adapter.MessageQueueAdapter.sendReceiveMessage(MessageQueueAdapter.java:186)\n : com.aviva.aol.integration.spi.TransactionProcessIntegrationImpl.jmsSendReceiveMessage(TransactionProcessIntegrationImpl.java:274)\n : com.aviva.aol.tr.manager.FundIntegrationImpl.getFundCurrentHoldingListSwitching(FundIntegrationImpl.java:1961)\n : com.aviva.aol.tr.manager.TransactionManagerImpl.getFundCurrentHoldingListSwitchingByAccountId(TransactionManagerImpl.java:887)\n : com.aviva.aol.tr.action.TransactionSwitchPendingEditPrepareAction.doAction(TransactionSwitchPendingEditPrepareAction.java:193)\n : com.aviva.framework.struts.CommonAction.execute(CommonAction.java:515)\n : org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)\n : com.aviva.framework.struts.StoryBoardRequestProcessor.processActionPerform(StoryBoardRequestProcessor.java:45)\n : org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)\n : com.aviva.framework.struts.StoryBoardRequestProcessor.process(StoryBoardRequestProcessor.java:104)\n : org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)\n : org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)\n : javax.servlet.http.HttpServlet.service(HttpServlet.java:595)\n : javax.servlet.http.HttpServlet.service(HttpServlet.java:668)\n : com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1214)\n : com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:774)\n : com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:456)\n : com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)\n : com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:125)\n : com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:92)\n : com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:46)\n : com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:192)\n : com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:89)\n : com.aviva.aol.common.servlet.XFrameXSSFilter.doFilter(XFrameXSSFilter.java:40)\n : com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:192)\n : com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:89)\n : com.aviva.aol.common.servlet.XSSFilter.doFilter(XSSFilter.java:24)\n : com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:192)\n : com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:89)\n : com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:926)\n : com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1023)\n : com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3703)\n : com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)\n : com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:962)\n : com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)\n : com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195)\n : com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)\n : com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)\n : com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)\n : com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:276)\n : com.ibm.ws.ssl.channel.impl.SSLConnectionLink.determineNextChannel(SSLConnectionLink.java:1049)\n : com.ibm.ws.ssl.channel.impl.SSLConnectionLink$MyReadCompletedCallback.complete(SSLConnectionLink.java:643)\n : com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1784)\n : com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)\n : com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)\n : com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)\n : com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)\n : com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)\n : com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)\n : com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)\n : com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1659)\n Caused by [1] --> Message : com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2009' ('MQRC_CONNECTION_BROKEN').\n Class : class com.ibm.mq.MQException\n Stack : com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:223)\n : com.ibm.msg.client.wmq.internal.WMQSession.disconnect(WMQSession.java:758)\n : com.ibm.msg.client.wmq.internal.WMQSession.close(WMQSession.java:718)\n : com.ibm.msg.client.jms.internal.JmsSessionImpl.close(JmsSessionImpl.java:498)\n : com.ibm.msg.client.jms.internal.JmsConnectionImpl.close(JmsConnectionImpl.java:295)\n : com.ibm.mq.jms.MQConnection.close(MQConnection.java:98)\n : com.ibm.ejs.jms.JMSManagedConnection.destroy(JMSManagedConnection.java:1147)\n : com.ibm.ejs.j2c.MCWrapper.destroy(MCWrapper.java:2054)\n : com.ibm.ejs.j2c.FreePool.cleanupAndDestroyMCWrapper(FreePool.java:748)\n : com.ibm.ejs.j2c.FreePool.getFreeConnection(FreePool.java:896)\n : com.ibm.ejs.j2c.PoolManager.reserve(PoolManager.java:2879)\n : com.ibm.ejs.j2c.PoolManager.reserve(PoolManager.java:2529)\n : com.ibm.ejs.j2c.ConnectionManager.allocateMCWrapper(ConnectionManager.java:1499)\n : com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.java:1011)\n : com.ibm.ejs.jms.JMSQueueConnectionFactoryHandle.createQueueConnection(JMSQueueConnectionFactoryHandle.java:85)\n : com.aviva.aol.messaging.adapter.MessageQueueAdapter.retryReceiveMsg(MessageQueueAdapter.java:234)\n : com.aviva.aol.messaging.adapter.MessageQueueAdapter.sendReceiveMessage(MessageQueueAdapter.java:186)\n : com.aviva.aol.integration.spi.TransactionProcessIntegrationImpl.jmsSendReceiveMessage(TransactionProcessIntegrationImpl.java:274)\n : com.aviva.aol.tr.manager.FundIntegrationImpl.getFundCurrentHoldingListSwitching(FundIntegrationImpl.java:1961)\n : com.aviva.aol.tr.manager.TransactionManagerImpl.getFundCurrentHoldingListSwitchingByAccountId(TransactionManagerImpl.java:887)\n : com.aviva.aol.tr.action.TransactionSwitchPendingEditPrepareAction.doAction(TransactionSwitchPendingEditPrepareAction.java:193)\n : com.aviva.framework.struts.CommonAction.execute(CommonAction.java:515)\n : org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)\n : com.aviva.framework.struts.StoryBoardRequestProcessor.processActionPerform(StoryBoardRequestProcessor.java:45)\n : org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)\n : com.aviva.framework.struts.StoryBoardRequestProcessor.process(StoryBoardRequestProcessor.java:104)\n : org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)\n : org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)\n : javax.servlet.http.HttpServlet.service(HttpServlet.java:595)\n : javax.servlet.http.HttpServlet.service(HttpServlet.java:668)\n : com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1214)\n : com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:774)\n : com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:456)\n : com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)\n : com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:125)\n : com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:92)\n : com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:46)\n : com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:192)\n : com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:89)\n : com.aviva.aol.common.servlet.XFrameXSSFilter.doFilter(XFrameXSSFilter.java:40)\n : com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:192)\n : com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:89)\n : com.aviva.aol.common.servlet.XSSFilter.doFilter(XSSFilter.java:24)\n : com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:192)\n : com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:89)\n : com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:926)\n : com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1023)\n : com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3703)\n : com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)\n : com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:962)\n : com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)\n : com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195)\n : com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)\n : com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)\n : com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)\n : com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:276)\n : com.ibm.ws.ssl.channel.impl.SSLConnectionLink.determineNextChannel(SSLConnectionLink.java:1049)\n : com.ibm.ws.ssl.channel.impl.SSLConnectionLink$MyReadCompletedCallback.complete(SSLConnectionLink.java:643)\n : com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1784)\n : com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)\n : com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)\n : com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)\n : com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)\n : com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)\n : com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)\n : com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)\n : com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1659)\n Caused by [2] --> Message : com.ibm.mq.jmqi.JmqiException: CC=2;RC=2009\n Class : class com.ibm.mq.jmqi.JmqiException\n Stack : com.ibm.mq.jmqi.remote.internal.RemoteHconn.enterCall(RemoteHconn.java:475)\n : com.ibm.mq.jmqi.remote.internal.RemoteHconn.enterCall(RemoteHconn.java:397)\n : com.ibm.mq.jmqi.remote.internal.RemoteHconn.enterCall(RemoteHconn.java:372)\n : com.ibm.mq.jmqi.remote.internal.RemoteFAP.MQDISC(RemoteFAP.java:2604)\n : com.ibm.msg.client.wmq.internal.WMQSession.disconnect(WMQSession.java:746)\n : com.ibm.msg.client.wmq.internal.WMQSession.close(WMQSession.java:718)\n : com.ibm.msg.client.jms.internal.JmsSessionImpl.close(JmsSessionImpl.java:498)\n : com.ibm.msg.client.jms.internal.JmsConnectionImpl.close(JmsConnectionImpl.java:295)\n : com.ibm.mq.jms.MQConnection.close(MQConnection.java:98)\n : com.ibm.ejs.jms.JMSManagedConnection.destroy(JMSManagedConnection.java:1147)\n : com.ibm.ejs.j2c.MCWrapper.destroy(MCWrapper.java:2054)\n : com.ibm.ejs.j2c.FreePool.cleanupAndDestroyMCWrapper(FreePool.java:748)\n : com.ibm.ejs.j2c.FreePool.getFreeConnection(FreePool.java:896)\n : com.ibm.ejs.j2c.PoolManager.reserve(PoolManager.java:2879)\n : com.ibm.ejs.j2c.PoolManager.reserve(PoolManager.java:2529)\n : com.ibm.ejs.j2c.ConnectionManager.allocateMCWrapper(ConnectionManager.java:1499)\n : com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.java:1011)\n : com.ibm.ejs.jms.JMSQueueConnectionFactoryHandle.createQueueConnection(JMSQueueConnectionFactoryHandle.java:85)\n : com.aviva.aol.messaging.adapter.MessageQueueAdapter.retryReceiveMsg(MessageQueueAdapter.java:234)\n : com.aviva.aol.messaging.adapter.MessageQueueAdapter.sendReceiveMessage(MessageQueueAdapter.java:186)\n : com.aviva.aol.integration.spi.TransactionProcessIntegrationImpl.jmsSendReceiveMessage(TransactionProcessIntegrationImpl.java:274)\n : com.aviva.aol.tr.manager.FundIntegrationImpl.getFundCurrentHoldingListSwitching(FundIntegrationImpl.java:1961)\n : com.aviva.aol.tr.manager.TransactionManagerImpl.getFundCurrentHoldingListSwitchingByAccountId(TransactionManagerImpl.java:887)\n : com.aviva.aol.tr.action.TransactionSwitchPendingEditPrepareAction.doAction(TransactionSwitchPendingEditPrepareAction.java:193)\n : com.aviva.framework.struts.CommonAction.execute(CommonAction.java:515)\n : org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)\n : com.aviva.framework.struts.StoryBoardRequestProcessor.processActionPerform(StoryBoardRequestProcessor.java:45)\n : org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)\n : com.aviva.framework.struts.StoryBoardRequestProcessor.process(StoryBoardRequestProcessor.java:104)\n : org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)\n : org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)\n : javax.servlet.http.HttpServlet.service(HttpServlet.java:595)\n : javax.servlet.http.HttpServlet.service(HttpServlet.java:668)\n : com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1214)\n : com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:774)\n : com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:456)\n : com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)\n : com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:125)\n : com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:92)\n : com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:46)\n : com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:192)\n : com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:89)\n : com.aviva.aol.common.servlet.XFrameXSSFilter.doFilter(XFrameXSSFilter.java:40)\n : com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:192)\n : com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:89)\n : com.aviva.aol.common.servlet.XSSFilter.doFilter(XSSFilter.java:24)\n : com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:192)\n : com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:89)\n : com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:926)\n : com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1023)\n : com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3703)\n : com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)\n : com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:962)\n : com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)\n : com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195)\n : com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)\n : com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)\n : com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)\n : com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:276)\n : com.ibm.ws.ssl.channel.impl.SSLConnectionLink.determineNextChannel(SSLConnectionLink.java:1049)\n : com.ibm.ws.ssl.channel.impl.SSLConnectionLink$MyReadCompletedCallback.complete(SSLConnectionLink.java:643)\n : com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1784)\n : com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)\n : com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)\n : com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)\n : com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)\n : com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)\n : com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)\n : com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)\n : com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1659)\n Caused by [3] --> Message : com.ibm.mq.jmqi.JmqiException: CC=2;RC=2195\n Class : class com.ibm.mq.jmqi.JmqiException\n Stack : com.ibm.mq.jmqi.remote.internal.RemoteRcvThread.run(RemoteRcvThread.java:597)\n : com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.runTask(WorkQueueItem.java:209)\n : com.ibm.msg.client.commonservices.workqueue.SimpleWorkQueueItem.runItem(SimpleWorkQueueItem.java:100)\n : com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.run(WorkQueueItem.java:224)\n :com.ibm.ws.wmqcsi.workqueue.WorkQueueManagerImpl$WorkQueueRunnable.run(WorkQueueManagerImpl.java:550)\n : java.lang.Thread.run(Thread.java:769)\n Caused by [4] --> Message : java.lang.OutOfMemoryError\n Class : class java.lang.OutOfMemoryError\n Stack :com.ibm.mq.jmqi.remote.internal.system.RemoteCommsBufferItem.(RemoteCommsBufferItem.java:84)\n : com.ibm.mq.jmqi.remote.internal.system.RemoteCommsBufferPool.allocBuffer(RemoteCommsBufferPool.java:107)\n : com.ibm.mq.jmqi.remote.internal.RemoteRcvThread.receiveOneTSH(RemoteRcvThread.java:709)\n : com.ibm.mq.jmqi.remote.internal.RemoteRcvThread.run(RemoteRcvThread.java:151)\n : com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.runTask(WorkQueueItem.java:209)\n : com.ibm.msg.client.commonservices.workqueue.SimpleWorkQueueItem.runItem(SimpleWorkQueueItem.java:100)\n : com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.run(WorkQueueItem.java:224)\n : com.ibm.ws.wmqcsi.workqueue.WorkQueueManagerImpl$WorkQueueRunnable.run(WorkQueueManagerImpl.java:550)\n : java.lang.Thread.run(Thread.java:769)### Assistant: The cause is that either the channel or the queue manager you are connecting to is being stopped:\ncompcode '2' ('MQCC_FAILED') reason '2202' ('MQRC_CONNECTION_QUIESCING')\n"} +{"text": "### Human: I am new to IBM WebSphere MQ. I am trying to connect to MQ using IBM.XMS dll in a plugin for Dynamics CRM and getting below error.Exception:Fatal error. Failed to initialize XMSFactoryFactory\nStack Trace: at IBM.XMS.XMSFactoryFactory.GetXmsFactory(Int32 connectionType)\nat IBM.XMS.XMSFactoryFactory.GetInstance(Int32 connectionType)\nat Mta.ACBPS.Mta.Crm.Plugins.PostMtaMessageCreate.GetConnection(IOrganizationService service, mta_mqconnection mqConnectionRecord, ITracingService tracer)\nInner Exception:System.InvalidCastException:Unable to cast object of type 'IBM.XMS.Client.Impl.XmsFactoryFactoryImpl' to type 'IBM.XMS.XMSFactoryFactory'.The source code isvar connectionfactory = (IConnectionFactory)null;\ntry\n{\nvar factoryfactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);\nconnectionfactory = factoryfactory.CreateConnectionFactory();\nconnectionfactory.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, mqConnectionRecord.mta_name);\nconnectionfactory.SetStringProperty(XMSC.WMQ_HOST_NAME, mqConnectionRecord.mta_HostIP);\nconnectionfactory.SetIntProperty(XMSC.WMQ_PORT, int.Parse(mqConnectionRecord.mta_Port));\nconnectionfactory.SetStringProperty(XMSC.WMQ_CHANNEL, mqConnectionRecord.mta_Channel);\nconnectionfactory.SetIntProperty(XMSC.WMQ_BROKER_VERSION, XMSC.WMQ_BROKER_V2);\nconnectionfactory.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT_UNMANAGED);\n\n}### Assistant: The obvious question is: have you installed MQ client or just copied IBM.XMS.DLL assembly from somewhere and using it? IBM.XMS has dependency on many other assemblies. Just having IBM.XMS assembly alone does not help.IBM XMS .NET client comes bundled with MQ client. So you must install MQ client. You can download latest MQ client fromhere.Once you install MQ client, refer the samples in \\Tools\\dotnet\\samples\\cs\\xms directory.Update based on commentI am wondering if you need to reference other XMS assemblies in your plugin so that CRM finds those dependent assemblies. As a starting point, you can referenceIBM.XMS.Client.ImplandIBM.XMS.Impland see if it helps.\n"} +{"text": "### Human: Closed. This question needs to be morefocused. It is not currently accepting answers.Want to improve this question?Update the question so it focuses on one problem only byediting this post.Closed8 years ago.Improve this questionI wanted to understand how can I use Web sphere MQ for the following scenario:1.How I can read the message from the queue without removing that message from the queue.\n2. We have a web application so we need the Listener to read the Queue. Is there any tool to do this ?### Assistant: Yes, it's possible to read message without removing from a queue, it's known as Browsing. You will need to create a browser consumer to read the messages. I have posted snippet here, same code is available inTools\\dotnet\\samples\\cs\\xms\\simple\\wmq\\SimpleQueueBrowser\\SimpleQueueBrowser.csalso.// Create connection.\n IConnection connectionWMQ = cf.CreateConnection();\n // Create session\n ISession sessionWMQ = connectionWMQ.CreateSession(false, AcknowledgeMode.AutoAcknowledge);\n // Create destination\n IDestination destination = sessionWMQ.CreateQueue(queueName);\n // Create consumer\n IQueueBrowser queueBrowser = sessionWMQ.CreateBrowser(destination);\n // Create message listener and assign it to consumer\n MessageListener messageListener = new MessageListener(OnMessageCallback);\n queueBrowser.MessageListener = messageListener;\n // Start the connection to receive messages.\n connectionWMQ.Start();Callback methodstatic void OnMessageCallback(IMessage message)\n {\n try\n {\n // Display received message\n Console.Write(message);\n }\n catch (Exception ex)\n {\n Console.WriteLine(\"Exception caught in OnMessageCallback: {0}\", ex);\n }\n }\n"} +{"text": "### Human: Im trying to set MCA user id in MQ explorer 7 on a channel .\nwhere do I get the value of the MCA ??### Assistant: The value you put in that field is the ID that will be used by the application connecting via the channel. That is a complex security issue which needs to be determined by your company. MQ channels need to be configured so they are secure and do not allow unwanted access.\n"} +{"text": "### Human: Is there a way to get the Correlation Id/ Message Id and store it into the variable? I want to put it into a variable and store it into the database.I'm thinking of using MQMD.MQMD *md;std::string corid = md->CorrelId;The code above is not functioning.Please help me with this. BTW, I'm using Websphere MQ for C++.Thanks! :)### Assistant: MessageID, CorrelID and GroupID are all byte arrays. Hence they can't be assigned the way you are trying to. Instead do the following to get messageID. You can try out similarly for CorrelationID and GroupID.if ( queue.get( msg, gmo ) ) \n {\n // Get the message id \n char byMessageId[24];\n ImqBinary msglId = msg.messageId();\n\n // Copy the message to a buffer.\n msglId.copyOut(byMessageId,24);\n }Hope this helped.\n"} +{"text": "### Human: I am sending a message from one queue to another queue, for example when in my input queue, if there is an empty message , then an actual message, when the code starts queuing, it doesn't send me the actual message once it sees the first empty message.Import queue:\n\n -> empty message\nTest -> actual messageThis is the piece of message am getting and sending.if (mqMsg.MessageLength > 0 && mqMsg.DataLength > 0)\n{\nmessageData = mqMsg.ReadString(mqMsg.MessageLength);\n}puttingmqQueue.Put(mqMsg, mqPutMsgOpts);this is how am implementing:while(if any message is available)\n{\n //go a read/get\n mqMsg = new MQMessage();\n mqGetMsgOpts = new MQGetMessageOptions();\n mqQueue.Get(mqMsg);\n if (mqMsg.MessageLength > 0 && mqMsg.DataLength > 0)\n {\n //posted to send method\n } \n}another method(send) - sends it.mqPutMsgOpts = new MQPutMessageOptions();\n mqQueue.Put(mqMsg, mqPutMsgOpts);How do i process this so that, the queue continues to send messages even when there is empty message ?### Assistant: Just checking for MessageLength is enough.if(mqMsg.MessageLength > 0)\n{\n // Send message to another queue.\n}But it's important to understand why there is a message with no body and fix that problem. Why would someone send a message that has no body?\n"} +{"text": "### Human: Closed.This question does not meetStack Overflow guidelines. It is not currently accepting answers.This question does not appear to be abouta specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic onanother Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.Closed6 years ago.Improve this questionI have been working on MQ installation in last couple of weeks. Now I need to automate MQ 7.5 installation using chef or powershell scripts. MQ installation for unix I got this URLhttps://github.com/ibm-messaging/mq-chefthrough chef. For windows I am not sure how to automate ? Please guide me or send me any articles to do that. Thanks advance!### Assistant: The IBM MQ 7.5 Knowledge center page \"Advanced installation using msiexec\" documents how to perform a automated install.ExampleHere is an example of a typical msiexec command. All parameters,\n separated by one or more spaces, must be typed on the same line as the\n msiexec call.msiexec\n/i path\\MSI\\IBM WebSphere MQ.msi\n/l*v c:\\install.log\n/q\nTRANSFORMS=1033.mst\nAGREETOLICENSE=yes\nADDLOCAL=Server\n"} +{"text": "### Human: Closed.This question is seeking recommendations for books, tools, software libraries, and more. It does not meetStack Overflow guidelines. It is not currently accepting answers.We don\u2019t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.Closed7 months ago.Improve this questionCan anyone share the ibm mq explorer software link, I am not getting the correct link.Thanksam not getting proper download link### Assistant: I'm not sure what you typed or are using but if you put \"ibm mq explorer\" into Mr. Google then the first hit is \"MS0T: IBM MQ Explorer\". As noted in the SupportPac, IBM now provides MQ Explorer viaFix Central.\n"} +{"text": "### Human: //ctx is InitialContext\nConnectionFactory cf = (ConnectionFactory) ctx.lookup(\"jms/CF\");\nConnection conn = cf.createConnection();\nconn.start();\n\nSession session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);\nQueue queue = (Queue) ctx.lookup(\"jms/MyQueue\");\nQueueBrowser qb = session.createBrowser(queue);\n\n//sadly, getting this enum is the best the JMS API can offer.\n//but the upside is the code is portable AND it can run over MQ and SIBus\n//implementations.\nEnumeration queueMessageEnum = qb.getEnumeration();\nint count = 0;\nwhile(queueMessageEnum.hasMoreElements()) {\n queueMessageEnum.nextElement();\n count++;\n}//how can i make this as soap web service so it can product queuedepth value### Assistant: If the current queue depth is for a GUi window then fine but do not ever consume messages based on current queue depth.There are 2 ways by Java (not Java/JMS) to retrieve the current queue depth: inquire on queue or MQ PCF command of MQCMD_INQUIRE_Q.If you want to use MQ PCF command then see my complete example here:How to display local queues where curdepth reached its maxdepth in ibm mqTo inquire on a queue, you simply do the following:MQQueue inQ = qMgr.accessQueue( qName, CMQC.MQOO_INQUIRE + CMQC.MQOO_FAIL_IF_QUIESCING)\nSystem.out.println(\"Current depth is \" + inQ.getCurrentDepth());\ninQ.close();Note: You can use the same code in a .NET application to inquire on a queue.\n"} +{"text": "### Human: I am new to IBM MQ with Apache camel. below is my configuration\n\n \n \nmy application is running in Spring Container. some time I am getting this below warning, hence My route is not working ( IBM MQ is not reading msg). for getting warning, Route is not working .Exceptionorg.springframework.jms.listener.DefaultMessageListenerContainer handleListenerSetupFailure\n WARNING: Setup of JMS message listener invoker failed for destination 'temporary' - trying to recover. Cause: User XXXXXX is not authorized to create: temp-queue://ID:IP Address-1:26:1\n Feb 20, 2015 2:59:07 AM org.springframework.jms.listener.DefaultMessageListenerContainer refreshConnectionUntilSuccessful\n INFO: Successfully refreshed JMS Connection\n Feb 20, 2015 2:59:08 AM org.springframework.jms.listener.DefaultMessageListenerContainer handleListenerSetupFailure\n WARNING: Setup of JMS message listener invoker failed for destination 'temporary' - trying to recover. Cause: JMSWMQ2008: Failed to open MQ queue 'SYSTEM.DEFAULT.MODEL.QUEUE'.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED').**I am using Active & IBM MQ, why Spring JMS Listener is throwing warning ?### Assistant: You should make sure you don't have request-reply specified asexchange pattern.I would explicitly state that the message should be \"InOnly\".\n If you intend to do a request/reply, then you need to make sure your WebSphere MQ user has rights to access SYSTEM.DEFAULT.MODEL.QUEUE.Something like this should allow authority:setmqaut -m QMGR -t q -n SYSTEM.DEFAULT.MODEL.QUEUE -g mygroup +dsp +inq +get\n"} +{"text": "### Human: I need a sample script which will clear IBM MQ queue below script use to clear rabbit MQ queue, for example:if [%1]==[] echo Queue Manager Profile was not specified && goto Usage\nif [%2]==[] echo Queue Name was not specified && goto Usage\n\ncd /D C:\\Capitalware\\MQBT\\\nmqbt.exe QLIST -p %1 -k %2 -t L -f qdepth.txt -D### Assistant: Your question is about scripting MQ Batch Toolkit (MQBT) for deleting messages from a queue. Note You could have sent a message to Capitalware Support (support@capitalware.com) for help.The QList function of MQBT is for generating a list of queues of the queue manager.Also, you appear to be posting only part of the script. Here is the entire sample Windows batch file calledClearQ.bat:@echo off\nsetlocal\n\nif [%1]==[] echo Queue Manager Profile was not specified && goto Usage\nif [%2]==[] echo Queue Name was not specified && goto Usage\n\ncd /D C:\\Capitalware\\MQBT\\\nmqbt.exe QLIST -p %1 -k %2 -t L -f qdepth.txt -D\nFOR /F \"tokens=1,2\" %%A in (qdepth.txt) DO (\n\n if %%B GTR 0 (\n mqbt.exe ClearQ -p %1 -q %%A\n )\n)\ndel qdepth.txt\ngoto :DONE\n\n:Usage\necho Usage: %0 QMgr_Profile_Name Queue_Name\ngoto :DONE\n\n:DONE\nendlocalSo, to run it and clear the contains of a single queue called TEST.Q1 of queue manager 'MQA1', you would do:ClearQ.bat MQA1 TEST.Q1So, to run it and clear the contains of all queues named TEST.* of queue manager 'MQA1', you would do:ClearQ.bat MQA1 \"TEST.*\"\n"} +{"text": "### Human: Is there anyway to clear the IBM Queue programatically? I want to clear all messages for some queues at a certain time everyday.### Assistant: You can write a simple program to consume all messages on the queue. If the IPPROCS and OPPROCS are both zero then you can write a program to issue the PCF ClearQ command or the runmqsc ClearQ command. I've written abouthow to do itand so have other MQ users. Try doing an internet search.\n"} +{"text": "### Human: Closed. This question isopinion-based. It is not currently accepting answers.Want to improve this question?Update the question so it can be answered with facts and citations byediting this post.Closed3 years ago.Improve this questionWe are using spring boot application with IBM MQ, so Which integration tool is better Apache camel or Spring integrationas I'm new for these technologies and it's higher priority decision so I'm making it a separate question, if it exists so could you please comment link then I will refer it.### Assistant: Please be aware that Apache Camel uses Spring JMS for the messaging component. So your are looking to use Spring JMS regardless of the other technologies. If you are looking at Camel and Spring Boot, have a look atSpring Boot - Camel - IBM MQ. This example makes good use of connection pooling.The example also uses JTA synchronized transactions for reliable message delivery (DUPS_OK mode, not XA). This can be difficult to achieve.\n"} +{"text": "### Human: I am new to MQ and as per my requirement i need to put 120 seconds in the Receive method to wait message and I written Java Jms standalone application.is it below line correct.Message message = queueReceiver.receive(120 * 1000);Thanks in Advance### Assistant: Short answer: YesLong answer:From the documentationhereParameters:\n timeout - the timeout value (in milliseconds)There are 120000 milliseconds in 120 seconds. So your maths of 120 * 1000 checks out.\n"} +{"text": "### Human: Below is the code which gives 400 bad request, tried various options with this but always ends up with 400 bad request, however the same works using OkHttp clientHttpHeaders hh = new HttpHeaders();\nRestTemplate rt = new RestTemplate();\nString reqBody = new ObjectMapper.writeValueAsString(\u201ctest msg\u201d); \nheaders.set(\u201cAccept\u201d, \u201ctext/plain\u201d); \nheaders.set(\u201ccontent-type\u201d,\u201dapplication/json\u201d); \nheaders.set(\u201cauthorization\u201d, \u201cBasic xxxxx\u201d); \nheaders.set(\u201cibm-mq-rest-csrf-token\u201d,\u201dblank\u201d); \nHttpEntity request = new HttpEntity<>(reqBody.toString()); \nResponseEntity result = rt.postForObject(url, request, Object.class);Below code works using okhttp### Assistant: Your content does not appear to be JSON, in both cases it appears to be plain text. Therefore the headerContent-Type: text/plainshould be used rather thanContent-Type: application/jsonI am unsure why this works in your OKHTTP example, unless perhaps the media type you use to build your post body somehow over-rides yourContent-Typeheader?\n"} +{"text": "### Human: I have to check the IBM MQ queue manager status before opening a queue.\nI have to create requestor app by checking that the QMgr is active or not then call put msg or get message from MQ\nIs it possible to check the status,please share some code snippets.Thanks### Assistant: You should NEVER have to check the QMgr before opening a queue. As I responded toa similar questiontoday, the design proposed is a very, VERY bad design. The effect is to turn async messaging back into synchronous messaging. This couples message producers to consumers, introduces location and resolution dependencies, breaks clustering, defeats WMQ's load distribution and balancing, embeds network topology into the application, and makes the whole system brittle. Please do not blame WMQ for not working correctly after intentionally defeating all its best features except the actual queue/dequeue operations.If your requestor app is checking that the QMgr is active, you aremuchbetter off using a multi-instance connection name and a layer of two or more functionally equivalent QMgrs that can access the cluster. So long as one of the QMgrs is up, the app will cycle between them until it finds one at which to connect.If your responder app is checking that the QMgr is active, you aremuchbetter off just attempting to connect. Responder apps shouldneverfail over to a different QMgr since doing so breaks transactionality and may leave queues unserviced. Instead just ensure that each queue has at least two input handles from local responder apps that do not fail over across QMgrs. (It is OK if the QMgr itself fails over using hardware clustering or multi-instance QMgr though).If the intent is to check that there's an open input handle on the queue before putting messages there a better design is to have the requesting app not care to which queue instance the messages are routed and instead use the instrumentation built into WMQ to either restart responder apps that lose their input handle, or to disable the queue when nothing's listening.\n"} +{"text": "### Human: I want to be able to enter a BankID into XML file and if record is exist then have integer result,if doesn't should display another resultMy code is written in IBM web sphere message broker toolkitPlease help me about this simple problem!!!!### Assistant: Try this:SET Environment.Variables.BankId =THE( SELECT BankId, FROM \n Database.YourSchema.YourTable where somecondition=true); \n\n IF EXISTS(Environment.Variables.BankId[]) THEN\n SET OutputRoot.XMLNSC.BankId= Environment.Variables.BankId[1] ;\nELSE\n\n SET OutputRoot.XMLNSC.BankId='SOMETHING ELSE';\n\nEND IF;\n"} +{"text": "### Human: We are running multiple instances of a windows service that reads messages from a Topic, runs a report, then converts the results into a PDF and emails them to a user. In case of exceptions we simply log the exception and move on.The use case we want to handle is when the service is shut down we want to preserve the jobs that are currently running so they can be reprocessed by another instance of the service or when the service is restarted.Is there a way of requeueing a message? The hacky solution would be to just republish the message from the consuming service, but there must be another way.When incoming messages are processed, their data is put in an internal queue structure (not a message queue) and processed in batches of parallel threads, so the IbmMq transaction stuff seems hard to implement. Is that what I should be using though?### Assistant: Your requirement seems to be hard to implement if you don't get rid of the \"internal queue structure (not a message queue)\" if this is not based on a transaction oriented middleware. The MQ queue / topic works well for multi-threaded consumers, so it is not apparent what you gain from this intermediate step of moving the data to just another queue. If you start your transaction with consuming the message from MQ, you can have it being rolled back when something goes wrong.\n"} +{"text": "### Human: I wrote code to connect remote MQ and download the message but sometime some message is missing . I'm posting my code . Can anyone tell me what is the error in this codeusing IBM.WMQ;\n\ninternal class MQReader\n{\n private static MQQueueManager queueManager;\n private static MQMessage queueMessage;\n private static MQGetMessageOptions queueGetMessageOptions;\n private static MQQueue queue;\n static string strReturn = \"\";\n static string message = \"\";\n static string mqexception = \"\";\n static string connerror = \"\";\n static string QueueName;\n static string QueueManagerName;\n static string ChannelInfo;\n static string channelName;\n static string PortNumber;\n static string transportType;\n static string connectionName;\n static bool running;\n static bool conresult;\n static string checkconnexp;\n static bool connerrorflag;\n static bool checkconnresult;\n\n public static bool connectMQ()\n {\n bool flag;\n QueueManagerName = ConfigurationManager.AppSettings[\"QueueManager\"];\n QueueName = ConfigurationManager.AppSettings[\"Queuename\"];\n ChannelInfo = ConfigurationManager.AppSettings[\"ChannelInformation\"];\n PortNumber = ConfigurationManager.AppSettings[\"Port\"];\n char[] separator = { '/' };\n string[] ChannelParams;\n ChannelParams = ChannelInfo.Split(separator);\n channelName = ConfigurationManager.AppSettings[\"Channel\"];\n transportType = ConfigurationManager.AppSettings[\"TransportType\"];\n connectionName = ConfigurationManager.AppSettings[\"ConnectionName\"];\n\n try\n {\n queueManager = new MQQueueManager(QueueManagerName,\n channelName, connectionName);\n queue = queueManager.AccessQueue(QueueName,\n MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING);\n connerror = \"Connected Successfully\";\n flag = true;\n }\n catch (MQException connectionexp)\n {\n connerror = \"Exception: \" + connectionexp.Message;\n logFile(connerror);\n flag = false;\n }\n\n return flag;\n }\n\n private static void logFile(string errormsg)\n {\n string path = ConfigurationManager.AppSettings[\"logFilePath\"];\n string fileName = path + \"MQLog\" + DateTime.Now.Date.ToString(\"yyyyMMdd\") + \".txt\";\n System.IO.File.AppendAllText(fileName, errormsg + Environment.NewLine);\n }\n\n public static void getMessage()\n {\n conresult = connectMQ();\n running = true;\n\n while (running)\n {\n if (conresult == true)\n {\n try\n {\n queueMessage = new MQMessage();\n queueMessage.Format = MQC.MQFMT_STRING;\n queueGetMessageOptions = new MQGetMessageOptions();\n queueGetMessageOptions.Options |= MQC.MQGMO_WAIT | MQC.MQGMO_FAIL_IF_QUIESCING;\n queueGetMessageOptions.WaitInterval = 60000;\n queue.Get(queueMessage, queueGetMessageOptions);\n message = queueMessage.ReadString(queueMessage.MessageLength);\n }\n catch (MQException exp)\n {\n mqexception = exp.Message;\n message = \"Exception: \" + mqexception;\n }\n\n if (message != \"Exception: \" + mqexception)\n {\n string path = ConfigurationManager.AppSettings[\"xmlFilePath\"];\n string fileName = path + \"MQMessage\" + DateTime.Now.ToString(\"yyyyMMddHHmmssfff\") + \".xml\";\n System.IO.File.WriteAllText(fileName, message); \n }\n else \n {\n logFile(message);\n queueManager.Close();\n queueManager.Disconnect();\n conresult = false;\n }\n }\n\n if (conresult == false)\n { \n conresult = connectMQ();\n }\n }\n }\n\n public void InitializeConnections()\n {\n getMessage();\n } \n\n public void StopIt()\n {\n queueManager.Disconnect();\n running = false;\n }\n}Sometimes message is not downloading or missing into local directory. All connection codes are credentials are coming from web.config.EDITPlease suggest any remote mq monitor tool which will log when message is sent into mq and when it's downloaded . Any power shell script or any tool anything will do fine .### Assistant: I'll be polite and only say 'Yuk' to that code.First off, C# is an object oriented language so you should learn how to use try, catch & finally.if (message != \"Exception: \" + mqexception)What is that? That is not how you do string comparison and why isn't that code in the try{} section?string fileName = path + \"MQMessage\" + DateTime.Now.ToString(\"yyyyMMddHHmmssfff\") + \".xml\";Hummm. You didn't lose your messages, you threw them away. What happens if you get 2 or more messages during the same millisecond?From the docs for Write\u200bAll\u200bText:Creates a new file, write the contents to the file, and then closes\n the file. If the target file already exists, it is overwritten.So, that means when you get 2 or more messages during the same millisecond the next one overwrites the previous one.\n"} +{"text": "### Human: I Want to push a message in IBM MQ Lite through java for that i write a code:\nIn that i use AQMP protocol as suggested By IBM MQ Lite Community. I want to try the same thing using the ftp protocol, I want to know weather it will work or not if it work what changes need to be done in my code.Here is my code:import com.ibm.mqlight.api.ClientOptions;\n\nimport com.ibm.mqlight.api.Delivery;\nimport com.ibm.mqlight.api.DestinationAdapter;\nimport com.ibm.mqlight.api.NonBlockingClient;\nimport com.ibm.mqlight.api.NonBlockingClientAdapter;\nimport com.ibm.mqlight.api.StringDelivery;\n\n\npublic class SendReceive2 \n{\n public static void main(String[] cmdline) \n {\n ClientOptions clientOpts = ClientOptions.builder().setCredentials(\"ad\", \"jms123\").build();\n\n\n\n NonBlockingClient.create(\"ftp://localhost\", clientOpts, new NonBlockingClientAdapter()\n {\n\n public void onStarted(NonBlockingClient client, Void context) \n {\n client.subscribe(\"JmsQueue\", new DestinationAdapter() \n {\n public void onMessage(NonBlockingClient client, Void context, Delivery delivery) \n {\n if (delivery.getType() == Delivery.Type.STRING)\n System.out.println(((StringDelivery)delivery).getData());\n }\n }, null, null);\n }\n }, null);\n\n\n\n\n\n NonBlockingClient.create(\"ftp://localhost\", clientOpts, new NonBlockingClientAdapter()\n {\n public void onStarted(NonBlockingClient client, Void context) \n {\n client.send(\"JmsQueue\", \"Jms Queue is Formed!\", null);\n }\n\n }, null);\n\n\n\n\n\n\n }//main\n\n\n}//class### Assistant: MQ Light only supports the amqp protocol.I also suggest you may want to check outMessage Hubwhich can work with MQ Light API\n"} +{"text": "### Human: Closed.This question does not meetStack Overflow guidelines. It is not currently accepting answers.Questions asking for code mustdemonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and theexpectedresults. See also:Stack Overflow question checklistClosed9 years ago.Improve this questionI am receiving following sting in properties from IBM MQ as message Id, I want to convert it back to original value in string or integer. Please help me do that.JMSMessageID=ID:c1d4d840d8e4c16dd4d8404040404040520b91682005a90d### Assistant: What you see afterJMSMessageID=IDi.e.c1d4d840d8e4c16dd4d8404040404040520b91682005a90dis the real (or original) message id. It is 24 byte long. You can't convert that into an integer.\n"} +{"text": "### Human: Now I am working on the IBM MQ 7.1 and this MQ has been installed into a Sun Solaris Server. All machine are unix OS.I have another two application server also Sun Solaris and both are running on different machine.AppServerA now is completely successfully connect to the MQ server with the ID as below :AppServerA\n group - app:54323\n id - mgr:200:54323AppServerB now is failed to connect to the MQ server with the reason code 2035 and with ID as below :AppServerB\n group - uat:54324\n id - uat:200:54324MQ server priviledges as below :group - mqm:54323\nid - mqm:200Primarily, I am suspecting that group ID is not same with the MQ server so that caused AppServerB cannot connect to MQ server.\nBut now I have reset the AppServerB login credentials to as below :AppServerB\n group - app:54323\n id - uat:201:54323After reset ID , it still failed to connect. Any idea ?**Last time worked on AIX server, this method was working fine when I faced the same issue.### Assistant: The queue manager error log will show the reason why you were given a 2035. The error will list the user ID in question and the problem with that user ID which caused the 2035:For example, lack of+putauthority or banned by CHLAUTH, et cetera.\n"} +{"text": "### Human: I didnt see enough examples on web using apache camel with websphere mq to send and receive messages. I had a example code but I got struck at the middle of code. could any one help on this..import org.apache.camel.CamelContext;\nimport org.apache.camel.Endpoint;\nimport org.apache.camel.Exchange;\nimport org.apache.camel.ExchangePattern;\nimport org.apache.camel.Producer;\nimport org.apache.camel.util.IOHelper;\nimport org.springframework.context.support.AbstractApplicationContext;\nimport org.springframework.context.support.ClassPathXmlApplicationContext;\n\n/**\n * Client that uses the Mesage Endpoint\n * pattern to easily exchange messages with the Server.\n *

\n * Notice this very same API can use for all components in Camel, so if we were using TCP communication instead\n * of JMS messaging we could just use camel.getEndpoint(\"mina:tcp://someserver:port\").\n *

\n * Requires that the JMS broker is running, as well as CamelServer\n */\npublic final class CamelClientEndpoint {\n private CamelClientEndpoint() {\n //Helper class\n }\n\n // START SNIPPET: e1\n public static void main(final String[] args) throws Exception {\n System.out.println(\"Notice this client requires that the CamelServer is already running!\");\n\n AbstractApplicationContext context = new ClassPathXmlApplicationContext(\"camel-client.xml\");\n CamelContext camel = context.getBean(\"camel-client\", CamelContext.class);\n\n // get the endpoint from the camel context\n Endpoint endpoint = camel.getEndpoint(\"jms:queue:numbers\");\n\n // create the exchange used for the communication\n // we use the in out pattern for a synchronized exchange where we expect a response\n Exchange exchange = endpoint.createExchange(ExchangePattern.InOut);\n // set the input on the in body\n // must be correct type to match the expected type of an Integer object\n exchange.getIn().setBody(11);\n\n // to send the exchange we need an producer to do it for us\n Producer producer = endpoint.createProducer();\n // start the producer so it can operate\n producer.start();\n\n // let the producer process the exchange where it does all the work in this oneline of code\n System.out.println(\"Invoking the multiply with 11\");\n producer.process(exchange);\n\n // get the response from the out body and cast it to an integer\n int response = exchange.getOut().getBody(Integer.class);\n System.out.println(\"... the result is: \" + response);\n\n // stopping the JMS producer has the side effect of the \"ReplyTo Queue\" being properly\n // closed, making this client not to try any further reads for the replies from the server\n producer.stop();\n\n // we're done so let's properly close the application context\n IOHelper.close(context);\n }}I got struck at this point of code..exchange.getIn()Do I have to useexchange.getOut()to send message?? and How to construct message using string and add headers to it.### Assistant: Welcome to stackoverflow!\nI am still not sure what exactly is the problem you are stuck at and it prevents me (and possibly others as well) in helping you resolve your roadblock.Perhaps you need to familiarize a bit more on what camel is and how it works.Camel in Actionis a great book to help you with that.If you are unable to get a copy at this point, apreviewof the first few chapters of the book is available online and it should give you much better leverage. Source code repository forchapter 2should give you some more ideas around how to process JMS messages.In addition to it. Please don't expect full blown solutions from StackOverflow. You may read this page onhow to ask a good question\n"} +{"text": "### Human: Closed. This question needs to be morefocused. It is not currently accepting answers.Want to improve this question?Update the question so it focuses on one problem only byediting this post.Closed4 years ago.Improve this questionI want to build listener using Java to pull data from IBM MQ once the data existing in the queue, anyone have the idea?.### Assistant: A few tips to get you started;How to ask questions:https://stackoverflow.com/help/how-to-askA bit on an IBM MQ listener here:https://github.com/ibm-messaging/mq-dev-samples/tree/master/jms/DemoMessageListenerApplicationIf you're new to writing apps for IBM MQ, check out the Developer Essentials badge:https://developer.ibm.com/messaging/learn-mq/mq-tutorials/mq-dev-essentials/\n"} +{"text": "### Human: Closed.This question is seeking recommendations for books, tools, software libraries, and more. It does not meetStack Overflow guidelines. It is not currently accepting answers.We don\u2019t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.Closed7 years ago.Improve this questionAs I am evaluating IBM MQ, I am looking for some technical details on its strengths and limitations.Maximum number of connectionsHow much high volume it can supportMaximum size of the message it supportsHow do I redoif message was lost due to client was offline? Examples?How do I apply transactions in the messages? Examples?Are there any examples to send / subscribe messages directly from\nmobile device?What are the strong features IBM MQ provides which are not available\nin other competitive JMS products (ex: Weblogic, Rabitt MQ, etc) ?### Assistant: This sounds like your boss asked you to do some research on MQ but instead you posted the questions here. Did you read any of the IBM RedBooks on MQ? Here is theMQ Primerwhich is a good starting point for beginners. Did you read theMQ Knowledge Center?You still need to do more research unless you want to hire me as a consultant (I'm not cheap!!) but here are some answers off the top of my head.Depends on the horsepower of the server. Years ago, I've had queue managers handling thousands and thousands of connections without issue.Again it depends on the horsepower of the server. On the mainframe, I know of customer moving hundreds of millions of messages per day without issue.Come on, that is the easiest thing to look up in MQ. (default is 4MB - max is 100MB otherwise use message grouping)Pub/Sub or Point-to-Point? For Pub/Sub use durable subscription and for P-2-P use persistent messages. Besides, MQ does NOT loose messages if the client application is not connected. It would be a pretty bad messaging system if it did - maybe you're using a bad one right now.You can have local UOW or 2 Phase UOW.Sure. Install MQ and select Samples then go and play around with the samples. Did you do any internet searches? TheMQ Telemetry Transport (MQTT) Programmingpresentation should have been at the top. Note: There are more presentations on MQTT atMQTC's web site. You can also find lots of MQ sampleshere.Ask your IBM sales rep.\n"} +{"text": "### Human: Anyone knows what JAR?? Im going to implement a connection pooling for MQ series connection.### Assistant: The jar is com.ibm.mq.jarYou can download it fromhttp://www.java2s.com/Code/JarDownload/com.ibm/com.ibm.mq.jar.zipOr if using maven\n com.ibm\n com.ibm.mq\n 5.3.07\n\n"}