candrews / sqs-jms-ra

SQS JMS Resource Adapter
Apache License 2.0
10 stars 3 forks source link

Add Payara setup hints to README #4

Open baztian opened 6 years ago

baztian commented 6 years ago

It would've saved me a lot of time if the README had some instructions on how to deploy the rar separately from my war. On Payara I have to do the following

mvn dependency:copy -Dartifact=com.integralblue:sqs-jms-rar:1.0.0:rar -DoutputDirectory=target/
asadmin deploy target/sqs-jms-rar-1.0.0.rar
asadmin create-jvm-options \
          -Dcom.sun.enterprise.connectors.inbound.ramid=sqs-jms-rar-1.0.0

My MDB looks like this.

@MessageDriven(
    activationConfig = {
        @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
        @ActivationConfigProperty(propertyName = "destination", propertyValue = "qDummy"),
        @ActivationConfigProperty(propertyName = "useJndi", propertyValue = "false")
    })
// activation config properties are from com.integralblue.sqsjmara.SQSJMSActivationSpec
public class SqsMessageListener implements MessageListener {

  @Override
  public void onMessage(Message message) {
    TextMessage textMessage = (TextMessage) message;

    try {
      System.out.println(textMessage.getText());
    } catch (JMSException e) {
      e.printStackTrace();
    }
  }
}
candrews commented 6 years ago

Would you be interested in submitting a pull request with these changes?