Wednesday, January 3, 2024

#1000 OIC GCP Pub/Sub adapter

Multicloud support has been a focus of the latest releases of OIC3, which now includes adapters for  

  • Azure Active Directory
  • Azure Event Grid
  • Azure Service Bus
  • Azure Storage
  • GCP Pub/Sub
  • GCP Storage
This post will look at the GCP Pub/Sub adapter

Again, the usual caveat - I am not a GCP expert, but here I cover what you need to demo usage of the adapter in OIC. Part 1 will cover using the adapter to Invoke GCP Pub/Sub, i.e. to push a message to a topic. Part 2 will look at using this adapter as a Trigger, i.e. the subscriber.

First step is to create a Google Cloud account - you will need a credit card, but this is for identification purposes. Once created, you get $300 or €271 credit.


Next step is to create a topic in Pub/Sub.


Now to the security stuff - 




 



Add the OIC callback url for your instance - 























Copy the client id and secret for future use - 


Go to the OAuth Consent screen, here you will have to add your google user, as this is a project in "Test" status.






Now to OIC - 


I create this connection for Invoke - as you can see, I add the project id of My First Project and the client id and secret.


I then click Provide Consent
Apologies for the German, but you see I am using the google account I added to the OAuth consent screen.


 
























The reason you see "already has some access" is because I am doing this for the second time.

That's it! Back in OIC - click Test


Create an integration - app driven. This will push a message to the topic, in my case, a simple order.





I then do the mapping, activate and run -


Check in GCP - 
I created a subscriber in GCP to pull the data. This was very easy - 


Part 2

Create a service account in your GCP project - 


I note the client id.

Next step is to - Create a user in the Oracle Cloud Infrastructure identity domain that has the same user name as the service account's client ID and assign it at least the ServiceInvoker role.


Then I create a new GCP Pub/Sub connection - 

Provide Consent as above. Then use the newly created connection as a trigger in a new app driven integration.






The only processing logic is a Logger action, which logs the orderNr.

I now test the invoke and trigger by pushing a new order to the topic - 






I check out the activity stream of the subscriber - 



No comments: