Git Product home page Git Product logo

sqs-jms-ra's Introduction

SQS JMS Resource Adapter

DevOps By Rultor.com Build Status Maven Central Reference Status Dependency Status Javadoc Quality Gate

The SQS JMS Resource Adapter provides a way to access AWS (Amazon Web Services) SQS (Simple Queue Service) as JMS (Java Message Service) resources using JCA (Java EE Connector Architecture).

Quick Start

  • Minimum requirements โ€” You'll need Java 1.7+ to compile/run. The SQS JMS Resource Adapter requires a JEE 7 application server.
  • Download โ€” Depend on this library using, for example, Maven:
  <dependency>
    <groupId>com.integralblue</groupId>
    <artifactId>sqs-jms-rar</artifactId>
    <version>[INSERT VERSION HERE]</version>
  </dependency>

sqs-jms-ra's People

Contributors

candrews avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

sqs-jms-ra's Issues

Add Payara setup hints to README

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();
    }
  }
}

java.lang.NoSuchMethodException: WFLYJCA0074: Method setDestinationType not found

I have been trying to use with resource adapter with WildFly 22, but it fails to deploy. The error synopsis is:

[02/24/21 21:36:43:312 UTC] [Controller Boot Thread] [management-op] [ERROR  ] WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "sqs-jms-rar-1.0.0.rar")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.ra.deployment.\"sqs-jms-rar-1.0.0.rar_sqs-jms-ra\"" => "WFLYJCA0046: Failed to start RA deployment [sqs-jms-rar-1.0.0.rar]
    Caused by: org.jboss.jca.deployers.common.DeployException: WFLYJCA0072: Deployment com.integralblue.sqsjmara.SQSJMSActivationSpec failed
    Caused by: java.lang.NoSuchMethodException: WFLYJCA0074: Method setDestinationType not found"}}

with the longer stacktrace of:

[02/24/21 21:36:43:308 UTC] [ServerService Thread Pool -- 82] [fail         ] [ERROR  ] MSC000001: Failed to start service jboss.ra.deployment."sqs-jms-rar-1.0.0.rar_sqs-jms-ra": org.jboss.msc.service.StartException in service jboss.ra.deployment."sqs-jms-rar-1.0.0.rar_sqs-jms-ra": WFLYJCA0046: Failed to start RA deployment [sqs-jms-rar-1.0.0.rar]
        at [email protected]//org.jboss.as.connector.services.resourceadapters.deployment.AbstractResourceAdapterDeploymentService$2.run(AbstractResourceAdapterDeploymentService.java:340)
        at [email protected]//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
        at [email protected]//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
        at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
        at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
        at java.base/java.lang.Thread.run(Thread.java:834)
        at [email protected]//org.jboss.threads.JBossThread.run(JBossThread.java:513)
Caused by: org.jboss.jca.deployers.common.DeployException: WFLYJCA0072: Deployment com.integralblue.sqsjmara.SQSJMSActivationSpec failed
        at [email protected]//org.jboss.as.connector.services.resourceadapters.deployment.AbstractResourceAdapterDeploymentService$AbstractWildFlyRaDeployer.initAndInject(AbstractResourceAdapterDeploymentService.java:646)
        at [email protected]//org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.initActivationSpec(AbstractResourceAdapterDeployer.java:773)
        at [email protected]//org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAdapterDeployer.java:1928)
        at [email protected]//org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService$WildFlyRaXmlDeployer.doDeploy(ResourceAdapterXmlDeploymentService.java:190)
        at [email protected]//org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:128)
        at [email protected]//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
        at [email protected]//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
        at [email protected]//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
        at [email protected]//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
        at [email protected]//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
        at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
        at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
        at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.NoSuchMethodException: WFLYJCA0074: Method setDestinationType not found
        at [email protected]//org.jboss.as.connector.util.Injection.inject(Injection.java:134)
        at [email protected]//org.jboss.as.connector.util.Injection.inject(Injection.java:87)
        at [email protected]//org.jboss.as.connector.services.resourceadapters.deployment.AbstractResourceAdapterDeploymentService$AbstractWildFlyRaDeployer.initAndInject(AbstractResourceAdapterDeploymentService.java:633)
... 12 more

I thought maybe I could avoid the error by commenting out the ActivationConfigProperty for destinationType:

@MessageDriven(activationConfig = {
// @ActivationConfigProperty(propertyName = "destinationType",propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination",propertyValue = "AlertQueue"),
@ActivationConfigProperty(propertyName = "acknowledgeMode",propertyValue = "Auto-acknowledge")
})

since it looks like the code is written to set the initial value to javax.jms.Queue anyway, but I still get the same error. So, while I don't know why WildFly is trying to call the setter, it also seems like it would be easy (and good form) to add the missing setter. What do you think?

Rar deployment slow

I'm using Payara server and deployment of rar takes about 20-40 seconds. I deploy the rar using the following commands

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

Why does deployment taking so long?

App deployment/undeployment is slow

Deployment, undeployment as well as starting and stopping the app server is really slow. This is probably due to the use of amazon-sqs-java-messaging-lib. I used this lib with all sorts of problems. I then switched to "native" AWS Java SDK. I used a managed executor service for (long) polling. I had fast deployment cycles an no issues so far.

Would it be possible to use AWS SDK directly instead of the other lib? I would prefer to use sqs-jms-ra instead of hand crafting sqs connection for every project or having a direct dependency to a library.

MDB Receiver is single-threaded

Using Wildfly 21, when the pool size is greater than one, the mdb receiver does not scale up and create more instances of the mdb. Is this expected behavior? Is there a separate configuration to enable more instances?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.