You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "lopushen (via GitHub)" <gi...@apache.org> on 2024/06/04 21:37:28 UTC
[PR] Added missing bundles for camel-aws2-sqs and integration test [camel-karaf]
lopushen opened a new pull request, #321:
URL: https://github.com/apache/camel-karaf/pull/321
Fixes https://github.com/apache/camel-karaf/issues/320
Motivation
- During testing using an OSGI blueprint, it turned out that the camel-aws2-sqs is missing bundles to successfully execute the route.
Modifications:
- Add the missing bundles
- Add an integration test for camel-aws2-sqs
To run localstack (AWS emulator):
`docker run --rm -it -p 4566:4566 -p 4510-4559:4510-4559 localstack/localstack`
In the emulator run
`aws configure --profile localstack`
and enter in the prompt:
```
test
test
us-east-1
json
```
to get
```
AWS Access Key ID [None]: test
AWS Secret Access Key [None]: test
Default region name [None]: us-east-1
Default output format [None]: json
```
Create an sqs queue in the localstack
`aws --endpoint-url=http://localhost:4566 sqs create-queue --queue-name my-queue`
Deploy the following blueprint
```
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
xsi:schemaLocation="
http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd
http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
<bean id="sqs2Configuration" class="org.apache.camel.component.aws2.sqs.Sqs2Configuration">
<property name="accessKey" value="test"/>
<property name="secretKey" value="test"/>
<property name="region" value="us-east-1"/>
<property name="overrideEndpoint" value="true"/>
<property name="uriEndpointOverride" value="http://localhost:4566"/>
</bean>
<bean id="aws2-sqs" class="org.apache.camel.component.aws2.sqs.Sqs2Component">
<property name="configuration" ref="sqs2Configuration"/>
</bean>
<camelContext id="camel" xmlns="http://camel.apache.org/schema/blueprint">
<route id="sendSqsMessageRoute">
<from uri="timer:sendEmailTimer?period=5000"/>
<setBody>
<constant>Hello, this is a test message from AWS sqs!</constant>
</setBody>
<to uri="aws2-sqs://my-queue"/>
<log message="Sent message: ${body}"/>
</route>
<route id="receiveFromSqsRoute">
<from uri="aws2-sqs://my-queue"/>
<log message="Received message: ${body}"/>
</route>
</camelContext>
</blueprint>
```
Observe the following output:
```
00:35:15.569 INFO [Camel (camel-1) thread #2 - timer://sendEmailTimer] Sent message: Hello, this is a test message from AWS sqs!
00:35:15.898 INFO [Camel (camel-1) thread #1 - aws2-sqs://my-queue] Received message: Hello, this is a test message from AWS sqs!
00:35:20.571 INFO [Camel (camel-1) thread #2 - timer://sendEmailTimer] Sent message: Hello, this is a test message from AWS sqs!
00:35:21.062 INFO [Camel (camel-1) thread #1 - aws2-sqs://my-queue] Received message: Hello, this is a test message from AWS sqs!
00:35:25.586 INFO [Camel (camel-1) thread #2 - timer://sendEmailTimer] Sent message: Hello, this is a test message from AWS sqs!
00:35:25.730 INFO [Camel (camel-1) thread #1 - aws2-sqs://my-queue] Received message: Hello, this is a test message from AWS sqs!
```
Also, an integration test was added to test the feature (artifact camel-aws2-sqs-test) - run `mvn clean verify` in the folder to run the test
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Added missing bundles for camel-aws2-sqs and integration test [camel-karaf]
Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo merged PR #321:
URL: https://github.com/apache/camel-karaf/pull/321
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org