Server-side setup v42.7.3.1
To use advanced queueing functionality on your JMS-based Java application perform following steps in EDB-PSQL or EDB-JDBC:
- Create a user-defined message type, which may be one of the standard JMS message types. However, EDB-JDBC also supports any user-defined message types. These message types will be covered in detail in the upcoming sections.
- Create a queue table specifying the payload type. This type will typically be the one created in step 1.
- Create a queue using the queue table created in the previous step.
- Start the queue on the database server.
- You have the option to use either EDB-PSQL or EDB-JDBC JMS API in your Java application.
Using EDB-PSQL
Invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Use the SPL commands in EDB-PSQL to:
Create a user-defined type
To specify a RAW data type, create a user-defined type.
This example shows how to create a user-defined type named as mytype
:
Create the queue table
A queue table can hold multiple queues with the same payload type.
This example shows how to create a queue table named MSG_QUEUE_TABLE
:
Create the queue
This example shows how to create a queue named MSG_QUEUE
in the table MSG_QUEUE_TABLE
:
Start the queue
Once the queue is created, start the queue.
This example shows how to start a queue in the database:
Using EDB-JDBC JMS API
Tip
The following sequence of steps is required only if you want to create message types, queue table and queue programmatically. If the message types, queue table, and queue are created using EDB-PSQL then you can use the standard JMS API.
The following JMS API calls perform the same steps performed using EDB-PSQL to:
- Connect to the EDB Postgres Advanced Server database
- Create the user-defined type
- Create the queue table and queue
- Start the queue