You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by js...@apache.org on 2002/06/23 01:56:11 UTC
cvs commit: jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/jms sendObject.jelly flushQueue.jelly sendMessage.jelly receiveMap.jelly receiveObject.jelly sendText.jelly sendMap.jelly receive.jelly
jstrachan 2002/06/22 16:56:11
Added: jelly/src/test/org/apache/commons/jelly/jms sendObject.jelly
flushQueue.jelly sendMessage.jelly receiveMap.jelly
receiveObject.jelly sendText.jelly sendMap.jelly
receive.jelly
Log:
added a bunch of JMS example jelly scripts that demonstrate the JMS tag library in action
Revision Changes Path
1.1 jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/jms/sendObject.jelly
Index: sendObject.jelly
===================================================================
<?xml version="1.0"?>
<jelly xmlns="jelly:core" xmlns:jms="jelly:jms">
About to send a JMS Object message
<new className="java.util.Date" var="d"/>
<jms:connection name="queue">
<jms:send>
<jms:destination name="myQueue"/>
<jms:objectMessage object="${d}" type="Date" correlationID="4321"/>
</jms:send>
</jms:connection>
Message sent!
</jelly>
1.1 jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/jms/flushQueue.jelly
Index: flushQueue.jelly
===================================================================
<?xml version="1.0"?>
<jelly xmlns="jelly:core" xmlns:jms="jelly:jms">
Flushing the input queue
<jms:connection name="queue" var="conn">
<forEach begin="1" end="1000">
<jms:receive var="message" timeout="1">
<jms:destination name="myQueue"/>
</jms:receive>
<if test="${message != null}">
Found message: ${message}.
</if>
</forEach>
</jms:connection>
</jelly>
1.1 jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/jms/sendMessage.jelly
Index: sendMessage.jelly
===================================================================
<?xml version="1.0"?>
<jelly xmlns="jelly:core" xmlns:jms="jelly:jms">
About to send a JMS message
<jms:connection name="queue">
<jms:send>
<jms:destination name="myQueue"/>
<jms:message type="Pizza" correlationID="9999">
<jms:property name="a" value="topping"/>
<jms:property name="b" value="${123+456}"/>
<jms:property name="c">cheese x ${2+2}</jms:property>
</jms:message>
</jms:send>
</jms:connection>
Message sent!
</jelly>
1.1 jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/jms/receiveMap.jelly
Index: receiveMap.jelly
===================================================================
<?xml version="1.0"?>
<jelly xmlns="jelly:core" xmlns:jms="jelly:jms">
Waiting until I receive a JMS message
<jms:connection name="queue" var="conn">
<jms:receive var="message">
<jms:destination name="myQueue"/>
</jms:receive>
</jms:connection>
Found message: ${message.JMSMessageID}.
Map values are:
<forEach items="${message.mapNames}" var="key">
${key} = ${message.getObject(key)}
</forEach>
</jelly>
1.1 jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/jms/receiveObject.jelly
Index: receiveObject.jelly
===================================================================
<?xml version="1.0"?>
<jelly xmlns="jelly:core" xmlns:jms="jelly:jms">
Waiting until I receive a JMS message
<jms:connection name="queue" var="conn">
<jms:receive var="message">
<jms:destination name="myQueue"/>
</jms:receive>
</jms:connection>
Found message: ${message}
The object body is: ${message.getObject()}
</jelly>
1.1 jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/jms/sendText.jelly
Index: sendText.jelly
===================================================================
<?xml version="1.0"?>
<jelly xmlns="jelly:core" xmlns:jms="jelly:jms">
About to send a JMS text message
<jms:connection name="queue">
<jms:send>
<jms:destination>myQueue</jms:destination>
<jms:textMessage type="Chat">This is some text via the tag body</jms:textMessage>
</jms:send>
<jms:send>
<jms:destination name="myQueue"/>
<jms:textMessage text="This is some text via the attribute" type="Chat"/>
</jms:send>
</jms:connection>
Messages sent!
</jelly>
1.1 jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/jms/sendMap.jelly
Index: sendMap.jelly
===================================================================
<?xml version="1.0"?>
<jelly xmlns="jelly:core" xmlns:jms="jelly:jms">
About to send a JMS map message
<jms:connection name="queue">
<jms:send>
<jms:destination name="myQueue"/>
<jms:mapMessage type="Order" correlationID="1234">
<jms:mapEntry name="a" value="pizza"/>
<jms:mapEntry name="b">cheese</jms:mapEntry>
<jms:mapEntry name="c" value="${12 * 20}"/>
</jms:mapMessage>
</jms:send>
<new className="java.util.HashMap" var="m"/>
<set target="${m}" property="a" value="pizza"/>
<set target="${m}" property="b" value="1234"/>
<set target="${m}" property="c" value="${12+57}"/>
Sending map message with map: ${m}
<jms:send>
<jms:destination name="myQueue"/>
<jms:mapMessage type="Order2" correlationID="23456" map="${m}"/>
</jms:send>
</jms:connection>
</jelly>
1.1 jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/jms/receive.jelly
Index: receive.jelly
===================================================================
<?xml version="1.0"?>
<jelly xmlns="jelly:core" xmlns:jms="jelly:jms">
Waiting until I receive a JMS message
<jms:connection name="queue" var="conn">
<jms:receive var="message">
<jms:destination name="myQueue"/>
</jms:receive>
</jms:connection>
Found message: ${message}
Properties are:
<forEach items="${message.propertyNames}" var="key">
${key} = ${message.getObjectProperty(key)}
</forEach>
The text body is: ${message.text}
</jelly>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>