Uploaded image for project: 'ServiceMix Components'
  1. ServiceMix Components
  2. SMXCOMP-148

Refactor JmsProviderEndpoint to not use reflection to call protected method on Spring JmsTemplate class

    XMLWordPrintableJSON

Details

    • Patch Available

    Description

      A recent fix changed JmsProviderEndpoint.java and calls the Spring JmsTemplate protected method doSend() directly via reflection.

      Method method = JmsTemplate.class.getDeclaredMethod("doSend", Session.class, Destination.class, MessageCreator.class);
      method.setAccessible(true);
      method.invoke(template, session, dest, new MessageCreator() {
        public Message createMessage(Session session) throws JMSException {
           return message;
        }
      });
      

      This new approach is based on java.lang.reflect and uses private methods of the JmsTemplate. Do the latest problem related to JmsProviderEndpoint really justify using private methods?
      Please consider refactoring the code above.

      Attachments

        1. SM-1786.patch
          11 kB
          Torsten Mielke

        Activity

          People

            gnodet Guillaume Nodet
            tmielke Torsten Mielke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: