Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //package org.unibl.etf.mq;
- import java.util.Scanner;
- import javax.ws.rs.client.Client;
- import javax.ws.rs.client.ClientBuilder;
- import javax.ws.rs.core.Response;
- /*import com.rabbitmq.client.Channel;
- import com.rabbitmq.client.Connection;
- import com.rabbitmq.client.ConnectionFactory;
- */
- public class Sender {
- private final static String QUEUE_NAME = "test";
- public static void main(String[] argv) throws Exception {
- /* ConnectionFactory factory = new ConnectionFactory();
- factory.setHost("localhost");
- Connection connection = factory.newConnection();
- Channel channel = connection.createChannel();
- channel.queueDeclare(QUEUE_NAME, false, false, false, null);
- Scanner in = new Scanner(System.in);
- System.out.print("Unesi prvu poruku: ");
- String message;
- */
- Client client = ClientBuilder.newClient();
- Response response = client.target("http://commerce.com/customers/123")
- .accept("application/json")
- .get();
- /* while(!(message=in.nextLine()).equals("QUIT")){
- channel.basicPublish("", QUEUE_NAME, null, message.getBytes("UTF-8"));
- System.out.println("Sending: '" + message + "'");
- System.out.print("Unesi sljedeću poruku: ");
- }
- in.close();
- channel.close();
- connection.close();*/
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement