Skip to content

Commit

Permalink
selector support
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/billburke/jboss/resteasy/resteasy-git/svn-server-sync/resteasy/trunk/rest-star/messaging@1260 2b1ed4c4-5db3-0410-90e4-80a7a6204c25
  • Loading branch information
patriot1burke committed Oct 25, 2010
1 parent f813b85 commit a8cde46
Show file tree
Hide file tree
Showing 22 changed files with 688 additions and 104 deletions.
2 changes: 1 addition & 1 deletion core/pom.xml
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.hornetq.rest</groupId>
<artifactId>resteasy-star-messaging-all</artifactId>
<version>1.0-beta-1</version>
<version>1.0-beta-2</version>
</parent>

<groupId>org.hornetq.rest</groupId>
Expand Down
9 changes: 5 additions & 4 deletions pom.xml
Expand Up @@ -5,12 +5,13 @@
<name>HornetQ REST Interface Parent POM</name>
<groupId>org.hornetq.rest</groupId>
<artifactId>hornetq-rest-all</artifactId>
<version>1.0-beta-1</version>
<version>1.0-beta-2</version>
<packaging>pom</packaging>
<description>HornetQ REST Interface</description>

<properties>
<jboss.home>/Users/billburke/jboss/jboss-4.2.3.GA</jboss.home>
<resteasy.version>2.0.0.GA</resteasy.version>
<resteasy.version>2.0.1.GA</resteasy.version>
</properties>

<url>http://rest-easy.org</url>
Expand Down Expand Up @@ -86,12 +87,12 @@
<dependency>
<groupId>org.hornetq</groupId>
<artifactId>hornetq-core</artifactId>
<version>2.1.1.Final</version>
<version>2.1.2.Final</version>
</dependency>
<dependency>
<groupId>org.hornetq</groupId>
<artifactId>hornetq-jms</artifactId>
<version>2.1.1.Final</version>
<version>2.1.2.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.jms</groupId>
Expand Down
2 changes: 1 addition & 1 deletion session-interface/distribution/pom.xml
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.hornetq.rest</groupId>
<artifactId>hornetq-rest-all</artifactId>
<version>1.0-beta-1</version>
<version>1.0-beta-2</version>
</parent>

<artifactId>hornetq-rest-dist</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion session-interface/docbook/pom.xml
Expand Up @@ -6,7 +6,7 @@

<groupId>org.hornetq.rest</groupId>
<artifactId>hornetq-rest-reference-guide-${translation}</artifactId>
<version>1.0-beta-1</version>
<version>1.0-beta-2</version>
<packaging>jdocbook</packaging>
<name>HornetQ REST Interface Reference Guide (${translation})</name>
<repositories>
Expand Down
26 changes: 25 additions & 1 deletion session-interface/docbook/reference/en/master.xml
Expand Up @@ -870,6 +870,17 @@ Content-Type: application/xml
the server. Only usable on topics.</para>
</listitem>
</varlistentry>

<varlistentry>
<term>selector</term>

<listitem>
<para>This is an optional JMS selector string. The HornetQ REST
interface adds HTTP headers to the JMS message for REST produced
messages. HTTP headers are prefixed with "http_" and every '-'
charactor is converted to a '$'.</para>
</listitem>
</varlistentry>
</variablelist>

<sect1>
Expand Down Expand Up @@ -1480,6 +1491,10 @@ msg-consume-next: http://example.com/queues/jms.queue.bar/pull-consumers/333/con

<programlisting>&lt;push-registration&gt;
&lt;durable&gt;false&lt;/durable&gt;
&lt;selector&gt;&lt;![CDATA[
SomeAttribute &gt; 1
]]&gt;
&lt;/selector&gt;
&lt;link rel="push" href="http://somewhere.com" type="application/json" method="PUT"/&gt;
&lt;/push-registration&gt;
</programlisting>
Expand All @@ -1493,6 +1508,10 @@ msg-consume-next: http://example.com/queues/jms.queue.bar/pull-consumers/333/con
<literal>queue-push-store-dir</literal> config variable defined in
Chapter 2. (<literal>topic-push-store-dir</literal> for topics).</para>

<para>The <literal>selector</literal> element is optional and defines a
JMS message selector. You should enclose it within CDATA blocks as some
of the selector characters are illegal XML.</para>

<para>The <literal>link</literal> element specifies the basis of the
interaction. The <literal>href</literal> attribute contains the URL you
want to interact with. It is the only required attribute. The
Expand Down Expand Up @@ -1562,11 +1581,16 @@ msg-consume-next: http://example.com/queues/jms.queue.bar/pull-consumers/333/con
<title>The Topic Push Subscription XML</title>

<para>The push XML for a topic is the same except the root element is
push-topic-registration. The rest of the document is the same. Here's an
push-topic-registration. (Also remember the <literal>selector</literal>
element is optional). The rest of the document is the same. Here's an
example of a template registration:</para>

<programlisting>&lt;push-topic-registration&gt;
&lt;durable&gt;true&lt;/durable&gt;
&lt;selector&gt;&lt;![CDATA[
SomeAttribute &gt; 1
]]&gt;
&lt;/selector&gt;
&lt;link rel="template" href="http://somewhere.com/resources/{id}/messages" method="POST"/&gt;
&lt;/push-topic registration&gt;</programlisting>
</sect1>
Expand Down
2 changes: 1 addition & 1 deletion session-interface/examples/dup-send/pom.xml
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.hornetq.rest</groupId>
<artifactId>hornetq-rest-all</artifactId>
<version>1.0-beta-1</version>
<version>1.0-beta-2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.hornetq.rest.examples</groupId>
Expand Down
2 changes: 1 addition & 1 deletion session-interface/examples/javascript-chat/pom.xml
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.hornetq.rest</groupId>
<artifactId>hornetq-rest-all</artifactId>
<version>1.0-beta-1</version>
<version>1.0-beta-2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.hornetq.rest.examples</groupId>
Expand Down
2 changes: 1 addition & 1 deletion session-interface/examples/jms-to-rest/pom.xml
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.hornetq.rest</groupId>
<artifactId>hornetq-rest-all</artifactId>
<version>1.0-beta-1</version>
<version>1.0-beta-2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.hornetq.rest.examples</groupId>
Expand Down
2 changes: 1 addition & 1 deletion session-interface/examples/push/pom.xml
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.hornetq.rest</groupId>
<artifactId>hornetq-rest-all</artifactId>
<version>1.0-beta-1</version>
<version>1.0-beta-2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.hornetq.rest.examples</groupId>
Expand Down
2 changes: 1 addition & 1 deletion session-interface/jboss-integration/session/pom.xml
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.hornetq.rest</groupId>
<artifactId>resteasy-star-messaging-all</artifactId>
<version>1.0-beta-1</version>
<version>1.0-beta-2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.hornetq.rest.jbossas</groupId>
Expand Down
2 changes: 1 addition & 1 deletion session-interface/session/pom.xml
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.hornetq.rest</groupId>
<artifactId>hornetq-rest-all</artifactId>
<version>1.0-beta-1</version>
<version>1.0-beta-2</version>
</parent>

<groupId>org.hornetq.rest</groupId>
Expand Down
Expand Up @@ -31,10 +31,10 @@ public class AcknowledgedQueueConsumer extends QueueConsumer
protected String startup = Long.toString(System.currentTimeMillis());
protected volatile Acknowledgement ack;

public AcknowledgedQueueConsumer(ClientSessionFactory factory, String destination, String id, DestinationServiceManager serviceManager)
public AcknowledgedQueueConsumer(ClientSessionFactory factory, String destination, String id, DestinationServiceManager serviceManager, String selector)
throws HornetQException
{
super(factory, destination, id, serviceManager);
super(factory, destination, id, serviceManager, selector);
autoAck = false;
}

Expand Down Expand Up @@ -187,9 +187,7 @@ protected void unacknowledge()

try
{
session = factory.createSession();
consumer = session.createConsumer(destination);
session.start();
createSession();
}
catch (Exception e)
{
Expand Down

0 comments on commit a8cde46

Please sign in to comment.