From 12280cdaaa313a01ade5b5cd41134a1d3b0abbb6 Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Mon, 26 Oct 2020 21:23:29 -0400 Subject: [PATCH] ARTEMIS-2937 DOCS & Examples on AMQP Broker Connection --- .../test/resources/artemis-configuration.xsd | 446 +++++++++++++++++- docs/user-manual/en/SUMMARY.md | 1 + .../user-manual/en/amqp-broker-connections.md | 238 ++++++++++ .../amqp-receiving-messages/pom.xml | 165 +++++++ .../amqp-receiving-messages/readme.md | 7 + .../jms/example/BrokerConnectionReceiver.java | 81 ++++ .../resources/activemq/server0/broker.xml | 117 +++++ .../resources/activemq/server1/broker.xml | 110 +++++ .../amqp-sending-messages/pom.xml | 165 +++++++ .../amqp-sending-messages/readme.md | 7 + .../jms/example/BrokerConnectionSender.java | 78 +++ .../resources/activemq/server0/broker.xml | 117 +++++ .../resources/activemq/server1/broker.xml | 110 +++++ .../amqp-sending-overssl/pom.xml | 165 +++++++ .../amqp-sending-overssl/readme.md | 15 + .../example/BrokerConnectionSenderSSL.java | 78 +++ .../server0/activemq.example.keystore | Bin 0 -> 2251 bytes .../server0/activemq.example.truststore | Bin 0 -> 963 bytes .../resources/activemq/server0/broker.xml | 65 +++ .../server1/activemq.example.keystore | Bin 0 -> 2251 bytes .../server1/activemq.example.truststore | Bin 0 -> 963 bytes .../resources/activemq/server1/broker.xml | 60 +++ examples/features/broker-connection/pom.xml | 64 +++ examples/features/pom.xml | 2 + 24 files changed, 2073 insertions(+), 18 deletions(-) create mode 100644 docs/user-manual/en/amqp-broker-connections.md create mode 100644 examples/features/broker-connection/amqp-receiving-messages/pom.xml create mode 100644 examples/features/broker-connection/amqp-receiving-messages/readme.md create mode 100644 examples/features/broker-connection/amqp-receiving-messages/src/main/java/org/apache/activemq/artemis/jms/example/BrokerConnectionReceiver.java create mode 100644 examples/features/broker-connection/amqp-receiving-messages/src/main/resources/activemq/server0/broker.xml create mode 100644 examples/features/broker-connection/amqp-receiving-messages/src/main/resources/activemq/server1/broker.xml create mode 100644 examples/features/broker-connection/amqp-sending-messages/pom.xml create mode 100644 examples/features/broker-connection/amqp-sending-messages/readme.md create mode 100644 examples/features/broker-connection/amqp-sending-messages/src/main/java/org/apache/activemq/artemis/jms/example/BrokerConnectionSender.java create mode 100644 examples/features/broker-connection/amqp-sending-messages/src/main/resources/activemq/server0/broker.xml create mode 100644 examples/features/broker-connection/amqp-sending-messages/src/main/resources/activemq/server1/broker.xml create mode 100644 examples/features/broker-connection/amqp-sending-overssl/pom.xml create mode 100644 examples/features/broker-connection/amqp-sending-overssl/readme.md create mode 100644 examples/features/broker-connection/amqp-sending-overssl/src/main/java/org/apache/activemq/artemis/jms/example/BrokerConnectionSenderSSL.java create mode 100644 examples/features/broker-connection/amqp-sending-overssl/src/main/resources/activemq/server0/activemq.example.keystore create mode 100644 examples/features/broker-connection/amqp-sending-overssl/src/main/resources/activemq/server0/activemq.example.truststore create mode 100644 examples/features/broker-connection/amqp-sending-overssl/src/main/resources/activemq/server0/broker.xml create mode 100644 examples/features/broker-connection/amqp-sending-overssl/src/main/resources/activemq/server1/activemq.example.keystore create mode 100644 examples/features/broker-connection/amqp-sending-overssl/src/main/resources/activemq/server1/activemq.example.truststore create mode 100644 examples/features/broker-connection/amqp-sending-overssl/src/main/resources/activemq/server1/broker.xml create mode 100644 examples/features/broker-connection/pom.xml diff --git a/artemis-tools/src/test/resources/artemis-configuration.xsd b/artemis-tools/src/test/resources/artemis-configuration.xsd index bd80a40e7d..75693a7ab0 100644 --- a/artemis-tools/src/test/resources/artemis-configuration.xsd +++ b/artemis-tools/src/test/resources/artemis-configuration.xsd @@ -134,7 +134,23 @@ - how long (in ms) to wait before invalidating the security cache + how long (in ms) to wait before invalidating an entry in the authentication or authorization cache + + + + + + + + how large to make the authentication cache + + + + + + + + how large to make the authorization cache @@ -404,6 +420,14 @@ + + + + true means that the server will not allow any message that doesn't have a validated user, in JMS this is JMSXUserID + + + + @@ -586,6 +610,15 @@ + + + + A list of connections the broker will make towards other servers. + Currently the only connection type supported is amqp-connection + + + + @@ -682,6 +715,16 @@ + + + + + The size in bytes used by the device. This is usually translated as fstat/st_blksize + And this is a way to bypass the value returned as st_blksize. + + + + @@ -879,6 +922,15 @@ + + + + The timeout (in nanoseconds) used to sync pages. The exact default value + depend on whether the journal is ASYNCIO or NIO. + + + + @@ -1033,7 +1085,7 @@ - a metrics plugin + DEPRECATED: use metrics instead. A metrics plugin @@ -1056,6 +1108,69 @@ + + + + + metrics configuration + + + + + + + whether or not to report JVM memory metrics + + + + + + + + whether or not to report JVM thread metrics + + + + + + + + whether or not to report JVM GC metrics + + + + + + + + + a metrics plugin + + + + + + + properties to configure a plugin + + + + + + + + the name of the metrics plugin class to instantiate + + + + + + + + + + + @@ -1571,13 +1686,11 @@ - - - + @@ -1589,9 +1702,30 @@ - + + + + + + + + Name of the transport connector reference to use for the new upstream connection + back to this broker. + + + + + + + + + + + + + @@ -1610,6 +1744,88 @@ + + + + if there is a downstream and upstream connection configured for the same broker then + the same connection will be shared as long as both stream configs set this flag to true + + + + + + + + how long to keep a connection alive in the absence of any data arriving from the client + + + + + + + + How long to wait for a reply + + + + + + + + period (in ms) between successive retries + + + + + + + + multiplier to apply to the retry-interval + + + + + + + + Maximum value for retry-interval + + + + + + + + How many attempts should be made to connect initially + + + + + + + + How many attempts should be made to reconnect after failure + + + + + + + + The period (in milliseconds) used to check if the federation connection has failed to receive pings from + another server + + + + + + + + How long to wait for a reply if in the middle of a fail-over. -1 means wait forever. + + + + @@ -1790,6 +2006,132 @@ + + + + + + + + + + + + + + + + + + + uri of the amqp connection + + + + + + + How many attempts should be made to reconnect after failure + + + + + + + period (in ms) between successive retries + + + + + + + User name used to connect. If not defined it will try an anonymous connection. + + + + + + + Password used to connect. If not defined it will try an anonymous connection. + + + + + + + + name of the amqp connection + + + + + + + + + + + address expression to match addresses + + + + + + + This is the exact queue name to be used. + + + + + + + + This will determine that queues are mirrored towards this next broker. + All events will be send towards this AMQP connection acting like a replica. + + + + + + + + Should mirror acknowledgements towards the other server + + + + + + + Should mirror queue creation events for addresses and queues. + + + + + + + Should mirror queue deletion events for addresses and queues. + + + + + + + By default the replica will use a temporary store and forward queue to store events towards the mirror / replica. + However if this is set, we will use a defined durable queue. + + + + + + @@ -2154,20 +2496,61 @@ - + The JDBC Driver class name - + The JDBC Connection URL e.g. jdbc:mysql://localhost:3306/ + + + + The JDBC User to use for connecting to the database, NB this will only work with drivers where support + DriverManager.getConnection(String url, String user, String password). This can be encrypted. + + + + + + + The JDBC Password to use for connecting to the database, NB this will only work with drivers where support + DriverManager.getConnection(String url, String user, String password). This can be encrypted. + + + + + + + The DataSource class name + + + + + + + A list of options for the DataSource + + + + + + + + A key-value pair option for the DataSource + + + + + + @@ -2235,6 +2618,23 @@ + + + + + Configuration option key + + + + + + + Configuration option value + + + + + @@ -2938,7 +3338,7 @@ whether or not to automatically create the dead-letter-address and/or a corresponding queue - on that address when any matching queue is created + on that address when a message found to be undeliverable @@ -3328,7 +3728,8 @@ - the message count the queue must be at or below before it can be evaluated to be auto deleted, 0 waits until empty queue (default) and -1 disables this check. + the message count the queue must be at or below before it can be evaluated to be auto deleted, 0 waits until empty queue (default) and -1 disables this check. + @@ -3456,12 +3857,28 @@ + + + + whether or not to enable metrics for metrics plugins on the matching address + + + + + + + + the name of the page store to use, to allow the page store to coalesce for address hierarchies when wildcard routing is in play + + + + - pattern for matching settings against addresses; can use wildards + pattern for matching settings against addresses; can use wildcards @@ -3630,13 +4047,6 @@ - - - - The number of messages to preserve for future queues created on this address - - - diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md index d259f18c92..537c78498c 100644 --- a/docs/user-manual/en/SUMMARY.md +++ b/docs/user-manual/en/SUMMARY.md @@ -12,6 +12,7 @@ * [Address Model](address-model.md) * [Protocols and Interoperability](protocols-interoperability.md) * [AMQP](amqp.md) + * [Broker Connections](amqp-broker-connections.md) * [MQTT](mqtt.md) * [STOMP](stomp.md) * [OpenWire](openwire.md) diff --git a/docs/user-manual/en/amqp-broker-connections.md b/docs/user-manual/en/amqp-broker-connections.md new file mode 100644 index 0000000000..c161273d34 --- /dev/null +++ b/docs/user-manual/en/amqp-broker-connections.md @@ -0,0 +1,238 @@ +# Broker Connections + +Instead of waiting for clients to connect, a broker can initiate a connection to another endpoint on a specific protocol. + +Currently, this feature supports only the AMQP protocol. However, in the future, it might be expanded to other protocols. + +You configure broker connections using a `` XML element in the `broker.xml` configuration file. + +```xml + + ... + +``` + +# AMQP Server Connections + +An ActiveMQ Artemis broker can initiate connections using the AMQP protocol. This means that the broker can connect to another AMQP server (not necessarily ActiveMQ Artemis) and create elements on that connection. + +To define an AMQP broker connection, add an `` element within the ` + + ... + + +``` + +- `uri`: tcp://host:myport (this is a required argument) +- `name`: Name of the connection used for management purposes +- `user`: User name with which to connect to the endpoint (this is an optional argument) +- `password`: Password with which to connect to the endpoint (this is an optional argument) +- `retry-interval`: Time, in milliseconds to wait before retrying a connection after an error. The default value is `5000`. +- `reconnect-attempts`: default is -1 meaning infinite +- `auto-start` : Should the broker connection start automatically with the broker. Default is `true`. If false you need to call a management operation to start it. + +*Notice*: If you disable auto-start on the broker connection, the start of the broker connection will only happen after the management method `startBrokerConnection(connectionName)` is called on the ServerController. + +*Important*: The target endpoint needs permission for all operations that you configure. Therefore, If you are using a security manager, ensure that you perform the configured operations as a user with sufficient permissions. + +# AMQP Server Connection Operations +The following types of operations are supported on a AMQP server connection: + +* Senders + * Messages received on specific queues are transferred to another endpoint +* Receivers + * The broker pulls messages from another endpoint +* Peers + * The broker creates both senders and receivers on another endpoint that knows how to handle them. Currently, this is implemented by Apache Qpid Dispatch. +* Mirrors + * The broker uses an AMQP connection to another broker and duplicate messages and sends acknowledgements over the wire. + +## Senders and Receivers +It is possible to connect an ActiveMQ Artemis broker to another AMQP endpoint simply by creating a sender or receiver broker connection element. + +For a `sender`, the broker creates a message consumer on a queue that sends messages to another AMQP endpoint. + +For a `receiver`, the broker creates a message producer on an address that receives messages from another AMQP endpoint. + +Both elements work like a message bridge. However, there is no additional overhead required to process messages. Senders and receivers behave just like any other consumer or producer in ActiveMQ Artemis. + +You can configure senders or receivers for specific queues. You can also match senders and receivers to specific addresses or _sets_ of addresses, using wildcard expressions. When configuring a sender or receiver, you can set the following properties: + +- `match`: Match the sender or receiver to a specific address or __set__ of addresses, using a wildcard expression +- `queue-name`: Configure the sender or receiver for a specific queue + + +Some examples are shown below. + +Using address expressions: +```xml + + + + + + + + + +
+ + + +
+
+ + + +
+
+``` + +Using queue names: +```xml + + + + + + + + +
+ + + +
+
+ + + +
+
+ +``` +*Important*: You can match a receiver only to a local queue that already exists. Therefore, if you are using receivers, make sure that you pre-create the queue locally. Otherwise, the broker cannot match the remote queues and addresses. + +*Important*: Do not create a sender and a receiver to the same destination. This creates an infinite loop of sends and receives. + + +# Peers +A peer broker connection element is a combination of sender and receivers. The ActiveMQ Artemis broker creates both a sender and a receiver for a peer element, and the endpoint knows how to deal with the pair without creating an infinite loop of sending and receiving messages. + +Currently, [Apache Qpid Dispatch Router](https://qpid.apache.org/components/dispatch-router/index.html) is a peer. ActiveMQ Artemis creates the pair of receivers and sender for each matching destination. These senders and receivers have special configuration to let Qpid Dispatch Router know to collaborate with ActiveMQ Artemis. + +You can experiment with advanced networking scenarios with Qpid Dispatch Router and get a lot of benefit from the AMQP protocol and its ecosystem. + +With a peer, you have the same properties that you have on a sender and receiver. For example: +```xml + + + + + + + +
+ + + +
+
+ + + +
+
+``` + +*Important:* Do not use this feature to connect to another broker, otherwise any message sent will be immediately ready to consume creating an infinite echo of sends and receives. + +# Mirror +The mirror option on the broker connection can capture events from the broker and pass them over the wire to another broker. This enables you to capture multiple asynchronous replicas. The following types of events are captured: + +* Message routing +* Message acknowledgement +* Queue and address creation +* queue and address deletion + +When you configure a mirror, these events are captured from the broker, stored on a local queue, and later forwarded to a target destination on another ActiveMQ Artemis broker. + +To configure a mirror, you add a `` element within the `` element. + +The local queue is called `source-mirror-address` + +You can specify the following optional arguments. + +* `queue-removal`: Specifies whether a queue- or address-removal event is sent. The default value is `true`. +* `message-acknowledgements`: Specifies whether message acknowledgements are sent. The default value is `true`. +* `queue-creation`: Specifies whether a queue- or address-creation event is sent. The default value is `true`. +* `source-mirror-address`: By default, the mirror creates a non-durable temporary queue to store messages before they are sent to the other broker. If you define a name value for this property, an ANYCAST durable queue and address is created with the specified name. + +An example of a mirror configuration is shown below: +```xml + + + + + +``` + +## Catch up on Mirror +The broker will not send past events over the mirror. As the broker sends and receives messages, only a natural catch up would eventually happen. + +## Disaster & Recovery considerations +As you use the mirror option to replicate data across datacenters, you have to take a few considerations: + +* Currently we don't support quorums for activating the replica, so you have to manually control when your clients connect to the replica site. +* Make sure the replica site is passive. Having producers and consumers connected into both sites would be messy and could lead you to data integrity issues. + * You can disable auto-start on the acceptor your clients use to connect, and only enable it after a disaster has occurred. +* Only the queues and addresses are mirrored. Consumer states will have to be reapplied on the replica when the clients reconnects (that applies to message groups, exclusive consumers or anything related to clients) +* Make sure your configuration options are copied over, including Diverts, security, last value queues, address settings and other configuration options. +* Have a way back route after a disaster. + * You can have a disabled broker connection to be enabled after the disaster. + + +## Mirror example sending acknowledgements + +On this example lets play with two brokers: +- sourceBroker +- replicaBroker + +Add this configuration on sourceBroker: + +```xml + + + + + +``` + +On the replicaBroker, add disabled broker connection for failing back after a disaster, and also set the acceptors with autoStart=false + +```xml + + + + tcp://0.0.0.0:61616?autoStart=false;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;amqpMinLargeMessageSize=102400;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpDuplicateDetection=true;autoStart=false + + tcp://0.0.0.0:6700?autoStart=true;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=AMQP;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpMinLargeMessageSize=102400;amqpDuplicateDetection=true;autoStart=false + + + + + + +``` + +After a failure has occurred, you can use a management operation start on the acceptor: + +- AccetorControl.start(); + +And you can call startBrokerConnection to enable the failback towards the live site: + +- ActiveMQServerControl.startBrokerConnection("sourceBroker") + diff --git a/examples/features/broker-connection/amqp-receiving-messages/pom.xml b/examples/features/broker-connection/amqp-receiving-messages/pom.xml new file mode 100644 index 0000000000..e9f0c8f448 --- /dev/null +++ b/examples/features/broker-connection/amqp-receiving-messages/pom.xml @@ -0,0 +1,165 @@ + + + + + 4.0.0 + + + org.apache.activemq.examples.broker-connection + broker-connections + 2.16.0-SNAPSHOT + + + amqp-receiving-messages + jar + ActiveMQ Artemis JMS Client Side Load Balancing Example + + + ${project.basedir}/../../../.. + + + + + org.apache.qpid + qpid-jms-client + ${qpid.jms.version} + + + + + + + org.apache.activemq + artemis-maven-plugin + + + create0 + + create + + + ${noServer} + ${basedir}/target/server0 + true + ${basedir}/target/classes/activemq/server0 + + -Djava.net.preferIPv4Stack=true + + + + create1 + + create + + + ${noServer} + ${basedir}/target/server1 + true + ${basedir}/target/classes/activemq/server1 + + -Djava.net.preferIPv4Stack=true + + + + + start1 + + cli + + + ${noServer} + true + ${basedir}/target/server1 + tcp://localhost:5672 + + run + + server1 + + + + start0 + + cli + + + true + ${noServer} + ${basedir}/target/server0 + tcp://localhost:5671 + + run + + server0 + + + + runClient + + runClient + + + + org.apache.activemq.artemis.jms.example.BrokerConnectionReceiver + + + + stop0 + + cli + + + ${noServer} + ${basedir}/target/server0 + + stop + + + + + stop1 + + cli + + + ${noServer} + ${basedir}/target/server1 + + stop + + + + + + + org.apache.activemq.examples.broker-connection + amqp-receiving-messages + ${project.version} + + + + + org.apache.maven.plugins + maven-clean-plugin + + + + diff --git a/examples/features/broker-connection/amqp-receiving-messages/readme.md b/examples/features/broker-connection/amqp-receiving-messages/readme.md new file mode 100644 index 0000000000..6cf4de1564 --- /dev/null +++ b/examples/features/broker-connection/amqp-receiving-messages/readme.md @@ -0,0 +1,7 @@ +# AMQP Broker Connection with Senders + +To run the example, simply type **mvn verify** from this directory, or **mvn -PnoServer verify** if you want to create and start the broker manually. + +This example demonstrates how you can create a broker connection from one broker towards another broker, and send messages from that broker towards the target server. + +You basically configured the broker connection on broker.xml and this example will give you two working servers where you send messages in one broker and receive it on another broker. diff --git a/examples/features/broker-connection/amqp-receiving-messages/src/main/java/org/apache/activemq/artemis/jms/example/BrokerConnectionReceiver.java b/examples/features/broker-connection/amqp-receiving-messages/src/main/java/org/apache/activemq/artemis/jms/example/BrokerConnectionReceiver.java new file mode 100644 index 0000000000..a1f1a1b5a4 --- /dev/null +++ b/examples/features/broker-connection/amqp-receiving-messages/src/main/java/org/apache/activemq/artemis/jms/example/BrokerConnectionReceiver.java @@ -0,0 +1,81 @@ +/* + * 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. + */ +package org.apache.activemq.artemis.jms.example; + +import javax.jms.Connection; +import javax.jms.ConnectionFactory; +import javax.jms.MessageConsumer; +import javax.jms.MessageProducer; +import javax.jms.Queue; +import javax.jms.Session; +import javax.jms.TextMessage; + +import org.apache.qpid.jms.JmsConnectionFactory; + +/** + * This example demonstrates how sessions created from a single connection can be load + * balanced across the different nodes of the cluster. + *

+ * In this example there are three nodes and we use a round-robin client side load-balancing + * policy. + */ +public class BrokerConnectionReceiver { + + public static void main(final String[] args) throws Exception { + Connection connectionOnServer0 = null; + ConnectionFactory connectionFactoryServer0 = new JmsConnectionFactory("amqp://localhost:5672"); + + // Step 1. Create a connection on server0, and send a few messages + try { + + connectionOnServer0 = connectionFactoryServer0.createConnection(); + + Session session = connectionOnServer0.createSession(false, Session.AUTO_ACKNOWLEDGE); + + Queue queue = session.createQueue("exampleQueue"); + MessageProducer sender = session.createProducer(queue); + for (int i = 0; i < 100; i++) { + sender.send(session.createTextMessage("Hello world receiving n" + i)); + } + } finally { + if (connectionFactoryServer0 != null) { + connectionOnServer0.close(); + } + } + + // Step 2. create a connection on server1, and receive a few messages. + // the sender on the broker conneciton will take care of the transfer. + Connection connectionOnServer1 = null; + ConnectionFactory connectionFactoryServer1 = new JmsConnectionFactory("amqp://localhost:5671"); + + try { + connectionOnServer1 = connectionFactoryServer1.createConnection(); + connectionOnServer1.start(); + Session session = connectionOnServer1.createSession(false, Session.AUTO_ACKNOWLEDGE); + Queue queue = session.createQueue("exampleQueue"); + MessageConsumer consumer = session.createConsumer(queue); + for (int i = 0; i < 100; i++) { + TextMessage message = (TextMessage) consumer.receive(5000); + System.out.println("Received message " + message.getText()); + } + } finally { + if (connectionOnServer1 != null) { + connectionOnServer1.close(); + } + } + } +} diff --git a/examples/features/broker-connection/amqp-receiving-messages/src/main/resources/activemq/server0/broker.xml b/examples/features/broker-connection/amqp-receiving-messages/src/main/resources/activemq/server0/broker.xml new file mode 100644 index 0000000000..e499a12ff7 --- /dev/null +++ b/examples/features/broker-connection/amqp-receiving-messages/src/main/resources/activemq/server0/broker.xml @@ -0,0 +1,117 @@ + + + + + + + + 0.0.0.0 + + + false + + NIO + + + true + + 120000 + + 60000 + + HALT + + + 44000 + + + + tcp://0.0.0.0:5671?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;amqpMinLargeMessageSize=102400;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpDuplicateDetection=true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DLQ + ExpiryQueue + 0 + + -1 + 10 + PAGE + true + true + true + true + + + + DLQ + ExpiryQueue + 0 + + -1 + 10 + PAGE + true + true + true + true + + + + + +

+ + + +
+ + + + diff --git a/examples/features/broker-connection/amqp-receiving-messages/src/main/resources/activemq/server1/broker.xml b/examples/features/broker-connection/amqp-receiving-messages/src/main/resources/activemq/server1/broker.xml new file mode 100644 index 0000000000..74dfaa6b4f --- /dev/null +++ b/examples/features/broker-connection/amqp-receiving-messages/src/main/resources/activemq/server1/broker.xml @@ -0,0 +1,110 @@ + + + + + + + + 0.0.0.0 + + + false + + NIO + + + true + + 120000 + + 60000 + + HALT + + + 44000 + + + + tcp://0.0.0.0:5672?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;amqpMinLargeMessageSize=102400;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpDuplicateDetection=true + + + + + + + + + + + + + + + + + + + + + + + DLQ + ExpiryQueue + 0 + + -1 + 10 + PAGE + true + true + true + true + + + + DLQ + ExpiryQueue + 0 + + -1 + 10 + PAGE + true + true + true + true + + + + +
+ + + +
+
+ +
+
diff --git a/examples/features/broker-connection/amqp-sending-messages/pom.xml b/examples/features/broker-connection/amqp-sending-messages/pom.xml new file mode 100644 index 0000000000..f728babc7b --- /dev/null +++ b/examples/features/broker-connection/amqp-sending-messages/pom.xml @@ -0,0 +1,165 @@ + + + + + 4.0.0 + + + org.apache.activemq.examples.broker-connection + broker-connections + 2.16.0-SNAPSHOT + + + amqp-sending-messages + jar + ActiveMQ Artemis JMS Client Side Load Balancing Example + + + ${project.basedir}/../../../.. + + + + + org.apache.qpid + qpid-jms-client + ${qpid.jms.version} + + + + + + + org.apache.activemq + artemis-maven-plugin + + + create0 + + create + + + ${noServer} + ${basedir}/target/server0 + true + ${basedir}/target/classes/activemq/server0 + + -Djava.net.preferIPv4Stack=true + + + + create1 + + create + + + ${noServer} + ${basedir}/target/server1 + true + ${basedir}/target/classes/activemq/server1 + + -Djava.net.preferIPv4Stack=true + + + + + start1 + + cli + + + ${noServer} + true + ${basedir}/target/server1 + tcp://localhost:5672 + + run + + server1 + + + + start0 + + cli + + + true + ${noServer} + ${basedir}/target/server0 + tcp://localhost:5671 + + run + + server0 + + + + runClient + + runClient + + + + org.apache.activemq.artemis.jms.example.BrokerConnectionSender + + + + stop0 + + cli + + + ${noServer} + ${basedir}/target/server0 + + stop + + + + + stop1 + + cli + + + ${noServer} + ${basedir}/target/server1 + + stop + + + + + + + org.apache.activemq.examples.broker-connection + amqp-sending-messages + ${project.version} + + + + + org.apache.maven.plugins + maven-clean-plugin + + + + diff --git a/examples/features/broker-connection/amqp-sending-messages/readme.md b/examples/features/broker-connection/amqp-sending-messages/readme.md new file mode 100644 index 0000000000..6cf4de1564 --- /dev/null +++ b/examples/features/broker-connection/amqp-sending-messages/readme.md @@ -0,0 +1,7 @@ +# AMQP Broker Connection with Senders + +To run the example, simply type **mvn verify** from this directory, or **mvn -PnoServer verify** if you want to create and start the broker manually. + +This example demonstrates how you can create a broker connection from one broker towards another broker, and send messages from that broker towards the target server. + +You basically configured the broker connection on broker.xml and this example will give you two working servers where you send messages in one broker and receive it on another broker. diff --git a/examples/features/broker-connection/amqp-sending-messages/src/main/java/org/apache/activemq/artemis/jms/example/BrokerConnectionSender.java b/examples/features/broker-connection/amqp-sending-messages/src/main/java/org/apache/activemq/artemis/jms/example/BrokerConnectionSender.java new file mode 100644 index 0000000000..3407aac7ac --- /dev/null +++ b/examples/features/broker-connection/amqp-sending-messages/src/main/java/org/apache/activemq/artemis/jms/example/BrokerConnectionSender.java @@ -0,0 +1,78 @@ +/* + * 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. + */ +package org.apache.activemq.artemis.jms.example; + +import javax.jms.Connection; +import javax.jms.ConnectionFactory; +import javax.jms.MessageConsumer; +import javax.jms.MessageProducer; +import javax.jms.Queue; +import javax.jms.Session; +import javax.jms.TextMessage; + +import org.apache.qpid.jms.JmsConnectionFactory; + +/** + * This example is demonstrating how messages are transferred from one broker towards another broker + * through the sender element on a AMQP Broker Connection. + */ +public class BrokerConnectionSender { + + public static void main(final String[] args) throws Exception { + Connection connectionOnServer0 = null; + ConnectionFactory connectionFactoryServer0 = new JmsConnectionFactory("amqp://localhost:5671"); + + // Step 1. Create a connection on server0, and send a few messages + try { + + connectionOnServer0 = connectionFactoryServer0.createConnection(); + + Session session = connectionOnServer0.createSession(false, Session.AUTO_ACKNOWLEDGE); + + Queue queue = session.createQueue("exampleQueue"); + MessageProducer sender = session.createProducer(queue); + for (int i = 0; i < 100; i++) { + sender.send(session.createTextMessage("Hello world n" + i)); + } + } finally { + if (connectionFactoryServer0 != null) { + connectionOnServer0.close(); + } + } + + // Step 2. create a connection on server1, and receive a few messages. + // the sender on the broker conneciton will take care of the transfer. + Connection connectionOnServer1 = null; + ConnectionFactory connectionFactoryServer1 = new JmsConnectionFactory("amqp://localhost:5771"); + + try { + connectionOnServer1 = connectionFactoryServer1.createConnection(); + connectionOnServer1.start(); + Session session = connectionOnServer1.createSession(false, Session.AUTO_ACKNOWLEDGE); + Queue queue = session.createQueue("exampleQueue"); + MessageConsumer consumer = session.createConsumer(queue); + for (int i = 0; i < 100; i++) { + TextMessage message = (TextMessage) consumer.receive(5000); + System.out.println("Received message " + message.getText()); + } + } finally { + if (connectionOnServer1 != null) { + connectionOnServer1.close(); + } + } + } +} diff --git a/examples/features/broker-connection/amqp-sending-messages/src/main/resources/activemq/server0/broker.xml b/examples/features/broker-connection/amqp-sending-messages/src/main/resources/activemq/server0/broker.xml new file mode 100644 index 0000000000..f9fc84284a --- /dev/null +++ b/examples/features/broker-connection/amqp-sending-messages/src/main/resources/activemq/server0/broker.xml @@ -0,0 +1,117 @@ + + + + + + + + 0.0.0.0 + + + false + + NIO + + + true + + 120000 + + 60000 + + HALT + + + 44000 + + + + tcp://0.0.0.0:5671?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;amqpMinLargeMessageSize=102400;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpDuplicateDetection=true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DLQ + ExpiryQueue + 0 + + -1 + 10 + PAGE + true + true + true + true + + + + DLQ + ExpiryQueue + 0 + + -1 + 10 + PAGE + true + true + true + true + + + + + +
+ + + +
+
+ +
+
diff --git a/examples/features/broker-connection/amqp-sending-messages/src/main/resources/activemq/server1/broker.xml b/examples/features/broker-connection/amqp-sending-messages/src/main/resources/activemq/server1/broker.xml new file mode 100644 index 0000000000..67a19673bd --- /dev/null +++ b/examples/features/broker-connection/amqp-sending-messages/src/main/resources/activemq/server1/broker.xml @@ -0,0 +1,110 @@ + + + + + + + + 0.0.0.0 + + + false + + NIO + + + true + + 120000 + + 60000 + + HALT + + + 44000 + + + + tcp://0.0.0.0:5771?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;amqpMinLargeMessageSize=102400;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpDuplicateDetection=true + + + + + + + + + + + + + + + + + + + + + + + DLQ + ExpiryQueue + 0 + + -1 + 10 + PAGE + true + true + true + true + + + + DLQ + ExpiryQueue + 0 + + -1 + 10 + PAGE + true + true + true + true + + + + +
+ + + +
+
+ +
+
diff --git a/examples/features/broker-connection/amqp-sending-overssl/pom.xml b/examples/features/broker-connection/amqp-sending-overssl/pom.xml new file mode 100644 index 0000000000..507fa10dcd --- /dev/null +++ b/examples/features/broker-connection/amqp-sending-overssl/pom.xml @@ -0,0 +1,165 @@ + + + + + 4.0.0 + + + org.apache.activemq.examples.broker-connection + broker-connections + 2.16.0-SNAPSHOT + + + amqp-ssl-enabled + jar + Connecting to another broker over SSL + + + ${project.basedir}/../../../.. + + + + + org.apache.qpid + qpid-jms-client + ${qpid.jms.version} + + + + + + + org.apache.activemq + artemis-maven-plugin + + + create0 + + create + + + ${noServer} + ${basedir}/target/server0 + true + ${basedir}/target/classes/activemq/server0 + + -Djava.net.preferIPv4Stack=true + + + + create1 + + create + + + ${noServer} + ${basedir}/target/server1 + true + ${basedir}/target/classes/activemq/server1 + + -Djava.net.preferIPv4Stack=true + + + + start1 + + cli + + + ${noServer} + true + ${basedir}/target/server1 + tcp://localhost:5771 + + run + + server1 + + + + start0 + + cli + + + true + ${noServer} + ${basedir}/target/server0 + tcp://localhost:5671 + + run + + server0 + + + + runClient + + runClient + + + + org.apache.activemq.artemis.jms.example.BrokerConnectionSenderSSL + + + + stop0 + + cli + + + ${noServer} + ${basedir}/target/server0 + + stop + + + + + stop1 + + cli + + + ${noServer} + ${basedir}/target/server1 + + stop + + + + + + + + org.apache.activemq.examples.broker-connection + amqp-ssl-enabled + ${project.version} + + + + + org.apache.maven.plugins + maven-clean-plugin + + + + \ No newline at end of file diff --git a/examples/features/broker-connection/amqp-sending-overssl/readme.md b/examples/features/broker-connection/amqp-sending-overssl/readme.md new file mode 100644 index 0000000000..6038f6da90 --- /dev/null +++ b/examples/features/broker-connection/amqp-sending-overssl/readme.md @@ -0,0 +1,15 @@ +# JMS SSL Example + +To run the example, simply type **mvn verify** from this directory, or **mvn -PnoServer verify** if you want to start and create the broker manually. + +This example shows you how to configure SSL with ActiveMQ Artemis to send and receive message. + +Using SSL can make your messaging applications interact with ActiveMQ Artemis securely. An application can be secured transparently without extra coding effort. To secure your messaging application with SSL, you need to configure connector and acceptor as follows: + + tcp://localhost:5500?sslEnabled=true;keyStorePath=activemq.example.keystore;keyStorePassword=activemqexample + +In the configuration, the `activemq.example.keystore` is the key store file holding the server's certificate. The `activemq.example.truststore` is the file holding the certificates which the client trusts (i.e. the server's certificate exported from activemq.example.keystore). They are generated via the following commands: + +* `keytool -genkey -keystore activemq.example.keystore -storepass activemqexample -keypass activemqexample -dname "CN=ActiveMQ Artemis Server, OU=Artemis, O=ActiveMQ, L=AMQ, S=AMQ, C=AMQ" -keyalg RSA` +* `keytool -export -keystore activemq.example.keystore -file server-side-cert.cer -storepass activemqexample` +* `keytool -import -keystore activemq.example.truststore -file server-side-cert.cer -storepass activemqexample -keypass activemqexample -noprompt` \ No newline at end of file diff --git a/examples/features/broker-connection/amqp-sending-overssl/src/main/java/org/apache/activemq/artemis/jms/example/BrokerConnectionSenderSSL.java b/examples/features/broker-connection/amqp-sending-overssl/src/main/java/org/apache/activemq/artemis/jms/example/BrokerConnectionSenderSSL.java new file mode 100644 index 0000000000..a1bf376120 --- /dev/null +++ b/examples/features/broker-connection/amqp-sending-overssl/src/main/java/org/apache/activemq/artemis/jms/example/BrokerConnectionSenderSSL.java @@ -0,0 +1,78 @@ +/* + * 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. + */ +package org.apache.activemq.artemis.jms.example; + +import javax.jms.Connection; +import javax.jms.ConnectionFactory; +import javax.jms.MessageConsumer; +import javax.jms.MessageProducer; +import javax.jms.Queue; +import javax.jms.Session; +import javax.jms.TextMessage; + +import org.apache.qpid.jms.JmsConnectionFactory; + +/** + * This example is demonstrating how messages are transferred from one broker towards another broker + * through the sender element on a AMQP Broker Connection. + */ +public class BrokerConnectionSenderSSL { + + public static void main(final String[] args) throws Exception { + Connection connectionOnServer0 = null; + ConnectionFactory connectionFactoryServer0 = new JmsConnectionFactory("amqp://localhost:5671"); + + // Step 1. Create a connection on server0, and send a few messages + try { + + connectionOnServer0 = connectionFactoryServer0.createConnection(); + + Session session = connectionOnServer0.createSession(false, Session.AUTO_ACKNOWLEDGE); + + Queue queue = session.createQueue("exampleQueue"); + MessageProducer sender = session.createProducer(queue); + for (int i = 0; i < 100; i++) { + sender.send(session.createTextMessage("Hello world overSSL n" + i)); + } + } finally { + if (connectionFactoryServer0 != null) { + connectionOnServer0.close(); + } + } + + // Step 2. create a connection on server1, and receive a few messages. + // the sender on the broker conneciton will take care of the transfer. + Connection connectionOnServer1 = null; + ConnectionFactory connectionFactoryServer1 = new JmsConnectionFactory("amqp://localhost:5771"); + + try { + connectionOnServer1 = connectionFactoryServer1.createConnection(); + connectionOnServer1.start(); + Session session = connectionOnServer1.createSession(false, Session.AUTO_ACKNOWLEDGE); + Queue queue = session.createQueue("exampleQueue"); + MessageConsumer consumer = session.createConsumer(queue); + for (int i = 0; i < 100; i++) { + TextMessage message = (TextMessage) consumer.receive(5000); + System.out.println("Received message " + message.getText()); + } + } finally { + if (connectionOnServer1 != null) { + connectionOnServer1.close(); + } + } + } +} diff --git a/examples/features/broker-connection/amqp-sending-overssl/src/main/resources/activemq/server0/activemq.example.keystore b/examples/features/broker-connection/amqp-sending-overssl/src/main/resources/activemq/server0/activemq.example.keystore new file mode 100644 index 0000000000000000000000000000000000000000..4ed24133c4acd412e9e2db114409e72706ed0271 GIT binary patch literal 2251 zcmc(g=|2>D8^&j|o6uOYFIgI-84OdFj3vgF#x^qcv9DQ%49YNciVBIMB5R>x$d-=m zYdCU9lw#D#5+`FR%QNRW&v`!Q`3s&G_lxg+UoY;@_4|FU`(X886#xK$*aiG|afDtD z_Pxv|Psb7?6ac^hKu{oih$Ec5YMej_P!%Ku1abf%6bQ4tVdy}*GZOzTZLp-eOO>Oi zL*$+3!p~8-wOl=M*#j>0?ata)`teBRi=s9hK=anXZcTEC}YLV5$2J z=6C*vtmlZ8?3Hu7pYp#)!9J$=gp51{l5IaqTb{f_4o8XqNTNYE-ixKGF+Of!F(x0~ zl76%fc8@sm*4p|kd(VNF64-cs*})QK@|=;U|Q@?xFF@Y4~zst&bi=JyL7Ut{i_(x@pk zj^|t{CA}N9h3b*R;p(@pKN9sDA-G6KW--*}K27)2x3Z=nXAWOs?2>Obh&~>H%Y=e# z^(E``%b&>sY8=$ciL*UBXBcUl^M=nrcUn-b;qtLyeall<;?DZYe>3w5H;U0 ze&bWpR-w^AQ9SNg36pO!sf2d7SmVsk=6$aegULa(+m9RXSUwLT%9}Tp0jt(-@w(!l zSMMz>+R?iTiW=TJlHG66QOYTw|7Qda>Y{v9?olBFj`D51ehjXmv zX#p`(g*^O}zL$Gc(t77ifhX~~|HCiyVPOtSB|GHR%~ctB3Mpo#BWky?L(8K|d*<9Kqp*b;j1j-ZvLZ#lI|fe_(WO`= z_gV-F9YyMb3*wBetmc`9Piu(KHTTX#VMajfrBf`Pmqv$=f5Yl(m8t(yHT=Zt=i9aR(D+GrJ? zsct8TExpYMjjUWKwW8i&Rk)jEviuU2Ju{?!8p+TXa3@`vQ#|3>va)vjss?fIJfgCu zaCvK|g!DWgdMpl*TD~-_y_FDPifiv)Kh~um8Z*FkXk6FRB5l{{$m2`jo~LCN*+fWq z8M<69p%NAyVrpA+n$V<(B&7oCjg|>!3wl~ww(zFL^4)tu@a8g}X$SF7NLby- z%fyd)Z@{Zf)1szCxbqX2{QH{3Lne2bhOuP2-?0db#2xFw539E`O0L}>T19_{TG6|+ zGJePN4^)D`uH3+hixxP&D38l1qKKX|c%?Wcmt(I31JFr79AH)xKnv9T&{rGx?ec^j39krY0X<>u5@bldcP3l#?x>WAz-d;Q_y*4I}!r3@-bd(@>&wgkq}c>EKwg)5*w{DV!(P;ZLfU$KbSKp{>80AMPD z0!~IyK!HVI5D)}{NU}2x0p;XTO|wYbh5~_n?7+N)R-xmqEsM(34ua0O)jn8D_i{@Jd0ceUe_r~!Nm4Y|;cTh0BgQO*X-%lilo&eV zDgN1t(PHn*`=#XyG2~in^Qf&JOl86qM?ZR%WA((St+15gB}PEPEVb@<pl>AwQgBZv8l^_V`XuG1VERABN{%2%dnJmV;T zg#0z&!%Nn5llbuayfh-xwY51}9b1Sr-9JxeJ~iR@BHZ29ZTyy<1p)&Bz!G_cEJB+7 zxY9=;q7Y%!xr%i~2?e^gSxC^m0z=rQ?d!3Bn#lfLY!iV1Cy=#ga3D>-To4Z$8tyq( zWZkD`*nn0^GJQ>H9=C{m!6;?yVWWRLo9oy8D@a_g#p?#$ECIwjw8Z3$^kv1YM E0oUEtu>b%7 literal 0 HcmV?d00001 diff --git a/examples/features/broker-connection/amqp-sending-overssl/src/main/resources/activemq/server0/activemq.example.truststore b/examples/features/broker-connection/amqp-sending-overssl/src/main/resources/activemq/server0/activemq.example.truststore new file mode 100644 index 0000000000000000000000000000000000000000..45ab086071dbf158cefa27f2ab8dd72ea9ed7691 GIT binary patch literal 963 zcmezO_TO6u1_mY|W(3o$xs}@XR z!!fxevn&;;T)==2B*ZPu?pRcknwwc{s9+!m5@8k=hbdBkN+|@V7L}zI8OVwA8k!p# z8JZZH8krj#L;<-L2F7siKsc$1Q3*L<7+D#Zn;7{S44N3Zn3@Ioosup?9rKY zZfaL@m_OHRpv-%!*#A z(|ie%&%B@P3{K^GzOz0hr(@TS^M2OC>Q|zJHVHMbzSTJICn954_#~s|PU}YHZI^x| zRqa-qbfUHKjIi97S=u}8Jm(18o0NTVRtSB!dbV`>8)56}yj1a{E-Tk;G&+4s=>_Ks z#TCtZ>sXh~H{6$TZ|~Qe+a=H3o!*vW7`>*PN`Gv+abx_?^9g9EiZw1q?(+hA<|d zgzU`qipvBdm`|kjbkFa}v9(7p@A-IYONH5!oK=(e=(B2@#-GK9|8hDIhvpc;OMj?6UdO*2RA{?~s!_ChTU(H-Uy?HTu-KR%zKs(CBs{_06FWqTH?8fX7of790U;Md*q-zFK$sI(^q|En-D&n!Ir g^-~0I5j*drmUhF9{H>OfilSc@H^1gpFRLg903`@t1ONa4 literal 0 HcmV?d00001 diff --git a/examples/features/broker-connection/amqp-sending-overssl/src/main/resources/activemq/server0/broker.xml b/examples/features/broker-connection/amqp-sending-overssl/src/main/resources/activemq/server0/broker.xml new file mode 100644 index 0000000000..b2e9e7ef5a --- /dev/null +++ b/examples/features/broker-connection/amqp-sending-overssl/src/main/resources/activemq/server0/broker.xml @@ -0,0 +1,65 @@ + + + + + + ./data/messaging/bindings + + ./data/messaging/journal + + ./data/messaging/largemessages + + ./data/messaging/paging + + + + + tcp://0.0.0.0:5671?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;amqpMinLargeMessageSize=102400;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpDuplicateDetection=true + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+
+
+
diff --git a/examples/features/broker-connection/amqp-sending-overssl/src/main/resources/activemq/server1/activemq.example.keystore b/examples/features/broker-connection/amqp-sending-overssl/src/main/resources/activemq/server1/activemq.example.keystore new file mode 100644 index 0000000000000000000000000000000000000000..4ed24133c4acd412e9e2db114409e72706ed0271 GIT binary patch literal 2251 zcmc(g=|2>D8^&j|o6uOYFIgI-84OdFj3vgF#x^qcv9DQ%49YNciVBIMB5R>x$d-=m zYdCU9lw#D#5+`FR%QNRW&v`!Q`3s&G_lxg+UoY;@_4|FU`(X886#xK$*aiG|afDtD z_Pxv|Psb7?6ac^hKu{oih$Ec5YMej_P!%Ku1abf%6bQ4tVdy}*GZOzTZLp-eOO>Oi zL*$+3!p~8-wOl=M*#j>0?ata)`teBRi=s9hK=anXZcTEC}YLV5$2J z=6C*vtmlZ8?3Hu7pYp#)!9J$=gp51{l5IaqTb{f_4o8XqNTNYE-ixKGF+Of!F(x0~ zl76%fc8@sm*4p|kd(VNF64-cs*})QK@|=;U|Q@?xFF@Y4~zst&bi=JyL7Ut{i_(x@pk zj^|t{CA}N9h3b*R;p(@pKN9sDA-G6KW--*}K27)2x3Z=nXAWOs?2>Obh&~>H%Y=e# z^(E``%b&>sY8=$ciL*UBXBcUl^M=nrcUn-b;qtLyeall<;?DZYe>3w5H;U0 ze&bWpR-w^AQ9SNg36pO!sf2d7SmVsk=6$aegULa(+m9RXSUwLT%9}Tp0jt(-@w(!l zSMMz>+R?iTiW=TJlHG66QOYTw|7Qda>Y{v9?olBFj`D51ehjXmv zX#p`(g*^O}zL$Gc(t77ifhX~~|HCiyVPOtSB|GHR%~ctB3Mpo#BWky?L(8K|d*<9Kqp*b;j1j-ZvLZ#lI|fe_(WO`= z_gV-F9YyMb3*wBetmc`9Piu(KHTTX#VMajfrBf`Pmqv$=f5Yl(m8t(yHT=Zt=i9aR(D+GrJ? zsct8TExpYMjjUWKwW8i&Rk)jEviuU2Ju{?!8p+TXa3@`vQ#|3>va)vjss?fIJfgCu zaCvK|g!DWgdMpl*TD~-_y_FDPifiv)Kh~um8Z*FkXk6FRB5l{{$m2`jo~LCN*+fWq z8M<69p%NAyVrpA+n$V<(B&7oCjg|>!3wl~ww(zFL^4)tu@a8g}X$SF7NLby- z%fyd)Z@{Zf)1szCxbqX2{QH{3Lne2bhOuP2-?0db#2xFw539E`O0L}>T19_{TG6|+ zGJePN4^)D`uH3+hixxP&D38l1qKKX|c%?Wcmt(I31JFr79AH)xKnv9T&{rGx?ec^j39krY0X<>u5@bldcP3l#?x>WAz-d;Q_y*4I}!r3@-bd(@>&wgkq}c>EKwg)5*w{DV!(P;ZLfU$KbSKp{>80AMPD z0!~IyK!HVI5D)}{NU}2x0p;XTO|wYbh5~_n?7+N)R-xmqEsM(34ua0O)jn8D_i{@Jd0ceUe_r~!Nm4Y|;cTh0BgQO*X-%lilo&eV zDgN1t(PHn*`=#XyG2~in^Qf&JOl86qM?ZR%WA((St+15gB}PEPEVb@<pl>AwQgBZv8l^_V`XuG1VERABN{%2%dnJmV;T zg#0z&!%Nn5llbuayfh-xwY51}9b1Sr-9JxeJ~iR@BHZ29ZTyy<1p)&Bz!G_cEJB+7 zxY9=;q7Y%!xr%i~2?e^gSxC^m0z=rQ?d!3Bn#lfLY!iV1Cy=#ga3D>-To4Z$8tyq( zWZkD`*nn0^GJQ>H9=C{m!6;?yVWWRLo9oy8D@a_g#p?#$ECIwjw8Z3$^kv1YM E0oUEtu>b%7 literal 0 HcmV?d00001 diff --git a/examples/features/broker-connection/amqp-sending-overssl/src/main/resources/activemq/server1/activemq.example.truststore b/examples/features/broker-connection/amqp-sending-overssl/src/main/resources/activemq/server1/activemq.example.truststore new file mode 100644 index 0000000000000000000000000000000000000000..45ab086071dbf158cefa27f2ab8dd72ea9ed7691 GIT binary patch literal 963 zcmezO_TO6u1_mY|W(3o$xs}@XR z!!fxevn&;;T)==2B*ZPu?pRcknwwc{s9+!m5@8k=hbdBkN+|@V7L}zI8OVwA8k!p# z8JZZH8krj#L;<-L2F7siKsc$1Q3*L<7+D#Zn;7{S44N3Zn3@Ioosup?9rKY zZfaL@m_OHRpv-%!*#A z(|ie%&%B@P3{K^GzOz0hr(@TS^M2OC>Q|zJHVHMbzSTJICn954_#~s|PU}YHZI^x| zRqa-qbfUHKjIi97S=u}8Jm(18o0NTVRtSB!dbV`>8)56}yj1a{E-Tk;G&+4s=>_Ks z#TCtZ>sXh~H{6$TZ|~Qe+a=H3o!*vW7`>*PN`Gv+abx_?^9g9EiZw1q?(+hA<|d zgzU`qipvBdm`|kjbkFa}v9(7p@A-IYONH5!oK=(e=(B2@#-GK9|8hDIhvpc;OMj?6UdO*2RA{?~s!_ChTU(H-Uy?HTu-KR%zKs(CBs{_06FWqTH?8fX7of790U;Md*q-zFK$sI(^q|En-D&n!Ir g^-~0I5j*drmUhF9{H>OfilSc@H^1gpFRLg903`@t1ONa4 literal 0 HcmV?d00001 diff --git a/examples/features/broker-connection/amqp-sending-overssl/src/main/resources/activemq/server1/broker.xml b/examples/features/broker-connection/amqp-sending-overssl/src/main/resources/activemq/server1/broker.xml new file mode 100644 index 0000000000..6a5611f4fc --- /dev/null +++ b/examples/features/broker-connection/amqp-sending-overssl/src/main/resources/activemq/server1/broker.xml @@ -0,0 +1,60 @@ + + + + + + ./data/messaging/bindings + + ./data/messaging/journal + + ./data/messaging/largemessages + + ./data/messaging/paging + + + + + tcp://0.0.0.0:5771?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;amqpMinLargeMessageSize=102400;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpDuplicateDetection=true + tcp://localhost:5772?sslEnabled=true;keyStorePath=activemq.example.keystore;keyStorePassword=activemqexample;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE + + + + + + + + + + + + + + + + + +
+ + + +
+
+
+
diff --git a/examples/features/broker-connection/pom.xml b/examples/features/broker-connection/pom.xml new file mode 100644 index 0000000000..b7de672a4c --- /dev/null +++ b/examples/features/broker-connection/pom.xml @@ -0,0 +1,64 @@ + + + + + 4.0.0 + + + org.apache.activemq.examples.clustered + broker-features + 2.16.0-SNAPSHOT + + + org.apache.activemq.examples.broker-connection + broker-connections + pom + ActiveMQ Artemis Broker Connection Examples + + + + + UTF-8 + ${project.basedir}/../../.. + + + + + examples + + amqp-sending-messages + amqp-receiving-messages + amqp-sending-overssl + + + + release + + amqp-sending-messages + amqp-receiving-messages + amqp-sending-overssl + + + + diff --git a/examples/features/pom.xml b/examples/features/pom.xml index f88abf159e..b693d7f44d 100644 --- a/examples/features/pom.xml +++ b/examples/features/pom.xml @@ -48,6 +48,7 @@ under the License. examples clustered + broker-connection federation ha standard @@ -58,6 +59,7 @@ under the License. release + broker-connection federation clustered ha