Friday, June 16, 2023

OIC - How to call "upload as attachement REST integration" from another integration in Oracle Integration

Usecase: In my previous blogs, I have shown you how to upload single or multiple attachments in REST API. Here, I will show how to call that exposed REST API service from another integration.

For upload attachment in Rest API:

https://soalicious.blogspot.com/2023/06/oic-upload-attachment-in-rest-api.html

For upload multiple attachments in REST API:

https://soalicious.blogspot.com/2023/06/oic-upload-multiple-attachements-in.html


Logic steps:

  1. Create an OIC self REST invoke connection so that we can call the OIC rest upload attachment service.
  2. Confugure a rest trigger to get the employee details as json.
  3. Take a stage and write a file for example Employee.csv using sample CSV file and map the request employees to the csv file.
  4. Drag and drop the created OIC self connection and configure rest invoke with POST verb and resource URI of the upload attachment rest service. Take the request as multipart form-data.
  5. Map the stage file reference to attachement reference and provide content type as "text/CSV" and partname as filename of the stage write response.

Implementation steps with screenshots:

Create OIC self connection:


Integration flow:



Configure Rest Trigger





Stage to write a file:






Invoke rest upload attachment service






Notes: 
  • Content type should be mapped while invoking to Rest upload attachment integration. This case we have mapped as "text/CSV", otherwise you will get the error:  An error occurred while invoking the rest endpoint .[[Media type is null.]]. The 406 Not acceptable is an HTTP response statue code indicating that the client has requested a response using accept-headers that the server is unable to fulfill.

Thursday, June 15, 2023

OIC - Upload multiple attachements in REST API Oracle Integration

UseCase: We will upload multiple files as attachments to REST API and then for each file, we will write it to stage and then zip the files and wite the zip file to FTP directory.

Highlevel steps:

  • Configure a rest trigger with POST verb and select request as multipart with payload options.
  • Take a for each action and assign for each attachment repeating element.
  • Take a stage and write the file into stage using opaque schema and encodeReferenceToBase64() function.
  • Outside of for each, Take another stage and zip the files.
  • Drag and drop a FTP connection and write the zip file to a ftp ditectory. 


Implementation steps(with screenshots):


















Add tracking, save , activate and test.





OIC - Upload attachment in REST API Oracle Integration Cloud

UseCase: We will upload a CSV file as attachment to REST API and then parse the CSV file and send back the contents as json back to the consumer.

Highlevel steps:

  • Configure a rest trigger with POST verb and select request as multipart with payload options and response as a json payload
  • Take a stage and write the file into stage using opaque schema and encodeReferenceToBase64() function.
  • Take another stage and read the file using sample deilimited doc.
  • Map the read contents to rest response.

Json response payload:

[{

"FirstName":"",

"LastName":"",

"Designation":""

}]

For opaque schema:

https://soalicious.blogspot.com/2022/02/xsd-opaque-schema.html


Detailed implementation steps: 

Integration flow:


Steps:


















Wednesday, June 14, 2023

OIC - Advantages using Oracle Integration Publish and Subscribe model

This pattern involves the publisher and the subscriber relying on a message broker, AES, that relays messages from the publisher to the subscribers. The host (publisher) publishes messages (events) with a set schema (event type) to a channel that subscribers can then sign up to (subscribe).

There are several advantages to using OIC Pub/Sub:

  1. It allows messages to move between different integrations without integrations being aware of each other. This means you can simplify a complicated synchronous integration to smaller asynchronous integrations. In other words, you can have loose coupling between your integrations to make them more maintainable.
  2. It provides fast and scalable expansion. You can easily add additional subscribers to an existing Pub/Sub pattern, without any concerns about interrupting the existing event flow from publishers to subscribers.
  3. It allows for fast and real-time integrations of dispersed systems. Events are made available to multiple integrations for consumption, allowing applications across your organization to simultaneously receive relevant payload.

OIC - How to change From address for email Notification

If we use a "from" address in the email address in the email notification action, it will not be reflected. We can configure a from address from settings. If no email address is configured, a default from address will be used.

To change a from address we have to perform following 2 steps:

  1. Register the from address in Settings >> integrations >> Notification
  2. Configure SPF and DKIM on the sender domain. For example, if you want from address as no-reply@oraclecloud.com, then you have to configure the sender domain i.e, oraclecloud.com

Go to Settings >> integrations >> Notification >> you will see default from address.


For more details, follow the reference:




OIC - Why Scheduled Integrations are not executing on Time.

Scheduled integrations may be queued and not execute on time as scheduled for the following reasons:

  • There is a running instance of the same scheduled integration. No new instance of the same integration is executed until the running instance completes.
  • The throtting limit for scheduled integrations has been reached. No new scheduled integrations ate executed until the number of scheduled integrstions being executed falls below the throtting limit.
More, a scheduled integration is considered stuck when the total execution time exceeds six hours.

OIC - Maximum duration for integration flows | time out time for OIC services | Service limit for Scheduled orchestration or Async or Sync service

For Async integrations: Six hours (the instance is marked as aborted due to deadline timeout)

For Scheduled integrations: Six hours (the instance is marked as aborted due to deadline timeout)

For Synchronous integrarions: Five minutes (An HTTP 502 occurs).


Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...