Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 7. Atmosphere-Websocket
Atmosphere Websocket Servlet Component 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Available as of Camel 2.14
The atmosphere-websocket: component provides Websocket based endpoints for a servlet communicating with external clients over Websocket (as a servlet accepting websocket connections from external clients). The component uses the Chapter 132, SERVLET component and uses the Atmosphere library to support the Websocket transport in various Servlet containers (e..g., Jetty, Tomcat, ...).
Unlike the Chapter 163, Websocket component that starts the embedded Jetty server, this component uses the servlet provider of the container.
Maven users will need to add the following dependency to their
pom.xml
for this component:
URI Format 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
atmosphere-websocket:///relative path[?options]
atmosphere-websocket:///relative path[?options]
Reading and Writing Data over Websocket 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
An atmopshere-websocket 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 Read or Write Data 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
In the route below, Camel will read from the specified websocket connection.
from("atmosphere-websocket:///servicepath") .to("direct:next");
from("atmosphere-websocket:///servicepath")
.to("direct:next");
And the equivalent Spring sample:
In the route below, Camel will read from the specified websocket connection.
from("direct:next") .to("atmosphere-websocket:///servicepath");
from("direct:next")
.to("atmosphere-websocket:///servicepath");
And the equivalent Spring sample: