Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Section
borderfalse
Column
width60%

Setting up the Notification Service

Background

Starting with release 3.4.0 of OpenEMPI we switched to Apache ActiveMQ Artemis as the standard messaging service implementation. Apache ActiveMQ Artemis is an asynchronous messaging system, an example of Message Oriented Middleware. Using an asynchronous messaging system allows you to integrate OpenEMPI with other systems using a loosely coupled architecture. Messaging systems decouple the senders of messages from the consumers of those messages. The decoupling applies to the timing of the sending and receiving of the messages since the receiver or receivers do not need to be accessible or available when the messages are sent out. The decoupling also applies to the technologies used by the senders and the receivers since it is possible to receive the messages from the messaging system using a wide variety of technologies that don't match the technologies used in the implementation of OpenEMPI. Lastly, the decoupling also applies to the routing of the messages since the sender does not have any awareness of who the receiver is and through configuration you can setup either single or multiple receivers for the messages sent out by OpenEMPI.

Starting with release 3.5.1, OpenEMPI also supports RabbitMQ as the message broker instead of Apache ActiveMQ Artemis.

Child pages (Children Display)

Installation of Apache ActiveMQ Artemis

The first step in the installation of the message service is to download and extract the ActiveMQ Artemis distribution. The software can be downloaded from https://activemq.apache.org/artemis/download.html and we currently recommend version 2.1.0. You can extract the contents of the downloaded archive anywhere you have space in your filesystem but we recommend that you keep the distribution of the Artemis software separate from the directory where you have OpenEMPI installed. This will allow you to upgrade to future version of OpenEMPI and Artemis software independently of the instance of OpenEMPI you are maintaining.

The next step is to create an instance of the messaging server or broker. In the following example we assume that the environment variable ARTEMIS_HOME points to the directory where you extracted the contents of the ActiveMQ Artemis software and OPENEMPI_HOME points to the directory where you have OpenEMPI installed.

Code Block
languagebash
 $ ${ARTEMIS_HOME}/bin/artemis create ${OPENEMPI_HOME}/artemis --user openempi \
          --password openempi --require-login 
Creating ActiveMQ Artemis instance at: /sysnet/openempi/artemis
Auto tuning journal ...
done! Your system can make 0.53 writes per millisecond, your journal-buffer-timeout will be 1900000
You can now start the broker by executing:  
   "/sysnet/openempi/artemis/bin/artemis" run
Or you can run the broker in the background using:
   "/sysnet/openempi/artemis/bin/artemis-service" start

Once the broker has been created, you can start it using the commands shown above by the broker after it starts.

Code Block
$ /sysnet/projects/3.4.x/openempi/artemis/bin/artemis run
     _        _               _
    / \  ____| |_  ___ __  __(_) _____
   / _ \|  _ \ __|/ _ \  \/  | |/  __/
  / ___ \ | \/ |_/  __/ |\/| | |\___ \
 /_/   \_\|   \__\____|_|  |_|_|/___ /
 Apache ActiveMQ Artemis 2.1.0

17:46:00,904 INFO  [org.apache.activemq.artemis.integration.bootstrap] AMQ101000: 
Starting ActiveMQ Artemis Server
17:46:00,936 INFO  [org.apache.activemq.artemis.core.server] AMQ221000: live Message Broker 
is starting with configuration Broker Configuration
(clustered=false,journalDirectory=./data/journal,bindingsDirectory=./data/bindings,
largeMessagesDirectory=./data/large-messages,pagingDirectory=./data/paging)
17:46:00,953 INFO  [org.apache.activemq.artemis.core.server] AMQ221012: Using AIO Journal
17:46:00,978 INFO  [org.apache.activemq.artemis.core.server] AMQ221057: Global Max Size is being
adjusted to 1/2 of the JVM max size (-Xmx). being defined as 1,073,741,824
17:46:00,992 INFO  [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: 
[artemis-server]. Adding protocol support for: CORE
17:46:00,992 INFO  [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: 
[artemis-amqp-protocol]. Adding protocol support for: AMQP
17:46:00,993 INFO  [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: 
[artemis-hornetq-protocol]. Adding protocol support for: HORNETQ
17:46:00,993 INFO  [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: 
[artemis-mqtt-protocol]. Adding protocol support for: MQTT
17:46:00,993 INFO  [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: 
[artemis-openwire-protocol]. Adding protocol support for: OPENWIRE
17:46:00,995 INFO  [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: 
[artemis-stomp-protocol]. Adding protocol support for: STOMP
17:46:01,031 INFO  [org.apache.activemq.artemis.core.server] AMQ221034: Waiting indefinitely to obtain live lock
17:46:01,031 INFO  [org.apache.activemq.artemis.core.server] AMQ221035: Live Server Obtained live lock
17:46:01,329 INFO  [org.apache.activemq.artemis.core.server] AMQ221003: Deploying queue DLQ
17:46:01,403 INFO  [org.apache.activemq.artemis.core.server] AMQ221003: Deploying queue ExpiryQueue
17:46:01,695 INFO  [org.apache.activemq.artemis.core.server] AMQ221020: Started EPOLL Acceptor at 0.0.0.0:61616 for 
protocols 
[CORE,MQTT,AMQP,STOMP,HORNETQ,OPENWIRE]
17:46:01,697 INFO  [org.apache.activemq.artemis.core.server] AMQ221020: Started EPOLL Acceptor at 0.0.0.0:5445 for 
protocols [HORNETQ,STOMP]
17:46:01,698 INFO  [org.apache.activemq.artemis.core.server] AMQ221020: Started EPOLL Acceptor at 0.0.0.0:5672 for 
protocols [AMQP]
17:46:01,736 INFO  [org.apache.activemq.artemis.core.server] AMQ221020: Started EPOLL Acceptor at 0.0.0.0:1883 for 
protocols [MQTT]
17:46:01,738 INFO  [org.apache.activemq.artemis.core.server] AMQ221020: Started EPOLL Acceptor at 0.0.0.0:61613 for 
protocols [STOMP]
17:46:01,749 INFO  [org.apache.activemq.artemis.core.server] AMQ221007: Server is now live
17:46:01,750 INFO  [org.apache.activemq.artemis.core.server] AMQ221001: Apache ActiveMQ Artemis Message Broker version 2.1.0 
[0.0.0.0, nodeID=1e044172-8b71-11e7-beca-005056c00008] 
17:46:02,082 INFO  [org.apache.activemq.artemis] AMQ241001: HTTP Server started at http://localhost:8161
17:46:02,082 INFO  [org.apache.activemq.artemis] AMQ241002: Artemis Jolokia REST API available at http://localhost:8161/jolokia
17:46:06,620 WARN  [org.apache.activemq.artemis.core.server] AMQ222210: Storage usage is beyond max-disk-usage. System will 
start blocking producers.
17:46:26,912 INFO  [org.apache.activemq.artemis.core.server] AMQ221002: Apache ActiveMQ Artemis Message Broker version 2.1.0 
[1e044172-8b71-11e7-beca-005056c00008] stopped, uptime 26.007 seconds

You now need to configure OpenEMPI to specify how it should connect to the broker during startup. The configuration requires three parameters:

  1. The URL that OpenEMPI should use to connect to the running broker (using the parameter brokerUrl).
  2. The username that OpenEMPI should use to connect to the broker (using the parameter brokerUsername).
  3. The password that OpenEMPI should use to connect to the broker (using the parameter brokerPassword).

All three parameters are specified in the applicationContext-services.xml file as shown below. The brokerUsername and brokerPassword must match the values used during the creation of the broker above. The listening hostname, port number and many other configuration parameters for the broken can be specified in the broker.xml file that was created in the etc directory of the broker instance you created above.

Code Block
languagexml
	<bean id="notificationService" class="org.openhie.openempi.notification.impl.NotificationServiceImpl">
		<property name="enableNotificationService" value="true"/>
		<property name="topicMap">
			<map>
				<entry key="addNotificationEventType" value-ref="addEventTopic"/>
				<entry key="deleteNotificationEventType" value-ref="deleteEventTopic"/>
				<entry key="importNotificationEventType" value-ref="importEventTopic"/>
				<entry key="mergeNotificationEventType" value-ref="mergeEventTopic"/>
				<entry key="updateNotificationEventType" value-ref="updateEventTopic"/>
			</map>
		</property>
		<property name="brokerUrl" value="tcp://localhost:61616"/>
		<property name="brokerUsername" value="openempi"/>
		<property name="brokerPassword" value="openempi"/>
	</bean>

 

 

 

 

Column
width40%