You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by cbourne <ca...@intellect.co.uk> on 2006/07/28 13:38:25 UTC
ActiveMQ OpenWire .NET Example
Hi,
Does anybody have any working examples using the ActiveMQ OpenWire .NET
client libraries?
We've been digging arround for ages and not been able to find anything that
makes much sense.
Thanks
Carl
--
View this message in context: http://www.nabble.com/ActiveMQ-OpenWire-.NET-Example-tf2014936.html#a5537968
Sent from the ActiveMQ - Dev forum at Nabble.com.
Re: ActiveMQ OpenWire .NET Example
Posted by cbourne <ca...@intellect.co.uk>.
James,
Thanks again but I could do with somthing very simple to start with such
as:-
- Simply Producing/Consuming basic text messages in as few lines of Jave
code as possible.
- Simply Producing/Consuming messages with binary content in as few lines
of Jave code as possible.
We're new to some of this stuff and some very simple examples would be
enough to get us going.
I've spent hours searching the net but can't seem to find much on this.
Carl
--
View this message in context: http://www.nabble.com/ActiveMQ-OpenWire-.NET-Example-tf2014936.html#a5630656
Sent from the ActiveMQ - Dev forum at Nabble.com.
Re: ActiveMQ OpenWire .NET Example
Posted by James Strachan <ja...@gmail.com>.
If you are trying to see examples of APIs being used, try search the
code with your IDE as there's quite alot of example code in the test
cases. e.g.
https://svn.apache.org/repos/asf/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/streams/JMSInputStreamTest.java
On 8/2/06, cbourne <ca...@intellect.co.uk> wrote:
>
> James,
>
> Thanks for this – we're still struggling to get this work and thus prove the
> concept of producing and consuming large message/files.
>
> Could you be so kind as to provide a more complete working example of
> producing/consuming messages via JMS Streams. I really would to get some buy
> in on using this technology within our project.
>
> If I could just get a simple example up and running thats all I need to do
> for now.
>
> Best Regards,
>
> Carl
> --
> View this message in context: http://www.nabble.com/ActiveMQ-OpenWire-.NET-Example-tf2014936.html#a5616963
> Sent from the ActiveMQ - Dev forum at Nabble.com.
>
>
--
James
-------
http://radio.weblogs.com/0112098/
Re: ActiveMQ OpenWire .NET Example
Posted by cbourne <ca...@intellect.co.uk>.
James,
Thanks for this – we’re still struggling to get this work and thus prove the
concept of producing and consuming large message/files.
Could you be so kind as to provide a more complete working example of
producing/consuming messages via JMS Streams. I really would to get some buy
in on using this technology within our project.
If I could just get a simple example up and running thats all I need to do
for now.
Best Regards,
Carl
--
View this message in context: http://www.nabble.com/ActiveMQ-OpenWire-.NET-Example-tf2014936.html#a5616963
Sent from the ActiveMQ - Dev forum at Nabble.com.
Re: ActiveMQ OpenWire .NET Example
Posted by James Strachan <ja...@gmail.com>.
Its as straightforward as creating an input/output stream on a Connection...
I've added a little code example here...
http://activemq.org/site/jms-streams.html
On 8/1/06, cbourne <ca...@intellect.co.uk> wrote:
>
> James,
>
> We've given up for the time being with using the .Net libraries due to the
> lack of support for large files.
> Are there any examples of using the Java Client with JMS Streams?
>
> Carl
>
> --
> View this message in context: http://www.nabble.com/ActiveMQ-OpenWire-.NET-Example-tf2014936.html#a5598467
> Sent from the ActiveMQ - Dev forum at Nabble.com.
>
>
--
James
-------
http://radio.weblogs.com/0112098/
Re: ActiveMQ OpenWire .NET Example
Posted by cbourne <ca...@intellect.co.uk>.
James,
We've given up for the time being with using the .Net libraries due to the
lack of support for large files.
Are there any examples of using the Java Client with JMS Streams?
Carl
--
View this message in context: http://www.nabble.com/ActiveMQ-OpenWire-.NET-Example-tf2014936.html#a5598467
Sent from the ActiveMQ - Dev forum at Nabble.com.
Re: ActiveMQ OpenWire .NET Example
Posted by cbourne <ca...@intellect.co.uk>.
Thanks James!
Does the pure C# Stomp client support the Javastreams type functionality -
We need to some fairly hefty files if possible!
Carl
--
View this message in context: http://www.nabble.com/ActiveMQ-OpenWire-.NET-Example-tf2014936.html#a5542164
Sent from the ActiveMQ - Dev forum at Nabble.com.
Re: ActiveMQ OpenWire .NET Example
Posted by James Strachan <ja...@gmail.com>.
On 7/28/06, James Strachan <ja...@gmail.com> wrote:
> On 7/28/06, cbourne <ca...@intellect.co.uk> wrote:
> >
> > James,
> >
> > Thanks for the quick response.
> >
> > We're new to JMS type messaging systems but have good C# skills. ActiveMQ
> > looks like it will fit the needs of our project perfectly.
>
> Great. BTW we'd appreciate some feedback on the C# build and code from
> good C# developers :)
>
> e.g. is there an easy way to get it to auto generate javadoc type
> stuff for the NMS API etc
I just tried adding support for ndoc to the nant build which seems to
work OK - though it does take a very long time to run :).
I've uploaded the documentation here...
http://incubator.apache.org/activemq/nms/ndoc/
I've also tidied up the NMS documentation a little...
http://activemq.org/site/nms.html
--
James
-------
http://radio.weblogs.com/0112098/
Re: ActiveMQ OpenWire .NET Example
Posted by cbourne <ca...@intellect.co.uk>.
James
Yes it looks like the message producer is getting blocked - if we consume
the first message (20mb) then the producer is then able to post the next
message.
Not sure if we will have the time at this stage to attempt the JMS Streams
port to .Net. If we can get a basic working prototype of what we need, then
we maybe be able to look at it in the future.
Carl
--
View this message in context: http://www.nabble.com/ActiveMQ-OpenWire-.NET-Example-tf2014936.html#a5576861
Sent from the ActiveMQ - Dev forum at Nabble.com.
Re: ActiveMQ OpenWire .NET Example
Posted by James Strachan <ja...@gmail.com>.
Do you have a test case by any chance? What happens, do you get just
blocking broker?
BTW for messags of over 100K you should set the prefetch value to 1
for clients...
http://incubator.apache.org/activemq/what-is-the-prefetch-limit-for.html
I wonder if you feel up to the challenge of porting JMS Streams to
.Net? :) The code is not that hard to do...
http://incubator.apache.org/activemq/maven/activemq-core/xref/org/apache/activemq/ActiveMQConnection.html#1655
the only clever bit really is in these 2 classes
http://incubator.apache.org/activemq/maven/activemq-core/xref/org/apache/activemq/ActiveMQInputStream.html
http://incubator.apache.org/activemq/maven/activemq-core/xref/org/apache/activemq/ActiveMQOutputStream.html
On 7/31/06, cbourne <ca...@intellect.co.uk> wrote:
>
> James,
>
> Been doing some more testing using the 4.1 snap shot with the following
> settings and a large heap size:
> <memoryManager>
> <usageManager id="memory-manager" limitMB="400"/>
> </memoryManager>
>
> However, we still can't seem to push files much larger than about 10mb
> through the queues! Smaller files seem to work OK.
>
> Do you have any more suggesdtions?
>
> Carl
> --
> View this message in context: http://www.nabble.com/ActiveMQ-OpenWire-.NET-Example-tf2014936.html#a5573569
> Sent from the ActiveMQ - Dev forum at Nabble.com.
>
>
--
James
-------
http://radio.weblogs.com/0112098/
Re: ActiveMQ OpenWire .NET Example
Posted by cbourne <ca...@intellect.co.uk>.
James,
Been doing some more testing using the 4.1 snap shot with the following
settings and a large heap size:
<memoryManager>
<usageManager id="memory-manager" limitMB="400"/>
</memoryManager>
However, we still can't seem to push files much larger than about 10mb
through the queues! Smaller files seem to work OK.
Do you have any more suggesdtions?
Carl
--
View this message in context: http://www.nabble.com/ActiveMQ-OpenWire-.NET-Example-tf2014936.html#a5573569
Sent from the ActiveMQ - Dev forum at Nabble.com.
Re: ActiveMQ OpenWire .NET Example
Posted by cbourne <ca...@intellect.co.uk>.
>whcih we've not yet implemented in NMS
When do you think this bit will be implemented in NMS?
Carl
--
View this message in context: http://www.nabble.com/ActiveMQ-OpenWire-.NET-Example-tf2014936.html#a5542098
Sent from the ActiveMQ - Dev forum at Nabble.com.
Re: ActiveMQ OpenWire .NET Example
Posted by James Strachan <ja...@gmail.com>.
On 7/28/06, cbourne <ca...@intellect.co.uk> wrote:
>
> James,
>
> Thanks again for the help.
>
> We've managed to get this to work now using the default settings for
> ActiveMQ.
>
> It works great for smallish (around 1k) but when we send larger binary files
> (>20Mb) then the library seems to just stop part way through the send!
The out of the box ActiveMQ configuration is pretty modest and not
setup for much RAM buffer so you probably want to increase this. Note
messages are normally fairly small (say under 1Mb) and for larger
messages we tend to recommend using JMS streams...
http://incubator.apache.org/activemq/jms-streams.html
whcih we've not yet implemented in NMS
> Are there any message/queue size settings we need to change?
I'd set a large value for the <usageManager> to around 400Mb or
something then run with a large heap size.
http://incubator.apache.org/activemq/xml-configuration.html
BTW If you use 4.1-SNAPSHOT you can set this via the following which
is a bit simpler
<usageManager limitMb="400"/>
--
James
-------
http://radio.weblogs.com/0112098/
Re: ActiveMQ OpenWire .NET Example
Posted by cbourne <ca...@intellect.co.uk>.
James,
Thanks again for the help.
We’ve managed to get this to work now using the default settings for
ActiveMQ.
It works great for smallish (around 1k) but when we send larger binary files
(>20Mb) then the library seems to just stop part way through the send!
Are there any message/queue size settings we need to change?
Carl
--
View this message in context: http://www.nabble.com/ActiveMQ-OpenWire-.NET-Example-tf2014936.html#a5540768
Sent from the ActiveMQ - Dev forum at Nabble.com.
Re: ActiveMQ OpenWire .NET Example
Posted by James Strachan <ja...@gmail.com>.
On 7/28/06, cbourne <ca...@intellect.co.uk> wrote:
>
> James,
>
> Thanks for the quick response.
>
> We're new to JMS type messaging systems but have good C# skills. ActiveMQ
> looks like it will fit the needs of our project perfectly.
Great. BTW we'd appreciate some feedback on the C# build and code from
good C# developers :)
e.g. is there an easy way to get it to auto generate javadoc type
stuff for the NMS API etc
> We've been looking through the test cases but they are a bit cryptic to us
> at the moment.
>
> We could do with a couple of really simple examples that maybe shows
> producing/consuming binary data. i.e. Something like reading a binary file
> sending it to a queue and then reading the file back of the queue.
This example shows how to send and receive messages...
http://incubator.apache.org/activemq/openwire-dotnet.html
the main difference is you'll not be using ITextMessage objects but
using IBytesMessage instead and setting the Content property to be a
byte[]
--
James
-------
http://radio.weblogs.com/0112098/
Re: ActiveMQ OpenWire .NET Example
Posted by cbourne <ca...@intellect.co.uk>.
James,
Thanks for the quick response.
We're new to JMS type messaging systems but have good C# skills. ActiveMQ
looks like it will fit the needs of our project perfectly.
We’ve been looking through the test cases but they are a bit cryptic to us
at the moment.
We could do with a couple of really simple examples that maybe shows
producing/consuming binary data. i.e. Something like reading a binary file
sending it to a queue and then reading the file back of the queue.
Do we first need to convert the binary data to something like base64 before
posting it the message queues, or does the OpenWire library provide this
functionality itself?
Best Regards,
Carl
--
View this message in context: http://www.nabble.com/ActiveMQ-OpenWire-.NET-Example-tf2014936.html#a5538652
Sent from the ActiveMQ - Dev forum at Nabble.com.
Re: ActiveMQ OpenWire .NET Example
Posted by James Strachan <ja...@gmail.com>.
Try the NUnit test cases...
nant test
from this directory...
https://svn.apache.org/repos/asf/incubator/activemq/trunk/activemq-dotnet/
the main tests are here
https://svn.apache.org/repos/asf/incubator/activemq/trunk/activemq-dotnet/src/test/csharp/NMS/
On 7/28/06, cbourne <ca...@intellect.co.uk> wrote:
>
> Hi,
>
> Does anybody have any working examples using the ActiveMQ OpenWire .NET
> client libraries?
>
> We've been digging arround for ages and not been able to find anything that
> makes much sense.
>
> Thanks
>
> Carl
> --
> View this message in context: http://www.nabble.com/ActiveMQ-OpenWire-.NET-Example-tf2014936.html#a5537968
> Sent from the ActiveMQ - Dev forum at Nabble.com.
>
>
--
James
-------
http://radio.weblogs.com/0112098/