2 Replies Latest reply on Jan 15, 2015 10:57 PM by Justin Bertram

    Create persistent divert using core api?

    oliver henlich Newbie



      When our application encounters a certain error condition we need to have certain messages diverted to a different queue for later processing.


      I'm using the core api as follows to create the divert:


      HornetQServerControl hornetQServerControl = getHornetQServerControl();

      hornetQServerControl.createDivert("testDivert", null, "jms.queue.sourceQ", "jms.queue.forwardQ", true, "myproperty=xyz", null);


      This works as expected while the server is running.


      However, it does not seem to survive a server restart.
      So my questions are:

      - are config changes made by HornetQServerControl not intended to be persistent?

      - is there a way of achieving what I want through the API or is it only possible through the xml configuration