Sunday, September 23, 2012

"Use Chunked Streaming Mode" in OSB 11g

Problem:

We experienced 3 issues in the behavior of our OSB 11g installation on ExaLogic:
1. Client requests get a read timed out error
2. The BEA-380000 error "Request Entity Too Large" appears in the logs
3. The last executed OSB instance continuously retries every 5 minutes

Solution:

1. For all your Business Services, under HTTP Transport Configuration, set "Use Chunked Streaming Mode" to "Disabled".

2. If this causes your OSB business service to double-invoke (i.e., invoke the target system twice for every one invocation), then do the following:

  • For all Proxy Services, View Message Flow, Edit Route Node(s), check on "Quality of Service" and set it to "Exactly Once".

Explanation:

The problem described above seems specific to OSB 11g running on ExaLogic with ExaLogic optimizations enabled. ExaLogic optimizations are set via the following parameter in the config.xml file:
<exalogic-optimizations-enabled>true</exalogic-optimizations-enabled>
By disabling chunking (with the ExaLogic optimizations enabled), all 3 problems described above are eliminated. However, it introduces a new problem in which OSB makes 2 invocations for every single invocation. This is worked around by enabling the QoS property.

Understanding Chunked Streaming

Oracle documentation states that the Chunked Streaming Mode property should be selected "if you want to use HTTP chunked transfer encoding to send messages." You normally want to enable chunked streaming if possible (with my problem above, it is not possible).

Chunked transfer encoding is an HTTP 1.1 specification, and allows clients to parse dynamic data immediately after the first chunk is read. Note that the Oracle documentation also states not to enable chunked streaming if you use the Follow HTTP Redirects option, as redirection and authentication cannot be handled automatically in chunked mode.

Understanding Quality of Service (QoS)

OSB supports reliable messaging. If the proxy service is configured to be transactional, an exactly-once QoS is already chosen by default (i.e., no action necessary on your part).

For whatever reason, disabling chunked streaming affects this default QoS behavior. I don't see any reason why you wouldn't want to explicitly set a QoS to exactly-once for every single proxy service. This means that "messages are delivered from inbound to outbound exactly-once... reliability is optimized."


References:

Applicable Versions:
  • Oracle Service Bus (OSB) 11g (11.1.1.5)

3 comments:

  1. Hi

    Was going through your post. As per my understanding, the Quality of Service is used for reliable messaging where if the service is transactional like XA the post of the message will be done in one transaction. In case of best effort a new thread is opened to post the message. But I am not able to co-related why OSB will be posting the message twice? Can you throw some light on it?

    Thanks,
    Rohan

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. I am truly impressed by the details which you have provided regarding to streaming. It is an interesting article for me as well as for others. Thanks for sharing such articles here.
    high quality live sports streaming services

    ReplyDelete