Enterprise Messaging With Autonomous DB and Micronaut

I’ve written about messaging many times on my blog, and for good reason, too. It’s a popular subject that developers can’t seem to get enough of. In this world of distributed architectures, it’s critical that services communicate with each other to ensure the application's business logic is implemented properly. It’s well established that messaging is crucial for modern applications, so let’s look at a messaging solution that exists in the Oracle Cloud that you may not be aware of. In fact, if you’re already using Autonomous DB, then this solution is available to you at no additional charge! Allow me to introduce you to Oracle Advanced Queuing (AQ). 

What’s AQ? It’s exactly what it sounds like: a full-featured messaging solution right inside the database. Point-to-point, pub/sub, persistent, and non-persistent messaging are all supported. There are tons of ways to interact — including via PL/SQL, JMS, JDBC, .NET, Python, Node.JS — and pretty much any popular language can interface with AQ. Demos tend to be the best way to understand concepts like this, so in this post, we’re going to look at how to enable AQ in your Autonomous DB instance, create a queue, and enqueue and dequeue messages with PL/SQL. To complete the demo, we’ll look at publishing and consuming messages from AQ from a very simple Java application written with Micronaut.