I had a similar use case in the past, and I chose to route the "trash" messages to a JMS Topic that didn't have any durable subscribers. That way I could create a subscriber when I needed it to see what was being "trashed" - just be careful you don't create a durable subscriber or the messages will build-up in that topic.
On Thu, Jun 23, 2016 at 7:09 PM, Tim Bain <tb...@alumni.duke.edu> wrote: > To trash a message, do not send it to a DLQ! DLQ != /dev/null. > > Instead, just ack the message after you consume it (without doing anything > in response, just end the route or have your processor return null), which > in the default Camel configuration happens automatically when your Camel > route receives the message. If your route is somehow set up for individual > acks, you'd have to do the ack manually, but the code you've inherited > would have an example of what to do if that were the case. > > Tim > On Jun 23, 2016 8:14 AM, "Hassen Bennour" <bennour.has...@gmail.com> > wrote: > > > Hello, > > > > You can route messages following messages properties with filtered > > destinations http://activemq.apache.org/virtual-destinations.html > > or camel http://activemq.apache.org/sample-camel-routes.html > > http://camel.apache.org/message-filter.html > > > > to trash a message i think you can route it to DLQ or another "trash > queue" > > or simply if it not correspond to any filtered Destination selector or > > route it will not been forwarded, loosed. > > > > for example : > > <destinationInterceptors> > > <virtualDestinationInterceptor> > > <virtualDestinations> > > <compositeTopic name="TOPIC"> > > <forwardTo> > > * <!-- 1. all messages will be duplicated to topic TOPIC_LOGS -->* > > <topic physicalName="TOPIC_LOGS" /> > > * <!-- 2. all messages with message property clientID = 'activemq' will > be > > duplicated to topic ACTIVEMQ -->* > > <filteredDestination selector="clientID = 'activemq'" topic="ACTIVEMQ" /> > > </forwardTo> > > </compositeTopic > > > </virtualDestinations> > > </virtualDestinationInterceptor> > > </destinationInterceptors> > > > > if you remove the filter 1 and a if a message dont have a *clientID = > > 'activemq' * it will be ignored. > > > > > > > > Kind regards. > > > > *BENNOUR HASSEN* > > > > *SOA **Architect **/ **Java **Software Engineer* > > > > 2016-06-23 14:47 GMT+02:00 daelliott <my_fo...@outlook.com>: > > > > > I've taken over a project in which everyone that knows anything is > gone. > > > I'm new to ActiveMQ and have never used Camel before. > > > I'm trying to do content message routing and have a sample of what I'm > > > attempting to do but have a couple of questions. > > > > > > * How to access a custom ActiveMQ message property. > > > Is what I have below correct? > > > > > > * How to trash a message i.e. send to /dev/null > > > > > > This is what I have after going through all the documentation that I > > could > > > find. > > > Any help is GREATLY appreciated. > > > > > > > > > > > > > > > > > > > > > > > > -- > > > View this message in context: > > > > > > http://activemq.2283324.n4.nabble.com/Help-with-Camel-Config-routing-using-a-custom-ActiveMQ-Message-Property-tp4713278.html > > > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > > > > > > -- Quinn Stevenson qu...@pronoia-solutions.com (801) 244-7758