Skip to content

Instantly share code, notes, and snippets.

View swapnonil's full-sized avatar

Swapnonil Mukherjee swapnonil

  • London
View GitHub Profile
@swapnonil
swapnonil / rabbitmq-env.conf
Created February 24, 2013 20:03
Generic rabbitmq-env.conf. This names the node and changes the default port to 5673
# I am a complete /etc/rabbitmq/rabbitmq-env.conf file.
# Comment lines start with a hash character.
# This is a /bin/sh script file - use ordinary envt var syntax
NODENAME=mir_node_2@localhost
NODE_PORT=5673
@swapnonil
swapnonil / rabbitmq.config
Created February 24, 2013 20:00
Generic Rabbit MQ Config. This one makes the rabbit mq work on 5673 instead of 5672 and the Management Plugin work on 15673 instead of 15672.
[
{mnesia, [{dump_log_write_threshold, 1000}]},
{rabbit, [{tcp_listeners, [5673]}]},
{rabbitmq_management,
[{listener, [{port, 15673},
{ip, "127.0.0.1"}
]}
]}
].
@swapnonil
swapnonil / applicationConfig.xml
Created February 24, 2013 19:57
General Spring Publisher Config for Rabbit MQ. The rabbit:queue-arguments are not being used, as they did not work with Rabbit MQ 3.0.2 The HA /Mirror Queue Settings were set using the Rabbit MQ Management Console. Refer to http://www.rabbitmq.com/ha.html.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:rabbit="http://www.springframework.org/schema/rabbit"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/rabbit http://www.springframework.org/schema/rabbit/spring-rabbit.xsd">
<rabbit:connection-factory id="connectionFactory" addresses="localhost:5672,localhost:5673" publisher-confirms="true"/>
<rabbit:template id="amqpTemplate" connection-factory="connectionFactory"/>
@swapnonil
swapnonil / AppTest.java
Last active December 14, 2015 03:59
Rabbit MQ Test with Publisher Acknowledgements.
package rabbitmqclient;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.springframework.amqp.core.*;
import org.springframework.amqp.rabbit.core.*;
import org.springframework.amqp.rabbit.support.*;
import org.springframework.context.support.*;