aws-sqs-ra

Amazon SQS JMS Resource Adapter

Лицензия

Лицензия

Категории

Категории

AWS Контейнер PaaS Providers
Группа

Группа

io.bpic.aws
Идентификатор

Идентификатор

aws-sqs-ra
Последняя версия

Последняя версия

1.0.3
Дата

Дата

Тип

Тип

pom
Описание

Описание

aws-sqs-ra
Amazon SQS JMS Resource Adapter
Ссылка на сайт

Ссылка на сайт

https://github.com/bpicio/aws-sqs-ra
Система контроля версий

Система контроля версий

http://github.com/bpicio/aws-sqs-ra/tree/master

Скачать aws-sqs-ra

Имя Файла Размер
aws-sqs-ra-1.0.3.pom 9 KB
Обзор

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/io.bpic.aws/aws-sqs-ra/ -->
<dependency>
    <groupId>io.bpic.aws</groupId>
    <artifactId>aws-sqs-ra</artifactId>
    <version>1.0.3</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/io.bpic.aws/aws-sqs-ra/
implementation 'io.bpic.aws:aws-sqs-ra:1.0.3'
// https://jarcasting.com/artifacts/io.bpic.aws/aws-sqs-ra/
implementation ("io.bpic.aws:aws-sqs-ra:1.0.3")
'io.bpic.aws:aws-sqs-ra:pom:1.0.3'
<dependency org="io.bpic.aws" name="aws-sqs-ra" rev="1.0.3">
  <artifact name="aws-sqs-ra" type="pom" />
</dependency>
@Grapes(
@Grab(group='io.bpic.aws', module='aws-sqs-ra', version='1.0.3')
)
libraryDependencies += "io.bpic.aws" % "aws-sqs-ra" % "1.0.3"
[io.bpic.aws/aws-sqs-ra "1.0.3"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

  • aws-sqs-rar
  • aws-sqs-jca-api

Amazon SQS JMS Resource Adapter

Maven Central

Getting Started

Installation

For Wildfly, copy aws-sqs-rar-[VERSION HERE].rar to your application server deployment folder. In standalone it should be:

$WILDFLY_HOME/standalone/deployments

Either reference the resource adapter on your MDB using:

@ResourceAdapter("aws-sqs-rar-[VERSION HERE].rar")

Or by setting as the default adapter on standalone-full.xml:

<subsystem xmlns="urn:jboss:domain:ejb3:6.0">
    ...
    <mdb>
        <resource-adapter-ref resource-adapter-name="${ejb.resource-adapter-name:activemq-ra.rar}"/>
        ...
    </mdb>
    ...
</subsystem>

Then create a queue:

<subsystem xmlns="urn:jboss:domain:resource-adapters:5.0">
    <resource-adapters>
        <resource-adapter id="aws-sqs-rar-[VERSION HERE].rar">
            <archive>
                aws-sqs-rar-${project.version}.rar
            </archive>
            <transaction-support>NoTransaction</transaction-support>
            <admin-objects>
                <admin-object class-name="io.bpic.aws.sqs.ra.SQSJMSQueue" jndi-name="java:jboss/sqs/queue/QueueName" pool-name="QueuePool">
                    <config-property name="queueName">[QUEUE NAME]</config-property>
                </admin-object>
            </admin-objects>
        </resource-adapter>
    </resource-adapters>
</subsystem>

Inbound MDB

To receive messages you must implement the MessageListener interface.

public class ReceiveSQSMDB implements MessageListener {
   
} 

Also you must set the ActivationConfigProperty values suitable for your MDB.

Valid properties are below.

Config Property Name Type Default Notes
awsAccessKeyId String None Must be set to the access key of your AWS account (Optional)
awsSecretKey String None Must be set to the secret key of your AWS account (Optional)
destination String None JNDI queue name
region String None Must be set to the AWS region name of your queue. (Optional)

Your MDB should contain one method annotated with @OnMessage

A full skeleton MDB is shown below

@MessageDriven(activationConfig = {
    @ActivationConfigProperty(propertyName = "awsAccessKeyId", propertyValue = "${ENV=accessKey}"),
    @ActivationConfigProperty(propertyName = "awsSecretKey", propertyValue = "${ENV=secretKey}"),
    @ActivationConfigProperty(propertyName = "destination", propertyValue = "${ENV=destination}"),   
    @ActivationConfigProperty(propertyName = "region", propertyValue = "eu-west-2")    
})
@ResourceAdapter("aws-sqs-rar-[VERSION HERE].rar")
public class ReceiveSQSMDB implements MessageListener {

    @OnMessage
    public void receiveMessage(Message message) {
        System.out.println("Got message " + message.getBody());
    }
}

License

This project is licensed under the GNU AGPLv3 License - see the LICENSE.md file for details

io.bpic.aws

BP Internet

Версии библиотеки

Версия
1.0.3
1.0.2
1.0.1
1.0.0