wmq: how to create queue via mq client connected to queue manager - queue

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?

Have a look at SupportPac 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.

Related

MSMQ client support for linux

I have a use case where MSMQ server is running in our clients infrastructure and we have to receive messages sent by them on the MSMQ queue. I know MSMQ is a windows based system and will work best with windows but is there a way I can just get the messages in Linux ?
Thanks,
Anuj
The typical way to solve it is to bridge to some multi platform messaging product. ActiveMQ, RabbitMQ or whatnot. For that you probably need to write a small bridge service on a Windows server. So that all messages are relayed through "the multi platform broker".

MQ error code 2058 when connecting to queue manager JMS

I am trying to connect to Queue Manager using MQ api and I am able to connect to queue manager
MQQueueManager queueManager=new MQQueueManager(qmgrName);
queueManager.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 JMS
MQQueueConnectionFactory qcf=new MQQueueConnectionFactory();
qcf.setQueueManager(qmgrName);
qcf.setPort(1414);
qcf.setHostname("localhost");
qcf.createQueueConnection();
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 see Connection modes for IBM MQ classes for JMS which advises "To change the connection options used by the IBM MQ classes for JMS, modify the Connection Factory property CONNOPT." The acceptable values are provided on the page but you almost always want it to set for Standard Bindings (MQCNO_STANDARD_BINDING).
As documented here, MQRC 2058 means an invalid queue manager name or the queue manager name is unknown. But as you mention, bindings mode connection using MQ Base Java is successful, the queue manager name appears valid.
Update:
Sorry, I was mislead by your code and thought you are trying to do client mode connection using JMS. You don't need to set host and port for bindings mode connection.
Since the transport type is not set, default, WMQ_CM_BINDINGS is used. Suggest you to verify the queue manager name.
To connect with "BINDINGS", the queue manager needs to be local. Are you trying to connect to a remote queue manager? If so you would need to connect as "CLIENT". Also, check to be sure the qmgr is listening on the port you specified.

Is it possible to connect to Webpshere MQ?

I am having an incredibly difficult time finding any information by IBM on how to connect to our company's queue. Some more specific questions:
do I need the queue manage?
how do I know which queue connection factory to use?
how do I connect to the queue from a standalone java application?
I honestly can't find any MODERN, up-to-date resources explaining the websphere mq and how to make use of it (this includes within my own company).
Thanks!
You can connect to a queue manager in either binding mode or client mode. Binding mode allows an application to connect to the queue manager only when they are both running on the same machine. Client mode allows an application to connect to the queue manager when the two a running on separate machines. You can use client mode when they are both running on the same machine but its not as efficient as binding mode.
If you want to use binding mode then you only need to know the queue manager name.
If you want to use client mode then you will need to know the queue manager name, hostname, listener port number, and channel name.
The following URL provides some information on using JMS to connect to MQ:
http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q031500_.htm

Can I use 2 phase commit between 2 queue connections

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.
But I'm a little bit uncertain who is responsible of this Resouce.
IBM? 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.
wmq.jmsa.rar is released by IBM. Its found as part of the product. Go with the latest release WMQ 7.5 if possible.
WMQ 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_.htm
http://pic.dhe.ibm.com/infocenter/wmqv7/v7r5/index.jsp?topic=%2Fcom.ibm.mq.dev.doc%2Fq031500_.htm
You 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.

websphere MQ explorer on windows

I am a very beginner to WebSphere MQ world and this is what I'm looking for:
I have to create a simple system with 2 Machine (sender and receiver) to share messages on a queue:
PC 1 sender --> Queue --> PC 2 receiver
Both machines are Windows based and actually are on the same physical PC using virtualbox P1 (host) and PC 2 (guest)
Here is what I have done following online guides:
PC 1 sender:
Websphere MQ (full trial) installed
on MQ Explorer:
Queue Manager "QM.01" created
local Queue "Q.01" created with use=Transmission
channel sender "CH.01" created with queue=Q.01 and some doubts on connection which actually is 1414
PC 2 receiver:
only MQExplorer installed
try to create a remote queue manager with sender IP, 1414 port, and
CH.01 channel --> error 2539 (something wrong on PC 1 configuration
try to create a remote queue manager with sender IP, 1414 port, and
default SYSTEM.ADMIN.SVRCONN channel --> error 4036 (something wrong
with account authentication, I tryed to use the same "Adminitrator#PC
1" user. I've also tried to create the remote queue manager on PC 1
itself with the same result)
I suppose my error could be on PC 1 channel, its icon has a yellow or blue triangle and status=trying are not good.
Ps. forgive me if some setting name are not matching the English version, I have to translate them.
Now that I've been able to configure a remote QMgr on client PC I would learn how to write a simple program (maybe in Java) to read from a queue on the remote queue manager.
I've found a few guides but, before starting in Java, I tried to test amqsget and amqsput from command prompt.
There are no problems from the server machine (with Websphere full trial installed) but the console can't recognize the command from the client (with both Websphere client and MQ Explorer installed)
Where are my mistakes, or what passage have I missed?
When you have an application that needs to talk to a QMgr over the network, you create SVRCONN channels such as SYSTEM.ADMIN.SVRCONN. The application using a SVRCONN channel is able to open queues directly and put or get messages from them. There is no need to create a transmission queue or set USAGE=XMITQ in order for client applications to work.
When you have two QMgrs that need to communicate, you connect them using MCA channels. On the sending QMgr, these include SENDER, SERVER and CLUSTER SENDER. On the receiving QMgr there would include RECEIVER, REQUESTOR or CLUSTER RECEIVER channels. Any of the outbound channels (SDR, SVR or CLUSSDR) require a transmission queue.
In the example you described, there is only one QMgr therefore no SDR, SVR or CLUSSDR channel is required. You will need to use a SVRCONN such as SYSTEM.ADMIN.SVRCONN. You did not mention having defined a listener but apparently you did or else you would not have received a 2539 MQRC_CHANNEL_CONFIG_ERROR message. The reason you get 2539 is because you are attempting to connect with a client to a channel designed for QMgr-to-QMgr connections. The 4036 is because the configuration is incorrect.
Delete CH.01 and redefine it as a SVRCONN channel.
Alter Q.01 with USAGE=NORMAL
Configure WMQ Explorer to connect to CH.01.
As Shashi mentioned, take a look at some of the basic docs. These include...
Introduction to WebSphere MQ
Designing a WebSphere MQ architecture
The Quick Beginnings manuals have been broken up but the main sections are indexed here.
You may also wish to review the WMQ Security Lab for V7.1 and earlier posted at T-Rob.net. Although it is a security lab, it comes with scripts that build the lab environment, including SVRCONN and SDR/RCVR channel pairs, as well as an extensively illustrated lab guide.
Thank you for your response,
Following your indication I've understood I don't need two QMgr as I supposed,
but only one on the sending machine.
Therefore I have changed the query usage to normal, deleted the channel and leave other configuration by default:
SYSTEM.ADMIN.SVRCONN channel and LISTENER.TCP on 1414 port are automatically created.
I've tried also to redefine a channel named CH.01 as a SVRCONN channel
(Channel > new > server connection channel; and then choose between SYSTEM.ADMIN.SVRCONN, SYSTEM.AUTO.SVRCONN or SYSTEM.DEF.SVRCONN)
but unfortunately I wasn’t able to "Configure WMQ Explorer to connect to CH.01".
Anyway every attempt I have made to connect from the second PC are now ended with a AMQ4036 error; even if I’ve set in the CH.01 MCA Properties the ID user as my PC administrator and I have enabled the user identification on PC 2 as administrator#PC 1.
What I'm trying to achieve is to replicate an application used by company which receives data from a remote queue.
The queue connection specification given for test are: Server Name/IP, Port and Channel name.
This is the reason why I'm trying to replicate it creating a QMgr on the receiving PC, because when I tried with the default test information on my company machines it worked creating a QMgr with all the test queues avilable.
I'm now on holiday and I can't have more specific information about my company settings but I hope to be able to replicate a configuration like that.
Regards,
Flavio.