ServiceMix Components
  1. ServiceMix Components
  2. SMXCOMP-330

FilePoller should offer configurable targetOperation

    Details

    • Patch Info:
      Patch Available

      Description

      FilePoller currently does not use a target operation when sending a message to a target service. The operation must be set, for example, when sending a file to a Ode SU. If not set, Ode throws sort of NPE complaining operation is not set.

      FilePoller should offer a targetOperation property configurable via XBeans.

      This can be achieved by adding a targetOperation property to the org.apache.servicemix.file.FilePollerEndpoint.java class which will be passed to the exchange object if set. The following code would do (corresponding patch is appended):

      ...
      private QName targetOperation = null;
      ...
      public QName getTargetOperation()

      { return targetOperation; }

      public void setTargetOperation(QName targetOperation)

      { this.targetOperation = targetOperation; }

      ...
      protected void processFile(File aFile) throws Exception

      { ... exchange.setInMessage(message); if (getTargetOperation() != null) exchange.setOperation(getTargetOperation()); // <--- NEW marshaler.readMessage(exchange, message, in, name); ... }

      Then, the SU may be configured properly as follows:

      <f:poller
      service="proj:inbox"
      endpoint="inbox"
      targetService="process:receive"
      targetOperation="process:receive"
      file="file:///box/inbox"
      ...
      </f:poller>

      In case the attribute is not set in the xbean.xml, the current behaviour is not changed.

      1. servicemix-3.1.patch
        1 kB
        Lars Heinemann
      2. ASF.LICENSE.NOT.GRANTED--FilePollerEndpoint.java.txt
        0.4 kB
        Oliver Brusberg

        Activity

        Hide
        Bruce Snyder added a comment -

        Unfortunately the attached patch is invalid as it uses the exchange variable which is not available within the scope of the processFileAndDelete() method.

        Show
        Bruce Snyder added a comment - Unfortunately the attached patch is invalid as it uses the exchange variable which is not available within the scope of the processFileAndDelete() method.
        Hide
        Lars Heinemann added a comment -

        The newer smx releases support the targetOperation and set it correctly.
        Do we really maintain version 3.1 any longer?

        Regards,
        Lars

        Show
        Lars Heinemann added a comment - The newer smx releases support the targetOperation and set it correctly. Do we really maintain version 3.1 any longer? Regards, Lars
        Hide
        Bruce Snyder added a comment -

        No, 3.1 will no longer be patched. I was going to apply the patch to the 3.2 branch and the trunk.

        Show
        Bruce Snyder added a comment - No, 3.1 will no longer be patched. I was going to apply the patch to the 3.2 branch and the trunk.
        Hide
        Lars Heinemann added a comment - - edited

        If somebody changes the mind, here is a working patch. Unfortunately I wasn't able to build smx because of some not actual dependencies.

        Show
        Lars Heinemann added a comment - - edited If somebody changes the mind, here is a working patch. Unfortunately I wasn't able to build smx because of some not actual dependencies.
        Hide
        Lars Heinemann added a comment -

        ServiceMix 3.1 is no longer maintained.

        Show
        Lars Heinemann added a comment - ServiceMix 3.1 is no longer maintained.
        Hide
        Bruce Snyder added a comment - - edited

        We shoudln't close an issue simply because it's filed against an older version of ServiceMix. The patch should just be applied to a newer version.

        You mentioned in your last comment that you were unable to compile ServiceMix due to some missing dependencies. What dependencies are missing?

        Show
        Bruce Snyder added a comment - - edited We shoudln't close an issue simply because it's filed against an older version of ServiceMix. The patch should just be applied to a newer version. You mentioned in your last comment that you were unable to compile ServiceMix due to some missing dependencies. What dependencies are missing?
        Hide
        Lars Heinemann added a comment -

        Bruce,

        the targetOperation attribute is already implemented in smx 3.2 branch and in trunk.
        So this patch is only needed for 3.1 branch. As we do not maintain it any longer, this issue is
        now useless.

        For the dependency errors: I will file them tomorrow to the mailing list.

        Regards,
        Lars

        Show
        Lars Heinemann added a comment - Bruce, the targetOperation attribute is already implemented in smx 3.2 branch and in trunk. So this patch is only needed for 3.1 branch. As we do not maintain it any longer, this issue is now useless. For the dependency errors: I will file them tomorrow to the mailing list. Regards, Lars
        Hide
        tcook@musiciansfriend.com added a comment -

        Hi Bruce,

        This is Ty Cook. If you have a few minutes, I'd like to talk to you about a couple things (not bugs or anything). I don't have your email address. If you wouldn't mind emailing me at tcook@musiciansfriend.com I'll tell you what's going on.

        Thanks,
        Ty

        Quoted from:
        http://www.nabble.com/-jira--Reopened%3A-%28SM-1115%29-FilePoller-should-offer-configurable-targetOperation-tp16276509s12049p16276509.html

        Show
        tcook@musiciansfriend.com added a comment - Hi Bruce, This is Ty Cook. If you have a few minutes, I'd like to talk to you about a couple things (not bugs or anything). I don't have your email address. If you wouldn't mind emailing me at tcook@musiciansfriend.com I'll tell you what's going on. Thanks, Ty Quoted from: http://www.nabble.com/-jira--Reopened%3A-%28SM-1115%29-FilePoller-should-offer-configurable-targetOperation-tp16276509s12049p16276509.html
        Hide
        Bruce Snyder added a comment -

        he targetOperation attribute is already implemented in smx 3.2 branch and in trunk.
        So this patch is only needed for 3.1 branch. As we do not maintain it any longer, this issue is
        now useless.

        OK, if that's the case, then we can close out this issue. It is true that we won't apply any fixes to the 3.1 branch, but the better answer is that the targetOperation property is already provided in both the 3.2 branch and the trunk.

        For the dependency errors: I will file them tomorrow to the mailing list.

        Great, then I will close this issue.

        Show
        Bruce Snyder added a comment - he targetOperation attribute is already implemented in smx 3.2 branch and in trunk. So this patch is only needed for 3.1 branch. As we do not maintain it any longer, this issue is now useless. OK, if that's the case, then we can close out this issue. It is true that we won't apply any fixes to the 3.1 branch, but the better answer is that the targetOperation property is already provided in both the 3.2 branch and the trunk. For the dependency errors: I will file them tomorrow to the mailing list. Great, then I will close this issue.

          People

          • Assignee:
            Bruce Snyder
            Reporter:
            Oliver Brusberg
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development