This repository has been archived by the owner on Jul 16, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of git@github.com:rabbitmq/rmq-0mq
Conflicts: examples/pipeline/rabbitmq.config examples/pubsub/rabbitmq.config examples/reqrep/rabbitmq.config
- Loading branch information
Showing
34 changed files
with
110 additions
and
35 deletions.
There are no files selected for viewing
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
|
||
import com.rabbitmq.client.AMQP; | ||
import com.rabbitmq.client.Channel; | ||
import com.rabbitmq.client.Connection; | ||
import com.rabbitmq.client.ConnectionFactory; | ||
import com.rabbitmq.client.QueueingConsumer; | ||
|
||
public class pull { | ||
public static void main(String[] args) { | ||
try { | ||
|
||
// By default connect to the local AMQP broker | ||
String hostName = (args.length > 0) ? args[0] : "localhost"; | ||
int portNumber = (args.length > 1) ? | ||
Integer.parseInt(args[1]) : AMQP.PROTOCOL.PORT; | ||
|
||
// Connect to the AMQP broker | ||
ConnectionFactory factory = new ConnectionFactory(); | ||
factory.setHost(hostName); | ||
factory.setPort(portNumber); | ||
Connection connection = factory.newConnection(); | ||
Channel channel = connection.createChannel(); | ||
|
||
// Establish the PUB/SUB wiring | ||
String queueName = channel.queueDeclare().getQueue(); | ||
channel.queueBind(queueName, "PIPELINE", null); | ||
QueueingConsumer consumer = new QueueingConsumer(channel); | ||
channel.basicConsume(queueName, true, consumer); | ||
|
||
for (;;) { | ||
|
||
// Get next request | ||
String msg = consumer.nextDelivery().getBody().toString(); | ||
System.out.println (msg); | ||
} | ||
} catch (Exception e) { | ||
System.err.println("Main thread caught exception: " + e); | ||
e.printStackTrace(); | ||
System.exit(1); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
|
||
import zmq | ||
import time | ||
|
||
context = zmq.Context() | ||
socket = context.socket(zmq.PULL) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
import com.rabbitmq.client.AMQP; | ||
import com.rabbitmq.client.Channel; | ||
import com.rabbitmq.client.Connection; | ||
import com.rabbitmq.client.ConnectionFactory; | ||
import com.rabbitmq.client.QueueingConsumer; | ||
|
||
public class push { | ||
public static void main(String[] args) { | ||
try { | ||
|
||
// By default connect to the local AMQP broker | ||
String hostName = (args.length > 0) ? args[0] : "localhost"; | ||
int portNumber = (args.length > 1) ? | ||
Integer.parseInt(args[1]) : AMQP.PROTOCOL.PORT; | ||
|
||
// Connect to the AMQP broker | ||
ConnectionFactory factory = new ConnectionFactory(); | ||
factory.setHost(hostName); | ||
factory.setPort(portNumber); | ||
Connection connection = factory.newConnection(); | ||
Channel channel = connection.createChannel(); | ||
|
||
for (;;) { | ||
|
||
// Send a message. | ||
channel.basicPublish("PIPELINE", null, null, | ||
"Hello, World???".getBytes()); | ||
|
||
// Sleep for one second. | ||
Thread.sleep (1000); | ||
} | ||
} catch (Exception e) { | ||
System.err.println("Main thread caught exception: " + e); | ||
e.printStackTrace(); | ||
System.exit(1); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[{r0mq, | ||
[{services, | ||
[{push, "tcp://127.0.0.1:5557", <<"pipeline">>}, | ||
{pull, "tcp://127.0.0.1:5558", <<"pipeline">>}]}]}]. | ||
[{push, "tcp://127.0.0.1:5557", <<"PIPELINE">>}, | ||
{pull, "tcp://127.0.0.1:5558", <<"PIPELINE">>}]}]}]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[{r0mq, | ||
[{services, | ||
[{pub, "tcp://127.0.0.1:5555", <<"HELLO_FEED">>}, | ||
{sub, "tcp://127.0.0.1:5556", <<"HELLO_FEED">>}]}]}]. | ||
[{pub, "tcp://127.0.0.1:5555", <<"PUBSUB">>}, | ||
{sub, "tcp://127.0.0.1:5556", <<"PUBSUB">>}]}]}]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,4 @@ | ||
[{r0mq, | ||
[{services, | ||
[{req, | ||
"tcp://127.0.0.1:5559", | ||
<<"HELLO_WORLD">>}, | ||
{rep, | ||
"tcp://127.0.0.1:5560", | ||
<<"HELLO_WORLD">>}]}]}]. | ||
[{req, "tcp://127.0.0.1:5559", <<"REQREP">>}, | ||
{rep, "tcp://127.0.0.1:5560", <<"REQREP">>}]}]}]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ | |
|
||
while True: | ||
message = socket.recv() | ||
print "processing request" | ||
socket.send("World!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,5 @@ | |
socket.connect("tcp://127.0.0.1:5559") | ||
|
||
socket.send("Hello!") | ||
rep = socket.recv() | ||
print rep | ||
print socket.recv() | ||
|