zoukankan      html  css  js  c++  java
  • ActiveMQ(1) 初识ActiveMQ

    资源准备:

    apache-activemq-5.15.2-bin.zip

    解压后目录结构:

     

    试运行:选择bin目录, 选择自己系统版本相应的文件夹, 选择红框中的批处理脚本文件运行ActiveMQ。不要点击黄框中的批处理脚本文件, 点击那个批处理文件会出现cmd命令框闪退。

    初次运行会出现异常:

    jvm 1 | ERROR | Failed to start Apache ActiveMQ ([localhost, ID:201603140297-
    -57318-1491962087799-0:1], java.net.URISyntaxException: Illegal character in hos
    tname at index 17: ws://201603140297-:61614?maximumConnections=1000&wireFormat.m
    axFrameSize=104857600)

    选择conf目录,选择红框中的配置文件:

     

    出现这个问题的原因是默认配置文件中的默认配置为,系统识别不了0.0.0.0是哪台物理PC:

    1 <transportConnectors>
    2     <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
    3     <transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
    4     <transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
    5     <transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
    6     <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
    7     <transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
    8 </transportConnectors>

    解决方案→将上面的这段配置修改为:

    1 <transportConnectors>
    2     <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
    3     <transportConnector name="openwire" uri="tcp://127.0.0.1:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
    4     <transportConnector name="amqp" uri="amqp://127.0.0.1:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
    5     <transportConnector name="stomp" uri="stomp://127.0.0.1:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
    6     <transportConnector name="mqtt" uri="mqtt://127.0.0.1:1883?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
    7     <transportConnector name="ws" uri="ws://127.0.0.1:61614?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
    8 </transportConnectors>

    修改后启动:浏览器中输入 locahost:8161,出现下面这种画面说明启动成功。

    说明:8161为ActiveMQ 的默认端口。

    修改默认端口位置在conf目录中的 jetty.xml 文件。

    1 <bean id="jettyPort" class="org.apache.activemq.web.WebConsolePort" init-method="start">
    2     <!-- the default port number for the web console -->
    3     <property name="host" value="0.0.0.0"/>
    4     <property name="port" value="8161"/>
    5 </bean>
  • 相关阅读:
    [转]谈谈技术原则,技术学习方法,代码阅读及其它
    ImageMagick 详细安装使用 linux (jmagick)
    Sql Server中的表访问方式Table Scan, Index Scan, Index Seek
    在SQL Server中创建用户角色及授权
    LINQ to SQL:创建你的第一个程序
    Sql Server Statement Output
    内置系统账户:Local system/Network service/Local Service 区别
    SQL Server的备份
    SQL Server 使用Agent自动备份数据库
    将sql server 2000的备份文件导入到sql server 2012中
  • 原文地址:https://www.cnblogs.com/chinda/p/7954159.html
Copyright © 2011-2022 走看看