<div dir="ltr"> Further to my previous email, a minimal list of required modules for the proposed &quot;rabbit_common&quot; application are listed below (these are the ones I needed to get things up and running). I am going to make my own rabbit_common OTP application, and change the Erlang client to depend on it rather than the server. I will also see what it takes to change the rabbit 1.4.0 server itself to factor out the common code and to use this rabbit_common application. Perhaps I can use Dialyzer to ensure that I get all dependencies. If this would be of interest I would be glad to share it. <br>
<br>src/rabbit_binary_generator.erl<br>src/rabbit_misc.erl<br>src/rabbit_heartbeat.erl<br>src/rabbit_reader.erl<br>src/rabbit_framing_channel.erl<br>src/rabbit_writer.erl<br>src/rabbit_amqqueue.erl<br>src/rabbit_framing.erl<br>
src/rabbit_binary_parser.erl<br>src/rabbit_channel.erl<br>include/rabbit_framing.hrl<br>include/rabbit_framing_spec.hrl<br>include/rabbit.hrl<br><br>Regards,<br>Edwin Fine<br><br><div class="gmail_quote">On Sun, Sep 7, 2008 at 2:56 AM, Edwin Fine <span dir="ltr">&lt;<a href="mailto:rabbitmq-discuss_efine@usa.net">rabbitmq-discuss_efine@usa.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div dir="ltr">I had a surprise when trying to use the Erlang client on a node on which RabbitMQ Server was not installed.<br>
<br><span style="font-family: courier new,monospace;">=CRASH REPORT==== 7-Sep-2008::02:41:39 ===</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp; crasher:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; pid: &lt;0.165.0&gt;</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; registered_name: []</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; exception exit: {undef,</span><br style="font-family: courier new,monospace;">

<b style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [{rabbit_framing_channel,start_link,<br></b><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [#Fun&lt;amqp_network_driver.0.106693221&gt;,</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;0.165.0&gt;]]},</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {amqp_network_driver,handshake,1},</span><br>

<br>A network client should not require server code to be installed on the same node. This is certainly true of other clients I have used. <br><br>On further investigation, I found a number of direct calls and references to an installed server:<br>

<br><span style="font-family: courier new,monospace;">amqp_channel.erl:-include_lib(&quot;rabbitmq_server/include/rabbit_framing.hrl&quot;).</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">amqp_channel.erl:&nbsp;&nbsp;&nbsp; rabbit_amqqueue:notify_sent(Q, ChPid),</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">amqp_connection.erl:-include_lib(&quot;rabbitmq_server/include/rabbit_framing.hrl&quot;).</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">amqp_consumer.erl:-include_lib(&quot;rabbitmq_server/include/rabbit_framing.hrl&quot;).</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">amqp_network_driver.erl:-include_lib(&quot;rabbitmq_server/include/rabbit_framing.hrl&quot;).</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">amqp_network_driver.erl:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FramingPid = rabbit_framing_channel:start_link(fun(X) -&gt; X end, [Parent]),</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">amqp_network_driver.erl:&nbsp;&nbsp;&nbsp; rabbit_writer:shutdown(WriterPid).</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">amqp_network_driver.erl:&nbsp;&nbsp;&nbsp; rabbit_writer:send_command(Writer, Close),</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">amqp_network_driver.erl:&nbsp;&nbsp;&nbsp; rabbit_writer:shutdown(Writer),</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">amqp_network_driver.erl:do(Writer, Method) -&gt; rabbit_writer:send_command(Writer, Method).</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">amqp_network_driver.erl:do(Writer, Method, Content) -&gt; rabbit_writer:send_command(Writer, Method, Content).</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">amqp_network_driver.erl:&nbsp;&nbsp;&nbsp; rabbit_framing_channel:process(ChPid, Frame).</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">amqp_network_driver.erl:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; response = rabbit_binary_generator:generate_table(LoginTable),</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">amqp_network_driver.erl:&nbsp;&nbsp;&nbsp; rabbit_writer:start(Sock, Channel, ?FRAME_MIN_SIZE).</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">amqp_network_driver.erl:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rabbit_heartbeat:start_heartbeat(Sock, Heartbeat),</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">amqp_network_driver.erl:&nbsp;&nbsp;&nbsp; FramingPid = rabbit_framing_channel:start_link(fun(X) -&gt; link(X), X end, [ChannelPid]),</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">amqp_network_driver.erl:&nbsp;&nbsp;&nbsp; case rabbit_reader:analyze_frame(Type, Payload) of</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">amqp_network_driver.erl:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rabbit_misc:die(frame_error);</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">amqp_network_driver.erl:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rabbit_misc:die(frame_error);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">amqp_rpc_client.erl:-include_lib(&quot;rabbitmq_server/include/rabbit_framing.hrl&quot;).</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">amqp_rpc_client.erl:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; content_type = ContentType} = rabbit_framing:decode_properties(ClassId, PropertiesBin),</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">amqp_rpc_handler.erl:-include_lib(&quot;rabbitmq_server/include/rabbit_framing.hrl&quot;).</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">amqp_rpc_handler.erl:&nbsp;&nbsp;&nbsp; = rabbit_framing:decode_properties(ClassId, PropertiesBin),</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">amqp_rpc_util.erl:-include_lib(&quot;rabbitmq_server/include/rabbit_framing.hrl&quot;).</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">amqp_util.erl:-include_lib(&quot;rabbitmq_server/include/rabbit_framing.hrl&quot;).</span><br>

<br>I left out the direct driver modules because by definition they need to be on the same node.<br><br>I respectfully suggest that the above RabbitMQ server modules, and their dependencies, be bundled with the Erlang client. Ideally, I would think it would be best perhaps to put them a separate Erlang library application (maybe &quot;rabbitmq_common&quot;) that is used both by the server and the Erlang client.<br>

<br>In addition to that, the include_lib(&quot;rabbitmq_server/include/xxx.hrl&quot;) statements prevent one from even compiling the client unless the server is installed and this should be changed to use the common library app. I was forced to copy the include files and make a dummy rabbitmq_server application to be able to compile the client on a different node to the server.<br>

<br>Regards,<br>Edwin Fine<br><br></div>
</blockquote></div><br></div>