activeMQ Transport

来源:互联网 发布:下载图片报网络错误 编辑:程序博客网 时间:2024/04/19 21:44

    ActiveMQ目前支持的transport有:VM Transport、TCP Transport、SSL Transport、Peer Transport、UDP Transport、Multicast Transport、HTTP and HTTPS Transport、Failover Transport、Fanout Transport、Discovery Transport、ZeroConf Transport等。以下简单介绍其中的几种,更多请参考Apache官方文档。 
  
VM Transport 
    VM transport允许在VM内部通信,从而避免了网络传输的开销。这时候采用的连接不是socket连接,而是直接地方法调用。 第一个创建VM 连接的客户会启动一个embed VM broker,接下来所有使用相同的broker name的VM连接都会使用这个broker。当这个broker上所有的连接都关闭的时候,这个broker也会自动关闭。 
以下是配置语法:  
   vm://brokerName?transportOptions 

   例如:vm://broker1?marshal=false&broker.persistent=false 

   

Transport Options

Option Name

Default Value

Description

marshal

false

If true, forces each command sent over the transport to be marshalled and unmarshalled using a WireFormat

wireFormat

default

The name of the WireFormat to use

wireFormat.*

 

All the properties with this prefix are used to configure the wireFormat

create

true

If the broker should be created on demand if it does not already exist.

waitForStart

-1

If > 0, indicates the timeout in milliseconds to wait for a broker to start. Values -1 and 0 mean don't wait. Only supported in ActiveMQ 5.2+

broker.*

 

All the properties with this prefix are used to configure the broker. See Configuring Wire Formats for more information


TCP Transport
TCP transport 允许客户端通过TCP socket 连接到远程的broker。以下是配
置语法: 
    tcp://hostname:port?transportOptions 

0 0