Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface EventHubClientOptions

Package version

Describes the options that can be provided while creating the EventHubClient.

  • dataTransformer: A set of encode/decode methods to be used to encode an event before sending to service and to decode the event received from the service
  • userAgent : A string to append to the built in user agent string that is passed as a connection property to the service.
  • websocket : The WebSocket constructor used to create an AMQP connection if you choose to make the connection over a WebSocket.
  • webSocketConstructorOptions : Options to pass to the Websocket constructor when you choose to make the connection over a WebSocket.
  • retryOptions : The retry options for all the operations on the client/producer/consumer. A simple usage can be { "maxRetries": 4 }.

Example usage:

{
    retryOptions: {
        maxRetries: 4
    }
}
interface

ClientOptions

Hierarchy

  • EventHubClientOptions

Index

Properties

Optional dataTransformer

dataTransformer: DataTransformer
property

The data transformer that will be used to encode and decode the sent and received messages respectively. If not provided then the DefaultDataTransformer is used which has the below encode & decode features

  • encode:
    • If event body is a Buffer, then the event is sent without any data transformation
    • Else, JSON.stringfy() is run on the body, and then converted to Buffer before sending the event
    • If JSON.stringify() fails at this point, the send operation fails too.
  • decode
    • The body receivied via the AMQP protocol is always of type Buffer
    • UTF-8 encoding is used to convert Buffer to string, and then JSON.parse() is run on it to get the event body
    • If the JSON.parse() fails at this point, then the originally received Buffer object is returned in the event body.

Optional retryOptions

retryOptions: RetryOptions
property

The retry options for all the operations on the client/producer/consumer. This can be overridden by the retry options set on the producer and consumer.

Optional userAgent

userAgent: undefined | string
property

The user agent that will be appended to the built in user agent string that is passed as a connection property to the Event Hubs service.

Optional webSocket

webSocket: WebSocketImpl
property

The WebSocket constructor used to create an AMQP connection over a WebSocket. This option should be provided in the below scenarios:

  • The TCP port 5671 which is what is used by the AMQP connection to Event Hubs is blocked in your environment.
  • Your application needs to be run behind a proxy server
  • Your application needs to run in the browser and you want to provide your own choice of Websocket implementation instead of the built-in WebSocket in the browser.

Optional webSocketConstructorOptions

webSocketConstructorOptions: any
property

Options to be passed to the WebSocket constructor when the underlying rhea library instantiates the WebSocket.

Generated using TypeDoc