git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to do a divert using an xpath filter?


This isn't implemented yet.  See here [1].

That said, it doesn't appear that it would be that hard to implement.


Justin

[1]
https://github.com/apache/activemq-artemis/blob/master/artemis-server/src/main/java/org/apache/activemq/artemis/core/filter/impl/FilterImpl.java#L210

On Tue, Oct 16, 2018 at 6:32 PM Frank Michael <much99@xxxxxxxxx.invalid>
wrote:

> Hi, I'm using version 2.6.3 of Artemis and trying to set up a divert from
> one queue to another using an xpath filter. Unfortunately this doesn't work
> as my XML Test messages are not getting diverted but stay in the incoming
> queue.
> My adresses in broker.xml look like this      <addresses>         <address
> name="DLQ">            <anycast>               <queue name="DLQ" />
>     </anycast>         </address>         <address name="ExpiryQueue">
>       <anycast>               <queue name="ExpiryQueue" />
> </anycast>         </address>
>          <address name="Incoming">            <anycast>
>  <queue name="Incoming" />            </anycast>         </address>
> <address name="XMLMessages">
>             <anycast>               <queue name="XMLMessages" />
>   </anycast>         </address>        </addresses>
> My divert looks like this   <diverts>   <divert name="xmldivert">
>  <address>Incoming</address>
> <forwarding-address>XMLMessages</forwarding-address>
>                     <filter string="XPATH
> '//ContractedTimeTableMsg/Message'"/>
>      <exclusive>true</exclusive>   </divert>         </diverts>
> My XML message looks like this<ContractedTimeTableMsg> <Message
> type="123"> </Message></ContractedTimeTableMsg>
>
> Is it possible to use an XPATH Filter like this in a divert? If not, is
> there another, correct way to do it?I'm using Java 8 and a standalone
> installation of Artemis. Xalan is on the classpath, I tried version 2.6 and
> version 2.7.If this is generally the correct way, how would you debug this?