ActiveMQ配置初探

news2024/10/6 14:32:07

文章目录

  • 配置
    • 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.coloradmin.cn/o/954266.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

YOLO V5 和 YOLO V8 对比学习

参考文章&#xff1a; 1、YOLOv5 深度剖析 2、如何看待YOLOv8&#xff0c;YOLOv5作者开源新作&#xff0c;它来了&#xff01;? 3、anchor的简单理解 完整网络结构 YOLO v5和YOLO v8的Head部分 YOLO v8的Head 部分相比 YOLOv5 改动较大&#xff0c;换成了目前主流的解耦头结构…

半导体晶片机器视觉测量及MARK点视觉定位

半导体晶片机器视觉测量及MARK点视觉定位 客户的需求: 检测内容&#xff1a; SMT行业晶片位置角度与PCB板Mark点位置的测试测量 检测要求&#xff1a; 精度0.04mm&#xff0c;移动速度100mm/s 视觉可行性分析: 对样品进行了光学实验&#xff0c;并进行图像处理&#xff0c…

华为OD机试 - 硬件产品销售方案 - 回溯(Java 2023 B卷 200分)

目录 专栏导读一、题目描述二、输入描述三、输出描述四、补充说明五、解题思路六、Java算法源码七、效果展示1、输入2、输出3、说明 华为OD机试 2023B卷题库疯狂收录中&#xff0c;刷题点这里 专栏导读 本专栏收录于《华为OD机试&#xff08;JAVA&#xff09;真题&#xff08;…

【SVN】 代码版本管理工具使用步骤以及全局忽略不需要提交的文件夹

2023年&#xff0c;第36周。给自己一个目标&#xff0c;然后坚持总会有收货&#xff0c;不信你试试&#xff01; SVN是Subversion的简称&#xff0c;是一个开源的版本控制系统&#xff0c;用于管理软件开发过程中的代码版本和文件变更。 它提供了跟踪文件修改、协同开发、版本回…

上海市青少年算法2023年7月月赛(丙组)

T1先行后列 题目描述 从 1 开始的 nm 个整数按照先行后列的规律排列如下: 给定 n 与 m,再给定一个数字 c,请输出 c 所在的行数与列数。 输入格式 第一行:两个整数表示 n 与 m 第二行:一个整数表示 c 输出格式 两个整数:表示 c 所在的行数与列数。 数据范围 1≤n,m≤10000…

Oracle DBlink使用方法

DBlink作用&#xff1a;在当前数据库中访问另一个数据库中的表中的数据 create public database link dblink名称 connect to 对方数据库用户名 identified by 对方数据库用户密码 using (DESCRIPTION (ADDRESS_LIST (ADDRESS (PROTOCOL TCP)(HOST 要连接的数据库所在服务…

封闭式园区人员定位及轨迹跟踪管理系统的功能和作用

在当今充满竞争的商业环境中&#xff0c;企业安全和员工管理变得尤为重要。尤其是在封闭式园区这样的环境中&#xff0c;确保员工的安全和准确管理变得尤为关键。为了满足这一需求&#xff0c;封闭式园区人员定位及轨迹跟踪管理系统应运而生&#xff0c;该系统结合了最新科技和…

回文链表00

题目链接 回文链表 题目描述 注意点 回文的定义&#xff1a;回文就是反转以后和以前一样的就是回文结构用 O(n) 时间复杂度和 O(1) 空间复杂度解决此题 解答思路 用 O(n) 时间复杂度和 O(1) 空间复杂度解决此题要求有限遍历且避免使用O(n) 额外空间&#xff0c;避免使用 O…

护眼台灯拒交智商税!明基/SUKER书客/米家三款热门护眼台灯深度测评

Hello我是装修研究爱好者&#xff0c;最近后台收到多位家长们咨询&#xff0c;让推荐一款儿童护眼台灯 要求灯光质量和光源稳定&#xff0c;光线舒适护眼效果好的台灯&#xff0c;为此我开始整理儿童护眼台灯攻略 选护眼灯时首先必须关注与护眼相关的指标&#xff0c;其次在考…

打造高效便利的同城跑腿外卖小程序

随着移动互联网的发展&#xff0c;人们的生活方式发生了翻天覆地的变化。外卖行业作为其中的一部分&#xff0c;正日益蓬勃发展。为了满足用户对便利的需求&#xff0c;我们可以开发一个名为“同城跑腿外卖小程序”的应用&#xff0c;让用户能够轻松地下单外卖、送货上门以及处…

python编辑器推荐及配置

vscode首推,(个人喜好) 安装Python解释器 打开Python官网 https://www.python.org/ 在 Downloads 下面选择自己的对应系统&#xff0c;本文以 Windows 为例 下载完成后解压&#xff0c;双击 .exe 文件开始安装 注意勾选下面选项&#xff0c;将其 python.exe 添加到环境变量…

OA项目之会议通知(查询是否参会反馈详情)

目录 会议查询 是否参会 反馈详情 讲解思路 会议通知SQL语句分析 反馈详情SQL语句分析 后台代码编写 前端代码编写 效果预览 会议查询 MeetingFeedBack.java package com.zking.oa.model;import org.lisen.mvc.util.AutoIncrement; import org.lisen.mvc.util.…

Ubuntu入门04——目录与文件

目录 1.显示当前工作目录 2.更改目录 3.创建工作目录 4.删除工作目录 5.移动文件或者文件夹 6.文件夹and文件查看命令 7. 回到根目录&#xff0c;回到上一级 8.删除工作目录 9.查看目录和文件 10.以树状图列出目录内容 11.文件查找 12.在数据库中查找文件或目录 1…

从零开始学习数据服务API的最佳指南

随着互联网的快速发展&#xff0c;数据已经成为企业和个人的重要资产。为了更好地利用这些数据&#xff0c;数据服务API&#xff08;Data Service API&#xff09;应运而生。本文将为您介绍如何从零开始学习数据服务API的最佳指南&#xff0c;并推荐一款优秀的产品FDL&#xff…

[C/C++]内存管理,对内存进行操作

目录 一.内存结构 二.内存拷贝函数 三.栈空间与堆空间 四.变量的四种存储类型 五.函数返回值使用指针 六.常见错误总结 &#x1f388;个人主页&#xff1a;北海 &#x1f390;CSDN新晋作者 &#x1f389;欢迎 &#x1f44d;点赞✍评论⭐收藏✨收录专栏&#xff1a;C/C&…

如何让Midjourney角色保持一致的5个核心技巧

hi&#xff0c;同学们&#xff0c;我是赤辰&#xff0c;本期是赤辰第2期AI教程或推荐实用AI工具&#xff0c;文章底部准备了粉丝福利&#xff0c;看完可以领取&#xff01; 今天给大家介绍Midjourney5个控制AI绘画角色一致性的技巧。 近期整理了学员在使用Midjourney生图时遇…

KVM中的四种简单网络模型

KVM中的四种简单网络模型&#xff0c;分别如下&#xff1a; 1、隔离模型&#xff08;QEMU内置的用户模式网络&#xff08;user mode networking&#xff09;&#xff09;&#xff1a;虚拟机之间组建网络&#xff0c;该模式无法与宿主机通信&#xff0c;无法与其他网络通信&…

3D数字孪生技术应用到河道治理的整体方案

无论是城市还是农村的污水处理厂&#xff0c;在建设完毕并稳定运行以后&#xff0c;日常的巡检是最重要的现场管理环节。污水处理由于其自身工艺的特点&#xff0c;污水处理设备众多 &#xff0c;进水水质变化大&#xff0c;处理流程长&#xff0c;这期间需要经常对设备的运行情…

java安全问题处理

一、客户端的计算不可信 1、服务端计算价格&#xff0c;如果不这么做的话&#xff0c;很可能会被黑客利用&#xff0c;商品总价被恶意修改为比较低的价格。 二、客户端提交的参数需要校验 1、误以为客户端的数据来源是服务端&#xff0c;客户端就不可能提交异常数据 2、对参数进…

『PyQt5-Qt Designer篇』| 08 Qt Designer中容器布局和绝对布局的使用

08 Qt Designer中容器布局和绝对布局的使用 1 容器布局1.1 设计容器布局1.2 保存文件并执行2 绝对布局2.1 设计绝对布局2.2 保存文件并执行1 容器布局 1.1 设计容器布局 先拖入一个容器Frame容器,然后拖入几个控件: 把拖入的控件拖入容器中: 选中容器,右键-布局-栅格布局:…