Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

ctSysQueueOpen

Open or create a new queue.

Short Name

ctSysQueueOpen()

Type

ISAM function

Declaration

NINT ctSysQueueOpen(pTEXT qname, NINT qmode)

Description

ctSysQueueOpen() opens an existing queue or creates a new queue.

Parameter qname identify the queue to be opened. If the queue specified by qname does not exist, a new queue is created. Parameter qmode is currently reserved for future use and should be set to zero.

Register a queue list

In V11.6.1 and later, we support registering a system queue in a dedicated catalog of queues. This catalog is created as a memory file. Application can then access and query registered system queues. To use this feature, OR the ctSQ_MONITOR bit into the mode ctSysQueueOpen() call mode parameter. The memory file catalog is named $sysqueuemonitor.dat.

Example

An application opens $sysqueuemonitor.dat and reads records in this file, then queries the count of system queue entries for each queue. Example output:

16:26:42 - Logon to server...

16:26:42 - Open table...

16:26:45 - Update records...

16:26:45 - Logon to master server...

16:26:54 - Updated 50000 records locally in 12031 msecs - 4155.00 ops/sec

16:26:54 - Master pending queue: 9274

16:26:54 - Master notification queue local2: 3738

16:26:54 - Master notification queue local: 3608

16:26:56 - Master notification queue local2: 0

16:26:56 - Master notification queue local: 0

16:26:56 - Updated 50000 records to the master in 14031 msecs - 3563.00 ops/sec

16:26:56 - Close table...

16:26:56 - Logout...

When the queue is no longer needed, it must be closed by calling the close function ctSysQueueClose().

Return

ctSysQueueOpen() returns a queue handle on success, or a negative value on error.

Value

Symbolic Constant

Explanation

-454

NSUP_ERR

Service not supported.

See FairCom DB Error Codes for a complete listing of valid FairCom DB error values.

Example

NINT qhandle = ctSysQueueOpen("myqueue", 0);


if (qhandle < 0)

printf("ctSysQueueOpen failed with code %d\n", -qhandle);

Limitations

Client/Server mode only.

See also

ctSysQueueClose

TOCIndex