使用者队列未使用虚拟主题中的消息 [英] Messages in Virtual Topic not consumed by consumer queue

查看:101
本文介绍了使用者队列未使用虚拟主题中的消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用activemq中的队列来使来自虚拟主题的消息出队.我尝试发送一些消息,但该消息显示在已排队的消息"下的主题中,但无法使用.

我创建的虚拟主题名称为VirtualTopic.AA,使用者称为Consumer.client1.VirtualTopic.AA.

在Consumer.client1.VirtualTopic.AA中,我可以看到有一个使用者,但是它不能从虚拟主题中出消息.

有人知道为什么会这样吗?我需要在xml文件的配置中更改一些设置吗?

解决方案

使用Spring的JmsTemplate发布到虚拟主题时,需要通过将pubSubDomain属性设置为"true"来为主题配置它. >

来自 JmsTemplate文档:

如果要使用动态目标创建,则必须使用"pubSubDomain"属性指定要创建的JMS目标的类型.对于其他操作,这不是必需的.点对点(队列)是默认域.

并且在

I am trying to use a queue in activemq to dequeue messages from a virtual topic. I tried sending some messages and it is showing up in the topic under "message enqueued" but it is not able to be consumed.

The virtual topic name that i created was VirtualTopic.AA and the consumer is called Consumer.client1.VirtualTopic.AA.

In the consumer.client1.VirtualTopic.AA, i can see that there is a consumer but it is just not able to dequeue messages from the virtual topic.

Anyone knows why this is happening ? Do i need to change some settings in the configuration in the xml file ?

解决方案

When you publish to a virtual topic using Spring's JmsTemplate, you need to configure it for a topic by setting the pubSubDomain property to "true".

From the JmsTemplate documentation:

If you want to use dynamic destination creation, you must specify the type of JMS destination to create, using the "pubSubDomain" property. For other operations, this is not necessary. Point-to-Point (Queues) is the default domain.

And in JmsDestinationAccessor#setPubSubDomain:

pubSubDomain - "true" for the Publish/Subscribe domain (Topics), "false" for the Point-to-Point domain (Queues)

这篇关于使用者队列未使用虚拟主题中的消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆