anybody see anything possible in the code snip below that could cause the message to long error displayed at the bottom? note, this error is occurring on subscribe, not publish...<br><br>I can reproduce it on a xp pro workstation and a windows server 2003 box...<br>
<br><snip><br>//winform app<br>using System;<br>using System.Collections.Generic;<br>using System.ComponentModel;<br>using System.Collections;<br>using System.Data;<br>using System.Drawing;<br>using System.Linq;<br>
using System.Text;<br>using System.Windows.Forms;<br>using System.ServiceModel.Web;<br>using System.ServiceModel;<br>using System.ServiceModel.Channels;<br>using System.ServiceModel.Description;<br><br>using Test.Base;<br>
using Test.Entity;<br><br>using RabbitMQ.ServiceModel;<br>using RabbitMQ.Client;<br><br>namespace RabbitMqPubSub1<br>{<br> public partial class frmMain : Form<br> {<br> ServiceHost dispatcherHost = null;<br> ServiceHost subscriberHost = null;<br>
<br> string m_strSubscriber = string.Empty;<br> string m_strDispatcher = string.Empty;<br> string m_strSubscriberHost = string.Empty;<br><br> public frmMain()<br> {<br> InitializeComponent();<br>
}<br><br> /// <summary><br> /// Publish Test Message<br> /// </summary><br> /// <param name="sender"></param><br> /// <param name="e"></param><br>
private void btnPub_Click(object sender, EventArgs e)<br> {<br> try<br> {<br> using (ChannelFactory<IDispatcherService> scf = GetDispatcherCF())<br> {<br>
IDispatcherService client = scf.CreateChannel();<br> Test.Entity.Message msg = new Test.Entity.Message();<br> msg.Source = txtPubContent.Text;<br> msg.Contexts.Add("c1");<br>
<br> for (int i = 0; i < 1000; i++) //change seed for generic testing...<br> {<br> client.Publish(msg);<br> }<br> }<br> }<br>
catch (Exception ex)<br> {<br> throw ex;<br> }<br> }<br><br> /// <summary><br> /// Host The Dispatcher<br> /// </summary><br> /// <param name="sender"></param><br>
/// <param name="e"></param><br> private void btnHostDispatcher_Click(object sender, EventArgs e)<br> {<br> if (txtHostDispatcher.Text == string.Empty)<br> {<br>
m_strDispatcher = "amqp:///dispatcher";<br> }<br> else<br> {<br> m_strDispatcher = txtHostDispatcher.Text;<br> }<br> <br> dispatcherHost = new ServiceHost(typeof(Dispatcher.DispatcherService), new Uri("soap.amqp:///"));<br>
dispatcherHost.AddServiceEndpoint(typeof(IDispatcherService), new RabbitMQBinding(new Uri("amqp://localhost:5672/"), Protocols.AMQP_0_8), m_strDispatcher);<br> dispatcherHost.CloseTimeout = TimeSpan.FromMinutes(10); <br>
<br> dispatcherHost.Open();<br> }<br><br> private ChannelFactory<IDispatcherService> GetDispatcherCF()<br> {<br> if (txtHostDispatcher.Text == string.Empty)<br> {<br>
m_strDispatcher = "amqp:///dispatcher";<br> }<br> else<br> {<br> m_strDispatcher = txtHostDispatcher.Text;<br> }<br><br> ChannelFactory<IDispatcherService> scf;<br>
<br> //The RabbitMQBinding instantiation is where the error is being raised...<br> scf = new ChannelFactory<IDispatcherService>(<br> new RabbitMQBinding(<br> new Uri("amqp://localhost:5672/"),<br>
Protocols.AMQP_0_8),<br> new EndpointAddress(m_strDispatcher));<br><br> return scf;<br> }<br><br> /// <summary><br> /// Subscribe to queue<br>
/// </summary><br> /// <param name="sender"></param><br> /// <param name="e"></param><br> private void btnSubscribe_Click(object sender, EventArgs e)<br>
{ <br> if (txtHostSubscriberAddress.Text == string.Empty)<br> {<br> m_strSubscriber = "amqp:///subscriber";<br> }<br> else<br> {<br>
m_strSubscriber = txtHostSubscriberAddress.Text;<br> }<br><br> try<br> {<br> using (ChannelFactory<IDispatcherService> scf = GetDispatcherCF())<br> {<br>
IDispatcherService client = scf.CreateChannel();<br> client.Subscribe(new Test.Base.SubscriberInfo(m_strSubscriber, "c1", "c2"));<br> }<br> }<br>
<br> catch (Exception ex)<br> {<br> throw ex;<br> }<br> }<br><br> /// <summary><br> /// Host Subscriber<br> /// </summary><br> /// <param name="sender"></param><br>
/// <param name="e"></param><br> private void btnHostSubscriber_Click(object sender, EventArgs e)<br> {<br> if (txtHostSubscriberAddress.Text == string.Empty)<br> {<br>
m_strSubscriberHost = "amqp:///subscriber";<br> }<br> else<br> {<br> m_strSubscriberHost = txtHostSubscriberAddress.Text;<br> }<br><br> //The ServiceHost must specify a base or absolute endpoint address under the soap.amqp scheme. <br>
//An endpoint should then be added to the service using the RabbitMQBinding.<br> subscriberHost = new ServiceHost(typeof(Subscriber.SubscriberService), new Uri("soap.amqp:///"));<br> subscriberHost.AddServiceEndpoint(typeof(ISubscriberService), new RabbitMQBinding(new Uri("amqp://localhost:5672/"), Protocols.AMQP_0_8), m_strSubscriberHost);<br>
subscriberHost.CloseTimeout = TimeSpan.FromMinutes(10);<br><br> subscriberHost.Open();<br> }<br><br> /// <summary><br> /// Create Queue<br> /// </summary><br>
/// <param name="sender"></param><br> /// <param name="e"></param><br> private void btnCreateQueue_Click(object sender, EventArgs e)<br> {<br> string address = "localhost:5672";//"amqp:///";<br>
string strQueue = txtQueueName.Text;<br> bool durable = true;<br> string exchange = string.Empty;<br> string routingKey = string.Empty;<br><br> using (IConnection connection = new ConnectionFactory().CreateConnection(address))<br>
{<br> using (IModel model = connection.CreateModel())<br> {<br> strQueue = model.QueueDeclare(strQueue, durable);<br><br> model.QueueBind(strQueue, exchange, routingKey, false, null);<br>
}<br> }<br> }<br> }<br>}<br><br></snip><br><br>RE:<br><div class="gmail_quote">On Thu, Jul 23, 2009 at 9:13 AM, .... wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
although there are no messages any longer then "test message" in the applicable queue...<br><br>the following is returned...<br><br>The AMQP operation was interrupted: AMQP close-reason, initiated by Library, code=311, text="The body of a message (18446744073709551575 bytes) was too long.", classId=0, methodId=0, cause=RabbitMQ.Client.Impl.BodyTooLongException: The body of a message (18446744073709551575 bytes) was too long.<br>
at RabbitMQ.Client.Impl.ContentHeaderBase.ReadFrom(Int32 channelNumber, NetworkBinaryReader reader) in C:\RabbitMQ.Client\RabbitMQ\Client\Impl\ContentHeaderBase.cs:line 23<br> at RabbitMQ.Client.Impl.CommandAssembler.HandleFrame(Frame f) in C:\RabbitMQ.Client\RabbitMQ\Client\Impl\CommandAssembler.cs:line 53<br>
at RabbitMQ.Client.Impl.Session.HandleFrame(Frame frame) in C:\RabbitMQ.Client\RabbitMQ\Client\Impl\Session.cs:line 16<br> at RabbitMQ.Client.Impl.ConnectionBase.MainLoopIteration() in C:\RabbitMQ.Client\RabbitMQ\Client\Impl\ConnectionBase.cs:line 434<br>
at RabbitMQ.Client.Impl.ConnectionBase.MainLoop() in C:\RabbitMQ.Client\RabbitMQ\Client\Impl\ConnectionBase.cs:line 388<br><br>suggestions, comments, assistance?<br><br>thanks in advance.<br><br><br>
</blockquote></div><br>