Open topic with navigation

TIBCO Rendezvous® 8.7.0

# tibrvcmTransport_CreateDistributedQueue()

Function

## Declaration

    tibrv_status tibrvcmTransport_CreateDistributedQueue(
        tibrvcmTransport*    cmTransport,
        tibrvTransport       transport,
        const char*          cmName);
    tibrv_status tibrvcmTransport_CreateDistributedQueueEx(
        tibrvcmTransport*    cmTransport,
        tibrvTransport       transport,
        const char*          cmName,
        tibrv_u32            workerWeight,
        tibrv_u32            workerTasks,
        tibrv_u16            schedulerWeight,
        tibrv_f64            schedulerHeartbeat,
        tibrv_f64            schedulerActivation);

## Purpose

Create a distributed queue member.

## Remarks

The new distributed queue transport must employ a valid transport for network communications.

All members of a distributed queue must listen to exactly the same set of subjects. See Enforcing Identical Subscriptions in TIBCO Rendezvous Concepts.

To destroy a distributed queue transport, call tibrvcmTransport_Destroy().

Parameter | Description
`cmTransport` | The program supplies a location, and the function stores the new distributed queue transport in that location. The distributed queue transport remains valid until the program explicitly destroys it.
`transport` | The new distributed `cmTransport` employs this transport object for network communications. Destroying the distributed `cmTransport` does not affect this transport. The program must explicitly call tibrvTransport_Destroy() to destroy this tibrvTransport when it is no longer needed.
`cmName` | Bind this reusable name to the new distributed `cmTransport`, so the distributed queue transport becomes a member of the distributed queue with this name. The name must be non-`NULL`, and conform to the syntax rules for Rendezvous subject names. It cannot begin with reserved tokens. It cannot be a non-reusable name generated by a call to tibrvcmTransport_Create(). It cannot be the empty string. For more information, see Reusable Names in TIBCO Rendezvous Concepts.
`workerWeight` | When the scheduler receives a task, it assigns the task to the available worker with the greatest worker weight. A worker is considered available unless either of these conditions are true:
| • | The pending tasks assigned to the worker member exceed its task capacity.
| • | The worker is also the scheduler. (The scheduler assigns tasks to its own worker role only when no other workers are available.)
Programs can set this parameter using the extended function. The brief form supplies the default value, `TIBRVCM_DEFAULT_WORKER_WEIGHT` (`1`).
`workerTasks` | Task capacity is the maximum number of tasks that a worker can accept. When the number of accepted tasks reaches this maximum, the worker cannot accept additional tasks until it completes one or more of them. When the scheduler receives a task, it assigns the task to the worker with the greatest worker weight—unless the pending tasks assigned to that worker exceed its task capacity. When the preferred worker has too many tasks, the scheduler assigns the new inbound task to the worker with the next greatest worker weight. Programs can set this parameter using the extended function. The value must be a non-negative integer. The brief form supplies the default value, `TIBRVCM_DEFAULT_WORKER_TASKS` (`1`). Zero is a special value, indicating that this distributed queue member is a dedicated scheduler (that is, it never accepts tasks). Warning Tuning task capacity to compensate for communication time lag is more complicated than it might seem. Before setting this value to anything other than 1, see Task Capacity in TIBCO Rendezvous Concepts.
`schedulerWeight` | Weight represents the ability of this member to fulfill the role of scheduler, relative to other members with the same name. Cooperating distributed queue transports use relative scheduler weight values to elect one transport as the scheduler; members with higher scheduler weight take precedence. Programs can set this parameter using the extended function. Acceptable values range from 0 to 65535. Zero is a special value, indicating that the member can never be the scheduler. The brief form supplies the default value, `TIBRVCM_DEFAULT_SCHEDULER_WEIGHT` (`1`). For more information, see Rank and Weight in TIBCO Rendezvous Concepts.
`schedulerHeartbeat` | The scheduler sends heartbeat messages at this interval (in seconds). All members with the same name must specify the same value for this parameter. The value must be strictly positive. To determine the correct value, see Step 4: Choose the Intervals in TIBCO Rendezvous Concepts. Programs can set this parameter using the extended function. The brief form supplies the default value, `TIBRVCM_DEFAULT_SCHEDULER_HB` (`1.0`).
`schedulerActivation` | When the heartbeat signal from the scheduler has been silent for this interval (in seconds), the member with the greatest scheduler weight takes its place as the new scheduler. All members with the same name must specify the same value for this parameter. The value must be strictly positive. To determine the correct value, see Step 4: Choose the Intervals in TIBCO Rendezvous Concepts. Programs can set this parameter using the extended function. The brief form supplies the default value, `TIBRVCM_DEFAULT_SCHEDULER_ACTIVE` (`3.5`).

Constant | Value
`TIBRVCM_DEFAULT_COMPLETE_TIME` | `0`
`TIBRVCM_DEFAULT_WORKER_WEIGHT` | `1`
`TIBRVCM_DEFAULT_WORKER_TASKS` | `1`
`TIBRVCM_DEFAULT_SCHEDULER_WEIGHT` | `1`
`TIBRVCM_DEFAULT_SCHEDULER_HB` | `1.0`
`TIBRVCM_DEFAULT_SCHEDULER_ACTIVE` | `3.5`

## Relationship to CM

Although distributed queue members are a specialized type of CM transport, their behavior is quite different. Distributed queue transports do not support any functions related to sending messages (for a complete list, see the table of disabled functions, below).

Scheduler recovery and task rescheduling are available only when the task message is a certified message (that is, a certified delivery agreement is in effect between the task sender and the distributed queue transport scheduler).

Disabled Functions
tibrvcmTransport_AddListener() tibrvcmTransport_AllowListener() tibrvcmTransport_DisallowListener() tibrvcmTransport_GetDefaultCMTimeLimit() tibrvcmTransport_GetLedgerName() tibrvcmTransport_GetRequestOld() tibrvcmTransport_GetSyncLedger() tibrvcmTransport_RemoveListener() tibrvcmTransport_RemoveSendState() tibrvcmTransport_ReviewLedger() tibrvcmTransport_Send() tibrvcmTransport_SendReply() tibrvcmTransport_SendRequest() tibrvcmTransport_SetDefaultCMTimeLimit() tibrvcmTransport_SyncLedger()

## See Also

tibrvcmTransport_Destroy()

Distributed Queue, in TIBCO Rendezvous Concepts

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO Rendezvous®

Copyright © 1997-2023. Cloud Software Group, Inc. All Rights Reserved.