Open topic with navigation

# Transport Restrictions with Inline Mode

Inline mode restricts underlying transports. Conformance with the following restriction must be ensured.

Restriction: When a transport is associated with an inline event queue, it cannot be associated with any other event queue.

Violating the restriction results in an illegal state exception. The add subscriber API call throws the exception when the program attempts to add a subscriber that would violate the principle.

When specifying inline mode, programmers must coordinate with administrators to avoid illegal state exceptions.

## Programmer Violation

The first diagram illustrates a violation attributable to programmer error. The programmer created two subscribers (S1 and S2) from a single endpoint (E1), and adds them to two event queues, at least one of which (Q1) is an inline queue. This situation would associate the underlying transport (T1) of the subscribers with two incompatible queues (Q1 and Q2), violating the restriction.

Figure 33: Illegal Inline Queue, Simple Case

To rectify the violation, either add both subscribers to a single inline event queue (Q1), or to two ordinary event queues, neither of which use inline mode.

## Hidden Violation

While it would appear straightforward for programmers to avoid the violation of the simple case of the first diagram, the situation is more complicated because responsibilities are divided between programmers and administrators.

From a programmer’s perspective, transports are ordinarily hidden behind endpoint names. Conversely, administrators can ordinarily employ transports to implement endpoints without understanding the specifics of subscribers and queues in application programs. However, inline mode tightly couples transport I/O to program code, which in turn blurs the usual separation of responsibilities between programmer and administrator. As a result, the restriction requires that programmers and administrators coordinate whenever a program uses inline event queues.

Consider the following example. The situation in the second diagram might appear correct from the separate perspectives of the programmer and the administrator, but combining their perspectives reveals a hidden violation.

Figure 34: Illegal Inline Queue, Hidden Violation

The programmer instantiates two subscribers (S1 and S2) on two separate endpoints (E1 and E2), and associates them with separate queues (Q1 and Q2). Q1 is an inline queue.

Meanwhile, the administrator employs a single transport (T1) to implement the two endpoints (E1 and E2).

Because T1 is associated with Q1, which is an inline queue, this arrangement violates the principle. When the program adds S2 to Q2, the add subscriber call throws an exception, whether or not Q2 uses inline mode.

By coordinating their information, the programmer and administrator can cooperate to avoid the violation in any of three ways:

- Use ordinary queues instead of inline mode.
- Use separate transports to implement the two endpoints E1 and E2 (see Separate Transports to Correct a Violation, which follows).
- Add subscribers S1 and S2 to only one inline queue (see Single Queue to Correct a Violation, which follows).

## Separate Transports to Correct a Violation

In the third diagram, transport T1 is associated with only one inline event queue, Q1. This arrangement does not violate the restriction.

Figure 35: Legal Inline Queue, Separate Transports

## Single Queue to Correct a Violation

In the fourth diagram, even though two subscribers (S1 and S2) share the same underlying transport (T1), they are associated with the same inline event queue (Q1). This arrangement does not violate the restriction.

Figure 36: Legal Inline Queue, Single Queue

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 FTL® - Enterprise Edition

Copyright © 2009-2024. Cloud Software Group, Inc. All Rights Reserved.