Open topic with navigation

TIBCO BusinessEvents® Enterprise Edition 6.3.1

# Sending an Asynchronous Request (Not Secure)

To send requests to an HTTP server asynchronously, use `sendAsynchronousRequest` function.

## Signature

    String sendAsynchronousRequest(String url, SimpleEvent requestEvent, String correlationId, String successCallbackRuleFunctionURL, String errorCallbackRuleFunctionURL, Object httpConnectionInfo)

## Description

Sends a request to the server specified by the `url` parameter. When TIBCO BusinessEvents receives a response, the callback function is called.

Returns a correlation ID, which is either passed as input, or is generated from the server if the parameter is null. This ID enables you to correlate a request with its response.

You can disable the cookies using the `disableCookies()` function. To ensure that the entire message along with the response header and the request body is sent at once, use `disableExpectContinueHeader()`.

For handling timeout case, you can set the java property `com.tibco.be.http.client.socketTimeout` with the required timeout period.

Set the property `be.engine.http.client.async.responseEventOnError.enabled` to true to pass an additional parameter (output event) to the errorCallback rulefunction specified in the`HTTP.sendAsynchronousRequest()` function. The default value of the property is false.

## Parameters

Name | Type | Description
--- | --- | ---
    url
    String
| The URL for the server that will receive this request.
    requestEvent
    SimpleEvent
| The event to serialize and send to the server.
    correlationID
    String
| An optional ID to correlate the request and the response. If not specified, the ID is generated by the server.
    successCallbackRuleFunctionURL
    String
| The fully qualified path of a rule function to be invoked for success case. This rule function is called when a successful response is received. The response event would contain the correlation ID. The rule function must have correlation ID, RequestEvent, and ResponseEvent as parameters.
    errorCallbackRuleFunctionURL
    String
| The fully qualified path of a rule function to be called in case of an error. This rule function is called when the response received indicates an error. The response event would contain the correlation ID. The parameter can be null. The rule function must have correlation ID, RequestEvent, and ResponseEvent as parameters.
    httpConnectionInfo
    Object
| HTTP Connection Info object.

## Returns

Type | Description
--- | ---
    String
| A correlation ID

Did you find this helpful?

YesNo
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 BusinessEvents® Enterprise Edition

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