• Icon: Sub-task Sub-task
    • Resolution: Unresolved
    • Icon: Major Major
    • 3.x Future
    • 2.17.0.Final
    • Java EE

      It would be good to have a command to quickly add code to allow sending JMS messages. The following command would create the needed code using a message of type String :

      jms-add-send-message-method --named sendMessage --destinationType QUEUE --destinationName myQueue
      

      This would inject the javax.jms.JMSContext and add a method to send JMS message :

          @Inject
          JMSContext context;
      
          @Resource(mappedName = "myQueue")
          Queue queue;
      
          public void sendMessage(String message) {
              context.createProducer().send(queue, message);
          }
      

      To customize the message type, we just use the type parameter :

      jms-add-send-message-method --named sendMessage --type MyBean --destinationType QUEUE --destinationName myQueue
      

      We will get the following code :

          @Inject
          JMSContext context;
      
          @Resource(mappedName = "myQueue")
          Queue queue;
      
          public void sendMessage(MyBean message) {
              context.createProducer().send(queue, message);
          }
      

              Unassigned Unassigned
              agoncal Antonio Goncalves (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: