openQueue

openQueue(fullName: String;
          options:  String): JadeGenericQueue;

The openQueue method of the JadeMessagingFactory class is a factory method for creating and opening a messaging queue. It returns a transient instance of the JadeGenericQueue class from the information in the fullName parameter, which is a string specifying queue-related information.

The format of the fullName parameter is as follows.

transport-name :// queue-manager-name / queue-name

The components of the fullName parameter are listed in the following table.

Component Description
transport-name Name of the message queue transport.
queue-manager-name Address of the queue manager. Some transports require this to be localhost.
queue-name Name of the queue, formed from US-ASCII letters, digits, underscore, and the period. A trailing asterisk (*) indicates a mask from which a unique name is generated when the queue is opened.

Some transports require that the queue is created before it can be opened.

If the final character of the queue name is an asterisk (*) character, the queue manager replaces the asterisk with a system-generated string to create a unique queue name when the queue is opened.

If the openQueue method executes successfully, a queue is returned open for action. If the method fails (for example, if the format of the fullName parameter is invalid or the transport name is incorrect), an exception is raised.

The options parameter is a string that lists keywords with their associated values, if there are any. The keywords are separated by a semicolon and white space is ignored.

The following options are generically available.

Keyword Number of Values Allowed Values Example
Access Single

Public

Protected

Private

Access=Public

Access=Protected

Access=Private

Create Single

Never (queue must exist)

Always (queue must not exist)

Missing (if queue does not exist then create it)

Create=Never

Create=Always

Create=Missing

MustCreate (same as Create=Always) None   MustCreate
MustExist (same as Create=Never) None   MustExist
Usage Multiple Get, Put, Inq, All Usage="Get, Inq"
OtherUsage Multiple Get, Put, Inq, All Usage="Get, Inq"

The following example shows the use of the openQueue method.

vars
    factory : JadeMessagingFactory;
begin
    create factory transient;
    myQueue := factory.openQueue("JadeMQ://localnode/TestQ",
                                 "Access=Public; MustExist; Usage=Get,Put");
epilog
    delete factory;
end;

The following options are specific to the WebSphere MQ transport.

Keyword Description
Model Model=model-queue-name
MQSERVER MQSERVER=mq-server-setting. For details, see WebSphere MQ Clients documentation (csqzaf09.pdf); for example, MQSERVER=’CHANNEL/TCP/server.com(32001)’