Thursday, January 26, 2023

Saturday, January 21, 2023

#949 OIC Billing Metrics - how many messages is each integration consuming?



One question I get asked frequently is which integrations are the most costly from a billing perspective. Let's try this out with a very simple example.

I will use the following integration among others - this processes an 80kb file, i.e. should use up 2 * 50 kb messages per flow. The others are simple REST based integrations with payloads < 50kb.


I run a couple of flows and then go to the OCI Billing Metrics - 



I edit the query as follows - 


And they view the data - 


Naturally, one can check out other stats - 


One can also drill down into specific integrations and/or adapters - 






So this is useful, I know which flows are costing me the most messages. Next, how can I find out how many flows I actually have for AA_LARGEPAYLOADDEMO? 

This I can do with OCI Metrics - 


Here we see 4 instances of that integration - so 4 * 2 = 8 messages.

Of course, some integrations can have request payloads that vary in size.

I do the following simple set of tests -

Invoke the LargePayload integration twice with a payload < 50kb, then 3 times with a payload of 80kb.

The Mean cost should be (3 * 2) + (2*1) = 8 billed messages spread over 5 flows. That gives us a mean value of 1.6 messages per flow.


Here is the Mean Message Count Flow in detail - 








Thursday, January 12, 2023

#948 - OIC 22.12.1 Release - New Features --> Parallel Processing
















An extremely cool feature coming with 22.12.1. This is similar to the Split/Join feature in Oracle Service Bus - the ability to model the parallel execution of tasks. I have a simple order processing integration, as usual. As you can see, I have 2 branches one for legal and one for inventory processing. These two distinct tasks can be executed independently of each other.

We have added a new action in 22.12.1 to enable such processing -





Configuration is easy - 










Note the ability to Add more branches. I just choose edit here to give the action a relevant name.











Now to add some actions to the branches - this release currently supports adding Map & Invoke actions to a branch. That means you can drop an Invoke or a Call Integration action into a branch. We plan to support further actions in future releases. I will use Call Integration here - 



















I complete the mapping, then add a SWITH action after the Parallel Processing - here I will validate the results of the 2 invokes.













The SWITCH has access to the responses from both invokes -



Processing is simple - assign a success or failure message to a variable, which is then mapped to the integration response. Let's try it out!
















This new action has 2 great value-adds - 

1. Designtime models can more accurately reflect how the business works. 

2. Better Runtime performance. 

 












 



Tuesday, January 10, 2023

#947 OIC integration with OCI Queues

 


The OCI Queues service is now available under Developer Services - Application Integration section in your OCI console - 


Queues provides application decoupling, reliable message processing. OCI Queues auto-scales and can be invoked via REST.

Let's create a queue - ordersQueue.


 

 












So we see the queues is up and running.

Now to testing with the OC Queues API - for this we will need some information from the Queue itself -





we need the OCID, NOT the DLQ OCID!!!

We also require the Messages endpoint.

Apart from that, you will need your OCI tenancy OCID, your OCI user OCID. You need to create an API Key for your user and save the private and public keys, as well as the fingerprint.





















I downloaded the Queues section from the OCI REST collection available at postman.com. You can see that collection here.






































I then created an environment for OCI in my desktop Postman - 




I now try out the POST to create a message -


Please note, I have used a path variable to set the queue ocid - 


I check out the messages in the OCI console - 



Now to OIC...

Create an OCI Queues Connection 

Here I use the OIC REST adapter with security - OCI Signature Version 1 -






Now to the integration - it is very simple - essentially Rest trigger and the invoke of OCI Queues.

The REST Request payload is as follows - 

























Just to recap - the REST payload for the POST Message api call is in the following format - i.e. Message is a string.













I want to push the {order} structure to the queue - so I need to surface the json in a string. I do this in the Assign action below - 




Here is the Assign - takeaway here is to use \ to escape double quotes, comma etc.

























After initially publishing this post, my esteemed colleague - Valeria C. told me this could be simplified  - concat ('{', '"message"', ":", '"', /nssrcmpr:execute/ns15:request-wrapper/ns15:message, '"', '}' )
Simply wrap double quotes, commas etc. in single quotes. Net, net - there are 2 ways of doing this - the hard way or... 
 
Now on to the configuration of the Invoke of OCI Queues -








I map the v_orderAsString variable to the content field.

Let's test this out!



I check in the OCI Queues console - 




OCI Queues is another compelling tool in your OCI toolkit. Full documentation is available here. This also includes the relevant service limits section -