342.4. RFC5424 Syslog 协议


可从 Camel 2.14 开始

要公开 Syslog 侦听器服务,我们重复使用现有的 camel-mina 组件或 camel-netty ,其中我们仅使用 SyslogDataFormat 进行汇总和解封消息

342.4.1. 公开 Syslog 侦听程序

在 Spring XML 文件中,我们将端点配置为在端口 10514 上侦听 udp 信息,请注意,在 netty 中,我们将禁用默认的Codec,允许一个回退到 NettyTypeConverter,并将消息作为 InputStream 传递:

<camelContext id="myCamel" xmlns="http://camel.apache.org/schema/spring">

    <dataFormats>
          <syslog id="mySyslog"/>
    </dataFormats>

    <route>
          <from uri="netty:udp://localhost:10514?sync=false&amp;allowDefaultCodec=false"/>
          <unmarshal ref="mySyslog"/>
          <to uri="mock:stop1"/>
    </route>

</camelContext>
Copy to Clipboard Toggle word wrap

使用 camel-mina的相同路由

<camelContext id="myCamel" xmlns="http://camel.apache.org/schema/spring">

    <dataFormats>
          <syslog id="mySyslog"/>
    </dataFormats>

    <route>
          <from uri="mina:udp://localhost:10514"/>
          <unmarshal ref="mySyslog"/>
          <to uri="mock:stop1"/>
    </route>

</camelContext>
Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat