Streaming Troubleshooting

If you are experiencing issues consuming the Streaming API, check the following:

Environment

  • Verify the OPERA environment from which you wish to stream events is listed on the Environments tab of the developer portal.

  • Verify the OPERA environment shows as Streaming Enabled on the Environments tab of the developer portal.

  • Verify you have valid credentials to obtain the oAuth token (see API Troubleshooting for more information).

  • Verify the oAuth token is current. They expire after 60 minutes.  If not, request a new oAuth token.Check the oAuth token is current. They expire after 60 minutes.  If not, request a new oAuth token.

Configuration

Ensure your application streaming configuration is both requested and approved (see Working with Events in the Developer Portal for more information).

Postman

Postman cannot send "ping" on an open WebSocket, so the connection will automatically close. When it closes, you must resend the "init" message and then resend the "subscribe" message.

It is not yet possible to save WebSocket requests in Postman, except when signed in to a Postman workspace.

GraphiQL

If you receive errors from GraphiQL, ensure you have it opened only once. It cannot support streaming events from different applications in different tabs (see Connecting to the Streaming API via GraphiQL for more information).

Not Receiving the Expected Data

If you are not receiving the pieces of data you expected, check the subscribe message to ensure it includes the expected field.

The hotelId will always be null for chain-level entities, such as profiles, which tend to be shared across all hotels in the chain.

Verify this page lists the expected data values for the event(s) to which you are subscribed (see the ‘Business Events - Activity’ heading under the Configuring Business Events topic in the OPERA Cloud User Guide).

Receiving Unexpected Events

Keep in mind that a single action, such as checking a guest in, can trigger multiple business event notifications because that single action modifies multiple resources.

For integration partners developing against the sandbox, keep in mind that the actions taken by other partners in the sandbox will generate events.

Not Receiving Expected Events

If you are not receiving all new reservations, it is possible the customer has an external CRS setup. Request the customer to set up a "publisher" on your external system (the external system code is displayed on the Application, Events, Subscribed tab in the developer portal) following this process (see the ‘Managing External System Publishers’ heading under the Configuring External Systems topic in the OPERA Cloud User Guide).

If you are not receiving any events, it is possible you have not connected for greater than 24 hours. In this case, stop the WebSocket and reopen it, specifying in the subscribe message the last offset you received.

Verify you are not unexpectedly using the "hotelId" filter in the subscribe message.

Getting Overwhelmed with Events

The Streaming API sends events as soon as they are available, so it is important that consuming architecture can scale and potentially buffer events to avoid choking database connections (see Streaming Best Practices for more information).

Other Errors

See the Errors topic for suggested resolutions to common errors.

If the "init" request is failing, ensure you send it within 5 seconds of the HTTP upgrade request.

If the connection keep closing:
  • Ensure you send "ping" every 15 seconds (see Keeping the Stream Open for more information).

  • Postman cannot send "ping," so the connection will automatically close.

  • Wait at least 500ms between closing and re-opening the WebSocket, or you will receive 4409 errors (see Disconnecting the WebSocket for more information).

  • Ensure that only one process/thread/user is connected to a given stream (identified by application key, URL, and chainCode) at any one time.

  • Ensure you have connected only one WebSocket per application: Connecting more than one WebSocket with the same application key will result in 4409 errors.

  • If the socket closes with a 4401 error, obtain a new oAuth token before reconnecting. The socket will automatically close every one hour when the oAuth token expires (see Keeping the Stream Open for more information).

  • Receiving a 4403 error:
    • Verify the chain to which you are subscribing in the subscribe message matches the chain for the integration user that was used in the oAuth request.

  • Receiving a 4409 error:

    • Ensure only one client or process consumes events from a given gateway using a given application key and chain code.

    • Ensure you send the Complete message before disconnecting from the WebSocket.

    • Ensure you send the ping message to keep the stream open (see Keeping the Stream Open for more information).

    • Reconnect after 5 minutes.

Confused About Implementation?

We adhere to the GraphQL over WebSocket protocol, so ensure your implementation meets this protocol.

An example implementation is available on this GitHub page.

It is suggested that you create a second application using the GraphiQL tool to better distinguish between implementation and configuration issues.