Server-side setup v42.7.3.2
To use advanced queueing functionality on your JMS-based Java application, in EDB-PSQL or EDB-JDBC:
- Create a user-defined message type, which can be one of the standard JMS message types. However, EDB-JDBC also supports any user-defined message types. See Message types for details.
- Create a queue table specifying the payload type. This type is typically 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 can 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 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 tables, and queues programmatically. If you create the message types, queue table, and queue 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