Preparation
Last updated
Was this helpful?
Last updated
Was this helpful?
Let's integrate real life scenario together and make integration with . To provide custom Message Channels, that will be backed by Amazon SQS. This will allow us to send Ecotone's Messages over SQS.
Even, if you do not want to integrate new Module, it's still worth of going through demo, to see how messaging patterns are used and how to write tests.
In the demo we will be using package name SqsDemo.
In repository you will find _PackageTemplate
that can be used for bootraping your module.
Start by replacing _PackageTemplate
with SqsDemo
.
Our composer autoload
will be like this:
then by running docker-compose up -d
it will be now available for us in testing under http://localstack-sqs-demo:4576
hostname.
So the package we are interested is enqueue/sqs
, let's add this and ecotone/enqueue
.
Always prefer to use well known packages for low level integration with external services. This decrease amount of integration that needs to be maintained and does not reinvent the wheel.
Start by adding our sqsDemo
package ModulePackageList
and ModuleClassList
in the same way as other modules are added there. This will allow us to run this package from our tests.
As Ecotone encourage writing tests on real integrations instead of mocked libraries, we will add docker container, that will provide us with self-hosted Amazon SQS
.
We will be using for hosting local SQS, let's start by adding it to docker-compose.yaml
.
Ecotone provides basic integration with that we can build on top of.
You may check on , if it provides integration with service that you would like integrate Ecotone with. If so, then we will need to write less code, as part of the integration it already covered.
You may take a look on the over enqueue before we will go to the next step.