Search in sources :

Example 86 with Link

use of org.jboss.resteasy.spi.Link in project activemq-artemis by apache.

the class RestSend method main.

public static void main(String[] args) throws Exception {
    // first get the create URL for the shipping queue
    ClientRequest request = new ClientRequest("http://localhost:8080/queues/orders");
    ClientResponse res = request.head();
    Link create = res.getHeaderAsLink("msg-create");
    System.out.println("Send order...");
    Order order = new Order();
    order.setName("Bill");
    order.setItem("iPhone4");
    order.setAmount("$199.99");
    res = create.request().body("application/xml", order).post();
    if (res.getStatus() != 201)
        throw new RuntimeException("Failed to post");
}
Also used : ClientResponse(org.jboss.resteasy.client.ClientResponse) ClientRequest(org.jboss.resteasy.client.ClientRequest) Link(org.jboss.resteasy.spi.Link)

Aggregations

Link (org.jboss.resteasy.spi.Link)86 ClientRequest (org.jboss.resteasy.client.ClientRequest)81 Test (org.junit.Test)68 ClientResponse (org.jboss.resteasy.client.ClientResponse)25 XmlLink (org.apache.activemq.artemis.rest.queue.push.xml.XmlLink)20 QueueDeployment (org.apache.activemq.artemis.rest.queue.QueueDeployment)11 PushTopicRegistration (org.apache.activemq.artemis.rest.topic.PushTopicRegistration)8 TopicDeployment (org.apache.activemq.artemis.rest.topic.TopicDeployment)7 SimpleString (org.apache.activemq.artemis.api.core.SimpleString)4 PushRegistration (org.apache.activemq.artemis.rest.queue.push.xml.PushRegistration)4 ClientSession (org.apache.activemq.artemis.api.core.client.ClientSession)2 AddressInfo (org.apache.activemq.artemis.core.server.impl.AddressInfo)2 ActiveMQPushStrategy (org.apache.activemq.artemis.rest.queue.push.ActiveMQPushStrategy)2 Connection (javax.jms.Connection)1 Destination (javax.jms.Destination)1 MessageConsumer (javax.jms.MessageConsumer)1 MessageListener (javax.jms.MessageListener)1 Session (javax.jms.Session)1 SecurityConfiguration (org.apache.activemq.artemis.core.config.impl.SecurityConfiguration)1 ActiveMQDestination (org.apache.activemq.artemis.jms.client.ActiveMQDestination)1