Skip to content

Commit f21647d

Browse files
author
Vlad Ionescu
committed
merging from default
2 parents feac061 + 7b33b08 commit f21647d

File tree

155 files changed

+2338
-1096
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+2338
-1096
lines changed

LICENSE-MPL-RabbitMQ

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,11 +454,11 @@ EXHIBIT A -Mozilla Public License.
454454
are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
455455
Technologies LLC, and Rabbit Technologies Ltd.
456456

457-
Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
457+
Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift
458458
Ltd. Portions created by Cohesive Financial Technologies LLC are
459-
Copyright (C) 2007-2009 Cohesive Financial Technologies
459+
Copyright (C) 2007-2010 Cohesive Financial Technologies
460460
LLC. Portions created by Rabbit Technologies Ltd are Copyright
461-
(C) 2007-2009 Rabbit Technologies Ltd.
461+
(C) 2007-2010 Rabbit Technologies Ltd.
462462

463463
All Rights Reserved.
464464

build.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,9 @@
327327
</fail>
328328
</target>
329329

330-
<target name="test-suite-run" depends="test, test-ssl, test-persister-restart, test-functional, test-main-silent"/>
330+
<target name="test-suite-run" depends="test-client, test-ssl, test-server, test-functional, test-main-silent"/>
331331

332-
<target name="test" depends="test-build">
332+
<target name="test-client" depends="test-build">
333333
<junit printSummary="withOutAndErr"
334334
haltOnFailure="${haltOnFailureJunit}"
335335
failureproperty="test.failure"
@@ -338,7 +338,7 @@
338338

339339
<formatter type="plain"/>
340340
<formatter type="xml"/>
341-
<test todir="${build.out}" name="com.rabbitmq.client.test.AllTest"/>
341+
<test todir="${build.out}" name="com.rabbitmq.client.test.ClientTests"/>
342342
</junit>
343343
</target>
344344

@@ -375,7 +375,7 @@
375375
</junit>
376376
</target>
377377

378-
<target name="test-persister-restart" depends="test-build">
378+
<target name="test-server" depends="test-build">
379379
<junit printSummary="withOutAndErr"
380380
haltOnFailure="${haltOnFailureJunit}"
381381
failureproperty="test.failure"
@@ -384,7 +384,7 @@
384384
<formatter type="plain"/>
385385
<formatter type="xml"/>
386386
<test todir="${build.out}"
387-
name="com.rabbitmq.client.test.functional.PersisterRestartTests"/>
387+
name="com.rabbitmq.client.test.server.ServerTests"/>
388388
</junit>
389389
</target>
390390

codegen.py

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
## are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
1919
## Technologies LLC, and Rabbit Technologies Ltd.
2020
##
21-
## Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
21+
## Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift
2222
## Ltd. Portions created by Cohesive Financial Technologies LLC are
23-
## Copyright (C) 2007-2009 Cohesive Financial Technologies
23+
## Copyright (C) 2007-2010 Cohesive Financial Technologies
2424
## LLC. Portions created by Rabbit Technologies Ltd are Copyright
25-
## (C) 2007-2009 Rabbit Technologies Ltd.
25+
## (C) 2007-2010 Rabbit Technologies Ltd.
2626
##
2727
## All Rights Reserved.
2828
##
@@ -95,8 +95,45 @@ def java_field_type(spec, domain):
9595

9696
#---------------------------------------------------------------------------
9797

98+
def printFileHeader():
99+
print """// NOTE: This -*- java -*- source code is autogenerated from the AMQP
100+
// specification!
101+
//
102+
// The contents of this file are subject to the Mozilla Public License
103+
// Version 1.1 (the "License"); you may not use this file except in
104+
// compliance with the License. You may obtain a copy of the License at
105+
// http://www.mozilla.org/MPL/
106+
//
107+
// Software distributed under the License is distributed on an "AS IS"
108+
// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
109+
// License for the specific language governing rights and limitations
110+
// under the License.
111+
//
112+
// The Original Code is RabbitMQ.
113+
//
114+
// The Initial Developers of the Original Code are LShift Ltd,
115+
// Cohesive Financial Technologies LLC, and Rabbit Technologies Ltd.
116+
//
117+
// Portions created before 22-Nov-2008 00:00:00 GMT by LShift Ltd,
118+
// Cohesive Financial Technologies LLC, or Rabbit Technologies Ltd
119+
// are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
120+
// Technologies LLC, and Rabbit Technologies Ltd.
121+
//
122+
// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift
123+
// Ltd. Portions created by Cohesive Financial Technologies LLC are
124+
// Copyright (C) 2007-2010 Cohesive Financial Technologies
125+
// LLC. Portions created by Rabbit Technologies Ltd are Copyright
126+
// (C) 2007-2010 Rabbit Technologies Ltd.
127+
//
128+
// All Rights Reserved.
129+
//
130+
// Contributor(s): ______________________________________.
131+
//
132+
"""
133+
98134
def genJavaApi(spec):
99135
def printHeader():
136+
printFileHeader()
100137
print """package com.rabbitmq.client;
101138
102139
import java.io.IOException;
@@ -223,6 +260,7 @@ def printClassProperties(c):
223260

224261
def genJavaImpl(spec):
225262
def printHeader():
263+
printFileHeader()
226264
print """package com.rabbitmq.client.impl;
227265
228266
import java.io.IOException;

src/com/rabbitmq/client/Address.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
// are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
1919
// Technologies LLC, and Rabbit Technologies Ltd.
2020
//
21-
// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
21+
// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift
2222
// Ltd. Portions created by Cohesive Financial Technologies LLC are
23-
// Copyright (C) 2007-2009 Cohesive Financial Technologies
23+
// Copyright (C) 2007-2010 Cohesive Financial Technologies
2424
// LLC. Portions created by Rabbit Technologies Ltd are Copyright
25-
// (C) 2007-2009 Rabbit Technologies Ltd.
25+
// (C) 2007-2010 Rabbit Technologies Ltd.
2626
//
2727
// All Rights Reserved.
2828
//

src/com/rabbitmq/client/AlreadyClosedException.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
// are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
1919
// Technologies LLC, and Rabbit Technologies Ltd.
2020
//
21-
// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
21+
// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift
2222
// Ltd. Portions created by Cohesive Financial Technologies LLC are
23-
// Copyright (C) 2007-2009 Cohesive Financial Technologies
23+
// Copyright (C) 2007-2010 Cohesive Financial Technologies
2424
// LLC. Portions created by Rabbit Technologies Ltd are Copyright
25-
// (C) 2007-2009 Rabbit Technologies Ltd.
25+
// (C) 2007-2010 Rabbit Technologies Ltd.
2626
//
2727
// All Rights Reserved.
2828
//

src/com/rabbitmq/client/BasicProperties.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
// are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
1919
// Technologies LLC, and Rabbit Technologies Ltd.
2020
//
21-
// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
21+
// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift
2222
// Ltd. Portions created by Cohesive Financial Technologies LLC are
23-
// Copyright (C) 2007-2009 Cohesive Financial Technologies
23+
// Copyright (C) 2007-2010 Cohesive Financial Technologies
2424
// LLC. Portions created by Rabbit Technologies Ltd are Copyright
25-
// (C) 2007-2009 Rabbit Technologies Ltd.
25+
// (C) 2007-2010 Rabbit Technologies Ltd.
2626
//
2727
// All Rights Reserved.
2828
//

src/com/rabbitmq/client/Channel.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
// are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
1919
// Technologies LLC, and Rabbit Technologies Ltd.
2020
//
21-
// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
21+
// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift
2222
// Ltd. Portions created by Cohesive Financial Technologies LLC are
23-
// Copyright (C) 2007-2009 Cohesive Financial Technologies
23+
// Copyright (C) 2007-2010 Cohesive Financial Technologies
2424
// LLC. Portions created by Rabbit Technologies Ltd are Copyright
25-
// (C) 2007-2009 Rabbit Technologies Ltd.
25+
// (C) 2007-2010 Rabbit Technologies Ltd.
2626
//
2727
// All Rights Reserved.
2828
//
@@ -61,7 +61,7 @@
6161
*
6262
*/
6363

64-
public interface Channel extends ShutdownNotifier{
64+
public interface Channel extends ShutdownNotifier {
6565
/**
6666
* Retrieve this channel's channel number.
6767
* @return the channel number
@@ -77,35 +77,35 @@ public interface Channel extends ShutdownNotifier{
7777
/**
7878
* Close this channel with the {@link com.rabbitmq.client.AMQP#REPLY_SUCCESS} close code
7979
* and message 'OK'.
80-
*
80+
*
8181
* @throws java.io.IOException if an error is encountered
8282
*/
8383
void close() throws IOException;
84-
84+
8585
/**
8686
* Close this channel.
87-
*
87+
*
8888
* @param closeCode the close code (See under "Reply Codes" in the AMQP specification)
8989
* @param closeMessage a message indicating the reason for closing the connection
9090
* @throws java.io.IOException if an error is encountered
9191
*/
9292
void close(int closeCode, String closeMessage) throws IOException;
93-
93+
9494
/**
9595
* Abort this channel with the {@link com.rabbitmq.client.AMQP#REPLY_SUCCESS} close code
9696
* and message 'OK'.
97-
*
97+
*
9898
* Forces the channel to close and waits for the close operation to complete.
9999
* Any encountered exceptions in the close operation are silently discarded.
100100
*/
101101
void abort() throws IOException;
102-
102+
103103
/**
104104
* Abort this channel.
105-
*
105+
*
106106
* Forces the channel to close and waits for the close operation to complete.
107107
* Any encountered exceptions in the close operation are silently discarded.
108-
*/
108+
*/
109109
void abort(int closeCode, String closeMessage) throws IOException;
110110

111111
/**
@@ -254,7 +254,7 @@ Exchange.DeclareOk exchangeDeclare(String exchange, String type, boolean passive
254254
* @throws java.io.IOException if an error is encountered
255255
*/
256256
Queue.DeclareOk queueDeclare(String queue) throws IOException;
257-
257+
258258
/**
259259
* Actively declare a non-exclusive, non-autodelete queue
260260
* The name of the new queue is held in the "queue" field of the {@link com.rabbitmq.client.AMQP.Queue.DeclareOk} result.
@@ -329,7 +329,7 @@ Queue.DeclareOk queueDeclare(String queue, boolean passive, boolean durable, boo
329329
* @throws java.io.IOException if an error is encountered
330330
*/
331331
Queue.BindOk queueBind(String queue, String exchange, String routingKey, Map<String, Object> arguments) throws IOException;
332-
332+
333333
/**
334334
* Unbinds a queue from an exchange, with no extra arguments.
335335
* @see com.rabbitmq.client.AMQP.Queue.Unbind
@@ -370,7 +370,7 @@ Queue.DeclareOk queueDeclare(String queue, boolean passive, boolean durable, boo
370370
* @see com.rabbitmq.client.AMQP.Queue.Purge
371371
* @see com.rabbitmq.client.AMQP.Queue.PurgeOk
372372
* @param queue the name of the queue
373-
* @param nowait whether to await completion of the purge
373+
* @param nowait whether to await completion of the purge
374374
* @return a purge-confirm method if the purge was executed succesfully
375375
* @throws java.io.IOException if an error is encountered
376376
*/

src/com/rabbitmq/client/Command.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
// are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
1919
// Technologies LLC, and Rabbit Technologies Ltd.
2020
//
21-
// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
21+
// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift
2222
// Ltd. Portions created by Cohesive Financial Technologies LLC are
23-
// Copyright (C) 2007-2009 Cohesive Financial Technologies
23+
// Copyright (C) 2007-2010 Cohesive Financial Technologies
2424
// LLC. Portions created by Rabbit Technologies Ltd are Copyright
25-
// (C) 2007-2009 Rabbit Technologies Ltd.
25+
// (C) 2007-2010 Rabbit Technologies Ltd.
2626
//
2727
// All Rights Reserved.
2828
//

src/com/rabbitmq/client/Connection.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
// are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
1919
// Technologies LLC, and Rabbit Technologies Ltd.
2020
//
21-
// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
21+
// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift
2222
// Ltd. Portions created by Cohesive Financial Technologies LLC are
23-
// Copyright (C) 2007-2009 Cohesive Financial Technologies
23+
// Copyright (C) 2007-2010 Cohesive Financial Technologies
2424
// LLC. Portions created by Rabbit Technologies Ltd are Copyright
25-
// (C) 2007-2009 Rabbit Technologies Ltd.
25+
// (C) 2007-2010 Rabbit Technologies Ltd.
2626
//
2727
// All Rights Reserved.
2828
//

src/com/rabbitmq/client/ConnectionFactory.java

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
// are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
1919
// Technologies LLC, and Rabbit Technologies Ltd.
2020
//
21-
// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
21+
// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift
2222
// Ltd. Portions created by Cohesive Financial Technologies LLC are
23-
// Copyright (C) 2007-2009 Cohesive Financial Technologies
23+
// Copyright (C) 2007-2010 Cohesive Financial Technologies
2424
// LLC. Portions created by Rabbit Technologies Ltd are Copyright
25-
// (C) 2007-2009 Rabbit Technologies Ltd.
25+
// (C) 2007-2010 Rabbit Technologies Ltd.
2626
//
2727
// All Rights Reserved.
2828
//
@@ -36,6 +36,9 @@
3636
import java.util.HashMap;
3737
import java.util.Map;
3838

39+
import java.net.Socket;
40+
import java.net.InetSocketAddress;
41+
3942
import javax.net.SocketFactory;
4043
import javax.net.ssl.SSLContext;
4144
import javax.net.ssl.TrustManager;
@@ -153,7 +156,26 @@ protected FrameHandler createFrameHandler(Address addr)
153156
String hostName = addr.getHost();
154157
int portNumber = addr.getPort();
155158
if (portNumber == -1) portNumber = AMQP.PROTOCOL.PORT;
156-
return new SocketFrameHandler(_factory, hostName, portNumber);
159+
Socket socket = _factory.createSocket();
160+
configureSocket(socket);
161+
socket.connect(new InetSocketAddress(hostName, portNumber));
162+
return new SocketFrameHandler(socket);
163+
}
164+
165+
/**
166+
* Provides a hook to insert custom configuration of the sockets used
167+
* to connect to an AMQP server before they connect.
168+
*
169+
* The default behaviour of this method is to disable Nagle's algorithm to get
170+
* more consistently low latency.
171+
* However it may be overridden freely and there is no requirement to retain
172+
* this behaviour.
173+
*
174+
* @param socket The socket that is to be used for the Connection
175+
*/
176+
protected void configureSocket(Socket socket) throws IOException{
177+
// disable Nagle's algorithm, for more consistently low latency
178+
socket.setTcpNoDelay(true);
157179
}
158180

159181
private Connection newConnection(Address[] addrs,

0 commit comments

Comments
 (0)