Topic |
xmlBlaster provides an implementation of the JMS API.
|
Des cription |
The main purpose of XmlBlaster is not to be yet another JMS implementation. There
are conceptual differences but generally, a relatively simple mapping can be found between the features
required by a jms provider and a subset of the wide range of features provided by xmlBlaster.
Currently the implementation status is in its very first stage and only a simple demo is working.
|
Example
Java
|
This demo can be found in demo/javaclients/j2ee/jms
package javaclients.jms;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.jms.Topic;
import javax.jms.TopicConnection;
import javax.jms.TopicConnectionFactory;
import javax.jms.TopicPublisher;
import javax.jms.TopicSession;
import javax.jms.TopicSubscriber;
import org.xmlBlaster.jms.XBConnectionFactory;
import org.xmlBlaster.jms.XBTopic;
import org.xmlBlaster.util.Global;
/**
* SimpleTest
*
* @author Michele Laghi
*
*/
public class SimpleJmsDemo implements MessageListener {
private Global global;
private LogChannel log;
public SimpleJmsDemo(Global global) {
this.global = global;
this.log = this.global.getLog("jms-test");
}
public void prepare() throws JMSException {
try {
// create a factory (normally retreived by naming service)
TopicConnectionFactory factory = new XBConnectionFactory(this.global);
// should be retreived via jndi
Topic topic = new XBTopic("jms-test");
TopicConnection connection = factory.createTopicConnection();
connection.start();
TopicSession session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
TopicSubscriber subscriber = session.createSubscriber(topic);
subscriber.setMessageListener(this);
TopicPublisher publisher = session.createPublisher(topic);
TextMessage msg = session.createTextMessage();
msg.setText("this is a simple jms test message");
publisher.publish(msg);
Thread.sleep(3000L);
connection.stop();
}
catch (Exception ex) {
ex.printStackTrace();
}
}
public void onMessage(Message message) {
try {
if (message instanceof TextMessage) {
System.out.println(((TextMessage)message).getText());
}
}
catch (JMSException ex) {
System.err.println(ex.getMessage());
ex.printStackTrace();
}
}
public static void main(String[] args) {
Global global = new Global(args);
SimpleJmsDemo test = new SimpleJmsDemo(global);
try {
test.prepare();
}
catch (Exception ex) {
ex.printStackTrace();
}
}
}
|
Configure |
NOTE: Configuration parameters are specified on command line (-someValue 17) or in the
xmlBlaster.properties file (someValue=17). See requirement "util.property" for details.
Columns named Impl tells you if the feature is implemented.
Columns named Hot tells you if the configuration is changeable in hot operation.
|
Todo |
Decisions have to be taken regarding the following:
- how to separate queues from ptp clients
- sessions and session pools: how to deal with persistent subscriptions
and how to handle reconnection to an anonymous session (i.e. such one which
was assigned by the server side: negative public session Id).
Tasks to be done in the near future:
- implement client properties of type object in the qos
- check if the mapping for priorities is correct (message)
- check if the timestamp mapping is correct (are we using x1000000 ?)
- checking the naming for queues and topics
- add key client tags for the topics
- clear up what is the sense of having a setRedelivered in the message (should
it overwrite the serverside retries ?)
- setJMSReplyTo: should it be allowed to reply to topics, does the sender
really work or is it overwritten by the client library ?
- in messsage add in setters and getters for properties the xmlBlaster specific ones too.
- check if the settings of the publisher are stronger or weaker from the ones
set in the message.
|
This page is generated from the requirement XML file xmlBlaster/doc/requirements/jms.xml