activemq artemis address 详细配置实例

Wesley13
• 阅读 341

activemq artemis address 详细配置实例

https://my.oschina.net/zengfr

默认配置:

 <address-setting match="#">
            <dead-letter-address>DLQ</dead-letter-address>
            <expiry-address>ExpiryQueue</expiry-address>
            <redelivery-delay>0</redelivery-delay>
            <!-- with -1 only the global-max-size is in use for limiting -->
            <max-size-bytes>-1</max-size-bytes>
            <message-counter-history-day-limit>10</message-counter-history-day-limit>
            <address-full-policy>PAGE</address-full-policy>
            <auto-create-queues>true</auto-create-queues>
            <auto-create-addresses>true</auto-create-addresses>
            <auto-create-jms-queues>true</auto-create-jms-queues>
            <auto-create-jms-topics>true</auto-create-jms-topics>
<!--min-expiry-delay>86400000</min-expiry-delay> zfr 
<max-expiry-delay>102400000</max-expiry-delay-->
<expiry-delay>86400000</expiry-delay>
<auto-create-expiry-resources>true</auto-create-expiry-resources>
<expiry-queue-prefix></expiry-queue-prefix><!-- override the default-->
<expiry-queue-suffix>.EXP</expiry-queue-suffix>

                <auto-delete-queues>true</auto-delete-queues>
      <auto-delete-created-queues>true</auto-delete-created-queues>
      <auto-delete-queues-delay>86400000</auto-delete-queues-delay>
      <auto-delete-queues-message-count>0</auto-delete-queues-message-count>
      <config-delete-queues>FORCE</config-delete-queues>

      <auto-delete-addresses>true</auto-delete-addresses>
      <auto-delete-addresses-delay>86400000</auto-delete-addresses-delay>
      <config-delete-addresses>FORCE</config-delete-addresses>
         </address-setting>

Configuring Addresses and Queues via Address Settings

There are some attributes that are defined against an address wildcard rather than a specific address/queue. Here an example of anaddress-settingentry that would be found in thebroker.xmlfile.

<address-settings>
   <address-setting match="order.foo">
      <dead-letter-address>DLA</dead-letter-address>
      <auto-create-dead-letter-resources>false</auto-create-dead-letter-resources>
      <dead-letter-queue-prefix>DLQ.</dead-letter-queue-prefix>
      <dead-letter-queue-suffix></dead-letter-queue-suffix>
      <expiry-address>ExpiryQueue</expiry-address>
      <auto-create-expiry-resources>false</auto-create-expiry-resources>
      <expiry-queue-prefix>EXP.</expiry-queue-prefix>
      <expiry-queue-suffix></expiry-queue-suffix>
      <expiry-delay>123</expiry-delay>
      <redelivery-delay>5000</redelivery-delay>
      <redelivery-delay-multiplier>1.0</redelivery-delay-multiplier>
      <redelivery-collision-avoidance-factor>0.0</redelivery-collision-avoidance-factor>
      <max-redelivery-delay>10000</max-redelivery-delay>
      <max-delivery-attempts>3</max-delivery-attempts>
      <max-size-bytes>100000</max-size-bytes>
      <max-size-bytes-reject-threshold>-1</max-size-bytes-reject-threshold>
      <page-size-bytes>20000</page-size-bytes>
      <page-max-cache-size></page-max-cache-size>
      <address-full-policy>PAGE</address-full-policy>
      <message-counter-history-day-limit></message-counter-history-day-limit>
      <last-value-queue>true</last-value-queue> <!-- deprecated! see default-last-value-queue -->
      <default-last-value-queue>false</default-last-value-queue>
      <default-non-destructive>false</default-non-destructive>
      <default-exclusive-queue>false</default-exclusive-queue>
      <default-consumers-before-dispatch>0</default-consumers-before-dispatch>
      <default-delay-before-dispatch>-1</default-delay-before-dispatch>
      <redistribution-delay>0</redistribution-delay>
      <send-to-dla-on-no-route>true</send-to-dla-on-no-route>
      <slow-consumer-threshold>-1</slow-consumer-threshold>
      <slow-consumer-policy>NOTIFY</slow-consumer-policy>
      <slow-consumer-check-period>5</slow-consumer-check-period>
      <auto-create-jms-queues>true</auto-create-jms-queues> <!-- deprecated! see auto-create-queues -->
      <auto-delete-jms-queues>true</auto-delete-jms-queues> <!-- deprecated! see auto-delete-queues -->
      <auto-create-jms-topics>true</auto-create-jms-topics> <!-- deprecated! see auto-create-addresses -->
      <auto-delete-jms-topics>true</auto-delete-jms-topics> <!-- deprecated! see auto-delete-addresses -->
      <auto-create-queues>true</auto-create-queues>
      <auto-delete-queues>true</auto-delete-queues>
      <auto-delete-created-queues>false</auto-delete-created-queues>
      <auto-delete-queues-delay>0</auto-delete-queues-delay>
      <auto-delete-queues-message-count>0</auto-delete-queues-message-count>
      <config-delete-queues>OFF</config-delete-queues>
      <auto-create-addresses>true</auto-create-addresses>
      <auto-delete-addresses>true</auto-delete-addresses>
      <auto-delete-addresses-delay>0</auto-delete-addresses-delay>
      <config-delete-addresses>OFF</config-delete-addresses>
      <management-browse-page-size>200</management-browse-page-size>
      <default-purge-on-no-consumers>false</default-purge-on-no-consumers>
      <default-max-consumers>-1</default-max-consumers>
      <default-queue-routing-type></default-queue-routing-type>
      <default-address-routing-type></default-address-routing-type>
      <default-ring-size>-1</default-ring-size>
      <retroactive-message-count>0</retroactive-message-count>
      <enable-metrics>true</enable-metrics>
   </address-setting>
</address-settings>

The idea with address settings, is you can provide a block of settings which will be applied against any addresses that match the string in thematchattribute. In the above example the settings would only be applied to the address "order.foo" address but you can also usewildcardsto apply settings.

For example, if you used thematchstringqueue.#the settings would be applied to all addresses which start withqueue.

The meaning of the specific settings are explained fully throughout the user manual, however here is a brief description with a link to the appropriate chapter if available.

dead-letter-addressis the address to which messages are sent when they exceedmax-delivery-attempts. If no address is defined here then such messages will simply be discarded. Read more aboutundelivered messages.

auto-create-dead-letter-resourcesdetermines whether or not the broker will automatically create the defineddead-letter-addressand a corresponding dead-letter queue when a message is undeliverable. Read more in the chapter aboutundelivered messages.

dead-letter-queue-prefixdefines the prefix used for automatically created dead-letter queues. Read more in the chapter aboutundelivered messages.

dead-letter-queue-suffixdefines the suffix used for automatically created dead-letter queues. Read more in the chapter aboutundelivered messages.

expiry-addressdefines where to send a message that has expired. If no address is defined here then such messages will simply be discarded. Read more aboutmessage expiry.

auto-create-expiry-resourcesdetermines whether or not the broker will automatically create the definedexpiry-addressand a corresponding expiry queue when a message expired. Read more in the chapter aboutundelivered messages.

expiry-queue-prefixdefines the prefix used for automatically created expiry queues. Read more in the chapter aboutmessage expiry.

expiry-queue-suffixdefines the suffix used for automatically created expiry queues. Read more in the chapter aboutmessage expiry.

expiry-delaydefines the expiration time that will be used for messages which are using the default expiration time (i.e. 0). For example, ifexpiry-delayis set to "10" and a message which is using the default expiration time (i.e. 0) arrives then its expiration time of "0" will be changed to "10." However, if a message which is using an expiration time of "20" arrives then its expiration time will remain unchanged. Settingexpiry-delayto "-1" will disable this feature. The default is "-1". Read more aboutmessage expiry.

max-delivery-attemptsdefines how many time a cancelled message can be redelivered before sending to thedead-letter-address. Read more aboutundelivered messages.

redelivery-delaydefines how long to wait before attempting redelivery of a cancelled message. Default is0. Read more aboutundelivered messages.

redelivery-delay-multiplierdefines the number by which theredelivery-delaywill be multiplied on each subsequent redelivery attempt. Default is1.0. Read more aboutundelivered messages.

redelivery-collision-avoidance-factordefines an additional factor used to calculate an adjustment to theredelivery-delay(up or down). Default is0.0. Valid values are between 0.0 and 1.0. Read more aboutundelivered messages.

max-size-bytes,page-size-bytes, &page-max-cache-sizeare used to configure paging on an address. This is explainedhere.

max-size-bytes-reject-thresholdis used with the address fullBLOCKpolicy, the maximum size (in bytes) an address can reach before messages start getting rejected. Works in combination withmax-size-bytesfor AMQP clients only. Default is-1(i.e. no limit).

address-full-policy. This attribute can have one of the following values:PAGE,DROP,FAILorBLOCKand determines what happens when an address wheremax-size-bytesis specified becomes full. The default value isPAGE. If the value isPAGEthen further messages will be paged to disk. If the value isDROPthen further messages will be silently dropped. If the value isFAILthen further messages will be dropped and an exception will be thrown on the client-side. If the value isBLOCKthen client message producers will block when they try and send further messages. See theFlow ControlandPagingchapters for more info.

message-counter-history-day-limitis the number of days to keep message counter history for this address assuming thatmessage-counter-enabledistrue. Default is0.

last-value-queueisdeprecated. Seedefault-last-value-queue. It defines whether a queue only uses last values or not. Default isfalse. Read more aboutlast value queues.

default-last-value-queuedefines whether a queue only uses last values or not. Default isfalse. This value can be overridden at the queue level using thelast-valueboolean. Read more aboutlast value queues.

default-exclusive-queuedefines whether a queue will serve only a single consumer. Default isfalse. This value can be overridden at the queue level using theexclusiveboolean. Read more aboutexclusive queues.

default-consumers-before-dispatchdefines the number of consumers needed on a queue bound to the matching address before messages will be dispatched to those consumers. Default is0. This value can be overridden at the queue level using theconsumers-before-dispatchboolean. This behavior can be tuned usingdelay-before-dispatchon the queue itself or by using thedefault-delay-before-dispatchaddress-setting.

default-delay-before-dispatchdefines the number of milliseconds the broker will wait for the configured number of consumers to connect to the matching queue before it will begin to dispatch messages. Default is-1(wait forever).

redistribution-delaydefines how long to wait when the last consumer is closed on a queue before redistributing any messages. Read more aboutclusters.

send-to-dla-on-no-route. If a message is sent to an address, but the server does not route it to any queues (e.g. there might be no queues bound to that address, or none of the queues have filters that match) then normally that message would be discarded. However, if this parameter istruethen such a message will instead be sent to thedead-letter-address(DLA) for that address, if it exists.

slow-consumer-threshold. The minimum rate of message consumption allowed before a consumer is considered "slow." Measured in messages-per-second. Default is-1(i.e. disabled); any other valid value must be greater than 0. Read more aboutslow consumers.

slow-consumer-policy. What should happen when a slow consumer is detected.KILLwill kill the consumer's connection (which will obviously impact any other client threads using that same connection).NOTIFYwill send a CONSUMER_SLOW management notification which an application could receive and take action with. Read more aboutslow consumers.

slow-consumer-check-period. How often to check for slow consumers on a particular queue. Measured in_seconds_. Default is5. Read more aboutslow consumers.

auto-create-jms-queuesisdeprecated. Seeauto-create-queues. Whether or not the broker should automatically create a JMS queue when a JMS message is sent to a queue whose name fits the addressmatch(remember, a JMS queue is just a core queue which has the same address and queue name) or a JMS consumer tries to connect to a queue whose name fits the addressmatch. Queues which are auto-created are durable, non-temporary, and non-transient. Default istrue.

auto-delete-jms-queuesisdeprecated. Seeauto-delete-queues. Whether or not the broker should automatically delete auto-created JMS queues when they have both 0 consumers and 0 messages. Default istrue.

auto-create-jms-topicsisdeprecated. Seeauto-create-addresses. Whether or not the broker should automatically create a JMS topic when a JMS message is sent to a topic whose name fits the addressmatch(remember, a JMS topic is just a core address which has one or more core queues mapped to it) or a JMS consumer tries to subscribe to a topic whose name fits the addressmatch. Default istrue.

auto-delete-jms-topicsisdeprecated. Seeauto-delete-addresses. Whether or not the broker should automatically delete auto-created JMS topics once the last subscription on the topic has been closed. Default istrue.

auto-create-queues. Whether or not the broker should automatically create a queue when a message is sent or a consumer tries to connect to a queue whose name fits the addressmatch. Queues which are auto-created are durable, non-temporary, and non-transient. Default istrue.**Note:**automatic queue creation does_not_work for the core client. The core API is a low-level API and is not meant to have such automation.

auto-delete-queues. Whether or not the broker should automatically delete auto-created queues when they have both 0 consumers and the message count is less than or equal toauto-delete-queues-message-count. Default istrue.

auto-delete-created-queues. Whether or not the broker should automatically delete created queues when they have both 0 consumers and the message count is less than or equal toauto-delete-queues-message-count. Default isfalse.

auto-delete-queues-delay. How long to wait (in milliseconds) before deleting auto-created queues after the queue has 0 consumers and the message count is less than or equal toauto-delete-queues-message-count. Default is0(delete immediately). The broker'saddress-queue-scan-periodcontrols how often (in milliseconds) queues are scanned for potential deletion. Use-1to disable scanning. The default scan value is30000.

auto-delete-queues-message-count. The message count that the queue must be less than or equal to before deleting auto-created queues. To disable message count check-1can be set. Default is0(empty queue).

**Note:**the above auto-delete address settings can also be configured individually at the queue level when a client auto creates the queue.

For Core API it is exposed in createQueue methods.

For Core JMS you can set it using the destination queue attributesmy.destination?auto-delete=true&auto-delete-delay=120000&auto-delete-message-count=-1

config-delete-queues. How the broker should handle queues deleted on config reload, by delete policy:OFForFORCE. Default isOFF. Read more aboutconfiguration reload.

auto-create-addresses. Whether or not the broker should automatically create an address when a message is sent to or a consumer tries to consume from a queue which is mapped to an address whose name fits the addressmatch. Default istrue.**Note:**automatic address creation does_not_work for the core client. The core API is a low-level API and is not meant to have such automation.

auto-delete-addresses. Whether or not the broker should automatically delete auto-created addresses once the address no longer has any queues. Default istrue.

auto-delete-addresses-delay. How long to wait (in milliseconds) before deleting auto-created addresses after they no longer have any queues. Default is0(delete immediately). The broker'saddress-queue-scan-periodcontrols how often (in milliseconds) addresses are scanned for potential deletion. Use-1to disable scanning. The default scan value is30000.

config-delete-addresses. How the broker should handle addresses deleted on config reload, by delete policy:OFForFORCE. Default isOFF. Read more aboutconfiguration reload.

management-browse-page-sizeis the number of messages a management resource can browse. This is relevant for the "browse" management method exposed on the queue control. Default is200.

default-purge-on-no-consumersdefines a queue's defaultpurge-on-no-consumerssetting if none is provided on the queue itself. Default isfalse. This value can be overridden at the queue level using thepurge-on-no-consumersboolean. Read more aboutthis functionality.

default-max-consumersdefines a queue's defaultmax-consumerssetting if none is provided on the queue itself. Default is-1(i.e. no limit). This value can be overridden at the queue level using themax-consumersboolean. Read more aboutthis functionality.

default-queue-routing-typedefines the routing-type for an auto-created queue if the broker is unable to determine the routing-type based on the client and/or protocol semantics. Default isMULTICAST. Read more aboutrouting types.

default-address-routing-typedefines the routing-type for an auto-created address if the broker is unable to determine the routing-type based on the client and/or protocol semantics. Default isMULTICAST. Read more aboutrouting types.

default-consumer-window-sizedefines the defaultconsumerWindowSizevalue for aCOREprotocol consumer, if not defined the default will be set to 1 MiB (1024 * 1024 bytes). The consumer will use this value as the window size if the value is not set on the client. Read more aboutflow control.

default-ring-sizedefines the defaultring-sizevalue for any matching queue which doesn't havering-sizeexplicitly defined. If not defined the default will be set to -1. Read more aboutring queues.

retroactive-message-countdefines the number of messages to preserve for future queues created on the matching address. Defaults to 0. Read more aboutretroactive addresses.

enable-metricsdetermines whether or not metrics will be published to any configured metrics plugin for the matching address. Default istrue. Read more aboutmetrics.

点赞
收藏
评论区
推荐文章
blmius blmius
1年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录 问题 用navicat导入数据时,报错: 原因这是因为当前的MySQL不支持datetime为0的情况。 解决修改sql\mode: sql\mode:SQL Mode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。 全局s
Wesley13 Wesley13
1年前
activemq artemis address 详细配置
activemq artemis  address 详细配置 [https://my.oschina.net/zengfr](https://my.oschina.net/zengfr) '{"urn:activemq:core":auto-create-dead-letter-resources,  "urn:activemq:core":dead
Stella981 Stella981
1年前
KVM调整cpu和内存
一.修改kvm虚拟机的配置 1、virsh edit centos7 找到“memory”和“vcpu”标签,将 <name>centos7</name> <uuid>2220a6d1-a36a-4fbb-8523-e078b3dfe795</uuid>
Stella981 Stella981
1年前
ASMSupport教程4.9 生成三元运算符
<p>这节我们介绍如何用ASMSupport生成三元运算符(... ? ... : ... )运算符。我们预计生成如下代码:</p> <div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:935e30cc-3321-4e00-93ba-9834f3a4e044" class="wlWriterEditableS
Wesley13 Wesley13
1年前
MySQL查询按照指定规则排序
1.按照指定(单个)字段排序 select * from table_name order id desc; 2.按照指定(多个)字段排序 select * from table_name order id desc,status desc; 3.按照指定字段和规则排序 selec
Stella981 Stella981
1年前
Android蓝牙连接汽车OBD设备
//设备连接 public class BluetoothConnect implements Runnable {     private static final UUID CONNECT_UUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
Stella981 Stella981
1年前
Django中Admin中的一些参数配置
### **设置在列表中显示的字段,id为django模型默认的主键** list_display = ('id', 'name', 'sex', 'profession', 'email', 'qq', 'phone', 'status', 'create_time') ### **设置在列表可编辑字段** list_editable
Stella981 Stella981
1年前
Angular material mat
Icon Icon Name mat-icon code _add\_comment_ add comment icon <mat-icon> add\_comment</mat-icon> _attach\_file_ attach file icon <mat-icon> attach\_file</mat-icon> _attach\
Wesley13 Wesley13
1年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
#### 背景描述 # Time: 2019-01-24T00:08:14.705724+08:00 # User@Host: **[**] @ [**] Id: ** # Schema: sentrymeta Last_errno: 0 Killed: 0 # Query_time: 0.315758 Lock_
helloworld_34035044 helloworld_34035044
4个月前
皕杰报表之UUID
​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。 uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid() 或 uuid(sep)参数说明:sep 布尔值,生成的uuid中是否包含分隔符'',缺省为