The standard ActiveMQ installation runs with a basic configuration. You can configure and extend ActiveMQ based on your requirements.
For more advanced configuration, such as security, transport connectors, or memory settings, see Configuring advanced settings for ActiveMQ [3].
If you do not already have an ActiveMQ instance, install ActiveMQ [7] and follow the steps below.
messaging.broker.url=failover:(tcp://server:61616)?timeout=3000where server is the host name of the server where ActiveMQ is installed.
When you set up ActiveMQ, the Alfresco Community Edition events and messaging subsystems are set to start up automatically.
Any changes to alfresco-global.properties require you to restart Alfresco Community Edition to apply the changes.
Clustering
ActiveMQ should be clustered to achieve fault tolerance and reliable high performance load balancing of messages. The default URL configuration for both the repository and your module must use the fail over transport. For more information, see ActiveMQ - clustering [9].
Security
You can secure the repository - ActiveMQ - your module's topic and queue communication using authentication, authorization, and SSL encryption. For more information, see ActiveMQ - security [10] and ActiveMQ - using SSL [11].
<broker> .. <plugins> <simpleAuthenticationPlugin> <users> <authenticationUser username="system" password="manager" groups="users,admins"/> <authenticationUser username="user" password="password" groups="users"/> <authenticationUser username="guest" password="password" groups="guests"/> </users> </simpleAuthenticationPlugin> <authorizationPlugin> <map> <authorizationMap> <authorizationEntries> <authorizationEntry topic="Consumer.*.VirtualTopic.alfresco.repo.events.nodes>" read="users" write="users" admin="users"/> <authorizationEntry topic="ActiveMQ.Advisory.>" read="guests,users" write="guests,users" admin="guests,users"/> <authorizationEntry topic="VirtualTopic.alfresco.repo.events.nodes" read="guests,users" write="guests,users" admin="guests,users"/> </authorizationEntries> </authorizationMap> </map> </authorizationPlugin> </plugins> .. </broker>
This configures ActiveMQ to use basic authentication (username and password) and limit access to the your module's topic Consumer.*.VirtualTopic.alfresco.repo.events.nodes. Both the repository and sync service will have to provide a username and password. It it fails, an exception will be shown in the repository and the sync service logs.
Here's an example of the exception in the repository log:
Caused by: java.lang.SecurityException: User name [null] or password is invalid. at org.apache.activemq.security.SimpleAuthenticationBroker.authenticate(SimpleAuthenticationBroker.java:103) at org.apache.activemq.security.SimpleAuthenticationBroker.addConnection(SimpleAuthenticationBroker.java:71) at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:98) at org.apache.activemq.broker.MutableBrokerFilter.addConnection(MutableBrokerFilter.java:103)
ERROR [2016-03-16 16:07:21.251] [Camel (alfrescoServiceCamelContext) thread #3 - JmsConsumer[Consumer.074f6b96-685b-4a03-959f-7e77793f1ce2.VirtualTopic.alfresco.repo.events.nodes]] org.apache.camel.component.jms.DefaultJmsMessageListenerContainer - Could not refresh JMS Connection for destination 'Consumer.074f6b96-685b-4a03-959f-7e77793f1ce2.VirtualTopic.alfresco.repo.events.nodes?consumer.prefetchSize=3000' - retrying in 5000 ms. Cause: User name [null] or password is invalid.
The module's ActiveMQ username and password can be set using the properties, messaging.username and messaging.password. The repository ActiveMQ username and password can be set using the properties messaging.broker.username and messaging.broker.password.
Additionally, enable SSL to provide secure communication of events. See ActiveMQ - HTTP and HTTPS Transports [12].
Links:
[1] https://docs.alfresco.com/mm/tasks/mq-auto.html
[2] https://docs.alfresco.com/syncservice/tasks/desktop-sync-install.html
[3] https://docs.alfresco.com/activemq-config.html
[4] https://docs.alfresco.com/../tasks/activemq-install.html
[5] https://docs.alfresco.com/../concepts/activemq-config.html
[6] https://docs.alfresco.com/../concepts/ch-configuration.html
[7] http://activemq.apache.org/installation.html
[8] https://docs.alfresco.com/../concepts/activemq-overview.html
[9] http://activemq.apache.org/clustering.html
[10] http://activemq.apache.org/security.html
[11] http://activemq.apache.org/how-do-i-use-ssl.html
[12] http://activemq.apache.org/http-and-https-transports-reference.html