Re: Restrictions in uri supports for cpp client?

2007-05-18 Thread cppUser

Thanks a lot Nate!



nmittler wrote:
 
 Discovery is not currently supported by activemq-cpp.  You can see the
 list
 of options here:
 
 http://activemq.apache.org/cms/configuring.html
 
 Regards,
 Nate
 
 On 5/16/07, cppUser [EMAIL PROTECTED] wrote:


 Hi All,

 I tried to use the url options mentioned in the following link, but was
 only
 successful with tcp and io(partially only).

 http://activemq.apache.org/uri-protocols.html

 They all fail. For eg

 list:tcp://10.234.88.110:61616??wireFormat=openwire,tcp://localhost:61616?wireFormat=openwire
 OR discovery:(multicast://default)?wireFormat=openwire etc. The only
 perfectly working url is tcp://HOST:PORT?wireFormat=openwire.

 Could somebody throw some light how to use them from c++ client? Iam
 particularly interested in either discovering an availble broker or
 chosing
 from a list i give. Any help on this would be appreciated.

 Thanks!
 --
 View this message in context:
 http://www.nabble.com/Restrictions-in-uri-supports-for-cpp-client--tf3762645s2354.html#a10635911
 Sent from the ActiveMQ - User mailing list archive at Nabble.com.


 
 

-- 
View this message in context: 
http://www.nabble.com/Restrictions-in-uri-supports-for-cpp-client--tf3762645s2354.html#a10677275
Sent from the ActiveMQ - User mailing list archive at Nabble.com.



Re: Cleaning the database

2007-05-18 Thread James Strachan

On 5/17/07, Jim Alateras [EMAIL PROTECTED] wrote:

What is the best way to clear the database that stores persistent
messages? I am using an embedded broker and the mysql database, which
is shared with other applications.


You can purge individual queues via JMX; or just drop  recreate the
database in mysql :)

--
James
---
http://macstrac.blogspot.com/


Re: Shared File System Master Slave with OCFS

2007-05-18 Thread James Strachan

On 5/18/07, James Strachan [EMAIL PROTECTED] wrote:

On 5/17/07, felipera [EMAIL PROTECTED] wrote:
 Hi everyone,

 I am trying to setup two MQ Servers (4.1.1), sharing the same data directory
 (I tried Derby and Kaha), on top of OCFS, but the locking doesn't seem to be
 working. It works fine when both MQs are running on the same server (still
 using OCFS). I see the second MQ waiting for the lock to be released
 (Journal is locked... waiting 10 seconds for the journal to be unlocked.).
 That's why I am not sure if it's a OCFS issue. But when I run each MQ in
 separate boxes (still sharing the same data directory using OCFS) it doesn't
 work, they both start successfully.

This is the OCFS you're talking about right?
http://en.wikipedia.org/wiki/OCFS2


Actually OCFS2 seems more like a real distributed file system for
general purpose use; the OCFS looks more specifically for using to
host oracle data tables. Am wondering how good the file locking is on
OCFS? Certainly its clear the mutex file locking from Java isn't
supported on OCFS.

--
James
---
http://macstrac.blogspot.com/


Re: Shared File System Master Slave with OCFS

2007-05-18 Thread James Strachan

On 5/17/07, felipera [EMAIL PROTECTED] wrote:

Hi everyone,

I am trying to setup two MQ Servers (4.1.1), sharing the same data directory
(I tried Derby and Kaha), on top of OCFS, but the locking doesn't seem to be
working. It works fine when both MQs are running on the same server (still
using OCFS). I see the second MQ waiting for the lock to be released
(Journal is locked... waiting 10 seconds for the journal to be unlocked.).
That's why I am not sure if it's a OCFS issue. But when I run each MQ in
separate boxes (still sharing the same data directory using OCFS) it doesn't
work, they both start successfully.


This is the OCFS you're talking about right?
http://en.wikipedia.org/wiki/OCFS2

I guess the file locking isn't working from Java. I wonder how to use
file locking properly on OCFS.


I am thinking about using a network of brokers, since I don't know what else
to try.


If you want clustering  replicated message stores you could try one
of the other Master/Slave implementations.
http://activemq.apache.org/masterslave.html

FWIW Networks of Brokers is for store and forward of messages only;
messages are never replicated in multiple locations with networks of
brokers.

--
James
---
http://macstrac.blogspot.com/


Re: How to define properties for Topics and Queues

2007-05-18 Thread James Strachan

On 5/18/07, MarkusJ [EMAIL PROTECTED] wrote:




James.Strachan wrote:

 On 5/18/07, JohnF [EMAIL PROTECTED] wrote:

 Hello,

 I tried to use JNDI and the lookup() methode to get a topic for a client.

 properties = new HashtableString, String();

 properties.put(Context.INITIAL_CONTEXT_FACTORY,
 org.apache.activemq.jndi.ActiveMQInitialContextFactory);

 Context context = new InitialContext(properties);

 ConnectionFactory connectionFactory =
 (ConnectionFactory)context.lookup(ConnectionFactory);

 properties.put(Context.PROVIDER_URL,
 tcp://localhost:61616);

Topic destination = (Topic)context.lookup(NAME_OF_TOPIC);

 It failed and I got the NameNotFoundException. If I added the following
 line, it does work:

 properties.put(topic.NAME_OF_TOPIC, NAME_OF_TOPIC);

 I do not want to use a property file that is stored in the classpath. How
 do
 I have to configure a topic or a queue to avoid defining the Name of the
 destination for JNDI in the code of the client?

 You could load the properties file from some remote resource (file
 server, web server, database). Or you could use some other JNDI
 provider if you want (Sun's or one from your J2EE container) - which
 amounts to the same thing but adds tons of work usually.

 Or use spring and put the creation of the destinations in your
 spring.xml. Or just ditch JNDI/spring entirely and use the JMS API to
 create the topics you want?

 --
 James
 ---
 http://macstrac.blogspot.com/



Hello James,

thank you for answer. My hope was, that I can use the topic element of the
configuration file. I have found the description of the topic element  in
the reference page . The topic element has got one property called
'properties'. The description says: 'Get the properties from this instance
for storing in JNDI.'.

Is ist not possible to define the JNDI name of the topic at this place? How
do I have to do it(the format of the entry)?


No. You put object into JNDI; so you can create any JNDI provider and
add ActiveMQTopic and ActiveMQQueue objects to JNDI - in any way you
like. Though a Topic doesn't have a magic way to auto-discover a JNDI
provider and add itself automatically.

I don't really follow your reasoning; there's already a properties
file (the jndi.properties file) which can create destinations 
register them in JNDI - why don't you wanna use it?

--
James
---
http://macstrac.blogspot.com/


Re: How to define properties for Topics and Queues

2007-05-18 Thread MarkusJ



James.Strachan wrote:
 
 On 5/18/07, JohnF [EMAIL PROTECTED] wrote:

 Hello,

 I tried to use JNDI and the lookup() methode to get a topic for a client.

 properties = new HashtableString, String();

 properties.put(Context.INITIAL_CONTEXT_FACTORY,
 org.apache.activemq.jndi.ActiveMQInitialContextFactory);

 Context context = new InitialContext(properties);

 ConnectionFactory connectionFactory =
 (ConnectionFactory)context.lookup(ConnectionFactory);

 properties.put(Context.PROVIDER_URL,
 tcp://localhost:61616);

Topic destination = (Topic)context.lookup(NAME_OF_TOPIC);

 It failed and I got the NameNotFoundException. If I added the following
 line, it does work:

 properties.put(topic.NAME_OF_TOPIC, NAME_OF_TOPIC);

 I do not want to use a property file that is stored in the classpath. How
 do
 I have to configure a topic or a queue to avoid defining the Name of the
 destination for JNDI in the code of the client?
 
 You could load the properties file from some remote resource (file
 server, web server, database). Or you could use some other JNDI
 provider if you want (Sun's or one from your J2EE container) - which
 amounts to the same thing but adds tons of work usually.
 
 Or use spring and put the creation of the destinations in your
 spring.xml. Or just ditch JNDI/spring entirely and use the JMS API to
 create the topics you want?
 
 -- 
 James
 ---
 http://macstrac.blogspot.com/
 
 

Hello James,

thank you for answer. My hope was, that I can use the topic element of the
configuration file. I have found the description of the topic element  in
the reference page . The topic element has got one property called
'properties'. The description says: 'Get the properties from this instance
for storing in JNDI.'.

Is ist not possible to define the JNDI name of the topic at this place? How
do I have to do it(the format of the entry)?

Regards,
MarkusF
-- 
View this message in context: 
http://www.nabble.com/How-to-configure-topics-and-queues-for-using-with-JNDI%28_without_-a-jndi.properties-file%29-tf3775859s2354.html#a10678971
Sent from the ActiveMQ - User mailing list archive at Nabble.com.



Re: Failover and .Net

2007-05-18 Thread James Strachan

On 5/10/07, Bill.E [EMAIL PROTECTED] wrote:


Hi All,

I am trying to use the failover protocol in a .Net application written using
ActiveMQ.dll and NMS.dll ( not spring )

Everything is fine with the code supporting transactional session messages
and all.  The question I have is when attempting to use a url for the
failover protocol I am getting errors related to syntax of the url

failover:(tcp://10.10.209.92:61616,tcp://10.10.209.95:61616)

is the failover url i am attempting.

anyone succeed at this in .Net?


The failover protocol has not yet been implemented for .net.

--
James
---
http://macstrac.blogspot.com/


Re: question about consumer.prority meaning

2007-05-18 Thread James Strachan

On 5/14/07, Dominique DE VITO [EMAIL PROTECTED] wrote:

Hi,

I am wondering about JMS consumer.prority meaning (mentionned in
http://activemq.apache.org/consumer-priority.html )

- is it a priority defining concurrency between possible consumers of
the *same* messages ?

OR

- is it a priority defining (CPU) concurrency between all the consumers ?


Consumers with higher priority will get messages first (up until their
prefetch buffers fill). So its used to decide how messages are
dispatched on queues

--
James
---
http://macstrac.blogspot.com/


Licensing and Porting Issue for the CMS (ActiveMQ-CPP) on Visual Studio 6 from Visual Studio 8

2007-05-18 Thread Pravin Kundal

Licensing and Porting Issue for the CMS (ActiveMQ-CPP) on Visual Studio 6
from Visual Studio 8

I have downloaded activemq-cpp-2.0.1-src (i.e. CMS 2.0.1) from
http://activemq.apache.org/cms/download.html
It is provided with vs2005-build (Visual Studio 8). 
Now, as our project is in vs2003, I am trying to build (port) it in Visual
Studio 6, but I am getting following errors, which means I will need to make
some modifications like adding some typedefs or some fix to get around some
‘type’ issues that causes compiler errors under Visual Studio 6.

Snippet of few Errors in Visual Studio 6

Configuration: Consumer - Win32
Debug
Compiling...
main.cpp
c:\assigned_task\prototype\prototype\main\activemq\exceptions\activemqexception.h(107)
: error C2555: 'activemq::exceptions::ActiveMQException::clone' : overriding
virtual function differs from 'cms::CMSException::clone' only by return type
or calli
ng convention
c:\assigned_task\prototype\prototype\main\cms\cmsexception.h(33) :
see declaration of 'CMSException'
c:\assigned_task\prototype\prototype\main\cms\deliverymode.h(37) : error
C2252: 'PERSISTENT' : pure specifier can only be specified for functions
c:\assigned_task\prototype\prototype\main\cms\deliverymode.h(38) : error
C2258: illegal pure syntax, must be '= 0'
c:\assigned_task\prototype\prototype\main\cms\deliverymode.h(38) : error
C2252: 'NON_PERSISTENT' : pure specifier can only be specified for functions
c:\assigned_task\prototype\prototype\main\cms\message.h(154) : error C2632:
'long' followed by 'long' is illegal
.
.
.
c:\assigned_task\prototype\prototype\main\cms\bytesmessage.h(54) : error
C2039: 'size_t' : is not a member of 'std'
c:\assigned_task\prototype\prototype\main\cms\bytesmessage.h(112) : error
C2039: 'size_t' : is not a member of 'std'
c:\assigned_task\prototype\prototype\main\cms\bytesmessage.h(149) : error
C2039: 'size_t' : is not a member of 'std'


Now as CMS (ActiveMQ-CPP) is the Apache 2.0 licensed, so do I need to
release it back to the community, the porting changes that I make to the
current CMS library which is Visual Studio 2005 build, OR I wont be able to
make the changes OR what other licensing issues may arise in our case.
PLEASE CLERIFY. 

-- 
View this message in context: 
http://www.nabble.com/Licensing-and-Porting-Issue-for-the-CMS-%28ActiveMQ-CPP%29-on-Visual-Studio-6-from-Visual-Studio-8-tf3777279s2354.html#a10680894
Sent from the ActiveMQ - User mailing list archive at Nabble.com.



Re: Licensing and Porting Issue for the CMS (ActiveMQ-CPP) on Visual Studio 6 from Visual Studio 8

2007-05-18 Thread Albert Strasheim
Hello

This isn't so much about the licensing, but you might want to 
reconsider backporting AMQCPP to VS6. That compiler really isn't your 
friend.

I'm not 100% certain if this will work (I'm mainly concerned about
multiple runtime memory allocation issues) and whether this is feasible 
will depend on your application, but maybe we should rather spend some 
time getting AMQCPP to build as a DLL with VC++ 2005 Express (which is 
free to use, even for commercial applications) which you can then link 
into your VS6-compiled applications.

I have a bit of experience turning a static library into a DLL, and 
some of the Linux folks have also mentioned that they want a shared 
library, so maybe it's time to take the plunge.

Regards,

Albert

On Fri, 18 May 2007, Pravin Kundal wrote:

 Licensing and Porting Issue for the CMS (ActiveMQ-CPP) on Visual Studio 6
 from Visual Studio 8
   
 I have downloaded activemq-cpp-2.0.1-src (i.e. CMS 2.0.1) from
 http://activemq.apache.org/cms/download.html
 It is provided with vs2005-build (Visual Studio 8). 
 Now, as our project is in vs2003, I am trying to build (port) it in Visual
 Studio 6, but I am getting following errors, which means I will need to make
 some modifications like adding some typedefs or some fix to get around some
 ???type??? issues that causes compiler errors under Visual Studio 6.


Re: Messages for disconnected client

2007-05-18 Thread Gustavo Lanna

Huum !! Thank you... I will try this !!



David Budworth-3 wrote:
 
 temp queues are discarded when the creating session closes (goes away,
 crashes etc)
 
 also, if you want message to not be received when a client isn't there,
 you
 could always use topics
 
 
 On 5/17/07, Gustavo Lanna [EMAIL PROTECTED] wrote:


 Right, but if client doesn't connect and others services send him
 messages,
 his queue grows and the server crashes. I wish the ActiveMQ server to
 remove
 or discard the messages !!


 James.Strachan wrote:
 
  You could use a temporary queue for each client; then all messages are
  removed when the client disconnects
 
  On 5/17/07, Gustavo Lanna [EMAIL PROTECTED] wrote:
 
  Hi,
 
  How to configure ActiveMQ to discard/remove messages for disconnected
  clients. If I send a message to queue that has no clients listening,
 when
  a
  client connect to ActiveMQ his receive a message that I sent. I would
  like
  that the ActiveMQ delete the message if there is not client
  listening/connected.
 
  Thanks.
  --
  View this message in context:
 
 http://www.nabble.com/Messages-for-disconnected-client-tf3773500s2354.html#a10669498
  Sent from the ActiveMQ - User mailing list archive at Nabble.com.
 
 
 
 
  --
  James
  ---
  http://macstrac.blogspot.com/
 
 

 --
 View this message in context:
 http://www.nabble.com/Messages-for-disconnected-client-tf3773500s2354.html#a10671885
 Sent from the ActiveMQ - User mailing list archive at Nabble.com.


 
 

-- 
View this message in context: 
http://www.nabble.com/Messages-for-disconnected-client-tf3773500s2354.html#a10680807
Sent from the ActiveMQ - User mailing list archive at Nabble.com.



RE: Licensing and Porting Issue for the CMS (ActiveMQ-CPP) on Visual Studio 6 from Visual Studio 8

2007-05-18 Thread Mittler, Nathan
Agreed! 

I've created this issue
https://issues.apache.org/activemq/browse/AMQCPP-115 to address this. 

 -Original Message-
 From: Albert Strasheim [mailto:[EMAIL PROTECTED] 
 Sent: Friday, May 18, 2007 8:19 AM
 To: users@activemq.apache.org
 Subject: Re: Licensing and Porting Issue for the CMS 
 (ActiveMQ-CPP) on Visual Studio 6 from Visual Studio 8
 
 Hello
 
 This isn't so much about the licensing, but you might want to 
 reconsider backporting AMQCPP to VS6. That compiler really 
 isn't your friend.
 
 I'm not 100% certain if this will work (I'm mainly concerned 
 about multiple runtime memory allocation issues) and whether 
 this is feasible will depend on your application, but maybe 
 we should rather spend some time getting AMQCPP to build as a 
 DLL with VC++ 2005 Express (which is free to use, even for 
 commercial applications) which you can then link into your 
 VS6-compiled applications.
 
 I have a bit of experience turning a static library into a 
 DLL, and some of the Linux folks have also mentioned that 
 they want a shared library, so maybe it's time to take the plunge.
 
 Regards,
 
 Albert
 
 On Fri, 18 May 2007, Pravin Kundal wrote:
 
  Licensing and Porting Issue for the CMS (ActiveMQ-CPP) on Visual 
  Studio 6 from Visual Studio 8
  
  I have downloaded activemq-cpp-2.0.1-src (i.e. CMS 2.0.1) from 
  http://activemq.apache.org/cms/download.html
  It is provided with vs2005-build (Visual Studio 8). 
  Now, as our project is in vs2003, I am trying to build (port) it in 
  Visual Studio 6, but I am getting following errors, which 
 means I will 
  need to make some modifications like adding some typedefs 
 or some fix 
  to get around some ???type??? issues that causes compiler 
 errors under Visual Studio 6.
 


How to create an embedded ActiveMQ broker in a Spring 2.0 app?

2007-05-18 Thread Thai Dang Vu
Hi everybody,

I'm using Spring 2.0.5 and ActiveMQ 4.1.1. I want to create an embedded
ActiveMQ broker in a Spring 2.0 app. Here is my Spring application
context:

?xml version=1.0 encoding=UTF-8?
beans xmlns=http://www.springframework.org/schema/beans;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xmlns:amq=http://activemq.org/config/1.0;
   xsi:schemaLocation=http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.org/config/1.0
http://www.ibiblio.org/maven/org.apache.activemq/xsds/activemq-core-4.1.
1.xsd
amq:broker useJmx=false persistent=false
amq:transportConnectors
amq:transportConnector

!-- How can I specify the broker URI here? --

/amq:transportConnector
/amq:transportConnectors
/amq:broker
/beans

Thanks for any of your help?

PS: could you check if I use the correct activemq xsd file?



NOTICE: This message (including any attachments) from Momentum Systems, Inc. 
contains information that is PRIVILEGED and CONFIDENTIAL.  If you are not an 
intended recipient, you are hereby notified that any dissemination of this 
message is strictly prohibited.  If you have received this message in error, 
please do not read, copy or forward this message.  Please permanently delete 
all copies and any attachments and notify the sender immediately by reply email 
or by calling our Office at 703.740.9300.


Re: Shared File System Master Slave with OCFS

2007-05-18 Thread Christopher G. Stach II
James Strachan wrote:
 On 5/18/07, James Strachan [EMAIL PROTECTED] wrote:
 On 5/17/07, felipera [EMAIL PROTECTED] wrote:
  Hi everyone,
 
  I am trying to setup two MQ Servers (4.1.1), sharing the same data
 directory
  (I tried Derby and Kaha), on top of OCFS, but the locking doesn't
 seem to be
  working. It works fine when both MQs are running on the same server
 (still
  using OCFS). I see the second MQ waiting for the lock to be released
  (Journal is locked... waiting 10 seconds for the journal to be
 unlocked.).
  That's why I am not sure if it's a OCFS issue. But when I run each
 MQ in
  separate boxes (still sharing the same data directory using OCFS) it
 doesn't
  work, they both start successfully.

 This is the OCFS you're talking about right?
 http://en.wikipedia.org/wiki/OCFS2
 
 Actually OCFS2 seems more like a real distributed file system for
 general purpose use; the OCFS looks more specifically for using to
 host oracle data tables. Am wondering how good the file locking is on
 OCFS? Certainly its clear the mutex file locking from Java isn't
 supported on OCFS.
 

OCFS2 properly supports POSIX locking semantics with fcntl.  lockf and
flock aren't supported yet.  If that's what the JVM uses under the
covers, you're out of luck.  If this is about OCFS and not OCFS2, I'm
really sorry. :)

-- 
Christopher G. Stach II


Re: Shared File System Master Slave with OCFS

2007-05-18 Thread James Strachan

On 5/18/07, Christopher G. Stach II [EMAIL PROTECTED] wrote:

James Strachan wrote:
 On 5/18/07, James Strachan [EMAIL PROTECTED] wrote:
 On 5/17/07, felipera [EMAIL PROTECTED] wrote:
  Hi everyone,
 
  I am trying to setup two MQ Servers (4.1.1), sharing the same data
 directory
  (I tried Derby and Kaha), on top of OCFS, but the locking doesn't
 seem to be
  working. It works fine when both MQs are running on the same server
 (still
  using OCFS). I see the second MQ waiting for the lock to be released
  (Journal is locked... waiting 10 seconds for the journal to be
 unlocked.).
  That's why I am not sure if it's a OCFS issue. But when I run each
 MQ in
  separate boxes (still sharing the same data directory using OCFS) it
 doesn't
  work, they both start successfully.

 This is the OCFS you're talking about right?
 http://en.wikipedia.org/wiki/OCFS2

 Actually OCFS2 seems more like a real distributed file system for
 general purpose use; the OCFS looks more specifically for using to
 host oracle data tables. Am wondering how good the file locking is on
 OCFS? Certainly its clear the mutex file locking from Java isn't
 supported on OCFS.


OCFS2 properly supports POSIX locking semantics with fcntl.  lockf and
flock aren't supported yet.  If that's what the JVM uses under the
covers, you're out of luck.  If this is about OCFS and not OCFS2, I'm
really sorry. :)


Thanks for the heads up! :)

I guess we could make the locking strategy pluggable  we could have
some implementation call the fcntl locking. e.g. maybe using Jtux

http://www.basepath.com/aup/jtux/



--
James
---
http://macstrac.blogspot.com/