How to publish messages to a virtual topic in AMQP - activemq

I published messages to a topic in ActiveMQ using AMQP with the SenderLink API. I used the node address pointing to topic://topicname.
For VirtualTopic I went through this documentation. Changing the configuration as noted and renaming the topic name to VirtualTopic.TopicName is not publishing the messages on to queue.
Should the node address be different? Am I missing anything here?

The queue must exist before the message is produced.

Related

what is exactly Publisher confirms in Rabbitmq?

I read the official document of Rabbitmq, it is not really clear for me what was that?
its something like Consumer Ack but with a difference that the Publisher Confirm is send by rabbitmq server to Publisher client when the server get the message from publisher client?
Can someone explain more about it?
thanks in advance.
its something like Consumer Ack but with a difference that the
Publisher Confirm is send by rabbitmq server to Publisher client when
the server get the message from publisher client?
Yes. When you enable publisher confirms, and your publisher receives acknowledgement that the message is published, you can be certain of it.
Without publisher confirms, you can lose messages in several cases. One example: your application could publish the data to the TCP buffer, but then crash, or the server itself could crash. Another example: a network device could fail mid-delivery. Another example: RabbitMQ itself could crash after receiving the TCP data containing your message.
NOTE: the RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.

How to use activemq wildcards for sending messages

I try to send message to multiple queues according this documentation ActiveMQ Wildcards. The idea is to send message to PRICE.> queue and receive them in queues PRICE.STOCK.NASDAQ.ORCL and PRICE.STOCK.NYSE.IBM (queues are created). But instead of forwarding messages to PRICE.STOCK.NASDAQ.ORCL and PRICE.STOCK.NYSE.IBM activemq create new queue PRICE.> that become this message.
I tried to send message with activemq admin tool (send mask) and spring boot application. Behavior is the same - message is placed in new created queue PRICE.>.Activemq was not additionally configured, I'm using configuration provided with activemq 5.15.7.
The feature is only supported for subscribers, you need to send to a specific named destination when publishing a message. You can use the Virtual Destinations feature of ActiveMQ to define a target destination that forwards to some defined set.

How to know in Objective C if a message is already sent to the rabbitmq server?

I am using rabbitmq client (https://github.com/rabbitmq/rabbitmq-objc-client). I wanted to notify whether or not a message is sent to the rabbitmq server, but I couldn't find anything related to whether or not the message is really sent.
Could someone tell me how to know if I publish a message to a queue and the message really arrives to the rabbitmq server?. Thanks in advance !
Kinh
Publisher acknowledgments are on the amqp level, handled by RMQ itself. In the "API" level you may get a exception or a return value or some indication depends on the library.
Quote from the aforementioned link:
For unroutable messages, the broker will issue a confirm once the
exchange verifies a message won't route to any queue (returns an empty
list of queues). If the message is also published as mandatory, the
basic.return is sent to the client before basic.ack. The same is true
for negative acknowledgements (basic.nack).
For routable messages, the basic.ack is sent when a message has been
accepted by all the queues. For persistent messages routed to durable
queues, this means persisting to disk. For mirrored queues, this means
that all mirrors have accepted the message.

Can topic messages be made persistent in activemq?

I am very new to JMS and ESB.
I am using activemq as JMS and mule as ESB. When i am forwarding the messages from one queue to another with jms connector parameter "persistentDelivery" as "true" it retains the messages in the target queue after activemq re-start. But in case of forwarding messages from one topic to another,the messages are not retained in the target topic after restart.
Is there any limitation for persistence of messages in case of topic in activemq?
Thanks in advance.
Regards,
Arijit
topics are different in that messages are only retained if there is a durable consumer.
see these for more info...
http://activemq.apache.org/how-do-durable-queues-and-topics-work.html
http://stefanlearninglog.blogspot.com/2009/07/persistent-jms-topics-using-activemq.html
Topics in Activemq are not durable and persistent, so in case one of your consumer is down. You would lost your messages.
To make topic durable and persistent you can create a durable consumer by creating unique client id per consumer.
But again, that is not distributed in case you are following microservices architecture. So multiple pods or replicas will create problem while consuming messages as in no load balancing is possible for durable consumers.
To mitigate this scenario, there is a option of Virtual topics in Activemq.More details have been provided below,
You can send your messages via your producer in topic named as VirtualTopic.MyTopic.
** Note: you must have to follow this naming convention for default activemq configuration. But yes there is also a way to override this naming convention.
Now, to consume your messages via multiple consumers, you have to set naming convention for your consumer side destination as well for eg. Consumer.A.VirtualTopic.MyTopic
Consumer.B.VirtualTopic.MyTopic
These two consumer will receive messages through the topic created above, also with load balancing enabled between multiple replicas of same consumer.
I hope this will help you fixing your problem with activemq topic.

Message Bridge - How to route messages from topic to queue - Glassfish

Is it possible to configure a message bridge for GlassFish? The message is currently posted to a topic, and customer requirement is to "redirect" this message from a topic to a queue. (both are on the same GlassFish server). By redirect, I mean, the message will be posted on the topic and then copied to the queue. I cannot find much documentation about this, I have read about Open MQ, JMS broker and JMS bridge, but this does not seem to fit this requirement.
I understand, that I can implement a topic subscriber and then post a message to queue. But I would like to know, if it is possible to do this just by configuration or do I have to implement a bridge?
Thanks for your help, I do appreciate it.
Vladi
You'll need to implement a bridge... or change the submitter to submit to both the queue and the topic.