I been looking in google without success.
I´m connected to tibco machine by console, and I would like to rename a queue name.
show queue
Give me all the details of the queue. I would like to rename it.
AFAIK, You can't rename queues.
To achieve the same as "renaming" a queue you'd need to:
disconnect consumers from the old queue
create the new queue
move any pending messages from the old queue to the new one
create a bridge from the old q. to the new q.
reconnect consumers to the new queue
delete bridge and old queue when no longer referenced by any producer.
if you are in your own dev environment, just delete the old queue and create the new one (assume you don't care losing pending messages in that case)
Related
I am using circular logging. Because of human intervention, one of the
queue files is corrupted.
Since the circular logging is not having the ability of recovering the
corrupted queue files, what will be the next steps it will take?
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?
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 using runmqsc.
If additional queue recovery is required to make sure messages are not lost in such cases, linear logging is mandatory.
The queue manager is not going to create an new queue file automatically. If you truly have a corrupted queue then you may have to delete and recreate it. It would be helpful if you can provide more info about the error you see indicating the queue is corrupt. Also, what version of MQ are you using?
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.
I need to make sure only one message is consumed by the cluster.
I do not know the options to do this.
Is 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
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)
How would I set up MQ so that every message received is immediately written to file system?
I 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.
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 from SupportPac MO03 to 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 from SupportPac MA01 to 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 is here.
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 Infocenter
WMQ V7.1 Infocenter
WMQ V7.5 Infocenter
Can we rename a Queue without deleting and recreating it?
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 from SupportPac MO71 and the Q program from SupportPac MA01.
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?
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 the MirrorQ program might work for you.
You could change from using a queue to a durable topic and have both your reader and your browser subscribe to it.
You could also create a distribution list on your queue manager. A distribution list is used to send a copy of the same message to multiple queues. You would then have a processing queue and a browsing/monitoring queue.