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 73. IRC
IRC Component 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
The irc component implements an IRC (Internet Relay Chat) transport.
URI format 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
irc:nick@host[:port]/#room[?options]
irc:nick@host[:port]/#room[?options]
In Apache Camel 2.0, you can also use the following format:
irc:nick@host[:port]?channels=#channel1,#channel2,#channel3[?options]
irc:nick@host[:port]?channels=#channel1,#channel2,#channel3[?options]
You can append query options to the URI in the following format,
?option=value&option=value&...
Options 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Name | Description | Example | Default Value |
---|---|---|---|
channels
|
New in 2.0, comma separated list of IRC channels to join. |
channels=#channel1,#channel2
|
null
|
nickname
|
The nickname used in chat. |
irc:MyNick@irc.server.org#channel or irc:irc.server.org#channel?nickname=MyUser
|
null
|
username
|
The IRC server user name. |
irc:MyUser@irc.server.org#channel or irc:irc.server.org#channel?username=MyUser
|
Same as nickname. |
password
|
The IRC server password. |
password=somepass
|
None |
realname
|
The IRC user's actual name. |
realname=MyName
|
None |
colors
|
Whether or not the server supports color codes. |
true, false
|
true
|
onReply
|
Whether or not to handle general responses to commands or informational messages. |
true, false
|
false
|
onNick
|
Handle nickname change events. |
true, false
|
true
|
onQuit
|
Handle user quit events. |
true, false
|
true
|
onJoin
|
Handle user join events. |
true, false
|
true
|
onKick
|
Handle kick events. |
true, false
|
true
|
onMode
|
Handle mode change events. |
true, false
|
true
|
onPart
|
Handle user part events. |
true, false
|
true
|
onTopic
|
Handle topic change events. |
true, false
|
true
|
onPrivmsg
|
Handle message events. |
true, false
|
true
|
trustManager
|
New in 2.0, the trust manager used to verify the SSL server's certificate. |
trustManager=#referenceToTrustManagerBean
|
The default trust manager, which accepts all certificates, will be used. |
keys
|
Camel 2.2: Comma separated list of IRC channel keys. Important to be listed in same order as channels. When joining multiple channels with only some needing keys just insert an empty value for that channel. |
irc:MyNick@irc.server.org/#channel?keys=chankey
|
null
|
sslContextParameters |
*Camel 2.9:* Reference to an org.apache.camel.util.jsse.SSLContextParameters object in the Registry. This reference overrides any configured SSLContextParameters at the component level. See chapter "Configuring Transport Security for Camel Components" in "Security Guide" and the section called “Using the JSSE Configuration Utility”. Note that this setting overrides the trustManager option.
|
\#mySslContextParameters |
null
|
Using the JSSE Configuration Utility 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
As of Camel 2.9, the IRC component supports SSL/TLS configuration through the http://camel.apache.org/http4.html#HTTP4-UsingtheJSSEConfigurationUtility. This utility greatly decreases the amount of component-specific code you need to write, and it is configurable at the endpoint and component levels The following examples demonstrate how to use the utility with the IRC component.
Programmatic configuration of the endpoint 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Spring DSL based configuration of endpoint 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Using the legacy basic configuration options 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
You can also connect to an SSL enabled IRC server, as follows:
ircs:host[:port]/#room?username=user&password=pass
ircs:host[:port]/#room?username=user&password=pass
By default, the IRC transport uses SSLDefaultTrustManager. If you need to provide your own custom trust manager, use the
trustManager
parameter as follows:
ircs:host[:port]/#room?username=user&password=pass&trustManager=#referenceToMyTrustManagerBean
ircs:host[:port]/#room?username=user&password=pass&trustManager=#referenceToMyTrustManagerBean
Using keys 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Available as of Camel 2.2 Some irc rooms requires you to provide a key to be able to join that channel. The key is just a secret word.
For example we join 3 channels where as only channel 1 and 3 uses a key.
irc:nick@irc.server.org?channels=#chan1,#chan2,#chan3&keys=chan1Key,,chan3key
irc:nick@irc.server.org?channels=#chan1,#chan2,#chan3&keys=chan1Key,,chan3key