Continuing the series of posts on this compelling new feature. The previous posts covered my basic adapter for RabbitMQ. If you remember, the connection creation was as follows -
Naturally we need more - let's look again at the url I used, when testing in Postman - https://crow-01.rmq.cloudamqp.com/api/queues/{{account}}/{{queue}}/get
Note the 2 variables - account and queue. Wouldn't it be useful for the integration developer to be able to enter that data, when she is configuring the invoke?
Also how about giving the connection creator the ability to enter the connection type and relevant base url. This could be, in my case, https://crow-01.rmq.cloudamqp.com/api/queues.
So let's do this.
Firstly, adding the ability to select connection type and base url.
The next property is the connection URL; as you can see, I have added a default value here. This is purely to save me typing it in again and again. You will not do this in real life.
The result is as follows -
btw. coinĂn is the Irish for rabbit.
Next step, we want the person configuring the invoke to be able to specify the account and queue.
I only require this for the GET operation, remember my Rabbit MQ adapter allows me to PUT and GET messages.
So this only applies to the GET - therefore we add these to the configuration section of the GetMessageAction -
Now all we need to do is construct the uri for the GET operation. It will have the following format -
connectionURL /rabbitMQAccount/ queue/get
I construct it as follows -
"uri": "${.connectionProperties.connectionURL+ \"/\"+.configuration.rabbitMQAccount+ \"/\"+.configuration.queue+\"/get\"}"
Note the . notation and how I address the connectionURL as part of connectionProperties etc.
I set this here - in the section for the Get Message actions.
Remember, you will only be able to delete, if there are no connections defined in OIC, based on the adapter.
I delete the connection in OIC and then click Delete ADD -
Connection Properties are displayed with their default values.
I will drop the RabbitMQ invoke after the Assign action -
Now to the values I need to add - account and queue -
I put a message on the queue -
Then I get the message via OIC -
No comments:
Post a Comment