Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-2307

ActiveMQ Karaf commands do not work with Karaf 3

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0.RC1
    • Fix Version/s: 3.0.0
    • Component/s: karaf-shell
    • Labels:
      None

      Description

      The ActiveMQ Karaf commands import the package org.apache.felix.gogo.commands.basic which was exported by karaf shell before version 3.

      I first tried to change the activemq commands like we did for cxf and camel. The problem is that the activemq commands are quite generic as they simply map the activemq console commands. So they really need the package above.

      So my aproach is to create the package in karaf shell with deperecated classes extending the new classes. So this should provide the necessary compat layer. There classes can be removed once all commands are switched to pure karaf 3.

      1. amq-4492.patch
        0.6 kB
        Christian Schneider

        Issue Links

          Activity

          Hide
          jbonofre Jean-Baptiste Onofré added a comment -

          Now, ActiveMQ 5.10-SNAPSHOT (next 5.9.1 and 5.10) works fine on Karaf 3.0.0 (including the completer).

          The problem was on the service guard.

          I'm working on an enhancement on the completer to manager the proxy guard.

          Show
          jbonofre Jean-Baptiste Onofré added a comment - Now, ActiveMQ 5.10-SNAPSHOT (next 5.9.1 and 5.10) works fine on Karaf 3.0.0 (including the completer). The problem was on the service guard. I'm working on an enhancement on the completer to manager the proxy guard.
          Hide
          jbonofre Jean-Baptiste Onofré added a comment -

          I added dual export version of the console package.

          I tested ActiveMQ 5.7.0, and it works fine (deployment OK, just some commands are not visible, I gonna check why).

          Show
          jbonofre Jean-Baptiste Onofré added a comment - I added dual export version of the console package. I tested ActiveMQ 5.7.0, and it works fine (deployment OK, just some commands are not visible, I gonna check why).
          Hide
          jbonofre Jean-Baptiste Onofré added a comment - - edited

          Now, the ActiveMQ commands work:

          karaf@root()> activemq:list
          brokerName = amq-broker

          I gonna fix:

          • activemq subshell is not there, and the activemq:* commands are not in CommandsCompleter
          • activemq:bstat command doesn't work due the JMX ACL on the uptime attribute (I gonna provision a jmx.acl file by the ActiveMQ feature)
          Show
          jbonofre Jean-Baptiste Onofré added a comment - - edited Now, the ActiveMQ commands work: karaf@root()> activemq:list brokerName = amq-broker I gonna fix: activemq subshell is not there, and the activemq:* commands are not in CommandsCompleter activemq:bstat command doesn't work due the JMX ACL on the uptime attribute (I gonna provision a jmx.acl file by the ActiveMQ feature)
          Hide
          jbonofre Jean-Baptiste Onofré added a comment -

          I fixed the issues in ActiveMQ (I gonna submit a new patch very soon). The other part is in the addition of the compatibility bundle in Karaf (KARAF-2606).

          Show
          jbonofre Jean-Baptiste Onofré added a comment - I fixed the issues in ActiveMQ (I gonna submit a new patch very soon). The other part is in the addition of the compatibility bundle in Karaf ( KARAF-2606 ).
          Hide
          achim_nierbeck Achim Nierbeck added a comment - - edited

          I think we're safe to export "old" API in an old version, actually this also does give a good hint for future developers to verify that their using deprecated API

          Show
          achim_nierbeck Achim Nierbeck added a comment - - edited I think we're safe to export "old" API in an old version, actually this also does give a good hint for future developers to verify that their using deprecated API
          Hide
          chris@die-schneider.net Christian Schneider added a comment -

          I now committed a patch that contains the classes and interfaces at the old location. ActiveMQ karaf still has the wrong import range for the unchanged parts of the api (org.apache.karaf.shell.console) though.
          We now can either open up the import range for activemq-karaf to include the 3.x versions of the package or we have to export the package in a 2.x version.

          I have tested a patched version of activemq-karaf where I opened the import ranges to [2.3,4). After this change the activemq feature loads but the commands still do not work.
          Jean-Baptiste Onofré could you have a look at this. I think we are not too far from a solution.

          Show
          chris@die-schneider.net Christian Schneider added a comment - I now committed a patch that contains the classes and interfaces at the old location. ActiveMQ karaf still has the wrong import range for the unchanged parts of the api (org.apache.karaf.shell.console) though. We now can either open up the import range for activemq-karaf to include the 3.x versions of the package or we have to export the package in a 2.x version. I have tested a patched version of activemq-karaf where I opened the import ranges to [2.3,4). After this change the activemq feature loads but the commands still do not work. Jean-Baptiste Onofré could you have a look at this. I think we are not too far from a solution.
          Hide
          chris@die-schneider.net Christian Schneider added a comment -

          That should work. The only downside is that as soon as activemq switched it will not work with older karaf 2.x versions

          Show
          chris@die-schneider.net Christian Schneider added a comment - That should work. The only downside is that as soon as activemq switched it will not work with older karaf 2.x versions
          Hide
          jbonofre Jean-Baptiste Onofré added a comment -

          Agree, but why not providing the "dual" packages in 2.3 or 2.4 ?

          Show
          jbonofre Jean-Baptiste Onofré added a comment - Agree, but why not providing the "dual" packages in 2.3 or 2.4 ?
          Hide
          chris@die-schneider.net Christian Schneider added a comment -

          Patch to open import range for the shell package to allow installation into karaf3.

          Show
          chris@die-schneider.net Christian Schneider added a comment - Patch to open import range for the shell package to allow installation into karaf3.
          Hide
          chris@die-schneider.net Christian Schneider added a comment -

          If you have a better solution please go ahead. I think it makes sense as there should always be a version where you can use the old and new api as this allows a transition period for the projects.

          An alternative solution is to copy the classes from commands.basic into a package in activemq-karaf. This would involve a lot of duplicate code though.

          Show
          chris@die-schneider.net Christian Schneider added a comment - If you have a better solution please go ahead. I think it makes sense as there should always be a version where you can use the old and new api as this allows a transition period for the projects. An alternative solution is to copy the classes from commands.basic into a package in activemq-karaf. This would involve a lot of duplicate code though.
          Hide
          jbonofre Jean-Baptiste Onofré added a comment -

          To be honest, I don't like this solution: it's not the same sense at all.

          1/ we go back to gogo dependencies (which is limited and not good)
          2/ we invite the legacy projects to upgrade to that.

          Transition packages don't make sense as Karaf 2.3 and 2.4 are made for transition !

          Show
          jbonofre Jean-Baptiste Onofré added a comment - To be honest, I don't like this solution: it's not the same sense at all. 1/ we go back to gogo dependencies (which is limited and not good) 2/ we invite the legacy projects to upgrade to that. Transition packages don't make sense as Karaf 2.3 and 2.4 are made for transition !
          Hide
          chris@die-schneider.net Christian Schneider added a comment -

          Unfortunately there is also a problem with the import range of org.apache.karaf.shell.console in the karaf commands.
          So we will have to still adjust the command bundle.

          Show
          chris@die-schneider.net Christian Schneider added a comment - Unfortunately there is also a problem with the import range of org.apache.karaf.shell.console in the karaf commands. So we will have to still adjust the command bundle.

            People

            • Assignee:
              jbonofre Jean-Baptiste Onofré
              Reporter:
              chris@die-schneider.net Christian Schneider
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development