What is the use of creating bridges in EMS - tibco

I am aware of how to create bridges in EMS
But
What is the use of creating bridges in EMS...instead of directly specifying the name of the destination queue or subscriber ..
Is it for reliability purposes ?
Kindly explain me with the "WHY" part of usings bridges in EMS with suitable examples
Thanks

I see many "why" for EMS bridges.
Of the top of my head:
Create a topic out of an existing (and currently used) queue
By bridging a topic to a queue, make a more versatile durable subscriber (more options)
The "Topic to queue" pipe and filter pattern: Imagine all your (EAI) modules. All shall read from a queue, and write to a topic. Connectivity is not done in BW (or another writing application), but directly in the EMS configuration with bridges. A message from module A needs to be read by module B and module C ? Simply create 2 bridges from the module A outbound topic to module B and C inbound queues. Done ! Now the code does NOT have to be edited to adjust routing, and every module "stack" is well maintained by the inbound queues. (even if the module is off-line)
Bridges are useful with routes (multiple EMS instances), because of message selector feature (a JMS feature, not EMS, but very helpful with bridges). If a message in one queue needs to be sent to ONE out of 3 different EMS instances, based on a JMS property... then use a bridge with a message selector. No need for code.
I got more ;-) Seriously, it is a cool feature of EMS.

Related

ActiveMQ: copy messages from broker to broker

We have a requirement to copy messages from one ActiveMQ broker to another. Here the message has to just copy and the message should exist in both broker.
I can think of a custom application that subscribes to a certain destination and read that message and re-post the messages to the destination in multiple brokers.
I do not have access to make changes in the Broker so I couldn't think of Network of Brokers option.
Is there any best practice or tools available to copy A-MQ messages from one broker to another?
Without having access to the target broker, as far as I know and I have read, I believe there is not shortcut to avoid the custom application that re-post those messages.
However, depending on the messages you want to re-post, there might be some functionalities offered by ActiveMQ that could facilitate your implementation (but they would not be for free, regarding the computational costs).
For example, in the case you want to copy ALL the messages sent through that broker to the other, then you might consider using Mirrored Queues, with a specific prefix (e.g. "copy"), that would allow you to just have a single consumer using a wildcard after that prefix (e.g. "copy.>"). That consumer would get ALL the messages sent to the broker, and it would simplify your implementation since you would just have to care about that single consumer and re-post from it. However this has costs, since as it is described in the documentation, enabling the mirrored queues will make a duplicate of each queue/topic in the system, and will post each message twice. You need to consider if this is an important inconvenient in your case, depending on the amount of messages and the available memory that your broker disposes.
In case you just wanted to copy SOME of the messages and not all, then I believe the most elegant way to handle it is by creating an abstraction of your Consumer class (or specific implementation), and use that special implementation for those queues you want to re-post. That class would be responsible of re-posting the messages to the other broker, in a way that would be transparent from the other Consumer class when using it.
I have talked above about consumers, but the same concept could apply to topics and subscribers. Hope these ideas help :)

Can IBM MQ internally route messages?

I'm an IBM MQ novice, however have used other messaging systems in the past (Solace, RabbitMQ, BizTalk). I apologize if some of my MQ terminology is incorrect when it comes to local/remote/transmission queues etc.
I am integrating with a 3rd Party using MQ. I have no control over the use of MQ when it comes to this 3rd party. They define the set integration pattern.
I have my own local Queue Manager.
The 3rd party supports many 100s of different message types.
Typically each message sent to them will result in a response
Responses on overage will be delivered back to my QM within 0.5s (agreed SLA)
The basic model is as follows;
For all outbound messaging I publish to a single queue
All responses come to a single inbound queue on my QM
I do not believe they respect/use the ReplyToQ or ReplyToQmgr header properties
High level overview of the use case;
The MQ usage will be very active. Perhaps 500-1000 outbound messages per second
For the vast majority of these - there will be a user waiting for a response
The current design approach is to put a message onto the outbound queue and then create a subscription to the inbound queue with a JMS selector using the correlation ID.
Here is my challenge;
I am not sure if having so many concurrently subscriptions all with a unique filter on the single inbound queue will perform well. I would appreciate insights into this. I have a 2 node cluster running in a docker container. I don't have details on the spec yet.
My preference would be have messages arrive into the inbound queue and then be routed to many "function" specific local queues on the QM.
I would still use JMS selectors on the message ID in this model - however I would hope the load would be spread from a single deep queue to many shorter queues
It does not seem that I could route messages natively within MQ without an addon such as MQ Integration Broker or ESB (some other products within the WebSphere suite).
It is on this last point I could use some guidance. Can I route within my QM? If so - what options do I have. Alternatively - perhaps there are much better approaches that I have not considered?
Any guidance would be heartily appreciated!!

JMS 2.0: Shared-Durable-Consumer on Topic vs Asynchronous-Consumer on Queue; Ref. Official GlassFish 4.0 docs/javaee-tutorial Java EE 7

Ref: Official GlassFish 4.0 docs/javaee-tutorial Java EE 7
Firstly, let us start with the destination-type of: topic.
As per GlassFish 4.0 tutorial, section “46.4 Writing High Performance and Scalable JMS Applications”:
This section describes how to use the JMS API to write applications
that can handle high volumes of messages robustly.
In the subsection “46.4.2 Using Shared Durable Subscriptions”:
The SharedDurableSubscriberExample.java client shows how to use shared
durable subscriptions. It shows how shared durable subscriptions
combine the advantages of durable subscriptions (the subscription
remains active when the client is not) with those of shared consumers
(the message load can be divided among multiple clients).
When we run this example as per “46.4.2.1 To Run the ShareDurableSubscriberExample and Producer Clients”, it gives us the same effect/functionality as previous example on destination-type of queue: if we follow “46.2.6.2 To Run the AsynchConsumer and Producer Clients”, points 5 onwards – and modify it slightly using 2 consumer terminal-windows and 1 producer terminal-window.
Yes, section “45.2.2.2 Publish/Subscribe Messaging Style” does mention:
The JMS API relaxes this requirement to some extent by allowing
applications to create durable subscriptions, which receive messages
sent while the consumers are not active. Durable subscriptions provide
the flexibility and reliability of queues but still allow clients to
send messages to many recipients.
.. and anyway section “46.4 Writing High Performance and Scalable ..” examples are queue style – one message per consumer:
Each message added to the topic subscription is received by only one
consumer, similarly to the way in which each message added to a queue
is received by only one consumer.
What is the precise technical answer for: why, in this example, the use of Shared-Durable-Consumer on Topic is supposed to be, and mentioned under, “High Performance and Scalable JMS Application” vs. use of Asynchronous-Consumer on Queue?
I was wonderign about the same issue, so I found out the following link. I understand that John Ament gave you the right reponse, maybe it was just too short to get a full understand.
Basically, when you create a topic you are assuming that only the subscribed consumers will receive its messages. However processing such a message may requires a heavy processing; in such a cases you can create a shared topic using as much threads as you want.
Why not use a queue? The answer is quite simple, if you use a queue only one consumer will be able to handle such a message.
In order to clarify I will give you an example. Let's say a federal court publishes thousand of sentences every day and you have three distinct applications that depends on it.
Application A just copy the sentences to a database.
Application B parse the sentence and try to find out all relation between people around all previously saved sentences.
Application C parse the sentence and try to find out all relation between companies around all previously saved sentences.
You could use a Topic for the sentences, where Application A, B and C would be subscribed. However it easy to see that Application A can process the message very quicly while Application B and C may take some time. An available solution would consist of create a shared subscription for application B and another one to application C, so multiple threads could act on each of them simultaneouly...
...Of course there are other solutions, you could for example use a unshared topic (i.e. a regular one) and post all received messages on a ArrayBlockingQueue that would be handled by a pool of threads some time later; howecer in such a decision the developer would be the one to worry about queue handling.
Hope this can help.
The idea is that you can have multiple readers on a subscription. This allows you to read more messages faster, assuming you have threads available.
JMS Queue :
queued messages are persisted
each message is guaranteed to be delivered once-and-only-once, even no consumer running when the messages are sent.
JMS Shared Subscription :
subscription could have zero to many consumers
if messages sent when there is no subscriber (durable or not), message will never be received.

WMQ replicate message to another queue

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?
Does WMQ have support for queue copy?
Note : The queues reside on different queue managers.
Thanks,
Hudson
If you have multiple consumers(Queues), which needs the same message, then Publish-Subscribe is made exactly for this purpose.
You can refer here for details about pub-sub.
If you are using Websphere MQ 7.XX, then you can use an Alias queue to publish the 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 as Topic and 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.
If you don't want to bother with all of the Pub/Sub stuff, then have a look at the free open source project Message Multiplexer (MMX) at http://www.capitalware.biz/mmx_overview.html
Its purpose is to read messages from a source queue and put the exact same message to 'n' target queues (up to 99).
The download contains builds for AIX, HP-UX, Linux, IBM i (OS/400), Solaris, Windows and z/OS (mainframe).
MMX is a very simple and straight-forward program to use.

WebSphere MQ/MQSeries - Possible to send a message to multiple queues with single call?

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,
Jeff
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 the Infocenter. In particular, the "What's New in V7" section and the sections on Pub/Sub.
You can accomplish this using "Distribution Lists" in WebsphereMQ. These have to be configured on your queue manager.
Take a look at the Wesbphere MQ Application Programming Guide for more info.

Resources