Uploaded image for project: 'ServiceMix'
  1. ServiceMix
  2. SM-1111

Endpoint operation information lost when routing through camel

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.2.2, 3.3
    • servicemix-camel
    • None
    • Patch Available

    Description

      Hi

      I encountered problems regarding message routing to the camel service engine and
      back to the jbi NMR again. The information about the ("initial") called
      operation on a endpoint is lost while communicating with camel.

      see also
      http://www.nabble.com/Possible-Solution-to-a-camel-serviceengine-problem-or-only-a-bad-workaround---tf4645158s12049.html

      IMHO there are three different strategies to solve this problem:
      (thanks Guillaume pointing me to them )

      • (1) DSL - API call within the RouteBuilder

      It's currently not possible to do this because the JbiEndpoint doesn't have
      methods to set the operation.

      Sample:

      — 8< —
      String toUri = "jbi:endpoint:xxx";

      Endpoint endpoint = getContext().getEndpoint(toUri);

      if (endpoint instanceof JbiEndpoint)

      { JbiEndpoint jbiEndpoint = (JbiEndpoint) endpoint; //not possible jbiEndpoint.setOperation(operation); }

      from(fromUri).to(toUri);
      — 8< —

      • (2) URI - Setting the operation within the endpoint URI.

      This option specifies the operation within the given endpoint URI. It's clear
      which operation should be called but you always have to define the operation
      for a routing.

      — 8< —
      String toUri = "jbi:endpoint:xxx?operation=process";
      from(fromUri).to(toUri);
      — 8< —

      • (3) Copying the information

      This option copies the operation information from the "from-"Endpoint to the
      "to-"Endpoint. This is a simple solution if you want to call the same
      operation on all endpoints involved.

      I think option 2 and 3 should be applied. Option 2 overrides option 3. If you
      specify a direct operation information within your URI this one is used.

      Kristian

      ps: option 2 and 3 are available as patches within the attached file

      Attachments

        1. SM-1111.patch
          14 kB
          Willem Jiang
        2. ASF.LICENSE.NOT.GRANTED--patches.zip
          1 kB
          Kristian Kohler

        Issue Links

          Activity

            People

              njiang Willem Jiang
              kkoehler Kristian Kohler
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: