EDB-JDBC JMS allows you to send and receive non-standard messages that are fully controlled by the API user. These messages don't support setting and getting properties. The process involves creating a user-defined type and setting it as the payload for the queue table.
This example shows how to create a Java Bean corresponding to the type you created:
Note
When you create a user-defined class, it must extend the com.edb.aq.operations.UDTType class and override the getParamValues() method. In this method, add the attribute values to an ArrayList in the same order as they appear in the CREATE TYPE SQL statement in the database.
Also make sure to use the annotation @CompareValue(0) with better methods, as it specifies the order of methods when using the reflection API to reconstruct the object after dequeuing the message from the queue.
Failure to meet these requirements may result in errors.
This example shows how to send an object of this class as a message:
This example shows how to receive this object as a message:
Nested types
This example shows how to use nested types in the user-defined types:
In this example, custom_type is using innercustom as another user-defined type that in turn is using the innermostcustom user-defined type. EDB Postgres Advanced Server supports the nested types this manner. However, it may have performance implications at a certain level. EDB JMS API also provides flexibility to read such nested types at the cost of an added performance impact.
To illustrate this using the EDB JMS API, you must first create the equivalent objects that represent nested custom types as shown in the examples that follow.
InnermostCustom.java
InnerCustom.java
CustomType.java
This example shows how to read these nested types: