如何在ActiveMQ中查看已退出队列的消息
在从动态队列(ActiveMQ)(挂起的消息=1000)读取消息时,我已经确认了每条消息,现在退出队列的消息数=1000 是否有办法将所有已退出队列的消息再次放入队列中。 任何物理备份所有邮件的解决方案如何在ActiveMQ中查看已退出队列的消息,activemq,Activemq,在从动态队列(ActiveMQ)(挂起的消息=1000)读取消息时,我已经确认了每条消息,现在退出队列的消息数=1000 是否有办法将所有已退出队列的消息再次放入队列中。 任何物理备份所有邮件的解决方案 提前感谢一旦代理从消费者处获得确认,它将从代理的持久性存储[KahaDB/数据库,根据配置]中删除消息 因此,如果您已将所有消息从队列发送到另一个队列或代理,则可以将这些消息重新发送到原始队列。不过,这一切都取决于您对消息所做的操作。若您使用MDB/java代码等使用了它,那个么您将无法将它们再
提前感谢一旦代理从消费者处获得确认,它将从代理的持久性存储[KahaDB/数据库,根据配置]中删除消息
因此,如果您已将所有消息从队列发送到另一个队列或代理,则可以将这些消息重新发送到原始队列。不过,这一切都取决于您对消息所做的操作。若您使用MDB/java代码等使用了它,那个么您将无法将它们再次放入原始队列 一旦代理从使用者获得确认,它将从代理的持久性存储[KahaDB/数据库,根据配置]中删除消息
因此,如果您已将所有消息从队列发送到另一个队列或代理,则可以将这些消息重新发送到原始队列。不过,这一切都取决于您对消息所做的操作。若您使用MDB/java代码等使用了它,那个么您将无法将它们再次放入原始队列 在activemq中可以看到未设计排队消息,您需要自己的逻辑将它们保存到其他位置 ActivemMQ还提供了一些函数来简化这一过程,如镜像队列()或日志插件
但是您仍然需要将消息保存到其他位置并自己进行备份。在activemq中可以看到,出列消息不是设计的,您需要自己的逻辑将它们保存到其他位置 ActivemMQ还提供了一些函数来简化这一过程,如镜像队列()或日志插件
但您仍然需要将邮件保存到其他位置,并自行备份。要在需要邮件正文时备份排队的邮件,请执行以下操作: 您可以将其添加到您的activemq.xml 这将把消息的副本保存到
${activemq.base}/bin/data/activemq/
按日期和队列排列的文件
<bean id="ActiveMQVMConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="vm://localhost?create=false&waitForStart=10000"/>
<property name="userName" value="${activemq.username}"/>
<property name="password" value="${activemq.password}"/>
</bean>
<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent" >
<property name="connectionFactory" ref="ActiveMQVMConnectionFactory"/>
</bean>
<camelContext id="camel" trace="false" xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="activemq:queue:*?mapJmsMessage=false&selector=CamelFileNameProduced IS NULL" />
<choice>
<when>
<simple>${in.headers.CamelFileNameProduced} == null</simple>
<setHeader headerName="CamelJmsDestinationName">
<simple>${in.header.JMSDestination.physicalName}</simple>
</setHeader>
<transform>
<simple>${in.body}\n</simple>
</transform>
<to uri="file://data/activemq/?fileExist=Append&fileName=routeMessages-${in.header.JMSDestination.physicalName}-${date:now:yyyyMMdd}.txt" />
<to uri="activemq:dummy" />
</when>
</choice>
</route>
</camelContext>
要在需要邮件正文时备份排队的邮件,请执行以下操作: 您可以将其添加到您的activemq.xml 这将把消息的副本保存到
${activemq.base}/bin/data/activemq/
按日期和队列排列的文件
<bean id="ActiveMQVMConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="vm://localhost?create=false&waitForStart=10000"/>
<property name="userName" value="${activemq.username}"/>
<property name="password" value="${activemq.password}"/>
</bean>
<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent" >
<property name="connectionFactory" ref="ActiveMQVMConnectionFactory"/>
</bean>
<camelContext id="camel" trace="false" xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="activemq:queue:*?mapJmsMessage=false&selector=CamelFileNameProduced IS NULL" />
<choice>
<when>
<simple>${in.headers.CamelFileNameProduced} == null</simple>
<setHeader headerName="CamelJmsDestinationName">
<simple>${in.header.JMSDestination.physicalName}</simple>
</setHeader>
<transform>
<simple>${in.body}\n</simple>
</transform>
<to uri="file://data/activemq/?fileExist=Append&fileName=routeMessages-${in.header.JMSDestination.physicalName}-${date:now:yyyyMMdd}.txt" />
<to uri="activemq:dummy" />
</when>
</choice>
</route>
</camelContext>