Details

    • Release Notes Docs Status:
      Not Required
    • Docs QE Status:
      NEW

      Description

      In HornetQ User Guide [1] in chapter "2.3 Client-side Failure Handling" would be better to replace:

        try {
          producer.send(createMessage(session, i));
          System.out.println("Message: " + i);
        } catch (Exception e) {
          Thread.sleep(1000);
          producer.send(createMessage(session, i));
        }
      

      By:

      int numberOfRetries = 0;
      
      while (numberOfRetries < maxRetries) {
         try {
            producer.send(msg);
            return;
         } catch (JMSException ex) {
            numberOfRetries++;
         }
      }
      // this is an error - failover was not succeed
      throw new Exception("FAILURE - MaxRetry reached");
      

      @Clebert
      Could you or anyone from the dev team review the code before we make it public, please?

      Thanks a lot,
      Mirek

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                clebert.suconic Clebert Suconic
                Reporter:
                mnovak Miroslav Novak
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: