Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Available as of Camel 2.14

The ahc-ws: component provides Websocket based endpoints for consuming external resources accessible a client communicating with external servers over Websocket (as a client opening a websocket connection to call an external servers using Websocketserver).
The component uses the ahc AHC component that in turn uses the Async Http Client library.

...

Code Block
xml
xml
<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-ahc-ws</artifactId>
    <version>x.x.x</version>
    <!-- use the same version as your Camel core version -->
</dependency>

URI

...

Format

Code Block
ahc-ws://hostname[:port][/resourceUri][?options]
ahc-wss://hostname[:port][/resourceUri][?options]

...

As the AHC-WS component is based on the AHC component, you can use the various configuration options of the AHC component.

Writing and Reading Data over Websocket

An ahc-ws endpoint can either write data to the socket or read from the socket, depending on whether the endpoint is configured as the producer or the consumer, respectively.

Configuring URI to

...

Write or Read Data

In the route below, Camel will write to the specified websocket connection.

...

Include Page
Endpoint See Also
Endpoint See Also