Uploaded image for project: 'ActiveMQ Artemis'
  1. ActiveMQ Artemis
  2. ARTEMIS-2134

Define divert using an xpath filter on XML Message Content

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.6.3
    • None
    • Broker

    Description

      I'm not sure whether to classify this as a bug or an improvment so please reassign at will.

      Discussion can also be found here: http://mail-archives.apache.org/mod_mbox/activemq-users/201810.mbox/browser

      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 on the message content. Unfortunately this doesn't work as my XML Test messages are not getting diverted but stay in the incoming queue.

      So, Justin Bertram pointed me to https://github.com/apache/activemq-artemis/blob/master/artemis-server/src/main/java/org/apache/activemq/artemis/core/filter/impl/FilterImpl.java#L210
      writing this feature is not implemented yet.

      Unfortunately this also fails silently (no log message, no exception) and is not documented anywhere so it was a real headache to debug.

      Is there another way to do it? If not, is this a bug or a Feature/Improvement? (I think this was already working in AktiveMQ 5.something)

      My adresses in broker.xml look like this     

      <addresses>          
      ...
      DLQ and ExpiryQueue
      ...
      <address name="Incoming">            
        <anycast>                
          <queue name="Incoming" />            
        </anycast>          
      </address>        
      <address name="XMLMessages">             
        <anycast>               
          <queue name="XMLMessages" />            
        </anycast>         
      </address>        
      </addresses> 
      

      My divert:

      <diverts>   
        <divert name="xmldivert"> 
          <address>Incoming</address> 
          <forwarding-address>XMLMessages</forwarding-address>                     
          <filter string="XPATH '//ContractedTimeTableMsg/Message'"/>      
          <exclusive>true</exclusive>   
        </divert>         
      </diverts>
      

      My XML

      <ContractedTimeTableMsg> 
        <Message type="123"> 
        </Message>
      </ContractedTimeTableMsg> 
      

      I'm using Java 8 and a standalone installation of Artemis.
      Xalan is on the classpath, I tried version Xalan 2.6 and v2.7.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              nagelfar Michael Frank
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: