문제

I am using org.hornetq.api.core.client

how to confirm that sending a message using

producer.send("validQueue",clientMessage) 

was successful and did reached the queue ?

trying sending to invalid queue i.e

producer.send("NoneExistingQueue",clientMessage) 

did not throw hornetQException as I expected.

도움이 되었습니까?

해결책

With core api we allow users to do pure publish subscribe. Not having an address registered means you don't have someone connected to that particular address (i.e. not interested.. on that case messages are just ignored)

If you need that semantic, I suggest you do what we do on our JMS implementation, where we query for existent Queues.

If you know the name of the queue, I suggest you do:

QueueQuery query = session.queueQuery(queueName);

If you don't know the name of the queue and you have pure pub/sub:

BindingQuery queryBinding = session.bindingQuery(SimpleString address)

Then you may do the proper treatment for your usecase in case you have no consumers.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top