Skip to content

Commit 21b9b3d

Browse files
author
Michael Bridgen
committed
Merge no-pluggable-exchange branch into v1.7-series branch.
2 parents c706e4f + d74a371 commit 21b9b3d

Some content is hidden

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

41 files changed

+980
-758
lines changed

Makefile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,20 @@ TARGETS=$(EBIN_DIR)/rabbit.app $(BEAM_TARGETS)
1515
WEB_URL=http://stage.rabbitmq.com/
1616
MANPAGES=$(patsubst %.pod, %.gz, $(wildcard docs/*.[0-9].pod))
1717

18+
ifeq ($(shell python -c 'import simplejson' 2>/dev/null && echo yes),yes)
1819
PYTHON=python
20+
else
21+
ifeq ($(shell python2.6 -c 'import simplejson' 2>/dev/null && echo yes),yes)
22+
PYTHON=python2.6
23+
else
24+
ifeq ($(shell python2.5 -c 'import simplejson' 2>/dev/null && echo yes),yes)
25+
PYTHON=python2.5
26+
else
27+
# Hmm. Missing simplejson?
28+
PYTHON=python
29+
endif
30+
endif
31+
endif
1932

2033
BASIC_PLT=basic.plt
2134
RABBIT_PLT=rabbit.plt
@@ -46,7 +59,7 @@ ERL_EBIN=erl -noinput -pa $(EBIN_DIR)
4659
all: $(TARGETS)
4760

4861
$(EBIN_DIR)/rabbit.app: $(EBIN_DIR)/rabbit_app.in $(BEAM_TARGETS) generate_app
49-
escript generate_app $(EBIN_DIR) < $< > $@
62+
escript generate_app $(EBIN_DIR) $@ < $<
5063

5164
$(EBIN_DIR)/gen_server2.beam: $(SOURCE_DIR)/gen_server2.erl
5265
erlc $(ERLC_OPTS) $<

codegen.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,12 @@ def genEncodeProperties(c):
228228
print " rabbit_binary_generator:encode_properties(%s, %s);" % \
229229
(fieldTypeList(c.fields), fieldTempList(c.fields))
230230

231-
def massageConstantClass(cls):
231+
def messageConstantClass(cls):
232232
# We do this because 0.8 uses "soft error" and 8.1 uses "soft-error".
233233
return erlangConstantName(cls)
234234

235235
def genLookupException(c,v,cls):
236-
mCls = massageConstantClass(cls)
236+
mCls = messageConstantClass(cls)
237237
if mCls == 'SOFT_ERROR': genLookupException1(c,'false')
238238
elif mCls == 'HARD_ERROR': genLookupException1(c, 'true')
239239
elif mCls == '': pass
@@ -244,6 +244,11 @@ def genLookupException1(c,hardErrorBoolStr):
244244
print 'lookup_amqp_exception(%s) -> {%s, ?%s, <<"%s">>};' % \
245245
(n.lower(), hardErrorBoolStr, n, n)
246246

247+
def genAmqpException(c,v,cls):
248+
n = erlangConstantName(c)
249+
print 'amqp_exception(?%s) -> %s;' % \
250+
(n, n.lower())
251+
247252
methods = spec.allMethods()
248253

249254
print """-module(rabbit_framing).
@@ -260,6 +265,7 @@ def genLookupException1(c,hardErrorBoolStr):
260265
-export([encode_method_fields/1]).
261266
-export([encode_properties/1]).
262267
-export([lookup_amqp_exception/1]).
268+
-export([amqp_exception/1]).
263269
264270
bitvalue(true) -> 1;
265271
bitvalue(false) -> 0;
@@ -296,8 +302,10 @@ def genLookupException1(c,hardErrorBoolStr):
296302
for (c,v,cls) in spec.constants: genLookupException(c,v,cls)
297303
print "lookup_amqp_exception(Code) ->"
298304
print " rabbit_log:warning(\"Unknown AMQP error code '~p'~n\", [Code]),"
299-
print " {true, ?INTERNAL_ERROR, <<\"INTERNAL_ERROR\">>}."
305+
print " {true, ?INTERNAL_ERROR, <<\"INTERNAL_ERROR\">>}."
300306

307+
for(c,v,cls) in spec.constants: genAmqpException(c,v,cls)
308+
print "amqp_exception(_Code) -> undefined."
301309

302310
def genHrl(spec):
303311
def erlType(domain):

docs/rabbitmqctl.1.pod

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,9 @@ whether the queue will be deleted when no longer used
198198

199199
queue arguments
200200

201-
=item node
201+
=item pid
202202

203-
node on which the process associated with the queue resides
203+
id of the Erlang process associated with the queue
204204

205205
=item messages_ready
206206

@@ -279,7 +279,7 @@ exchange arguments
279279
=item list_bindings [-p I<vhostpath>]
280280

281281
List bindings by virtual host. Each line printed describes a binding,
282-
with the exchange name, routing key, queue name and arguments,
282+
with the exchange name, queue name, routing key and arguments,
283283
separated by tab characters.
284284

285285
=item list_connections [I<connectioninfoitem> ...]
@@ -297,7 +297,7 @@ I<user>, I<peer_address>, I<peer_port> and I<state> are assumed.
297297

298298
=item node
299299

300-
node on which the process associated with the connection resides
300+
id of the Erlang process associated with the connection
301301

302302
=item address
303303

@@ -340,6 +340,11 @@ connection timeout
340340

341341
maximum frame size (bytes)
342342

343+
=item client_properties
344+
345+
informational properties transmitted by the client during connection
346+
establishment
347+
343348
=item recv_oct
344349

345350
octets received

ebin/rabbit_app.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
{env, [{tcp_listeners, [{"0.0.0.0", 5672}]},
1818
{ssl_listeners, []},
1919
{ssl_options, []},
20+
{vm_memory_high_watermark, 0.4},
2021
{default_user, <<"guest">>},
2122
{default_pass, <<"guest">>},
2223
{default_vhost, <<"/">>},
23-
{default_permissions, [<<".*">>, <<".*">>, <<".*">>]},
24-
{memory_alarms, auto}]}]}.
24+
{default_permissions, [<<".*">>, <<".*">>, <<".*">>]}]}]}.

generate_app

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#!/usr/bin/env escript
22
%% -*- erlang -*-
33

4-
main([BeamDir]) ->
4+
main([BeamDir, TargetFile]) ->
55
Modules = [list_to_atom(filename:basename(F, ".beam")) ||
66
F <- filelib:wildcard("*.beam", BeamDir)],
77
{ok, {application, Application, Properties}} = io:read(''),
88
NewProperties = lists:keyreplace(modules, 1, Properties,
99
{modules, Modules}),
10-
io:format("~p.", [{application, Application, NewProperties}]).
10+
file:write_file(
11+
TargetFile,
12+
io_lib:format("~p.~n", [{application, Application, NewProperties}])).

include/rabbit.hrl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
-record(vhost, {virtual_host, dummy}).
3838

39-
-record(connection, {user, timeout_sec, frame_max, vhost}).
39+
-record(connection, {user, timeout_sec, frame_max, vhost, client_properties}).
4040

4141
-record(content,
4242
{class_id,

packaging/RPMS/Fedora/rabbitmq-server.spec

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,8 @@ echo '%defattr(-,root,root, -)' >> %{_builddir}/filelist.%{name}.rpm
7575
%pre
7676

7777
if [ $1 -gt 1 ]; then
78-
#Upgrade - stop and remove previous instance of rabbitmq-server init.d script
78+
# Upgrade - stop previous instance of rabbitmq-server init.d script
7979
/sbin/service rabbitmq-server stop
80-
/sbin/chkconfig --del rabbitmq-server
8180
fi
8281

8382
# create rabbitmq group

packaging/common/rabbitmq-asroot-script-wrapper

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/sh
22
## The contents of this file are subject to the Mozilla Public License
33
## Version 1.1 (the "License"); you may not use this file except in
44
## compliance with the License. You may obtain a copy of the License at
@@ -30,24 +30,16 @@
3030
## Contributor(s): ______________________________________.
3131
##
3232

33-
# Escape spaces and quotes, because shell is revolting.
34-
for arg in "$@" ; do
35-
# Escape quotes in parameters, so that they're passed through cleanly.
36-
arg=$(sed -e 's/"/\\"/g' <<-END
37-
$arg
38-
END
39-
)
40-
CMDLINE="${CMDLINE} \"${arg}\""
41-
done
42-
4333
cd /var/lib/rabbitmq
4434

4535
SCRIPT=`basename $0`
4636

4737
if [ `id -u` = 0 ] ; then
48-
/usr/lib/rabbitmq/bin/${SCRIPT} ${CMDLINE}
38+
/usr/lib/rabbitmq/bin/${SCRIPT} "$@"
4939
else
50-
echo -e "\nOnly root should run ${SCRIPT}\n"
40+
echo
41+
echo "Only root should run ${SCRIPT}"
42+
echo
5143
exit 1
5244
fi
5345

packaging/common/rabbitmq-script-wrapper

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,13 @@ SCRIPT=`basename $0`
4646

4747
if [ `id -u` = 0 ] ; then
4848
su rabbitmq -s /bin/sh -c "/usr/lib/rabbitmq/bin/${SCRIPT} ${CMDLINE}"
49+
elif [ `id -u` = `id -u rabbitmq` ] ; then
50+
/usr/lib/rabbitmq/bin/${SCRIPT} "$@"
4951
else
5052
/usr/lib/rabbitmq/bin/${SCRIPT}
51-
echo -e "\nOnly root should run ${SCRIPT}\n"
53+
echo
54+
echo "Only root or rabbitmq should run ${SCRIPT}"
55+
echo
5256
exit 1
5357
fi
5458

packaging/common/rabbitmq-server.init

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ stop_rabbitmq () {
6666
$DAEMON stop_all > ${INIT_LOG_DIR}/shutdown_log 2> ${INIT_LOG_DIR}/shutdown_err
6767
RETVAL=$?
6868
if [ $RETVAL = 0 ] ; then
69-
# Try to stop epmd if run by the rabbitmq user
70-
pkill -u rabbitmq epmd || :
7169
[ -n "$LOCK_FILE" ] && rm -rf $LOCK_FILE
7270
else
7371
echo FAILED - check ${INIT_LOG_DIR}/shutdown_log, _err

0 commit comments

Comments
 (0)