ActiveMQ配置初探

文章目录

  • 配置
    • wrapper相关配置
      • wrapper是干什么用的
      • MQ的运行内存修改【需修改】
        • 修改内容
        • 题外话
      • wrapper.log配置【需修改】
        • 引起的问题
        • 优化方式
    • activemq.xml相关配置
      • 官网介绍
      • 配置管理后台的认证授权【建议修改】
      • 配置broker【根据自己需求更改】
        • 配置允许jmx监控
        • 关闭消息通知
        • 持久化发布订阅模式(topic)管理
          • 删除过期的消息
          • 删除已经不活跃额订阅者
        • 队列模式(queue)管理
          • 配置参数
        • 认证授权
          • 明文配置方式
            • activemq.xml中的配置
            • 代码中的配置
          • 加密配置方式
        • 统一配置时间
        • 死信队列抛弃策略
          • 死信队列是什么呢?
          • 配置方式
        • 持久化配置
          • kahaDB配置
        • 存储空间设置
    • kahaDB日志【测试时才用,测试环境和生产环境不能配置】
  • 示例配置
    • activemq.xml
  • 原文件
    • activemq.xml

配置

wrapper相关配置

wrapper是干什么用的

ActiveMQ官网上是这么写的(戳此跳转到官网页面):

ActiveMQ uses the Java Service Wrapper to run the broker. To configure how the Java Service Wrapper starts up, you can edit the wrapper.conf located in the bin/win32, bin/linux, or bin/macosx depending on which system you are running it. For more information on the different properties of the Java Service Wrapper, refer to this page

wrapper是个将java打包成windows或者unix的服务的一个工具。它同时还为应用程序提供日记功能,灵活的配置,可靠的运行性能,按需求重新启动,简化应用程序的安装等。

MQ的运行内存修改【需修改】

修改内容

当你下载MQ并解压之后,你会发现文件夹如下所示(下图中,上面为macox、linux版,下图为windows版)

image-20230828172643918

修改内存可通过修改wrapper.conf文件中的如下命令。

注意此处是通过什么方式启动,就修改哪个文件夹的wrapper.conf啊!比如你是win64启动方式,就改win64文件夹下的.conf,并且你运行的时候也是用win64文件夹下的activemq.bat哈

# Initial Java Heap Size (in MB)
# 等同于xms
wrapper.java.initmemory=1024

# Maximum Java Heap Size (in MB)
# 等同于xmx
wrapper.java.maxmemory=1024

题外话

在研究的过程中,发现了一个很有意思的东西,在此赘述下。

在bin文件夹下的activemq(unix可执行文件)的源代码中,发现了一个备注

# System variables for this script, like ACTIVEMQ_OPTS and ACTIVEMQ_OPTS_MEMORY,
# can be configured in 'env' script located in this directory.

并且在activemq(unix可执行文件)中,也能看到代码为

if [ -z "$ACTIVEMQ_OPTS" ] ; then
    ACTIVEMQ_OPTS="$ACTIVEMQ_OPTS_MEMORY -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=$ACTIVEMQ_CONF/login.config"
fi

然后编辑env文件(windows版没有该文件)其中有一段代码如下

if [ -z "$ACTIVEMQ_OPTS_MEMORY" ] ; then
    ACTIVEMQ_OPTS_MEMORY="-Xms64M -Xmx1G"
fi
if [ -z "$ACTIVEMQ_OPTS" ] ; then
    ACTIVEMQ_OPTS="$ACTIVEMQ_OPTS_MEMORY -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=$ACTIVEMQ_CONF/login.config"
fi

if [ -z "$ACTIVEMQ_OUT" ]; then
   ACTIVEMQ_OUT="/dev/null"
fi

也就是说,在此处也可以进行配置,经过测试发现,如果会用bin目录下的activemq进行启动(当然此处window没法用这个启动),就会使用到这个内存修改参数。

  • 如果此文件修改了,使用的bin/xxx/下的activemq,最终wrapper会覆盖掉这个文件夹下的参数;

  • 如果此文件修改了,使用的bin下的activemq,最终使用的是env下的参数;

下图为使用单独文件夹下的activemq启动,如图所示

image-20230829103450532

下图为使用bin目录下的activemq启动,如图所示

image-20230829103652430

两者启动的形成的命令行如下(在macos上,其余系统未尝试)

java -Xms64M -Xmx1G -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=/apache-activemq-5.16.6/conf/login.config -Dcom.sun.management.jmxremote -Djava.awt.headless=true -Djava.io.tmpdir=/apache-activemq-5.16.6//tmp -Dactivemq.classpath=/apache-activemq-5.16.6//conf:/apache-activemq-5.16.6//../lib/: -Dactivemq.home=/apache-activemq-5.16.6/ -Dactivemq.base=/apache-activemq-5.16.6/ -Dactivemq.conf=/apache-activemq-5.16.6//conf -Dactivemq.data=/apache-activemq-5.16.6//data -jar //apache-activemq-5.16.6//bin/activemq.jar start
/apache-activemq-5.16.6/bin/macosx/wrapper /apache-activemq-5.16.6/bin/macosx/wrapper.conf wrapper.syslog.ident=ActiveMQ wrapper.pidfile=/apache-activemq-5.16.6/bin/macosx/./ActiveMQ.pid wrapper.daemonize=TRUE
  
/usr/bin/java -Dactivemq.home=../.. -Dactivemq.base=../.. -Djavax.net.ssl.keyStorePassword=password -Djavax.net.ssl.trustStorePassword=password -Djavax.net.ssl.keyStore=../../conf/broker.ks -Djavax.net.ssl.trustStore=../../conf/broker.ts -Dcom.sun.management.jmxremote -Dorg.apache.activemq.UseDedicatedTaskRunner=false -Djava.util.logging.config.file=logging.properties -Dactivemq.conf=../../conf -Dactivemq.data=../../data -Djava.security.auth.login.config=../../conf/login.config -Xms1024m -Xmx1024m -Djava.library.path=../../bin/macosx/ -classpath ../../bin/wrapper.jar:../../bin/activemq.jar -Dwrapper.key=ZpwQ3RjSWlo75KaJ -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.pid=87518 -Dwrapper.version=3.2.3 -Dwrapper.native_library=wrapper -Dwrapper.service=TRUE -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1 org.tanukisoftware.wrapper.WrapperSimpleApp org.apache.activemq.console.Main start

从启动命令能大概看出来,使用wrapper的方式启动,能覆盖到直接用unix执行命令启动

wrapper.log配置【需修改】

引起的问题

ActiveMQ服务器data目录下wrapper.log文件,默认产生的日志是不覆盖的,文件的大小逐渐增大。累加后会出现文件越来越大。所以建议此处进行优化。找到以下代码进行修改。如下面因为所示,一个是最大的文件大小,和最多的文件数量。

优化方式

# Maximum size that the log file will be allowed to grow to before
#  the log is rolled. Size is specified in bytes.  The default value
#  of 0, disables log rolling.  May abbreviate with the 'k' (kb) or
#  'm' (mb) suffix.  For example: 10m = 10 megabytes.
wrapper.logfile.maxsize=20m

# Maximum number of rolled log files which will be allowed before old
#  files are deleted.  The default value of 0 implies no limit.
wrapper.logfile.maxfiles=100

activemq.xml相关配置

官网介绍

默认的activemq.xml的原文件,详见最后的源文件,其相关内容的配置,详见“极其复杂的官网配置页面”

配置管理后台的认证授权【建议修改】

activemq在登录管理后台的时候,是会需要账号密码的。如果需要修改管理后台的登录账号密码,可以修改"conf/jetty-realm.properties/jetty-realm.properties"文件,文件内容如下:

# Defines users that can access the web (console, demo, etc.)
# username: password [,rolename ...]
admin: admin, admin
user: user, user

修改形式为 “用户名: 密码, 角色”,此处角色是怎么配置的,比较复杂,可以见"conf/jetty-realm.properties/jetty.xml"

配置broker【根据自己需求更改】

broker就相当于一个Activemq实例

配置允许jmx监控

<!-- 允许使用jmx监控 -->
 <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}" useJmx="true">
 ...
 </broker>

关闭消息通知

消息通知指的是broker上的操作记录的跟踪和通知,可通过配置关闭

<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}" advisorySupport="false">
 ...
 </broker>

持久化发布订阅模式(topic)管理

按照官网的解释,系统中不应该有离线的持久化订阅者,这样会浪费众多资源。详见官网

所以建议配置以下参数

删除过期的消息

在对应的entry上增加expireMessagesPeriod配置,比如:

<!-- 每5分钟检查一下所有的过期消息,不配置的话,默认是30秒 -->
<policyEntry topic=">" expireMessagesPeriod="300000"/>
删除已经不活跃额订阅者

在broker的数据上增加以下参数

参数默认中文描述英文描述
offlineDurableSubscriberTimeout-1删除多久不活跃的订阅者(单位毫秒),如果配置为-1,则不删除Amount of time (in milliseconds) after which we remove inactive durable subs. Default -1, means don’t remove them
offlineDurableSubscriberTaskSchedule300000检查的频率(单位毫秒)How often we check (in milliseconds)

示例:

<!-- 每小时检查离线1天的订阅者 -->
<broker name="localhost" offlineDurableSubscriberTimeout="86400000" offlineDurableSubscriberTaskSchedule="3600000">
.....
</broker>

队列模式(queue)管理

详见官网

配置参数
参数名称描述配置数据
schedulePeriodForDestinationPurge检查非活跃状态的queue间隔3600000
gcInactiveDestinations声明该队列是否要被扫描到,默认是false
inactiveTimeoutBeforeGC声明该队列闲置多少秒被删除,默认60秒

其中上面的闲置,代表“无入队记录及无有效订阅”

示例

<!-- 每10秒检查一次 -->
<broker xmlns="http://activemq.apache.org/schema/core" schedulePeriodForDestinationPurge="10000">

  <destinationPolicy>
     <policyMap>
        <policyEntries>
        <!-- 所有队列,都被扫毛,闲置30秒就被删除-->
           <policyEntry queue=">" gcInactiveDestinations="true" inactiveTimoutBeforeGC="30000"/>
        </policyEntries>
     </policyMap>
  </destinationPolicy>
      
</broker>

认证授权

一个ActiveMQ,不能无认证授权的暴漏在外网中,如果这样,会出现信息泄露的风险。所以需要对ActiveMQ的broker进行认证授权配置,这样系统在连接MQ的时候,就必须配置账号密码,提高mq的安全。

明文配置方式
activemq.xml中的配置

在中,找到标签,在标签前增加以下插件配置:

<plugins>
  <simpleAuthenticationPlugin>
    <users>
        <authenticationUser username="账号" password="密码" groups="组别"/>
    </users>
  </simpleAuthenticationPlugin>
</plugins>

此处账号密码可以写死,也可以通过加载配置文件引入,常用的配置方式是使用activemq.xml里面默认引入的配置文件“credentials.properties”,然后使用里面的配置的用户名和密码

比如:

<plugins>
  <simpleAuthenticationPlugin>
    <users>
        <authenticationUser username="${activemq.username}" password="${activemq.password}" groups="users,admins"/>
        <authenticationUser username="guest" password="${guest.password}" groups="guests"/>
    </users>
  </simpleAuthenticationPlugin>
</plugins>

其中“credentials.properties”引入方式是通过(activemq.xml里面是默认使用的):

<!-- Allows us to use system properties as variables in this configuration file -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="locations">
        <value>file:${activemq.conf}/credentials.properties</value>
    </property>
</bean>

里面的内容是:

# Defines credentials that will be used by components (like web console) to access the broker

activemq.username=system
activemq.password=manager
guest.password=password
代码中的配置

此处是以springboot为例,代码中需要配置

spring:
  activemq:
    broker-url: tcp://127.0.0.1:61616
    user: system
    password: manager
加密配置方式

具体内容详见官网页面,未仔细研究,大概就是使用credentials_enc.properties的内容,密码形如“ENC(Cf3Jf3tM+UrSOoaKU50od5CuBa8rxjoL)”,如需要可以查看官网

统一配置时间

在broker中使用TimeStampPlugin插件,此为一个时间戳插件,官网解释为:TimeStampPlugin插件

参数默认描述英文描述
futureOnlyfalseWhen the plugin will never set a message’s time stamp and expiration time to a value lower than the original values. When the plugin always update a message’s time stamp and expiration time.truefalse
ttlCeiling0表示过期时间上限(程序写的过期时间不能超过此时间,超过则以此时间为准)When not zero, this value (in ms) limit the expiration time.
zeroExpirationOverride0表示过期时间(给未分配过期时间的消息分配过期时间)When not zero this value (in ms) will override the expiration time for messages that do not have an expiration already set.

也就是统一设置过期时间的上线和默认过期时间

<plugins>
			<!-- 设置全局过期时间 -->
			<!-- 86,400,000 ms = 1 day -->
			<timeStampingBrokerPlugin ttlCeiling="1800000"  zeroExpirationOverride="1800000" />
</plugins>

死信队列抛弃策略

死信队列是什么呢?

消息过期后会进入死信队列,如不想抛弃死信队列,默认进入ACTIVEMQ.DLQ队列,且不会自动清除;对于过期的消息进入死信队列还有一些可选的策略:放入各自的死信通道、保存在一个共享的队列(默认),且可以设置是否将过期消息放入队列的开关以及死信队列消息过期时间。

配置方式

使用discardingDLQBrokerPlugin插件,官网解释为:DiscardingDLQBrokerPlugin插件,按照自己的需求,配置一下内容即可

<plugins>
    <!-- 丢弃所有死信-->
    <discardingDLQBrokerPlugindropAll="true"  dropTemporaryTopics="true" dropTemporaryQueues="true" />
    <!-- 丢弃指定死信-->
    <discardingDLQBrokerPlugindropOnly="MY.EXAMPLE.TOPIC.29 MY.EXAMPLE.QUEUE.87" reportInterval="1000" />
    <!--使用丢弃正则匹配到死信-->
    <discardingDLQBrokerPlugindropOnly="MY.EXAMPLE.TOPIC.[0-9]{3} MY.EXAMPLE.QUEUE.[0-9]{3}" reportInterval="3000"/>
</plugins>

持久化配置

activemq默认的持久化方式为kahaDB,当然如果有特殊需求,还可以配置jdbc作为持久化源。

kahaDB配置

所有参数,详见官网

默认的kahaDB的配置,只有存储路径

<persistenceAdapter>
		<kahaDB directory="${activemq.data}/kahadb"/>
</persistenceAdapter>

可以增加以下配置

<persistenceAdapter>
		<!-- journalMaxFileLength:产生的日志文件最大容量 -->
		<kahaDB directory="${activemq.data}/kahadb"  journalMaxFileLength="32mb">
		</kahaDB>
</persistenceAdapter>

存储空间设置

注意,此处标签有两层,不是我多写了哈

<systemUsage>
  <systemUsage>
    <memoryUsage>
    <!-- 表示ActiveMQ使用的内存 -->
      <memoryUsage percentOfJvmHeap="70" />
    </memoryUsage>
    <storeUsage>
    <!-- 表示持久化存储文件的大小 -->
      <storeUsage limit="100 gb"/>
    </storeUsage>
    <tempUsage>
    <!-- 非持久化消息的临时内存大小 -->
      <tempUsage limit="50 gb"/>
    </tempUsage>
  </systemUsage>
</systemUsage>

kahaDB日志【测试时才用,测试环境和生产环境不能配置】

在log4j.properties中,增加以下参数,便可以输出kahadb的相关日志

### 测试kahadb,增加日志
log4j.appender.kahadb=org.apache.log4j.RollingFileAppender
log4j.appender.kahadb.file=${activemq.base}/data/kahadb.log
log4j.appender.kahadb.maxFileSize=1024KB
log4j.appender.kahadb.maxBackupIndex=5
log4j.appender.kahadb.append=true
log4j.appender.kahadb.layout=org.apache.log4j.PatternLayout
log4j.appender.kahadb.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
log4j.logger.org.apache.activemq.store.kahadb.MessageDatabase=TRACE, kahadb

示例配置

activemq.xml

<beans
  xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">

    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <value>file:${activemq.conf}/credentials.properties</value>
        </property>
    </bean>

    <bean id="logQuery" class="io.fabric8.insight.log.log4j.Log4jLogQuery"
          lazy-init="false" scope="singleton"
          init-method="start" destroy-method="stop">
    </bean>

    <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}" start="false" restartAllowed="false"
			schedulePeriodForDestinationPurge="3600000"
			useJmx="true" advisorySupport="false" offlineDurableSubscriberTimeout="12000" offlineDurableSubscriberTaskSchedule="6000" deleteAllMessagesOnStartup="true">

        <destinationPolicy>
            <policyMap>
              <policyEntries>
                <policyEntry topic=">" expireMessagesPeriod="60000">
                  <pendingMessageLimitStrategy>
                    <constantPendingMessageLimitStrategy limit="1000"/>
                  </pendingMessageLimitStrategy>
                </policyEntry>
                <policyEntry queue=">" 
								gcInactiveDestinations="true"  inactiveTimoutBeforeGC="21600000" 
								strictOrderDispatch="true" expireMessagesPeriod="60000">
                </policyEntry>
              </policyEntries>
            </policyMap>
        </destinationPolicy>

        <managementContext>
            <managementContext createConnector="false"/>
        </managementContext>

        <persistenceAdapter>
            <kahaDB directory="${activemq.data}/kahadb" lockKeepAlivePeriod="2000"  ignoreMissingJournalfiles="true" enableAckCompaction = "true" journalMaxFileLength="32mb">
				<locker>
					<shared-file-locker lockAcquireSleepInterval="10000" />
				</locker>
			</kahaDB>
        </persistenceAdapter>

		<plugins>
			<timeStampingBrokerPlugin ttlCeiling="1800000"  zeroExpirationOverride="1800000" />
            <discardingDLQBrokerPlugin dropAll="true" dropTemporaryTopics="true" dropTemporaryQueues="true" />
        </plugins>
          <systemUsage>
            <systemUsage>
                <memoryUsage>
                    <memoryUsage percentOfJvmHeap="70" />
                </memoryUsage>
                <storeUsage>
                    <storeUsage limit="100 gb"/>
                </storeUsage>
                <tempUsage>
                    <tempUsage limit="50 gb"/>
                </tempUsage>
            </systemUsage>
        </systemUsage>

        <transportConnectors>
            <transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
        </transportConnectors>

        <shutdownHooks>
            <bean xmlns="http://www.springframework.org/schema/beans" class="org.apache.activemq.hooks.SpringContextHook" />
        </shutdownHooks>

    </broker>
    <import resource="jetty.xml"/>

</beans>

原文件

activemq.xml

<!--
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<!-- START SNIPPET: example -->
<beans
  xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">

    <!-- Allows us to use system properties as variables in this configuration file -->
    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <value>file:${activemq.conf}/credentials.properties</value>
        </property>
    </bean>

   <!-- Allows accessing the server log -->
    <bean id="logQuery" class="io.fabric8.insight.log.log4j.Log4jLogQuery"
          lazy-init="false" scope="singleton"
          init-method="start" destroy-method="stop">
    </bean>

    <!--
        The <broker> element is used to configure the ActiveMQ broker.
    -->
    <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}">

        <destinationPolicy>
            <policyMap>
              <policyEntries>
                <policyEntry topic=">" >
                    <!-- The constantPendingMessageLimitStrategy is used to prevent
                         slow topic consumers to block producers and affect other consumers
                         by limiting the number of messages that are retained
                         For more information, see:

                         http://activemq.apache.org/slow-consumer-handling.html

                    -->
                  <pendingMessageLimitStrategy>
                    <constantPendingMessageLimitStrategy limit="1000"/>
                  </pendingMessageLimitStrategy>
                </policyEntry>
              </policyEntries>
            </policyMap>
        </destinationPolicy>


        <!--
            The managementContext is used to configure how ActiveMQ is exposed in
            JMX. By default, ActiveMQ uses the MBean server that is started by
            the JVM. For more information, see:

            http://activemq.apache.org/jmx.html
        -->
        <managementContext>
            <managementContext createConnector="false"/>
        </managementContext>

        <!--
            Configure message persistence for the broker. The default persistence
            mechanism is the KahaDB store (identified by the kahaDB tag).
            For more information, see:

            http://activemq.apache.org/persistence.html
        -->
        <persistenceAdapter>
            <kahaDB directory="${activemq.data}/kahadb"/>
        </persistenceAdapter>


          <!--
            The systemUsage controls the maximum amount of space the broker will
            use before disabling caching and/or slowing down producers. For more information, see:
            http://activemq.apache.org/producer-flow-control.html
          -->
          <systemUsage>
            <systemUsage>
                <memoryUsage>
                    <memoryUsage percentOfJvmHeap="70" />
                </memoryUsage>
                <storeUsage>
                    <storeUsage limit="100 gb"/>
                </storeUsage>
                <tempUsage>
                    <tempUsage limit="50 gb"/>
                </tempUsage>
            </systemUsage>
        </systemUsage>

        <!--
            The transport connectors expose ActiveMQ over a given protocol to
            clients and other brokers. For more information, see:

            http://activemq.apache.org/configuring-transports.html
        -->
        <transportConnectors>
            <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
            <transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
        </transportConnectors>

        <!-- destroy the spring context on shutdown to stop jetty -->
        <shutdownHooks>
            <bean xmlns="http://www.springframework.org/schema/beans" class="org.apache.activemq.hooks.SpringContextHook" />
        </shutdownHooks>

    </broker>

    <!--
        Enable web consoles, REST and Ajax APIs and demos
        The web consoles requires by default login, you can disable this in the jetty.xml file

        Take a look at ${ACTIVEMQ_HOME}/conf/jetty.xml for more details
    -->
    <import resource="jetty.xml"/>

</beans>
<!-- END SNIPPET: example -->

天行健,君子以自强不息;地势坤,君子以厚德载物

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/99666.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

ubuntu学习(五)----读取文件以及光标的移动

1、读取文件函数原型介绍 ssize_t read(int fd,void*buf,size_t count) 参数说明&#xff1a; fd: 是文件描述符 buf:为读出数据的缓冲区&#xff1b; count: 为每次读取的字节数&#xff08;是请求读取的字节数&#xff0c;读上来的数据保存在缓冲区buf中&#xff0c;同时文…

基于飞桨图学习框架的空间异配性感知图神经网络

本期文章将为大家分享飞桨社区开发者肖淙曦、周景博发表于数据挖掘顶会KDD2023的论文《Spatial Heterophily Aware Graph Neural Networks》。 肖淙曦 肖淙曦&#xff0c;百度研究院商业智能实验室研究实习生&#xff0c;中国科学技术大学在读博士生&#xff0c;主要从事时空…

CSC7203S 应用注意事项

CSC7203S 为高性能电流模式 PWM 开关电源功率转换器&#xff0c;满足绿色环保标准&#xff1b;广泛适用于经济型开关电源&#xff0c;如 DVD、机顶盒、传真机、打印机、LCD 显示器等。CSC7203S采用SOP-8封装。  内置 700V 高压功率开关管  输入电压&#xff08;85V~265V&a…

【Apollo学习笔记】——规划模块TASK之PATH_ASSESSMENT_DECIDER

文章目录 前言PATH_ASSESSMENT_DECIDER功能简介PATH_ASSESSMENT_DECIDER相关信息PATH_ASSESSMENT_DECIDER总体流程1. 去除无效路径2. 分析并加入重要信息给speed决策SetPathInfoSetPathPointType 3. 排序选择最优的路径4. 更新必要的信息 前言 在Apollo星火计划学习笔记——Ap…

时序预测 | MATLAB实现TCN-BiGRU时间卷积双向门控循环单元时间序列预测

时序预测 | MATLAB实现TCN-BiGRU时间卷积双向门控循环单元时间序列预测 目录 时序预测 | MATLAB实现TCN-BiGRU时间卷积双向门控循环单元时间序列预测预测效果基本介绍模型描述程序设计参考资料 预测效果 基本介绍 1.MATLAB实现TCN-BiGRU时间卷积双向门控循环单元时间序列预测&a…

SQL Server开启变更数据捕获(CDC)

一、CDC简介 变更数据捕获&#xff08;Change Data Capture &#xff0c;简称 CDC&#xff09;&#xff1a;记录 SQL Server 表的插入、更新和删除操作。开启cdc的源表在插入、更新和删除操作时会插入数据到日志表中。cdc通过捕获进程将变更数据捕获到变更表中&#xff0c;通过…

【校招VIP】产品面试之面试官的真实意图

考点介绍&#xff1a; 大厂面试时&#xff0c;面试官提出的问题除了了解经历和想法外&#xff0c;最看重的是思维逻辑能力、团队协作能力和协调能力。 『产品面试之面试官的真实意图』相关题目及解析内容可点击文章末尾链接查看&#xff01; 一、考点题目 1. 你遇到的最大的…

复杂性分析与算法设计:解锁计算机科学的奥秘

文章目录 算法复杂性分析的基本概念时间复杂度空间复杂度 常见的算法设计策略1. 分治法2. 贪心法3. 动态规划 算法设计的实际应用1. 网络路由2. 图像处理3. 人工智能 算法的选择和性能分析结论 &#x1f389;欢迎来到数据结构学习专栏~复杂性分析与算法设计&#xff1a;解锁计算…

linux中安装nodejs,卸载nodejs,更新nodejs,git,linux中安装nginx并配置

文章目录 node的安装与卸载&#xff08;更新版本&#xff09;卸载nodejs安装新版本node git安装与拉取代码安装解决 linux git 每次推拉(push/pull)代码都要输入用户名密码的问题 nginx 安装、配置和卸载安装nginx配置**.conf 文件内容 nginx 卸载 注意&#xff0c;我的是Ubunt…

buildAdmin的使用笔记

安装buildAdmin 下载完整包&#xff0c;解压进入 buildadmin 的文件夹&#xff0c; 输入命令 composer install 启动的时候使用&#xff0c; php think run 就可以了 为什么启动只需要&#xff0c; php think run 这种启动方式&#xff0c; 我是头一回看见 &#xff0c;后来才…

css-伪类:not实现列表最后一项没有样式

有了&#xff1a;not这个选择符&#xff0c;那么你将可以很好的处理类似这样的场景&#xff1a;假定有个列表&#xff0c;每个列表项都有一条底边线&#xff0c;但是最后一项不需要底边线。 示例&#xff1a; html: <ul><li>111111111111</li><li>21…

十二、集合(2)

本章概要 添加元素组集合的打印列表 List 添加元素组 在 java.util 包中的 Arrays 和 Collections 类中都有很多实用的方法&#xff0c;可以在一个 Collection 中添加一组元素。 Arrays.asList() 方法接受一个数组或是逗号分隔的元素列表&#xff08;使用可变参数&#xff…

2023开学礼《乡村振兴战略下传统村落文化旅游设计》许少辉农大图书馆

2023开学礼《乡村振兴战略下传统村落文化旅游设计》许少辉农大图书馆

百万级并发IM即时消息系统(3)配置数据初始化和前后端交互

04_配置数据初始化及前后端交互_哔哩哔哩_bilibili 1.配置文件 创建一个config文件夹以及一个app.yaml配置文件。 该文件专门存放一些关键配置&#xff0c;如mysql DNS路径和redis的addr账号密码等。 后期可以创建一个工具包和一些初始化方法&#xff0c;专门用来加载这些配…

C++、C#、JAVA 、 DELPHI、VB各个程序的优缺点你知道吗?

每种编程语言都有自己的优势和缺点&#xff0c;以下是对C、C#、Java、Delphi和VB的一些常见评价&#xff1a;C:优势&#xff1a;高性能、灵活性和可移植性强&#xff0c;适合对性能要求高的应用&#xff0c;可以进行系统级编程和嵌入式开发。缺点&#xff1a;语法复杂&#xff…

亚马逊云科技 re:Inforce 大会云安全合规与技术实践及 Security Jam 大赛,快来报名吧!...

‍‍ 2023年8月31日在北京 亚马逊云科技 re:Inforce 大会 首次登陆中国&#xff01; 我们期待您的莅临&#xff0c; 并与您一起迎接 AI 时代&#xff0c; 开启全面智能的安全旅程&#xff01; 在13:00-17:00的 培训与动手实验环节中 云安全合规与技术实践 及 Security Jam 大赛…

使用Spring Boot和Kafka实现消息发送和订阅

文章目录 一&#xff0c;新建Spring Boot1&#xff0c;Maven配置2&#xff0c;无法识别为SpringBoot项目3&#xff0c;无效的源发行版4&#xff0c;无法访问SpringApplication5&#xff0c;运行直接Finish6&#xff0c;服务运行成功 二&#xff0c;安装启动Kafka1&#xff0c;下…

2023年05月 C/C++(五级)真题解析#中国电子学会#全国青少年软件编程等级考试

第1题&#xff1a;问题求解 给定一个正整数N&#xff0c;求最小的M满足比N大且M与N的二进制表示中有相同数目的1。 举个例子&#xff0c;假如给定N为78&#xff0c;二进制表示为1001110&#xff0c;包含4个1&#xff0c;那么最小的比N大的并且二进制表示中只包含4个1的数是83&a…

如何更好的设计测试用例

测试用例设计的最基本要求&#xff1a;覆盖住所要测试的功能。这是再基本不过的要求了&#xff0c;但别看只是简单的一句话&#xff0c;要能够达到切实覆盖全面&#xff0c;需要对被测试产品功能的全面了解、明确测试范围(特别是要明确哪些是不需要测试的)、具备基本的测试技术…

【爬虫】实验项目二:模拟登录和数据持久化

目录 一、实验目的 二、实验预习提示 三、实验内容 实验要求 基本要求&#xff1a; 改进要求A&#xff1a; 改进要求B&#xff1a; 四、实验过程 基本要求&#xff1a; 源码如下&#xff1a; 改进要求A: 源码如下&#xff1a; 改进要求B&#xff1a; 源码如下&…
最新文章