Thursday, February 22, 2024

#1010 AS2 Trigger / Invoke

The use case is to receive / send pdfs over AS2. No trading partner management is required.

I begin with the receive -

Create a Trigger AS2 Connection in OIC - 


Create a Sync Integration 


The logic is simple, just write the pdf to OIC File Server.

The Trigger configuration is basic - 






























The mapping uses the function - 



The target is - 


The FTP Invoke - 
























Let's try this out from Postman - 


I also added the AS2 headers - 


I check out the activity stream in OIC - 
























I check the ftp directory/folder for the file - 

note the file name - out-3.pdf. This is not the first time I've tested this!

So the basic inbound flow works.

Now let's look at using the AS2 adapter as an Invoke - 

Here I create a new scheduled integration that lists the files in the /In folder and then invokes the receive integration I just described.

The invoke connection uses the endpoint of the receive integration - 


The scheduled integration is as follows - 


The For-Each


Here is the configuration of the AS2 invoke - 


The mapping is simple - the reference returned by the GetFile operation has to be encoded to Base64 - 













That's it - let's test!

1 file processed - 


Check out the ftp folder - 




Monday, February 19, 2024

#1009 OIC Service Metrics and OCI Dashboards

 












OIC Service Metrics are available via your OIC instance page in the OCI console. 

The metrics names and description are as follows -



Let me start with a very simple example - a sync integration that waits a couple of seconds and then returns a success message -


I execute this 3 times and then check out the metrics - 

Received messages shows 3, 
same for Successful messages and Inbound requests - all set to 3.

The Inbound request processing time metric also surfaces.

I then check out Consumed messages (messages from a billing perspective) and see also 3




 I now run another sync integration - this one invokes the ATP adapter to write a new order to my Orders table.

























Back to the Service Metrics in OCI - I see the 1 new message in Successful messages, Receive Messages etc.

I also see the Outbound requests is 1 (the outbound request from the integration to ATP)

The metric for Outbound request invocation time also surfaces -

Time shown in msecs.

Finally, the one constant in all of this - Configured messages -  


This shows the number of message packs assigned to this instance.


The next scenario includes a sync integration that invokes another sync integration - 

This time I generate a DB error as I use the same orderNr (Primary Key).

I check the Messages failed count metric - 


It shows 2 here - 1 for the integration that writes to ATP and 1 for the integration that invokes it.

You will have seen the link to OCI Dashboards, while playing around with the Service Metrics -

Let's now look at them 


I add a widget - 

I create my first widget - 


Then add a few more - 


We can also create alarms based on these metrics - 

Let's create one on the Message Failed Count metric - 


I define the alarm as follows - 


I run the integration 3 times, each time with an error.

I see the 3 errors on the alarm data tab - 


I also get the relevant email - 







#1008 OIC Rapid Adapter Builder resources


The official docs are now online here.

So the key steps to get up and running are - 

1. Download Visual Code from here.


2. Download the OIC extension from here.





Now read the documentation! 

Sunday, February 11, 2024

#1007 OCI Policies for DevLive Lab London 2024

This is more of a note for the folks doing the hands on lab at DevLive 24 in London. The OIC lab involves uploading a .csv file from OIC FileServer to ATP. It is a bulk upload that will leverage OCI Object Storage. 

Here I detail the OCI policies required to -

  • manage object storage
  • manage OIC
  • manage ATP

Create a new user in OCI

I began by creating a user and assigning them to the following group - 





Grant Access to Object Storage

Per default - everything is locked down - 


I now grant access to the group - users will need to be able to create a bucket so I assign the manage verb.



As you can see, my newly created user now has access to OCI Object Storage.

Grant Access to ATP

Again, per default - no access to ATP.

I create the following policy - 
























Now my newly created user can see the ATP instance I already created - 


The user can click on the link and then select SQL - 


User is automatically in the ADMIN user schema - 

But also has the ability to create a new DB user e.g.
 

User can then login as DBTESTUSER  - 









Maybe do this is in incognito / private window.


Note, this user cannot create a new ATP DB instance - 

For that you would need to apply the manage verb, when creating the ATP policy.

However, this user can create tables etc. in their schema.


Grant Access to OIC instance

As to be expected, the newly created user has no access to the OIC instance.

Let's grant her access to an existing OIC instance.

This is the instance to which I will be granting access - 


I check for this instance in my Identity Domain - Oracle Cloud Services - 



I choose the Service Developer role and click Assign Groups -


I now validate that my newly created user can access the homepage of this OIC instance.

And she can -


However, the user still has no access to OIC at OCI level. i.e. she cannot create a new OIC instance or check out the service metrics etc. 

For that I require a new Policy -  

allow group DevLiveUsers to manage integration-instance in compartment DevLiveLondon24




Now the user has access -