# JBossMQ Examples Documentation

## SERVER

This is a simple JMS server using SypderMQ.

## CLIENT

This is a simple parser which gives you the ability to test the JMS server. You can dynamically use JMS objects, and invoke methods on them.

### Commands

- object.method(param[,...])
  Where param is an object or a string : invoke the selected method on the object
  ex: session.createTopic("myTopic")
- result=object.method(param[,...])
  Use this form to store the result of the method
  ex: ID=connection.getClientID()

### Macros

- pub(topic,text)
  Send a TextMessage to a topic
- pubq(queue,text)
  Send a TextMessage to a queue
- pub2(topic)
  Send a 10K BytesMessage to a topic
- newSubscriber=sub(topic)
  create a new TopicSubscriber for this topic
- queueReceiver=subq(queue)
  create a new QueueReceiver for this queue
- subscriber.listen()
  create a Listener for this MessageConsumer
- subscriber.unlisten()
  remove the Listener for this MessageConsumer

### Objects

When the program starts, it creates one the follwing objects:

- ct is a TopicConnection
- st is a TopicSession
- cq is a QueueConnection
- sq is a QueueSession

### Example

>     st.createTopic("example")
>     sub=sub("example")
>     sub.listen()
>     publish("example","hello")
>     ct.start()