You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Oleg Deribas <th...@td.selfip.net> on 2006/10/06 13:03:48 UTC

Using ActiveMQ from .NET compact framework

Hello,

I want to try using ActiveMQ from PDA with .NET compact framework.
Where should I start? I see that there is not project for CF.NET in NMS
solution. So I could try to create it. Is it possible?

And I have another question - how much traffic required for one simple
message (like event notification)? I will use GPRS connection from PDA,
so traffic is not cheap...

-- 
Oleg


Re: Security - how to?

Posted by Pico Florin <pi...@yahoo.co.uk>.
Hi!
   Thank you for your response. I am afraid that I don't understand  the security mechanism both on the client side and the server side. Can  you explain me what set up do I need in the client code and what I have  to do in the server side (do I need something else than setting up the  borker with the populateJMSXUserID to true)? Remeber that I have many  clients each of them with their own credentials that have to be  authorized into the server DB.
    Regards,
     Florin
  
  
  
  

Kelly Campbell <ke...@gmail.com> wrote:  I don't have an example for the second one yet, but the first one is simple.
You don't want clients to be able to set that header or property because
then clients could spoof another client. It is set by the broker based on
the authentication of the sender. If you're using username/password
authentication and you turn that feature on in the broker, then you should
be able to see that header in sent messages. You probably need to use the
latest version built from source code because of issue AMQ-940. (Or wait for
a 4.1 RC build to be released)

-Kelly

On 10/11/06, Pico Florin 
 wrote:
>
> Hi!
>    Thank you Kelly for your quick response!
>   I would like to ask you if there is any example with the 2 solutions
> that you gave me.
>    In the documentation recommended in the solution 1,  it is said that:
>   " Once enabled this feature adds the JMS property JMSXUserID to each JMS
> message so that a consumer can know exactly who the sender was using the
> broker's authentication policy."
>   I was trying to do something like this (on the client
> side):  ((ObjectMessage)message).setJMSXUserIDProperty() but I didn't found.
>    Then I was thinking to ((ObjectMessage)message).setObjectProperty()
>   but what string property should I use to set  up this JMSXUserID?
>
>
>   For the socond solution, I have no idea how to implement this. I
> have  no knowlege regarding the SSL connection, maybe a good example for
> both  server and client will reveal me how it realy works.
>     Thank you,
>      Florin
>
> Kelly Campbell  wrote:  Hi Pico,
>
> There is a feature where ActiveMQ can set the JMSXUserId header to the
> userid of the sender of the message. You can use that on the server side
> to
> determine what client is requesting it. The only issue with this is that
> the
> server has to trust the broker. Does that work for what you need?
> Documentation is here: http://activemq.org/site/jmsxuserid.html
>
> There's also now the option to authenticate and secure a connection using
> client SSL certificates in the 4.1 codebase. I'm working on some changes
> in
> my spare time to allow increased flexibility of this so you can do things
> like have the JMS client check the broker's certificate as well to ensure
> it
> is as expected.
>
> -Kelly
>
> On 10/10/06, Pico Florin
> wrote:
> >
> > Hi!
> >     I have a P2P architecture where many clients send messages to  JMS
> > server installed on a web server (Resin). The messages that the  client
> send
> > to be persisted in DB installed on on the server side.  Before that
> > operation the client should be authenticated against this  database
> > installed on the server side. The client should send its  credentials in
> > order to be authorized.
> >     Now the problem:
> >      I have seen that in the JMS API exists a method:
> >   ConnectionFactory.createConnection(String userName, String password)
> >   but I think that these credentials are for the service installed on
> > the  server in order to be connected to it, but I am afraid I cannot use
> > the  client's credentials for the application.(E.g. user1/pw1 authorized
> > to  be connected to the JMS server and use the service,
> > user2/pw2  authorized to be connected to the JMS server and use the
> service,
> > etc).  These credentials are also on the DB server installed on the
> > server.  The question is: am I wrong with this opinion or not? If yes,
> > what  should I write in the server side in order to accept many clients
> to
> > be  connected?
> >       Another solution is to set up a object property in header  of the
> > message, where I put my credentials encrypted. But is that ok(is  this a
> > real solution)?
> >    Any ideas and suggestions are appreciated.
> >     Florin
> >
> >
> >
> >
> > ---------------------------------
> > Yahoo! Photos – NEW, now offering a quality print service from just 8p a
> > photo.
> >
>
>
>
>
> ---------------------------------
> All new Yahoo! Mail "The new Interface is stunning in its simplicity and
> ease of use." - PC Magazine
>



 Send instant messages to your online friends http://uk.messenger.yahoo.com 

Re: Security - how to?

Posted by Kelly Campbell <ke...@gmail.com>.
I don't have an example for the second one yet, but the first one is simple.
You don't want clients to be able to set that header or property because
then clients could spoof another client. It is set by the broker based on
the authentication of the sender. If you're using username/password
authentication and you turn that feature on in the broker, then you should
be able to see that header in sent messages. You probably need to use the
latest version built from source code because of issue AMQ-940. (Or wait for
a 4.1 RC build to be released)

-Kelly

On 10/11/06, Pico Florin <pi...@yahoo.co.uk> wrote:
>
> Hi!
>    Thank you Kelly for your quick response!
>   I would like to ask you if there is any example with the 2 solutions
> that you gave me.
>    In the documentation recommended in the solution 1,  it is said that:
>   " Once enabled this feature adds the JMS property JMSXUserID to each JMS
> message so that a consumer can know exactly who the sender was using the
> broker's authentication policy."
>   I was trying to do something like this (on the client
> side):  ((ObjectMessage)message).setJMSXUserIDProperty() but I didn't found.
>    Then I was thinking to ((ObjectMessage)message).setObjectProperty()
>   but what string property should I use to set  up this JMSXUserID?
>
>
>   For the socond solution, I have no idea how to implement this. I
> have  no knowlege regarding the SSL connection, maybe a good example for
> both  server and client will reveal me how it realy works.
>     Thank you,
>      Florin
>
> Kelly Campbell <ke...@gmail.com> wrote:  Hi Pico,
>
> There is a feature where ActiveMQ can set the JMSXUserId header to the
> userid of the sender of the message. You can use that on the server side
> to
> determine what client is requesting it. The only issue with this is that
> the
> server has to trust the broker. Does that work for what you need?
> Documentation is here: http://activemq.org/site/jmsxuserid.html
>
> There's also now the option to authenticate and secure a connection using
> client SSL certificates in the 4.1 codebase. I'm working on some changes
> in
> my spare time to allow increased flexibility of this so you can do things
> like have the JMS client check the broker's certificate as well to ensure
> it
> is as expected.
>
> -Kelly
>
> On 10/10/06, Pico Florin
> wrote:
> >
> > Hi!
> >     I have a P2P architecture where many clients send messages to  JMS
> > server installed on a web server (Resin). The messages that the  client
> send
> > to be persisted in DB installed on on the server side.  Before that
> > operation the client should be authenticated against this  database
> > installed on the server side. The client should send its  credentials in
> > order to be authorized.
> >     Now the problem:
> >      I have seen that in the JMS API exists a method:
> >   ConnectionFactory.createConnection(String userName, String password)
> >   but I think that these credentials are for the service installed on
> > the  server in order to be connected to it, but I am afraid I cannot use
> > the  client's credentials for the application.(E.g. user1/pw1 authorized
> > to  be connected to the JMS server and use the service,
> > user2/pw2  authorized to be connected to the JMS server and use the
> service,
> > etc).  These credentials are also on the DB server installed on the
> > server.  The question is: am I wrong with this opinion or not? If yes,
> > what  should I write in the server side in order to accept many clients
> to
> > be  connected?
> >       Another solution is to set up a object property in header  of the
> > message, where I put my credentials encrypted. But is that ok(is  this a
> > real solution)?
> >    Any ideas and suggestions are appreciated.
> >     Florin
> >
> >
> >
> >
> > ---------------------------------
> > Yahoo! Photos – NEW, now offering a quality print service from just 8p a
> > photo.
> >
>
>
>
>
> ---------------------------------
> All new Yahoo! Mail "The new Interface is stunning in its simplicity and
> ease of use." - PC Magazine
>

Re: Security - how to?

Posted by Pico Florin <pi...@yahoo.co.uk>.
Hi!
   Thank you Kelly for your quick response! 
  I would like to ask you if there is any example with the 2 solutions that you gave me. 
   In the documentation recommended in the solution 1,  it is said that:
  " Once enabled this feature adds the JMS property JMSXUserID to each JMS message so that a consumer can know exactly who the sender was using the broker's authentication policy."
  I was trying to do something like this (on the client side):  ((ObjectMessage)message).setJMSXUserIDProperty() but I didn't found. 
   Then I was thinking to ((ObjectMessage)message).setObjectProperty()
  but what string property should I use to set  up this JMSXUserID?
  
  
  For the socond solution, I have no idea how to implement this. I have  no knowlege regarding the SSL connection, maybe a good example for both  server and client will reveal me how it realy works.
    Thank you,
     Florin

Kelly Campbell <ke...@gmail.com> wrote:  Hi Pico,

There is a feature where ActiveMQ can set the JMSXUserId header to the
userid of the sender of the message. You can use that on the server side to
determine what client is requesting it. The only issue with this is that the
server has to trust the broker. Does that work for what you need?
Documentation is here: http://activemq.org/site/jmsxuserid.html

There's also now the option to authenticate and secure a connection using
client SSL certificates in the 4.1 codebase. I'm working on some changes in
my spare time to allow increased flexibility of this so you can do things
like have the JMS client check the broker's certificate as well to ensure it
is as expected.

-Kelly

On 10/10/06, Pico Florin 
 wrote:
>
> Hi!
>     I have a P2P architecture where many clients send messages to  JMS
> server installed on a web server (Resin). The messages that the  client send
> to be persisted in DB installed on on the server side.  Before that
> operation the client should be authenticated against this  database
> installed on the server side. The client should send its  credentials in
> order to be authorized.
>     Now the problem:
>      I have seen that in the JMS API exists a method:
>   ConnectionFactory.createConnection(String userName, String password)
>   but I think that these credentials are for the service installed on
> the  server in order to be connected to it, but I am afraid I cannot use
> the  client's credentials for the application.(E.g. user1/pw1 authorized
> to  be connected to the JMS server and use the service,
> user2/pw2  authorized to be connected to the JMS server and use the service,
> etc).  These credentials are also on the DB server installed on the
> server.  The question is: am I wrong with this opinion or not? If yes,
> what  should I write in the server side in order to accept many clients to
> be  connected?
>       Another solution is to set up a object property in header  of the
> message, where I put my credentials encrypted. But is that ok(is  this a
> real solution)?
>    Any ideas and suggestions are appreciated.
>     Florin
>
>
>
>
> ---------------------------------
> Yahoo! Photos – NEW, now offering a quality print service from just 8p a
> photo.
>



 		
---------------------------------
 All new Yahoo! Mail "The new Interface is stunning in its simplicity and ease of use." - PC Magazine

Re: Security - how to?

Posted by Kelly Campbell <ke...@gmail.com>.
Hi Pico,

There is a feature where ActiveMQ can set the JMSXUserId header to the
userid of the sender of the message. You can use that on the server side to
determine what client is requesting it. The only issue with this is that the
server has to trust the broker. Does that work for what you need?
Documentation is here: http://activemq.org/site/jmsxuserid.html

There's also now the option to authenticate and secure a connection using
client SSL certificates in the 4.1 codebase. I'm working on some changes in
my spare time to allow increased flexibility of this so you can do things
like have the JMS client check the broker's certificate as well to ensure it
is as expected.

-Kelly

On 10/10/06, Pico Florin <pi...@yahoo.co.uk> wrote:
>
> Hi!
>     I have a P2P architecture where many clients send messages to  JMS
> server installed on a web server (Resin). The messages that the  client send
> to be persisted in DB installed on on the server side.  Before that
> operation the client should be authenticated against this  database
> installed on the server side. The client should send its  credentials in
> order to be authorized.
>     Now the problem:
>      I have seen that in the JMS API exists a method:
>   ConnectionFactory.createConnection(String userName, String password)
>   but I think that these credentials are for the service installed on
> the  server in order to be connected to it, but I am afraid I cannot use
> the  client's credentials for the application.(E.g. user1/pw1 authorized
> to  be connected to the JMS server and use the service,
> user2/pw2  authorized to be connected to the JMS server and use the service,
> etc).  These credentials are also on the DB server installed on the
> server.  The question is: am I wrong with this opinion or not? If yes,
> what  should I write in the server side in order to accept many clients to
> be  connected?
>       Another solution is to set up a object property in header  of the
> message, where I put my credentials encrypted. But is that ok(is  this a
> real solution)?
>    Any ideas and suggestions are appreciated.
>     Florin
>
>
>
>
> ---------------------------------
> Yahoo! Photos – NEW, now offering a quality print service from just 8p a
> photo.
>

Re: Using ActiveMQ from .NET compact framework

Posted by Oleg Deribas <th...@td.selfip.net>.
Hello,

James Strachan said the following on 10.10.2006 19:50:

>> Should I create issue regarding compact framework compatibility in jira?
> 
> Yes please

Done: http://issues.apache.org/activemq/browse/AMQ-969

-- 
Oleg


Re: Using ActiveMQ from .NET compact framework

Posted by James Strachan <ja...@gmail.com>.
On 10/10/06, Oleg Deribas <th...@td.selfip.net> wrote:
> Hello,
>
> James Strachan said the following on 10.10.2006 15:38:
>
> >> It seems that this mailing list doesn't accept attachments... :-(
> >
> > yeah - though you can attach stuff to the website wiki or JIRA
>
> Should I create issue regarding compact framework compatibility in jira?

Yes please


>
> >> >> with activemq project - it uses Monitor.PulseAll and Monitor.Wait
> >> >> methods not supported by compact framework. I'll try to investigate if
> >> >> it is possible to avoid these methods usage.
> >> >
> >> > I wonder if there's an alternative way of doing these kinds of
> >> > monitors / semaphores in .Net?
> >>
> >> Yes. Possibly it could be done just with plain locks. I'm currently
> >> trying to do so.
> >
> > Note that we use lock a fair bit, we're using Monitor for inter-thread
> > notifications rather than mutually exclusive locking. Or idd I
> > misunderstand you there?
>
> I think it is possible to replace Monitor.Wait(semaphore, maxWait) with:
>
> Monitor.Exit(semaphore);
> autoResetEvent.WaitOne(maxWait, false);
> Monitor.Enter(semaphore);
>
> and Monitor.PulseAll(semaphore) with:
>
> Monitor.Exit(semaphore);
> autoResetEvent.Set();
> Monitor.Enter(semaphore);
>
> but maybe, class which uses AutoResetEvent should implement IDisposable
> interface and call autoResetEvent.Close() in Dispose method.

Great thanks!

-- 

James
-------
http://radio.weblogs.com/0112098/

Re: Using ActiveMQ from .NET compact framework

Posted by Oleg Deribas <th...@td.selfip.net>.
Hello,

James Strachan said the following on 10.10.2006 15:38:

>> It seems that this mailing list doesn't accept attachments... :-(
> 
> yeah - though you can attach stuff to the website wiki or JIRA

Should I create issue regarding compact framework compatibility in jira?

>> >> NMS project building is fine, but there are small problems
>> >> with activemq project - it uses Monitor.PulseAll and Monitor.Wait
>> >> methods not supported by compact framework. I'll try to investigate if
>> >> it is possible to avoid these methods usage.
>> >
>> > I wonder if there's an alternative way of doing these kinds of
>> > monitors / semaphores in .Net?
>>
>> Yes. Possibly it could be done just with plain locks. I'm currently
>> trying to do so.
> 
> Note that we use lock a fair bit, we're using Monitor for inter-thread
> notifications rather than mutually exclusive locking. Or idd I
> misunderstand you there?

I think it is possible to replace Monitor.Wait(semaphore, maxWait) with:

Monitor.Exit(semaphore);
autoResetEvent.WaitOne(maxWait, false);
Monitor.Enter(semaphore);

and Monitor.PulseAll(semaphore) with:

Monitor.Exit(semaphore);
autoResetEvent.Set();
Monitor.Enter(semaphore);

but maybe, class which uses AutoResetEvent should implement IDisposable
interface and call autoResetEvent.Close() in Dispose method.

-- 
Oleg


Security - how to?

Posted by Pico Florin <pi...@yahoo.co.uk>.
Hi!
    I have a P2P architecture where many clients send messages to  JMS server installed on a web server (Resin). The messages that the  client send to be persisted in DB installed on on the server side.  Before that operation the client should be authenticated against this  database installed on the server side. The client should send its  credentials in order to be authorized.
    Now the problem:
     I have seen that in the JMS API exists a method:
  ConnectionFactory.createConnection(String userName, String password)
  but I think that these credentials are for the service installed on the  server in order to be connected to it, but I am afraid I cannot use the  client's credentials for the application.(E.g. user1/pw1 authorized to  be connected to the JMS server and use the service, user2/pw2  authorized to be connected to the JMS server and use the service, etc).  These credentials are also on the DB server installed on the server.  The question is: am I wrong with this opinion or not? If yes, what  should I write in the server side in order to accept many clients to be  connected?
      Another solution is to set up a object property in header  of the message, where I put my credentials encrypted. But is that ok(is  this a real solution)?
   Any ideas and suggestions are appreciated.
    Florin
     
  
  
 		
---------------------------------
Yahoo! Photos – NEW, now offering a quality print service from just 8p a photo.

Re: Using ActiveMQ from .NET compact framework

Posted by James Strachan <ja...@gmail.com>.
On 10/9/06, Oleg Deribas <th...@td.selfip.net> wrote:
> Hello,
>
> James Strachan said the following on 06.10.2006 20:49:
>
> >> I've tried it. I've created two additional projects (attached) for the
> >> solution.
>
> It seems that this mailing list doesn't accept attachments... :-(

yeah - though you can attach stuff to the website wiki or JIRA


> >> NMS project building is fine, but there are small problems
> >> with activemq project - it uses Monitor.PulseAll and Monitor.Wait
> >> methods not supported by compact framework. I'll try to investigate if
> >> it is possible to avoid these methods usage.
> >
> > I wonder if there's an alternative way of doing these kinds of
> > monitors / semaphores in .Net?
>
> Yes. Possibly it could be done just with plain locks. I'm currently
> trying to do so.

Note that we use lock a fair bit, we're using Monitor for inter-thread
notifications rather than mutually exclusive locking. Or idd I
misunderstand you there?



> There is also problem with LoggingTransport - it uses
> System.Diagnostics.Trace.WriteLine method which is also not supported in
> compact framework. I think it could be replaced with log4net.

Yeah


> > BTW does .Net compact framework support threads?
>
> Yes. But not all methods are supported.
>
> >> And I think payload compression is still a feature that has not yet
> >> been implemented in the .NET client implementation.
> >>
> >> But payload compression is the part of protocol specification?
> >
> > Yes - using GZip
>
> So it could be implemented using System.IO.Compression for .NET 2.0
> And this namespace isn't supported in compact framework and .NET 1.1 -
> so SharpZipLib could be used instead...

Cool thanks for the heads up

-- 

James
-------
http://radio.weblogs.com/0112098/

Re: Using ActiveMQ from .NET compact framework

Posted by Hiram Chirino <hi...@hiramchirino.com>.
BTW.. if we can have platform specific Trace transports.  At run time we
could detect what is supported and use the appropriate transport.  In a way,
the Transport interface is already acting as your adaptor.

On 10/12/06, Rob Lugt <ro...@cheynecapital.com> wrote:
>
>
>
> Oleg Deribas-5 wrote:
> >
> > It would be nice to have possibility to use log4net from this static
> > Trace class. Something like:
> >
> > #if LOG4NET
> >   // use log4net for output
> > #else
> >   // use internal tracing routines
> > #endif
> >
>
> I agree that it should be simple to plug a Log4Net logger into the Trace
> class, but I'm not sure that conditional compilation would be the most
> effective way to do this.  I'm concerned this may complicate the project
> files and it's possible (if unlikely) that a client would want to modify
> this at runtime.  Another way to implement this could be in the form of an
> Observer or an Adaptor pattern.  The Observer pattern (via a delegate)
> would
> be appropriate if we wanted to facilitate multiple Trace destinations (e.g
> .
> Log4Net and Diagnostics.Trace) but this may be overkill (esp. as Log4Net
> already provides this) and less efficient.  Perhaps a simple Adaptor is
> what's needed.
>
> I need improved tracing right now, so I'll raise a Jira and upload an
> example implementation.
>
>
>
> --
> View this message in context:
> http://www.nabble.com/Using-ActiveMQ-from-.NET-compact-framework-tf2394775.html#a6776248
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 
Regards,
Hiram

Blog: http://hiramchirino.com

Re: Using ActiveMQ from .NET compact framework

Posted by Rob Lugt <ro...@cheynecapital.com>.

Oleg Deribas-5 wrote:
> 
> It would be nice to have possibility to use log4net from this static
> Trace class. Something like:
> 
> #if LOG4NET
>   // use log4net for output
> #else
>   // use internal tracing routines
> #endif
> 

I agree that it should be simple to plug a Log4Net logger into the Trace
class, but I'm not sure that conditional compilation would be the most
effective way to do this.  I'm concerned this may complicate the project
files and it's possible (if unlikely) that a client would want to modify
this at runtime.  Another way to implement this could be in the form of an
Observer or an Adaptor pattern.  The Observer pattern (via a delegate) would
be appropriate if we wanted to facilitate multiple Trace destinations (e.g.
Log4Net and Diagnostics.Trace) but this may be overkill (esp. as Log4Net
already provides this) and less efficient.  Perhaps a simple Adaptor is
what's needed.

I need improved tracing right now, so I'll raise a Jira and upload an
example implementation.  



-- 
View this message in context: http://www.nabble.com/Using-ActiveMQ-from-.NET-compact-framework-tf2394775.html#a6776248
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Using ActiveMQ from .NET compact framework

Posted by Oleg Deribas <th...@td.selfip.net>.
Hello,

Rob Lugt said the following on 12.10.2006 12:19:

> I think this leaves us with two possible options:-
> 1) use Log4Net
> 2) create a static Trace class within the ActiveMQ namespace and pass all
> trace calls through this.  This could then be a central place where trace
> events are dispatched to the desired logging system.
> 
> (1) has the advantage that log4net is good and we aren't re-inventing any
> wheels, but has the disadvantage that we are creating a build dependency on
> Log4Net - which almost certainly isn't going to be currently used by all the
> projects targeting AMQ

Another advantage here is that Log4Net is sister apache incubation
project ;-)

> (2) has the advantage that we are creating no dependencies, but we are
> re-inventing a Trace interface.

It would be nice to have possibility to use log4net from this static
Trace class. Something like:

#if LOG4NET
  // use log4net for output
#else
  // use internal tracing routines
#endif

-- 
Oleg


Re: Using ActiveMQ from .NET compact framework

Posted by Rob Lugt <ro...@cheynecapital.com>.

Rob Lugt wrote:
> 
>>There is also problem with LoggingTransport - it uses
>>System.Diagnostics.Trace.WriteLine method which is also not supported in
>>compact framework. I think it could be replaced with log4net.
> 
> I'm surprised System.Diagnostics.Trace is not supported in the compact
> framework.  I don't use the CF, but this document from MS indicates it is
> supported:-
> http://msdn2.microsoft.com/en-us/library/system.diagnostics.trace.aspx
> 
> I think Log4net is a great tool, but in a conversation I had with James S
> he stated a desire to minimise the dependencies on other libraries - which
> I agree with.  If Trace is supported, then it probably won't be hard to
> register a Listener which simply passes the trace events on to a Log4Net
> log - but this will be under the control of the application rather than
> the activemq-dotnet library.
> 

A quick Google just answered my question about Trace support (it isn't):-
http://logging.apache.org/log4net/release/sdk/log4net.Appender.TraceAppender.html

I think this leaves us with two possible options:-
1) use Log4Net
2) create a static Trace class within the ActiveMQ namespace and pass all
trace calls through this.  This could then be a central place where trace
events are dispatched to the desired logging system.

(1) has the advantage that log4net is good and we aren't re-inventing any
wheels, but has the disadvantage that we are creating a build dependency on
Log4Net - which almost certainly isn't going to be currently used by all the
projects targeting AMQ
(2) has the advantage that we are creating no dependencies, but we are
re-inventing a Trace interface.

Of the two, I think I favour (2).  If everyone is in agreement I'm prepared
to make this a global change today (also replacing code where
activemq-dotnet currently writes to the Console.

Regards
~Rob
(2)

-- 
View this message in context: http://www.nabble.com/Using-ActiveMQ-from-.NET-compact-framework-tf2394775.html#a6772781
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Using ActiveMQ from .NET compact framework

Posted by Rob Lugt <ro...@cheynecapital.com>.
>There is also problem with LoggingTransport - it uses
>System.Diagnostics.Trace.WriteLine method which is also not supported in
>compact framework. I think it could be replaced with log4net.

I'm surprised System.Diagnostics.Trace is not supported in the compact
framework.  I don't use the CF, but this document from MS indicates it is
supported:-
http://msdn2.microsoft.com/en-us/library/system.diagnostics.trace.aspx

I think Log4net is a great tool, but in a conversation I had with James S he
stated a desire to minimise the dependencies on other libraries - which I
agree with.  If Trace is supported, then it probably won't be hard to
register a Listener which simply passes the trace events on to a Log4Net log
- but this will be under the control of the application rather than the
activemq-dotnet library.

Regards
~Rob Lugt
-- 
View this message in context: http://www.nabble.com/Using-ActiveMQ-from-.NET-compact-framework-tf2394775.html#a6772641
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Using ActiveMQ from .NET compact framework

Posted by Oleg Deribas <th...@td.selfip.net>.
Hello,

James Strachan said the following on 06.10.2006 20:49:

>> I've tried it. I've created two additional projects (attached) for the
>> solution. 

It seems that this mailing list doesn't accept attachments... :-(

>> NMS project building is fine, but there are small problems
>> with activemq project - it uses Monitor.PulseAll and Monitor.Wait
>> methods not supported by compact framework. I'll try to investigate if
>> it is possible to avoid these methods usage.
> 
> I wonder if there's an alternative way of doing these kinds of
> monitors / semaphores in .Net? 

Yes. Possibly it could be done just with plain locks. I'm currently
trying to do so.

There is also problem with LoggingTransport - it uses
System.Diagnostics.Trace.WriteLine method which is also not supported in
compact framework. I think it could be replaced with log4net.

> BTW does .Net compact framework support threads?

Yes. But not all methods are supported.

>> And I think payload compression is still a feature that has not yet
>> been implemented in the .NET client implementation.
>>
>> But payload compression is the part of protocol specification?
> 
> Yes - using GZip

So it could be implemented using System.IO.Compression for .NET 2.0
And this namespace isn't supported in compact framework and .NET 1.1 -
so SharpZipLib could be used instead...

-- 
Oleg


Re: Using ActiveMQ from .NET compact framework

Posted by James Strachan <ja...@gmail.com>.
On 10/7/06, Fredrik Jonson <fr...@myrealbox.com> wrote:
> James Strachan wrote:
>
> >  I wonder if there's an alternative way of doing these kinds of
> >  monitors / semaphores in .Net? BTW does .Net compact framework support
> >  threads?
>
> Yes, there is thread support in the compact framework.
>
> And I believe there are work arounds for monitor/semaphore too, though
> I'm just a cf-newbie myself sofar, so I can't give you a example.

Great. I'd be good if there was one way of doing it on both platforms
- but worse case we could wrap up our use of the 2 approaches behind a
little facade and allow the thread synchronization to be switched

-- 

James
-------
http://radio.weblogs.com/0112098/

Re: Using ActiveMQ from .NET compact framework

Posted by Fredrik Jonson <fr...@myrealbox.com>.
James Strachan wrote:
 
>  I wonder if there's an alternative way of doing these kinds of
>  monitors / semaphores in .Net? BTW does .Net compact framework support
>  threads?

Yes, there is thread support in the compact framework. 

And I believe there are work arounds for monitor/semaphore too, though 
I'm just a cf-newbie myself sofar, so I can't give you a example.

-- 
Fredrik Jonson


Re: Using ActiveMQ from .NET compact framework

Posted by James Strachan <ja...@gmail.com>.
On 10/6/06, Oleg Deribas <th...@td.selfip.net> wrote:
> Hello,
>
> Hiram Chirino said the following on 06.10.2006 19:47:
>
> > I don't see why it would not work.. Why don't you setup it up and let us
> > know how it goes.
>
> I've tried it. I've created two additional projects (attached) for the
> solution. NMS project building is fine, but there are small problems
> with activemq project - it uses Monitor.PulseAll and Monitor.Wait
> methods not supported by compact framework. I'll try to investigate if
> it is possible to avoid these methods usage.

I wonder if there's an alternative way of doing these kinds of
monitors / semaphores in .Net? BTW does .Net compact framework support
threads?


> >> And I have another question - how much traffic required for one simple
> >> message (like event notification)? I will use GPRS connection from PDA,
> >> so traffic is not cheap...
> >
> > We use lots of tricks in openwire to keep the message sizes as small as
> > possible but that does not deal with the message content compression.
>
> I mean just what overhead of wrapping data into messages. For example,
> for empty message - what is the smallest possible message size?

Its probably simplest to send an empty message and see how many bytes it uses :)



> > And I think payload compression is still a feature that has not yet been
> > implemented in the .NET client implementation.
>
> But payload compression is the part of protocol specification?

Yes - using GZip

> Anyway compression could be implemented on the application level.

Sure - though its easy to support in openwire

-- 

James
-------
http://radio.weblogs.com/0112098/

Re: Using ActiveMQ from .NET compact framework

Posted by Oleg Deribas <th...@td.selfip.net>.
Hello,

Hiram Chirino said the following on 06.10.2006 19:47:

> I don't see why it would not work.. Why don't you setup it up and let us
> know how it goes.

I've tried it. I've created two additional projects (attached) for the
solution. NMS project building is fine, but there are small problems
with activemq project - it uses Monitor.PulseAll and Monitor.Wait
methods not supported by compact framework. I'll try to investigate if
it is possible to avoid these methods usage.

>> And I have another question - how much traffic required for one simple
>> message (like event notification)? I will use GPRS connection from PDA,
>> so traffic is not cheap...
> 
> We use lots of tricks in openwire to keep the message sizes as small as
> possible but that does not deal with the message content compression. 

I mean just what overhead of wrapping data into messages. For example,
for empty message - what is the smallest possible message size?

> And I think payload compression is still a feature that has not yet been
> implemented in the .NET client implementation.

But payload compression is the part of protocol specification?
Anyway compression could be implemented on the application level.

-- 
Oleg

Re: Using ActiveMQ from .NET compact framework

Posted by Hiram Chirino <hi...@hiramchirino.com>.
I don't see why it would not work.. Why don't you setup it up and let us
know how it goes.

On 10/6/06, Oleg Deribas <th...@td.selfip.net> wrote:
>
> Hello,
>
> I want to try using ActiveMQ from PDA with .NET compact framework.
> Where should I start? I see that there is not project for CF.NET in NMS
> solution. So I could try to create it. Is it possible?
>
> And I have another question - how much traffic required for one simple
> message (like event notification)? I will use GPRS connection from PDA,
> so traffic is not cheap...



We use lots of tricks in openwire to keep the message sizes as small as
possible but that does not deal with the message content compression.  And I
think payload compression is still a feature that has not yet been
implemented in the .NET client implementation.


--
> Oleg
>
>


-- 
Regards,
Hiram

Blog: http://hiramchirino.com