Overview

What is it?

As of Jetspeed 1.6, Jetspeed now supports the JMS API. This is done through the new Messaging service. While the interface is able to support a JMS 1.0.2 implementation, the AbstractJMSMessagingService makes use of the JMS 1.1 API to provide easier integration with other JMS implementations.

Currently, Jetspeed uses ActiveMQ as the JMS implementation. In order to substitute another JMS 1.1 compatiable implementation, all that needs to be done is to derive from the AbstractJMSMessagingService, implementing the createConnection method. Also, any unique parameters that your JMS implementation needs will need to be configured in the new implementations init() method.

What can it do?

The Messaging service allows Jetspeed to be ran in a multi-node configuration (multiple Jetspeed instances running in different VMs or different webapps). When configured properly, Jetspeed's Registry and SecurityCache services will enable listeners on appropriate JMS topics. When a registry entry is updated or a change is made in the security (user/role/group), a message will be sent to the topic. The other nodes will receive the message and clear their cache of the appropriate item. The next access to the same item will cause Jetspeed to reload the information from the underlying storage mechanism.

Setup

ActiveMQ

  • In order to use the Messaging service, you will need to download Active MQ from the distribution site.
  • Unzip the distribution into your preferred directory.
  • From the ActiveMQ root, type "maven server" to start the JMS server.

Jetspeed

You will need to setup a central database where the data (Registry/Security) will be stored. Without this, the Messaging service will yield no results. When the services reload their data, they will still be loading from the local files.

In order to activate the messaging service, the following property will need to be added to the JetspeedResources.properties file. services.MessagingService.classname=org.apache.jetspeed.services.messaging.jms.activemq.MessagingServiceImpl No other configuration is needed. If you wish to configure the service, see the section on configuration.

This will enable the Messaging service. However, the Registry and SecurityCache service will not use it by default. To enable the use of the Messaging service, add the following propertis to the JetspeedResources.properties file. services.Registry.enable_messaging=true services.SecurityCache.enable_messaging=true

Configuration

Connection URL

FieldDescriptionDefault ValueExample
urlThe URL for the service to connect to. If this is specified, the other parameters are ignoredConfigured by the Implementationrmi://localhost:616161
schemaThe connection schemaConfigured by the Implementationhttp, rmi, tcp
hostThe server to connect toConfigured by the Implementationlocalhost
portThe port to connect toConfigured by the Implementation8080, 61616
nameExtra path information, servlet nameConfigured by the Implementationjmsservlet

JNDI

FieldDescriptionDefault ValueExample
connection_factoryClassname of the JNDI connection factoryConfigured by the Implementationorg.apache.jndi.my.factory

Session

FieldDescriptionDefault ValueExample
transactedWhether the messages should be transacted or notfalsetrue/false
ack_modeThe acknowledgement mode of the sessionautoauto, client, dups_ok

Message

FieldDescriptionDefault ValueExample
topic_enabledChooses between queues and topicstruetrue/false
durableEnables the client to receive messages that are persistent and were sent while the client was not listeningfalsetrue/false
nolocalWhether the local node should also receive messages generated by the same node.truetrue/false

Producer

FieldDescriptionDefault ValueExample
delivery_modeWhether messages should persist beyond the life of the sendernon_persistentnon_persistent, persistent
priorityThe priority of the message being sent00 < X < 10
time_to_liveHow long the message should live00 < 2^16

ActiveMQ

FieldDescriptionDefault ValueExample
usernameThe username to access the JMS serverConfigured by the Implementationmyusername
passwordThe password to access the JMS serverConfigured by the Implementationwordpass